// $Id$ // // File: DDetectorMatches_factory.h // Created: Tue Aug 9 14:29:24 EST 2011 // Creator: pmatt (on Linux ifarml6 2.6.18-128.el5 x86_64) // #ifndef _DDetectorMatches_ #define _DDetectorMatches_ #include #include #include #include #include #include #include using namespace std; //one DDetectorMatches object created per DTrackTimeBased class DDetectorMatches : public JObject { public: JOBJECT_PUBLIC(DDetectorMatches); class DShowerMatchParams { //these are only created for the "best" match for each detector system public: double dx; //the distance the track traveled through the detector system up to the shower position double dTime; //the time measured by the detector system hit, but projected back along the track to DTrackTimeBased::position() (POCA to beamline) double dTimeVariance; //the variance of dTime double dPathLength; //path length from DTrackTimeBased::position() to the shower }; class DHitMatchParams { //these are only created for the "best" match for each detector system public: double dEdx; //dE/dx; dE: the energy lost by the track, dx: the distance the track traveled through the detector system double dTime; //the time measured by the detector system hit, but projected back along the track to DTrackTimeBased::position() (POCA to beamline) double dTimeVariance; //the variance of dTime double dPathLength; //path length from DTrackTimeBased::position() to the hit }; //time-based track to which the objects are matched const DTrackTimeBased* dTrackTimeBased; //All detector objects matched to dTrackTimeBased (vectors may be empty) vector dTrackTOFMatches; vector dTrackSCMatches; vector dTrackBCALMatches; vector dTrackFCALMatches; //"Best" matches to each system (can be multiple matches) and associated parameters //pointers NULL if no match //memory for the DHitMatchParams & DShowerMatchParams objects managed by the DDetectorMatches factory //for BCAL & FCAL: "Best" match is the shower with the largest energy (within some minimum distance) //for TOF & SC: "Best" match is the closest hit (SC: in phi, TOF: distance on TOF plane) pair dTrackTOFMatchParams; pair dTrackSCMatchParams; pair dTrackBCALMatchParams; pair dTrackFCALMatchParams; //primary time detector hit (used for PID FOM, kinematic fit time constraints) DetectorSystem_t dMainTimeHitSystem; //order of preference: SYS_BCAL, SYS_TOF, SYS_FCAL, SYS_START, SYS_CDC, SYS_FDC, SYS_NULL //SYS_BCAL preferred over SYS_TOF & SYS_FCAL because scattering in BCAL can significantly alter track parameters //covariance matrix terms useful for kinematic fit: only saved for the primary detector hit double dTimePxCovariance; //covariance matrix term between the time and the x-component of the track momentum at DTrackTimeBased::position() double dTimePyCovariance; //covariance matrix term between the time and the y-component of the track momentum at DTrackTimeBased::position() double dTimePzCovariance; //covariance matrix term between the time and the z-component of the track momentum at DTrackTimeBased::position() }; #endif // _DDetectorMatches_