Project
Loading...
Searching...
No Matches
SimParam.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
13
14#ifndef O2_TRD_SIMPARAM_H
15#define O2_TRD_SIMPARAM_H
16
17#include <array>
18#include "Rtypes.h" // for ClassDef
19
20namespace o2
21{
22namespace trd
23{
24
28{
29 public:
30 enum class GasMixture { Xenon,
31 Argon };
32
33 SimParam();
34 SimParam(const SimParam&) = delete;
35 SimParam& operator=(const SimParam&) = delete;
36
38 void init();
39
40 // Cached magnetic field, to be called by the user before using DiffusionAndTimeStructEstimator::GetDiffCoeff
41 void cacheMagField();
42
43 // Setters
44 void setGasGain(float gasgain) { mGasGain = gasgain; }
45 void setNoise(float noise) { mNoise = noise; }
46 void setChipGain(float chipgain) { mChipGain = chipgain; }
47 void setADCoutRange(float range) { mADCoutRange = range; }
48 void setADCinRange(float range) { mADCinRange = range; }
49 void setADCbaseline(int basel) { mADCbaseline = basel; }
50 void setDiffusion(bool flag = true) { mDiffusionOn = flag; }
51 void setElAttach(bool flag = true) { mElAttachOn = flag; }
52 void setElAttachProp(float prop) { mElAttachProp = prop; }
53 void setTimeResponse(bool flag = true) { mTRFOn = flag; }
54 void setCrossTalk(bool flag = true) { mCTOn = flag; }
55 void setPadCoupling(float v) { mPadCoupling = v; }
56 void setTimeCoupling(float v) { mTimeCoupling = v; }
57 void setTimeStruct(bool flag = true) { mTimeStructOn = flag; }
58 void setPadResponse(bool flag = true) { mPRFOn = flag; }
59 void setExB(bool flag = true) { mExBOn = flag; }
60 void setSamplingFrequency(float freq) { mSamplingFrequency = freq; }
61 void setTRF(int trf, float mu = 0., float sigma = 0.3)
62 {
63 mTRF = trf;
64 mMu = mu;
65 mSigma = sigma;
66 }
67
68 // Getters
69 float getGasGain() const { return mGasGain; }
70 float getNoise() const { return mNoise; }
71 float getChipGain() const { return mChipGain; }
72 float getADCoutRange() const { return mADCoutRange; }
73 float getADCinRange() const { return mADCinRange; }
74 int getADCbaseline() const { return mADCbaseline; }
75 float getTRFlo() const { return mTRFlo; }
76 float getTRFhi() const { return mTRFhi; }
77 float getPadCoupling() const { return mPadCoupling; }
78 float getTimeCoupling() const { return mTimeCoupling; }
79 bool diffusionOn() const { return mDiffusionOn; }
80 bool elAttachOn() const { return mElAttachOn; }
81 float getElAttachProp() const { return mElAttachProp; }
82 bool trfOn() const { return mTRFOn; }
83 bool ctOn() const { return mCTOn; }
84 bool timeStructOn() const { return mTimeStructOn; }
85 bool prfOn() const { return mPRFOn; }
86 int getNumberOfPadsInPadResponse() const { return mNPadsInPadResponse; }
87 double timeResponse(double) const;
88 double crossTalk(double) const;
89 bool isExBOn() const { return mExBOn; }
90 bool isXenon() const { return (mGasMixture == GasMixture::Xenon); }
91 bool isArgon() const { return (mGasMixture == GasMixture::Argon); }
92 GasMixture getGasMixture() const { return mGasMixture; }
93 float getSamplingFrequency() const { return mSamplingFrequency; }
94 float getCachedField() const;
95
96 private:
98 void sampleTRF();
99
100 float mNoise{1250.f};
101 float mChipGain{12.4f};
102 float mADCoutRange{1023.f};
103 float mADCinRange{2000.f};
104 int mADCbaseline{10};
105 bool mDiffusionOn{true};
106 bool mElAttachOn{false};
107 float mElAttachProp{0.f};
108 bool mTRFOn{true};
109 bool mCTOn{true};
110 bool mPRFOn{true};
111 int mNPadsInPadResponse{3};
112 static constexpr int mNBinsMax = 200;
113
114 // From CommonParam
115 GasMixture mGasMixture{GasMixture::Xenon};
116 bool mExBOn{true};
117 bool mFieldCached{false};
118 float mField{0.};
119 float mSamplingFrequency{10.f};
120
121 // Use 0.46, instead of the theroetical value 0.3, since it reproduces better
122 // the test beam data, even tough it is not understood why.
123 float mPadCoupling{.46f};
124 float mTimeCoupling{.4f};
125 bool mTimeStructOn{true};
126
128 std::array<float, mNBinsMax> mTRFsmp{};
129 std::array<float, mNBinsMax> mCTsmp{};
130 int mTRF{0};
131 float mMu{0.};
132 float mSigma{0.03};
133 int mTRFbin{200};
134 float mTRFlo{-.4f};
135 float mTRFhi{3.58f};
136 float mInvTRFwid{static_cast<float>(mTRFbin) / (mTRFhi - mTRFlo)};
137 float mGasGain{4000.f};
138
139 ClassDefNV(SimParam, 2); // The TRD simulation parameters
140};
141
142} // namespace trd
143} // namespace o2
144#endif
Constant parameters for the TRD simulation.
Definition SimParam.h:28
void setTimeCoupling(float v)
Definition SimParam.h:56
float getADCoutRange() const
Definition SimParam.h:72
bool timeStructOn() const
Definition SimParam.h:84
SimParam & operator=(const SimParam &)=delete
bool isArgon() const
Definition SimParam.h:91
float getCachedField() const
Definition SimParam.cxx:47
void setTRF(int trf, float mu=0., float sigma=0.3)
Definition SimParam.h:61
void setChipGain(float chipgain)
Definition SimParam.h:46
float getGasGain() const
Definition SimParam.h:69
void setGasGain(float gasgain)
Definition SimParam.h:44
double timeResponse(double) const
Definition SimParam.cxx:57
void setADCbaseline(int basel)
Definition SimParam.h:49
float getNoise() const
Definition SimParam.h:70
double crossTalk(double) const
Definition SimParam.cxx:74
void setADCinRange(float range)
Definition SimParam.h:48
bool isExBOn() const
Definition SimParam.h:89
void setADCoutRange(float range)
Definition SimParam.h:47
bool trfOn() const
Definition SimParam.h:82
void setPadCoupling(float v)
Definition SimParam.h:55
void setExB(bool flag=true)
Definition SimParam.h:59
void setSamplingFrequency(float freq)
Definition SimParam.h:60
void setNoise(float noise)
Definition SimParam.h:45
GasMixture getGasMixture() const
Definition SimParam.h:92
void setElAttachProp(float prop)
Definition SimParam.h:52
float getTRFhi() const
Definition SimParam.h:76
bool ctOn() const
Definition SimParam.h:83
SimParam(const SimParam &)=delete
bool diffusionOn() const
Definition SimParam.h:79
void setDiffusion(bool flag=true)
Definition SimParam.h:50
bool prfOn() const
Definition SimParam.h:85
void setElAttach(bool flag=true)
Definition SimParam.h:51
void setTimeStruct(bool flag=true)
Definition SimParam.h:57
float getADCinRange() const
Definition SimParam.h:73
bool isXenon() const
Definition SimParam.h:90
float getPadCoupling() const
Definition SimParam.h:77
int getADCbaseline() const
Definition SimParam.h:74
bool elAttachOn() const
Definition SimParam.h:80
void setPadResponse(bool flag=true)
Definition SimParam.h:58
float getTimeCoupling() const
Definition SimParam.h:78
float getTRFlo() const
Definition SimParam.h:75
float getElAttachProp() const
Definition SimParam.h:81
float getSamplingFrequency() const
Definition SimParam.h:93
int getNumberOfPadsInPadResponse() const
Definition SimParam.h:86
void setCrossTalk(bool flag=true)
Definition SimParam.h:54
float getChipGain() const
Definition SimParam.h:71
void setTimeResponse(bool flag=true)
Definition SimParam.h:53
void init()
initialization based on configured gas mixture in TRDSimParams
Definition SimParam.cxx:90
const GLdouble * v
Definition glcorearb.h:832
GLenum GLint * range
Definition glcorearb.h:1899
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...