CbmRoot
Loading...
Searching...
No Matches
CbmTrdRawToDigiLookUpCorrR Class Reference

#include <CbmTrdRawToDigiLookUpCorrR.h>

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

Public Types

enum class  eLookUpModes : size_t { kTwoSamplesFileInput = 0 , kTwoSamplesDynamicAnalytic }
 

Public Member Functions

 CbmTrdRawToDigiLookUpCorrR (std::string infile="", eLookUpModes mode=eLookUpModes::kTwoSamplesFileInput)
 Construct a new CbmTrdRawToDigiLookUpCorrR.
 
 CbmTrdRawToDigiLookUpCorrR (const CbmTrdRawToDigiLookUpCorrR &)=delete
 Copy constructor - not implemented!
 
CbmTrdRawToDigiLookUpCorrR operator= (const CbmTrdRawToDigiLookUpCorrR &)
 Assignment operator - not implemented!
 
virtual ~CbmTrdRawToDigiLookUpCorrR ()
 Destructor.
 
bool Init (std::string infile="")
 Initialise the method after all settings have been passed.
 
void CreateDebugHistoFile ()
 Create the Debug Histo File If called, the debug histos are written to a file which is written to disk.
 
ULong64_t GetBinTimeShift (const std::vector< std::int16_t > *samples)
 Get the Bin Time Shift value.
 
Float_t GetMaxAdcValue (const std::vector< std::int16_t > *samples)
 Get the MaxAdc value.
 
eLookUpModes GetLookUpMode ()
 Get the defined Look Up Mode.
 
UInt_t GetFirstSamplePos ()
 Get the First Sample Pos.
 
UInt_t GetSecondSamplePos ()
 Get the Second Sample Pos.
 
void SetLookUpMode (eLookUpModes value, std::string infile="")
 Set the Look Up Mode.
 
void SetFirstSamplePos (UInt_t value)
 Set the position of the first look up sample.
 
void SetSecondSamplePos (UInt_t value)
 Set the position of the second look up sample.
 
virtual void SetNrOfPresamples (UInt_t value)
 Set the Nr Of Presamples also resets the look up sample positions.
 
 ClassDef (CbmTrdRawToDigiLookUpCorrR, 2)
 
std::unique_ptr< CbmTrdDigiMakeDigi (const std::vector< std::int16_t > *samples, Int_t padChNr, Int_t uniqueModuleId, ULong64_t time, CbmTrdDigi::eTriggerType triggerType, Int_t errClass)
 Get digi from input values. Implemented in the derived classes.
 
Float_t GetBaseline (const std::vector< std::int16_t > *samples)
 Get the Baseline value.
 
std::shared_ptr< CbmTrdSpadicGetSpadicObject ()
 Get the spadic class.
 
UInt_t GetNrOfPresamples ()
 Get the Nr Of Presamples.
 
void SetSpadicObject (std::shared_ptr< CbmTrdSpadic > spadic)
 Set the spadic class.
 
 ClassDef (CbmTrdRawToDigiBaseR, 2)
 

Static Public Member Functions

static CbmTrdDigi::eTriggerType GetDigiTriggerType (Spadic::eTriggerType tt)
 Get the Digi Trigger Type from the raw message triggertype.
 

Protected Member Functions

void prepareLookUpTables (std::string infile)
 Prepare the look up tables for the used look up mode.
 
void loadLookUpTables (std::string infile)
 Load the look up tables from the given file.
 
void createAnalyticLookUpTables ()
 Create a Analytical Look Up Tables.
 

Protected Attributes

eLookUpModes fLookUpMode
 Used look up mode.
 
std::map< Int_t, std::map< Int_t, Float_t > > fMaxAdcLookUpMap = {}
 Look up map for the max adc values for Keys correspond to charge[fCurrentTimeshift], charge[fSecondLookUpSamplePos] and the mapped value is the input charge in MIP calibrated max adc units.
 
std::map< UInt_t, std::map< UInt_t, ULong64_t > > fTimeshiftLookUpMap = {}
 Look up map for the bin time shift value Keys correspond to charge[fFirstLookUpSamplePos], charge[fSecondLookUpSamplePos] and the mapped value is the timeshift.
 
