Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DMCThrownMatching_factory.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DMCThrownMatching_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 _DMCThrownMatching_factory_
9 #define _DMCThrownMatching_factory_
10 
11 #include <map>
12 
13 #include "TDecompLU.h"
14 
15 #include <JANA/JFactory.h>
16 #include "TRACKING/DMCThrown.h"
18 #include "PID/DChargedTrack.h"
20 #include "PID/DNeutralParticle.h"
21 #include "PID/DNeutralShower.h"
22 #include "PID/DBeamPhoton.h"
24 #include "DANA/DApplication.h"
25 
27 #include "TAGGER/DTAGMHit.h"
28 #include "TAGGER/DTAGHHit.h"
29 #include "TOF/DTOFPoint.h"
30 #include "TOF/DTOFTruth.h"
31 #include "BCAL/DBCALShower.h"
32 #include "BCAL/DBCALTruthShower.h"
33 #include "FCAL/DFCALShower.h"
34 #include "FCAL/DFCALTruthShower.h"
35 
36 using namespace jana;
37 using namespace std;
38 
39 class DMCThrownMatching_factory : public jana::JFactory<DMCThrownMatching>
40 {
41  public:
42  bool Calc_InverseMatrix(const TMatrixFSym& locInputCovarianceMatrix, TMatrixDSym& locInverse3x3Matrix) const;
43  double Calc_MatchFOM(const DVector3& locMomentum_Thrown, const DVector3& locMomentum_Detected, TMatrixDSym locInverse3x3Matrix) const;
44 
45  private:
46  jerror_t init(void); ///< Called once at program start.
47  jerror_t brun(jana::JEventLoop *locEventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
48  jerror_t evnt(jana::JEventLoop *locEventLoop, uint64_t eventnumber); ///< Called every event.
49  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
50  jerror_t fini(void); ///< Called after last event of last event source has been processed.
51 
52  void Find_GenReconMatches_BeamPhotons(JEventLoop* locEventLoop, DMCThrownMatching* locMCThrownMatching) const;
53 
54  void Find_GenReconMatches_ChargedTrack(const vector<const DChargedTrack*>& locChargedTracks, DMCThrownMatching* locMCThrownMatching) const;
55  void Find_GenReconMatches_ChargedHypo(const vector<const DMCThrown*>& locInputMCThrownVector, const vector<const DChargedTrackHypothesis*>& locInputChargedTrackHypothesisVector, DMCThrownMatching* locMCThrownMatching) const;
56 
57  void Find_GenReconMatches_NeutralParticle(const vector<const DNeutralParticle*>& locNeutralParticles, DMCThrownMatching* locMCThrownMatching) const;
58  void Find_GenReconMatches_NeutralHypo(const vector<const DMCThrown*>& locInputMCThrownVector, const vector<const DNeutralParticleHypothesis*>& locInputNeutralParticleHypothesisVector, DMCThrownMatching* locMCThrownMatching) const;
59 
60  void Find_GenReconMatches_TOFPoints(JEventLoop* locEventLoop, DMCThrownMatching* locMCThrownMatching) const;
61  void Find_GenReconMatches_BCALShowers(JEventLoop* locEventLoop, DMCThrownMatching* locMCThrownMatching) const;
62  void Find_GenReconMatches_FCALShowers(JEventLoop* locEventLoop, DMCThrownMatching* locMCThrownMatching) const;
63 
68  unsigned int dDebugLevel;
69  double dTargetCenter;
71 };
72 
73 #endif // _DMCThrownMatching_factory_
74 
TVector3 DVector3
Definition: DVector3.h:14