CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
CgemMdcFitAlg.h
Go to the documentation of this file.
1#include "GaudiKernel/Algorithm.h"
2#include "GaudiKernel/NTuple.h"
3#include "GaudiKernel/INTupleSvc.h"
12//#include "KalFitAlg/helix/Helix.h"
13
14class CgemMdcFitAlg:public Algorithm
15{
16 public:
17 enum TrackType{ lineType = 2, circleType = 3, helixType = 5};
18 CgemMdcFitAlg(const std::string& name, ISvcLocator* pSvcLocator);
19 StatusCode initialize();
20 StatusCode execute();
21 StatusCode finalize();
22
23 void updateTracks(int trackId, TrkRecoTrk* trkRecoTrk, RecMdcTrack* recMdcTrack, int trkStat);
24 void compareTracks(MdcTrackList& mdcTrackList, double dzCut);
25 TrkErrCode fit(RecMdcTrack* recMdcTrack, TrkRecoTrk* trkRecoTrk, TrackType trackType);
26 //template <typename T>
27 //TrkErrCode fit(double& dr,double& phi0, double& kappa, double& dz, double& tanl, RecMdcTrack* recMdcTrack, TrkRecoTrk* trkRecoTrk, T &trackfactory, TrackType trkType);
28 TrkErrCode check(TrkRecoTrk* trkRecoTrk, TrackType trackType);
29 private:
30 StatusCode storeTracks(RecMdcTrackCol*& trackList_tds ,RecMdcHitCol*& hxitList_tds, MdcTrackList& mdcTrackList);
31 StatusCode bookTuple();
32 void getMcTruth();
33
34 int m_debug;
35 int m_tuple;
36 int m_debugArbHit;
37 int m_changeTDS;
38 int m_fit2D;
39 int m_filter;
40 int m_compareTrack;
41 int m_removeBadTrack;
42 std::string m_evtFile;
43
44 double m_drCut;
45 double m_dzCut;
46 double m_qualityFactor;
47 double m_dropTrkDrCut;
48 double m_dropTrkDzCut;
49 double m_dropTrkNhitCut;
50 double m_dropTrkChi2Cut;
51 double m_dropTrkChi2NdfCut;
52 double m_bunchT0;
53 static const TrkContextEv* m_context;
54 static const MdcCalibFunSvc* m_mdcCalibFunSvc;
55 static const CgemCalibFunSvc* m_cgemCalibFunSvc;
56 static const CgemGeomSvc* m_cgemGeomSvc;
57 static const MdcDetector* m_mdcDetector;
58 TrackType trackType;
59 vector<MdcHit*> mdcHitCol;
60
61 int t_nTrkMC;
62 int t_nMdcMcHit;
63 double t_t0Truth;
64 int t_pidTruth[10];
65 double t_costhetaMC[10];
66 double t_phiMC[10];
67 double t_qMC[10];
68 double t_vzMC[10];
69 double t_vrMC[10];
70 double t_pxMC[10];
71 double t_pyMC[10];
72 double t_pzMC[10];
73 double t_ptMC[10];
74 double t_pMC[10];
75
76 //---track parameters before fitting
77 NTuple::Tuple* ntuple_evt;
78 NTuple::Item<int> m_run;
79 NTuple::Item<int> m_event;
80 NTuple::Item<int> m_nTrkRec;
81 NTuple::Array<int> m_trkidRec;
82 NTuple::Array<double> m_drRec ;
83 NTuple::Array<double> m_phi0Rec ;
84 NTuple::Array<double> m_kappaRec;
85 NTuple::Array<double> m_dzRec ;
86 NTuple::Array<double> m_tanlRec ;
87 NTuple::Array<int> m_chargeRec ;
88 NTuple::Array<int> m_statRec ;
89 NTuple::Array<int> m_nhitsRec ;
90 NTuple::Array<int> m_nclusterRec;
91 NTuple::Array<int> m_nsterRec ;
92 NTuple::Array<int> m_ndofRec ;
93 NTuple::Array<double> m_chi2Rec ;
94 NTuple::Array<double> m_pxRec ;
95 NTuple::Array<double> m_pyRec ;
96 NTuple::Array<double> m_pzRec ;
97 NTuple::Array<double> m_pxyRec ;
98 NTuple::Array<double> m_pRec ;
99 NTuple::Array<double> m_xRec ;
100 NTuple::Array<double> m_yRec ;
101 NTuple::Array<double> m_zRec ;
102 NTuple::Array<double> m_rRec ;
103 NTuple::Array<double> m_thetaRec ;
104 NTuple::Array<double> m_phiRec ;
105 NTuple::Array<double> m_fiTermRec ;
106
107 //---track parameters after fitting
108 NTuple::Item<int> m_nTrkFit;
109 NTuple::Array<int> m_trkidFit;
110 NTuple::Array<double> m_drFit ;
111 NTuple::Array<double> m_phi0Fit ;
112 NTuple::Array<double> m_kappaFit;
113 NTuple::Array<double> m_dzFit ;
114 NTuple::Array<double> m_tanlFit ;
115 NTuple::Array<int> m_chargeFit ;
116 NTuple::Array<int> m_statFit ;
117 NTuple::Array<int> m_nhitsFit ;
118 NTuple::Array<int> m_nclusterFit;
119 NTuple::Array<int> m_nsterFit ;
120 NTuple::Array<int> m_ndofFit ;
121 NTuple::Array<double> m_chi2Fit ;
122 NTuple::Array<double> m_pxFit ;
123 NTuple::Array<double> m_pyFit ;
124 NTuple::Array<double> m_pzFit ;
125 NTuple::Array<double> m_pxyFit ;
126 NTuple::Array<double> m_pFit ;
127 NTuple::Array<double> m_xFit ;
128 NTuple::Array<double> m_yFit ;
129 NTuple::Array<double> m_zFit ;
130 NTuple::Array<double> m_rFit ;
131 NTuple::Array<double> m_thetaFit ;
132 NTuple::Array<double> m_phiFit ;
133 NTuple::Array<double> m_fiTermFit ;
134
135 //--track parameters of McParticle
136 NTuple::Item<int> m_nTrkMC;
137 NTuple::Array<int> m_trkidMC;
138 NTuple::Array<double> m_drMC ;
139 NTuple::Array<double> m_phi0MC ;
140 NTuple::Array<double> m_kappaMC;
141 NTuple::Array<double> m_dzMC ;
142 NTuple::Array<double> m_tanlMC ;
143 NTuple::Array<double> m_qMC ;
144 NTuple::Array<double> m_costhetaMC ;
145 NTuple::Array<double> m_phiMC ;
146 NTuple::Array<double> m_vzMC ;
147 NTuple::Array<double> m_vrMC ;
148 NTuple::Array<double> m_pxMC ;
149 NTuple::Array<double> m_pyMC ;
150 NTuple::Array<double> m_pzMC ;
151 NTuple::Array<double> m_ptMC ;
152 NTuple::Array<double> m_pMC ;
153
154 //NTuple::Tuple* ntuple_hit;
155};
ObjectVector< RecMdcHit > RecMdcHitCol
Definition RecMdcHit.h:99
ObjectVector< RecMdcTrack > RecMdcTrackCol
TrackType
Definition ZHelix.h:31
CgemMdcFitAlg(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode execute()
void updateTracks(int trackId, TrkRecoTrk *trkRecoTrk, RecMdcTrack *recMdcTrack, int trkStat)
void compareTracks(MdcTrackList &mdcTrackList, double dzCut)
TrkErrCode check(TrkRecoTrk *trkRecoTrk, TrackType trackType)
StatusCode initialize()
StatusCode finalize()
TrkErrCode fit(RecMdcTrack *recMdcTrack, TrkRecoTrk *trkRecoTrk, TrackType trackType)