CbmRoot
|
#include <CbmTrdRawToDigiLookUpCorrR.h>
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< CbmTrdDigi > | MakeDigi (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< CbmTrdSpadic > | GetSpadicObject () |
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< CbmTrdSpadic > | fSpadic = std::make_shared<CbmTrdSpadic>() |
Definition at line 36 of file CbmTrdRawToDigiLookUpCorrR.h.
|
strong |
Definition at line 40 of file CbmTrdRawToDigiLookUpCorrR.h.
CbmTrdRawToDigiLookUpCorrR::CbmTrdRawToDigiLookUpCorrR | ( | std::string | infile = "", |
eLookUpModes | mode = eLookUpModes::kTwoSamplesFileInput ) |
Construct a new CbmTrdRawToDigiLookUpCorrR.
infile |
Definition at line 23 of file CbmTrdRawToDigiLookUpCorrR.cxx.
References prepareLookUpTables().
|
delete |
Copy constructor - not implemented!
|
inlinevirtual |
Destructor.
Definition at line 79 of file CbmTrdRawToDigiLookUpCorrR.h.
|
inherited |
CbmTrdRawToDigiLookUpCorrR::ClassDef | ( | CbmTrdRawToDigiLookUpCorrR | , |
2 | ) |
|
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().
void CbmTrdRawToDigiLookUpCorrR::CreateDebugHistoFile | ( | ) |
Create the Debug Histo File If called, the debug histos are written to a file which is written to disk.
|
inherited |
Get the Baseline value.
The digi charge is an unsigned. Hence, we need to get the baseline to 0
samples |
Definition at line 17 of file CbmTrdRawToDigiBaseR.cxx.
References CbmTrdRawToDigiBaseR::fNrOfPresamples, and CbmTrdRawToDigiBaseR::fSpadic.
Referenced by CbmTrdRawToDigiFitR::fitResponse(), GetBinTimeShift(), and CbmTrdRawToDigiMaxAdcR::GetMaxAdcValue().
|
virtual |
Get the Bin Time Shift value.
Extract the bin time shift from the look up tables. The value is also stored in fCurrentTimeshift.
samples |
Implements CbmTrdRawToDigiBaseR.
Definition at line 49 of file CbmTrdRawToDigiLookUpCorrR.cxx.
References fcorrFirstSample, fcorrSecondSample, fFirstLookUpSamplePos, fSecondLookUpSamplePos, CbmTrdRawToDigiBaseR::fSpadic, fTimeshiftLookUpMap, and CbmTrdRawToDigiBaseR::GetBaseline().
|
staticinherited |
Get the Digi Trigger Type from the raw message triggertype.
tt |
Definition at line 36 of file CbmTrdRawToDigiBaseR.cxx.
References Spadic::kGlobal, Spadic::kNeigh, CbmTrdDigi::kNeighbor, CbmTrdDigi::kNTrg, Spadic::kSandN, CbmTrdDigi::kSelf, and Spadic::kSelf.
Referenced by CbmTrdUnpackAlgoLegacy2020R::makeDigi(), CbmTrdUnpackAlgoR::makeDigi(), and CbmTrdUnpackAlgoR::makeDigi().
|
inline |
Get the First Sample Pos.
Definition at line 129 of file CbmTrdRawToDigiLookUpCorrR.h.
References fFirstLookUpSamplePos.
|
inline |
Get the defined Look Up Mode.
Definition at line 122 of file CbmTrdRawToDigiLookUpCorrR.h.
References fLookUpMode.
|
virtual |
Get the MaxAdc value.
samples |
Implements CbmTrdRawToDigiBaseR.
Definition at line 66 of file CbmTrdRawToDigiLookUpCorrR.cxx.
References fcorrSecondSample, CbmTrdRawToDigiBaseR::fCurrentTimeshift, and fMaxAdcLookUpMap.
|
inlineinherited |
Get the Nr Of Presamples.
Definition at line 103 of file CbmTrdRawToDigiBaseR.h.
References CbmTrdRawToDigiBaseR::fNrOfPresamples.
|
inline |
Get the Second Sample Pos.
Definition at line 136 of file CbmTrdRawToDigiLookUpCorrR.h.
References fSecondLookUpSamplePos.
|
inlineinherited |
Get the spadic class.
Definition at line 96 of file CbmTrdRawToDigiBaseR.h.
References CbmTrdRawToDigiBaseR::fSpadic.
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!
infile |
Definition at line 32 of file CbmTrdRawToDigiLookUpCorrR.cxx.
References fLookUpFilename, fMaxAdcLookUpMap, fTimeshiftLookUpMap, and prepareLookUpTables().
|
protected |
Load the look up tables from the given file.
infile |
Definition at line 93 of file CbmTrdRawToDigiLookUpCorrR.cxx.
References fFirstLookUpSamplePos, fMaxAdcLookUpMap, fSecondLookUpSamplePos, and fTimeshiftLookUpMap.
Referenced by prepareLookUpTables().
|
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
samples | Adc samples |
padChNr | Channel number of the pad |
uniqueModuleId | unique Id of the module |
time | Absolute time [ns]. |
triggerType | SPADIC trigger type see CbmTrdTriggerType. |
errClass | SPADIC signal error parametrization based on message type. |
Definition at line 52 of file CbmTrdRawToDigiBaseR.cxx.
References CbmTrdRawToDigiBaseR::fCurrentTimeshift, CbmTrdRawToDigiBaseR::fSpadic, CbmTrdRawToDigiBaseR::GetBinTimeShift(), and CbmTrdRawToDigiBaseR::GetMaxAdcValue().
CbmTrdRawToDigiLookUpCorrR CbmTrdRawToDigiLookUpCorrR::operator= | ( | const CbmTrdRawToDigiLookUpCorrR & | ) |
Assignment operator - not implemented!
|
protected |
Prepare the look up tables for the used look up mode.
infile |
Definition at line 79 of file CbmTrdRawToDigiLookUpCorrR.cxx.
References createAnalyticLookUpTables(), fLookUpMode, kTwoSamplesDynamicAnalytic, kTwoSamplesFileInput, and loadLookUpTables().
Referenced by CbmTrdRawToDigiLookUpCorrR(), Init(), and SetLookUpMode().
|
inline |
Set the position of the first look up sample.
value |
Definition at line 154 of file CbmTrdRawToDigiLookUpCorrR.h.
References fFirstLookUpSamplePos.
Referenced by SetNrOfPresamples().
|
inline |
Set the Look Up Mode.
value |
Definition at line 143 of file CbmTrdRawToDigiLookUpCorrR.h.
References fLookUpMode, and prepareLookUpTables().
|
inlinevirtual |
Set the Nr Of Presamples also resets the look up sample positions.
value |
Reimplemented from CbmTrdRawToDigiBaseR.
Definition at line 168 of file CbmTrdRawToDigiLookUpCorrR.h.
References CbmTrdRawToDigiBaseR::fNrOfPresamples, SetFirstSamplePos(), and SetSecondSamplePos().
|
inline |
Set the position of the second look up sample.
value |
Definition at line 161 of file CbmTrdRawToDigiLookUpCorrR.h.
References fSecondLookUpSamplePos.
Referenced by SetNrOfPresamples().
|
inlineinherited |
Set the spadic class.
spadic |
Definition at line 126 of file CbmTrdRawToDigiBaseR.h.
References CbmTrdRawToDigiBaseR::fSpadic.
|
protected |
Baseline corrected sample value of the first used sample.
Definition at line 241 of file CbmTrdRawToDigiLookUpCorrR.h.
Referenced by GetBinTimeShift().
|
protected |
Baseline corrected sample value of the second used sample.
Definition at line 247 of file CbmTrdRawToDigiLookUpCorrR.h.
Referenced by GetBinTimeShift(), and GetMaxAdcValue().
|
protectedinherited |
Bin timeshift for the current sample set in [ns].
Definition at line 146 of file CbmTrdRawToDigiBaseR.h.
Referenced by GetMaxAdcValue(), and CbmTrdRawToDigiBaseR::MakeDigi().
|
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().
|
protected |
File name where the look up histos are stored.
Definition at line 253 of file CbmTrdRawToDigiLookUpCorrR.h.
Referenced by Init().
|
protected |
Used look up mode.
Definition at line 204 of file CbmTrdRawToDigiLookUpCorrR.h.
Referenced by GetLookUpMode(), prepareLookUpTables(), and SetLookUpMode().
|
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().
|
protectedinherited |
Number of presamples before the signal starts (SPADIC default 2)
Definition at line 140 of file CbmTrdRawToDigiBaseR.h.
Referenced by CbmTrdRawToDigiBaseR::GetBaseline(), CbmTrdRawToDigiBaseR::GetNrOfPresamples(), CbmTrdRawToDigiBaseR::SetNrOfPresamples(), CbmTrdRawToDigiFitR::SetNrOfPresamples(), and SetNrOfPresamples().
|
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().
|
protectedinherited |
Definition at line 148 of file CbmTrdRawToDigiBaseR.h.
Referenced by createAnalyticLookUpTables(), CbmTrdRawToDigiBaseR::GetBaseline(), GetBinTimeShift(), CbmTrdRawToDigiBaseR::GetSpadicObject(), CbmTrdRawToDigiBaseR::MakeDigi(), and CbmTrdRawToDigiBaseR::SetSpadicObject().
|
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().