MDetector/Pixel.h
Go to the documentation of this file.
1 #ifndef _mdet_Pixel_h
2 #define _mdet_Pixel_h
3 
4 #include <mdet/MDetectorComponent.h>
5 #include <mdet/PMT_helper.h>
6 //
7 #include <utl/ShadowPtr.h>
8 #include <utl/Validated.h>
9 #include <utl/Math.h>
10 #include <utl/MathConstants.h>
11 #include <utl/ConsecutiveEnumFactory.h>
12 //
13 #include <complex>
14 #include <cmath>
15 
16 
17 namespace det {
18  struct ParentCreator;
19  struct ComponentUpdater; // Actually not needed because PMT.h -> MComponentGroup.h -> ComponentGroup.h
20 }
21 
22 
23 namespace mdet {
24 
28  typedef std::vector<int> IdsContainer;
29 
30 
31  class PMT;
32 
33 
49  class Pixel : public MDetectorComponent<Pixel>::Type {
50 
51  public:
52  static const char* const kComponentName;
53 
54  static const char* const kComponentId;
55 
56  const PMT& GetPMT() const { return fPMT; }
57 
98  class SPE {
99  public:
101  double
102  TimeSpaceEvaluate(double t)
103  const
104  {
105  /*
106  * Note that the standard function should not receive
107  * Auger-units dependant magnitudes: by dividing
108  * with sigma we independized x from Auger-units.
109  */
110  const double x = (t - fMu) / fSigma;
111  return kOverallSign * fAmplitude * std::exp(-0.5 * utl::Sqr(x));
112  }
113 
115  std::complex<double>
116  FrequencySpaceEvaluate(const double f)
117  const
118  {
119  double rp = -1 * utl::Sqr(fMu) / (2 * utl::Sqr(fSigma));
121  const double ip = -1 * fMu * f;
122  const std::complex<double> e(rp, ip);
124  }
125 
127  double UpperLimit() const { return fMu + fPixel.GetPulseRelevantWidth() * fSigma; }
128 
134  double LowerLimit() const { return fMu - fPixel.GetPulseRelevantWidth() * fSigma; }
135 
136  double GetAmplitude() const { return fAmplitude; }
137 
138  double GetMu() const { return fMu; }
139 
140  double GetSigma() const { return fSigma; }
141 
142  private:
154  static const int kOverallSign = -1;
155 
161  SPE(const Pixel& p, const double a, const double m, const double s)
162  : fPixel(p), fAmplitude(a), fMu(m), fSigma(s) { }
163 
164  const Pixel& fPixel;
165  double fAmplitude = 0;
166  double fMu = 0;
167  double fSigma = 0;
168 
169  // Allow construction.
170  friend class Pixel;
171  };
172 
179  SPE MakeSPEAt(const double t) const;
180 
181  private:
182  void Update(const bool invalidateData, const bool invalidateComponents);
183 
204  };
205 
207  static const char * const PulseParametrizationTags[];
208 
212  // See the following friendship: repeats class name.
213  typedef
219 
221  /*
222  * It isn't possible to define friendship through a typedef: so we need a little verbosity here.
223  * http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf
224  */
225  // See the previous typedef: repeats class name.
227 
233 
238  double GetPulseAmplitudeMean() const;
239 
244  double GetPulseAmplitudeStdDev() const;
245 
250  double GetPulseStdDevMean() const;
251 
256  double GetPulseStdDevStdDev() const;
257 
262  double GetPulseChargeMean() const;
263 
268  double GetPulseChargeStdDev() const;
269 
274  double GetPulseParametersCorrelation() const;
275 
295  double GetPulseRelevantWidth() const;
296 
313  Pixel(const int pId, const det::VManager::IndexMap& parentMap, const PMT& parent);
314 
315  ~Pixel() { }
316 
326 
334 
341 
344 
346  friend struct det::ParentCreator;
347 
352  template<class T>
353  friend void boost::checked_delete(T*) BOOST_NOEXCEPT;
354 
356  friend class PMT;
357 
359  friend class Module;
360 
362  friend struct det::ComponentUpdater;
363 
377 
384  mutable utl::ShadowPtr<CrossTalkContainer> fNeighborsCrossTalk;
385 
390  mutable utl::Validated<double> fCrossTalkNormalizationFactor;
391 
396  typedef std::string PulseParametrizationForConfig;
397 
398  mutable utl::Validated<PulseParametrizationForConfig> fPulseParametrization;
399 
402 
403  mutable utl::Validated<double> fPulseAmplitudeMean;
404 
405  mutable utl::Validated<double> fPulseAmplitudeStdDev;
406 
407  mutable utl::Validated<double> fPulseStdDevMean;
408 
409  mutable utl::Validated<double> fPulseStdDevStdDev;
410 
411  mutable utl::Validated<double> fPulseChargeMean;
412 
413  mutable utl::Validated<double> fPulseChargeStdDev;
414 
415  mutable utl::Validated<double> fPulseParametersCorrelation;
416 
417  mutable utl::Validated<double> fPulseRelevantWidth;
418 
419  const PMT& fPMT;
420 
421  };
422 
423 }
424 
425 
426 #endif
427 
Simple factory to create an enumerator for a given enumeration.
utl::Validated< double > fPulseAmplitudeStdDev
double GetPulseStdDevStdDev() const
Standard deviation of time spread in SPE pulses.
return kOverallSign *fAmplitude * std::exp(-0.5 *utl::Sqr(x))
double LowerLimit() const
Returns the lower temporal limit.
constexpr T Sqr(const T &x)
Amplitude and standard deviation.
utl::Validated< double > fPulseStdDevStdDev
const std::complex< double > e(rp, ip)
PulseParametrization
SPE can be parametrized fixing two of three parameters.
Defines within it the common (templated) type for muon detector hierarchy components.
return kOverallSign *fAmplitude *std::sqrt(2 *utl::kPi)*fSigma *std doubl UpperLimit)() const
Returns the (for all practical purposes) upper temporal limit of the pulse.
utl::Validated< double > fPulseParametersCorrelation
std::vector< double > CrossTalkContainer
Typedef for mdet::Pixel crosstalk container.
Definition: PMT_helper.h:21
utl::Validated< double > fPulseRelevantWidth
const CrossTalkContainer & GetNeighborsCrossTalkCorner() const
Cross-talk coeffcient for neighbors of corner located pixel.
double GetPulseStdDevMean() const
Mean standard deviation in SPE pulses (time spread).
PulseParametrization GetPulseParametrization() const
Type of SPE parametrization actually employed.
static const char *const kComponentName
double GetPulseChargeStdDev() const
Standard deviation of total charge in SPE pulses.
utl::ConsecutiveEnumFactory< PulseParametrization, eChargeAndStandardDeviation, PulseParametrizationTags > PulseParametrizationCreator
Convenience typedef for creation of PulseParametrization enumerators.
double GetPulseRelevantWidth() const
Pulse relevant time width.
constexpr double s
Definition: AugerUnits.h:163
utl::Validated< PulseParametrizationForConfig > fPulseParametrization
utl::Validated< double > fPulseAmplitudeMean
const PMT & GetPMT() const
constexpr double kPi
Definition: MathConstants.h:24
static const int kOverallSign
Overall sign of the pulses.
Array of Scintillator.
double GetSigma() const
double GetAmplitude() const
std::vector< int > IdsContainer
Typedef for container of corresponding Channel, Scintillator, Fiber indices.
double GetPulseAmplitudeMean() const
Mean amplitude of SPE pulses.
Multiple-pixel photo-multiplier tube.
Definition: MDetector/PMT.h:49
utl::Validated< double > fPulseStdDevMean
const PMT & fPMT
utl::ShadowPtr< CrossTalkContainer > fNeighborsCrossTalk
Container for cross-talk coefficients.
utl::Validated< double > fPulseChargeMean
PMT pixel.
const Pixel & fPixel
std::string const
Returns the message that identifies this component.
double GetMu() const
friend void boost::checked_delete(T *) BOOST_NOEXCEPT
Friendship for destruction. Depends on det::ComponentGroup innards.
const VManager::Status f
double GetPulseParametersCorrelation() const
The correlation between the two selected parameters.
std::map< std::string, std::string > IndexMap
Definition: VManager.h:133
Charge and standard deviation.
std::vector< const Pixel * > NeighborsContainer
Typedef for mdet::Pixel neighbor container.
Definition: PMT_helper.h:6
Pixel(const int pId, const det::VManager::IndexMap &parentMap, const PMT &parent)
Constructs the pixel.
static const char *const PulseParametrizationTags[]
Tags for textual representation.
static const char *const kComponentId
utl::Validated< double > fPulseChargeStdDev
void Update(const bool invalidateData, const bool invalidateComponents)
double GetPulseChargeMean() const
Mean total charge in SPE pulses.
utl::ShadowPtr< IdsContainer > fChannelScintillatorFiberIds
Container for indices of corresponding Channel, Scintillator, Fiber.
const IdsContainer & GetChannelScintillatorFiberIds() const
Indices for Channel, Scintillator, Fiber of corrresponding Pixel.
utl::Validated< double > fCrossTalkNormalizationFactor
Conversion factor to percentual values. Handled within mdet::PMT.
Type
The type of file that we are acutally opening.
Definition: IoCodes.h:33
const CrossTalkContainer & GetNeighborsCrossTalkSide() const
Cross-talk coeffcient for neighbors of a side (not corner) located pixel.
NeighborsContainer fNeighbors
Neighbors.
constexpr double m
Definition: AugerUnits.h:121
SPE MakeSPEAt(const double t) const
Constructs an SPE according to this pixel&#39;s characteristics.
const CrossTalkContainer & GetNeighborsCrossTalkInside() const
Cross-talk coeffcient for neighbors of a pixel located inside the pixel matrix.
std::string PulseParametrizationForConfig
Alias for a type considered within the config hierarchy, to be converted to the actual enum...
double GetPulseAmplitudeStdDev() const
Standard deviation of amplitude in SPE pulses.
The child the information from the parent upon construction.
SPE(const Pixel &p, const double a, const double m, const double s)
Construct with the parameters.

, generated on Tue Sep 26 2023.