CbmRoot
CbmTrdFASP.h
Go to the documentation of this file.
1 #ifndef CBMTRDFASP_H
2 #define CBMTRDFASP_H
3 
4 #include <Rtypes.h> // for THashConsistencyHolder, ClassDef
5 #include <RtypesCore.h> // for Int_t, Float_t, ULong64_t, UInt_t, Bool_t
6 #include <TObject.h> // for TObject
7 
8 #include <tuple> // for tuple
9 #include <utility> // for pair
10 #include <vector> // for vector
11 
12 class CbmMatch;
13 class CbmTrdDigi;
15 class TCanvas;
16 class TGraph;
17 class TLine;
18 
19 #define FASP_WINDOW 200
20 #define SHAPER_LUT 80
21 #define NGRAPH 160
22 
24 class CbmTrdFASP : public TObject {
25 public:
29  CbmTrdFASP(UInt_t uslice = 1000);
30  virtual ~CbmTrdFASP();
32  virtual void Clear(Option_t* opt = "");
34  virtual void Draw(Option_t* opt = "");
35  virtual ULong64_t GetEndTime() const { return fStartTime + fProcTime; }
36  virtual ULong64_t GetStartTime() const { return fStartTime; }
38  static Float_t GetBaselineCorr() { return 4095. * fgBaseline / fgOutGain; }
40  virtual Bool_t Go(ULong64_t time);
45  virtual void Init(Int_t col, CbmTrdParFaspChannel* par);
51  virtual void PhysToRaw(std::vector<std::pair<CbmTrdDigi*, CbmMatch*>>* digi,
52  Int_t col = 0,
53  Int_t row = 0);
55  virtual void Print(Option_t* opt = "") const;
59  void SetCol(Int_t col) { fCol = col; }
63  static void SetLGminLength(Int_t nclk) { fgNclkLG = nclk; }
67  static void SetNeighbourTrigger(Bool_t nb = kTRUE) { fgNeighbour = nb; }
71  static void SetNeighbourThr(Float_t thr = 0.1) { fgNeighbourThr = thr; }
75  static void SetShaperThr(Float_t thr = 0.2) { fgShaperThr = thr; }
77  void SetProcTime(ULong64_t t = 0);
79  void SetStartTime(ULong64_t t) { fStartTime = t; }
80 
81 protected:
85  void GetShaperSignal(Double_t charge);
87  Double_t MakeOut(Int_t t);
91  Int_t ProcessShaper(Char_t typ = 'T');
93  void ScanDigi(std::vector<std::pair<CbmTrdDigi*, CbmMatch*>>* digi,
94  Int_t col,
95  Int_t row);
97  void ScanDigiNE(std::vector<std::pair<CbmTrdDigi*, CbmMatch*>>* digi,
98  Int_t col,
99  Int_t row);
101  void WriteDigi();
102 
103  ULong64_t fStartTime;
104  UInt_t
106  Int_t fCol;
107  Int_t fRow;
108  Int_t fAsicId;
109  Int_t fNphys
110  [2];
111  Int_t fNraw;
112  std::vector<std::pair<CbmTrdDigi*, CbmMatch*>>*
114 
115  // analog support
116  std::vector<bool> fHitThPrev;
117  std::vector<Float_t> fShaper;
118  std::vector<Float_t> fShaperNext;
119  std::vector<std::tuple<UInt_t, UInt_t, UInt_t, Bool_t>>
121  Float_t fSignal
122  [FASP_WINDOW];
123 
124  // FASP channel characteristics
126  Int_t fTimeLG;
127  Int_t fTimeFT;
128  Int_t fTimeDY;
129  Float_t fFT;
130 
131  // draw support
132  Int_t fGraphId;
133  std::vector<Float_t> fOut;
134  std::vector<std::pair<Int_t, Int_t>>
136  TGraph* fGraph[NGRAPH];
137  TGraph* fGraphShp[NGRAPH];
138  TGraph* fGraphPhys[NGRAPH];
139  TLine* fGthr;
140  TCanvas* fMonitor;
141 
142  // CADENCE parameters
143  static const Int_t fgkNDB = 53;
144  static const Float_t fgkCharge[fgkNDB];
145  static const Float_t fgkShaper
146  [fgkNDB]
147  [FASP_WINDOW];
148  static const Float_t fgkShaperPar[4];
149  static const Float_t fgkShaperLUT[SHAPER_LUT];
150  static const Float_t
152 
153  // FASP configuration parameters
154  static const Int_t fgkNclkFT;
155  static Int_t fgNclkLG;
156  static Bool_t fgNeighbour;
157  static Float_t
159  static Float_t fgShaperThr;
160  static Float_t fgBaseline;
161  static Float_t fgOutGain;
162 
163  // FASP simulator configuration
164  static const Int_t
166 
167  ClassDef(CbmTrdFASP, 1) // FASP ASIC simulator
168 };
169 
170 #endif
CbmTrdFASP::fGraphMap
std::vector< std::pair< Int_t, Int_t > > fGraphMap
map of ASIC id and output FASP signals
Definition: CbmTrdFASP.h:135
CbmTrdFASP::fGraphId
Int_t fGraphId
current graph to be filled if draw support is compiled
Definition: CbmTrdFASP.h:132
CbmTrdFASP::fSignal
Float_t fSignal[FASP_WINDOW]
temporary array to store shaper analog signal for current charge interpolation
Definition: CbmTrdFASP.h:122
CbmMatch
Definition: CbmMatch.h:22
CbmTrdFASP::ScanDigiNE
void ScanDigiNE(std::vector< std::pair< CbmTrdDigi *, CbmMatch * >> *digi, Int_t col, Int_t row)
Read digi array for neighbour trigger processing.
Definition: CbmTrdFASP.cxx:612
CbmTrdFASP::SetNeighbourThr
static void SetNeighbourThr(Float_t thr=0.1)
Set threshold for the neighbour channel. CADENCE value.
Definition: CbmTrdFASP.h:71
CbmTrdFASP::fgOutGain
static Float_t fgOutGain
FASP -> ADC gain [V/4095 ADC].
Definition: CbmTrdFASP.h:161
CbmTrdFASP::fRow
Int_t fRow
current row
Definition: CbmTrdFASP.h:107
CbmTrdFASP::GetShaperSignal
void GetShaperSignal(Double_t charge)
Retrive linear interpolation of CADENCE for signal.
Definition: CbmTrdFASP.cxx:228
CbmTrdFASP::fNphys
Int_t fNphys[2]
number of physical digi in the current [0] and next [1] shaper
Definition: CbmTrdFASP.h:110
CbmTrdFASP::fGraphPhys
TGraph * fGraphPhys[NGRAPH]
graph representations of physics digi
Definition: CbmTrdFASP.h:138
CbmTrdFASP::fHitThPrev
std::vector< bool > fHitThPrev
previous channel hit threshold
Definition: CbmTrdFASP.h:116
CbmTrdFASP::fTimeDY
Int_t fTimeDY
Time decay from FT [5*ns].
Definition: CbmTrdFASP.h:128
CbmTrdFASP::MakeOut
Double_t MakeOut(Int_t t)
Make convolution of shaper1 superposition and theoretic shaping model (see fgkShaperPar)
Definition: CbmTrdFASP.cxx:271
CbmTrdFASP::~CbmTrdFASP
virtual ~CbmTrdFASP()
Definition: CbmTrdFASP.cxx:84
CbmTrdFASP::fgkShaperPar
static const Float_t fgkShaperPar[4]
shaper parameters
Definition: CbmTrdFASP.h:148
CbmTrdFASP::ScanDigi
void ScanDigi(std::vector< std::pair< CbmTrdDigi *, CbmMatch * >> *digi, Int_t col, Int_t row)
Read digi array for single channel processing.
Definition: CbmTrdFASP.cxx:528
CbmTrdFASP::fGraphShp
TGraph * fGraphShp[NGRAPH]
graph representations of FASP shaper
Definition: CbmTrdFASP.h:137
CbmTrdFASP::fShaperNext
std::vector< Float_t > fShaperNext
next channel shaper analog
Definition: CbmTrdFASP.h:118
CbmTrdFASP::fgkShaperLUT
static const Float_t fgkShaperLUT[SHAPER_LUT]
shaper LUT
Definition: CbmTrdFASP.h:149
CbmTrdFASP::fDigiProc
std::vector< std::tuple< UInt_t, UInt_t, UInt_t, Bool_t > > fDigiProc
proccessed info <hit_time[ns], CS_time[ns], OUT[ADC], trigger>
Definition: CbmTrdFASP.h:120
CbmTrdFASP::fProcTime
UInt_t fProcTime
time window [ns] for actual digi processing (excluded fgkBufferKeep)
Definition: CbmTrdFASP.h:105
CbmTrdFASP::SetShaperThr
static void SetShaperThr(Float_t thr=0.2)
Set threshold for the current channel. CADENCE value.
Definition: CbmTrdFASP.h:75
CbmTrdFASP::fNraw
Int_t fNraw
number of raw digi for the tilt channel
Definition: CbmTrdFASP.h:111
CbmTrdFASP::fStartTime
ULong64_t fStartTime
time offset [ns] for the current simulation
Definition: CbmTrdFASP.h:103
CbmTrdParFaspChannel
Definition of FASP channel calibration container.
Definition: CbmTrdParFasp.h:18
CbmTrdFASP::SetStartTime
void SetStartTime(ULong64_t t)
Set buffer time offset [ns].
Definition: CbmTrdFASP.h:79
CbmTrdFASP::fPar
CbmTrdParFaspChannel * fPar
current FASP channel parametrization
Definition: CbmTrdFASP.h:125
NGRAPH
#define NGRAPH
Definition: CbmTrdFASP.h:21
CbmTrdFASP::fMonitor
TCanvas * fMonitor
monitor canvas when drawing
Definition: CbmTrdFASP.h:140
CbmTrdFASP::fShaper
std::vector< Float_t > fShaper
current channel shaper analog
Definition: CbmTrdFASP.h:117
CbmTrdFASP::GetEndTime
virtual ULong64_t GetEndTime() const
Definition: CbmTrdFASP.h:35
CbmTrdFASP::ProcessShaper
Int_t ProcessShaper(Char_t typ='T')
Calculate output FASP signal and CS timming for the signal array stored in fShaper.
Definition: CbmTrdFASP.cxx:341
CbmTrdFASP::SetLGminLength
static void SetLGminLength(Int_t nclk)
Set linear-gate minimum length.
Definition: CbmTrdFASP.h:63
CbmTrdFASP::fgkCharge
static const Float_t fgkCharge[fgkNDB]
DB input charge discretization.
Definition: CbmTrdFASP.h:144
CbmTrdFASP::fgNeighbour
static Bool_t fgNeighbour
Neighbour enable flag.
Definition: CbmTrdFASP.h:156
CbmTrdFASP
FASP channel simulator.
Definition: CbmTrdFASP.h:24
CbmTrdFASP::fOut
std::vector< Float_t > fOut
analog output for the current channel
Definition: CbmTrdFASP.h:133
CbmTrdFASP::fgNeighbourThr
static Float_t fgNeighbourThr
neighbour threshold [V] for fgNeighbour=kTRUE
Definition: CbmTrdFASP.h:158
CbmTrdFASP::fDigi
std::vector< std::pair< CbmTrdDigi *, CbmMatch * > > * fDigi
link to digi vector to be transformed
Definition: CbmTrdFASP.h:113
CbmTrdFASP::fgkNDB
static const Int_t fgkNDB
DB shaper size.
Definition: CbmTrdFASP.h:143
CbmTrdFASP::Print
virtual void Print(Option_t *opt="") const
Print-out FASP analog/digital response to currently stored data.
Definition: CbmTrdFASP.cxx:310
CbmTrdFASP::Draw
virtual void Draw(Option_t *opt="")
Graphical representation of FASP analog/digital response to currently stored data.
Definition: CbmTrdFASP.cxx:109
SHAPER_LUT
#define SHAPER_LUT
Definition: CbmTrdFASP.h:20
CbmTrdFASP::Clear
virtual void Clear(Option_t *opt="")
Finalize currently stored data.
Definition: CbmTrdFASP.cxx:97
CbmTrdFASP::fTimeFT
Int_t fTimeFT
Chip Select time legth [5*ns].
Definition: CbmTrdFASP.h:127
CbmTrdFASP::Init
virtual void Init(Int_t col, CbmTrdParFaspChannel *par)
[Re]Start processing of one channel
Definition: CbmTrdFASP.cxx:268
CbmTrdFASP::fgkNclkFT
static const Int_t fgkNclkFT
length of flat top in FASP clocks
Definition: CbmTrdFASP.h:154
CbmTrdFASP::fGthr
TLine * fGthr
graph representation of various thresholds
Definition: CbmTrdFASP.h:139
CbmTrdFASP::fFT
Float_t fFT
Flat Top value [V].
Definition: CbmTrdFASP.h:129
CbmTrdFASP::Go
virtual Bool_t Go(ULong64_t time)
Check if there is enough time elapsed from fStartTime to run simulator.
Definition: CbmTrdFASP.cxx:206
CbmTrdFASP::GetStartTime
virtual ULong64_t GetStartTime() const
Definition: CbmTrdFASP.h:36
CbmTrdFASP::fCol
Int_t fCol
current column
Definition: CbmTrdFASP.h:106
CbmTrdFASP::SetCol
void SetCol(Int_t col)
Set column for the current channel.
Definition: CbmTrdFASP.h:59
CbmTrdFASP::fGraph
TGraph * fGraph[NGRAPH]
graph representations of analog FASP response
Definition: CbmTrdFASP.h:136
CbmTrdFASP::fTimeLG
Int_t fTimeLG
Linear gate time length [5*ns].
Definition: CbmTrdFASP.h:126
CbmTrdDigi
Definition: CbmTrdDigi.h:14
CbmTrdFASP::PhysToRaw
virtual void PhysToRaw(std::vector< std::pair< CbmTrdDigi *, CbmMatch * >> *digi, Int_t col=0, Int_t row=0)
Convert physics information in digi to the raw format.
Definition: CbmTrdFASP.cxx:296
FASP_WINDOW
#define FASP_WINDOW
Definition: CbmTrdFASP.h:19
CbmTrdFASP::fgkBufferKeep
static const Int_t fgkBufferKeep
length of buffer time in 5ns which is kept between cycles
Definition: CbmTrdFASP.h:165
CbmTrdFASP::SetProcTime
void SetProcTime(ULong64_t t=0)
Set limit in time for processing digis.
Definition: CbmTrdFASP.cxx:798
CbmTrdFASP::GetBaselineCorr
static Float_t GetBaselineCorr()
Return the baseline value in ADC ch.
Definition: CbmTrdFASP.h:38
CbmTrdFASP::fgkShaper
static const Float_t fgkShaper[fgkNDB][FASP_WINDOW]
DB shaper signals for each input charge discretization.
Definition: CbmTrdFASP.h:147
CbmTrdFASP::fgNclkLG
static Int_t fgNclkLG
length of linear-gate command in FASP clocks
Definition: CbmTrdFASP.h:155
CbmTrdFASP::fgkDecayLUT
static const Float_t fgkDecayLUT[SHAPER_LUT]
forced discharged of FASP LUT
Definition: CbmTrdFASP.h:151
CbmTrdFASP::CbmTrdFASP
CbmTrdFASP(UInt_t uslice=1000)
Constructor of FASP simulator.
Definition: CbmTrdFASP.cxx:40
CbmTrdFASP::WriteDigi
void WriteDigi()
Write processed digi to output array.
Definition: CbmTrdFASP.cxx:807
CbmTrdFASP::fgShaperThr
static Float_t fgShaperThr
shaper threshold [V]
Definition: CbmTrdFASP.h:159
CbmTrdFASP::SetNeighbourTrigger
static void SetNeighbourTrigger(Bool_t nb=kTRUE)
Set FASP trigger mode.
Definition: CbmTrdFASP.h:67
CbmTrdFASP::fAsicId
Int_t fAsicId
identifier of FASP in module
Definition: CbmTrdFASP.h:108
CbmTrdFASP::fgBaseline
static Float_t fgBaseline
FASP baseline [V].
Definition: CbmTrdFASP.h:160