18 getAllProvenances(
false),
19 printProvenanceInfo(
false),
20 theCSCStripPedestalSum(0),
21 theCSCStripPedestalCount(0),
23 std::string MsgLoggerCat =
"GlobalDigisProducer_GlobalDigisProducer";
72 produces<PGlobalDigi>(
label);
76 edm::LogInfo(MsgLoggerCat) <<
"\n===============================\n"
77 <<
"Initialized as EDProducer with parameter values:\n"
78 <<
" Name = " <<
fName <<
"\n"
81 <<
" Label = " <<
label <<
"\n"
96 <<
"===============================\n";
112 std::string MsgLoggerCat =
"GlobalDigisProducer_beginJob";
126 delete defaultRatios;
146 std::string MsgLoggerCat =
"GlobalDigisProducer_endJob";
148 edm::LogInfo(MsgLoggerCat) <<
"Terminating having processed " <<
count <<
" events.";
153 std::string MsgLoggerCat =
"GlobalDigisProducer_produce";
175 edm::LogInfo(MsgLoggerCat) <<
"Processing run " << nrun <<
", event " <<
nevt <<
" (" <<
count <<
" events total)";
188 std::vector<const edm::StableProvenance *> AllProv;
189 iEvent.getAllStableProvenance(AllProv);
192 edm::LogInfo(MsgLoggerCat) <<
"Number of Provenances = " << AllProv.size();
195 TString eventout(
"\nProvenance info:\n");
197 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
198 eventout +=
"\n ******************************";
199 eventout +=
"\n Module : ";
201 eventout += AllProv[
i]->moduleLabel();
202 eventout +=
"\n ProductID : ";
204 eventout += AllProv[
i]->productID().id();
205 eventout +=
"\n ClassName : ";
207 eventout += AllProv[
i]->className();
208 eventout +=
"\n InstanceName : ";
210 eventout += AllProv[
i]->productInstanceName();
211 eventout +=
"\n BranchName : ";
213 eventout += AllProv[
i]->branchName();
215 eventout +=
"\n ******************************\n";
233 edm::LogInfo(MsgLoggerCat) <<
"Done gathering data from event.";
236 std::unique_ptr<PGlobalDigi> pOut(
new PGlobalDigi);
258 std::string MsgLoggerCat =
"GlobalDigisProducer_fillECal";
262 eventout =
"\nGathering info:";
281 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalDigiEB in event!";
284 if (EcalDigiEB->
empty())
290 if (!crossingFrame.
isValid()) {
291 edm::LogWarning(MsgLoggerCat) <<
"Unable to find cal barrel crossingFrame in event!";
304 uint32_t crystid = ebid.
rawId();
305 ebSimMap[crystid] += hitItr->energy();
311 std::vector<double> ebAnalogSignal;
312 std::vector<double> ebADCCounts;
313 std::vector<double> ebADCGains;
319 for (
unsigned int digis = 0; digis < EcalDigiEB->
size(); ++digis) {
328 int nrSamples = ebdf.
size();
335 double pedestalPreSample = 0.;
336 double pedestalPreSampleAnalog = 0.;
340 ebAnalogSignal[
sample] = 0.;
350 ebADCCounts[
sample] = (thisSample.
adc());
353 if (Emax < ebAnalogSignal[
sample]) {
354 Emax = ebAnalogSignal[
sample];
358 pedestalPreSample += ebADCCounts[
sample];
362 pedestalPreSample /= 3.;
363 pedestalPreSampleAnalog /= 3.;
375 eventout +=
"\n Number of EBDigis collected:.............. ";
383 bool isEndCap =
true;
387 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalDigiEE in event!";
390 if (EcalDigiEE->
empty())
396 if (!crossingFrame.
isValid()) {
397 edm::LogWarning(MsgLoggerCat) <<
"Unable to find cal endcap crossingFrame in event!";
410 uint32_t crystid = eeid.
rawId();
411 eeSimMap[crystid] += hitItr->energy();
417 std::vector<double> eeAnalogSignal;
418 std::vector<double> eeADCCounts;
419 std::vector<double> eeADCGains;
429 for (
unsigned int digis = 0; digis < EcalDigiEE->
size(); ++digis) {
433 int nrSamples = eedf.
size();
440 double pedestalPreSample = 0.;
441 double pedestalPreSampleAnalog = 0.;
445 eeAnalogSignal[
sample] = 0.;
456 eeADCCounts[
sample] = (thisSample.
adc());
459 if (Emax < eeAnalogSignal[
sample]) {
460 Emax = eeAnalogSignal[
sample];
464 pedestalPreSample += eeADCCounts[
sample];
468 pedestalPreSample /= 3.;
469 pedestalPreSampleAnalog /= 3.;
481 eventout +=
"\n Number of EEDigis collected:.............. ";
489 bool isPreshower =
true;
493 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalDigiES in event!";
496 if (EcalDigiES->
empty())
502 if (!crossingFrame.
isValid()) {
503 edm::LogWarning(MsgLoggerCat) <<
"Unable to find cal preshower crossingFrame in event!";
516 uint32_t crystid = esid.
rawId();
517 esSimMap[crystid] += hitItr->energy();
523 std::vector<double> esADCCounts;
527 for (
unsigned int digis = 0; digis < EcalDigiES->
size(); ++digis) {
536 int nrSamples = esdf.
size();
550 esADCCounts[
sample] = (thisSample.
adc());
560 eventout +=
"\n Number of ESDigis collected:.............. ";
572 std::string MsgLoggerCat =
"GlobalDigisProducer_storeECal";
575 TString eventout(
"\n nEBDigis = ");
578 eventout +=
"\n (maxPos, AEE, SHE) = (";
586 eventout +=
"\n nEEDigis = ";
589 eventout +=
"\n (maxPos, AEE, SHE) = (";
597 eventout +=
"\n nESDigis = ";
600 eventout +=
"\n (ADC0, ADC1, ADC2, SHE) = (";
621 std::string MsgLoggerCat =
"GlobalDigisProducer_fillHCal";
625 eventout =
"\nGathering info:";
630 if (!HCalconditions.
isValid()) {
631 edm::LogWarning(MsgLoggerCat) <<
"Unable to find HCalconditions in event!";
652 for (std::vector<PCaloHit>::const_iterator
simhits = simhitResult->begin();
simhits != simhitResult->end();
655 uint32_t cellid = detId.
rawId();
658 fHBEnergySimHits[cellid] +=
simhits->energy();
661 fHEEnergySimHits[cellid] +=
simhits->energy();
664 fHOEnergySimHits[cellid] +=
simhits->energy();
667 fHFEnergySimHits[cellid] +=
simhits->energy();
676 if (!
hbhe.isValid()) {
677 edm::LogWarning(MsgLoggerCat) <<
"Unable to find HBHEDataFrame in event!";
684 for (ihbhe =
hbhe->begin(); ihbhe !=
hbhe->end(); ++ihbhe) {
694 coder.
adc2fC(*ihbhe, tool);
699 float fDigiSum = 0.0;
702 int capid = (*ihbhe)[
ii].capid();
707 HBCalSHE.push_back(fHBEnergySimHits[cell.rawId()]);
713 float fDigiSum = 0.0;
715 int capid = (*ihbhe)[
ii].capid();
720 HECalSHE.push_back(fHEEnergySimHits[cell.rawId()]);
726 eventout +=
"\n Number of HBDigis collected:.............. ";
731 eventout +=
"\n Number of HEDigis collected:.............. ";
741 edm::LogWarning(MsgLoggerCat) <<
"Unable to find HODataFrame in event!";
747 for (iho =
ho->begin(); iho !=
ho->end(); ++iho) {
760 float fDigiSum = 0.0;
763 int capid = (*iho)[
ii].capid();
768 HOCalSHE.push_back(fHOEnergySimHits[cell.rawId()]);
773 eventout +=
"\n Number of HODigis collected:.............. ";
783 edm::LogWarning(MsgLoggerCat) <<
"Unable to find HFDataFrame in event!";
802 float fDigiSum = 0.0;
805 int capid = (*ihf)[
ii].capid();
810 HFCalSHE.push_back(fHFEnergySimHits[cell.rawId()]);
815 eventout +=
"\n Number of HFDigis collected:.............. ";
826 std::string MsgLoggerCat =
"GlobalDigisProducer_storeHCal";
829 TString eventout(
"\n nHBDigis = ");
831 for (
unsigned int i = 0;
i <
HBCalAEE.size(); ++
i) {
832 eventout +=
"\n (AEE, SHE) = (";
838 eventout +=
"\n nHEDigis = ";
840 for (
unsigned int i = 0;
i <
HECalAEE.size(); ++
i) {
841 eventout +=
"\n (AEE, SHE) = (";
847 eventout +=
"\n nHODigis = ";
849 for (
unsigned int i = 0;
i <
HOCalAEE.size(); ++
i) {
850 eventout +=
"\n (AEE, SHE) = (";
856 eventout +=
"\n nHFDigis = ";
858 for (
unsigned int i = 0;
i <
HFCalAEE.size(); ++
i) {
859 eventout +=
"\n (AEE, SHE) = (";
883 std::string MsgLoggerCat =
"GlobalDigisProducer_fillTrk";
887 eventout =
"\nGathering info:";
893 edm::LogWarning(MsgLoggerCat) <<
"Unable to find stripDigis in event!";
897 int nStripBrl = 0, nStripFwd = 0;
899 for (DSViter = stripDigis->begin(); DSViter != stripDigis->end(); ++DSViter) {
900 unsigned int id = DSViter->id;
908 for (iter =
begin; iter !=
end; ++iter) {
931 for (iter =
begin; iter !=
end; ++iter) {
954 for (iter =
begin; iter !=
end; ++iter) {
973 for (iter =
begin; iter !=
end; ++iter) {
1012 eventout +=
"\n Number of BrlStripDigis collected:........ ";
1013 eventout += nStripBrl;
1017 eventout +=
"\n Number of FrwdStripDigis collected:....... ";
1018 eventout += nStripFwd;
1025 edm::LogWarning(MsgLoggerCat) <<
"Unable to find pixelDigis in event!";
1029 int nPxlBrl = 0, nPxlFwd = 0;
1031 for (DPViter = pixelDigis->begin(); DPViter != pixelDigis->end(); ++DPViter) {
1032 unsigned int id = DPViter->id;
1040 for (iter =
begin; iter !=
end; ++iter) {
1043 BRL1ADC.push_back((*iter).adc());
1044 BRL1Row.push_back((*iter).row());
1045 BRL1Col.push_back((*iter).column());
1048 BRL2ADC.push_back((*iter).adc());
1049 BRL2Row.push_back((*iter).row());
1050 BRL2Col.push_back((*iter).column());
1053 BRL3ADC.push_back((*iter).adc());
1054 BRL3Row.push_back((*iter).row());
1055 BRL3Col.push_back((*iter).column());
1062 for (iter =
begin; iter !=
end; ++iter) {
1064 if (tTopo->
pxfDisk(
id) == 1) {
1065 if (tTopo->
pxfSide(
id) == 1) {
1068 FWD1nCol.push_back((*iter).column());
1070 if (tTopo->
pxfSide(
id) == 2) {
1073 FWD1pCol.push_back((*iter).column());
1076 if (tTopo->
pxfDisk(
id) == 2) {
1077 if (tTopo->
pxfSide(
id) == 1) {
1080 FWD2nCol.push_back((*iter).column());
1082 if (tTopo->
pxfSide(
id) == 2) {
1085 FWD2pCol.push_back((*iter).column());
1093 eventout +=
"\n Number of BrlPixelDigis collected:........ ";
1094 eventout += nPxlBrl;
1098 eventout +=
"\n Number of FrwdPixelDigis collected:....... ";
1099 eventout += nPxlFwd;
1109 std::string MsgLoggerCat =
"GlobalDigisProducer_storeTrk";
1113 TString eventout(
"\n nTIBL1 = ");
1115 for (
unsigned int i = 0;
i <
TIBL1ADC.size(); ++
i) {
1116 eventout +=
"\n (ADC, strip) = (";
1122 eventout +=
"\n nTIBL2 = ";
1124 for (
unsigned int i = 0;
i <
TIBL2ADC.size(); ++
i) {
1125 eventout +=
"\n (ADC, strip) = (";
1131 eventout +=
"\n nTIBL3 = ";
1133 for (
unsigned int i = 0;
i <
TIBL3ADC.size(); ++
i) {
1134 eventout +=
"\n (ADC, strip) = (";
1140 eventout +=
"\n nTIBL4 = ";
1142 for (
unsigned int i = 0;
i <
TIBL4ADC.size(); ++
i) {
1143 eventout +=
"\n (ADC, strip) = (";
1149 eventout +=
"\n nTOBL1 = ";
1151 for (
unsigned int i = 0;
i <
TOBL1ADC.size(); ++
i) {
1152 eventout +=
"\n (ADC, strip) = (";
1158 eventout +=
"\n nTOBL2 = ";
1160 for (
unsigned int i = 0;
i <
TOBL2ADC.size(); ++
i) {
1161 eventout +=
"\n (ADC, strip) = (";
1167 eventout +=
"\n nTOBL3 = ";
1169 for (
unsigned int i = 0;
i <
TOBL3ADC.size(); ++
i) {
1170 eventout +=
"\n (ADC, strip) = (";
1176 eventout +=
"\n nTOBL4 = ";
1178 for (
unsigned int i = 0;
i <
TOBL4ADC.size(); ++
i) {
1179 eventout +=
"\n (ADC, strip) = (";
1185 eventout +=
"\n nTIDW1 = ";
1187 for (
unsigned int i = 0;
i <
TIDW1ADC.size(); ++
i) {
1188 eventout +=
"\n (ADC, strip) = (";
1194 eventout +=
"\n nTIDW2 = ";
1196 for (
unsigned int i = 0;
i <
TIDW2ADC.size(); ++
i) {
1197 eventout +=
"\n (ADC, strip) = (";
1203 eventout +=
"\n nTIDW3 = ";
1205 for (
unsigned int i = 0;
i <
TIDW3ADC.size(); ++
i) {
1206 eventout +=
"\n (ADC, strip) = (";
1212 eventout +=
"\n nTECW1 = ";
1214 for (
unsigned int i = 0;
i <
TECW1ADC.size(); ++
i) {
1215 eventout +=
"\n (ADC, strip) = (";
1221 eventout +=
"\n nTECW2 = ";
1223 for (
unsigned int i = 0;
i <
TECW2ADC.size(); ++
i) {
1224 eventout +=
"\n (ADC, strip) = (";
1230 eventout +=
"\n nTECW3 = ";
1232 for (
unsigned int i = 0;
i <
TECW3ADC.size(); ++
i) {
1233 eventout +=
"\n (ADC, strip) = (";
1239 eventout +=
"\n nTECW4 = ";
1241 for (
unsigned int i = 0;
i <
TECW4ADC.size(); ++
i) {
1242 eventout +=
"\n (ADC, strip) = (";
1248 eventout +=
"\n nTECW5 = ";
1250 for (
unsigned int i = 0;
i <
TECW5ADC.size(); ++
i) {
1251 eventout +=
"\n (ADC, strip) = (";
1257 eventout +=
"\n nTECW6 = ";
1259 for (
unsigned int i = 0;
i <
TECW6ADC.size(); ++
i) {
1260 eventout +=
"\n (ADC, strip) = (";
1266 eventout +=
"\n nTECW7 = ";
1268 for (
unsigned int i = 0;
i <
TECW7ADC.size(); ++
i) {
1269 eventout +=
"\n (ADC, strip) = (";
1275 eventout +=
"\n nTECW8 = ";
1277 for (
unsigned int i = 0;
i <
TECW8ADC.size(); ++
i) {
1278 eventout +=
"\n (ADC, strip) = (";
1286 eventout +=
"\n nBRL1 = ";
1288 for (
unsigned int i = 0;
i <
BRL1ADC.size(); ++
i) {
1289 eventout +=
"\n (ADC, row, column) = (";
1297 eventout +=
"\n nBRL2 = ";
1299 for (
unsigned int i = 0;
i <
BRL2ADC.size(); ++
i) {
1300 eventout +=
"\n (ADC, row, column) = (";
1308 eventout +=
"\n nBRL3 = ";
1310 for (
unsigned int i = 0;
i <
BRL3ADC.size(); ++
i) {
1311 eventout +=
"\n (ADC, row, column) = (";
1319 eventout +=
"\n nFWD1p = ";
1321 for (
unsigned int i = 0;
i <
FWD1pADC.size(); ++
i) {
1322 eventout +=
"\n (ADC, row, column) = (";
1330 eventout +=
"\n nFWD1p = ";
1332 for (
unsigned int i = 0;
i <
FWD1nADC.size(); ++
i) {
1333 eventout +=
"\n (ADC, row, column) = (";
1341 eventout +=
"\n nFWD1p = ";
1343 for (
unsigned int i = 0;
i <
FWD2pADC.size(); ++
i) {
1344 eventout +=
"\n (ADC, row, column) = (";
1352 eventout +=
"\n nFWD2p = ";
1354 for (
unsigned int i = 0;
i <
FWD2nADC.size(); ++
i) {
1355 eventout +=
"\n (ADC, row, column) = (";
1401 std::string MsgLoggerCat =
"GlobalDigisProducer_fillMuon";
1405 eventout =
"\nGathering info:";
1417 for (detUnitIt = dtDigis->begin(); detUnitIt != dtDigis->end(); ++detUnitIt) {
1418 const DTLayerId &
id = (*detUnitIt).first;
1424 DTWireId wireId(
id, (*digiIt).wire());
1425 if (wireId.station() == 1) {
1427 MB1Time.push_back((*digiIt).time());
1430 if (wireId.station() == 2) {
1432 MB2Time.push_back((*digiIt).time());
1435 if (wireId.station() == 3) {
1437 MB3Time.push_back((*digiIt).time());
1440 if (wireId.station() == 4) {
1442 MB4Time.push_back((*digiIt).time());
1449 eventout +=
"\n Number of DtMuonDigis collected:.......... ";
1457 edm::LogWarning(MsgLoggerCat) <<
"Unable to find muon strips in event!";
1463 std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
1464 std::vector<CSCStripDigi>::const_iterator
last = (*j).second.second;
1466 for (; digiItr !=
last; ++digiItr) {
1470 std::vector<int> adcCounts = digiItr->getADCCounts();
1478 if (adcCounts[5] > (
pedestal + 100))
1485 eventout +=
"\n Number of CSCStripDigis collected:........ ";
1492 if (!
wires.isValid()) {
1493 edm::LogWarning(MsgLoggerCat) <<
"Unable to find muon wires in event!";
1499 std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first;
1500 std::vector<CSCWireDigi>::const_iterator endDigi = (*j).second.second;
1502 for (; digiItr != endDigi; ++digiItr) {
1510 eventout +=
"\n Number of CSCWireDigis collected:......... ";
1521 std::string MsgLoggerCat =
"GlobalDigisProducer_storeMuon";
1525 TString eventout(
"\n nMB1 = ");
1528 eventout +=
"\n (slayer, time, layer) = (";
1536 eventout +=
"\n nMB2 = ";
1539 eventout +=
"\n (slayer, time, layer) = (";
1547 eventout +=
"\n nMB3 = ";
1550 eventout +=
"\n (slayer, time, layer) = (";
1558 eventout +=
"\n nMB2 = ";
1561 eventout +=
"\n (slayer, time, layer) = (";
1571 eventout +=
"\n nCSCStrip = ";
1574 eventout +=
"\n (adc) = (";
1580 eventout +=
"\n nCSCWire = ";
1583 eventout +=
"\n (time) = (";
1604 std::string MsgLoggerCat =
"GlobalDigisProducer_clear";
1607 edm::LogInfo(MsgLoggerCat) <<
"Clearing event holders";