6#ifndef BMNADCPROCESSOR_H
7#define BMNADCPROCESSOR_H
16#include <unordered_map>
27#include <FairLogger.h>
40#define N_EV_FOR_PEDESTALS 500
41#define ADC_N_CHANNELS 64
42#define ADC_PROF_N_CHANNELS 2
43#define ADC_SIBT_N_SAMPLES 64
44#define ADC128_N_SAMPLES 128
45#define ADC32_N_SAMPLES 32
48using std::unordered_map;
112 return (nSmpl == 128) ? 1542 : 1992;
128 typedef std::tuple<uint16_t, uint16_t, uint8_t>
KeySML;
129 typedef std::tuple<uint16_t, uint16_t>
KeySM;
150 template<
typename cl>
154 UInt_t serial = it.first;
166 template<
typename SST>
169 Int_t kNStations = ss->GetNStations();
172 for (
Int_t iSt = 0; iSt < kNStations; ++iSt) {
173 auto* st = ss->GetStation(iSt);
174 UInt_t nModules = st->GetNModules();
177 for (UInt_t iMod = 0; iMod < nModules; ++iMod) {
178 auto* mod = st->GetModule(iMod);
179 Int_t nLayers = mod->GetNStripLayers();
182 for (
Int_t iLay = 0; iLay < nLayers; ++iLay) {
183 auto& lay = mod->GetStripLayer(iLay);
184 Int_t nStrips = lay.GetNStrips();
186 histName.
Form(
"%s_%d_%d_%d",
fDetName.Data(), iSt, iMod, iLay);
188 printf(
"SigProf %s strips %d\n", histName.
Data(), nStrips);
189 fSigProf[iSt][iMod][iLay] =
new TH1F(histName, histName, nStrips, 0, nStrips);
190 fSigProf[iSt][iMod][iLay]->SetDirectory(0);
192 for (
Int_t iStrip = 0; iStrip < nStrips; ++iStrip)
199 template<
typename SST>
202 Int_t kNStations = ss->GetNStations();
203 for (
Int_t iSt = 0; iSt < kNStations; ++iSt) {
204 auto* st = ss->GetStation(iSt);
205 for (
Int_t iMod = 0; iMod < st->GetNModules(); ++iMod) {
206 auto* mod = st->GetModule(iMod);
207 for (
Int_t iLay = 0; iLay < mod->GetNStripLayers(); ++iLay) {
225 unordered_map<UInt_t, size_t>
fSerMap;
245 vector<vector<TH1*>>
hCMode;
246 vector<vector<TH1*>>
hSMode;
#define ClassDef(name, id)
BmnStatus
Define status code.
BmnSetup
Define experimental setup.
unordered_map< UInt_t, size_t > fSerMap
ADC serials map.
void DeleteStripNoiseArrays(SST &ss)
void PrecalcEventMods(TClonesArray *adc)
void InitStripNoiseArrays(SST &ss)
Double_t **** fPedDat
data set to calculate pedestals
BmnStatus RecalculatePedestalsAugmented()
map< PlMapKey, Double_t > fSpecThreshMap
Double_t **** GetPedData()
Double_t *** GetPedestalsRMS()
void CalcEventMods_simd()
Bool_t *** fNoisyChipChannels
BmnAdcProcessor(uint32_t period, uint32_t run, TString det, uint16_t nCh, const uint16_t nSmpl, BmnSetup setup=kBMNSETUP)
void SetThreshold(Double_t final_thr, Double_t thr_dif=-1, Double_t n_iters=-1, Double_t cmod_cut=-1)
BmnStatus SaveFilterInfo(TFile *cTalibFile)
std::tuple< uint16_t, uint16_t, uint8_t > KeySML
vector< uint32_t > fAdcSerials
list of serial id for ADC-detector
void SetEvForPedestals(uint32_t v)
vector< vector< TH1 * > > hCMode
virtual ~BmnAdcProcessor()
unordered_map< uint32_t, size_t > & GetSerialMap()
Bool_t **** fNoisyChannels
const uint16_t fNChannels
void CopyData2PedMap(TClonesArray *adc, UInt_t ev)
void GrabSerialsFromMap(unordered_map< UInt_t, cl > m)
void GrabNewSerial(UInt_t serial)
const uint16_t GetNChannels()
void InitChipNoiseArrays()
std::tuple< uint16_t, uint16_t > KeySM
void PrecalcEventMods_simd(TClonesArray *adc)
const uint16_t GetNSamples()
Float_t GetPedestal(uint32_t iSer, Int_t ch, Int_t smpl)
Bool_t *** GetNoisyChipChannels()
Float_t *** GetPedestals()
vector< vector< TH1 * > > hPedLine
vector< vector< TH1 * > > hSMode
vector< vector< TH1 * > > hPedLineSi
void(BmnAdcProcessor::* PrecalcEventModsImp)(TClonesArray *adc)
Double_t CalcCMS(Double_t *samples, Int_t size)
void SetApplyThreshold(bool b)
static BmnStatus DrawFilterInfo(BmnCalibData *data)
BmnStatus LoadFilterInfo(TFile *cTalibFile)
uint32_t GetBoundaryRun(uint16_t nSmpl)
uint32_t GetEvForPedestals()
vector< uint32_t > & GetSerials()
BmnStatus RecalculatePedestals()
const char * Data() const
void Form(const char *fmt,...)
Define enumerations used in tracking.