SDetector/Scintillator.h
Go to the documentation of this file.
1 #ifndef _sdet_Scintillator_h_
2 #define _sdet_Scintillator_h_
3 
4 #include <vector>
5 #include <string>
6 
7 #include <det/VManager.h>
8 #include <det/Detector.h>
9 #include <sdet/PMT.h>
10 
11 #include <utl/AugerUnits.h>
12 #include <utl/AugerException.h>
13 #include <utl/CoordinateSystemPtr.h>
14 #include <utl/Validated.h>
15 #include <utl/Point.h>
16 #include <utl/Vector.h>
17 #include <utl/TabulatedFunction.h>
18 #include <utl/ShadowPtr.h>
19 #include <utl/config.h>
20 
21 
22 namespace sdet {
23 
24  class Scintillator {
25 
26  public:
27  double GetBarLength() const;
28 
29  double GetBarWidth() const;
30 
31  double GetBarThickness() const;
32 
33  unsigned int GetNBars() const;
34 
35  // The "Gap" is the distance between the two wings of scintillator bars.
36 
37  double GetGap() const;
38 
39  /*
40  * Fiber properties refer to single fibers, which are routed through two scintillator
41  * bars. In the transition from one bar to the next, they are bent in a U-turn.
42  */
43  double GetFiberLength() const;
44 
45  double GetFiberUTurnDiameter() const;
46 
47  // "Housing" refers to the polystyrene bed into which the scintillator bars are inserted.
48 
49  double GetHousingLength() const;
50 
51  double GetHousingWidth() const;
52 
53  double GetHousingThickness() const;
54 
55  // "Casing" refers to the alumninum frame in which the housing and bars reside.
56 
57  double GetCasingThickness() const;
58 
59  double GetSandwichPanelThickness() const;
60 
61  double GetRoofOffset() const;
62 
63  double GetRoofThickness() const;
64 
65  /*
66  * Position in Station coordinate system is returned, where the origin
67  * is located at the intersection between the tank's central axis and
68  * the ground. The position of the scintillator origin (the point returned)
69  * is schematically shown and described in SModels.xml.
70  */
71  utl::Point GetPosition() const;
72 
73  double GetFiberExpDecayConstant() const;
74 
75  double GetBarExpDecayConstant() const;
76 
77  double GetAttenuationLength() const;
78 
79  double GetBarLeakageExpCoefficient() const;
80 
81  double GetBarLeakageMaxRatio() const;
82 
83  double GetEffectiveRefractiveIndex() const;
84 
85  double GetReferencePENumber() const;
86 
87  double GetSigmaBarToBar() const;
88 
89  double GetReferenceEnergy() const;
90 
91  /*
92  * Returns the distances photons must travel along a fiber in both directions in
93  * order to reach the PMT.
94  */
95  std::vector<double> GetDistancesToPMT(const utl::Point& p) const;
96 
97  /*
98  * Returns the distances between the point of partical traversal and the ends
99  * of the traversed bar. The first element in the vector is the distance to the
100  * end closest to the PMT.
101  */
102  std::pair<double, double> GetDistancesToBarEnds(const utl::Point& p) const;
103 
104  /*
105  * The "halo" argument of both the IsHit and IsInsideBar functions will extend the acceptance
106  * region of the function by the entered distance. In the case of IsHit, each side of the
107  * rectangular intersection planes is extended by "halo." In the case of IsInsideBar, each
108  * scintillator wing's rectangular prism dimensions (length, width, height) is extended by
109  * "halo." Keep in mind in both cases that only the actual scintillator bars are considered.
110  * The housing and casing of the scintillator module are not.
111  */
112  bool IsHit(const utl::Point& from, const utl::Vector& direction, const double halo = 0) const;
113 
114  bool IsInsideBar(const utl::Point& p, const double halo = 0) const;
115 
116  /*
117  * The GetMaxRadius and GetMaxHeight functions are used to determine the
118  * boundaries (in cylindrical coordinates) necessary to encompass the
119  * scintillator. One example usage is the injection cylinder of the
120  * CachedShowerRegenerator. It is more effective to calculate these maximum
121  * variables here than to read all the variables necessary to calculate
122  * the them in the relevant modules.
123  */
124  double GetMaxRadius() const;
125 
126  double GetMaxHeight() const;
127 
128  private:
129  Scintillator(const int stationId, const unsigned int isUUB);
130 
131  void Update() const;
132 
133  /*
134  * Helper method to do the redundant work of preparing requests for
135  * scintillator data, sending them to the manager and reporting any errors.
136  * The errorMsg argument should contain a meaningful error message that
137  * will help users understand the situation if the requested component is
138  * not found. It should have a description in English of what was not
139  * located.
140  */
141  template<typename T>
143  GetScintillatorData(T& requestedData,
144  const std::string& property,
145  const std::string& component,
146  const std::string& errorMsg,
147  const bool throwOnFailure = true)
148  const
149  {
150  const det::VManager& manager =
151  det::Detector::GetInstance().GetSManagerRegister();
152  const det::VManager::Status status =
153  manager.GetData(requestedData, property, component, indexMap);
154 
155  if (throwOnFailure && status == det::VManager::eNotFound)
156  NotFoundAndThrow(errorMsg);
157 
158  return status;
159  }
160 
161  void NotFoundAndThrow(const std::string& msg) const;
162 
163  int fStationId = 0;
189 
190  std::pair<double, double> fDistancesToPMT{0, 0};
191 
192  friend class Station;
193 
194  };
195 
196 }
197 
198 
199 #endif
double GetBarLeakageExpCoefficient() const
utl::Validated< utl::Point > fPosition
Point object.
Definition: Point.h:32
utl::Validated< double > fBarLength
det::VManager::Status GetScintillatorData(T &requestedData, const std::string &property, const std::string &component, const std::string &errorMsg, const bool throwOnFailure=true) const
Detector description interface for Station-related data.
utl::Validated< double > fFiberUTurnDiameter
utl::Validated< double > fBarLeakageMaxRatio
utl::Validated< double > fFiberLength
bool IsHit(const utl::Point &from, const utl::Vector &direction, const double halo=0) const
utl::Validated< double > fCasingThickness
utl::Validated< double > fBarWidth
double GetBarExpDecayConstant() const
double GetReferenceEnergy() const
double GetHousingWidth() const
double GetAttenuationLength() const
utl::Validated< double > fRoofOffset
double GetFiberLength() const
Interface for detector managers.
Definition: VManager.h:115
double GetSandwichPanelThickness() const
utl::Validated< double > fSigmaBarToBar
utl::Validated< double > fRoofThickness
std::vector< double > GetDistancesToPMT(const utl::Point &p) const
utl::Validated< double > fEffectiveRefractiveIndex
unsigned int GetNBars() const
virtual Status GetData(double &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
double GetFiberUTurnDiameter() const
double GetHousingThickness() const
std::pair< double, double > GetDistancesToBarEnds(const utl::Point &p) const
utl::Validated< double > fHousingThickness
double GetBarLength() const
utl::Validated< double > fBarThickness
utl::Validated< double > fGap
utl::Validated< double > fHousingWidth
double GetBarLeakageMaxRatio() const
void NotFoundAndThrow(const std::string &msg) const
double GetFiberExpDecayConstant() const
det::VManager::IndexMap indexMap
utl::Validated< double > fReferenceEnergy
utl::Validated< double > fHousingLength
double GetCasingThickness() const
double GetReferencePENumber() const
utl::Validated< double > fFiberExpDecayConstant
utl::Validated< double > fBarLeakageExpCoefficient
utl::Validated< double > fReferencePENumber
std::map< std::string, std::string > IndexMap
Definition: VManager.h:133
utl::Point GetPosition() const
utl::Validated< double > fSandwichPanelThickness
double GetBarThickness() const
Vector object.
Definition: Vector.h:30
double GetHousingLength() const
double GetRoofThickness() const
Scintillator(const int stationId, const unsigned int isUUB)
double GetSigmaBarToBar() const
double GetEffectiveRefractiveIndex() const
utl::Validated< double > fAttenuationLength
utl::Validated< double > fBarExpDecayConstant
bool IsInsideBar(const utl::Point &p, const double halo=0) const
Status
Specifies success or (eventually) various possible failure modes.
Definition: VManager.h:127
std::pair< double, double > fDistancesToPMT
utl::Validated< unsigned int > fNBars

, generated on Tue Sep 26 2023.