CbmRoot
|
FASP channel simulator. More...
#include <CbmTrdFASP.h>
Public Member Functions | |
CbmTrdFASP (UInt_t uslice=1000) | |
Constructor of FASP simulator. | |
virtual | ~CbmTrdFASP () |
virtual void | Clear (Option_t *opt="") |
Finalize currently stored data. | |
virtual void | Draw (Option_t *opt="") |
Graphical representation of FASP analog/digital response to currently stored data. | |
virtual ULong64_t | GetEndTime () const |
virtual ULong64_t | GetStartTime () const |
virtual Bool_t | Go (ULong64_t time) |
Check if there is enough time elapsed from fStartTime to run simulator. | |
virtual void | InitChannel (int id, const CbmTrdParFaspChannel *par, int asicId=-1, int chId=-1) |
[Re]Initialize one of the two FASP channels | |
virtual void | PhysToRaw (std::vector< std::pair< CbmTrdDigi *, CbmMatch * > > *digi) |
Convert physics information in digi to the raw format. | |
virtual void | Print (Option_t *opt="") const |
Print-out FASP analog/digital response to currently stored data. | |
void | SetProcTime (ULong64_t t=0) |
Set limit in time for processing digis. | |
void | SetStartTime (ULong64_t t) |
Set buffer time offset [ns]. | |
Static Public Member Functions | |
static Float_t | GetBaselineCorr () |
Return the baseline value in ADC ch. | |
static void | SetLGminLength (Int_t nclk) |
Set linear-gate minimum length. | |
static void | SetNeighbourTrigger (Bool_t nb=kTRUE) |
Set FASP trigger mode. | |
static void | SetNeighbourThr (Float_t thr=0.1) |
Set threshold for the neighbour channel. CADENCE value. | |
static void | SetShaperThr (Float_t thr=0.2) |
Set threshold for the current channel. CADENCE value. | |
Protected Member Functions | |
int | AddGraph (char typ='T') |
void | GetShaperSignal (Double_t charge) |
Retrive linear interpolation of CADENCE for signal. | |
Double_t | MakeOut (Int_t t) |
Make convolution of shaper1 superposition and theoretic shaping model (see fgkShaperPar) | |
Int_t | ProcessShaper (Char_t typ='T') |
Calculate output FASP signal and CS timming for the signal array stored in fShaper. | |
void | ScanDigi (std::vector< std::pair< CbmTrdDigi *, CbmMatch * > > *digi) |
Read digi array for one pair T/R defined by the pad column. | |
void | ScanDigiNE (std::vector< std::pair< CbmTrdDigi *, CbmMatch * > > *digi) |
Read digi array for neighbour trigger processing. | |
void | WriteDigi () |
Write processed digi to output array. | |
Protected Attributes | |
ULong64_t | fStartTime = 0 |
time offset [ns] for the current simulation | |
UInt_t | fProcTime = 0 |
time window [ns] for actual digi processing (excluded fgkBufferKeep) | |
int | fPad = -1 |
current pad as defined by CbmTrdModuleAbstract::GetPadAddress() | |
Int_t | fNphys [2] |
number of physical digi in the current [0] and next [1] shaper | |
Int_t | fNraw = 0 |
number of raw digi for the tilt channel | |
std::vector< std::pair< CbmTrdDigi *, CbmMatch * > > * | fDigi = nullptr |
link to digi vector to be transformed | |
std::vector< bool > | fHitThPrev = {0} |
previous channel hit threshold | |
std::vector< Float_t > | fShaper = {0.} |
current channel shaper analog | |
std::vector< Float_t > | fShaperNext = {0.} |
next channel shaper analog | |
std::vector< std::tuple< UInt_t, UInt_t, UInt_t, Bool_t > > | fDigiProc |
proccessed info wrt fStartTime <hit_time[ns], CS_time[ns], OUT[ADC], trigger> | |
Float_t | fSignal [FASP_WINDOW] |
temporary array to store shaper analog signal for current charge interpolation | |
const CbmTrdParFaspChannel * | fPar [2] = {nullptr} |
current FASP ASIC parametrization | |
Int_t | fTimeLG = -1 |
Linear gate time length [5*ns]. | |
Int_t | fTimeFT = -1 |
Chip Select time legth [5*ns]. | |
Int_t | fTimeDY = -1 |
Time decay from FT [5*ns]. | |
Float_t | fFT = 0. |
Flat Top value [V]. | |
int | fNgraph = 1 |
No of graphs generated. | |
int | fAsicId [2] = {-1, -1} |
identifier of FASP(s) in module | |
int | fChId [2] = {-1, -1} |
FASP channels being processed. | |
std::vector< Float_t > | fOut = {0.} |
analog output for the current channel | |
std::map< int, std::array< int, NFASPCH > > | fGraphMap |
map of ASIC_id and (ch_id, output_id of FASP signals graphs) pairs | |
TGraph * | fGraph [NGRAPH] = {nullptr} |
graph representations of analog FASP response | |
TGraph * | fGraphShp [NGRAPH] = {nullptr} |
graph representations of FASP shaper | |
TGraph * | fGraphPhys [NGRAPH] = {nullptr} |
graph representations of physics digi | |
TLine * | fGthr = nullptr |
graph representation of various thresholds | |
TCanvas * | fMonitor = nullptr |
monitor canvas when drawing | |
Static Protected Attributes | |
static const Int_t | fgkNDB = 53 |
DB shaper size. | |
static const Float_t | fgkCharge [fgkNDB] |
DB input charge discretization. | |
static const Float_t | fgkShaper [fgkNDB][FASP_WINDOW] |
DB shaper signals for each input charge discretization. | |
static const Float_t | fgkShaperPar [4] = {0.068, 26.1, 2.61, 50} |
shaper parameters | |
static const Float_t | fgkShaperLUT [SHAPER_LUT] |
shaper LUT | |
static const Float_t | fgkDecayLUT [SHAPER_LUT] |
forced discharged of FASP LUT | |
static const Int_t | fgkNclkFT = 14 |
length of flat top in FASP clocks | |
static Int_t | fgNclkLG = 31 |
length of linear-gate command in FASP clocks | |
static Bool_t | fgNeighbour = kFALSE |
Neighbour enable flag. | |
static Float_t | fgNeighbourThr = 0.04 |
neighbour threshold [V] for fgNeighbour=kTRUE | |
static Float_t | fgShaperThr = 0.08 |
shaper threshold [V] | |
static Float_t | fgBaseline = 0.25 |
FASP baseline [V]. | |
static Float_t | fgOutGain = 2.025 |
FASP -> ADC gain [V/4095 ADC]. | |
static const Int_t | fgkBufferKeep = 400 |
length of buffer time in 5ns which is kept between cycles | |
FASP channel simulator.
Definition at line 30 of file CbmTrdFASP.h.
CbmTrdFASP::CbmTrdFASP | ( | UInt_t | uslice = 1000 | ) |
Constructor of FASP simulator.
[in] | uslice | length of microslice [ns] |
Build the FASP simulator for a microslice of 5*uslice [ns]
Definition at line 46 of file CbmTrdFASP.cxx.
References DRAW, fgkBufferKeep, fGraph, fGraphPhys, fGraphShp, fHitThPrev, fNphys, fOut, fShaper, fShaperNext, NGRAPH, and SetProcTime().
|
virtual |
Definition at line 70 of file CbmTrdFASP.cxx.
References DRAW, fGraph, fGraphPhys, fGraphShp, fMonitor, NGRAPH, and VERBOSE.
|
protected |
Definition at line 130 of file CbmTrdFASP.cxx.
References fAsicId, fChId, fGraph, fGraphPhys, fGraphShp, fNgraph, fOut, fPad, fStartTime, and NGRAPH.
Referenced by ScanDigi().
|
virtual |
Finalize currently stored data.
Definition at line 84 of file CbmTrdFASP.cxx.
References Draw(), fHitThPrev, fNphys, ProcessShaper(), and WriteDigi().
Referenced by CbmTrdModuleSim2D::FlushBuffer().
|
virtual |
Graphical representation of FASP analog/digital response to currently stored data.
Definition at line 166 of file CbmTrdFASP.cxx.
References DRAW, fgNeighbourThr, fGraph, fGraphMap, fGraphPhys, fGraphShp, fgShaperThr, fGthr, fMonitor, fOut, and NFASPCH.
Referenced by Clear().
|
inlinestatic |
Return the baseline value in ADC ch.
Definition at line 44 of file CbmTrdFASP.h.
References fgBaseline, and fgOutGain.
Referenced by CbmTrdDigiRec::GetCharge(), and CbmTrdModuleRec2D::LoadDigisRC().
|
inlinevirtual |
Definition at line 41 of file CbmTrdFASP.h.
References fProcTime, and fStartTime.
Referenced by CbmTrdModuleSim2D::FlushBuffer().
|
protected |
Retrive linear interpolation of CADENCE for signal.
[in] | charge | charge on channel |
Retrive linear interpolation of CADENCE simulations around the input charge and store them in the fSignal array for further processing
Definition at line 242 of file CbmTrdFASP.cxx.
References FASP_WINDOW, fgkCharge, fgkNDB, fgkShaper, fSignal, and VERBOSE.
Referenced by ScanDigi().
|
inlinevirtual |
Definition at line 42 of file CbmTrdFASP.h.
References fStartTime.
Referenced by CbmTrdModuleSim2D::FlushBuffer().
|
virtual |
Check if there is enough time elapsed from fStartTime to run simulator.
Start FASP simulator if at least the fProcTime has elapsed from buffer start time. time - event time in ns
Definition at line 219 of file CbmTrdFASP.cxx.
References fProcTime, and fStartTime.
Referenced by CbmTrdModuleSim2D::FlushBuffer().
|
virtual |
[Re]Initialize one of the two FASP channels
[in] | id | FASP-CHANNEL identifier |
[in] | par | FASP-CHANNEL parametrization |
[in] | asicId | FASP id on the module (as in the DAQ mapping) to be used on drawing |
[in] | chId | FASP-CHANNEL id on the module (as in the DAQ mapping) to be used on drawing |
Definition at line 95 of file CbmTrdFASP.cxx.
References DRAW, fAsicId, fChId, fGraph, fGraphMap, fGraphPhys, fGraphShp, fPar, and NFASPCH.
Referenced by CbmTrdModuleSim2D::FlushBuffer().
|
protected |
Make convolution of shaper1 superposition and theoretic shaping model (see fgkShaperPar)
Definition at line 278 of file CbmTrdFASP.cxx.
References fFT, fgkDecayLUT, fgkShaperLUT, fShaper, fTimeDY, fTimeFT, and SHAPER_LUT.
Referenced by ProcessShaper().
|
virtual |
Convert physics information in digi to the raw format.
[in] | digi | list of digits for the current pad |
Public interface for converting physical digi to raw digi. See ScanDigi and ScanDigiNE for the actual algorithms
Definition at line 304 of file CbmTrdFASP.cxx.
References fgNeighbour, ScanDigi(), and ScanDigiNE().
Referenced by CbmTrdModuleSim2D::FlushBuffer().
|
virtual |
Print-out FASP analog/digital response to currently stored data.
Dump settings for the FASP simulator and optionally the content of the current buffers.
Definition at line 315 of file CbmTrdFASP.cxx.
References CbmTrdDigi::Clk(), fgkNclkFT, fgNclkLG, fgNeighbour, fgNeighbourThr, fgShaperThr, fPad, fShaper, fShaperNext, and CbmTrdDigi::kFASP.
|
protected |
Calculate output FASP signal and CS timming for the signal array stored in fShaper.
Simulate the logic block of the FASP ASIC and apply shapper forming time (see MakeOut()). Calculate the following logic signals:
Optionally the analog input and output for the current channel are also saved if DRAW is defined.
Definition at line 339 of file CbmTrdFASP.cxx.
References CbmTrdDigi::Clk(), DRAW, fAsicId, fChId, fDigiProc, fFT, fgBaseline, fgkNclkFT, fgNclkLG, fgNeighbour, fgNeighbourThr, fgOutGain, fGraph, fGraphMap, fGraphShp, fgShaperThr, fHitThPrev, fNphys, fOut, fPad, fShaper, fShaperNext, fStartTime, fTimeDY, fTimeFT, fTimeLG, CbmTrdDigi::kFASP, MakeOut(), max(), SHAPER_LUT, and VERBOSE.
Referenced by Clear(), and ScanDigi().
|
protected |
Read digi array for one pair T/R defined by the pad column.
[in] | digi | the set of digi and their MC info if avilable |
Transform point like time distribution of digis into the time dependent analog signal of the first FASP shaper
Definition at line 498 of file CbmTrdFASP.cxx.
References AddGraph(), DRAW, fAsicId, FASP_WINDOW, fChId, fDigi, fGraphMap, fGraphPhys, fNphys, fNraw, fPad, fShaper, fShaperNext, fSignal, fStartTime, CbmTrdDigi::GetAddressChannel(), CbmTrdDigi::GetCharge(), GetShaperSignal(), CbmTrdDigi::GetTime(), CbmTrdDigi::GetTimeDAQ(), ProcessShaper(), VERBOSE, and WriteDigi().
Referenced by PhysToRaw().
|
protected |
Read digi array for neighbour trigger processing.
Transform point like time distribution of digis into the time dependent analog signal of the first FASP shaper and process output (see ProcessShaper())
Definition at line 576 of file CbmTrdFASP.cxx.
Referenced by PhysToRaw().
|
inlinestatic |
Set linear-gate minimum length.
[in] | nclk | number of clock cycles at current clock frequency |
Definition at line 63 of file CbmTrdFASP.h.
References fgNclkLG.
Referenced by CbmTrdModuleSim2D::FlushBuffer().
|
inlinestatic |
Set threshold for the neighbour channel. CADENCE value.
[in] | thr | Threshold value [V] - default 100 mV |
Definition at line 71 of file CbmTrdFASP.h.
References fgNeighbourThr.
|
inlinestatic |
Set FASP trigger mode.
[in] | nb | Enable trigger for neighbor channels [default = on] |
Definition at line 67 of file CbmTrdFASP.h.
References fgNeighbour.
Referenced by CbmTrdModuleSim2D::FlushBuffer().
void CbmTrdFASP::SetProcTime | ( | ULong64_t | t = 0 | ) |
Set limit in time for processing digis.
Definition at line 741 of file CbmTrdFASP.cxx.
References fgkBufferKeep, fProcTime, fShaper, and fStartTime.
Referenced by CbmTrdFASP(), and CbmTrdModuleSim2D::FlushBuffer().
|
inlinestatic |
Set threshold for the current channel. CADENCE value.
[in] | thr | Threshold value [V] - default 200 mV |
Definition at line 75 of file CbmTrdFASP.h.
References fgShaperThr.
|
inline |
Set buffer time offset [ns].
Definition at line 79 of file CbmTrdFASP.h.
References fStartTime.
Referenced by CbmTrdModuleSim2D::FlushBuffer().
|
protected |
Write processed digi to output array.
Definition at line 750 of file CbmTrdFASP.cxx.
References CbmTrdDigi::Clk(), fDigi, fDigiProc, fNraw, fProcTime, fStartTime, CbmTrdDigi::GetCharge(), CbmTrdDigi::GetTime(), CbmTrdDigi::GetTimeDAQ(), CbmTrdDigi::GetTriggerType(), CbmTrdDigi::IsFlagged(), CbmTrdDigi::kFASP, CbmTrdDigi::SetFlag(), CbmMatch::ToString(), CbmTrdDigi::ToString(), and VERBOSE.
Referenced by Clear(), and ScanDigi().
|
protected |
identifier of FASP(s) in module
Definition at line 127 of file CbmTrdFASP.h.
Referenced by AddGraph(), InitChannel(), ProcessShaper(), and ScanDigi().
|
protected |
FASP channels being processed.
Definition at line 128 of file CbmTrdFASP.h.
Referenced by AddGraph(), InitChannel(), ProcessShaper(), and ScanDigi().
|
protected |
link to digi vector to be transformed
Definition at line 107 of file CbmTrdFASP.h.
Referenced by ScanDigi(), and WriteDigi().
|
protected |
proccessed info wrt fStartTime <hit_time[ns], CS_time[ns], OUT[ADC], trigger>
Definition at line 113 of file CbmTrdFASP.h.
Referenced by ProcessShaper(), and WriteDigi().
|
protected |
Flat Top value [V].
Definition at line 123 of file CbmTrdFASP.h.
Referenced by MakeOut(), and ProcessShaper().
|
staticprotected |
FASP baseline [V].
Definition at line 152 of file CbmTrdFASP.h.
Referenced by GetBaselineCorr(), and ProcessShaper().
|
staticprotected |
length of buffer time in 5ns which is kept between cycles
Definition at line 156 of file CbmTrdFASP.h.
Referenced by CbmTrdFASP(), and SetProcTime().
|
staticprotected |
DB input charge discretization.
Definition at line 926 of file CbmTrdFASP.h.
Referenced by GetShaperSignal().
|
staticprotected |
forced discharged of FASP LUT
Definition at line 917 of file CbmTrdFASP.h.
Referenced by MakeOut().
|
staticprotected |
length of flat top in FASP clocks
Definition at line 147 of file CbmTrdFASP.h.
Referenced by Print(), and ProcessShaper().
|
staticprotected |
|
staticprotected |
DB shaper signals for each input charge discretization.
Definition at line 930 of file CbmTrdFASP.h.
Referenced by GetShaperSignal().
|
staticprotected |
shaper LUT
Definition at line 908 of file CbmTrdFASP.h.
Referenced by MakeOut().
|
staticprotected |
shaper parameters
Definition at line 907 of file CbmTrdFASP.h.
|
staticprotected |
length of linear-gate command in FASP clocks
Definition at line 148 of file CbmTrdFASP.h.
Referenced by Print(), ProcessShaper(), and SetLGminLength().
|
staticprotected |
Neighbour enable flag.
Definition at line 149 of file CbmTrdFASP.h.
Referenced by PhysToRaw(), Print(), ProcessShaper(), and SetNeighbourTrigger().
|
staticprotected |
neighbour threshold [V] for fgNeighbour=kTRUE
Definition at line 150 of file CbmTrdFASP.h.
Referenced by Draw(), Print(), ProcessShaper(), and SetNeighbourThr().
|
staticprotected |
FASP -> ADC gain [V/4095 ADC].
Definition at line 153 of file CbmTrdFASP.h.
Referenced by GetBaselineCorr(), and ProcessShaper().
|
protected |
graph representations of analog FASP response
Definition at line 132 of file CbmTrdFASP.h.
Referenced by AddGraph(), CbmTrdFASP(), Draw(), InitChannel(), ProcessShaper(), and ~CbmTrdFASP().
|
protected |
map of ASIC_id and (ch_id, output_id of FASP signals graphs) pairs
Definition at line 131 of file CbmTrdFASP.h.
Referenced by Draw(), InitChannel(), ProcessShaper(), and ScanDigi().
|
protected |
graph representations of physics digi
Definition at line 134 of file CbmTrdFASP.h.
Referenced by AddGraph(), CbmTrdFASP(), Draw(), InitChannel(), ScanDigi(), and ~CbmTrdFASP().
|
protected |
graph representations of FASP shaper
Definition at line 133 of file CbmTrdFASP.h.
Referenced by AddGraph(), CbmTrdFASP(), Draw(), InitChannel(), ProcessShaper(), and ~CbmTrdFASP().
|
staticprotected |
shaper threshold [V]
Definition at line 151 of file CbmTrdFASP.h.
Referenced by Draw(), Print(), ProcessShaper(), and SetShaperThr().
|
protected |
graph representation of various thresholds
Definition at line 135 of file CbmTrdFASP.h.
Referenced by Draw().
|
protected |
previous channel hit threshold
Definition at line 110 of file CbmTrdFASP.h.
Referenced by CbmTrdFASP(), Clear(), and ProcessShaper().
|
protected |
monitor canvas when drawing
Definition at line 136 of file CbmTrdFASP.h.
Referenced by Draw(), and ~CbmTrdFASP().
|
protected |
|
protected |
number of physical digi in the current [0] and next [1] shaper
Definition at line 105 of file CbmTrdFASP.h.
Referenced by CbmTrdFASP(), Clear(), ProcessShaper(), and ScanDigi().
|
protected |
number of raw digi for the tilt channel
Definition at line 106 of file CbmTrdFASP.h.
Referenced by ScanDigi(), and WriteDigi().
|
protected |
analog output for the current channel
Definition at line 129 of file CbmTrdFASP.h.
Referenced by AddGraph(), CbmTrdFASP(), Draw(), and ProcessShaper().
|
protected |
current pad as defined by CbmTrdModuleAbstract::GetPadAddress()
Definition at line 104 of file CbmTrdFASP.h.
Referenced by AddGraph(), Print(), ProcessShaper(), and ScanDigi().
|
protected |
current FASP ASIC parametrization
Definition at line 119 of file CbmTrdFASP.h.
Referenced by InitChannel().
|
protected |
time window [ns] for actual digi processing (excluded fgkBufferKeep)
Definition at line 103 of file CbmTrdFASP.h.
Referenced by GetEndTime(), Go(), SetProcTime(), and WriteDigi().
|
protected |
current channel shaper analog
Definition at line 111 of file CbmTrdFASP.h.
Referenced by CbmTrdFASP(), MakeOut(), Print(), ProcessShaper(), ScanDigi(), and SetProcTime().
|
protected |
next channel shaper analog
Definition at line 112 of file CbmTrdFASP.h.
Referenced by CbmTrdFASP(), Print(), ProcessShaper(), and ScanDigi().
|
protected |
temporary array to store shaper analog signal for current charge interpolation
Definition at line 115 of file CbmTrdFASP.h.
Referenced by GetShaperSignal(), and ScanDigi().
|
protected |
time offset [ns] for the current simulation
Definition at line 102 of file CbmTrdFASP.h.
Referenced by AddGraph(), GetEndTime(), GetStartTime(), Go(), ProcessShaper(), ScanDigi(), SetProcTime(), SetStartTime(), and WriteDigi().
|
protected |
Time decay from FT [5*ns].
Definition at line 122 of file CbmTrdFASP.h.
Referenced by MakeOut(), and ProcessShaper().
|
protected |
Chip Select time legth [5*ns].
Definition at line 121 of file CbmTrdFASP.h.
Referenced by MakeOut(), and ProcessShaper().
|
protected |
Linear gate time length [5*ns].
Definition at line 120 of file CbmTrdFASP.h.
Referenced by ProcessShaper().