25 constexpr
float infinity=std::numeric_limits<float>::infinity();
30 std::map<unsigned int, unsigned int> occ;
33 if (!history)
continue;
34 for (
unsigned int k = 0;
k < history->
nData();
k++)
41 runMin = occ.begin()->first;
42 runMax = occ.rbegin()->first;
46 h->GetXaxis()->SetTitle(
"Run number");
47 h->GetYaxis()->SetTitle(
"Occupancy");
48 for (std::map<unsigned int, unsigned int>::const_iterator
run = occ.begin();
53 h->SetBinContent(
bin,
run->second);
54 h->GetXaxis()->SetBinLabel(
bin, Form(
"%d",
run->first));
62 std::map<std::pair<unsigned int, unsigned int>,
unsigned int> occ;
65 if (!history)
continue;
66 for (
unsigned int k = 0;
k < history->
nData();
k++)
70 TH1I*
h =
new TH1I(
"occ",
"Event occupancies", occ.size(), 0, occ.size());
71 h->GetXaxis()->SetTitle(
"Recorded Event");
72 h->GetYaxis()->SetTitle(
"Occupancy");
75 for (std::map<std::pair<unsigned int, unsigned int>,
unsigned int>::const_iterator
event = occ.begin();
78 if (occForDump > 0 && occForDump <= event->
second)
79 cout <<
"run = " <<
event->first.first <<
" event = " <<
event->first.second <<
" occ = " <<
event->second << endl;
88 std::map<unsigned int, unsigned int> occ;
91 if (!history)
continue;
92 for (
unsigned int k = 0;
k < history->
nData();
k++)
96 unsigned int oMin = 999999999, oMax = 0;
98 for (std::map<unsigned int, unsigned int>::const_iterator
event = occ.begin();
101 if (
event->second < oMin) oMin =
event->second;
102 if (
event->second > oMax) oMax =
event->second;
105 TH1I*
h =
new TH1I(
"occ",
"Event occupancies", oMax - oMin + 1, oMin - 0.5, oMax + 0.5);
106 h->GetXaxis()->SetTitle(
"Occupancy");
107 h->GetYaxis()->SetTitle(
"Number of events");
108 for (std::map<unsigned int, unsigned int>::const_iterator
event = occ.begin();
118 std::vector<unsigned int> occ(
nChannels());
122 occ[
i] = occ[
i] + history->
nData();
126 unsigned int oMin = 999999999, oMax = 0;
128 for (std::vector<unsigned int>::const_iterator
cell = occ.begin();
136 std::map<std::pair<unsigned int, unsigned int>, std::string>
names;
137 TH1I*
h =
new TH1I(
"occ",
"Cell occupancies", oMax - oMin + 1, oMin - 0.5, oMax + 0.5);
138 h->GetXaxis()->SetTitle(
"Occupancy");
139 h->GetYaxis()->SetTitle(
"Number of cells");
142 for (std::vector<unsigned int>::const_iterator cellOcc = occ.begin();
143 cellOcc != occ.end(); ++cellOcc, ++
i) {
146 if (!history)
continue;
147 if (minForPrintout >= 0) {
150 names[ std::pair<unsigned int, unsigned int>(*cellOcc,
i) ] = heading.Data();
154 if (minForPrintout >= 0) {
161 for (std::map<std::pair<unsigned int, unsigned int>, std::string>::reverse_iterator
cell =
names.rbegin();
164 if (
cell->first.first < (
unsigned int)minForPrintout)
break;
165 cout <<
cell->first.first <<
" : " <<
cell->first.second <<
", " <<
cell->second << endl;
175 std::map<unsigned int, unsigned int> occ;
180 if (!history)
continue;
181 for (
unsigned int k = 0;
k < history->
nData();
k++)
185 unsigned int oMin = 999999999, oMax = 0;
187 for (std::map<unsigned int, unsigned int>::const_iterator feb = occ.begin();
188 feb != occ.end(); ++feb)
190 if (feb->second < oMin) oMin = feb->second;
191 if (feb->second > oMax) oMax = feb->second;
194 TH1I*
h =
new TH1I(
"occ",
"FEB occupancies", oMax - oMin + 1, oMin - 0.5, oMax + 0.5);
195 h->GetXaxis()->SetTitle(
"Occupancy");
196 h->GetYaxis()->SetTitle(
"Number of FEBs");
197 for (std::map<unsigned int, unsigned int>::const_iterator feb = occ.begin();
198 feb != occ.end(); ++feb)
199 h->Fill(feb->second);
210 if (!history)
continue;
224 Form(
"Occupancies for partition %s, layer %d",
Id::str(calo).
Data(),
layer),
233 if (!history)
continue;
236 cout <<
" : " << history->
nData() <<
" pulse" << endl;
239 for (
unsigned int i = 0;
i < history->
nData();
i++)
240 cout <<
"E = " << history->
data(
i)->
energy() <<
" MeV, " << endl;
248 const unsigned int nPhiRings = 5516;
249 unsigned int nCells[4][3], nRings[4][3];
250 unsigned int ringOccupancy[nPhiRings][4][3];
252 for (
unsigned int i = 0;
i < 4;
i++)
253 for (
unsigned int j = 0; j < 3; j++) {
254 for (
unsigned int k = 0;
k < nPhiRings;
k++) ringOccupancy[
k][
i][j] = 0;
260 if (
i%10000 == 0) cout <<
"Processing hash = " <<
i << endl;
262 if (!history)
continue;
264 unsigned int n[3] = {0,0,0};
266 for (
unsigned int k = 0;
k < history->
nData();
k++) {
268 if (globalPhiRing<0)
continue;
275 for (
unsigned int i = 0;
i < 4;
i++)
276 for (
unsigned int j = 0; j < 3; j++) {
277 for (
unsigned int k = 0;
k < nPhiRings;
k++)
278 if (ringOccupancy[
k][
i][j] >= nMin) nRings[
i][j]++;
281 for (
unsigned int i = 0;
i < 4;
i++) {
282 cout <<
"layer " <<
i << endl;
285 for (
unsigned int j = 0; j < 3; j++) {
286 float nCellFract= infinity;
287 if (nChann>0) nCellFract =
nCells[
i][j]*100.0/nChann;
288 float nRingFract = infinity;
289 if (
nEta > 0) nRingFract = nRings[
i][j]*100.0/
nEta;
290 cout <<
" gain " << j <<
" : "
291 <<
nCells[
i][j] <<
" cells of " << nChann <<
" (" << nCellFract <<
" %), "
292 << nRings[
i][j] <<
" rings of " <<
nEta <<
" (" << nRingFract <<
" %)." << endl;
295 for (
unsigned int i = 0;
i < 4;
i++) {
298 cout <<
i <<
" & " << nChann <<
" & " <<
nEta <<
" & ";
299 for (
unsigned int j = 0; j < 3; j++){
300 float val = infinity;
301 if (nChann>0)
val =
nCells[
i][j]*100.0/nChann;
302 cout << Form(
"%4.1f\\%% & ",
val);
304 for (
unsigned int j = 0; j < 3; j++){
305 float val = infinity;
307 cout << Form(
"%4.1f\\%% & ",
val);