CbmRoot
Loading...
Searching...
No Matches
CbmTrdRawToDigiBaseR.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
5
20#ifndef CBMTRDRAWTODIGIBASER_H
21#define CBMTRDRAWTODIGIBASER_H
22
23#include "CbmTrdDigi.h" // for MakeDigi
25#include "CbmTrdSpadic.h"
26
27#include <Rtypes.h> // for types and classdef
28#include <RtypesCore.h>
29#include <TObject.h> // for TObject inheritance
30
31#include <cstdint>
32#include <memory> // for shared_ptr
33
34class CbmTrdRawToDigiBaseR : public TObject {
35 public:
41
43 virtual ~CbmTrdRawToDigiBaseR() { ; }
44
45
62 std::unique_ptr<CbmTrdDigi> MakeDigi(const std::vector<std::int16_t>* samples, Int_t padChNr, Int_t uniqueModuleId,
63 ULong64_t time, CbmTrdDigi::eTriggerType triggerType, Int_t errClass);
64
71 virtual ULong64_t GetBinTimeShift(const std::vector<std::int16_t>* samples) = 0;
72
79 virtual Float_t GetMaxAdcValue(const std::vector<std::int16_t>* samples) = 0;
80
89 Float_t GetBaseline(const std::vector<std::int16_t>* samples);
90
96 std::shared_ptr<CbmTrdSpadic> GetSpadicObject() { return fSpadic; }
97
104
112
118 virtual void SetNrOfPresamples(UInt_t value) { fNrOfPresamples = value; }
119
120
126 void SetSpadicObject(std::shared_ptr<CbmTrdSpadic> spadic) { fSpadic = spadic; }
127
128 private:
134
135 protected:
141
146 ULong64_t fCurrentTimeshift = 0;
147
148 std::shared_ptr<CbmTrdSpadic> fSpadic = std::make_shared<CbmTrdSpadic>();
149
150 public:
152};
153
154#endif
Software representation of the SPADIC v2.2+.
virtual Float_t GetMaxAdcValue(const std::vector< std::int16_t > *samples)=0
Get the MaxAdc value.
CbmTrdRawToDigiBaseR(const CbmTrdRawToDigiBaseR &)=delete
Copy constructor - not implemented!
UInt_t fNrOfPresamples
Number of presamples before the signal starts (SPADIC default 2)
void SetSpadicObject(std::shared_ptr< CbmTrdSpadic > spadic)
Set the spadic class.
std::shared_ptr< CbmTrdSpadic > GetSpadicObject()
Get the spadic class.
virtual ~CbmTrdRawToDigiBaseR()
Destructor.
ClassDef(CbmTrdRawToDigiBaseR, 2)
static CbmTrdDigi::eTriggerType GetDigiTriggerType(Spadic::eTriggerType tt)
Get the Digi Trigger Type from the raw message triggertype.
virtual void SetNrOfPresamples(UInt_t value)
Set the Nr Of Presamples.
virtual ULong64_t GetBinTimeShift(const std::vector< std::int16_t > *samples)=0
Get the Bin Time Shift value.
std::shared_ptr< CbmTrdSpadic > fSpadic
CbmTrdRawToDigiBaseR()
Construct a new CbmTrdRawToDigiBaseR object.
Float_t GetBaseline(const std::vector< std::int16_t > *samples)
Get the Baseline value.
ULong64_t fCurrentTimeshift
Bin timeshift for the current sample set in [ns].
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.
UInt_t GetNrOfPresamples()
Get the Nr Of Presamples.
static constexpr UInt_t GetNrOfPresamples()
Get the Nr Of Preamples.