BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnSiliconRaw2Digit.cxx
Go to the documentation of this file.
2
3// Boost
4#include <boost/program_options.hpp>
5// BmnRoot
6#include "BmnRawDataDecoder.h"
7
8namespace po = boost::program_options;
9
10BmnSiliconRaw2Digit::BmnSiliconRaw2Digit(uint32_t period, uint32_t run, TString MapFileName, BmnSetup bmnSetup)
11 : BmnAdcProcessor(period, run, "SILICON", ADC_N_CHANNELS, ADC128_N_SAMPLES, bmnSetup)
13 , fMapFileName(MapFileName)
14{
15 LOG(info) << "Loading SILICON Map from FILE: Period " << period << ", Run " << run << "...";
17 // GrabSerialsFromMap(fOuterMap);
19
20 Int_t kNStations = fSilStationSet->GetNStations();
21 fSigProf = new TH1F***[kNStations];
22 fNoisyChannels = new Bool_t***[kNStations];
23 for (Int_t iSt = 0; iSt < kNStations; ++iSt) {
24 auto* st = fSilStationSet->GetStation(iSt);
25 Int_t kNModules = st->GetNModules();
26 fSigProf[iSt] = new TH1F**[kNModules];
27 fNoisyChannels[iSt] = new Bool_t**[kNModules];
28 for (Int_t iMod = 0; iMod < kNModules; ++iMod) {
29 auto* mod = st->GetModule(iMod);
30 Int_t kNLayers = 2; // mod->GetNStripLayers();
31 fSigProf[iSt][iMod] = new TH1F*[kNLayers];
32 fNoisyChannels[iSt][iMod] = new Bool_t*[kNLayers];
33 for (Int_t iLay = 0; iLay < kNLayers; ++iLay) {
34 BmnSiliconLayer& lay = mod->GetStripLayer(iLay);
35 if (iSt != 0) {
36 BmnSiliconLayer& lay1 = mod->GetStripLayer(iLay * 2);
37 BmnSiliconLayer& lay2 = mod->GetStripLayer(iLay * 2 + 1);
38 if (lay1.GetLastStripNumber() > lay2.GetLastStripNumber())
39 lay = lay1;
40 else
41 lay = lay2;
42 // LOGF(info, "Station: %d, Module: %2d, PseudoLayer: %2d, Strips: %3d", iSt,
43 // iMod, iLay, lay.GetLastStripNumber() + 1); LOGF(info, "\tLay 1 FirstStripNumber:
44 // %3d, LastStripNumber: %3d", lay1.GetFirstStripNumber(),
45 // lay1.GetLastStripNumber()); LOGF(info, "\tLay 2 FirstStripNumber: %3d,
46 // LastStripNumber: %3d", lay2.GetFirstStripNumber(), lay2.GetLastStripNumber());
47 }
48 LOGF(debug, "Station: %d, Module: %2d, PseudoLayer: %2d, Strips: %3d", iSt, iMod, iLay,
49 lay.GetLastStripNumber() + 1);
50 // printf("FirstStripNumber: %3d, LastStripNumber: %3d\n", lay.GetFirstStripNumber(),
51 // lay.GetLastStripNumber());
52 Int_t kNStrips = lay.GetLastStripNumber() + 1;
53 TString histName;
54 histName.Form("%s_%d_%d_%d", fDetName.Data(), iSt, iMod, iLay);
55 fSigProf[iSt][iMod][iLay] = new TH1F(histName, histName, kNStrips, 0, kNStrips);
56 fSigProf[iSt][iMod][iLay]->SetDirectory(0);
57 fNoisyChannels[iSt][iMod][iLay] = new Bool_t[kNStrips + 30]();
58 // for (Int_t iStrip = 0; iStrip < kNStrips; ++iStrip){
59 // LOGF(info, "fNoisyChannels Station: %d, Module: %2d, PseudoLayer: %2d iStrip: %d
60 // is %d",
61 // iSt,iMod,iLay, iStrip, fNoisyChannels[iSt][iMod][iLay][iStrip]);
62 // fNoisyChannels[iSt][iMod][iLay][iStrip] = kFALSE;
63 // }
64 }
65 }
66 }
67}
68
70{
71 Int_t kNStations = fSilStationSet->GetNStations();
72 for (Int_t iSt = 0; iSt < kNStations; ++iSt) {
73 auto* st = fSilStationSet->GetStation(iSt);
74 Int_t kNModules = st->GetNModules();
75 for (Int_t iMod = 0; iMod < kNModules; ++iMod) {
76 // auto *mod = st->GetModule(iMod);
77 Int_t kNLayers = 2; // mod->GetNStripLayers();
78 for (Int_t iLay = 0; iLay < kNLayers; ++iLay) {
79 delete fSigProf[iSt][iMod][iLay];
80 delete[] fNoisyChannels[iSt][iMod][iLay];
81 }
82 delete[] fSigProf[iSt][iMod];
83 delete[] fNoisyChannels[iSt][iMod];
84 }
85 delete[] fSigProf[iSt];
86 delete[] fNoisyChannels[iSt];
87 }
88 delete[] fNoisyChannels;
89 delete[] fSigProf;
90 if (canStrip)
91 delete canStrip;
92 for (auto& it : fOuterMap)
93 for (auto& inner : it.second)
94 delete inner.second;
95}
96
98{
99 UInt_t ser = 0;
100 Int_t ch_lo = 0;
101 Int_t ch_hi = 0;
102 Int_t mod_adc = 0;
103 Int_t iMod = 0;
104 Int_t iLay = 0;
105 Int_t iStation = 0;
106
107 vector<string> channel_map;
108 vector<string> spec_thr;
109 Double_t final_thr = 0;
110 Double_t thr_dif = 0;
111 Int_t n_iters = 0;
112 Double_t cmod_cut = 0;
113
114 // Setup options.
115 po::options_description desc("Options");
116 desc.add_options()("CHANNEL_MAP.channels", po::value<vector<string>>(&channel_map)->multitoken(),
117 "ADC channel -> strip map")("SIGNAL_CONFIGURATION.spec_thr",
118 po::value<vector<string>>(&spec_thr)->multitoken(),
119 "ADC channel -> strip map")(
120 "SIGNAL_CONFIGURATION.Threshold", po::value<Double_t>(&final_thr)->default_value(150), "ADC final threshold")(
121 "SIGNAL_CONFIGURATION.ThresholdDif", po::value<Double_t>(&thr_dif)->default_value(100), "ADC threshold step")(
122 "SIGNAL_CONFIGURATION.NIterations", po::value<Int_t>(&n_iters)->default_value(6), "ADC filter iterations")(
123 "SIGNAL_CONFIGURATION.CModCut", po::value<Double_t>(&cmod_cut)->default_value(100), "ADC CModCut");
124
125 // Load config file.
126 po::variables_map vm;
127 TString name = TString(getenv("VMCWORKDIR")) + TString("/input/") + fMapFileName;
128 ifstream config_file(name.Data(), ifstream::in);
129 if (!config_file.is_open()) {
130 LOG(error) << "Error opening map-file (" << name << ")!";
131 return kBMNERROR;
132 }
133 po::store(po::parse_config_file(config_file, desc), vm);
134 config_file.close();
135 po::notify(vm);
136
137 // set thresholds
138 SetThreshold(final_thr, thr_dif, n_iters, cmod_cut);
139
140 // set specific thresholds
141 Int_t ch = 0;
142 Double_t thr = 0;
143 for (auto& str : spec_thr) {
144 istringstream ss(str);
145 ss >> std::hex >> ser >> std::dec >> ch >> thr;
146 fSpecThreshMap.insert(make_pair(make_pair(ser, ch), thr));
147 LOGF(debug, "Serial 0x%08X Channel %2d Threshold %3.3f", ser, ch, thr);
148 }
149
150 // set channel map
151 for (auto& str : channel_map) {
152 istringstream ss(str);
153 ss >> std::hex >> ser >> std::dec >> ch_lo >> ch_hi >> mod_adc >> iMod >> iLay >> iStation;
154 BmnSiliconMapInfo* record = new BmnSiliconMapInfo();
155 record->station = iStation;
156 record->module = iMod;
157 record->layer = iLay;
158 record->serial = ser;
159 if (ch_lo < ch_hi) {
160 record->channel_low = ch_lo;
161 record->channel_high = ch_hi;
162 } else {
163 record->channel_low = ch_hi;
164 record->channel_high = ch_lo;
165 record->inverted = true;
166 }
167 auto it = fOuterMap.find(ser);
168 if (it == fOuterMap.end()) { // create inner channel map for the serial
169 InChanMapSil inner;
170 inner.insert(make_pair(record->channel_low - 1, nullptr));
171 inner.insert(make_pair(record->channel_high, record));
172 fOuterMap.insert(make_pair(ser, move(inner)));
173 } else { // add range to the existing inner channel map
174 InChanMapSil& inner = it->second;
175 auto innerItHi = inner.find(record->channel_high);
176 auto innerItLo = inner.find(record->channel_low - 1);
177 if (innerItHi == inner.end()) {
178 inner.insert(make_pair(record->channel_high, record));
179 } else {
180 if (innerItHi->second == nullptr) {
181 inner.erase(innerItHi);
182 inner.insert(make_pair(record->channel_high, record));
183 } else {
184 fprintf(stderr, "Wrong %s map! Overlapping intervals for %08X!\n", fDetName.Data(), ser);
185 return kBMNERROR;
186 }
187 }
188 if (innerItLo == inner.end()) {
189 inner.insert(make_pair(record->channel_low - 1, nullptr));
190 }
191 }
192 // fSML2Crate[{iStation,iMod,iLay}] = GetNSerials();
193 fSML2MapInfo[{iStation, iMod, iLay}] = record;
194 GrabNewSerial(ser);
195 // set strip range
196 auto* st = fSilStationSet->GetStation(record->station);
197 auto* mod = st->GetModule(record->module);
198 int32_t strip_min{INT32_MAX};
199 int32_t strip_max{0};
200 if (mod->GetNStripLayers() == 4) {
201 BmnSiliconLayer& lay1 = mod->GetStripLayer(record->layer * 2);
202 BmnSiliconLayer& lay2 = mod->GetStripLayer(record->layer * 2 + 1);
203 if (strip_min > lay1.GetFirstStripNumber())
204 strip_min = lay1.GetFirstStripNumber();
205 if (strip_min > lay2.GetFirstStripNumber())
206 strip_min = lay2.GetFirstStripNumber();
207 if (strip_max < lay1.GetLastStripNumber())
208 strip_max = lay1.GetLastStripNumber();
209 if (strip_max < lay2.GetLastStripNumber())
210 strip_max = lay2.GetLastStripNumber();
211 } else {
212 BmnSiliconLayer& lay = mod->GetStripLayer(record->layer);
213 if (strip_min > lay.GetFirstStripNumber())
214 strip_min = lay.GetFirstStripNumber();
215 if (strip_max < lay.GetLastStripNumber())
216 strip_max = lay.GetLastStripNumber();
217 }
218 record->strip_min = strip_min;
219 record->strip_max = strip_max;
220 }
221 return kBMNSUCCESS;
222}
223
225{
226 (this->*PrecalcEventModsImp)(adc);
227#ifdef BUILD_DEBUG
229#else
231#endif
232 ProcessAdc(digits, kFALSE);
233 return kBMNSUCCESS;
234}
235
237{
238 (this->*PrecalcEventModsImp)(adc);
239#ifdef BUILD_DEBUG
241#else
243#endif
244 ProcessAdc(nullptr, kTRUE);
245
246 return kBMNSUCCESS;
247}
248
250{
251 const Int_t kNStripsInBunch = BmnRawDataDecoder::samplesSil; // GetNSamples();
252 // const Int_t kNBunches = kNStrips / kNStripsInBunch;
255 LOGF(info, "Searching Noisy Channels in Silicon Strip Detectors");
256 LOGF(info, "Window size: %3d, Threshold: %.2f, Correction: %3d", kNStripsInBunch, kNThresh,
257 (int)round(correction));
258 // repeat noisy channels in the physical terms (station/module/layer)
259 for (size_t iCr = 0; iCr < GetNSerials(); ++iCr) {
260 auto it = fOuterMap.find(GetSerials()[iCr]);
261 if (it == fOuterMap.end())
262 continue;
263 for (uint16_t iCh = 0; iCh < GetNChannels(); ++iCh) {
264 InChanMapSil& inner = it->second;
265 auto innerIt = inner.lower_bound(iCh);
266 if (innerIt == inner.end())
267 continue;
268 BmnSiliconMapInfo* rec = innerIt->second;
269 if (!rec)
270 continue;
271 for (uint16_t iSmpl = 0; iSmpl < GetNSamples(); ++iSmpl) {
272 if (GetNoisyChipChannels()[iCr][iCh][iSmpl] == kTRUE) {
273 Int_t iStrip = MapStrip(rec, iCh, iSmpl);
274 if ((iStrip > rec->strip_max) || (iStrip < rec->strip_min)) {
275 LOGF(debug2,
276 "fNoisyChannels strip outside range!\n\t"
277 " Station: %d, Module: %2d, Layer: %2d iStrip: %d set true",
278 rec->station, rec->module, rec->layer, iStrip);
279 LOGF(debug2, "lay : [%3d, %3d]", rec->strip_min, rec->strip_max);
280 continue;
281 }
282 fNoisyChannels[rec->station][rec->module][rec->layer][iStrip] = kTRUE;
283 }
284 }
285 }
286 }
287 int newNoisyCnt = 0;
288 // LOGF(info, "mark noisy");
289 // mark noisy
290 for (Int_t iSt = 0; iSt < fSilStationSet->GetNStations(); ++iSt) {
291 auto* st = fSilStationSet->GetStation(iSt);
292 for (Int_t iMod = 0; iMod < st->GetNModules(); ++iMod) {
293 auto* mod = st->GetModule(iMod);
294 for (Int_t iLay = 0; iLay < 2 /*mod->GetNStripLayers()*/; ++iLay) {
295 // LOGF(info, "fNoisyChannels Station: %d, Module: %2d, PseudoLayer: %2d iStrip: %d
296 // set true",
297 // rec->station, rec->module, rec->layer, iStrip);
298 TH1F* prof = fSigProf[iSt][iMod][iLay];
299 /** Big module has 2 separate parts of each layer*/
300 // Int_t realILayer = (mod->GetNStripLayers() == 4) ? 2 * iLay : iLay;
301 BmnSiliconLayer& lay = mod->GetStripLayer(iLay);
302 if (iSt != 0) {
303 BmnSiliconLayer& lay1 = mod->GetStripLayer(iLay * 2);
304 BmnSiliconLayer& lay2 = mod->GetStripLayer(iLay * 2 + 1);
305 if (lay1.GetLastStripNumber() > lay2.GetLastStripNumber())
306 lay = lay1;
307 else
308 lay = lay2;
309 }
310 Double_t sum;
311 Int_t properStrips;
312 bool newNoisyChannels = true;
313 while (newNoisyChannels) {
314 sum = 0.0;
315 properStrips = 0;
316 newNoisyChannels = false;
317 // calculating initial window
318 vector<int> noisyChannels;
319 for (Int_t iStrip = 0; iStrip < kNStripsInBunch; ++iStrip) {
320 Int_t strip = iStrip; // + iBunch * kNStripsInBunch;
321 if (fNoisyChannels[iSt][iMod][iLay][strip] == kTRUE)
322 continue;
323 Double_t curr = prof->GetBinContent(strip + 1);
324 sum += curr;
325 if (curr > 0) // current channel might be broken
326 properStrips++;
327 }
328 // LOGF(info, "checking noisy channels");
329 // marking noisy channels
330 for (Int_t strip = 0; strip < lay.GetLastStripNumber() + 1; strip++) {
331 // checking if this channel is noisy
332 // LOGF(info, "check noise on iSt %d iMod %d iLay %d strip
333 // %d",
334 // iSt, iMod, iLay, strip);
335 if (fNoisyChannels[iSt][iMod][iLay][strip] == kFALSE) {
336 Double_t curr = prof->GetBinContent(strip + 1);
337 if (curr > 0 && properStrips > 0) {
338 if (properStrips == 1
339 || (kNThresh * (sum - curr) / (properStrips - 1) < curr - correction))
340 {
341 LOGF(debug2, "profile noise on iSt %d iMod %d iLay %d strip %d", iSt, iMod, iLay,
342 strip);
343 newNoisyCnt++;
344 newNoisyChannels = true;
345 noisyChannels.push_back(strip);
346 }
347 }
348 }
349 // moving the current frame for calculating mean
350 if (strip >= (kNStripsInBunch - 1) / 2
351 && lay.GetLastStripNumber() + 1 - strip > (kNStripsInBunch / 2) + 1)
352 {
353 if ((fNoisyChannels[iSt][iMod][iLay][strip - (kNStripsInBunch - 1) / 2] == kFALSE)) {
354 sum -= prof->GetBinContent(strip - (kNStripsInBunch - 1) / 2
355 + 1); // first element in window
356 if (prof->GetBinContent(strip - (kNStripsInBunch - 1) / 2 + 1) > 0)
357 properStrips--;
358 }
359 // LOGF(info, "check noise on iSt %d iMod %d iLay %d
360 // strip %d left bound",
361 // iSt, iMod, iLay, strip);
362 if ((fNoisyChannels[iSt][iMod][iLay][strip + (kNStripsInBunch / 2) + 1] == kFALSE)) {
363 sum += prof->GetBinContent(strip + (kNStripsInBunch / 2) + 1
364 + 1); // element right after the window
365 if (prof->GetBinContent(strip + (kNStripsInBunch / 2) + 1 + 1) > 0)
366 properStrips++;
367 }
368 }
369 }
370 // LOGF(info, "marking noisy channels");
371 auto it = fSML2MapInfo.find({iSt, iMod, iLay});
372 if (it == fSML2MapInfo.end())
373 continue;
374 BmnSiliconMapInfo* rec = it->second;
375 uint32_t iCr = fSerMap[rec->serial];
376 for (auto strip : noisyChannels) {
377 fNoisyChannels[iSt][iMod][iLay][strip] = kTRUE;
378 uint16_t iCh = rec->inverted ? (rec->channel_high - strip / GetNSamples())
379 : (rec->channel_low + strip / GetNSamples());
380 UInt_t iSmpl = (strip) % GetNSamples();
381 GetNoisyChipChannels()[iCr][iCh][iSmpl] = kTRUE;
382 }
383 }
384 }
385 }
386 }
387 // LOGF(info, "Marked %d new channels as noisy on Silicon Strip Detectors", newNoisyCnt);
388 // repeat noisy channels back into the electronics terms
389 for (size_t iCr = 0; iCr < GetNSerials(); ++iCr) {
390 auto it = fOuterMap.find(GetSerials()[iCr]);
391 if (it == fOuterMap.end())
392 continue;
393 for (uint16_t iCh = 0; iCh < GetNChannels(); ++iCh) {
394 InChanMapSil& inner = it->second;
395 auto innerIt = inner.lower_bound(iCh);
396 if (innerIt == inner.end())
397 continue;
398 BmnSiliconMapInfo* rec = innerIt->second;
399 if (!rec)
400 continue;
401 for (uint16_t iSmpl = 0; iSmpl < GetNSamples(); ++iSmpl) {
402 Int_t iStrip = MapStrip(rec, iCh, iSmpl);
403 if ((iStrip > rec->strip_max) || (iStrip < rec->strip_min)) {
404 LOGF(debug2,
405 "fNoisyChannels strip outside range!\n\t"
406 " Station: %d, Module: %2d, Layer: %2d iStrip: %d set true back",
407 rec->station, rec->module, rec->layer, iStrip);
408 LOGF(debug2, "lay : [%3d, %3d]", rec->strip_min, rec->strip_max);
409 continue;
410 }
411 if (fNoisyChannels[rec->station][rec->module][rec->layer][iStrip] == kTRUE)
412 GetNoisyChipChannels()[iCr][iCh][iSmpl] = kTRUE;
413 }
414 }
415 }
416 // LOGF(info, "Finished marking on Silicon Strip Detectors");
417 return kBMNSUCCESS;
418}
419
421{
422 for (size_t iCr = 0; iCr < GetNSerials(); ++iCr) {
423 auto it = fOuterMap.find(GetSerials()[iCr]);
424 if (it == fOuterMap.end())
425 continue;
426 for (uint16_t iCh = 0; iCh < GetNChannels(); ++iCh) {
427 auto innerIt = it->second.lower_bound(iCh);
428 if (innerIt == it->second.end())
429 continue;
430 BmnSiliconMapInfo* rec = innerIt->second;
431 if (!rec)
432 continue;
433 // spec threshold
434 Double_t SpecThr(0);
435 auto itThr = fSpecThreshMap.find(make_pair(GetSerials()[iCr], iCh));
436 if (itThr != fSpecThreshMap.end())
437 SpecThr = itThr->second;
438 // strip map
439 uint16_t station = rec->station;
440 uint16_t module = rec->module;
441 uint16_t layer = rec->layer;
442 int32_t sampleShift =
443 (rec->inverted) ? (rec->channel_high - iCh) * GetNSamples() : (iCh - rec->channel_low) * GetNSamples();
444 // printf("st %d mod %d l %d\n", station, module ,layer);
445 Double_t cs = fCMode[iCr][iCh] - fSMode[iCr][iCh];
446 for (uint16_t iSmpl = 0; iSmpl < GetNSamples(); ++iSmpl) {
447 if ((GetNoisyChipChannels()[iCr][iCh][iSmpl] == kTRUE) /* || (fPedVal[iCr][iCh][iSmpl] == 0.0)*/)
448 continue;
449 int32_t iStrip = sampleShift + iSmpl;
450 // int32_t iStrip = MapStrip(rec, iCh, iSmpl);
451 if ((iStrip > rec->strip_max) || (iStrip < rec->strip_min)) {
452 LOGF(debug2,
453 "fNoisyChannels strip outside range!\n\t"
454 " Station: %d, Module: %2d, Layer: %2d iStrip: %d digi add",
455 rec->station, rec->module, rec->layer, iStrip);
456 LOGF(debug2, "lay : [%3d, %3d]", rec->strip_min, rec->strip_max);
457 continue;
458 }
459 Double_t sig = fAdc[iCr][iCh][iSmpl] - fPedVal[iCr][iCh][iSmpl] + cs;
460 // LOGF(debug2,"%s st %2d mod %2d l %2d strip %4d ser %08X ch %2d iSmpl %3d pedestal
461 // %4.2f CMode %4.2f SMode %4.2f GetPedestalsRMS() %4.2f sig %4.2f\n",
462 // fDetName.Data(), station, module, layer, strip, GetSerials()[iCr], iCh, iSmpl,
463 // fPedVal[iCr][iCh][iSmpl], fCMode[iCr][iCh], fSMode[iCr][iCh],
464 // GetPedestalsRMS()[iCr][iCh][iSmpl], sig);
465 if (layer == 1)
466 sig = -sig;
467 // Double_t Asig = TMath::Abs(sig);
468 // Double_t thr = Max(SpecThr, Max(FinalThr, 3.5 * GetPedestalsRMS()[iCr][iCh][iSmpl]));
469 // // default
470 Double_t thr = Max(SpecThr, FinalThr);
471 if ((!GetApplyThreshold()) || (sig > thr)) {
472 if (doFill) {
473 if (Abs(fCMode[iCr][iCh] - fSMode[iCr][iCh]) < cmodcut)
474 fSigProf[station][module][layer]->Fill(iStrip);
475 }
476 if (digs) {
477 // if ((fVerbose > 0) && (GetSerials()[iCr] == 0x0AADF52A) && (!doFill))
478 // LOGF(debug2, "%s st %2d mod %2d l %2d strip %4d ser %08X ch %2d iSmpl"
479 // " %3d pedestal %4.2f CMode %4.2f SMode %4.2f GetPedestalsRMS() %4.2f" "sig %4.2f\n",
480 // fDetName.Data(), station, module, layer, strip, GetSerials()[iCr], iCh, iSmpl,
481 // fPedVal[iCr][iCh][iSmpl], fCMode[iCr][iCh],
482 // fSMode[iCr][iCh], GetPedestalsRMS()[iCr][iCh][iSmpl], sig);
483 BmnSiliconDigit* resDig = new ((*digs)[digs->GetEntriesFast()])
484 BmnSiliconDigit(station, module, layer, iStrip, sig, GetPedestalsRMS()[iCr][iCh][iSmpl]);
485 if ((Abs(fCMode[iCr][iCh] - fSMode[iCr][iCh]) > cmodcut))
486 resDig->SetIsGoodDigit(kFALSE);
487 else
488 resDig->SetIsGoodDigit(kTRUE);
489 }
490 }
491 }
492 }
493 }
494}
#define ADC128_N_SAMPLES
#define ADC_N_CHANNELS
BmnStatus
Define status code.
Definition BmnEnums.h:93
@ kBMNERROR
Error.
Definition BmnEnums.h:95
@ kBMNSUCCESS
Success.
Definition BmnEnums.h:94
map< int32_t, BmnSiliconMapInfo * > InChanMapSil
upper channel to map info (range map (C++20 is still unavailable, so we have to use crutches))
bool Bool_t
int Int_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
unordered_map< UInt_t, size_t > fSerMap
ADC serials map.
Double_t *** GetPedestalsRMS()
Float_t *** fPedVal
BmnAdcProcessor(uint32_t period, uint32_t run, TString det, uint16_t nCh, const uint16_t nSmpl, BmnSetup setup=kBMNSETUP)
map< PlMapKey, Double_t > fSpecThreshMap
void SetThreshold(Double_t final_thr, Double_t thr_dif=-1, Double_t n_iters=-1, Double_t cmod_cut=-1)
Bool_t **** fNoisyChannels
void GrabNewSerial(UInt_t serial)
const uint16_t GetNChannels()
const uint16_t GetNSamples()
void(BmnAdcProcessor::* PrecalcEventModsImp)(TClonesArray *adc)
Bool_t *** GetNoisyChipChannels()
vector< uint32_t > & GetSerials()
static double threshSil
static double correctionSil
Int_t GetFirstStripNumber()
Int_t GetLastStripNumber()
BmnStatus FillProfiles(TClonesArray *adc)
unordered_map< uint32_t, InChanMapSil > fOuterMap
BmnSiliconRaw2Digit(uint32_t period, uint32_t run, TString MapFileName, BmnSetup bmnSetup=kBMNSETUP)
unique_ptr< BmnSiliconStationSet > fSilStationSet
int32_t MapStrip(BmnSiliconMapInfo *v, uint16_t &iCh, uint16_t &iSmpl)
BmnStatus FillEvent(TClonesArray *adc, TClonesArray *sts)
void ProcessAdc(TClonesArray *silicon, Bool_t doFill)
map< KeySML, BmnSiliconMapInfo * > fSML2MapInfo
void SetIsGoodDigit(Bool_t tmp)
virtual Double_t GetBinContent(Int_t bin) const
Int_t GetEntriesFast() const
const char * Data() const
void Form(const char *fmt,...)
RVec< PromoteType< T > > round(const RVec< T > &v)
Double_t Abs(Double_t d)
Double_t Max(Double_t a, Double_t b)