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
47 ~GEMAmplification() = default;
48
50 void updateParameters();
51
55 int getStackAmplification(int nElectrons = 1);
56
60 int getEffectiveStackAmplification(int nElectrons = 1);
61
69 int getStackAmplification(const CRU& cru, const PadPos& pos, const AmplificationMode mode, int nElectrons = 1);
70
76 int getSingleGEMAmplification(int nElectrons, int GEM);
77
82 int getElectronLosses(int nElectrons, float probability);
83
90 int getGEMMultiplication(int nElectrons, int GEM);
91
92 private:
94
97 math_utils::RandomRing<> mRandomGaus;
99 math_utils::RandomRing<> mRandomFlat;
101 std::array<math_utils::RandomRing<>, 4> mGain;
103 math_utils::RandomRing<> mGainFullStack;
104
105 const ParameterGEM* mGEMParam;
106 const ParameterGas* mGasParam;
107 const CalPad* mGainMap;
108};
109
110inline int GEMAmplification::getStackAmplification(const CRU& cru, const PadPos& pos, const AmplificationMode mode, int nElectrons)
111{
114 switch (mode) {
116 return static_cast<int>(static_cast<float>(getStackAmplification(nElectrons)) *
117 mGainMap->getValue(cru, pos.getRow(), pos.getPad()));
118 break;
119 }
121 return static_cast<int>(static_cast<float>(getEffectiveStackAmplification(nElectrons)) *
122 mGainMap->getValue(cru, pos.getRow(), pos.getPad()));
123 break;
124 }
125 }
126 return nElectrons;
127}
128} // namespace tpc
129} // namespace o2
130
131#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
const T getValue(const int sec, const int globalPadInSector) const
Definition CalDet.h:154
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.
int getGEMMultiplication(int nElectrons, int GEM)
static GEMAmplification & instance()
Default constructor.
GLenum mode
Definition glcorearb.h:266
@ 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 ...