8#include <arich/calibration/ARICHChannelMaskMaker.h>
9#include <arich/dbobjects/ARICHChannelMask.h>
17 " --------------------- ARICHChannelMask Calibration Algorithm -----------------\n"
19 " Produces channel mask for arich hot/dead channels, based on criteria of \n"
20 " minimal and maximal occupancy \n"
21 " ------------------------------------------------------------------------------\n"
28 auto hist = getObjectPtr<TH2F>(
"ch_occupancy");
31 B2INFO(
"Number of Entries in ARICH ch_occupancy histogram was " << hist->GetEntries());
33 const int NumberOfChannelsPerHapd = 144;
34 int numChannels = hist->GetNbinsX();
36 int nevt = hist->GetBinContent(numChannels, 1);
40 double ringChnAvg[7] = {0.};
42 const int hapdInRing[7] = {42, 48, 54, 60, 66, 72, 78};
44 for (
int bin = 1; bin < numChannels; ++bin) {
45 int moduleID = (bin - 1) / NumberOfChannelsPerHapd + 1;
46 double nsig = hist->GetBinContent(bin, 2) + hist->GetBinContent(bin, 3) - hist->GetBinContent(bin, 1) - hist->GetBinContent(bin, 4);
49 if (nsig /
float(nevt) > 0.02)
continue;
50 ringChnAvg[ring] += nsig;
54 for (
int i = 0; i < 7; i++) {
55 ringChnAvg[i] /= float(hapdInRing[i] * NumberOfChannelsPerHapd);
58 B2INFO(
"Average hits in channel in outer HAPD ring is " << ringChnAvg[6] <<
" (which is less that minimally required, " <<
62 for (
int bin = 1; bin < numChannels; ++bin) {
63 int moduleID = (bin - 1) / NumberOfChannelsPerHapd + 1;
64 int channelID = (bin - 1) % NumberOfChannelsPerHapd;
65 double nsig = hist->GetBinContent(bin, 2) + hist->GetBinContent(bin, 3) - hist->GetBinContent(bin, 1) - hist->GetBinContent(bin, 4);
66 double s2n = nsig / (hist->GetBinContent(bin, 2) + hist->GetBinContent(bin, 3));
70 mask->setActiveCh(moduleID, channelID, value);
82 if (modID <= 42)
return 0;
83 if (modID <= 90)
return 1;
84 if (modID <= 144)
return 2;
85 if (modID <= 204)
return 3;
86 if (modID <= 270)
return 4;
87 if (modID <= 342)
return 5;
88 if (modID <= 420)
return 6;
ARICHChannelMaskMaker()
Constructor set the prefix to TestCalibration.
double m_minHitPerChn
Minimal number of hits in the channel in the outter HAPD ring, collect more data if not satisfied.
int getRing(int modID)
get hapd ring number from moduleID
double m_minFrac
Minimal number of signal hits (bit 1+2-0-3) in channel / average number of signal hits in channel in ...
virtual EResult calibrate() override
Run algo on data.
double m_minS2N
Minimal signal/(signal+noise) for channel (for hot channels)
The Class for ARICH HAPD channel mask.
Base class for calibration algorithms.
void saveCalibration(TClonesArray *data, const std::string &name)
Store DBArray payload with given name with default IOV.
void setDescription(const std::string &description)
Set algorithm description (in constructor)
EResult
The result of calibration.
@ c_OK
Finished successfully =0 in Python.
@ c_NotEnoughData
Needs more data =2 in Python.
@ c_Failure
Failed =3 in Python.
Abstract base class for different kinds of events.