HerdSoftware  0.4.0
CaloTwoThreshShowerAlgo.h
Go to the documentation of this file.
1 /*
2  * CaloTwoThreshShowerAlgo.h
3  *
4  * Created on 18 November 2021
5  * Author: Sergio Bottai
6  */
7 
10 #ifndef CALOSHOWERALGO_H_
11 #define CALOSHOWERALGO_H_
12 
13 // HerdSoftware headers
15 
16 // EventAnalysis headers
17 #include "algorithm/Algorithm.h"
18 
19 namespace Herd {
20 // clang-format off
57 // clang-format on
58 
59 class CaloTwoThreshShowerAlgo : public EA::Algorithm {
60 
61 public:
66  CaloTwoThreshShowerAlgo(const std::string &name);
67 
72  bool Initialize() override;
73 
78  bool Process() override;
79 
84  bool Finalize() override;
85 
86 private:
88  struct UsedObjects {
89  std::string usedAxisDataObjName;
90  size_t usedAxisIndex;
91  std::string usedCaloDataObjName;
92  size_t usedCaloCollIndex = defaultValue<decltype(usedCaloCollIndex)>;
93  };
94 
96  bool BuildShower(const CaloHits &, Line showeraxis, const UsedObjects &usedObjects);
97 
100 
103 
107  std::string m_caloHitsName;
108 
112  std::string m_trackAxisType;
113 
118 
119  std::string m_objName{"caloShowers"};
120 
122  std::shared_ptr<CaloShowers> m_caloShowers;
123 
124  // Utility variables
125  EA::observer_ptr<EA::EventDataStore> m_evStore; // Pointer to the event data store
126  EA::observer_ptr<EA::GlobalDataStore> m_globStore; // Pointer to the global data store
127 };
128 
129 #endif /* CALOSHOWERALGO_H_ */
130 }
CaloShowers.h
Herd::CaloTwoThreshShowerAlgo::m_evStore
EA::observer_ptr< EA::EventDataStore > m_evStore
Definition: CaloTwoThreshShowerAlgo.h:125
Herd::CaloTwoThreshShowerAlgo::Initialize
bool Initialize() override
Initialization of the algorithm.
Definition: CaloTwoThreshShowerAlgo.cpp:32
Herd::Line
Class describing a line in the 3D space.
Definition: Line.h:37
Herd::CaloTwoThreshShowerAlgo::m_objName
std::string m_objName
Definition: CaloTwoThreshShowerAlgo.h:119
Herd::CaloTwoThreshShowerAlgo::m_caloHitsName
std::string m_caloHitsName
Name of the CaloHits collections to be used for reconstruction.
Definition: CaloTwoThreshShowerAlgo.h:107
Herd::CaloTwoThreshShowerAlgo::Finalize
bool Finalize() override
Post processing part.
Definition: CaloTwoThreshShowerAlgo.cpp:207
Herd::CaloTwoThreshShowerAlgo::CaloTwoThreshShowerAlgo
CaloTwoThreshShowerAlgo(const std::string &name)
Constructor.
Definition: CaloTwoThreshShowerAlgo.cpp:20
Herd
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:22
Herd::CaloTwoThreshShowerAlgo::m_edepThreshold
float m_edepThreshold
Threshold (in GeV) for energy deposit in CALO hits. Only hits above threshold are used to build the C...
Definition: CaloTwoThreshShowerAlgo.h:102
Herd::CaloTwoThreshShowerAlgo::m_axisInversion
bool m_axisInversion
Flag variable to Invert the direction of the selected trackAxisType.
Definition: CaloTwoThreshShowerAlgo.h:117
Herd::CaloTwoThreshShowerAlgo::UsedObjects::usedAxisIndex
size_t usedAxisIndex
Definition: CaloTwoThreshShowerAlgo.h:90
Herd::CaloTwoThreshShowerAlgo
Algorithm for Calorimeter Shower reconstruction starting from a given Axis Direction.
Definition: CaloTwoThreshShowerAlgo.h:59
Herd::CaloTwoThreshShowerAlgo::m_globStore
EA::observer_ptr< EA::GlobalDataStore > m_globStore
Definition: CaloTwoThreshShowerAlgo.h:126
CaloHits
Container for the hits of a single CALO detector.
Herd::CaloTwoThreshShowerAlgo::UsedObjects::usedCaloDataObjName
std::string usedCaloDataObjName
Definition: CaloTwoThreshShowerAlgo.h:91
Herd::CaloTwoThreshShowerAlgo::m_trackAxisType
std::string m_trackAxisType
Type of existing track used for Shower reconstruction.
Definition: CaloTwoThreshShowerAlgo.h:112
Herd::CaloTwoThreshShowerAlgo::UsedObjects::usedCaloCollIndex
size_t usedCaloCollIndex
Definition: CaloTwoThreshShowerAlgo.h:92
Herd::CaloTwoThreshShowerAlgo::m_caloShowers
std::shared_ptr< CaloShowers > m_caloShowers
Pointer to CaloShowers objects.
Definition: CaloTwoThreshShowerAlgo.h:122
Herd::CaloTwoThreshShowerAlgo::BuildShower
bool BuildShower(const CaloHits &, Line showeraxis, const UsedObjects &usedObjects)
Build Shower.
Definition: CaloTwoThreshShowerAlgo.cpp:181
Herd::CaloTwoThreshShowerAlgo::Process
bool Process() override
Process a single event.
Definition: CaloTwoThreshShowerAlgo.cpp:83
Herd::CaloTwoThreshShowerAlgo::UsedObjects
Helper struct to keep track of the object used in the shower reconstruction.
Definition: CaloTwoThreshShowerAlgo.h:88
Herd::CaloTwoThreshShowerAlgo::m_processCalo
bool m_processCalo
Flag variable to instruct the algorithm to process the whole calo hit collection instead of separate ...
Definition: CaloTwoThreshShowerAlgo.h:99
Herd::CaloTwoThreshShowerAlgo::UsedObjects::usedAxisDataObjName
std::string usedAxisDataObjName
Definition: CaloTwoThreshShowerAlgo.h:89