1#ifndef DotsHelixFitter_H
2#define DotsHelixFitter_H
9#include "MdcGeomSvc/MdcGeomSvc.h"
33 void setT0(
double T0) {myEventT0=T0;};
35 void setDChits(vector<const MdcDigi*> aVecMdcDigi,
double T0);
42 void fitModeHelix() {myFitCircleOnly=
false; myUseAxialHitsOnly=
false;}
50 if(dphi<-M_PI||dphi>
M_PI) dphi=atan2(
sin(dphi),
cos(dphi));
56 const HepSymMatrix &
getEa() {
return myHelix_Ea;};
61 void setExtraPoints(vector< pair<double, double> > extraPoints) {myExtraPoints=extraPoints;};
65 vector<double>
calculateCirclePar_Taubin(
bool useIniHelix=
false,
int layerMin=-1,
int layerMax=50,
bool useExtraPoints=
false);
70 int deactiveHits(
double chi_cut=10,
int nMax=1,
int layerMin=0,
int layerMax=50);
84 vector<pair<double, double> >
getSZ(
const MdcDigi* aDcDigi);
111 return myRmidDGapCgem[i];
117 myWireCrossPointPersistent=mode;
123 bool myIsInitialized;
126 bool myFitCircleOnly;
127 bool myUseAxialHitsOnly;
128 bool myUseMdcHitsOnly;
129 bool myWireCrossPointPersistent;
134 int myMinXhitsInCircleFit;
135 int myMinVhitsInHelixFit;
136 int myMinHitsInHelixFit;
137 double myDchi2Converge;
138 double myDchi2Diverge;
139 int myMaxNChi2Increase;
140 double myChi2Diverge;
150 double myPosOnWire[3];
151 double myPosOnTrk[3];
153 double myDocaFromTrk;
154 double myEntranceAngle;
155 double myFlightLength;
156 double myDocaFromDigi;
157 double myDriftDist[2];
158 double myDriftDistErr[2];
166 void prtHelix() { cout<<
"my Helix: "<<myHelix_a[0] <<
", "<< myHelix_a[1] <<
", "<< myHelix_a[2] <<
", "<< myHelix_a[3] <<
", "<< myHelix_a[4] <<endl; }
167 HepVector myHelix_aVec;
168 HepSymMatrix myHelix_Ea;
171 int myNActiveOuterXHits;
179 vector<const MdcDigi*> myVecMdcDigi;
180 vector<double> myPhiAmbiVecMdcDigi;
181 vector<double> myDelDVecMdcDigi;
182 vector< vector<double> > myDerivVecMdcDigi;
183 vector<double> myChiVecMdcDigi;
184 vector<int> myAmbiguityMdcDigi;
185 vector<int> myMdcDigiIsActive;
186 int myNumMdcDigiPerLayer[43];
187 int myIdxMdcDigiNeighbour[43][2];
188 int myWireIdMdcDigiNeighbour[43][2];
191 vector<const RecCgemCluster*> myVecCgemCluster;
192 vector<int> myCgemClusterIsActive;
193 vector<double> myChiVecCgemCluster;
194 vector<const RecCgemCluster*> myVecCgemClusterX;
195 vector<const RecCgemCluster*> myVecCgemClusterV;
198 map<double, int> myMapFlylenIdx;
202 vector< pair<double, double> > myExtraPoints;
209 vector<double> myPhiWires[43];
210 vector<double> myTensionWires[43];
211 vector<double*> myEastPosWires[43];
212 vector<double*> myWestPosWires[43];
213 vector<double*> myPosWires[43];
214 vector<double*> myDirWires[43];
218 double myRmidDGapCgem[3];
219 double myR2midDGapCgem[3];
222 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()
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)
vector< double > calculateCirclePar_Taubin(bool useIniHelix=false, int layerMin=-1, int layerMax=50, bool useExtraPoints=false)
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)
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()