//----------------------------------------------------------- // File and Version Information: // $Id$ // // Description: // Class to align tpc with respect to external tracks // // // Environment: // Software NOT developed for the PANDA Detector at FAIR. // // Author List: // Alexander Schmah TUM (original author) // Maxence Vandenbroucke TUM (author) // Francesco Cusanno TUM (author) // Sverre Doerheim TUM (author, rewrite from macro to compiled object) // // //----------------------------------------------------------- #ifndef TpcStandaloneResCalc_H #define TpcStandaloneResCalc_H #include #include #include #include #include #include #include #include #include #include #include #include "TpcResidual.h" #include "TpcSimpleResidual.h" #include "TpcAlignmentManager.h" #include "TpcRefGFTrkResCalc.h" class TpcStandaloneResCalc : public TObject { public: TpcStandaloneResCalc(); //Sets the ranges of relevant histograms void setAlignmentFile(TString alfile){fAlignmentFile=alfile;} void setDetectorName(std::string name){fDetectorName=name;} void setInputChain(TChain* chain){fInputChain=chain;} void setFopiChain(TTree* tree){fFopiTree=tree;} //Add branch used in main Chain void addBranch(const TString name,const TString classType); void addFopiBranch(const TString name,const TString classType); void setTpcEventBranchName(const TString name); void setFopiEventBranchName(const TString name); void setMaxEvents(int nEv){fMaxEvents=nEv;} //Set the residual calculator, needs to be called before init! void setResCalculatior(AbsRefTrackResCalc* rc,std::string name){fResidualCalculator=rc;fResCalcName=name;} void setVerbose(int verbose = 1){fVerbose=verbose;} //turn on/of charge filtering // chargefilter<0 : only negative tracks // chargefilter>0 : only positive tracks // chargefilter==0 : all tracks void setChargeFiltering(int chargeFilter){fChargeFiltering=chargeFilter;} void setOutFileName(const TString &name){fOutFileName=name;} bool init(); bool execute(); void writeHistos(); TString getHistoFileName() const; void setHistoFileName(const TString &value); // getters and setters for histogramming int getzSlicesHists() const; void setzSlicesHists(int value); double getMaxRangeXY() const; void setMaxRangeXY(double value); double getMaxRangeZ() const; void setMaxRangeZ(double value); double getzStart() const; void setzStart(double value); double getzEnd() const; void setzEnd(double value); bool getSaveHistos() const; void setSaveHistos(bool value); private: int fVerbose; std::string fDetectorName; std::string fAlignmentFile; //Used when storing resiudals to file TClonesArray* fTCResiduals; std::map fBranches; std::map fFopiBranches; TString fFopiEventBranchName;//("FopiEventBr"), TString fTpcEventIdentifierBranchName;//("TpcEventIdentifier"), TpcAlignmentManager* fAlMan; TChain* fInputChain; TTree* fFopiTree; TTreeIndex* fFopiIndex; AbsRefTrackResCalc* fResidualCalculator; std::string fResCalcName; int fMaxEvents; int fChargeFiltering;// positive value= positive tracks, negative = negative, 0 all TString fOutFileName; bool fSaveHistos; std::map hists; std::map histDirName; TFile* fHistoFile; TString fHistoFileName; int fzSlicesHists; double fMaxRangeXY; double fMaxRangeZ; double fzStart; double fzEnd; void fillHistos(const TpcResidual*, const TVector3 pos20, const TVector3 mom20); void initHistos(); public: ClassDef(TpcStandaloneResCalc,1) }; #endif // TpcStandaloneResCalc_H