CbmRoot
Loading...
Searching...
No Matches
CbmMuchUnpackConfig.h
Go to the documentation of this file.
1/* Copyright (C) 2022 Fair GmbH, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
15#ifndef CbmMuchUnpackConfig_H
16#define CbmMuchUnpackConfig_H
17
18#include "CbmErrorMessage.h" // REMARK this should become a Much specific container I Would propose PR
19#include "CbmMuchDigi.h"
20#include "CbmMuchUnpackAlgo.h"
22#include "CbmRecoUnpackConfig.tmpl"
23
24#include <Rtypes.h>
25#include <RtypesCore.h>
26
27#include <cstddef>
28#include <cstdint>
29#include <memory>
30#include <vector>
31
32class CbmMuchUnpackConfig : public CbmRecoUnpackConfig<CbmMuchUnpackAlgo, CbmMuchDigi, CbmMuchDigi, CbmErrorMessage> {
33
34 public:
42 CbmMuchUnpackConfig(std::string detGeoSetupTag, UInt_t runid = 0);
43
48 virtual ~CbmMuchUnpackConfig();
49
52
55
57 UInt_t uFeb;
58 UInt_t uChan;
59 Bool_t bMasked;
60 };
61
62 // Getters
64 std::shared_ptr<CbmMuchUnpackMonitor> GetMonitor() { return fMonitor; }
65
70 void InitAlgo();
71
72 void MaskNoisyChannel(UInt_t uFeb, UInt_t uChan, Bool_t bMasked = kTRUE)
73 {
74 fvChanMasks.emplace_back(FebChanMaskReco{uFeb, uChan, bMasked});
75 }
76
81 virtual std::pair<size_t, bool> ReadInactiveChannels();
82
83 // Setters
90 void SetAsicTimeOffset(size_t asicid, double value)
91 {
92 if (fvdTimeOffsetNsAsics.size() < (asicid + 1)) fvdTimeOffsetNsAsics.resize(asicid + 1);
93 fvdTimeOffsetNsAsics.at(asicid) = value;
94 }
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<CbmMuchUnpackMonitor> value) { fMonitor = value; }
110
116 void SetParFileName(std::string sNewName) { fsParFileName = sNewName; }
117 void LoadParFileName() { fAlgo->SetParFileName(fsParFileName); }
118
119 void SetNoisyChannelFile(TString fileName) { fInactiveChannelFileName = fileName; }
120
121 protected:
127 virtual std::shared_ptr<CbmMuchUnpackAlgo> chooseAlgo();
128
130 std::shared_ptr<CbmMuchUnpackMonitor> fMonitor = nullptr;
131
133 uint32_t fdAdcCut = 0;
134
136 std::map<uint32_t, uint32_t> fdAdcCut_perFeb;
137
139 std::vector<double> fvdTimeOffsetNsAsics = {};
140
143
145 bool fbDupliWithoutAdc = true;
146
148 std::vector<FebChanMaskReco> fvChanMasks = {};
149
151 std::string fsParFileName = "mMuchPar.par";
153
154 private:
155 ClassDef(CbmMuchUnpackConfig, 2)
156};
157
158#endif // CbmMuchUnpackConfig_H
MUCH unpacker algorithms.
void SetParFileName(std::string sNewName)
Sets the name of the parameter file to be used.
CbmMuchUnpackConfig(const CbmMuchUnpackConfig &)=delete
Copy constructor - not implemented.
void MaskNoisyChannel(UInt_t uFeb, UInt_t uChan, Bool_t bMasked=kTRUE)
void SetMinAdcCut(uint32_t febid, uint32_t value)
void SetNoisyChannelFile(TString fileName)
std::map< uint32_t, uint32_t > fdAdcCut_perFeb
Minimum adc cut per Feb to store a hit.
virtual ~CbmMuchUnpackConfig()
Destroy the Cbm Sts Unpack Task object.
void InitAlgo()
Initialize the algorithm, should include all steps needing te parameter objects to be present....
void SetMonitor(std::shared_ptr< CbmMuchUnpackMonitor > value)
Add a monitor to the unpacker.
bool fbDupliWithoutAdc
If rejecting duplicate digis, enables rejection even if ADC differs.
CbmMuchUnpackConfig & operator=(const CbmMuchUnpackConfig &)=delete
Assignment operator - not implemented.
void SetAsicTimeOffset(size_t asicid, double value)
Set the Asic Time Offset.
void SetMinAdcCut(uint32_t value)
Set the minimum adc cut value.
bool fbRejectDuplicateDigis
Enables the rejection of duplicate digis.
uint32_t fdAdcCut
Minimum adc cut to store a hit.
std::shared_ptr< CbmMuchUnpackMonitor > fMonitor
pointer to the monitor object
virtual std::shared_ptr< CbmMuchUnpackAlgo > chooseAlgo()
Choose the derived unpacker algorithm to be used for the DAQ output to Digi translation....
std::vector< double > fvdTimeOffsetNsAsics
Vector with the Asic time offsets.
std::string fsParFileName
Parameter file name.
std::vector< FebChanMaskReco > fvChanMasks
Temporary storage of user parameters.
virtual std::pair< size_t, bool > ReadInactiveChannels()
Read Inactive Channel list based on CbmMuchAddress from a file.
std::shared_ptr< CbmMuchUnpackMonitor > GetMonitor()
Get the potentially added monitor.
CbmMuchUnpackConfig(std::string detGeoSetupTag, UInt_t runid=0)
Create the Cbm Sts Unpack Task object.
void SetDuplicatesRejection(bool bIn=true, bool bDiffAdc=true)
Enable/Disable the duplicate digis rejection, without or with same ADC checks.