All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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);
47  std::string inFcnLabel,
48  TCSlice& slc,
49  int icotID,
50  int jcotID,
51  bool prt);
53  std::string inFcnLabel,
54  TCSlice& slc,
55  int icotID,
56  int jcotID,
57  int kcotID,
58  bool prt);
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);
102  std::string inFcnLabel,
103  TCSlice& slc,
104  ShowerStruct3D& ss3,
105  bool prt);
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);
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:1448
bool TransferTjHits(TCSlice &slc, bool prt)
Definition: TCShower.cxx:3898
void MergeNearby2DShowers(std::string inFcnLabel, TCSlice &slc, const CTP_t &inCTP, bool prt)
Definition: TCShower.cxx:2310
void ConfigureMVA(TCConfig &tcc, std::string fMVAShowerParentWeights)
Definition: TCShower.cxx:35
bool FindParent(detinfo::DetectorPropertiesData const &detProp, std::string inFcnLabel, TCSlice &slc, ShowerStruct3D &ss3, bool prt)
Definition: TCShower.cxx:1577
void ReverseShower(std::string inFcnLabel, TCSlice &slc, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:3153
void MergeShowerChain(std::string inFcnLabel, TCSlice &slc, const CTP_t &inCTP, bool prt)
Definition: TCShower.cxx:2524
double InShowerProbLong(double showerEnergy, double along)
Definition: TCShower.cxx:1958
bool ChkAssns(std::string inFcnLabel, TCSlice &slc)
Definition: TCShower.cxx:4157
ShowerStruct3D CreateSS3(TCSlice &slc)
Definition: TCShower.cxx:4090
TCConfig tcc
Definition: DataStructs.cxx:9
void PrintShowers(detinfo::DetectorPropertiesData const &detProp, std::string fcnLabel, TCSlice &slc)
Definition: TCShower.cxx:4213
int GetCotID(TCSlice &slc, int ShowerTjID)
Definition: TCShower.cxx:3943
void PrintShower(std::string someText, TCSlice &slc, const ShowerStruct &ss, bool printHeader, bool printExtras)
Definition: TCShower.cxx:4343
bool WrongSplitTj(std::string inFcnLabel, TCSlice &slc, Trajectory &tj, unsigned short tjEnd, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:2268
void KillVerticesInShower(std::string inFcnLabel, TCSlice &slc, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:711
bool FindShowers3D(detinfo::DetectorPropertiesData const &detProp, TCSlice &slc)
Definition: TCShower.cxx:289
double ShowerEnergy(const ShowerStruct3D &ss3)
Definition: TCShower.cxx:3954
float ParentFOM(std::string inFcnLabel, TCSlice &slc, PFPStruct &pfp, unsigned short pend, ShowerStruct3D &ss3, bool prt)
Definition: TCShower.cxx:2077
bool IsShowerLike(TCSlice &slc, const std::vector< int > TjIDs)
Definition: TCShower.cxx:1909
double InShowerProbTrans(double showerEnergy, double along, double trans)
Definition: TCShower.cxx:1994
bool FindShowerStart(detinfo::DetectorPropertiesData const &detProp, TCSlice &slc, ShowerStruct3D &ss3, bool prt)
Definition: TCShower.cxx:62
ShowerStruct CreateSS(TCSlice &slc, const std::vector< int > &tjl)
Definition: TCShower.cxx:4110
bool AddLooseHits(TCSlice &slc, int cotID, bool prt)
Definition: TCShower.cxx:3627
bool DontCluster(TCSlice &slc, const std::vector< int > &tjlist1, const std::vector< int > &tjlist2)
Definition: TCShower.cxx:3258
void MergeTjList(std::vector< std::vector< int >> &tjList)
Definition: TCShower.cxx:1303
double ShowerParamTransRMS(double showerEnergy, double along)
Definition: TCShower.cxx:1943
void AddCloseTjsToList(TCSlice &slc, unsigned short itj, std::vector< int > list)
Definition: TCShower.cxx:3459
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
void DefineEnvelope(std::string inFcnLabel, TCSlice &slc, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:3489
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:2655
void DumpShowerPts(TCSlice &slc, int cotID)
Definition: TCShower.cxx:3875
float InShowerProb(TCSlice &slc, const ShowerStruct3D &ss3, const PFPStruct &pfp)
Definition: TCShower.cxx:2016
bool MergeShowerTjsAndStore(TCSlice &slc, unsigned short istj, unsigned short jstj, bool prt)
Definition: TCShower.cxx:3017
void TagShowerLike(std::string inFcnLabel, TCSlice &slc, const CTP_t &inCTP)
Definition: TCShower.cxx:3276
void FindNearbyTjs(std::string inFcnLabel, TCSlice &slc, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:3380
void MergeOverlap(std::string inFcnLabel, TCSlice &slc, const CTP_t &inCTP, bool prt)
Definition: TCShower.cxx:2403
bool AddPFP(std::string inFcnLabel, TCSlice &slc, int pID, ShowerStruct3D &ss3, bool doUpdate, bool prt)
Definition: TCShower.cxx:1386
std::vector< float > StartChgVec(TCSlice &slc, int cotID, bool prt)
Definition: TCShower.cxx:3825
bool AddTjsInsideEnvelope(std::string inFcnLabel, TCSlice &slc, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:3551
bool MergeShowersAndStore(std::string inFcnLabel, TCSlice &slc, int icotID, int jcotID, bool prt)
Definition: TCShower.cxx:2946
unsigned int CTP_t
Definition: DataStructs.h:47
bool RemoveTj(std::string inFcnLabel, TCSlice &slc, int TjID, ShowerStruct &ss, bool doUpdate, bool prt)
Definition: TCShower.cxx:1521
int MergeShowers(std::string inFcnLabel, TCSlice &slc, std::vector< int > ssIDs, bool prt)
Definition: TCShower.cxx:2884
void ShowerParams(double showerEnergy, double &shMaxAlong, double &along95)
Definition: TCShower.cxx:1923
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)
bool RemovePFP(std::string inFcnLabel, TCSlice &slc, PFPStruct &pfp, ShowerStruct3D &ss3, bool doUpdate, bool prt)
Definition: TCShower.cxx:1357
void MergeSubShowers(std::string inFcnLabel, TCSlice &slc, const CTP_t &inCTP, bool prt)
Definition: TCShower.cxx:2767
void FindStartChg(std::string inFcnLabel, TCSlice &slc, int cotID, bool prt)
Definition: TCShower.cxx:3704
void Finish3DShowers(TCSlice &slc)
Definition: TCShower.cxx:156
bool AnalyzeRotPos(std::string inFcnLabel, TCSlice &slc, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:3062
float Match3DFOM(detinfo::DetectorPropertiesData const &detProp, std::string inFcnLabel, TCSlice &slc, ShowerStruct3D &ss3, bool prt)
Definition: TCShower.cxx:1211
float ChgToMeV(float chg)
Definition: TCShower.cxx:3982
bool UpdateShower(std::string inFcnLabel, TCSlice &slc, ShowerStruct &ss, bool prt)
Definition: TCShower.cxx:913
void Print2DShowers(std::string someText, TCSlice &slc, CTP_t inCTP, bool printKilledShowers)
Definition: TCShower.cxx:4254
bool CompleteIncompleteShower(std::string inFcnLabel, TCSlice &slc, ShowerStruct3D &ss3, bool prt)
Definition: TCShower.cxx:756
bool SetParent(detinfo::DetectorPropertiesData const &detProp, std::string inFcnLabel, TCSlice &slc, PFPStruct &pfp, ShowerStruct3D &ss3, bool prt)
Definition: TCShower.cxx:1832
list
Definition: file_to_url.sh:28
auto const detProp
void MakeShowerObsolete(std::string inFcnLabel, TCSlice &slc, ShowerStruct3D &ss3, bool prt)
Definition: TCShower.cxx:3194
bool StoreShower(std::string inFcnLabel, TCSlice &slc, ShowerStruct3D &ss3)
Definition: TCShower.cxx:3991
bool Reconcile3D(std::string inFcnLabel, TCSlice &slc, bool parentSearchDone, bool prt)
Definition: TCShower.cxx:429