LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
TCTruth.h
Go to the documentation of this file.
1 //
3 //
4 // TCAlg MC Truth
5 //
6 // Bruce Baller
7 //
9 #ifndef TRAJCLUSTERALGTRUTH_H
10 #define TRAJCLUSTERALGTRUTH_H
11 
14 
18 
19 
20 namespace tca {
21 
23  {
24 
25  public:
26 
28  EPCnts.fill(0);
29  TSums.fill(0.0);
30  EPTSums.fill(0.0);
31  TruVxCounts.fill(0);
32  MCP_TSum = 0;
33  MCP_EPTSum = 0;
34  MCP_Cnt = 0;
35  MCP_PFP_Cnt = 0;
36  Prim_TSum = 0;
37  Prim_EPTSum = 0;
38  PFP_Cnt = 0;
39  nBadEP = 0;
40  nLongInPln = 0;
41  nLongMCP = 0;
42  nGoodLongMCP = 0;
43  }
44 
45  void Initialize();
46  void MatchTruth(std::vector<simb::MCParticle*> const& mcpList, std::vector<unsigned int> const& mcpListIndex);
47  void MatchAndSum(std::vector<simb::MCParticle*> const& mcpList, std::vector<unsigned int> const& mcpListIndex);
48  void PrintResults(int eventNum) const;
49  bool CanReconstruct(std::vector<unsigned int> mcpHits, unsigned short nDimensions, const geo::TPCID& inTPCID);
50  // Put hits matched to a MCParticle in CTP into a vector
51 // std::vector<unsigned int> PutMCPHitsInVector(unsigned int mcpIndex, CTP_t inCTP);
53  void StudyElectrons(TCSlice& slc, const HistStuff& hist);
54  void StudyPiZeros(TCSlice& slc, const HistStuff& hist);
55 
56  // Variables for summing Eff*Pur for electrons, muons, pions, kaons and protons for Trajectories
57  std::array<short, 5> EPCnts {{0}};
58  std::array<float, 5> TSums; // sum of kinetic energy
59  std::array<float, 5> EPTSums; // E*P sum weighted by kinetic energy for 5 particle types
60 
61  float MCP_TSum; // T sum of MCParticles that should be reconstructed in 3D
62  float MCP_EPTSum; // E*P weighted T sum of MCParticles that ARE reconstructed in 3D
63  float MCP_Cnt; // Count of MCParticles that should be reconstructed in 3D
64  float MCP_PFP_Cnt; // Count of MCParticles that are matched to a PFParticle
65  float Prim_TSum; // T sum of Primary MCParticles that should be reconstructed in 3D
66  float Prim_EPTSum; // E*P weighted T sum of primary MCParticles that ARE reconstructed in 3D
67  float PFP_Cnt; // Count of ALL PFParticles
68 
69  unsigned short nBadEP; // Number of MCParticles that have >= MatchTruth[3] hits in a plane && EP < MatchTruth[2]
70  unsigned short nLongInPln; // Number of MCParticles that have >= MatchTruth[3] hits in a plane
71  unsigned short nLongMCP; // Number of MCParticles that have >= MatchTruth[3] hits
72  unsigned short nGoodLongMCP; // Number of MCParticles that have >= 2 * MatchTruth[3] hits with EP > 0.8
73 
74  // Counts of:
75  // [0] = the number of true vertices that are reconstructable (> 0 primary MCParticles)
76  // [1] = [0] + a vertex was reconstructed within 1 cm of the true vertex position
77  // [2] = [1] + the vertex is attached to a neutrino PFParticle
78  std::array<unsigned short, 3> TruVxCounts;
79  }; // TruthMatcher class
80 
82  {
83  public:
84 
86  void MakeTruTrajPoint(TCSlice& slc, unsigned int MCParticleListIndex, TrajPoint& tp);
87  ShowerStruct3D MakeCheatShower(TCSlice& slc, unsigned int mcpIndex, Point3_t primVx, int& truParentPFP);
88  bool PrimaryElectronStart(Point3_t& start, Vector3_t& dir, float& energy);
89  int PrimaryElectronPFPID(TCSlice& slc);
90  int PrimaryElectronTjID(TCSlice& slc, CTP_t inCTP);
91  int MCParticleStartTjID(TCSlice& slc, unsigned int MCParticleListIndex, CTP_t inCTP);
92  unsigned int GetMCPListIndex(TCSlice& slc, const TrajPoint& tp);
93  unsigned int GetMCPListIndex(TCSlice& slc, const Trajectory& tj, unsigned short& nTruHits);
94  unsigned int GetMCPListIndex(TCSlice& slc, const ShowerStruct& ss, unsigned short& nTruHits);
95 
96  }; // MCParticleListUtils class
97 
98 
99 } // namespace tca
100 
101 #endif // ifndef TRAJCLUSTERALGTRUTH_H
float MCP_TSum
Definition: TCTruth.h:61
unsigned short nLongInPln
Definition: TCTruth.h:70
std::array< double, 3 > Point3_t
Definition: DataStructs.h:35
Float_t ss
Definition: plot.C:23
void StudyShowerParents(TCSlice &slc, HistStuff &hist)
void StudyElectrons(TCSlice &slc, const HistStuff &hist)
void Initialize()
Definition: TCTruth.cxx:20
void MatchAndSum(std::vector< simb::MCParticle * > const &mcpList, std::vector< unsigned int > const &mcpListIndex)
Definition: TCTruth.cxx:120
float Prim_EPTSum
Definition: TCTruth.h:66
bool CanReconstruct(std::vector< unsigned int > mcpHits, unsigned short nDimensions, const geo::TPCID &inTPCID)
Definition: TCTruth.cxx:415
float MCP_EPTSum
Definition: TCTruth.h:62
void MatchTruth(std::vector< simb::MCParticle * > const &mcpList, std::vector< unsigned int > const &mcpListIndex)
Definition: TCTruth.cxx:31
std::array< float, 5 > TSums
Definition: TCTruth.h:58
std::array< float, 5 > EPTSums
Definition: TCTruth.h:59
std::array< short, 5 > EPCnts
Definition: TCTruth.h:57
double energy
Definition: plottest35.C:25
unsigned short nLongMCP
Definition: TCTruth.h:71
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
unsigned short nBadEP
Definition: TCTruth.h:69
unsigned short nGoodLongMCP
Definition: TCTruth.h:72
void StudyPiZeros(TCSlice &slc, const HistStuff &hist)
unsigned int CTP_t
Definition: DataStructs.h:41
TH2F * hist
Definition: plot.C:136
TDirectory * dir
Definition: macro.C:5
float MCP_PFP_Cnt
Definition: TCTruth.h:64
std::array< double, 3 > Vector3_t
Definition: DataStructs.h:36
void PrintResults(int eventNum) const
Definition: TCTruth.cxx:364
std::array< unsigned short, 3 > TruVxCounts
Definition: TCTruth.h:78
float Prim_TSum
Definition: TCTruth.h:65