HerdSoftware  0.2.3
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} {};
59 
60  bool IsCaloGeoParamsAvailable();
61  RetrievalResult GetCaloGeoParams(ObjectWrapper &wrapper);
62 
70  std::function<unsigned int(const float *)> CaloHitIDFromGGSPos() { return m_caloVolIDFromGGSPos; };
71 
72 private:
74 
75  std::shared_ptr<GGSTRootReader> m_ggsReader;
76 
78  std::function<unsigned int(const float *)> m_caloVolIDFromGGSPos;
79 
80  bool m_geoParamsRead = false;
81 
82  // Methods used for cube mask, which constins the GGS ID
83  int CaloTray(int iGGSCubeID, CaloGeoParamsHelpValues caloValues);
84  int CaloLayer(int iGGSCubeID, CaloGeoParamsHelpValues caloValues);
85  unsigned int CaloHitIDFromGGSID(int iGGSCubeID, CaloGeoParamsHelpValues caloValues);
86 };
87 } // namespace Readers
88 } // namespace Herd
89 
90 #endif
CaloGeoParams m_caloGeoParams
Definition: ParametricGeoCaloReader.h:77
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:70
Data structure for the Calo geometry parameters.
Definition: CaloGeoParams.h:29
std::function< unsigned int(const float *)> m_caloVolIDFromGGSPos
Definition: ParametricGeoCaloReader.h:78
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:73