26 std::map<unsigned int, unsigned int> occ;
29 if (!history)
continue;
30 for (
unsigned int k = 0;
k < history->
nData();
k++)
37 runMin = occ.begin()->first;
38 runMax = occ.rbegin()->first;
42 h->GetXaxis()->SetTitle(
"Run number");
43 h->GetYaxis()->SetTitle(
"Occupancy");
44 for (std::map<unsigned int, unsigned int>::const_iterator
run = occ.begin();
49 h->SetBinContent(
bin,
run->second);
50 h->GetXaxis()->SetBinLabel(
bin, Form(
"%d",
run->first));
58 std::map<std::pair<unsigned int, unsigned int>,
unsigned int> occ;
61 if (!history)
continue;
62 for (
unsigned int k = 0;
k < history->
nData();
k++)
66 TH1I*
h =
new TH1I(
"occ",
"Event occupancies", occ.size(), 0, occ.size());
67 h->GetXaxis()->SetTitle(
"Recorded Event");
68 h->GetYaxis()->SetTitle(
"Occupancy");
71 for (std::map<std::pair<unsigned int, unsigned int>,
unsigned int>::const_iterator
event = occ.begin();
74 if (occForDump > 0 && occForDump <= event->
second)
75 cout <<
"run = " <<
event->first.first <<
" event = " <<
event->first.second <<
" occ = " <<
event->second << endl;
84 std::map<unsigned int, unsigned int> occ;
87 if (!history)
continue;
88 for (
unsigned int k = 0;
k < history->
nData();
k++)
92 unsigned int oMin = 999999999, oMax = 0;
94 for (std::map<unsigned int, unsigned int>::const_iterator
event = occ.begin();
97 if (
event->second < oMin) oMin =
event->second;
98 if (
event->second > oMax) oMax =
event->second;
101 TH1I*
h =
new TH1I(
"occ",
"Event occupancies", oMax - oMin + 1, oMin - 0.5, oMax + 0.5);
102 h->GetXaxis()->SetTitle(
"Occupancy");
103 h->GetYaxis()->SetTitle(
"Number of events");
104 for (std::map<unsigned int, unsigned int>::const_iterator
event = occ.begin();
114 std::vector<unsigned int> occ(
nChannels());
118 occ[
i] = occ[
i] + history->
nData();
122 unsigned int oMin = 999999999, oMax = 0;
124 for (std::vector<unsigned int>::const_iterator
cell = occ.begin();
132 std::map<std::pair<unsigned int, unsigned int>, std::string>
names;
133 TH1I*
h =
new TH1I(
"occ",
"Cell occupancies", oMax - oMin + 1, oMin - 0.5, oMax + 0.5);
134 h->GetXaxis()->SetTitle(
"Occupancy");
135 h->GetYaxis()->SetTitle(
"Number of cells");
138 for (std::vector<unsigned int>::const_iterator cellOcc = occ.begin();
139 cellOcc != occ.end(); ++cellOcc, ++
i) {
142 if (!history)
continue;
143 if (minForPrintout >= 0) {
146 names[ std::pair<unsigned int, unsigned int>(*cellOcc,
i) ] = heading.Data();
150 if (minForPrintout >= 0) {
157 for (std::map<std::pair<unsigned int, unsigned int>, std::string>::reverse_iterator
cell =
names.rbegin();
160 if (
cell->first.first < (
unsigned int)minForPrintout)
break;
161 cout <<
cell->first.first <<
" : " <<
cell->first.second <<
", " <<
cell->second << endl;
171 std::map<unsigned int, unsigned int> occ;
176 if (!history)
continue;
177 for (
unsigned int k = 0;
k < history->
nData();
k++)
181 unsigned int oMin = 999999999, oMax = 0;
183 for (std::map<unsigned int, unsigned int>::const_iterator feb = occ.begin();
184 feb != occ.end(); ++feb)
186 if (feb->second < oMin) oMin = feb->second;
187 if (feb->second > oMax) oMax = feb->second;
190 TH1I*
h =
new TH1I(
"occ",
"FEB occupancies", oMax - oMin + 1, oMin - 0.5, oMax + 0.5);
191 h->GetXaxis()->SetTitle(
"Occupancy");
192 h->GetYaxis()->SetTitle(
"Number of FEBs");
193 for (std::map<unsigned int, unsigned int>::const_iterator feb = occ.begin();
194 feb != occ.end(); ++feb)
195 h->Fill(feb->second);
206 if (!history)
continue;
220 Form(
"Occupancies for partition %s, layer %d",
Id::str(calo).
Data(),
layer),
229 if (!history)
continue;
232 cout <<
" : " << history->
nData() <<
" pulse" << endl;
235 for (
unsigned int i = 0;
i < history->
nData();
i++)
236 cout <<
"E = " << history->
data(
i)->
energy() <<
" MeV, " << endl;
244 const unsigned int nPhiRings = 5516;
245 unsigned int nCells[4][3], nRings[4][3];
246 unsigned int ringOccupancy[nPhiRings][4][3];
248 for (
unsigned int i = 0;
i < 4;
i++)
249 for (
unsigned int j = 0; j < 3; j++) {
250 for (
unsigned int k = 0;
k < nPhiRings;
k++) ringOccupancy[
k][
i][j] = 0;
256 if (
i%10000 == 0) cout <<
"Processing hash = " <<
i << endl;
258 if (!history)
continue;
260 unsigned int n[3] = {0,0,0};
262 for (
unsigned int k = 0;
k < history->
nData();
k++) {
269 for (
unsigned int i = 0;
i < 4;
i++)
270 for (
unsigned int j = 0; j < 3; j++) {
271 for (
unsigned int k = 0;
k < nPhiRings;
k++)
272 if (ringOccupancy[
k][
i][j] >= nMin) nRings[
i][j]++;
275 for (
unsigned int i = 0;
i < 4;
i++) {
276 cout <<
"layer " <<
i << endl;
277 for (
unsigned int j = 0; j < 3; j++) {
278 cout <<
" gain " << j <<
" : "
280 << nRings[
i][j] <<
" rings of " <<
Geo::nEta(calo,
i) <<
" (" << nRings[
i][j]*100.0/
Geo::nEta(calo,
i) <<
" %)." << endl;
283 for (
unsigned int i = 0;
i < 4;
i++) {
285 for (
unsigned int j = 0; j < 3; j++)
287 for (
unsigned int j = 0; j < 3; j++)
288 cout << Form(
"%4.1f\\%% & ", nRings[
i][j]*100.0/
Geo::nEta(calo,
i));