15 fileName_(ps.getUntrackedParameter<
std::
string>(
"fileName",
std::
string(
"ecalPedDigiDump"))),
16 barrelDigiCollection_(ps.getParameter<
edm::
InputTag>(
"EBdigiCollection")),
17 endcapDigiCollection_(ps.getParameter<
edm::
InputTag>(
"EEdigiCollection")),
18 headerProducer_(ps.getParameter<
edm::
InputTag>(
"headerProducer")) {
54 for (vector<int>::const_iterator intIter =
listFEDs_.begin(); intIter !=
listFEDs_.end(); intIter++) {
55 if (((*intIter) < 601) || (654 < (*intIter))) {
56 cout <<
"[EcalPedHists] FED value: " << (*intIter) <<
" found in listFEDs. "
57 <<
" Valid range is 601-654. Returning." << endl;
65 vector<int> listDefaults = vector<int>();
67 for (
int i = 1;
i < 1701; ++
i) {
68 listDefaults.push_back(
i);
73 listDefaults.push_back(0);
74 listDefaults.push_back(1);
75 listDefaults.push_back(2);
79 vector<int>::iterator intIter;
94 if (((*intIter) < 1) || (10 < (*intIter))) {
95 cout <<
"[EcalPedHists] sample number: " << (*intIter) <<
" found in listSamples. "
96 <<
" Valid range is 1-10. Returning." << endl;
125 TDirectory* FEDdir = gDirectory->mkdir(
dir.c_str());
136 TH1F*
hist =
nullptr;
138 string name1 =
"Cry";
139 name1.append(chnl +
"Gain1");
140 string name2 =
"Cry";
141 name2.append(chnl +
"Gain6");
142 string name3 =
"Cry";
143 name3.append(chnl +
"Gain12");
144 hist = mapHistos[name1];
146 if (
hist !=
nullptr) {
147 string cryDirName =
"Cry_" + chnl;
148 TDirectory* cryDir = FEDdir->mkdir(cryDirName.c_str());
150 hist->SetDirectory(cryDir);
153 hist->SetDirectory(cryDir);
155 hist = mapHistos[name3];
156 hist->SetDirectory(cryDir);
161 cerr <<
"EcalPedHists: Error: This shouldn't happen!" << endl;
189 int FEDid = 600 + headerItr->id();
203 bool barrelDigisFound =
true;
204 bool endcapDigisFound =
true;
213 barrelDigisFound =
false;
223 endcapDigisFound =
false;
226 if (barrelDigisFound)
228 if (endcapDigisFound)
230 if (!barrelDigisFound && !endcapDigisFound)
231 edm::LogError(
"EcalPedOffset") <<
"No digis found in the event!";
242 std::map<string, TH1F*> histMap;
249 string title1 =
"Gain1 ADC Counts for channel ";
251 string name1 =
"Cry";
252 name1.append(chnl +
"Gain1");
253 string title2 =
"Gain6 ADC Counts for channel ";
255 string name2 =
"Cry";
256 name2.append(chnl +
"Gain6");
257 string title3 =
"Gain12 ADC Counts for channel ";
259 string name3 =
"Cry";
260 name3.append(chnl +
"Gain12");
261 histMap.insert(make_pair(name1,
new TH1F(name1.c_str(), title1.c_str(), 75, 175.0, 250.0)));
262 histMap[name1]->SetDirectory(
nullptr);
263 histMap.insert(make_pair(
name2,
new TH1F(
name2.c_str(), title2.c_str(), 75, 175.0, 250.0)));
264 histMap[
name2]->SetDirectory(
nullptr);
265 histMap.insert(make_pair(name3,
new TH1F(name3.c_str(), title3.c_str(), 75, 175.0, 250.0)));
266 histMap[name3]->SetDirectory(
nullptr);
281 int FEDid = 600 + elecId.
dccId();
282 int crystalId = detId.
ic();
293 vector<int>::iterator icIter;
304 string name1 =
"Cry";
305 name1.append(chnl +
"Gain1");
306 string name2 =
"Cry";
307 name2.append(chnl +
"Gain6");
308 string name3 =
"Cry";
309 name3.append(chnl +
"Gain12");
310 TH1F*
hist =
nullptr;
312 hist = mapHistos[name1];
316 hist = mapHistos[name3];
320 cerr <<
"EcalPedHistDumper: Error: This shouldn't happen!" << endl;
335 int FEDid = 600 + elecId.
dccId();
336 int crystalId = 10000 * FEDid + 100 * elecId.towerId() + 5 * (elecId.stripId() - 1) + elecId.xtalId();
344 vector<int>::iterator icIter;
355 string name1 =
"Cry";
356 name1.append(chnl +
"Gain1");
357 string name2 =
"Cry";
358 name2.append(chnl +
"Gain6");
359 string name3 =
"Cry";
360 name3.append(chnl +
"Gain12");
361 TH1F*
hist =
nullptr;
363 hist = mapHistos[name1];
367 hist = mapHistos[name3];
371 cerr <<
"EcalPedHistDumper: Error: This shouldn't happen!" << endl;
382 ostringstream myStream;
383 myStream <<
num << flush;
384 return (myStream.str());