Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DDetectorMatches_factory.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DDetectorMatches_factory.h
4 // Created: Tue Aug 9 14:29:24 EST 2011
5 // Creator: pmatt (on Linux ifarml6 2.6.18-128.el5 x86_64)
6 //
7 
8 #ifndef _DDetectorMatches_factory_
9 #define _DDetectorMatches_factory_
10 
11 #include <iostream>
12 #include <iomanip>
13 #include <memory>
14 
15 #include <JANA/JFactory.h>
16 #include <PID/DDetectorMatches.h>
18 #include <PID/DParticleID.h>
19 #include <TOF/DTOFPoint.h>
20 #include <BCAL/DBCALShower.h>
21 #include <FCAL/DFCALShower.h>
22 #include <DIRC/DDIRCPmtHit.h>
23 #include <DIRC/DDIRCTruthBarHit.h>
24 #include <TMath.h>
25 
26 using namespace std;
27 using namespace jana;
28 
29 class DDetectorMatches_factory : public jana::JFactory<DDetectorMatches>
30 {
31  public:
34 
35  //called by DDetectorMatches tag=Combo factory
36  DDetectorMatches* Create_DDetectorMatches(jana::JEventLoop* locEventLoop, vector<const DTrackTimeBased*>& locTrackTimeBasedVector);
37 
38  private:
39  jerror_t init(void); ///< Called once at program start.
40  jerror_t brun(jana::JEventLoop *locEventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
41  jerror_t evnt(jana::JEventLoop *locEventLoop, uint64_t eventnumber); ///< Called every event.
42 
43  //matching tracks to hits/showers routines
44  void MatchToTOF(const DParticleID* locParticleID, const DTrackTimeBased* locTrackTimeBased, const vector<const DTOFPoint*>& locTOFPoints, DDetectorMatches* locDetectorMatches) const;
45  void MatchToBCAL(const DParticleID* locParticleID, const DTrackTimeBased* locTrackTimeBased, const vector<const DBCALShower*>& locBCALShowers, DDetectorMatches* locDetectorMatches) const;
46  void MatchToFCAL(const DParticleID* locParticleID, const DTrackTimeBased* locTrackTimeBased, const vector<const DFCALShower*>& locFCALShowers, DDetectorMatches* locDetectorMatches) const;
47  void MatchToSC(const DParticleID* locParticleID, const DTrackTimeBased* locTrackTimeBased, const vector<const DSCHit*>& locSCHits, DDetectorMatches* locDetectorMatches) const;
48  void MatchToDIRC(const DParticleID* locParticleID, const DTrackTimeBased* locTrackTimeBased, const vector<const DDIRCPmtHit*>& locDIRCHits, DDetectorMatches* locDetectorMatches, const vector<const DDIRCTruthBarHit*>& locDIRCBarHits) const;
49 
50  //matching showers to tracks routines
51  void MatchToTrack(const DParticleID* locParticleID, const DBCALShower* locBCALShower, const vector<const DTrackTimeBased*>& locTrackTimeBasedVector, DDetectorMatches* locDetectorMatches) const;
52  void MatchToTrack(const DParticleID* locParticleID, const DFCALShower* locFCALShower, const vector<const DTrackTimeBased*>& locTrackTimeBasedVector, DDetectorMatches* locDetectorMatches) const;
53 };
54 
55 #endif // _DDetectorMatches_factory_
56