42 double averageChannelHits = nhits->GetEntries() * nhits->GetMean() / 16 / 512;
43 B2INFO(
"Average number of good hits per channel: " << averageChannelHits);
49 string expNo = to_string(expRun[0].first);
50 while (expNo.length() < 4) expNo.insert(0,
"0");
51 string runNo = to_string(expRun[0].second);
52 while (runNo.length() < 5) runNo.insert(0,
"0");
53 string outputFileName =
"channelMask-e" + expNo +
"-r" + runNo +
".root";
54 m_file = TFile::Open(outputFileName.c_str(),
"recreate");
64 auto meanHits =
new TH1F(
"meanHits",
"Average number of hits per channel; slot number; average", 16, 0.5, 16.5);
65 auto rmsHits =
new TH1F(
"rmsHits",
"r.m.s of number of hits per channel; slot number; r.m.s", 16, 0.5, 16.5);
66 for (
int slot = 1; slot <= 16; slot++) {
67 string name =
"hits_" + to_string(slot);
73 double rms = h->GetMaximum();
74 for (
int iter = 0; iter < 5; iter++) {
78 for (
int chan = 0; chan < h->GetNbinsX(); chan++) {
79 double y = h->GetBinContent(chan + 1);
80 if (y == 0 or fabs(y - mean) > 3 * rms)
continue;
87 rms =
sqrt(sumyy / n - mean * mean);
89 meanHits->SetBinContent(slot, mean);
90 rmsHits->SetBinContent(slot, rms);
91 double deadCut = mean / 5;
92 double hotCut = std::max(mean * 2, mean + 6 * rms);
94 for (
int chan = 0; chan < h->GetNbinsX(); chan++) {
95 double y = h->GetBinContent(chan + 1);
98 }
else if (y > hotCut) {
106 for (
int slot = 1; slot <= 16; slot++) {
107 string name =
"window_vs_asic_" + to_string(slot);
111 auto h0 = h->ProjectionX();
113 for (
int asic = 0; asic < h->GetNbinsX(); asic++) {
114 double r = 1 - h1->GetBinContent(asic + 1) / h0->GetBinContent(asic + 1);
116 for (
int chan = 0; chan < 8; chan++)
m_channelMask->setNoisy(slot, chan + asic * 8);
125 auto dead =
new TH1F(
"numDead",
"Number of dead channels; slot number; dead channels", 16, 0.5, 16.5);
126 auto hot =
new TH1F(
"numHot",
"Number of noisy channels; slot number; noisy channels", 16, 0.5, 16.5);
127 auto active =
new TH1F(
"activeFract",
"Fraction of active channels; slot number; active fraction", 16, 0.5, 16.5);
128 for (
int slot = 1; slot <= 16; slot++) {
129 dead->SetBinContent(slot,
m_channelMask->getNumOfDeadChannels(slot));
130 hot->SetBinContent(slot,
m_channelMask->getNumOfNoisyChannels(slot));
131 active->SetBinContent(slot,
m_channelMask->getActiveFraction(slot));
std::shared_ptr< T > getObjectPtr(const std::string &name, const std::vector< Calibration::ExpRun > &requestedRuns)
Get calibration data object by name and list of runs, the Merge function will be called to generate t...