//----------------------------------------------------------- // File and Version Information: // $Id$ // // Description: // Abstract Interface for residual calculation with // reference tracks // USAGE: Create this object ON MACRO LEVEL, // add all required branch names // YOU HAVE TO MAKE SURE IN YOUR IMPLEMENTATION OF // THAT THE DATA YOU NEED IS THERE! // // Environment: // Software developed for the PANDA Detector at FAIR. // // Author List: // Felix Boehmer (original author) // Sverre Doerheim (adapted to be more general) // Physik Department E18, TUM // //----------------------------------------------------------- #ifndef ABSRESCALC_HH #define ABSRESCALC_HH #include #include #include "TString.h" #include "TObject.h" class AbsRefTrackResCalc; class TpcRefResidualCollection; class TClonesArray; //TODO: Make it so that the name of the residual output branch can be //specified. The Task should then get the information from each calc //and write the TCA to the tree class AbsResCalc { friend class TpcRefTrackResidualTask; friend class AbsRefTrackResCalc; public: AbsResCalc(); ~AbsResCalc(); //should not be needed to be re-defined! //dynamically add another BranchName to the list //POINTERS to the TCArrays are taken care of FROM THE OUTSIDE! //take care of the logical identification & connection in your //implementation! virtual int addBranchName(const TString& branch); //return 0: ok,consistent //return 1: inconsistent //main function to be called after successful calculation virtual int calc() = 0; //is called by the task after setting the branches //this is where you should check if all the data are there! virtual bool init() = 0; //false: all fine //will be needed from outside to connect to the input branches virtual std::map* getBranchMap() {return &fBranchMap;} protected: std::vector fBranchNames; std::map fBranchMap; bool fInit; unsigned int fNExpectedBranches; }; #endif