CbmRoot
|
Class for the simulation of a readout unit in the CBM-STS. More...
#include <CbmStsSimModule.h>
Public Member Functions | |
CbmStsSimModule (CbmStsElement *setupModule=nullptr, const CbmStsParModule *modulePar=nullptr, CbmStsDigitize *digitizer=nullptr) | |
Standard constructor. More... | |
CbmStsSimModule (const CbmStsSimModule &)=delete | |
Copy constructor (disabled) More... | |
CbmStsSimModule & | operator= (const CbmStsSimModule &)=delete |
Assignment operator (disabled) More... | |
virtual | ~CbmStsSimModule () |
Destructor. More... | |
void | AddSignal (UShort_t channel, Double_t time, Double_t charge, Int_t index=0, Int_t entry=0, Int_t file=0) |
void | BufferStatus (Int_t &nofSignals, Double_t &timeFirst, Double_t &timeLast) |
CbmStsDigitize * | GetDigitizer () const |
Digitizer task. More... | |
UShort_t | GetNofChannels () const |
Number of electronic channels @value Number of ADC channels. More... | |
void | InitAnalogBuffer () |
Bool_t | IsSet () const |
Int_t | ProcessAnalogBuffer (Double_t readoutTime) |
void | SetParams (const CbmStsParModule ¶ms) |
Int_t | GenerateNoise (Double_t t1, Double_t t2) |
Generate noise. More... | |
std::string | ToString () const |
Static Public Member Functions | |
static Int_t | GetAddressFromName (TString name) |
Get the address from the module name (static) More... | |
Private Types | |
typedef std::multiset< CbmStsSignal *, CbmStsSignal::Before > | sigset |
Module parameters. More... | |
Private Member Functions | |
void | Digitize (UShort_t channel, CbmStsSignal *signal) |
ClassDef (CbmStsSimModule, 1) | |
Private Attributes | |
Bool_t | fIsSet = kFALSE |
? Parameters are set More... | |
CbmStsElement * | fElement = nullptr |
CbmStsDigitize * | fDigitizer = nullptr |
Element in geometry setup. More... | |
const CbmStsParModule * | fParams = nullptr |
Digitizer. More... | |
std::map< UShort_t, sigset > | fAnalogBuffer |
Class for the simulation of a readout unit in the CBM-STS.
The module is the read-out unit in the CBM STS. It consists of one sensor or two or more daisy-chained sensors (CbmStsSensor), the analogue cable and the read-out electronics.
The module receives and stores the analogue signals from the sensor(s) in a buffer. It takes care of interference of signals in one and the same channel (two signals arriving within a given dead time). The module digitises the analogue signals and sends them to the CbmDaq when appropriate.
Definition at line 42 of file CbmStsSimModule.h.
|
private |
Module parameters.
Buffer for analog signals, key is channel number. Because signals do not, in general, arrive time-sorted, the buffer must hold a (multi)set of signals for each channel (multiset allowing for different signals at the same time). Sorting in the multiset is with the less operator of CbmStsSignal, which compares the time of the signals.
Definition at line 209 of file CbmStsSimModule.h.
CbmStsSimModule::CbmStsSimModule | ( | CbmStsElement * | setupModule = nullptr , |
const CbmStsParModule * | modulePar = nullptr , |
||
CbmStsDigitize * | digitizer = nullptr |
||
) |
Standard constructor.
setupModule | Pointer to module element in the STS setup |
|
delete |
Copy constructor (disabled)
|
virtual |
void CbmStsSimModule::AddSignal | ( | UShort_t | channel, |
Double_t | time, | ||
Double_t | charge, | ||
Int_t | index = 0 , |
||
Int_t | entry = 0 , |
||
Int_t | file = 0 |
||
) |
Add an analogue signal to the buffer
channel | channel number |
time | time of signal [ns] |
charge | analogue charge [e] |
index | index of CbmStsPoint in TClonesArray |
entry | MC entry (event number) |
file | MC input file number |
The signal will be added to the buffer. Interference with previous signals within the same channels is checked and the proper action is executed.
Definition at line 41 of file CbmStsSimModule.cxx.
References fAnalogBuffer, fParams, CbmStsParAsic::GetDeadTime(), GetNofChannels(), CbmStsParModule::GetParAsic(), and CbmStsParModule::IsChannelActive().
Referenced by GenerateNoise(), and CbmStsSimSensorDssd::RegisterCharge().
void CbmStsSimModule::BufferStatus | ( | Int_t & | nofSignals, |
Double_t & | timeFirst, | ||
Double_t & | timeLast | ||
) |
Get status of the analogue buffer
@paramOut nofSignals Number of signals in buffer (active channels) @paramOut timeFirst Time of first signal in buffer [ns] @paramOut timeLast Time of last signal in buffer [ns]
Definition at line 98 of file CbmStsSimModule.cxx.
References fAnalogBuffer.
|
private |
|
private |
Digitise an analogue charge signal
channel | Channel number |
signal | Pointer to signal object |
Definition at line 133 of file CbmStsSimModule.cxx.
References CbmStsDigitize::CreateDigi(), fDigitizer, fElement, fParams, CbmStsElement::GetAddress(), CbmStsSignal::GetCharge(), CbmStsSignal::GetMatch(), GetNofChannels(), CbmStsParModule::GetParAsic(), and CbmStsSignal::GetTime().
Referenced by ProcessAnalogBuffer().
Int_t CbmStsSimModule::GenerateNoise | ( | Double_t | t1, |
Double_t | t2 | ||
) |
Generate noise.
Get vector of individual ASIC parameters of this module Get parameters of the ASIC corresponding to the module channel number
moduleChannel | module channel number |
t1 | Start time [ns] |
t2 | Stop time [n2] |
This method will generate noise digis in the time interval [t1, t2] according to Rice's formula. The number of noise digis in this interval is sampled from a Poissonian with mean calculated from the single-channel noise rate, the number of channels and the length of the time interval. The noise hits are randomly distributed to the channels. The time of each noise digi is sampled from a flat distribution, its charge from a Gaussian with sigma = noise, truncated at threshold.
Definition at line 165 of file CbmStsSimModule.cxx.
References AddSignal(), fParams, CbmStsParModule::GetAsicParams(), CbmStsParModule::GetNofAsicChannels(), and CbmStsParModule::GetNofAsics().
|
static |
Get the address from the module name (static)
Convert charge to ADC channel.
charge | analogUE charge [e] |
This must be the inverse of AdcToCharge
name | Name of module @value Unique element address |
Definition at line 203 of file CbmStsSimModule.cxx.
References CbmStsAddress::GetAddress().
|
inline |
Digitizer task.
Pointer | to digitizer task |
Definition at line 114 of file CbmStsSimModule.h.
References fDigitizer.
|
inline |
Number of electronic channels @value Number of ADC channels.
Definition at line 120 of file CbmStsSimModule.h.
References fParams, and CbmStsParModule::GetNofChannels().
Referenced by AddSignal(), and Digitize().
void CbmStsSimModule::InitAnalogBuffer | ( | ) |
Initialise the analogue buffer The analogue buffer contains a std::multiset for each channel, to be filled with CbmStsSignal objects. Without this method, a channel multiset would be instantiated at run time when the first signal for this channel arrives. Depending on the occupancy of this channel, this may happen only after several hundreds of events. Consequently, the memory consumption will increase for the first events until each channel was activated at least once. This behaviour mimics a memory leak and makes it harder to detect a real one in other parts of the code. This is avoided by instantiating each channel multiset at initialisation time.
Definition at line 226 of file CbmStsSimModule.cxx.
References fAnalogBuffer, fParams, and CbmStsParModule::GetNofChannels().
|
inline |
Check whether module parameters are set @value kTRUE if parameters are set
Definition at line 141 of file CbmStsSimModule.h.
References fIsSet.
|
delete |
Assignment operator (disabled)
Int_t CbmStsSimModule::ProcessAnalogBuffer | ( | Double_t | readoutTime | ) |
Digitise signals in the analogue buffer
time | readout time [ns] |
All signals with time less than the readout time minus a safety margin (taking into account dead time and time resolution) will be digitised and removed from the buffer.
Definition at line 237 of file CbmStsSimModule.cxx.
References Digitize(), fAnalogBuffer, fParams, CbmStsParModule::GetParAsic(), and CbmStsParAsic::GetTimeResol().
|
inline |
Definition at line 155 of file CbmStsSimModule.h.
References fParams.
string CbmStsSimModule::ToString | ( | ) | const |
String output
Definition at line 297 of file CbmStsSimModule.cxx.
References fElement, fParams, and CbmStsParModule::GetParAsic().
|
private |
Definition at line 210 of file CbmStsSimModule.h.
Referenced by AddSignal(), BufferStatus(), InitAnalogBuffer(), ProcessAnalogBuffer(), and ~CbmStsSimModule().
|
private |
Element in geometry setup.
Definition at line 199 of file CbmStsSimModule.h.
Referenced by Digitize(), and GetDigitizer().
|
private |
Definition at line 198 of file CbmStsSimModule.h.
Referenced by Digitize(), and ToString().
|
private |
|
private |
Digitizer.
Definition at line 200 of file CbmStsSimModule.h.
Referenced by AddSignal(), Digitize(), GenerateNoise(), GetNofChannels(), InitAnalogBuffer(), ProcessAnalogBuffer(), SetParams(), and ToString().