UInt_t fFirstLookUpSamplePos = fNrOfPresamples + 1
 Position of the first sample used in the look up tables Default corresponds to the value used in the look ups in the parameters repository.
 
UInt_t fSecondLookUpSamplePos = fNrOfPresamples + 5
 Position of the second sample used in the look up tables Default corresponds to the value used in the look ups in the parameters repository.
 
Int_t fcorrFirstSample = 0
 Baseline corrected sample value of the first used sample.
 
Int_t fcorrSecondSample = 0
 Baseline corrected sample value of the second used sample.
 
std::string fLookUpFilename = ""
 File name where the look up histos are stored.
 
UInt_t fNrOfPresamples = CbmTrdSpadic::GetNrOfPresamples()
 Number of presamples before the signal starts (SPADIC default 2)
 
ULong64_t fCurrentTimeshift = 0
 Bin timeshift for the current sample set in [ns].
 
std::shared_ptr< CbmTrdSpadicfSpadic = std::make_shared<CbmTrdSpadic>()
 

Detailed Description

Definition at line 36 of file CbmTrdRawToDigiLookUpCorrR.h.

Member Enumeration Documentation

◆ eLookUpModes

enum class CbmTrdRawToDigiLookUpCorrR::eLookUpModes : size_t
strong
Enumerator
kTwoSamplesFileInput 

Look up mode based on two samples and statistical filling. Look up mode based on two samples with maps based on statistical extraction stored in the passed infile.

kTwoSamplesDynamicAnalytic 

Look up mode based on two samples and analytical on the fly filling. Look up mode based on two samples with maps based on analytical filling created dynamically when this mode is selected.

Definition at line 40 of file CbmTrdRawToDigiLookUpCorrR.h.

Constructor & Destructor Documentation

◆ CbmTrdRawToDigiLookUpCorrR() [1/2]

CbmTrdRawToDigiLookUpCorrR::CbmTrdRawToDigiLookUpCorrR ( std::string infile = "",
eLookUpModes mode = eLookUpModes::kTwoSamplesFileInput )

Construct a new CbmTrdRawToDigiLookUpCorrR.

Parameters
infile

Definition at line 23 of file CbmTrdRawToDigiLookUpCorrR.cxx.

References prepareLookUpTables().

◆ CbmTrdRawToDigiLookUpCorrR() [2/2]

CbmTrdRawToDigiLookUpCorrR::CbmTrdRawToDigiLookUpCorrR ( const CbmTrdRawToDigiLookUpCorrR & )
delete

Copy constructor - not implemented!

◆ ~CbmTrdRawToDigiLookUpCorrR()

virtual CbmTrdRawToDigiLookUpCorrR::~CbmTrdRawToDigiLookUpCorrR ( )
inlinevirtual

Destructor.

Definition at line 79 of file CbmTrdRawToDigiLookUpCorrR.h.

Member Function Documentation

◆ ClassDef() [1/2]

CbmTrdRawToDigiBaseR::ClassDef ( CbmTrdRawToDigiBaseR ,
2  )
inherited

◆ ClassDef() [2/2]

CbmTrdRawToDigiLookUpCorrR::ClassDef ( CbmTrdRawToDigiLookUpCorrR ,
2  )

◆ createAnalyticLookUpTables()

void CbmTrdRawToDigiLookUpCorrR::createAnalyticLookUpTables ( )
protected

Create a Analytical Look Up Tables.

Two of three look up modes are based on dynamically created look up tables based on analytical approaches.

Definition at line 142 of file CbmTrdRawToDigiLookUpCorrR.cxx.

References fFirstLookUpSamplePos, fMaxAdcLookUpMap, fSecondLookUpSamplePos, CbmTrdRawToDigiBaseR::fSpadic, fTimeshiftLookUpMap, CbmTrdSpadic::kBinTimeshift, and CbmTrdSpadic::kInputCharge.

Referenced by prepareLookUpTables().

◆ CreateDebugHistoFile()

void CbmTrdRawToDigiLookUpCorrR::CreateDebugHistoFile ( )

Create the Debug Histo File If called, the debug histos are written to a file which is written to disk.

◆ GetBaseline()

Float_t CbmTrdRawToDigiBaseR::GetBaseline ( const std::vector< std::int16_t > * samples)
inherited

Get the Baseline value.

The digi charge is an unsigned. Hence, we need to get the baseline to 0

