TCShower.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 //
4 // TCAlg shower code
5 //
6 // Bruce Baller
7 //
8 ///////////////////////////////////////////////////////////////////////
9 #ifndef TRAJCLUSTERALGSHOWERS_H
10 #define TRAJCLUSTERALGSHOWERS_H
11 
12 // C/C++ standard libraries
13 #include <string>
14 #include <vector>
15 
16 // LArSoft libraries
18 
19 namespace detinfo {
20  class DetectorPropertiesData;
21 }
22 
23 namespace tca {
24 
25  void ConfigureMVA(TCConfig& tcc, std::string fMVAShowerParentWeights);
27  TCSlice& slc,
28  ShowerStruct3D& ss3,
29  bool prt);
30  void KillVerticesInShower(std::string inFcnLabel, TCSlice& slc, ShowerStruct& ss, bool prt);
31  void Finish3DShowers(TCSlice& slc);
32  bool FindShowers3D(detinfo::DetectorPropertiesData const& detProp, TCSlice& slc);
33  bool Reconcile3D(std::string inFcnLabel, TCSlice& slc, bool parentSearchDone, bool prt);
34  bool Reconcile3D(std::string inFcnLabel, TCSlice& slc, ShowerStruct3D& ss3, bool prt);
35  bool MergeShowerTjsAndStore(TCSlice& slc, unsigned short istj, unsigned short jstj, bool prt);
36  bool TransferTjHits(TCSlice& slc, bool prt);
37  int GetCotID(TCSlice& slc, int ShowerTjID);
38 
39  bool CompleteIncompleteShower(std::string inFcnLabel,
40  TCSlice& slc,
41  ShowerStruct3D& ss3,
42  bool prt);
43  void Match2DShowers(std::string inFcnLabel, TCSlice& slc, bool prt);
44  bool UpdateShower(std::string inFcnLabel, TCSlice& slc, ShowerStruct& ss, bool prt);
45  bool UpdateShower(std::string inFcnLabel, TCSlice& slc, ShowerStruct3D& ss3, bool prt);
46  float Match3DFOM(detinfo::DetectorPropertiesData const& detProp,
47  std::string inFcnLabel,
48  TCSlice& slc,
49  int icotID,
50  int jcotID,
51  bool prt);
52  float Match3DFOM(detinfo::DetectorPropertiesData const& detProp,
53  std::string inFcnLabel,
54  TCSlice& slc,
55  int icotID,
56  int jcotID,
57  int kcotID,
58  bool prt);
59  float Match3DFOM(detinfo::DetectorPropertiesData const& detProp,
60  std::string inFcnLabel,
61  TCSlice& slc,
62  ShowerStruct3D& ss3,
63  bool prt);
64  void MakeShowerObsolete(std::string inFcnLabel, TCSlice& slc, ShowerStruct3D& ss3, bool prt);
65  void MakeShowerObsolete(std::string inFcnLabel, TCSlice& slc, ShowerStruct& ss, bool prt);
66  bool DontCluster(TCSlice& slc, const std::vector<int>& tjlist1, const std::vector<int>& tjlist2);
67  void DefineDontCluster(TCSlice& slc, bool prt);
68  bool RemovePFP(std::string inFcnLabel,
69  TCSlice& slc,
70  PFPStruct& pfp,
71  ShowerStruct3D& ss3,
72  bool doUpdate,
73  bool prt);
74  bool AddPFP(std::string inFcnLabel,
75  TCSlice& slc,
76  int pID,
77  ShowerStruct3D& ss3,
78  bool doUpdate,
79  bool prt);
80  bool RemovePFP(std::string inFcnLabel,
81  TCSlice& slc,
82  int pID,
83  ShowerStruct3D& ss3,
84  bool doUpdate,
85  bool prt);
86  bool AddTj(std::string inFcnLabel,
87  TCSlice& slc,
88  int TjID,
89  ShowerStruct& ss,
90  bool doUpdate,
91  bool prt);
92  bool RemoveTj(std::string inFcnLabel,
93  TCSlice& slc,
94  int TjID,
95  ShowerStruct& ss,
96  bool doUpdate,
97  bool prt);
98  bool AnalyzeRotPos(std::string inFcnLabel, TCSlice& slc, ShowerStruct& ss, bool prt);
99  void ReverseShower(std::string inFcnLabel, TCSlice& slc, ShowerStruct& ss, bool prt);
100  void ReverseShower(std::string inFcnLabel, TCSlice& slc, int cotID, bool prt);
101  bool FindParent(detinfo::DetectorPropertiesData const& detProp,
102  std::string inFcnLabel,
103  TCSlice& slc,
104  ShowerStruct3D& ss3,
105  bool prt);
106  bool SetParent(detinfo::DetectorPropertiesData const& detProp,
107  std::string inFcnLabel,
108  TCSlice& slc,
109  PFPStruct& pfp,
110  ShowerStruct3D& ss3,
111  bool prt);
112  bool WrongSplitTj(std::string inFcnLabel,
113  TCSlice& slc,
114  Trajectory& tj,
115  unsigned short tjEnd,
116  ShowerStruct& ss,
117  bool prt);
118  bool IsShowerLike(TCSlice& slc, const std::vector<int> TjIDs);
119  float InShowerProb(TCSlice& slc, const ShowerStruct3D& ss3, const PFPStruct& pfp);
120  float InShowerProb(TCSlice& slc, const ShowerStruct& ss, const Trajectory& tj);
121  void ShowerParams(double showerEnergy, double& shMaxAlong, double& shE95Along);
122  double ShowerParamTransRMS(double showerEnergy, double along);
123  double InShowerProbLong(double showerEnergy, double along);
124  double InShowerProbTrans(double showerEnergy, double along, double trans);
125  double InShowerProb(double showerEnergy, double along, double trans);
126  float ParentFOM(std::string inFcnLabel,
127  TCSlice& slc,
128  PFPStruct& pfp,
129  unsigned short pend,
130  ShowerStruct3D& ss3,
131  bool prt);
132  float ParentFOM(std::string inFcnLabel,
133  TCSlice& slc,
134  Trajectory& tj,
135  unsigned short& tjEnd,
136  ShowerStruct& ss,
137  float& tp1Sep,
138  float& vx3Score,
139  bool prt);
140  void DefineEnvelope(std::string inFcnLabel, TCSlice& slc, ShowerStruct& ss, bool prt);
141  bool AddTjsInsideEnvelope(std::string inFcnLabel, TCSlice& slc, ShowerStruct& ss, bool prt);
142  bool AddLooseHits(std::string inFcnLabel, TCSlice& slc, int cotID, bool prt);
143  void FindStartChg(std::string inFcnLabel, TCSlice& slc, int cotID, bool prt);
144  std::vector<float> StartChgVec(TCSlice& slc, int cotID, bool prt);
145  void DumpShowerPts(std::string inFcnLabel, TCSlice& slc, int cotID);
146 
147  void FindCots(std::string inFcnLabel,
148  TCSlice& slc,
149  const CTP_t& inCTP,
150  std::vector<std::vector<int>>& tjLists,
151  bool prt);
152  void TagShowerLike(std::string inFcnLabel, TCSlice& slc, const CTP_t& inCTP);
153  void FindNearbyTjs(std::string inFcnLabel, TCSlice& slc, ShowerStruct& ss, bool prt);
154  void AddCloseTjsToList(std::string inFcnLabel,
155  TCSlice& slc,
156  unsigned short itj,
157  std::vector<int> list);
158  void MergeTjList(std::vector<std::vector<int>>& tjList);
159  void MergeTjList2(std::string inFcnLabel,
160  TCSlice& slc,
161  std::vector<std::vector<int>>& tjList,
162  bool prt);
163  void MergeNearby2DShowers(std::string inFcnLabel, TCSlice& slc, const CTP_t& inCTP, bool prt);
164  void MergeOverlap(std::string inFcnLabel, TCSlice& slc, const CTP_t& inCTP, bool prt);
165  void MergeShowerChain(std::string inFcnLabel, TCSlice& slc, const CTP_t& inCTP, bool prt);
166  void MergeSubShowersTj(std::string inFcnLabel, TCSlice& slc, const CTP_t& inCTP, bool prt);
167  void MergeSubShowers(std::string inFcnLabel, TCSlice& slc, const CTP_t& inCTP, bool prt);
168  int MergeShowers(std::string inFcnLabel, TCSlice& slc, std::vector<int> showerIDs, bool prt);
169  bool MergeShowersAndStore(std::string inFcnLabel, TCSlice& slc, int icotID, int jcotID, bool prt);
170  double ShowerEnergy(const ShowerStruct3D& ss3);
171  float ShowerEnergy(TCSlice& slc, const std::vector<int> tjIDs);
172  float ChgToMeV(float chg);
173  // PFPStruct CreateFakePFP(TCSlice& slc, const ShowerStruct3D& ss3);
174  bool StoreShower(std::string inFcnLabel, TCSlice& slc, ShowerStruct3D& ss3);
175  bool StoreShower(std::string inFcnLabel, TCSlice& slc, ShowerStruct& ss);
176  ShowerStruct3D CreateSS3(TCSlice& slc);
177  ShowerStruct CreateSS(TCSlice& slc, const std::vector<int>& tjl);
178  bool ChkAssns(std::string inFcnLabel, TCSlice& slc);
179  void PrintShowers(detinfo::DetectorPropertiesData const& detProp,
180  std::string someText,
181  TCSlice& slc);
182  void Print2DShowers(std::string someText, TCSlice& slc, CTP_t inCTP, bool printKilledShowers);
183  void PrintShower(std::string someText,
184  TCSlice& slc,
185  const ShowerStruct& ss,
186  bool printHeader,
187  bool printExtras);
188 
189 }
190 
191 #endif // ifndef TRAJCLUSTERALGSHOWERS_H
bool AddTj(std::string inFcnLabel, TCSlice &slc, int tjID, ShowerStruct &ss, bool doUpdate, bool prt)
Definition: TCShower.cxx:1446
bool TransferTjHits(TCSlice &slc, bool prt)
Definition: TCShower.cxx:3896
void MergeNearby2DShowers(std::string inFcnLabel, TCSlice &slc, const CTP_t &inCTP, bool prt)
Definition: TCShower.cxx:2308
void ConfigureMVA(TCConfig &tcc, std::string fMVAShowerParentWeights)
Definition: TCShower.cxx:33
bool AddLooseHits(std::string inFcnLabel, TCSlice &slc, int cotID, bool prt)
bool FindParent(detinfo::DetectorPropertiesData const &detProp, std::string inFcnLabel, TCSlice &slc, ShowerStruct3D &ss3, bool prt)
Definition: TCShower.cxx:1575
void ReverseShower(std::string inFcnLabel, TCSlice &slc, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:3151
void MergeShowerChain(std::string inFcnLabel, TCSlice &slc, const CTP_t &inCTP, bool prt)
Definition: TCShower.cxx:2522
double InShowerProbLong(double showerEnergy, double along)
Definition: TCShower.cxx:1956
bool ChkAssns(std::string inFcnLabel, TCSlice &slc)
Definition: TCShower.cxx:4155
ShowerStruct3D CreateSS3(TCSlice &slc)
Definition: TCShower.cxx:4088
std::string string
Definition: nybbler.cc:12
TCConfig tcc
Definition: DataStructs.cxx:8
void PrintShowers(detinfo::DetectorPropertiesData const &detProp, std::string fcnLabel, TCSlice &slc)
Definition: TCShower.cxx:4211
int GetCotID(TCSlice &slc, int ShowerTjID)
Definition: TCShower.cxx:3941
struct vector vector
void PrintShower(std::string someText, TCSlice &slc, const ShowerStruct &ss, bool printHeader, bool printExtras)
Definition: TCShower.cxx:4341
bool WrongSplitTj(std::string inFcnLabel, TCSlice &slc, Trajectory &tj, unsigned short tjEnd, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:2266
void KillVerticesInShower(std::string inFcnLabel, TCSlice &slc, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:709
bool FindShowers3D(detinfo::DetectorPropertiesData const &detProp, TCSlice &slc)
Definition: TCShower.cxx:287
double ShowerEnergy(const ShowerStruct3D &ss3)
Definition: TCShower.cxx:3952
float ParentFOM(std::string inFcnLabel, TCSlice &slc, PFPStruct &pfp, unsigned short pend, ShowerStruct3D &ss3, bool prt)
Definition: TCShower.cxx:2075
bool IsShowerLike(TCSlice &slc, const std::vector< int > TjIDs)
Definition: TCShower.cxx:1907
double InShowerProbTrans(double showerEnergy, double along, double trans)
Definition: TCShower.cxx:1992
bool FindShowerStart(detinfo::DetectorPropertiesData const &detProp, TCSlice &slc, ShowerStruct3D &ss3, bool prt)
Definition: TCShower.cxx:60
ShowerStruct CreateSS(TCSlice &slc, const std::vector< int > &tjl)
Definition: TCShower.cxx:4108
bool DontCluster(TCSlice &slc, const std::vector< int > &tjlist1, const std::vector< int > &tjlist2)
Definition: TCShower.cxx:3256
void MergeTjList(std::vector< std::vector< int >> &tjList)
Definition: TCShower.cxx:1301
double ShowerParamTransRMS(double showerEnergy, double along)
Definition: TCShower.cxx:1941
void DefineEnvelope(std::string inFcnLabel, TCSlice &slc, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:3487
void FindCots(std::string inFcnLabel, TCSlice &slc, const CTP_t &inCTP, std::vector< std::vector< int >> &tjLists, bool prt)
void MergeSubShowersTj(std::string inFcnLabel, TCSlice &slc, const CTP_t &inCTP, bool prt)
Definition: TCShower.cxx:2653
bool MergeShowerTjsAndStore(TCSlice &slc, unsigned short istj, unsigned short jstj, bool prt)
Definition: TCShower.cxx:3015
void TagShowerLike(std::string inFcnLabel, TCSlice &slc, const CTP_t &inCTP)
Definition: TCShower.cxx:3274
void AddCloseTjsToList(std::string inFcnLabel, TCSlice &slc, unsigned short itj, std::vector< int > list)
void FindNearbyTjs(std::string inFcnLabel, TCSlice &slc, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:3378
void MergeOverlap(std::string inFcnLabel, TCSlice &slc, const CTP_t &inCTP, bool prt)
Definition: TCShower.cxx:2401
double InShowerProb(double showerEnergy, double along, double trans)
General LArSoft Utilities.
bool AddPFP(std::string inFcnLabel, TCSlice &slc, int pID, ShowerStruct3D &ss3, bool doUpdate, bool prt)
Definition: TCShower.cxx:1384
std::vector< float > StartChgVec(TCSlice &slc, int cotID, bool prt)
Definition: TCShower.cxx:3823
bool AddTjsInsideEnvelope(std::string inFcnLabel, TCSlice &slc, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:3549
bool MergeShowersAndStore(std::string inFcnLabel, TCSlice &slc, int icotID, int jcotID, bool prt)
Definition: TCShower.cxx:2944
unsigned int CTP_t
Definition: DataStructs.h:49
bool RemoveTj(std::string inFcnLabel, TCSlice &slc, int TjID, ShowerStruct &ss, bool doUpdate, bool prt)
Definition: TCShower.cxx:1519
int MergeShowers(std::string inFcnLabel, TCSlice &slc, std::vector< int > ssIDs, bool prt)
Definition: TCShower.cxx:2882
void ShowerParams(double showerEnergy, double &shMaxAlong, double &along95)
Definition: TCShower.cxx:1921
void Match2DShowers(std::string inFcnLabel, TCSlice &slc, bool prt)
void DefineDontCluster(TCSlice &slc, bool prt)
void MergeTjList2(std::string inFcnLabel, TCSlice &slc, std::vector< std::vector< int >> &tjList, bool prt)
void MergeSubShowers(std::string inFcnLabel, TCSlice &slc, const CTP_t &inCTP, bool prt)
Definition: TCShower.cxx:2765
void FindStartChg(std::string inFcnLabel, TCSlice &slc, int cotID, bool prt)
Definition: TCShower.cxx:3702
void Finish3DShowers(TCSlice &slc)
Definition: TCShower.cxx:154
bool AnalyzeRotPos(std::string inFcnLabel, TCSlice &slc, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:3060
float Match3DFOM(detinfo::DetectorPropertiesData const &detProp, std::string inFcnLabel, TCSlice &slc, ShowerStruct3D &ss3, bool prt)
Definition: TCShower.cxx:1209
float ChgToMeV(float chg)
Definition: TCShower.cxx:3980
bool UpdateShower(std::string inFcnLabel, TCSlice &slc, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:911
bool RemovePFP(std::string inFcnLabel, TCSlice &slc, int pID, ShowerStruct3D &ss3, bool doUpdate, bool prt)
void Print2DShowers(std::string someText, TCSlice &slc, CTP_t inCTP, bool printKilledShowers)
Definition: TCShower.cxx:4252
bool CompleteIncompleteShower(std::string inFcnLabel, TCSlice &slc, ShowerStruct3D &ss3, bool prt)
Definition: TCShower.cxx:754
void DumpShowerPts(std::string inFcnLabel, TCSlice &slc, int cotID)
bool SetParent(detinfo::DetectorPropertiesData const &detProp, std::string inFcnLabel, TCSlice &slc, PFPStruct &pfp, ShowerStruct3D &ss3, bool prt)
Definition: TCShower.cxx:1830
void MakeShowerObsolete(std::string inFcnLabel, TCSlice &slc, ShowerStruct3D &ss3, bool prt)
Definition: TCShower.cxx:3192
bool StoreShower(std::string inFcnLabel, TCSlice &slc, ShowerStruct3D &ss3)
Definition: TCShower.cxx:3989
bool Reconcile3D(std::string inFcnLabel, TCSlice &slc, bool parentSearchDone, bool prt)
Definition: TCShower.cxx:427