LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
LArProtoShower.h
Go to the documentation of this file.
1 
8 #ifndef LAR_PROTO_SHOWER_H
9 #define LAR_PROTO_SHOWER_H 1
10 
11 #include "Pandora/PandoraInternal.h"
12 
13 #include "Objects/CaloHit.h"
14 #include "Objects/CartesianVector.h"
15 
16 namespace lar_content
17 {
18 
23 {
24 public:
28  ShowerCore();
29 
36  ShowerCore(const pandora::CartesianVector &startPosition, const pandora::CartesianVector &startDirection);
37 
43  const pandora::CartesianVector &GetStartPosition() const;
44 
50  const pandora::CartesianVector &GetStartDirection() const;
51 
52 private:
53  pandora::CartesianVector m_startPosition;
54  pandora::CartesianVector m_startDirection;
55 };
56 
57 //------------------------------------------------------------------------------------------------------------------------------------------
58 
59 inline ShowerCore::ShowerCore(const pandora::CartesianVector &startPosition, const pandora::CartesianVector &startDirection) :
60  m_startPosition(startPosition),
61  m_startDirection(startDirection)
62 {
63 }
64 
65 //------------------------------------------------------------------------------------------------------------------------------------------
66 
68  m_startPosition(0.f, 0.f, 0.f),
69  m_startDirection(0.f, 0.f, 0.f)
70 {
71 }
72 
73 //------------------------------------------------------------------------------------------------------------------------------------------
74 
75 inline const pandora::CartesianVector &ShowerCore::GetStartPosition() const
76 {
77  return m_startPosition;
78 }
79 
80 //------------------------------------------------------------------------------------------------------------------------------------------
81 
82 inline const pandora::CartesianVector &ShowerCore::GetStartDirection() const
83 {
84  return m_startDirection;
85 }
86 
87 //------------------------------------------------------------------------------------------------------------------------------------------
88 //------------------------------------------------------------------------------------------------------------------------------------------
89 
94 {
95 public:
100 
107  ConnectionPathway(const pandora::CartesianVector &startPosition, const pandora::CartesianVector &startDirection);
108 
114  const pandora::CartesianVector &GetStartPosition() const;
115 
121  const pandora::CartesianVector &GetStartDirection() const;
122 
123 private:
124  pandora::CartesianVector m_startPosition;
125  pandora::CartesianVector m_startDirection;
126 };
127 
128 typedef std::vector<ConnectionPathway> ConnectionPathwayVector;
129 
130 //------------------------------------------------------------------------------------------------------------------------------------------
131 
132 inline ConnectionPathway::ConnectionPathway(const pandora::CartesianVector &startPosition, const pandora::CartesianVector &startDirection) :
133  m_startPosition(startPosition),
134  m_startDirection(startDirection)
135 {
136 }
137 
138 //------------------------------------------------------------------------------------------------------------------------------------------
139 
141  m_startPosition(0.f, 0.f, 0.f),
142  m_startDirection(0.f, 0.f, 0.f)
143 {
144 }
145 
146 //------------------------------------------------------------------------------------------------------------------------------------------
147 
148 inline const pandora::CartesianVector &ConnectionPathway::GetStartPosition() const
149 {
150  return m_startPosition;
151 }
152 
153 //------------------------------------------------------------------------------------------------------------------------------------------
154 
155 inline const pandora::CartesianVector &ConnectionPathway::GetStartDirection() const
156 {
157  return m_startDirection;
158 }
159 
160 //------------------------------------------------------------------------------------------------------------------------------------------
161 //------------------------------------------------------------------------------------------------------------------------------------------
162 
167 {
168 public:
179  ProtoShower(const ShowerCore &showerCore, const ConnectionPathway &connectionPathway, const pandora::CaloHitList &spineHitList,
180  const pandora::CaloHitList &ambiguousHitList, const pandora::CartesianPointVector &ambiguousDirectionVector,
181  const pandora::CaloHitList &hitsToAdd);
182 
188  ProtoShower(const ProtoShower &protoShower);
189 
195  const ShowerCore &GetShowerCore() const;
196 
202  const ConnectionPathway &GetConnectionPathway() const;
203 
209  const pandora::CaloHitList &GetSpineHitList() const;
210 
216  const pandora::CaloHitList &GetAmbiguousHitList() const;
217 
223  void AddAmbiguousHit(const pandora::CaloHit *const ambiguousHit);
224 
230  const pandora::CartesianPointVector &GetAmbiguousDirectionVector() const;
231 
237  void AddAmbiguousDirection(const pandora::CartesianVector &ambiguousDirection);
238 
244  const pandora::CaloHitList &GetHitsToAddList() const;
245 
251  void SetHitsToAddList(const pandora::CaloHitList &hitsToAddList);
252 
258  void AddHitToAdd(const pandora::CaloHit *const hitToAdd);
259 
260 private:
263  pandora::CaloHitList m_spineHitList;
264  pandora::CaloHitList m_ambiguousHitList;
265  pandora::CartesianPointVector m_ambiguousDirectionVector;
266  pandora::CaloHitList m_hitsToAdd;
267 };
268 
269 typedef std::vector<ProtoShower> ProtoShowerVector;
270 
271 //------------------------------------------------------------------------------------------------------------------------------------------
272 
273 inline ProtoShower::ProtoShower(const ShowerCore &showerCore, const ConnectionPathway &connectionPathway,
274  const pandora::CaloHitList &spineHitList, const pandora::CaloHitList &ambiguousHitList,
275  const pandora::CartesianPointVector &ambiguousDirectionVector, const pandora::CaloHitList &hitsToAdd) :
276  m_showerCore(showerCore),
277  m_connectionPathway(connectionPathway),
278  m_spineHitList(spineHitList),
279  m_ambiguousHitList(ambiguousHitList),
280  m_ambiguousDirectionVector(ambiguousDirectionVector),
281  m_hitsToAdd(hitsToAdd)
282 {
283 }
284 
285 //------------------------------------------------------------------------------------------------------------------------------------------
286 
287 inline ProtoShower::ProtoShower(const ProtoShower &protoShower) :
288  m_showerCore(ShowerCore(protoShower.GetShowerCore().GetStartPosition(), protoShower.GetShowerCore().GetStartDirection())),
290  ConnectionPathway(protoShower.GetConnectionPathway().GetStartPosition(), protoShower.GetConnectionPathway().GetStartDirection())),
291  m_spineHitList(protoShower.GetSpineHitList()),
294  m_hitsToAdd(protoShower.GetHitsToAddList())
295 {
296 }
297 
298 //------------------------------------------------------------------------------------------------------------------------------------------
299 
301 {
302  return m_showerCore;
303 }
304 
305 //------------------------------------------------------------------------------------------------------------------------------------------
306 
308 {
309  return m_connectionPathway;
310 }
311 
312 //------------------------------------------------------------------------------------------------------------------------------------------
313 
314 inline const pandora::CaloHitList &ProtoShower::GetSpineHitList() const
315 {
316  return m_spineHitList;
317 }
318 
319 //------------------------------------------------------------------------------------------------------------------------------------------
320 
321 inline const pandora::CaloHitList &ProtoShower::GetAmbiguousHitList() const
322 {
323  return m_ambiguousHitList;
324 }
325 
326 //------------------------------------------------------------------------------------------------------------------------------------------
327 
328 inline void ProtoShower::AddAmbiguousHit(const pandora::CaloHit *const ambiguousHit)
329 {
330  m_ambiguousHitList.push_back(ambiguousHit);
331 }
332 
333 //------------------------------------------------------------------------------------------------------------------------------------------
334 
335 inline const pandora::CartesianPointVector &ProtoShower::GetAmbiguousDirectionVector() const
336 {
338 }
339 
340 //------------------------------------------------------------------------------------------------------------------------------------------
341 
342 inline void ProtoShower::AddAmbiguousDirection(const pandora::CartesianVector &ambiguousDirection)
343 {
344  m_ambiguousDirectionVector.push_back(ambiguousDirection);
345 }
346 
347 //------------------------------------------------------------------------------------------------------------------------------------------
348 
349 inline const pandora::CaloHitList &ProtoShower::GetHitsToAddList() const
350 {
351  return m_hitsToAdd;
352 }
353 
354 //------------------------------------------------------------------------------------------------------------------------------------------
355 
356 inline void ProtoShower::SetHitsToAddList(const pandora::CaloHitList &hitsToAddList)
357 {
358  m_hitsToAdd = hitsToAddList;
359 }
360 
361 //------------------------------------------------------------------------------------------------------------------------------------------
362 
363 inline void ProtoShower::AddHitToAdd(const pandora::CaloHit *const hitToAdd)
364 {
365  m_hitsToAdd.push_back(hitToAdd);
366 }
367 
368 //------------------------------------------------------------------------------------------------------------------------------------------
369 //------------------------------------------------------------------------------------------------------------------------------------------
370 
375 {
379 };
380 
381 //------------------------------------------------------------------------------------------------------------------------------------------
382 //------------------------------------------------------------------------------------------------------------------------------------------
383 
388 {
389 public:
394 
403  ProtoShowerMatch(const ProtoShower &protoShowerU, const ProtoShower &protoShowerV, const ProtoShower &protoShowerW, const Consistency consistencyType);
404 
410  const ProtoShower &GetProtoShowerU() const;
411 
417  const ProtoShower &GetProtoShowerV() const;
418 
424  const ProtoShower &GetProtoShowerW() const;
425 
433  ProtoShower &GetProtoShowerToModify(const pandora::HitType hitType);
434 
440  const Consistency &GetConsistencyType() const;
441 
442 private:
447 };
448 
449 typedef std::vector<ProtoShowerMatch> ProtoShowerMatchVector;
450 
451 //------------------------------------------------------------------------------------------------------------------------------------------
452 
454  const ProtoShower &protoShowerU, const ProtoShower &protoShowerV, const ProtoShower &protoShowerW, const Consistency consistencyType) :
455  m_protoShowerU(protoShowerU),
456  m_protoShowerV(protoShowerV),
457  m_protoShowerW(protoShowerW),
458  m_consistencyType(consistencyType)
459 {
460 }
461 
462 //------------------------------------------------------------------------------------------------------------------------------------------
463 
465 {
466  return m_protoShowerU;
467 }
468 
469 //------------------------------------------------------------------------------------------------------------------------------------------
470 
472 {
473  return m_protoShowerV;
474 }
475 
476 //------------------------------------------------------------------------------------------------------------------------------------------
477 
479 {
480  return m_protoShowerW;
481 }
482 
483 //------------------------------------------------------------------------------------------------------------------------------------------
484 
486 {
487  return hitType == pandora::TPC_VIEW_U ? m_protoShowerU : (hitType == pandora::TPC_VIEW_V ? m_protoShowerV : m_protoShowerW);
488 }
489 
490 //------------------------------------------------------------------------------------------------------------------------------------------
491 
493 {
494  return m_consistencyType;
495 }
496 
497 //------------------------------------------------------------------------------------------------------------------------------------------
498 
499 } // namespace lar_content
500 
501 #endif // #ifndef LAR_PROTO_SHOWER_H
const ProtoShower & GetProtoShowerU() const
Get the U view ProtoShower.
const ProtoShower & GetProtoShowerV() const
Get the V view ProtoShower.
ProtoShower m_protoShowerU
the U view ProtoShower
const pandora::CartesianPointVector & GetAmbiguousDirectionVector() const
Get the ambiguous direction vector.
pandora::CartesianVector m_startDirection
the initial 2D direction of the shower cascade
const pandora::CaloHitList & GetAmbiguousHitList() const
Get the ambiguous hit list.
const ConnectionPathway m_connectionPathway
the ConnectionPathway object
ProtoShowerMatch()
Default constructor.
Consistency
Consistency enumeration.
ProtoShower m_protoShowerW
the W view ProtoShower
const ConnectionPathway & GetConnectionPathway() const
Get the connection pathway.
pandora::CartesianPointVector m_ambiguousDirectionVector
the initial directions of the ambiguous hit owners
void SetHitsToAddList(const pandora::CaloHitList &hitsToAddList)
Set the hits to add list.
pandora::CaloHitList m_hitsToAdd
the list of hits to add to an electron shower pfo
pandora::CartesianVector m_startPosition
the 2D position at which the cascade looks to begin
const pandora::CaloHitList & GetSpineHitList() const
Get the spine hit list.
ProtoShowerMatch class.
TFile f
Definition: plotHisto.C:6
const pandora::CartesianVector & GetStartPosition() const
Get the start position of the connection pathway.
void AddAmbiguousHit(const pandora::CaloHit *const ambiguousHit)
Add an ambiguous hit to the ambiguous hit list.
const ShowerCore m_showerCore
the ShowerCore object
ConnectionPathway class.
std::vector< ConnectionPathway > ConnectionPathwayVector
const pandora::CartesianVector & GetStartPosition() const
Get the start position of the shower core.
pandora::CartesianVector m_startPosition
the start position of the connection pathway
const Consistency & GetConsistencyType() const
Get the consistency type.
ShowerCore class.
const pandora::CartesianVector & GetStartDirection() const
Get the start direction of the shower core.
pandora::CaloHitList m_ambiguousHitList
the list of ambiguous hits (those with shared energy deposits)
Consistency m_consistencyType
the nature of the 2D->3D match
ProtoShower class.
HitType
Definition: HitType.h:12
std::vector< ProtoShowerMatch > ProtoShowerMatchVector
ShowerCore()
Default constructor.
std::vector< ProtoShower > ProtoShowerVector
ConnectionPathway()
Default constructor.
void AddHitToAdd(const pandora::CaloHit *const hitToAdd)
Add a hit to the hits to add list.
pandora::CartesianVector m_startDirection
the initial direction of the connection pathway
void AddAmbiguousDirection(const pandora::CartesianVector &ambiguousDirection)
Add an ambiguous direction to the ambiguous direction vector.
const pandora::CaloHitList & GetHitsToAddList() const
Get the hits to add list.
ProtoShower & GetProtoShowerToModify(const pandora::HitType hitType)
Get a modifiable ProtoShower in a given view.
const ShowerCore & GetShowerCore() const
Get the shower core.
ProtoShower m_protoShowerV
the V view ProtoShower
const ProtoShower & GetProtoShowerW() const
Get the W view ProtoShower.
pandora::CaloHitList m_spineHitList
the shower spine hit list
ProtoShower(const ShowerCore &showerCore, const ConnectionPathway &connectionPathway, const pandora::CaloHitList &spineHitList, const pandora::CaloHitList &ambiguousHitList, const pandora::CartesianPointVector &ambiguousDirectionVector, const pandora::CaloHitList &hitsToAdd)
Constructor.
const pandora::CartesianVector & GetStartDirection() const
Get the start direction of the connection pathway.