LArSoft  v10_04_05
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);
37 
43  const pandora::CartesianVector &GetStartPosition() const;
44 
45 private:
46  pandora::CartesianVector m_startPosition;
47 };
48 
49 //------------------------------------------------------------------------------------------------------------------------------------------
50 
51 inline ShowerCore::ShowerCore(const pandora::CartesianVector &startPosition) :
52  m_startPosition(startPosition)
53 {
54 }
55 
56 //------------------------------------------------------------------------------------------------------------------------------------------
57 
59  m_startPosition(0.f, 0.f, 0.f)
60 {
61 }
62 
63 //------------------------------------------------------------------------------------------------------------------------------------------
64 
65 inline const pandora::CartesianVector &ShowerCore::GetStartPosition() const
66 {
67  return m_startPosition;
68 }
69 
70 //------------------------------------------------------------------------------------------------------------------------------------------
71 //------------------------------------------------------------------------------------------------------------------------------------------
72 
77 {
78 public:
83 
90  ConnectionPathway(const pandora::CartesianVector &startPosition, const pandora::CartesianVector &startDirection);
91 
97  const pandora::CartesianVector &GetStartPosition() const;
98 
104  const pandora::CartesianVector &GetStartDirection() const;
105 
106 private:
107  pandora::CartesianVector m_startPosition;
108  pandora::CartesianVector m_startDirection;
109 };
110 
111 typedef std::vector<ConnectionPathway> ConnectionPathwayVector;
112 
113 //------------------------------------------------------------------------------------------------------------------------------------------
114 
115 inline ConnectionPathway::ConnectionPathway(const pandora::CartesianVector &startPosition, const pandora::CartesianVector &startDirection) :
116  m_startPosition(startPosition),
117  m_startDirection(startDirection)
118 {
119 }
120 
121 //------------------------------------------------------------------------------------------------------------------------------------------
122 
124  m_startPosition(0.f, 0.f, 0.f),
125  m_startDirection(0.f, 0.f, 0.f)
126 {
127 }
128 
129 //------------------------------------------------------------------------------------------------------------------------------------------
130 
131 inline const pandora::CartesianVector &ConnectionPathway::GetStartPosition() const
132 {
133  return m_startPosition;
134 }
135 
136 //------------------------------------------------------------------------------------------------------------------------------------------
137 
138 inline const pandora::CartesianVector &ConnectionPathway::GetStartDirection() const
139 {
140  return m_startDirection;
141 }
142 
143 //------------------------------------------------------------------------------------------------------------------------------------------
144 //------------------------------------------------------------------------------------------------------------------------------------------
145 
150 {
151 public:
162  ProtoShower(const ShowerCore &showerCore, const ConnectionPathway &connectionPathway, const pandora::CaloHitList &spineHitList,
163  const pandora::CaloHitList &ambiguousHitList, const pandora::CartesianPointVector &ambiguousDirectionVector,
164  const pandora::CaloHitList &hitsToAdd);
165 
171  ProtoShower(const ProtoShower &protoShower);
172 
178  const ShowerCore &GetShowerCore() const;
179 
185  const ConnectionPathway &GetConnectionPathway() const;
186 
192  const pandora::CaloHitList &GetSpineHitList() const;
193 
199  const pandora::CaloHitList &GetAmbiguousHitList() const;
200 
206  void AddAmbiguousHit(const pandora::CaloHit *const ambiguousHit);
207 
213  const pandora::CartesianPointVector &GetAmbiguousDirectionVector() const;
214 
220  void AddAmbiguousDirection(const pandora::CartesianVector &ambiguousDirection);
221 
227  const pandora::CaloHitList &GetHitsToAddList() const;
228 
234  void SetHitsToAddList(const pandora::CaloHitList &hitsToAddList);
235 
241  void AddHitToAdd(const pandora::CaloHit *const hitToAdd);
242 
243 private:
246  pandora::CaloHitList m_spineHitList;
247  pandora::CaloHitList m_ambiguousHitList;
248  pandora::CartesianPointVector m_ambiguousDirectionVector;
249  pandora::CaloHitList m_hitsToAdd;
250 };
251 
252 typedef std::vector<ProtoShower> ProtoShowerVector;
253 
254 //------------------------------------------------------------------------------------------------------------------------------------------
255 
256 inline ProtoShower::ProtoShower(const ShowerCore &showerCore, const ConnectionPathway &connectionPathway,
257  const pandora::CaloHitList &spineHitList, const pandora::CaloHitList &ambiguousHitList,
258  const pandora::CartesianPointVector &ambiguousDirectionVector, const pandora::CaloHitList &hitsToAdd) :
259  m_showerCore(showerCore),
260  m_connectionPathway(connectionPathway),
261  m_spineHitList(spineHitList),
262  m_ambiguousHitList(ambiguousHitList),
263  m_ambiguousDirectionVector(ambiguousDirectionVector),
264  m_hitsToAdd(hitsToAdd)
265 {
266 }
267 
268 //------------------------------------------------------------------------------------------------------------------------------------------
269 
270 inline ProtoShower::ProtoShower(const ProtoShower &protoShower) :
271  m_showerCore(ShowerCore(protoShower.GetShowerCore().GetStartPosition())),
273  ConnectionPathway(protoShower.GetConnectionPathway().GetStartPosition(), protoShower.GetConnectionPathway().GetStartDirection())),
274  m_spineHitList(protoShower.GetSpineHitList()),
277  m_hitsToAdd(protoShower.GetHitsToAddList())
278 {
279 }
280 
281 //------------------------------------------------------------------------------------------------------------------------------------------
282 
284 {
285  return m_showerCore;
286 }
287 
288 //------------------------------------------------------------------------------------------------------------------------------------------
289 
291 {
292  return m_connectionPathway;
293 }
294 
295 //------------------------------------------------------------------------------------------------------------------------------------------
296 
297 inline const pandora::CaloHitList &ProtoShower::GetSpineHitList() const
298 {
299  return m_spineHitList;
300 }
301 
302 //------------------------------------------------------------------------------------------------------------------------------------------
303 
304 inline const pandora::CaloHitList &ProtoShower::GetAmbiguousHitList() const
305 {
306  return m_ambiguousHitList;
307 }
308 
309 //------------------------------------------------------------------------------------------------------------------------------------------
310 
311 inline void ProtoShower::AddAmbiguousHit(const pandora::CaloHit *const ambiguousHit)
312 {
313  m_ambiguousHitList.push_back(ambiguousHit);
314 }
315 
316 //------------------------------------------------------------------------------------------------------------------------------------------
317 
318 inline const pandora::CartesianPointVector &ProtoShower::GetAmbiguousDirectionVector() const
319 {
321 }
322 
323 //------------------------------------------------------------------------------------------------------------------------------------------
324 
325 inline void ProtoShower::AddAmbiguousDirection(const pandora::CartesianVector &ambiguousDirection)
326 {
327  m_ambiguousDirectionVector.push_back(ambiguousDirection);
328 }
329 
330 //------------------------------------------------------------------------------------------------------------------------------------------
331 
332 inline const pandora::CaloHitList &ProtoShower::GetHitsToAddList() const
333 {
334  return m_hitsToAdd;
335 }
336 
337 //------------------------------------------------------------------------------------------------------------------------------------------
338 
339 inline void ProtoShower::SetHitsToAddList(const pandora::CaloHitList &hitsToAddList)
340 {
341  m_hitsToAdd = hitsToAddList;
342 }
343 
344 //------------------------------------------------------------------------------------------------------------------------------------------
345 
346 inline void ProtoShower::AddHitToAdd(const pandora::CaloHit *const hitToAdd)
347 {
348  m_hitsToAdd.push_back(hitToAdd);
349 }
350 
351 //------------------------------------------------------------------------------------------------------------------------------------------
352 //------------------------------------------------------------------------------------------------------------------------------------------
353 
358 {
362 };
363 
364 //------------------------------------------------------------------------------------------------------------------------------------------
365 //------------------------------------------------------------------------------------------------------------------------------------------
366 
371 {
372 public:
377 
386  ProtoShowerMatch(const ProtoShower &protoShowerU, const ProtoShower &protoShowerV, const ProtoShower &protoShowerW, const Consistency consistencyType);
387 
393  const ProtoShower &GetProtoShowerU() const;
394 
400  const ProtoShower &GetProtoShowerV() const;
401 
407  const ProtoShower &GetProtoShowerW() const;
408 
416  ProtoShower &GetProtoShowerToModify(const pandora::HitType hitType);
417 
423  const Consistency &GetConsistencyType() const;
424 
425 private:
430 };
431 
432 typedef std::vector<ProtoShowerMatch> ProtoShowerMatchVector;
433 
434 //------------------------------------------------------------------------------------------------------------------------------------------
435 
437  const ProtoShower &protoShowerU, const ProtoShower &protoShowerV, const ProtoShower &protoShowerW, const Consistency consistencyType) :
438  m_protoShowerU(protoShowerU),
439  m_protoShowerV(protoShowerV),
440  m_protoShowerW(protoShowerW),
441  m_consistencyType(consistencyType)
442 {
443 }
444 
445 //------------------------------------------------------------------------------------------------------------------------------------------
446 
448 {
449  return m_protoShowerU;
450 }
451 
452 //------------------------------------------------------------------------------------------------------------------------------------------
453 
455 {
456  return m_protoShowerV;
457 }
458 
459 //------------------------------------------------------------------------------------------------------------------------------------------
460 
462 {
463  return m_protoShowerW;
464 }
465 
466 //------------------------------------------------------------------------------------------------------------------------------------------
467 
469 {
470  return hitType == pandora::TPC_VIEW_U ? m_protoShowerU : (hitType == pandora::TPC_VIEW_V ? m_protoShowerV : m_protoShowerW);
471 }
472 
473 //------------------------------------------------------------------------------------------------------------------------------------------
474 
476 {
477  return m_consistencyType;
478 }
479 
480 //------------------------------------------------------------------------------------------------------------------------------------------
481 
482 } // namespace lar_content
483 
484 #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.
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.
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.