HerdSoftware  0.3.2
ParametricGeoSiliconDetectorReader.h
Go to the documentation of this file.
1 /*
2  * ParametricGeoSiliconDetectorReader.h
3  *
4  * Created on: 25 May 2021
5  * Author: Valerio Formato
6  */
7 
10 #ifndef HERD_PARAMETRICGEOSILICONDETECTORREADER_H_
11 #define HERD_PARAMETRICGEOSILICONDETECTORREADER_H_
12 
13 #ifndef GGSSMARTLOG_H_
14 #define HERD_PARAMETRICGEOSILICONDETECTORREADER_H_UNDEF_LOGGING
15 #endif
16 
17 // GGS headers
18 #include "montecarlo/readers/GGSTRootReader.h"
19 
20 #ifdef HERD_PARAMETRICGEOSILICONDETECTORREADER_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  enum class DetectorType { STK, SCD };
59 
60  ParametricGeoSiliconDetectorReader(std::shared_ptr<GGSTRootReader> ggsReader, DetectorType type)
61  : m_ggsReader{ggsReader}, m_type{type} {};
62 
63  bool IsSiliconDetectorGeoParamsAvailable();
64  RetrievalResult GetSiliconDetectorGeoParamsColl(ObjectWrapper &wrapper);
65 
72  std::array<int, 4> SideDetectorFirstWaferID() { return m_sideDetectorFirstWaferID; }
73 
74 private:
75  std::shared_ptr<GGSTRootReader> m_ggsReader;
76 
78 
80  std::array<int, 4> m_sideDetectorFirstWaferID;
81 
82  bool m_geoParamsRead = false;
83 };
84 } // namespace Readers
85 } // namespace Herd
86 
87 #endif
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
ParametricGeoSiliconDetectorReader(std::shared_ptr< GGSTRootReader > ggsReader, DetectorType type)
Definition: ParametricGeoSiliconDetectorReader.h:60
SiliconDetectorGeoParams reader class.
Definition: ParametricGeoSiliconDetectorReader.h:56
std::array< int, 4 > SideDetectorFirstWaferID()
Get the GGS volID of the first wafer for each side detector.
Definition: ParametricGeoSiliconDetectorReader.h:72
DetectorType m_type
Definition: ParametricGeoSiliconDetectorReader.h:77
std::shared_ptr< GGSTRootReader > m_ggsReader
Definition: ParametricGeoSiliconDetectorReader.h:75
DetectorType
Definition: ParametricGeoSiliconDetectorReader.h:58
SiliconDetectorGeoParamsColl m_sdGeoParamsColl
Definition: ParametricGeoSiliconDetectorReader.h:79
std::array< int, 4 > m_sideDetectorFirstWaferID
Definition: ParametricGeoSiliconDetectorReader.h:80