HerdSoftware  0.3.2
ParametricGeoCaloReader.h
Go to the documentation of this file.
1 /*
2  * ParametricGeoCaloReader.h
3  *
4  * Created on: 24 May 2021
5  * Author: Valerio Formato
6  */
7 
10 #ifndef HERD_PARAMETRICGEOCALOREADER_H_
11 #define HERD_PARAMETRICGEOCALOREADER_H_
12 
13 #ifndef GGSSMARTLOG_H_
14 #define HERD_PARAMETRICGEOCALOREADER_H_UNDEF_LOGGING
15 #endif
16 
17 // GGS headers
18 #include "montecarlo/readers/GGSTRootReader.h"
19 
20 #ifdef HERD_PARAMETRICGEOCALOREADER_H_UNDEF_LOGGING
21 // Remove the definitions of GGS output macros (would conflict with the same macros defined in EventAnalysis)
22 // We only do this if GGSSmartLog.h is being parsed in this TU, otherwise there would be nothing to undef
23 // (or we could even be undefining the EA macros)
24 #undef COUT
25 #undef CCOUT
26 #undef ENDL
27 #endif
28 
29 // EA headers
30 #include "core/ObjectWrapper.h"
31 #include "core/RetrievalResult.h"
32 #include "utils/Memory.h"
33 
34 // HerdSoftware headers
35 #include "common/DefaultValues.h"
37 
38 // c++ headers
39 #include <functional>
40 #include <string>
41 
42 using namespace EA;
43 
44 namespace Herd {
45 
46 // TODO: write doxygen doc
47 
48 namespace Readers {
49 // clang-format off
55 // clang-format on
57 public:
58  ParametricGeoCaloReader(std::shared_ptr<GGSTRootReader> ggsReader) : m_ggsReader{ggsReader}, m_sameIDs{false} {};
59 
60  bool IsCaloGeoParamsAvailable();
61  RetrievalResult GetCaloGeoParams(ObjectWrapper &wrapper);
62 
71  std::function<unsigned int(const float *)> CaloHitIDFromGGSPos() { return m_caloVolIDFromGGSPos; };
72 
77  bool SameIDs() { return m_sameIDs; };
78 
79 private:
81 
82  std::shared_ptr<GGSTRootReader> m_ggsReader;
83 
85  std::function<unsigned int(const float *)> m_caloVolIDFromGGSPos;
86 
87  bool m_geoParamsRead = false;
88  bool m_sameIDs; // If true then the GGS volume IDs are equal to HS IDs
89 
90  // Methods used for cube mask, which contains the GGS ID
91  unsigned int CaloHitIDFromGGSID(int iGGSCubeID, CaloGeoParamsHelpValues caloValues);
92 };
93 } // namespace Readers
94 } // namespace Herd
95 
96 #endif
CaloGeoParams m_caloGeoParams
Definition: ParametricGeoCaloReader.h:84
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
std::function< unsigned int(const float *)> CaloHitIDFromGGSPos()
Get the volID calculator for the calorimeter.
Definition: ParametricGeoCaloReader.h:71
bool m_sameIDs
Definition: ParametricGeoCaloReader.h:88
Data structure for the Calo geometry parameters.
Definition: CaloGeoParams.h:34
std::function< unsigned int(const float *)> m_caloVolIDFromGGSPos
Definition: ParametricGeoCaloReader.h:85
bool SameIDs()
Tells if GGS and HS volume IDs are the same for the current CALO geometry.
Definition: ParametricGeoCaloReader.h:77
ParametricGeoCaloReader(std::shared_ptr< GGSTRootReader > ggsReader)
Definition: ParametricGeoCaloReader.h:58
CaloGeoParams reader class.
Definition: ParametricGeoCaloReader.h:56
std::shared_ptr< GGSTRootReader > m_ggsReader
Definition: ParametricGeoCaloReader.h:80