CbmRoot
CbmStsSimModule Class Reference

Class for the simulation of a readout unit in the CBM-STS. More...

#include <CbmStsSimModule.h>

Inheritance diagram for CbmStsSimModule:
[legend]
Collaboration diagram for CbmStsSimModule:
[legend]

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...
 
CbmStsSimModuleoperator= (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)
 
CbmStsDigitizeGetDigitizer () 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 &params)
 
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::Beforesigset
 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...
 
CbmStsElementfElement = nullptr
 
CbmStsDigitizefDigitizer = nullptr
 Element in geometry setup. More...
 
const CbmStsParModulefParams = nullptr
 Digitizer. More...
 
std::map< UShort_t, sigsetfAnalogBuffer
 

Detailed Description

Class for the simulation of a readout unit in the CBM-STS.

Author
V.Friese v.fri.nosp@m.ese@.nosp@m.gsi.d.nosp@m.e @data 16.03.2020

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.

Member Typedef Documentation

◆ sigset

typedef std::multiset<CbmStsSignal*, CbmStsSignal::Before> CbmStsSimModule::sigset
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.

Constructor & Destructor Documentation

◆ CbmStsSimModule() [1/2]

CbmStsSimModule::CbmStsSimModule ( CbmStsElement setupModule = nullptr,
const CbmStsParModule modulePar = nullptr,
CbmStsDigitize digitizer = nullptr 
)

Standard constructor.

Parameters
setupModulePointer to module element in the STS setup

◆ CbmStsSimModule() [2/2]

CbmStsSimModule::CbmStsSimModule ( const CbmStsSimModule )
delete

Copy constructor (disabled)

◆ ~CbmStsSimModule()

CbmStsSimModule::~CbmStsSimModule ( )
virtual

Destructor.

Definition at line 26 of file CbmStsSimModule.cxx.

References fAnalogBuffer.

Member Function Documentation

◆ AddSignal()

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

Parameters
channelchannel number
timetime of signal [ns]
chargeanalogue charge [e]
indexindex of CbmStsPoint in TClonesArray
entryMC entry (event number)
fileMC 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().

◆ BufferStatus()

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.

◆ ClassDef()

CbmStsSimModule::ClassDef ( CbmStsSimModule  ,
 
)
private

◆ Digitize()

void CbmStsSimModule::Digitize ( UShort_t  channel,
CbmStsSignal signal 
)
private

Digitise an analogue charge signal

Parameters
channelChannel number
signalPointer 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().

◆ GenerateNoise()

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

Parameters
moduleChannelmodule channel number
t1Start time [ns]
t2Stop 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().

◆ GetAddressFromName()

Int_t CbmStsSimModule::GetAddressFromName ( TString  name)
static

Get the address from the module name (static)

Convert charge to ADC channel.

Parameters
chargeanalogUE charge [e]
Returns
ADC channel number

This must be the inverse of AdcToCharge

Parameters
nameName of module @value Unique element address

Definition at line 203 of file CbmStsSimModule.cxx.

References CbmStsAddress::GetAddress().

◆ GetDigitizer()

CbmStsDigitize* CbmStsSimModule::GetDigitizer ( ) const
inline

Digitizer task.

Parameters
Pointerto digitizer task

Definition at line 114 of file CbmStsSimModule.h.

References fDigitizer.

◆ GetNofChannels()

UShort_t CbmStsSimModule::GetNofChannels ( ) const
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().

◆ InitAnalogBuffer()

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().

◆ IsSet()

Bool_t CbmStsSimModule::IsSet ( ) const
inline

Check whether module parameters are set @value kTRUE if parameters are set

Definition at line 141 of file CbmStsSimModule.h.

References fIsSet.

◆ operator=()

CbmStsSimModule& CbmStsSimModule::operator= ( const CbmStsSimModule )
delete

Assignment operator (disabled)

◆ ProcessAnalogBuffer()

Int_t CbmStsSimModule::ProcessAnalogBuffer ( Double_t  readoutTime)

Digitise signals in the analogue buffer

Parameters
timereadout time [ns]
Returns
Number of created digis

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().

◆ SetParams()

void CbmStsSimModule::SetParams ( const CbmStsParModule params)
inline

Definition at line 155 of file CbmStsSimModule.h.

References fParams.

◆ ToString()

string CbmStsSimModule::ToString ( ) const

String output

Definition at line 297 of file CbmStsSimModule.cxx.

References fElement, fParams, and CbmStsParModule::GetParAsic().

Member Data Documentation

◆ fAnalogBuffer

std::map<UShort_t, sigset> CbmStsSimModule::fAnalogBuffer
private

◆ fDigitizer

CbmStsDigitize* CbmStsSimModule::fDigitizer = nullptr
private

Element in geometry setup.

Definition at line 199 of file CbmStsSimModule.h.

Referenced by Digitize(), and GetDigitizer().

◆ fElement

CbmStsElement* CbmStsSimModule::fElement = nullptr
private

Definition at line 198 of file CbmStsSimModule.h.

Referenced by Digitize(), and ToString().

◆ fIsSet

Bool_t CbmStsSimModule::fIsSet = kFALSE
private

? Parameters are set

Definition at line 197 of file CbmStsSimModule.h.

Referenced by IsSet().

◆ fParams

const CbmStsParModule* CbmStsSimModule::fParams = nullptr
private

The documentation for this class was generated from the following files: