CbmRoot
Loading...
Searching...
No Matches
CbmStsUnpackAlgoBase.h
Go to the documentation of this file.
1/* Copyright (C) 2021 Fair GmbH, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau, Dominik Smith [committer] */
4
21#ifndef CbmStsUnpackAlgoBase_H
22#define CbmStsUnpackAlgoBase_H
23
24#include "CbmErrorMessage.h" // REMARK see remark in CbmStsUnpackConfig
25#include "CbmRecoUnpackAlgo.tmpl"
26#include "CbmStsDigi.h"
27#include "CbmStsParModule.h"
28#include "CbmStsUnpackMonitor.h"
29#include "Timeslice.hpp" // timeslice
30
31#include <FairTask.h> // for InitStatus
32
33#include <Rtypes.h> // for types
34#include <RtypesCore.h>
35
36#include <cstddef>
37#include <cstdint>
38#include <memory>
39#include <utility>
40
41class CbmStsUnpackAlgoBase : public CbmRecoUnpackAlgo<CbmStsDigi, CbmStsDigi, CbmErrorMessage> {
42 public:
44 CbmStsUnpackAlgoBase(std::string name);
45
47 virtual ~CbmStsUnpackAlgoBase();
48
51
54
55 // Setters
57 void SetMonitor(std::shared_ptr<CbmStsUnpackMonitor> monitor) { fMonitor = monitor; }
58
60 void SetMinAdcCut(uint32_t value) { fdAdcCut = value; }
61
62 void SetMinAdcCut(uint32_t febid, uint32_t value) { fdAdcCut_perFeb[febid] = value; }
63
65 void SetAsicTimeOffsetVec(std::vector<double> value) { fvdTimeOffsetNsAsics.swap(value); }
66
68 void SetWalkMap(const std::map<uint32_t, CbmStsParModule>& mapIn);
69
71 void SetDuplicatesRejection(bool bIn = true, bool bDiffAdc = true)
72 {
74 fbDupliWithoutAdc = bDiffAdc;
75 }
76
78 void SetFwBinning(bool useFwBinning) { fbUseFwBinning = useFwBinning; }
79
89 virtual std::vector<std::pair<std::string, std::shared_ptr<FairParGenericSet>>>*
90 GetParContainerRequest(std::string geoTag, std::uint32_t runId);
91
99 virtual void MaskNoisyChannel(const uint32_t uFeb, const uint32_t uChan, const bool bMasked = true)
100 {
101 (void) uFeb;
102 (void) uChan;
103 (void) bMasked;
104 };
105
106 protected:
108 virtual void finish()
109 {
110 if (fMonitor) fMonitor->Finish();
111 return;
112 }
113
114 // Monitoring
116 std::shared_ptr<CbmStsUnpackMonitor> fMonitor = nullptr;
117
119 uint32_t fdAdcCut = 0;
120
122 std::map<uint32_t, uint32_t> fdAdcCut_perFeb;
123
125 std::vector<double> fvdTimeOffsetNsAsics = {};
126
129
131 std::map<uint32_t, std::vector<std::vector<double>>> fWalkLookup = {};
132
135
137 bool fbDupliWithoutAdc = true;
138
140 bool fbUseFwBinning = true;
141
142 private:
143 ClassDef(CbmStsUnpackAlgoBase, 2)
144};
145
146#endif // CbmStsUnpackAlgoBase_H
void SetMonitor(std::shared_ptr< CbmStsUnpackMonitor > monitor)
Set a predefined monitor.
void SetMinAdcCut(uint32_t febid, uint32_t value)
std::vector< double > fvdTimeOffsetNsAsics
Time offsets per Asic???
virtual void MaskNoisyChannel(const uint32_t uFeb, const uint32_t uChan, const bool bMasked=true)
Mask a Noisy Channel.
virtual void finish()
Finish function for this algorithm base clase.
bool fbUseTimeWalkCorrection
Enable/Disable time-walk correction.
bool fbUseFwBinning
Enables firmware binning (some implementations ignore this)
void SetWalkMap(const std::map< uint32_t, CbmStsParModule > &mapIn)
Enable/Disable time-walk correction.
virtual ~CbmStsUnpackAlgoBase()
Destroy the Cbm Sts Unpack Task object.
uint32_t fdAdcCut
Minimum adc cut to store a hit.
std::map< uint32_t, std::vector< std::vector< double > > > fWalkLookup
Per-ASIC's sensors Time-Walk correction mapping.
bool fbRejectDuplicateDigis
Enables the rejection of duplicate digis.
void SetFwBinning(bool useFwBinning)
Enable/Disable firmware binning (switch only supported by older implementations)
void SetAsicTimeOffsetVec(std::vector< double > value)
Set the time offset per Asic.
std::shared_ptr< CbmStsUnpackMonitor > fMonitor
Potential (online) monitor for the unpacking process.
CbmStsUnpackAlgoBase(const CbmStsUnpackAlgoBase &)=delete
Copy constructor - not implemented.
CbmStsUnpackAlgoBase & operator=(const CbmStsUnpackAlgoBase &)=delete
Assignment operator - not implemented.
CbmStsUnpackAlgoBase(std::string name)
Create the Cbm Sts Unpack AlgoBase object.
virtual std::vector< std::pair< std::string, std::shared_ptr< FairParGenericSet > > > * GetParContainerRequest(std::string geoTag, std::uint32_t runId)
Get the requested parameter containers. To be defined in the derived classes! Return the required par...
void SetDuplicatesRejection(bool bIn=true, bool bDiffAdc=true)
Enable/Disable the duplicate digis rejection, without or with same ADC checks.
std::map< uint32_t, uint32_t > fdAdcCut_perFeb
Minimum adc cut per Feb to store a hit.
void SetMinAdcCut(uint32_t value)
Set the minimum adc cut value.
bool fbDupliWithoutAdc
If rejecting duplicate digis, enables rejection even if ADC differs.