Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DDetectorMatches_factory_WireBased.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DDetectorMatches_factory_WireBased.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_WireBased_
9 #define _DDetectorMatches_factory_WireBased_
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 <TMath.h>
23 
24 using namespace std;
25 using namespace jana;
26 
27 class DDetectorMatches_factory_WireBased : public jana::JFactory<DDetectorMatches>
28 {
29  public:
32  const char* Tag(void){return "WireBased";}
33 
34  //called by DDetectorMatches tag=Combo factory
35  DDetectorMatches* Create_DDetectorMatches(jana::JEventLoop* locEventLoop, vector<const DTrackWireBased*>& locTrackWireBasedVector);
36 
37  private:
38  jerror_t init(void); ///< Called once at program start.
39  jerror_t brun(jana::JEventLoop *locEventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
40  jerror_t evnt(jana::JEventLoop *locEventLoop, uint64_t eventnumber); ///< Called every event.
41 
42  //matching tracks to hits/showers routines
43  void MatchToTOF(const DParticleID* locParticleID, const DTrackWireBased* locTrackWireBased, const vector<const DTOFPoint*>& locTOFPoints, DDetectorMatches* locDetectorMatches) const;
44  void MatchToBCAL(const DParticleID* locParticleID, const DTrackWireBased* locTrackWireBased, const vector<const DBCALShower*>& locBCALShowers, DDetectorMatches* locDetectorMatches) const;
45  void MatchToFCAL(const DParticleID* locParticleID, const DTrackWireBased* locTrackWireBased, const vector<const DFCALShower*>& locFCALShowers, DDetectorMatches* locDetectorMatches) const;
46  void MatchToSC(const DParticleID* locParticleID, const DTrackWireBased* locTrackWireBased, const vector<const DSCHit*>& locSCHits, DDetectorMatches* locDetectorMatches) const;
47 
48  //matching showers to tracks routines
49  void MatchToTrack(const DParticleID* locParticleID, const DBCALShower* locBCALShower, const vector<const DTrackWireBased*>& locTrackWireBasedVector, DDetectorMatches* locDetectorMatches) const;
50  void MatchToTrack(const DParticleID* locParticleID, const DFCALShower* locFCALShower, const vector<const DTrackWireBased*>& locTrackWireBasedVector, DDetectorMatches* locDetectorMatches) const;
51 };
52 
53 #endif // _DDetectorMatches_factory_WireBased_