Project
Loading...
Searching...
No Matches
GEMAmplification.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef ALICEO2_TPC_GEMAmplification_H_
17#define ALICEO2_TPC_GEMAmplification_H_
18
22#include "TPCBase/CRU.h"
23#include "TPCBase/PadPos.h"
24#include "TPCBase/CalDet.h"
25
26namespace o2
27{
28namespace tpc
29{
30
35
37{
38 public:
41 {
42 static GEMAmplification gemAmplification;
43 return gemAmplification;
44 }
45
48 explicit GEMAmplification(TRandom* rng = nullptr);
49
51 ~GEMAmplification() = default;
52
54 void setRandomRingPositions(TRandom& rng);
55
57 void updateParameters();
58
62 int getStackAmplification(int nElectrons = 1);
63
67 int getEffectiveStackAmplification(int nElectrons = 1);
68
76 int getStackAmplification(const CRU& cru, const PadPos& pos, const AmplificationMode mode, int nElectrons = 1);
77
83 int getSingleGEMAmplification(int nElectrons, int GEM);
84
89 int getElectronLosses(int nElectrons, float probability);
90
97 int getGEMMultiplication(int nElectrons, int GEM);
98
99 private:
102 math_utils::RandomRing<> mRandomGaus;
104 math_utils::RandomRing<> mRandomFlat;
106 std::array<math_utils::RandomRing<>, 4> mGain;
108 math_utils::RandomRing<> mGainFullStack;
109
110 const ParameterGEM* mGEMParam;
111 const ParameterGas* mGasParam;
112 const CalPad* mGainMap;
113};
114
115inline int GEMAmplification::getStackAmplification(const CRU& cru, const PadPos& pos, const AmplificationMode mode, int nElectrons)
116{
119 switch (mode) {
121 return static_cast<int>(static_cast<float>(getStackAmplification(nElectrons)) *
122 mGainMap->getValue(cru, pos.getRow(), pos.getPad()));
123 break;
124 }
126 const int region = static_cast<int>(cru.gemStack());
127 const float relativeGain = mGEMParam->RelativeGainStack[region];
128 return static_cast<int>(static_cast<float>(getEffectiveStackAmplification(nElectrons)) *
129 mGainMap->getValue(cru, pos.getRow(), pos.getPad()) * relativeGain);
130 break;
131 }
132 }
133 return nElectrons;
134}
135} // namespace tpc
136} // namespace o2
137
138#endif // ALICEO2_TPC_GEMAmplification_H_
Definition of the parameter class for the GEM stack.
Definition of the parameter class for the detector gas.
uint16_t pos
Definition RawData.h:3
GEMstack gemStack() const
Definition CRU.h:82
const T getValue(const int sec, const int globalPadInSector) const
Definition CalDet.h:160
void updateParameters()
Update the OCDB parameters cached in the class. To be called once per event.
int getElectronLosses(int nElectrons, float probability)
int getEffectiveStackAmplification(int nElectrons=1)
int getStackAmplification(int nElectrons=1)
int getSingleGEMAmplification(int nElectrons, int GEM)
~GEMAmplification()=default
Destructor.
void setRandomRingPositions(TRandom &rng)
Move the random rings to new positions drawn from rng.
int getGEMMultiplication(int nElectrons, int GEM)
static GEMAmplification & instance()
Default constructor.
@ EffectiveMode
Effective amplification mode using one polya distribution only.
@ FullMode
Full 4-GEM simulation of all efficiencies etc.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
float RelativeGainStack[4]
Relative gain of the stack per region (IROC, OROC1, OROC2, OROC3) for the EffectiveMode.