1#ifndef DotsHelixFitter_H
2#define DotsHelixFitter_H
9#include "MdcGeomSvc/MdcGeomSvc.h"
34 void setT0(
double T0) {myEventT0=T0;};
36 void setDChits(vector<const MdcDigi*> aVecMdcDigi,
double T0);
46 void fitModeHelix() {myFitCircleOnly=
false; myUseAxialHitsOnly=
false;}
54 if(dphi<-M_PI||dphi>
M_PI) dphi=atan2(
sin(dphi),
cos(dphi));
60 const HepSymMatrix &
getEa() {
return myHelix_Ea;};
65 void setExtraPoints(vector< pair<double, double> > extraPoints) {myExtraPoints=extraPoints;};
69 vector<double>
calculateCirclePar_Taubin(
bool useIniHelix=
false,
int layerMin=-1,
int layerMax=50,
bool useExtraPoints=
false,
int debug=0);
74 int deactiveHits(
double chi_cut=10,
int nMax=1,
int layerMin=0,
int layerMax=50);
89 vector<pair<double, double> >
getSZ(
const MdcDigi* aDcDigi);
116 return myRmidDGapCgem[i];
122 myWireCrossPointPersistent=mode;
128 bool myIsInitialized;
131 bool myFitCircleOnly;
132 bool myFitCircleOriginOnly;
133 bool myUseAxialHitsOnly;
134 bool myUseMdcHitsOnly;
135 bool myWireCrossPointPersistent;
140 int myMinXhitsInCircleFit;
141 int myMinVhitsInHelixFit;
142 int myMinHitsInHelixFit;
143 double myDchi2Converge;
144 double myDchi2Diverge;
145 int myMaxNChi2Increase;
146 double myChi2Diverge;
156 double myPosOnWire[3];
157 double myPosOnTrk[3];
159 double myDocaFromTrk;
160 double myEntranceAngle;
161 double myFlightLength;
162 double myDocaFromDigi;
163 double myDriftDist[2];
164 double myDriftDistErr[2];
172 void prtHelix() { cout<<
"my Helix: "<<myHelix_a[0] <<
", "<< myHelix_a[1] <<
", "<< myHelix_a[2] <<
", "<< myHelix_a[3] <<
", "<< myHelix_a[4] <<endl; }
173 HepVector myHelix_aVec;
174 HepSymMatrix myHelix_Ea;
177 int myNActiveOuterXHits;
185 vector<const MdcDigi*> myVecMdcDigi;
186 vector<double> myPhiAmbiVecMdcDigi;
187 vector<double> myDelDVecMdcDigi;
188 vector< vector<double> > myDerivVecMdcDigi;
189 vector<double> myChiVecMdcDigi;
190 vector<int> myAmbiguityMdcDigi;
191 vector<int> myMdcDigiIsActive;
192 int myNumMdcDigiPerLayer[43];
193 int myIdxMdcDigiNeighbour[43][2];
194 int myWireIdMdcDigiNeighbour[43][2];
197 vector<const RecCgemCluster*> myVecCgemCluster;
198 vector<int> myCgemClusterIsActive;
199 vector<double> myChiVecCgemCluster;
200 vector<const RecCgemCluster*> myVecCgemClusterX;
201 vector<const RecCgemCluster*> myVecCgemClusterV;
204 map<double, int> myMapFlylenIdx;
208 vector< pair<double, double> > myExtraPoints;
215 vector<double> myPhiWires[43];
216 vector<double> myTensionWires[43];
217 vector<double*> myEastPosWires[43];
218 vector<double*> myWestPosWires[43];
219 vector<double*> myPosWires[43];
220 vector<double*> myDirWires[43];
224 double myRmidDGapCgem[3];
225 double myR2midDGapCgem[3];
228 double myAngStereoCgem[3];
double sin(const BesAngle a)
double cos(const BesAngle a)
*********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
void setInitialHelix(KalmanFit::Helix aHelix)
void setChi2Diverge(double cut=1000000)
int activeHits(double chi_cut=10, int sel=0)
activate myMdcDigiIsActive's hit based on myChiVecMdcDigi
int getLayer(const MdcDigi *aDcDigi)
void setDChits(vector< const MdcDigi * > aVecMdcDigi, double T0)
double dPhi(double phi1, double phi2)
vector< const RecCgemCluster * > getVecCgemCluster()
void fitModeCircleOrigin()
vector< const MdcDigi * > getVecMdcDigi()
void setCgemClusters(vector< const RecCgemCluster * > aVecCgemCluster)
void setMinHitsInHelixFit(int n=5)
void useAxialHitsOnly(bool x=true)
bool getPosAtCgem(int layer, HepPoint3D &pos)
DotsHelixFitter(KalmanFit::Helix iniHelix, vector< const MdcDigi * > vecMdcDigi, vector< const RecCgemCluster * > vecCgemCluster)
int deactiveHits(double chi_cut=10, int nMax=1, int layerMin=0, int layerMax=50)
HepMatrix dxda_cgem(KalmanFit::Helix a, double phi)
void setMaxNChi2Increase(int n=2)
bool setDChitsPhiAmbi(const vector< double > &vec)
void calculateDocaFromTrk(const MdcDigi *aDcDigi)
void setDchi2Diverge(double cut=50)
void setDchi2Converge(double cut=5)
vector< double > circleParConversion(const vector< double > &vec_par_Taubin)
void setMinVhitsInHelixFit(int n=2)
double getRmidGapCgem(int i)
vector< double > getVecChiCgemCluster()
int getNActiveOuterXHits()
const HepSymMatrix & getEa()
KalmanFit::Helix getClassHelix()
void setModeWireCrossPointPersistent(bool mode)
vector< pair< double, double > > getSZ(const MdcDigi *aDcDigi)
return S, the track length in XY; and Z of a hit on a stereo wire
void setMaxIterations(int n=10)
bool setDChitsFitFlag(vector< int > &vec)
set myMdcDigiIsActive from vec
void fitCircleOnly(bool x=true)
void setMinXhitsInCircleFit(int n=3)
vector< double > CircleFitByTaubin(const vector< pair< double, double > > &pos_hits)
double getFlightLength(const MdcDigi *aDcDigi)
void loadOneDcDigi(const MdcDigi *aDcDigi)
vector< double > calculateCirclePar_Taubin(bool useIniHelix=false, int layerMin=-1, int layerMax=50, bool useExtraPoints=false, int debug=0)
void setExtraPoints(vector< pair< double, double > > extraPoints)
void usePhiAmbi(bool x=true)
vector< RecMdcHit > makeRecMdcHitVec(int sel=1)
void calculateRoughDD(const MdcDigi *aMdcDigi)
RecMdcHit makeRecMdcHit(const MdcDigi *aDcDigi)
void calculateInitialHelix()
vector< double > getVecChiMdcDigi()
void useMdcHitsOnly(bool x=true)
vector< int > getVecMdcDigiIsAct()
double IntersectCylinder(double r)
void updateDcDigiInfo(const MdcDigi *aDcDigi)
based on input aDcDigi, modifies myFlightLength, myLeftRight, myPosOnWire, myDocaFromDigi,...
double getDocaFromTrk(const MdcDigi *aDcDigi)
vector< int > getVecIsActiveCgemCluster()