Parameters
samples
Returns
Float_t

Definition at line 17 of file CbmTrdRawToDigiBaseR.cxx.

References CbmTrdRawToDigiBaseR::fNrOfPresamples, and CbmTrdRawToDigiBaseR::fSpadic.

Referenced by CbmTrdRawToDigiFitR::fitResponse(), GetBinTimeShift(), and CbmTrdRawToDigiMaxAdcR::GetMaxAdcValue().

◆ GetBinTimeShift()

ULong64_t CbmTrdRawToDigiLookUpCorrR::GetBinTimeShift ( const std::vector< std::int16_t > * samples)
virtual

Get the Bin Time Shift value.

Extract the bin time shift from the look up tables. The value is also stored in fCurrentTimeshift.

Parameters
samples
Returns
ULong64_t

Implements CbmTrdRawToDigiBaseR.

Definition at line 49 of file CbmTrdRawToDigiLookUpCorrR.cxx.

References fcorrFirstSample, fcorrSecondSample, fFirstLookUpSamplePos, fSecondLookUpSamplePos, CbmTrdRawToDigiBaseR::fSpadic, fTimeshiftLookUpMap, and CbmTrdRawToDigiBaseR::GetBaseline().

◆ GetDigiTriggerType()

CbmTrdDigi::eTriggerType CbmTrdRawToDigiBaseR::GetDigiTriggerType ( Spadic::eTriggerType tt)
staticinherited

◆ GetFirstSamplePos()

UInt_t CbmTrdRawToDigiLookUpCorrR::GetFirstSamplePos ( )
inline

Get the First Sample Pos.

Returns
UInt_t

Definition at line 129 of file CbmTrdRawToDigiLookUpCorrR.h.

References fFirstLookUpSamplePos.

◆ GetLookUpMode()

eLookUpModes CbmTrdRawToDigiLookUpCorrR::GetLookUpMode ( )
inline

Get the defined Look Up Mode.

Returns
eLookUpModes

Definition at line 122 of file CbmTrdRawToDigiLookUpCorrR.h.

References fLookUpMode.

◆ GetMaxAdcValue()

Float_t CbmTrdRawToDigiLookUpCorrR::GetMaxAdcValue ( const std::vector< std::int16_t > * samples)
virtual

Get the MaxAdc value.

Parameters
samples
Returns
Float_t

Implements CbmTrdRawToDigiBaseR.

Definition at line 66 of file CbmTrdRawToDigiLookUpCorrR.cxx.

References fcorrSecondSample, CbmTrdRawToDigiBaseR::fCurrentTimeshift, and fMaxAdcLookUpMap.

◆ GetNrOfPresamples()

UInt_t CbmTrdRawToDigiBaseR::GetNrOfPresamples ( )
inlineinherited

Get the Nr Of Presamples.

Returns
UInt_t

Definition at line 103 of file CbmTrdRawToDigiBaseR.h.

References CbmTrdRawToDigiBaseR::fNrOfPresamples.

◆ GetSecondSamplePos()

UInt_t CbmTrdRawToDigiLookUpCorrR::GetSecondSamplePos ( )
inline

Get the Second Sample Pos.

Returns
UInt_t

Definition at line 136 of file CbmTrdRawToDigiLookUpCorrR.h.

References fSecondLookUpSamplePos.

◆ GetSpadicObject()

std::shared_ptr< CbmTrdSpadic > CbmTrdRawToDigiBaseR::GetSpadicObject ( )
inlineinherited

Get the spadic class.

Returns
std::shared_ptr<CbmTrdSpadic>

Definition at line 96 of file CbmTrdRawToDigiBaseR.h.

References CbmTrdRawToDigiBaseR::fSpadic.

◆ Init()

bool CbmTrdRawToDigiLookUpCorrR::Init ( std::string infile = "")

Initialise the method after all settings have been passed.

This initialises the method if none default settings are used. If it is not call after a change of settings, the defaults will still be used!

Parameters
infile
Returns
true
false

Definition at line 32 of file CbmTrdRawToDigiLookUpCorrR.cxx.

References fLookUpFilename, fMaxAdcLookUpMap, fTimeshiftLookUpMap, and prepareLookUpTables().

◆ loadLookUpTables()

