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 getT0() const { return mT0; }
70 float getEffVdriftDefault() const { return mEffVdriftDefault; }
71 float getGasGain() const { return mGasGain; }
72 float getNoise() const { return mNoise; }
73 float getChipGain() const { return mChipGain; }
74 float getADCoutRange() const { return mADCoutRange; }
75 float getADCinRange() const { return mADCinRange; }
76 int getADCbaseline() const { return mADCbaseline; }
77 float getTRFlo() const { return mTRFlo; }
78 float getTRFhi() const { return mTRFhi; }
79 float getPadCoupling() const { return mPadCoupling; }
80 float getTimeCoupling() const { return mTimeCoupling; }
81 bool diffusionOn() const { return mDiffusionOn; }
82 bool elAttachOn() const { return mElAttachOn; }
83 float getElAttachProp() const { return mElAttachProp; }
84 bool trfOn() const { return mTRFOn; }
85 bool ctOn() const { return mCTOn; }
86 bool timeStructOn() const { return mTimeStructOn; }
87 bool prfOn() const { return mPRFOn; }
88 int getNumberOfPadsInPadResponse() const { return mNPadsInPadResponse; }
89 double timeResponse(double) const;
90 double crossTalk(double) const;
91 bool isExBOn() const { return mExBOn; }
92 bool isXenon() const { return (mGasMixture == GasMixture::Xenon); }
93 bool isArgon() const { return (mGasMixture == GasMixture::Argon); }
94 GasMixture getGasMixture() const { return mGasMixture; }
95 float getSamplingFrequency() const { return mSamplingFrequency; }
96 float getCachedField() const;
97
98 private:
100 void sampleTRF();
101
102 float mNoise{1250.f};
103 float mChipGain{12.4f};
104 float mADCoutRange{1023.f};
105 float mADCinRange{2000.f};
106 int mADCbaseline{10};
107 bool mDiffusionOn{true};
108 bool mElAttachOn{false};
109 float mElAttachProp{0.f};
110 bool mTRFOn{true};
111 bool mCTOn{true};
112 bool mPRFOn{true};
113 int mNPadsInPadResponse{3};
114 static constexpr int mNBinsMax = 200;
115
116 // From CommonParam
117 GasMixture mGasMixture{GasMixture::Xenon};
118 bool mExBOn{true};
119 bool mFieldCached{false};
120 float mField{0.};
121 float mSamplingFrequency{10.f};
122
123 // Use 0.46, instead of the theroetical value 0.3, since it reproduces better
124 // the test beam data, even tough it is not understood why.
125 float mPadCoupling{.46f};
126 float mTimeCoupling{.4f};
127 bool mTimeStructOn{true};
128
130 std::array<float, mNBinsMax> mTRFsmp{};
131 std::array<float, mNBinsMax> mCTsmp{};
132 int mTRF{0};
133 float mMu{0.};
134 float mSigma{0.03};
135 int mTRFbin{200};
136 float mTRFlo{-.4f};
137 float mTRFhi{3.58f};
138 float mInvTRFwid{static_cast<float>(mTRFbin) / (mTRFhi - mTRFlo)};
139 float mGasGain{4000.f};
140 float mT0{-0.130f};
141
142 float mEffVdriftDefault{1.22f};
143
144 ClassDefNV(SimParam, 2); // The TRD simulation parameters
145};
146
147} // namespace trd
148} // namespace o2
149#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:74
bool timeStructOn() const
Definition SimParam.h:86
SimParam & operator=(const SimParam &)=delete
bool isArgon() const
Definition SimParam.h:93
float getCachedField() const
Definition SimParam.cxx:48
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:71
void setGasGain(float gasgain)
Definition SimParam.h:44
float getEffVdriftDefault() const
Definition SimParam.h:70
double timeResponse(double) const
Definition SimParam.cxx:58
void setADCbaseline(int basel)
Definition SimParam.h:49
float getNoise() const
Definition SimParam.h:72
float getT0() const
Definition SimParam.h:69
double crossTalk(double) const
Definition SimParam.cxx:75
void setADCinRange(float range)
Definition SimParam.h:48
bool isExBOn() const
Definition SimParam.h:91
void setADCoutRange(float range)
Definition SimParam.h:47
bool trfOn() const
Definition SimParam.h:84
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:94
void setElAttachProp(float prop)
Definition SimParam.h:52
float getTRFhi() const
Definition SimParam.h:78
bool ctOn() const
Definition SimParam.h:85
SimParam(const SimParam &)=delete
bool diffusionOn() const
Definition SimParam.h:81
void setDiffusion(bool flag=true)
Definition SimParam.h:50
bool prfOn() const
Definition SimParam.h:87
void setElAttach(bool flag=true)
Definition SimParam.h:51
void setTimeStruct(bool flag=true)
Definition SimParam.h:57
float getADCinRange() const
Definition SimParam.h:75
bool isXenon() const
Definition SimParam.h:92
float getPadCoupling() const
Definition SimParam.h:79
int getADCbaseline() const
Definition SimParam.h:76
bool elAttachOn() const
Definition SimParam.h:82
void setPadResponse(bool flag=true)
Definition SimParam.h:58
float getTimeCoupling() const
Definition SimParam.h:80
float getTRFlo() const
Definition SimParam.h:77
float getElAttachProp() const
Definition SimParam.h:83
float getSamplingFrequency() const
Definition SimParam.h:95
int getNumberOfPadsInPadResponse() const
Definition SimParam.h:88
void setCrossTalk(bool flag=true)
Definition SimParam.h:54
float getChipGain() const
Definition SimParam.h:73
void setTimeResponse(bool flag=true)
Definition SimParam.h:53
void init()
initialization based on configured gas mixture in TRDSimParams
Definition SimParam.cxx:91
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 ...