CbmRoot
Loading...
Searching...
No Matches
CbmStsUnpackConfig.h
Go to the documentation of this file.
1/* Copyright (C) 2021 Goethe-University, Frankfurt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau, Pascal Raisig [committer], Dominik Smith */
4
18#ifndef CbmStsUnpackConfig_H
19#define CbmStsUnpackConfig_H
20
21#include "CbmErrorMessage.h" // REMARK this should become a Sts specific container I Would propose PR
22#include "CbmRecoUnpackConfig.tmpl"
23#include "CbmStsDigi.h"
24#include "CbmStsParModule.h"
25#include "CbmStsUnpackAlgo.h"
26#include "CbmStsUnpackMonitor.h"
27
28#include <Rtypes.h>
29#include <RtypesCore.h>
30
31#include <cstddef>
32#include <cstdint>
33#include <memory>
34#include <vector>
35
36class CbmStsUnpackConfig : public CbmRecoUnpackConfig<CbmStsUnpackAlgoBase, CbmStsDigi, CbmStsDigi, CbmErrorMessage> {
37
38 public:
46 CbmStsUnpackConfig(std::string detGeoSetupTag, UInt_t runid = 0);
47
52 virtual ~CbmStsUnpackConfig();
53
56
59
61 UInt_t uFeb;
62 UInt_t uChan;
63 Bool_t bMasked;
64 };
65
66 // Getters
68 std::shared_ptr<CbmStsUnpackMonitor> GetMonitor() { return fMonitor; }
69
74 void InitAlgo();
75
76 void MaskNoisyChannel(UInt_t uFeb, UInt_t uChan, Bool_t bMasked = kTRUE)
77 {
78 fvChanMasks.emplace_back(FebChanMaskReco{uFeb, uChan, bMasked});
79 }
80
81 // Setters
88 void SetAsicTimeOffset(size_t asicid, double value)
89 {
90 if (fvdTimeOffsetNsAsics.size() < (asicid + 1)) fvdTimeOffsetNsAsics.resize(asicid + 1);
91 fvdTimeOffsetNsAsics.at(asicid) = value;
92 }
94 void SetWalkMap(const std::map<uint32_t, CbmStsParModule>& mapIn) { fWalkMap = mapIn; }
95
97 void SetDuplicatesRejection(bool bIn = true, bool bDiffAdc = true)
98 {
100 fbDupliWithoutAdc = bDiffAdc;
101 }
102
104 void SetMinAdcCut(uint32_t value) { fdAdcCut = value; }
105
106 void SetMinAdcCut(uint32_t febid, uint32_t value) { fdAdcCut_perFeb[febid] = value; }
107
109 void SetMonitor(std::shared_ptr<CbmStsUnpackMonitor> value) { fMonitor = value; }
110
112 void SetFwBinning(bool useFwBinning) { fbUseFwBinning = useFwBinning; }
113
114 protected:
120 virtual std::shared_ptr<CbmStsUnpackAlgoBase> chooseAlgo();
121
123 std::shared_ptr<CbmStsUnpackMonitor> fMonitor = nullptr;
124
126 uint32_t fdAdcCut = 0;
127
129 std::map<uint32_t, uint32_t> fdAdcCut_perFeb;
130
132 std::vector<double> fvdTimeOffsetNsAsics = {};
133
136
138 std::map<uint32_t, CbmStsParModule> fWalkMap = {};
139
142
144 bool fbDupliWithoutAdc = true;
145
147 bool fbUseFwBinning = true;
148
150 std::vector<FebChanMaskReco> fvChanMasks = {};
151
152 private:
153 ClassDef(CbmStsUnpackConfig, 3)
154};
155
156#endif // CbmStsUnpackConfig_H
Baseclass for the STS unpacker algorithms.
virtual std::shared_ptr< CbmStsUnpackAlgoBase > chooseAlgo()
Choose the derived unpacker algorithm to be used for the DAQ output to Digi translation....
bool fbUseTimeWalkCorrection
Enables time-walk correction.
void MaskNoisyChannel(UInt_t uFeb, UInt_t uChan, Bool_t bMasked=kTRUE)
void SetAsicTimeOffset(size_t asicid, double value)
Set the Asic Time Offset.
CbmStsUnpackConfig & operator=(const CbmStsUnpackConfig &)=delete
Assignment operator - not implemented.
std::vector< double > fvdTimeOffsetNsAsics
Vector with the Asic time offsets.
std::shared_ptr< CbmStsUnpackMonitor > fMonitor
pointer to the monitor object
void SetFwBinning(bool useFwBinning)
Enable/Disable firmware binning (switch only supported by legacy algo)
std::map< uint32_t, uint32_t > fdAdcCut_perFeb
Minimum adc cut per Feb to store a hit.
bool fbUseFwBinning
Enables firmware binning (some implementations ignore this)
virtual ~CbmStsUnpackConfig()
Destroy the Cbm Sts Unpack Task object.
CbmStsUnpackConfig(const CbmStsUnpackConfig &)=delete
Copy constructor - not implemented.
void SetMinAdcCut(uint32_t value)
Set the minimum adc cut value.
void SetMinAdcCut(uint32_t febid, uint32_t value)
void InitAlgo()
Initialize the algorithm, should include all steps needing te parameter objects to be present....
void SetMonitor(std::shared_ptr< CbmStsUnpackMonitor > value)
Add a monitor to the unpacker.
uint32_t fdAdcCut
Minimum adc cut to store a hit.
CbmStsUnpackConfig(std::string detGeoSetupTag, UInt_t runid=0)
Create the Cbm Sts Unpack Task object.
std::shared_ptr< CbmStsUnpackMonitor > GetMonitor()
Get the potentially added monitor.
void SetDuplicatesRejection(bool bIn=true, bool bDiffAdc=true)
Enable/Disable the duplicate digis rejection, without or with same ADC checks.
std::vector< FebChanMaskReco > fvChanMasks
Temporary storage of user parameters.
void SetWalkMap(const std::map< uint32_t, CbmStsParModule > &mapIn)
Set Time-Walk correction map.
bool fbRejectDuplicateDigis
Enables the rejection of duplicate digis.
bool fbDupliWithoutAdc
If rejecting duplicate digis, enables rejection even if ADC differs.
std::map< uint32_t, CbmStsParModule > fWalkMap
Time-Walk Parameters map.