void CbmTrdRawToDigiLookUpCorrR::loadLookUpTables ( std::string infile)
protected

Load the look up tables from the given file.

Parameters
infile

Definition at line 93 of file CbmTrdRawToDigiLookUpCorrR.cxx.

References fFirstLookUpSamplePos, fMaxAdcLookUpMap, fSecondLookUpSamplePos, and fTimeshiftLookUpMap.

Referenced by prepareLookUpTables().

◆ MakeDigi()

std::unique_ptr< CbmTrdDigi > CbmTrdRawToDigiBaseR::MakeDigi ( const std::vector< std::int16_t > * samples,
Int_t padChNr,
Int_t uniqueModuleId,
ULong64_t time,
CbmTrdDigi::eTriggerType triggerType,
Int_t errClass )
inherited

Get digi from input values. Implemented in the derived classes.

Get digi from the input values. The methods how a timeshift within the bins is estimated and how the input charge to the asic is extracted are implemented in the derived classes

Parameters
samplesAdc samples
padChNrChannel number of the pad
uniqueModuleIdunique Id of the module
timeAbsolute time [ns].
triggerTypeSPADIC trigger type see CbmTrdTriggerType.
errClassSPADIC signal error parametrization based on message type.
Returns
std::shared_ptr<CbmTrdDigi> *

Definition at line 52 of file CbmTrdRawToDigiBaseR.cxx.

References CbmTrdRawToDigiBaseR::fCurrentTimeshift, CbmTrdRawToDigiBaseR::fSpadic, CbmTrdRawToDigiBaseR::GetBinTimeShift(), and CbmTrdRawToDigiBaseR::GetMaxAdcValue().

◆ operator=()

CbmTrdRawToDigiLookUpCorrR CbmTrdRawToDigiLookUpCorrR::operator= ( const CbmTrdRawToDigiLookUpCorrR & )

Assignment operator - not implemented!

Returns
CbmTrdRawToDigiLookUpCorrR

◆ prepareLookUpTables()

void CbmTrdRawToDigiLookUpCorrR::prepareLookUpTables ( std::string infile)
protected

Prepare the look up tables for the used look up mode.

Parameters
infile

Definition at line 79 of file CbmTrdRawToDigiLookUpCorrR.cxx.

References createAnalyticLookUpTables(), fLookUpMode, kTwoSamplesDynamicAnalytic, kTwoSamplesFileInput, and loadLookUpTables().

Referenced by CbmTrdRawToDigiLookUpCorrR(), Init(), and SetLookUpMode().

◆ SetFirstSamplePos()

void CbmTrdRawToDigiLookUpCorrR::SetFirstSamplePos ( UInt_t value)
inline

Set the position of the first look up sample.

Parameters
value

Definition at line 154 of file CbmTrdRawToDigiLookUpCorrR.h.

References fFirstLookUpSamplePos.

Referenced by SetNrOfPresamples().

◆ SetLookUpMode()

void CbmTrdRawToDigiLookUpCorrR::SetLookUpMode ( eLookUpModes value,
std::string infile = "" )
inline

Set the Look Up Mode.

Parameters
value

Definition at line 143 of file CbmTrdRawToDigiLookUpCorrR.h.

References fLookUpMode, and prepareLookUpTables().

◆ SetNrOfPresamples()

virtual void CbmTrdRawToDigiLookUpCorrR::SetNrOfPresamples ( UInt_t value)
inlinevirtual

Set the Nr Of Presamples also resets the look up sample positions.

Parameters
value

Reimplemented from CbmTrdRawToDigiBaseR.

Definition at line 168 of file CbmTrdRawToDigiLookUpCorrR.h.

References CbmTrdRawToDigiBaseR::fNrOfPresamples, SetFirstSamplePos(), and SetSecondSamplePos().

◆ SetSecondSamplePos()

void CbmTrdRawToDigiLookUpCorrR::SetSecondSamplePos ( UInt_t value)
inline

Set the position of the second look up sample.

Parameters
value

Definition at line 161 of file CbmTrdRawToDigiLookUpCorrR.h.

References fSecondLookUpSamplePos.

Referenced by SetNrOfPresamples().

◆ SetSpadicObject()

void CbmTrdRawToDigiBaseR::SetSpadicObject ( std::shared_ptr< CbmTrdSpadic > spadic)
inlineinherited

