//----------------------------------------------------------- // 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 TPCALIGNMENT_H #define TPCALIGNMENT_H #include #include #include #include #include #include #include #include #include "TpcResidual.h" #include "TpcSimpleResidual.h" #include "TpcAlignmentManager.h" #include "TpcRefGFTrkResCalc.h" class TpcAlignment : public TObject { public: TpcAlignment(); void setMaxRes(double res){maxRes=res;} void setMaxResXY(double res){maxResXY=res;} void setMaxResZ(double res){maxResZ=res;} void setAlignmentFile(TString alfile){alignmentFile=alfile;} void setDetectorName(TString name){detectorName=name;} void setInputChain(TChain* chain){inputChain=chain;} void setMaxEvents(int nEv){maxEvents=nEv;} void setCdcTrackBranchName(std::string name){cdcTrackBranchName=name;} void setTpcClusterBranchName(std::string name){tpcClusterBranchName=name;} bool init(); bool execute(); void writeHistos(std::string outfile); void setResidualCalculator(std::string calc){residualCalculatorType=calc;} void setTestRun(bool opt){testRun=opt;} void setStore(bool opt){storeResiduals=opt;} void setResCalculatior(AbsRefTrackResCalc* rc){residualCalculator=rc;} void setUseBAT(bool opt=true){fUseBat=opt;} void set3DResiduals(bool opt=true){fcdc3Dcalculation=opt;} static void fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag); //to be minimized static double chisquare(int npar,double * pars); static void setDetectorName(std::string name){detectorName=name;} private: static bool fcdc3Dcalculation; static std::string detectorName; static std::string alignmentFile; static std::vector fResiduals; static std::vector fSimpleResiduals; static TClonesArray fTCResiduals; static int nCallsFcn; static double meanZ; //variables needed caching in the chi2 method static double phi_,theta_,psi_; static double dphi_,dtheta_,dpsi_; static TVector3 tpcpos_; static TVector3 dtpcpos_; static TGeoCombiTrans* lastTransP1P2; bool fUseBat; double maxRes; double maxResXY; double maxResZ; //double meanZ; std::string cdcTrackBranchName; std::string cdcGFTrackBranchName; std::string tpcTrackBranchName; std::string tpcClusterBranchName; std::string tpcShieldPointBranchName; TpcAlignmentManager* alMan; TVector3 inititalTpcPos; double initialPhi; double initialTheta; double initialPsi; TChain* inputChain; // TClonesArray* cdcTracks; // TClonesArray* tpcClusterArr; std::map fBranches; TString oldtpcxyz; double storeResiduals; std::string residualFile; std::map hists; AbsRefTrackResCalc* residualCalculator; int maxEvents; TClonesArray* cdcTracks; TClonesArray* cdcGFTracks; TClonesArray* tpcClusters; TClonesArray* tpcSPHits; TClonesArray* tpcTracks; TClonesArray* shieldPoints; std::string residualCalculatorType; bool testRun; public: ClassDef(TpcAlignment,0) }; #endif // TPCALIGNMENT_H