Project
Loading...
Searching...
No Matches
DigiParams.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
14
15#ifndef ALICEO2_ITSMFT_DIGIPARAMS_H
16#define ALICEO2_ITSMFT_DIGIPARAMS_H
17
18#include <vector>
19#include <algorithm>
20#include <Rtypes.h>
23
25// //
26// Simulation params for Alpide chip //
27// //
28// This is a provisionary implementation, until proper //
29// microscopic simulation and its configuration will //
30// be implemented //
31// //
33
34namespace o2
35{
36namespace itsmft
37{
38
39class AlpideSimResponse;
40
42{
43
45
46 public:
47 DigiParams();
48 ~DigiParams() = default;
49
50 void setNoisePerPixel(float v) { mNoisePerPixel = v; }
51 float getNoisePerPixel() const { return mNoisePerPixel; }
52
53 void setContinuous(bool v) { mIsContinuous = v; }
54 bool isContinuous() const { return mIsContinuous; }
55
56 int getROFrameLengthInBC(int layer = -1) const { return layer < 0 ? mROFrameLengthInBC : mROFrameLayerLengthInBC[layer]; }
57 void setROFrameLengthInBC(int n, int layer = -1) { layer < 0 ? mROFrameLengthInBC = n : mROFrameLayerLengthInBC[layer] = n; }
58
59 void setROFrameLength(float ns, int layer = -1);
60 float getROFrameLength(int layer = -1) const { return layer < 0 ? mROFrameLength : mROFrameLayerLength[layer]; }
61 float getROFrameLengthInv(int layer = -1) const { return layer < 0 ? mROFrameLengthInv : mROFrameLayerLengthInv[layer]; }
62
63 void setStrobeDelay(float ns) { mStrobeDelay = ns; }
64 float getStrobeDelay(int layer = -1) const { return layer < 0 ? mStrobeDelay : mStrobeLayerDelay[layer]; }
65
66 void setStrobeLength(float ns) { mStrobeLength = ns; }
67 float getStrobeLength(int layer = -1) const { return layer < 0 ? mStrobeLength : mStrobeLayerLength[layer]; }
68
69 void setTimeOffset(double sec) { mTimeOffset = sec; }
70 double getTimeOffset() const { return mTimeOffset; }
71
72 void setROFrameBiasInBC(int n, int layer = -1) { layer < 0 ? mROFrameBiasInBC = n : mROFrameLayerBiasInBC[layer] = n; }
73 int getROFrameBiasInBC(int layer = -1) const { return layer < 0 ? mROFrameBiasInBC : mROFrameLayerBiasInBC[layer]; }
74
75 void setChargeThreshold(int v, float frac2Account = 0.1);
76 void setNSimSteps(int v);
77 void setEnergyToNElectrons(float v) { mEnergyToNElectrons = v; }
78
79 void setVbb(float v) { mVbb = v; }
80 void setIBVbb(float v) { mIBVbb = v; }
81 void setOBVbb(float v) { mOBVbb = v; }
82
83 int getChargeThreshold() const { return mChargeThreshold; }
84 int getMinChargeToAccount() const { return mMinChargeToAccount; }
85 int getNSimSteps() const { return mNSimSteps; }
86 float getNSimStepsInv() const { return mNSimStepsInv; }
87 float getEnergyToNElectrons() const { return mEnergyToNElectrons; }
88
89 float getVbb() const { return mVbb; }
90 float getIBVbb() const { return mIBVbb; }
91 float getOBVbb() const { return mOBVbb; }
92
93 bool isTimeOffsetSet() const { return mTimeOffset > -infTime; }
94
95 const o2::itsmft::AlpideSimResponse* getAlpSimResponse() const { return mAlpSimResponse; }
96 void setAlpSimResponse(const o2::itsmft::AlpideSimResponse* par) { mAlpSimResponse = par; }
97
98 const SignalShape& getSignalShape() const { return mSignalShape; }
99 SignalShape& getSignalShape() { return (SignalShape&)mSignalShape; }
100
101 bool withStaggering() const noexcept { return !mROFrameLayerLength.empty(); }
102 void addROFrameLayerLengthInBC(int len) { mROFrameLayerLengthInBC.push_back(len); }
103 void addROFrameLayerBiasInBC(int len) { mROFrameLayerBiasInBC.push_back(len); }
104 void addStrobeLength(float ns) { mStrobeLayerLength.push_back(ns); }
105 void addStrobeDelay(float ns) { mStrobeLayerDelay.push_back(ns); }
106
107 virtual void print() const;
108
109 private:
110 static constexpr double infTime = 1e99;
111 bool mIsContinuous = false;
112 float mNoisePerPixel = 1.e-8;
113 int mROFrameLengthInBC = 0;
114 float mROFrameLength = 0;
115 float mStrobeDelay = 0.;
116 float mStrobeLength = 0;
117 double mTimeOffset = -2 * infTime;
118 int mROFrameBiasInBC = 0;
119 int mChargeThreshold = 150;
120 int mMinChargeToAccount = 15;
121 int mNSimSteps = 7;
122 float mEnergyToNElectrons = 1. / 3.6e-9; // conversion of eloss to Nelectrons
123
124 float mVbb = 0.0;
125 float mIBVbb = 0.0;
126 float mOBVbb = 0.0;
127
128 std::vector<int> mROFrameLayerLengthInBC;
129 std::vector<int> mROFrameLayerBiasInBC;
130 std::vector<float> mROFrameLayerLength;
131 std::vector<float> mStrobeLayerLength;
132 std::vector<float> mStrobeLayerDelay;
133
135
136 const o2::itsmft::AlpideSimResponse* mAlpSimResponse = nullptr;
137
138 // auxiliary precalculated parameters
139 float mROFrameLengthInv = 0;
140 std::vector<float> mROFrameLayerLengthInv; // inverse length of RO frame in ns per layer
141 float mNSimStepsInv = 0;
142
143 ClassDef(DigiParams, 3);
144};
145} // namespace itsmft
146} // namespace o2
147
148#endif
Simple class describing ALPIDE signal time shape.
void addROFrameLayerBiasInBC(int len)
Definition DigiParams.h:103
void setROFrameLength(float ns, int layer=-1)
float getIBVbb() const
Definition DigiParams.h:90
int getMinChargeToAccount() const
Definition DigiParams.h:84
void setEnergyToNElectrons(float v)
Definition DigiParams.h:77
float getStrobeDelay(int layer=-1) const
Definition DigiParams.h:64
void setAlpSimResponse(const o2::itsmft::AlpideSimResponse *par)
Definition DigiParams.h:96
const o2::itsmft::AlpideSimResponse * getAlpSimResponse() const
Definition DigiParams.h:95
void setNoisePerPixel(float v)
Definition DigiParams.h:50
void setIBVbb(float v)
Definition DigiParams.h:80
void addStrobeLength(float ns)
Definition DigiParams.h:104
double getTimeOffset() const
Definition DigiParams.h:70
virtual void print() const
void setChargeThreshold(int v, float frac2Account=0.1)
int getROFrameBiasInBC(int layer=-1) const
Definition DigiParams.h:73
float getROFrameLengthInv(int layer=-1) const
Definition DigiParams.h:61
const SignalShape & getSignalShape() const
Definition DigiParams.h:98
void setTimeOffset(double sec)
Definition DigiParams.h:69
float getVbb() const
Definition DigiParams.h:89
void setStrobeDelay(float ns)
Definition DigiParams.h:63
float getOBVbb() const
Definition DigiParams.h:91
float getStrobeLength(int layer=-1) const
Definition DigiParams.h:67
void addStrobeDelay(float ns)
Definition DigiParams.h:105
void setOBVbb(float v)
Definition DigiParams.h:81
float getEnergyToNElectrons() const
Definition DigiParams.h:87
void setROFrameLengthInBC(int n, int layer=-1)
Definition DigiParams.h:57
bool withStaggering() const noexcept
Definition DigiParams.h:101
int getROFrameLengthInBC(int layer=-1) const
Definition DigiParams.h:56
bool isContinuous() const
Definition DigiParams.h:54
void addROFrameLayerLengthInBC(int len)
Definition DigiParams.h:102
void setStrobeLength(float ns)
Definition DigiParams.h:66
int getChargeThreshold() const
Definition DigiParams.h:83
float getNoisePerPixel() const
Definition DigiParams.h:51
float getNSimStepsInv() const
Definition DigiParams.h:86
SignalShape & getSignalShape()
Definition DigiParams.h:99
float getROFrameLength(int layer=-1) const
Definition DigiParams.h:60
int getNSimSteps() const
Definition DigiParams.h:85
void setROFrameBiasInBC(int n, int layer=-1)
Definition DigiParams.h:72
void setContinuous(bool v)
Definition DigiParams.h:53
void setVbb(float v)
Definition DigiParams.h:79
bool isTimeOffsetSet() const
Definition DigiParams.h:93
GLdouble n
Definition glcorearb.h:1982
const GLdouble * v
Definition glcorearb.h:832
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLenum GLenum GLsizei len
Definition glcorearb.h:4232
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...