Set the spadic class.

Parameters
spadic

Definition at line 126 of file CbmTrdRawToDigiBaseR.h.

References CbmTrdRawToDigiBaseR::fSpadic.

Member Data Documentation

◆ fcorrFirstSample

Int_t CbmTrdRawToDigiLookUpCorrR::fcorrFirstSample = 0
protected

Baseline corrected sample value of the first used sample.

Definition at line 241 of file CbmTrdRawToDigiLookUpCorrR.h.

Referenced by GetBinTimeShift().

◆ fcorrSecondSample

Int_t CbmTrdRawToDigiLookUpCorrR::fcorrSecondSample = 0
protected

Baseline corrected sample value of the second used sample.

Definition at line 247 of file CbmTrdRawToDigiLookUpCorrR.h.

Referenced by GetBinTimeShift(), and GetMaxAdcValue().

◆ fCurrentTimeshift

ULong64_t CbmTrdRawToDigiBaseR::fCurrentTimeshift = 0
protectedinherited

Bin timeshift for the current sample set in [ns].

Definition at line 146 of file CbmTrdRawToDigiBaseR.h.

Referenced by GetMaxAdcValue(), and CbmTrdRawToDigiBaseR::MakeDigi().

◆ fFirstLookUpSamplePos

UInt_t CbmTrdRawToDigiLookUpCorrR::fFirstLookUpSamplePos = fNrOfPresamples + 1
protected

Position of the first sample used in the look up tables Default corresponds to the value used in the look ups in the parameters repository.

Definition at line 227 of file CbmTrdRawToDigiLookUpCorrR.h.

Referenced by createAnalyticLookUpTables(), GetBinTimeShift(), GetFirstSamplePos(), loadLookUpTables(), and SetFirstSamplePos().

◆ fLookUpFilename

std::string CbmTrdRawToDigiLookUpCorrR::fLookUpFilename = ""
protected

File name where the look up histos are stored.

Definition at line 253 of file CbmTrdRawToDigiLookUpCorrR.h.

Referenced by Init().

◆ fLookUpMode

eLookUpModes CbmTrdRawToDigiLookUpCorrR::fLookUpMode
protected

Used look up mode.

Definition at line 204 of file CbmTrdRawToDigiLookUpCorrR.h.

Referenced by GetLookUpMode(), prepareLookUpTables(), and SetLookUpMode().

◆ fMaxAdcLookUpMap

std::map<Int_t, std::map<Int_t, Float_t> > CbmTrdRawToDigiLookUpCorrR::fMaxAdcLookUpMap = {}
protected

Look up map for the max adc values for Keys correspond to charge[fCurrentTimeshift], charge[fSecondLookUpSamplePos] and the mapped value is the input charge in MIP calibrated max adc units.

Definition at line 213 of file CbmTrdRawToDigiLookUpCorrR.h.

Referenced by createAnalyticLookUpTables(), GetMaxAdcValue(), Init(), and loadLookUpTables().

◆ fNrOfPresamples

UInt_t CbmTrdRawToDigiBaseR::fNrOfPresamples = CbmTrdSpadic::GetNrOfPresamples()
protectedinherited

◆ fSecondLookUpSamplePos

UInt_t CbmTrdRawToDigiLookUpCorrR::fSecondLookUpSamplePos = fNrOfPresamples + 5
protected

Position of the second sample used in the look up tables Default corresponds to the value used in the look ups in the parameters repository.

Definition at line 235 of file CbmTrdRawToDigiLookUpCorrR.h.

Referenced by createAnalyticLookUpTables(), GetBinTimeShift(), GetSecondSamplePos(), loadLookUpTables(), and SetSecondSamplePos().

◆ fSpadic

◆ fTimeshiftLookUpMap

std::map<UInt_t, std::map<UInt_t, ULong64_t> > CbmTrdRawToDigiLookUpCorrR::fTimeshiftLookUpMap = {}
protected

Look up map for the bin time shift value Keys correspond to charge[fFirstLookUpSamplePos], charge[fSecondLookUpSamplePos] and the mapped value is the timeshift.

Definition at line 220 of file CbmTrdRawToDigiLookUpCorrR.h.

Referenced by createAnalyticLookUpTables(), GetBinTimeShift(), Init(), and loadLookUpTables().


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