17 #include <JANA/JObject.h>
18 #include <JANA/JFactory.h>
81 jerror_t
CalcDCdEdx(
const DTrackTimeBased *locTrackTimeBased,
double& locdEdx_FDC,
double& locdx_FDC,
double& locdEdx_CDC,
double& locdEdx_CDC_amp,
double& locdx_CDC,
double& locdx_CDC_amp,
unsigned int& locNumHitsUsedFordEdx_FDC,
unsigned int& locNumHitsUsedFordEdx_CDC)
const;
82 jerror_t
CalcDCdEdx(
const DTrackTimeBased *locTrackTimeBased,
const vector<dedx_t>& locdEdxHits_CDC,
const vector<dedx_t>& locdEdxHits_FDC,
double& locdEdx_FDC,
double& locdx_FDC,
double& locdEdx_CDC,
double& locdEdx_CDC_amp,
double& locdx_CDC,
double& locdx_CDC_amp,
unsigned int& locNumHitsUsedFordEdx_FDC,
unsigned int& locNumHitsUsedFordEdx_CDC)
const;
87 jerror_t
GroupTracks(vector<const DTrackTimeBased *> &tracks, vector<vector<const DTrackTimeBased*> >&grouped_tracks)
const;
91 double GetdEdxSigma_DC(
double num_hits,
double p,
double mass,
double mean_path_length,
bool locIsCDCFlag)
const;
93 virtual jerror_t
GetdEdxMean_CDC(
double locBeta,
unsigned int locNumHitsUsedFordEdx,
double& locMeandEdx,
Particle_t locPIDHypothesis)
const=0;
94 virtual jerror_t
GetdEdxSigma_CDC(
double locBeta,
unsigned int locNumHitsUsedFordEdx,
double& locSigmadEdx,
Particle_t locPIDHypothesis)
const=0;
95 virtual jerror_t
GetdEdxMean_FDC(
double locBeta,
unsigned int locNumHitsUsedFordEdx,
double& locMeandEdx,
Particle_t locPIDHypothesis)
const=0;
96 virtual jerror_t
GetdEdxSigma_FDC(
double locBeta,
unsigned int locNumHitsUsedFordEdx,
double& locSigmadEdx,
Particle_t locPIDHypothesis)
const=0;
118 bool Distance_ToTrack(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
const DFCALShower* locFCALShower,
double locInputStartTime, shared_ptr<DFCALShowerMatchParams>& locShowerMatchParams,
DVector3* locOutputProjPos=
nullptr,
DVector3* locOutputProjMom=
nullptr)
const;
119 bool Distance_ToTrack(
const vector<DTrackFitter::Extrapolation_t>&extrapolations,
const DTOFPoint* locTOFPoint,
double locInputStartTime,shared_ptr<DTOFHitMatchParams>& locTOFHitMatchParams,
DVector3* locOutputProjPos=
nullptr,
DVector3* locOutputProjMom=
nullptr)
const;
120 bool Distance_ToTrack(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
const DSCHit* locSCHit,
double locInputStartTime,shared_ptr<DSCHitMatchParams>& locSCHitMatchParams,
DVector3* locOutputProjPos=
nullptr,
DVector3* locOutputProjMom=
nullptr)
const;
121 bool Distance_ToTrack(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
const DBCALShower* locBCALShower,
double locInputStartTime,shared_ptr<DBCALShowerMatchParams>& locShowerMatchParams,
DVector3* locOutputProjPos=
nullptr,
DVector3* locOutputProjMom=
nullptr)
const;
131 bool Cut_MatchDistance(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
const DBCALShower* locBCALShower,
double locInputStartTime,shared_ptr<DBCALShowerMatchParams>& locShowerMatchParams,
DVector3 *locOutputProjPos=
nullptr,
DVector3 *locOutputProjMom=
nullptr)
const;
132 bool Cut_MatchDistance(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
const DFCALShower* locFCALShower,
double locInputStartTime,shared_ptr<DFCALShowerMatchParams>& locShowerMatchParams,
DVector3 *locOutputProjPos=
nullptr,
DVector3 *locOutputProjMom=
nullptr)
const;
133 bool Cut_MatchDistance(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
const DTOFPoint* locTOFPoint,
double locInputStartTime,shared_ptr<DTOFHitMatchParams>& locTOFHitMatchParams,
DVector3 *locOutputProjPos=
nullptr,
DVector3 *locOutputProjMom=
nullptr)
const;
134 bool Cut_MatchDistance(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
const DSCHit* locSCHit,
double locInputStartTime,shared_ptr<DSCHitMatchParams>& locSCHitMatchParams,
bool locIsTimeBased,
DVector3 *locOutputProjPos=
nullptr,
DVector3 *locOutputProjMom=
nullptr)
const;
135 bool Cut_MatchDIRC(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
const vector<const DDIRCPmtHit*> locDIRCHits,
double locInputStartTime,
Particle_t locPID, shared_ptr<DDIRCMatchParams>& locDIRCMatchParams,
const vector<const DDIRCTruthBarHit*> locDIRCBarHits, map<shared_ptr<const DDIRCMatchParams>, vector<const DDIRCPmtHit*> >& locDIRCTrackMatchParams,
DVector3 *locOutputProjPos=
nullptr,
DVector3 *locOutputProjMom=
nullptr)
const;
147 shared_ptr<const DBCALShowerMatchParams>
Get_BestBCALMatchParams(
DVector3 locMomentum, vector<shared_ptr<const DBCALShowerMatchParams> >& locShowerMatchParams)
const;
148 shared_ptr<const DSCHitMatchParams>
Get_BestSCMatchParams(vector<shared_ptr<const DSCHitMatchParams> >& locSCHitMatchParams)
const;
149 shared_ptr<const DTOFHitMatchParams>
Get_BestTOFMatchParams(vector<shared_ptr<const DTOFHitMatchParams> >& locTOFHitMatchParams)
const;
150 shared_ptr<const DFCALShowerMatchParams>
Get_BestFCALMatchParams(vector<shared_ptr<const DFCALShowerMatchParams> >& locShowerMatchParams)
const;
155 bool Get_ClosestToTrack(
const DReferenceTrajectory* rt,
const vector<const DBCALShower*>& locBCALShowers,
bool locCutFlag,
double& locStartTime, shared_ptr<const DBCALShowerMatchParams>& locBestMatchParams,
double* locStartTimeVariance =
nullptr,
DVector3* locBestProjPos =
nullptr,
DVector3* locBestProjMom =
nullptr)
const;
156 bool Get_ClosestToTrack(
const DReferenceTrajectory* rt,
const vector<const DTOFPoint*>& locTOFPoints,
bool locCutFlag,
double& locStartTime, shared_ptr<const DTOFHitMatchParams>& locBestMatchParams,
double* locStartTimeVariance =
nullptr,
DVector3* locBestProjPos =
nullptr,
DVector3* locBestProjMom =
nullptr)
const;
157 bool Get_ClosestToTrack(
const DReferenceTrajectory* rt,
const vector<const DFCALShower*>& locFCALShowers,
bool locCutFlag,
double& locStartTime, shared_ptr<const DFCALShowerMatchParams>& locBestMatchParams,
double* locStartTimeVariance =
nullptr,
DVector3* locBestProjPos =
nullptr,
DVector3* locBestProjMom =
nullptr)
const;
158 bool Get_ClosestToTrack(
const DReferenceTrajectory* rt,
const vector<const DSCHit*>& locSCHits,
bool locIsTimeBased,
bool locCutFlag,
double& locStartTime, shared_ptr<const DSCHitMatchParams>& locBestMatchParams,
double* locStartTimeVariance =
nullptr,
DVector3* locBestProjPos =
nullptr,
DVector3* locBestProjMom =
nullptr)
const;
163 bool Get_ClosestToTrack(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
const vector<const DBCALShower*>& locBCALShowers,
bool locCutFlag,
double& locStartTime,shared_ptr<const DBCALShowerMatchParams>& locBestMatchParams,
double* locStartTimeVariance=
nullptr,
DVector3* locBestProjPos=
nullptr,
DVector3* locBestProjMom=
nullptr)
const;
164 bool Get_ClosestToTrack(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
const vector<const DTOFPoint*>& locTOFPoints,
bool locCutFlag,
double& locStartTime, shared_ptr<const DTOFHitMatchParams>& locBestMatchParams,
double* locStartTimeVariance=
nullptr,
DVector3* locBestProjPos=
nullptr,
DVector3* locBestProjMom=
nullptr)
const;
165 bool Get_ClosestToTrack(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
const vector<const DFCALShower*>& locFCALShowers,
bool locCutFlag,
double& locStartTime,shared_ptr<const DFCALShowerMatchParams>& locBestMatchParams,
double* locStartTimeVariance=
nullptr,
DVector3* locBestProjPos=
nullptr,
DVector3* locBestProjMom=
nullptr)
const;
166 bool Get_ClosestToTrack(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
const vector<const DSCHit*>& locSCHits,
bool locIsTimeBased,
bool locCutFlag,
double& locStartTime,shared_ptr<const DSCHitMatchParams>& locBestMatchParams,
double* locStartTimeVariance=
nullptr,
DVector3* locBestProjPos=
nullptr,
DVector3* locBestProjMom=
nullptr)
const;
167 const DTOFPaddleHit*
Get_ClosestTOFPaddleHit_Horizontal(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
const vector<const DTOFPaddleHit*>& locTOFPaddleHits,
double locInputStartTime,
double& locBestDeltaY,
double& locBestDistance)
const;
168 const DTOFPaddleHit*
Get_ClosestTOFPaddleHit_Vertical(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
const vector<const DTOFPaddleHit*>& locTOFPaddleHits,
double locInputStartTime,
double& locBestDeltaX,
double& locBestDistance)
const;
179 unsigned int PredictSCSector(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
double& locDeltaPhi,
DVector3& locProjPos,
DVector3& locProjMom,
DVector3& locPaddleNorm,
double& locPathLength,
double& locFlightTime,
double& locFlightTimeVariance,
int& locSCPlane)
const;
180 unsigned int PredictSCSector(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
DVector3* locOutputProjPos=
nullptr,
bool* locProjBarrelRegion=
nullptr,
double* locMinDPhi=
nullptr)
const;
181 bool PredictFCALHit(
const vector<DTrackFitter::Extrapolation_t>&extrapolations,
unsigned int &row,
unsigned int &col,
DVector3 *intersection=
nullptr)
const;
182 bool PredictBCALWedge(
const vector<DTrackFitter::Extrapolation_t>&extrapolations,
unsigned int &module,
unsigned int §or,
DVector3 *intersection=
nullptr)
const;
183 bool PredictTOFPaddles(
const vector<DTrackFitter::Extrapolation_t>&extrapolations,
unsigned int &hbar,
unsigned int &vbar,
DVector3 *intersection=
nullptr)
const;
186 bool Get_StartTime(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
187 const vector<const DFCALShower*>& FCALShowers,
188 double& StartTime)
const;
189 bool Get_StartTime(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
190 const vector<const DSCHit*>& SCHits,
191 double& StartTime)
const;
192 bool Get_StartTime(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
193 const vector<const DTOFPoint*>& TOFPoints,
194 double& StartTime)
const;
195 bool Get_StartTime(
const vector<DTrackFitter::Extrapolation_t> &extrapolations,
196 const vector<const DBCALShower*>& locBCALShowers,
197 double& StartTime)
const;
213 void Get_CDCRings(
unsigned int locBitPattern, set<int>& locCDCRings)
const;
214 void Get_FDCPlanes(
unsigned int locBitPattern, set<int>& locFDCPlanes)
const;
323 #endif // _DParticleID_
virtual jerror_t CalcDCdEdxChiSq(DChargedTrackHypothesis *locChargedTrackHypothesis) const =0
unsigned int PredictSCSector(const DReferenceTrajectory *rt, DVector3 *locOutputProjPos=nullptr, bool *locProjBarrelRegion=nullptr, double *locMinDPhi=nullptr) const
vector< double > sc_pt_slope[3]
unsigned int Get_FDCPlaneBitPattern(vector< const DFDCPseudo * > &locFDCPseudos) const
void Get_FDCPlanes(unsigned int locBitPattern, set< int > &locFDCPlanes) const
void Get_CDCRings(unsigned int locBitPattern, set< int > &locCDCRings) const
vector< double > sc_attn_A[2]
const DTOFPaddleHit * Get_ClosestTOFPaddleHit_Horizontal(const DReferenceTrajectory *locReferenceTrajectory, const vector< const DTOFPaddleHit * > &locTOFPaddleHits, double locInputStartTime, double &locBestDeltaY, double &locBestDistance) const
vector< double > SC_BOUNDARY2
vector< double > SC_SECTION2_P0
The DTrackFitter class is a base class for different charged track fitting algorithms. It does not actually fit the track itself, but provides the interface and some common support features most algorthims will need to implement.
vector< double > sc_veff[3]
vector< double > dSCCutPars_TimeBased
virtual double GetProtondEdxSigma_SC(double locBeta) const =0
vector< double > SC_BOUNDARY1
vector< double > CDC_GAIN_DOCA_PARS
bool ProjectTo_SC(const DReferenceTrajectory *rt, unsigned int locSCSector, double &locDeltaPhi, DVector3 &locProjPos, DVector3 &locProjMom, DVector3 &locPaddleNorm, double &locPathLength, double &locFlightTime, double &locFlightTimeVariance, int &locSCPlane) const
bool Cut_MatchDIRC(const vector< DTrackFitter::Extrapolation_t > &extrapolations, const vector< const DDIRCPmtHit * > locDIRCHits, double locInputStartTime, Particle_t locPID, shared_ptr< DDIRCMatchParams > &locDIRCMatchParams, const vector< const DDIRCTruthBarHit * > locDIRCBarHits, map< shared_ptr< const DDIRCMatchParams >, vector< const DDIRCPmtHit * > > &locDIRCTrackMatchParams, DVector3 *locOutputProjPos=nullptr, DVector3 *locOutputProjMom=nullptr) const
double Calc_SCFlightTimePCorrelation(const DTrackingData *locTrack, const DDetectorMatches *locDetectorMatches) const
bool Get_DIRCMatchParams(const DTrackingData *locTrack, const DDetectorMatches *locDetectorMatches, shared_ptr< const DDIRCMatchParams > &locBestMatchParams) const
double CalcdXHit(const DVector3 &mom, const DVector3 &pos, const DCoordinateSystem *wire) const
virtual jerror_t GetdEdxMean_FDC(double locBeta, unsigned int locNumHitsUsedFordEdx, double &locMeandEdx, Particle_t locPIDHypothesis) const =0
vector< double > SC_SECTION4_P0
double Calc_PropagatedRFTime(const DKinematicData *locKinematicData, const DEventRFBunch *locEventRFBunch) const
virtual jerror_t GetdEdxMean_CDC(double locBeta, unsigned int locNumHitsUsedFordEdx, double &locMeandEdx, Particle_t locPIDHypothesis) const =0
vector< double > SC_SECTION3_P0
JOBJECT_PUBLIC(DParticleID)
bool Get_StartTime(const vector< DTrackFitter::Extrapolation_t > &extrapolations, const vector< const DFCALShower * > &FCALShowers, double &StartTime) const
double CDC_TIME_CUT_FOR_DEDX
bool PredictFCALHit(const DReferenceTrajectory *rt, unsigned int &row, unsigned int &col, DVector3 *intersection=nullptr) const
void Get_FDCNumHitPlanesPerPackage(int locBitPattern, map< int, int > &locNumHitPlanesPerPackage) const
double Get_CorrectedHitEnergy(const DTOFPoint *locTOFPoint, const DVector3 &locProjPos) const
bool Get_BestTOFMatchParams(const DTrackingData *locTrack, const DDetectorMatches *locDetectorMatches, shared_ptr< const DTOFHitMatchParams > &locBestMatchParams) const
void Calc_ChargedPIDFOM(DChargedTrackHypothesis *locChargedTrackHypothesis) const
DTOFPoint_factory * dTOFPointFactory
bool Get_BestSCMatchParams(const DTrackingData *locTrack, const DDetectorMatches *locDetectorMatches, shared_ptr< const DSCHitMatchParams > &locBestMatchParams) const
bool PredictTOFPaddles(const DReferenceTrajectory *rt, unsigned int &hbar, unsigned int &vbar, DVector3 *intersection=nullptr) const
double Calc_TOFFlightTimePCorrelation(const DTrackingData *locTrack, DDetectorMatches *locDetectorMatches) const
void Get_CDCNumHitRingsPerSuperlayer(int locBitPattern, map< int, int > &locNumHitRingsPerSuperlayer) const
unsigned int Get_CDCRingBitPattern(vector< const DCDCTrackHit * > &locCDCTrackHits) const
double Calc_FCALFlightTimePCorrelation(const DTrackingData *locTrack, DDetectorMatches *locDetectorMatches) const
vector< double > SC_SECTION2_P1
double Calc_BCALFlightTimePCorrelation(const DTrackingData *locTrack, DDetectorMatches *locDetectorMatches) const
const DDIRCLut * dDIRCLut
vector< double > SC_SECTION1_P0
vector< double > sc_attn_C[2]
vector< double > sc_pt_yint[3]
bool Get_BestFCALMatchParams(const DTrackingData *locTrack, const DDetectorMatches *locDetectorMatches, shared_ptr< const DFCALShowerMatchParams > &locBestMatchParams) const
bool Get_BestBCALMatchParams(const DTrackingData *locTrack, const DDetectorMatches *locDetectorMatches, shared_ptr< const DBCALShowerMatchParams > &locBestMatchParams) const
double GetMostProbabledEdx_DC(double p, double mass, double dx, bool locIsCDCFlag) const
vector< double > dSCCutPars_WireBased
const DTOFPaddleHit * Get_ClosestTOFPaddleHit_Vertical(const DReferenceTrajectory *locReferenceTrajectory, const vector< const DTOFPaddleHit * > &locTOFPaddleHits, double locInputStartTime, double &locBestDeltaX, double &locBestDistance) const
virtual double GetProtondEdxMean_SC(double locBeta) const =0
vector< double > SC_BOUNDARY3
jerror_t GroupTracks(vector< const DTrackTimeBased * > &tracks, vector< vector< const DTrackTimeBased * > > &grouped_tracks) const
bool Get_ClosestToTrack(const DReferenceTrajectory *rt, const vector< const DBCALShower * > &locBCALShowers, bool locCutFlag, double &locStartTime, shared_ptr< const DBCALShowerMatchParams > &locBestMatchParams, double *locStartTimeVariance=nullptr, DVector3 *locBestProjPos=nullptr, DVector3 *locBestProjMom=nullptr) const
vector< double > SC_SECTION1_P1
virtual ~DParticleID(void)
double GetdEdxSigma_DC(double num_hits, double p, double mass, double mean_path_length, bool locIsCDCFlag) const
jerror_t CalcdEdxHit(const DVector3 &mom, const DVector3 &pos, const DCDCTrackHit *hit, dedx_t &dedx) const
bool Cut_MatchDistance(const DReferenceTrajectory *rt, const DBCALShower *locBCALShower, double locInputStartTime, shared_ptr< DBCALShowerMatchParams > &locShowerMatchParams, DVector3 *locOutputProjPos=nullptr, DVector3 *locOutputProjMom=nullptr) const
const DTOFGeometry * dTOFGeometry
double Calc_TimingChiSq(const DChargedTrackHypothesis *locChargedHypo, unsigned int &locNDF, double &locTimingPull) const
const DDIRCLut * Get_DIRCLut() const
jerror_t CalcDCdEdx(const DTrackTimeBased *locTrackTimeBased, double &locdEdx_FDC, double &locdx_FDC, double &locdEdx_CDC, double &locdEdx_CDC_amp, double &locdx_CDC, double &locdx_CDC_amp, unsigned int &locNumHitsUsedFordEdx_FDC, unsigned int &locNumHitsUsedFordEdx_CDC) const
jerror_t GetDCdEdxHits(const DTrackTimeBased *track, vector< dedx_t > &dEdxHits_CDC, vector< dedx_t > &dEdxHits_FDC) const
virtual double GetTimeVariance(DetectorSystem_t detector, Particle_t particle, double p) const =0
virtual jerror_t GetdEdxSigma_CDC(double locBeta, unsigned int locNumHitsUsedFordEdx, double &locSigmadEdx, Particle_t locPIDHypothesis) const =0
const DTrackFitter * fitter
dedx_t(double dE, double dE_amp, double dx, double p)
virtual jerror_t GetdEdxSigma_FDC(double locBeta, unsigned int locNumHitsUsedFordEdx, double &locSigmadEdx, Particle_t locPIDHypothesis) const =0
vector< vector< DVector3 > > sc_pos
vector< double > sc_attn_B[2]
vector< vector< DVector3 > > sc_norm
vector< double > SC_SECTION3_P1
virtual double GetEOverPSigma(DetectorSystem_t detector, double p) const =0
double Get_CorrectedHitTime(const DTOFPoint *locTOFPoint, const DVector3 &locProjPos) const
double dHalfPaddle_OneSided
void GetScintMPdEandSigma(double p, double M, double x, double &most_prob_dE, double &sigma_dE) const
const DFCALGeometry * dFCALGeometry
const DTrackFinder * finder
bool Distance_ToTrack(const DReferenceTrajectory *rt, const DFCALShower *locFCALShower, double locInputStartTime, shared_ptr< DFCALShowerMatchParams > &locShowerMatchParams, DVector3 *locOutputProjPos=nullptr, DVector3 *locOutputProjMom=nullptr) const
vector< double > SC_SECTION4_P1
bool PredictBCALWedge(const DReferenceTrajectory *rt, unsigned int &module, unsigned int §or, DVector3 *intersection=nullptr) const
double ONESIDED_PADDLE_MIDPOINT_MAG
vector< double > propagation_speed
virtual double GetEOverPMean(DetectorSystem_t detector, double p) const =0
vector< vector< DVector3 > > sc_dir