CbmRoot
Loading...
Searching...
No Matches
CbmTrdRawToDigiLookUpCorrR.h
Go to the documentation of this file.
1/* Copyright (C) 2021 Goethe-University Frankfurt, Frankfurt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pascal Raisig [committer] */
4
21#ifndef CbmTrdRawToDigiLookUpCorrR_H
22#define CbmTrdRawToDigiLookUpCorrR_H
23
25
26#include <Rtypes.h> // for types and classdef
27#include <RtypesCore.h>
28#include <TH2.h>
29#include <TObject.h> // for TObject inheritance
30
31#include <cstddef>
32#include <cstdint>
33#include <memory>
34#include <string>
35
37
38
39 public:
40 enum class eLookUpModes : size_t
41 {
49
56 };
57
64
70
77
80
91 bool Init(std::string infile = "");
92
98
107 ULong64_t GetBinTimeShift(const std::vector<std::int16_t>* samples);
108
115 Float_t GetMaxAdcValue(const std::vector<std::int16_t>* samples);
116
123
130
137
143 void SetLookUpMode(eLookUpModes value, std::string infile = "")
144 {
145 fLookUpMode = value;
146 prepareLookUpTables(infile);
147 }
148
154 void SetFirstSamplePos(UInt_t value) { fFirstLookUpSamplePos = value; }
155
161 void SetSecondSamplePos(UInt_t value) { fSecondLookUpSamplePos = value; }
162
168 virtual void SetNrOfPresamples(UInt_t value)
169 {
170 fNrOfPresamples = value;
171 SetFirstSamplePos(value + 1);
172 SetSecondSamplePos(value + 2);
173 }
174
175
176 private:
177 protected:
183 void prepareLookUpTables(std::string infile);
184
190 void loadLookUpTables(std::string infile);
191
199
205
206
213 std::map<Int_t, std::map<Int_t, Float_t>> fMaxAdcLookUpMap = {};
214
220 std::map<UInt_t, std::map<UInt_t, ULong64_t>> fTimeshiftLookUpMap = {};
221
228
234 // UInt_t fSecondLookUpSamplePos = fNrOfPresamples + 2;
236
242
248
253 std::string fLookUpFilename = "";
254
255
256 public:
258};
259
260#endif
Base class for extracting of information from raw signals to digi level.
UInt_t fNrOfPresamples
Number of presamples before the signal starts (SPADIC default 2)
CbmTrdRawToDigiLookUpCorrR(std::string infile="", eLookUpModes mode=eLookUpModes::kTwoSamplesFileInput)
Construct a new CbmTrdRawToDigiLookUpCorrR.
UInt_t GetSecondSamplePos()
Get the Second Sample Pos.
ClassDef(CbmTrdRawToDigiLookUpCorrR, 2)
CbmTrdRawToDigiLookUpCorrR(const CbmTrdRawToDigiLookUpCorrR &)=delete
Copy constructor - not implemented!
UInt_t GetFirstSamplePos()
Get the First Sample Pos.
std::string fLookUpFilename
File name where the look up histos are stored.
UInt_t fFirstLookUpSamplePos
Position of the first sample used in the look up tables Default corresponds to the value used in the ...
eLookUpModes fLookUpMode
Used look up mode.
void CreateDebugHistoFile()
Create the Debug Histo File If called, the debug histos are written to a file which is written to dis...
bool Init(std::string infile="")
Initialise the method after all settings have been passed.
ULong64_t GetBinTimeShift(const std::vector< std::int16_t > *samples)
Get the Bin Time Shift value.
CbmTrdRawToDigiLookUpCorrR operator=(const CbmTrdRawToDigiLookUpCorrR &)
Assignment operator - not implemented!
Float_t GetMaxAdcValue(const std::vector< std::int16_t > *samples)
Get the MaxAdc value.
virtual ~CbmTrdRawToDigiLookUpCorrR()
Destructor.
void loadLookUpTables(std::string infile)
Load the look up tables from the given file.
void SetLookUpMode(eLookUpModes value, std::string infile="")
Set the Look Up Mode.
Int_t fcorrFirstSample
Baseline corrected sample value of the first used sample.
void SetFirstSamplePos(UInt_t value)
Set the position of the first look up sample.
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],...
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],...
UInt_t fSecondLookUpSamplePos
Position of the second sample used in the look up tables Default corresponds to the value used in the...
eLookUpModes GetLookUpMode()
Get the defined Look Up Mode.
virtual void SetNrOfPresamples(UInt_t value)
Set the Nr Of Presamples also resets the look up sample positions.
Int_t fcorrSecondSample
Baseline corrected sample value of the second used sample.
void prepareLookUpTables(std::string infile)
Prepare the look up tables for the used look up mode.
void createAnalyticLookUpTables()
Create a Analytical Look Up Tables.
void SetSecondSamplePos(UInt_t value)
Set the position of the second look up sample.
@ kTwoSamplesFileInput
Look up mode based on two samples and statistical filling. Look up mode based on two samples with map...
@ kTwoSamplesDynamicAnalytic
Look up mode based on two samples and analytical on the fly filling. Look up mode based on two sample...