CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
DotsHelixFitter.h
Go to the documentation of this file.
1#ifndef DotsHelixFitter_H
2#define DotsHelixFitter_H
3
13
14//using namespace KalmanFit;
15
17{
18 public:
21 DotsHelixFitter(KalmanFit::Helix iniHelix, vector<const MdcDigi*> vecMdcDigi, vector<const RecCgemCluster*> vecCgemCluster);
22 void initialize();
23 void setMaxIterations(int n=10) {myMaxIteration=n;};
24 void setMinXhitsInCircleFit(int n=3) {myMinXhitsInCircleFit=n;};
25 void setMinVhitsInHelixFit(int n=2) {myMinVhitsInHelixFit=n;};
26 void setMinHitsInHelixFit(int n=5) {myMinHitsInHelixFit=n;};
27 void setDchi2Converge(double cut=5) {myDchi2Converge=cut;};
28 void setDchi2Diverge(double cut=50) {myDchi2Diverge=cut;};
29 void setMaxNChi2Increase(int n=2) {myMaxNChi2Increase=n;};
30 void setChi2Diverge(double cut=1000000) {myChi2Diverge=cut;};
31
33 void setT0(double T0) {myEventT0=T0;};
34 void setCgemClusters(vector<const RecCgemCluster*> aVecCgemCluster);
35 void setDChits(vector<const MdcDigi*> aVecMdcDigi, double T0);
36
37 void fitCircleOnly(bool x=true) {myFitCircleOnly=x;};
38 void fitModeCircle() {myFitCircleOnly=true;}
39 void fitModeHelix() {myFitCircleOnly=false; myUseAxialHitsOnly=false;}
40 void useAxialHitsOnly(bool x=true) {myUseAxialHitsOnly=x;}
41
42 KalmanFit::Helix getClassHelix() {return *myHelix;} // in cm, radian, GeV/c
43 HepVector getHelix() {return myHelix_aVec;};
44 const HepSymMatrix & getEa() {return myHelix_Ea;};// error matrix
45 double getChi2() {return myChi2;};
46
47 void fit();
48
52 int deactiveHits(double chi_cut=10, int nMax=1);
53 int activeHits(double chi_cut=10);
54 int deactiveHits(int layer_max=43, int nHit_max=1000);
55 int getNActiveHits() {return myNActiveHits;};
56 void updateChi2();
57
58 void loadOneDcDigi(const MdcDigi* aDcDigi);
59 void calculateDocaFromTrk(const MdcDigi* aDcDigi);
60 void updateDcDigiInfo(const MdcDigi* aDcDigi);
61 double getFlightLength() { return myFlightLength; };
62 double getFlightLength(const MdcDigi* aDcDigi) { calculateDocaFromTrk(aDcDigi); return myFlightLength; };
63 int getLayer(const MdcDigi* aDcDigi) { loadOneDcDigi(aDcDigi); return myLayer; };
64 double getDocaFromTrk() {return myDocaFromTrk;};
65 double getDocaFromTrk(const MdcDigi* aDcDigi) { calculateDocaFromTrk(aDcDigi); return myDocaFromTrk;};
66
67 RecMdcHit makeRecMdcHit(const MdcDigi* aDcDigi);
68 RecMdcHit makeRecMdcHit(const MdcDigi* aDcDigi, KalmanFit::Helix aHelix);
69 vector<RecMdcHit> makeRecMdcHitVec(int sel=1);// sel=0: all, 1: only active
70
71 vector<const MdcDigi*> getVecMdcDigi() {return myVecMdcDigi;}
72 vector<double> getVecChiMdcDigi() {return myChiVecMdcDigi;}
73 vector<int> getVecMdcDigiIsAct() {return myMdcDigiIsActive;}
74
75 vector<const RecCgemCluster*> getVecCgemCluster() { return myVecCgemCluster;}
76 vector<int> getVecIsActiveCgemCluster() { return myCgemClusterIsActive;}
77 vector<double> getVecChiCgemCluster() { return myChiVecCgemCluster;}
78
79 double IntersectCylinder(double r);
80 HepMatrix dxda_cgem(KalmanFit::Helix a, double phi);
81
82 double getRmidGapCgem(int i)
83 {
84 if(i>2) i=2;
85 if(i<0) i=0;
86 return myRmidDGapCgem[i];
87 }
88
89 private:
90
91 // --- if initialized
92 bool myIsInitialized;
93
94 // --- option
95 bool myFitCircleOnly;
96 bool myUseAxialHitsOnly;
97
98 // --- criteria
99 int myMaxIteration;
100 int myMinXhitsInCircleFit;
101 int myMinVhitsInHelixFit;
102 int myMinHitsInHelixFit;
103 double myDchi2Converge;
104 double myDchi2Diverge;
105 int myMaxNChi2Increase;
106 double myChi2Diverge;
107
108 // --- some common information at event level
109 double myEventT0;// event start time
110
111 // --- information of a DC digi (or CGEM cluster) under proccessing
112 int myLayer;
113 int myWire;
114 double myWirePos[7];
115 double myCharge;
116 double myPosOnWire[3];
117 double myPosOnTrk[3];
118 int myLeftRight;//left:0, right:1
119 double myDocaFromTrk;
120 double myEntranceAngle;
121 double myFlightLength;
122 double myDocaFromDigi;
123 double myDriftDist[2];//left/right
124 double myDriftDistErr[2];//left/right
125 double myDriftTime;
126 double myDcChi;
127
128
129 // --- track parameters
130 KalmanFit::Helix* myHelix;// in cm, radian, GeV/c
131 double myHelix_a[5];// in cm, radian, GeV/c
132 HepVector myHelix_aVec;
133 HepSymMatrix myHelix_Ea;// error matrix
134 double myChi2;
135 int myNActiveHits;
136
137
138 // --- digi collection for DC
139 vector<const MdcDigi*> myVecMdcDigi;
140 vector<double> myDelDVecMdcDigi;
141 vector< vector<double> > myDerivVecMdcDigi;
142 vector<double> myChiVecMdcDigi;
143 vector<int> myAmbiguityMdcDigi;// left: -1, right: 1, not sure: 0
144 vector<int> myMdcDigiIsActive;// active: 1, inactive: 0
145 int myNumMdcDigiPerLayer[43];
146 int myIdxMdcDigiNeighbour[43][2];// index
147 int myWireIdMdcDigiNeighbour[43][2];// wire id
148
149 // --- cluster collection for CGEM
150 vector<const RecCgemCluster*> myVecCgemCluster;
151 vector<int> myCgemClusterIsActive;// active: 1, inactive: 0
152 vector<double> myChiVecCgemCluster;
153 vector<const RecCgemCluster*> myVecCgemClusterX;
154 vector<const RecCgemCluster*> myVecCgemClusterV;
155
156 // --- index ordered by flight length
157 map<double, int> myMapFlylenIdx;
158
159
160 // --- geometry for MDC
161 MdcGeomSvc* myMdcGeomSvc;
162 int myWireFlag[43];
163 int myNWire[43];
164 double myRWires[43];
165 vector<double> myPhiWires[43];
166 vector<double> myTensionWires[43];
167 vector<double*> myEastPosWires[43];
168 vector<double*> myWestPosWires[43];
169 vector<double*> myPosWires[43];// position of wires with z=0
170 vector<double*> myDirWires[43];// direction of wires
171
172 // --- geometry for CGEM
173 CgemGeomSvc* myCgemGeomSvc;
174 double myRmidDGapCgem[3];
175 double myR2midDGapCgem[3];
176 double myRVCgem[3];
177 double myRXCgem[3];
178 double myAngStereoCgem[3];
179 int myNSheets[3];
180
181 // --- calibration svc
182 MdcCalibFunSvc* myMdcCalibFunSvc;
183 ICgemCalibFunSvc* myCgemCalibSvc;
184
185 // --- MDC utility
186 IMdcUtilitySvc* myMdcUtilitySvc;
187
188};
189
190#endif
const Int_t n
Double_t x[10]
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared cut
Definition: KarFin.h:27
void setInitialHelix(KalmanFit::Helix aHelix)
void setChi2Diverge(double cut=1000000)
double getFlightLength()
int deactiveHits(double chi_cut=10, int nMax=1)
int getLayer(const MdcDigi *aDcDigi)
void setDChits(vector< const MdcDigi * > aVecMdcDigi, double T0)
void calcuMeasDeriv()
vector< const RecCgemCluster * > getVecCgemCluster()
vector< const MdcDigi * > getVecMdcDigi()
void setCgemClusters(vector< const RecCgemCluster * > aVecCgemCluster)
void setMinHitsInHelixFit(int n=5)
void useAxialHitsOnly(bool x=true)
DotsHelixFitter(KalmanFit::Helix iniHelix, vector< const MdcDigi * > vecMdcDigi, vector< const RecCgemCluster * > vecCgemCluster)
HepMatrix dxda_cgem(KalmanFit::Helix a, double phi)
void setMaxNChi2Increase(int n=2)
void calculateDocaFromTrk(const MdcDigi *aDcDigi)
void setDchi2Diverge(double cut=50)
void setDchi2Converge(double cut=5)
void setMinVhitsInHelixFit(int n=2)
double getRmidGapCgem(int i)
vector< double > getVecChiCgemCluster()
const HepSymMatrix & getEa()
KalmanFit::Helix getClassHelix()
HepVector getHelix()
void setMaxIterations(int n=10)
void fitCircleOnly(bool x=true)
void setMinXhitsInCircleFit(int n=3)
double getFlightLength(const MdcDigi *aDcDigi)
void loadOneDcDigi(const MdcDigi *aDcDigi)
vector< RecMdcHit > makeRecMdcHitVec(int sel=1)
RecMdcHit makeRecMdcHit(const MdcDigi *aDcDigi)
void calculateInitialHelix()
vector< double > getVecChiMdcDigi()
void setT0(double T0)
vector< int > getVecMdcDigiIsAct()
double IntersectCylinder(double r)
void updateDcDigiInfo(const MdcDigi *aDcDigi)
double getDocaFromTrk()
double getDocaFromTrk(const MdcDigi *aDcDigi)
int activeHits(double chi_cut=10)
vector< int > getVecIsActiveCgemCluster()