32 #if (CMSSW_COMPAT_VERSION>=210)
51 34, 32, 33, 33, 32, 34, 33, 34, 33,
54 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
57 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
60 32, 33, 33, 32, 34, 33, 34, 33, 34
66 # include <sys/time.h>
69 gettimeofday(&start_, 0);
78 std::cout <<
"[PgTiming] " << mess_ <<
" "
79 << ((t.tv_sec-start_.tv_sec)*1.e3
80 + (t.tv_usec-start_.tv_usec)*1.e-3)
88 #else //DO_TIMING is not defined
93 #endif //DO_TIMING defined condition
96 collNotFoundWarn_(ps.getUntrackedParameter<bool>(
"warnIfCollectionNotFound",
true)),
97 ebDigis_(ps.getParameter<edm::
InputTag>(
"EbDigiCollection"),
false,
99 eeDigis_(ps.getParameter<edm::
InputTag>(
"EeDigiCollection"),
false,
101 ebNoZsDigis_(ps.getParameter<edm::
InputTag>(
"EbUnsuppressedDigiCollection"),
103 eeNoZsDigis_(ps.getParameter<edm::
InputTag>(
"EeUnsuppressedDigiCollection"),
105 ebSrFlags_(ps.getParameter<edm::
InputTag>(
"EbSrFlagCollection"),
false,
107 eeSrFlags_(ps.getParameter<edm::
InputTag>(
"EeSrFlagCollection"),
false,
109 ebComputedSrFlags_(ps.getParameter<edm::
InputTag>(
"EbSrFlagFromTTCollection"),
false,
111 eeComputedSrFlags_(ps.getParameter<edm::
InputTag>(
"EeSrFlagFromTTCollection"),
false,
113 ebSimHits_(ps.getParameter<edm::
InputTag>(
"EbSimHitCollection"),
false,
115 eeSimHits_(ps.getParameter<edm::
InputTag>(
"EeSimHitCollection"),
false,
117 tps_(ps.getParameter<edm::
InputTag>(
"TrigPrimCollection"),
false,
119 ebRecHits_(ps.getParameter<edm::
InputTag>(
"EbRecHitCollection"),
false,
121 eeRecHits_(ps.getParameter<edm::
InputTag>(
"EeRecHitCollection"),
false,
123 fedRaw_(ps.getParameter<edm::
InputTag>(
"FEDRawCollection"),
false,
126 tmin(numeric_limits<int64_t>::
max()),
130 localReco_(ps.getParameter<bool>(
"LocalReco")),
131 weights_(ps.getParameter<vector<double> >(
"weights")),
132 tpInGeV_(ps.getParameter<bool>(
"tpInGeV")),
133 firstFIRSample_(ps.getParameter<int>(
"ecalDccZs1stSample")),
134 useEventRate_(ps.getParameter<bool>(
"useEventRate")),
135 logErrForDccs_(nDccs_,
false),
138 histDir_(ps.getParameter<
string>(
"histDir")),
139 withEeSimHit_(
false),
140 withEbSimHit_(
false){
153 tps_.setToken(collector);
158 PgTiming t(
"EcalSelectiveReadoutValidation ctor");
175 double ebZsThr = ps.
getParameter<
double>(
"ebZsThrADCCount");
176 double eeZsThr = ps.
getParameter<
double>(
"eeZsThrADCCount");
198 LogInfo(
"OutputInfo") <<
" Ecal Digi Task histograms will be saved to '"
201 LogInfo(
"OutputInfo") <<
" Ecal Digi Task histograms will NOT be saved";
216 if(
verbose_) dbe_->showDirStructure();
222 vector<string>(1,
"all")));
224 for(vector<string>::iterator it = hists.begin();
225 it!=hists.end(); ++it)
histList_.insert(*it);
241 "ECAL DCC event fragment size;Dcc id; "
245 "LI channel payload per DCC;Dcc id; "
249 "HI channel payload per DCC;Dcc id; "
253 "ECAL DCC event fragment size;Dcc id; "
257 "ECAL Barrel low interest crystal data payload;"
258 "Event size (kB);Nevts",
262 "Endcap low interest crystal data payload;"
263 "Event size (kB);Nevts",
267 "ECAL low interest crystal data payload;"
268 "Event size (kB);Nevts",
272 "Barrel high interest crystal data payload;"
273 "Event size (kB);Nevts",
277 "Endcap high interest crystal data payload;"
278 "Event size (kB);Nevts",
282 "ECAL high interest crystal data payload;"
283 "Event size (kB);Nevts",
287 "Barrel data volume;Event size (kB);Nevts",
291 "Endcap data volume;Event size (kB);Nevts",
295 "ECAL data volume;Event size (kB);Nevts",
299 "ECAL crystal channel occupancy after zero suppression;"
300 "iX -200 / iEta / iX + 100;"
301 "iY / iPhi (starting from -10^{o}!);"
310 title =
string(
"Trigger primitive TT E_{T};E_{T} ")
311 + tpUnit +
string(
";Event Count");
317 "Trigger primitive TT flag;Flag number;Event count",
320 title =
string(
"Trigger tower flag vs TP;E_{T}(TT) (")
321 + tpUnit +
string(
");Flag number");
328 "Trigger tower flag vs #sumE_{T};"
333 title =
string(
"Trigger primitive Et (TP) vs #sumE_{T};"
335 "E_{T} (TP) (") + tpUnit +
string (
")");
342 title =
string(
"Trigger primitive E_{T};"
345 "E_{T} (TP) (") + tpUnit +
string (
")");
353 "Full Read-out readout unit;"
354 "iX - 40 / iEta / iX + 20;"
355 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
361 "Number of Full-readout-flagged readout units;"
362 "FRO RU count;Event count",
366 "Number of EB Full-readout-flagged readout units;"
367 "FRO RU count;Event count",
371 "Number of EE Full-readout-flagged readout units;"
372 "FRO RU count;Event count",
376 "Readout unit with ZS-thr-1 flag;"
377 "iX - 40 / iEta / iX + 20;"
378 "iY0 / iPhi0 (iPhi = 1 at phi = 0 rad);"
384 "ECAL readout unit with forced bit of SR flag on;"
385 "iX - 40 / iEta / iX + 20;"
386 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
392 "Low interest trigger tower flags;"
400 "Mid interest trigger tower flags;"
408 "High interest trigger tower flags;"
416 "Trigger tower flags with forced bit set;"
424 const float ebMinNoise = -1.;
425 const float ebMaxNoise = 1.;
427 const float eeMinNoise = -1.;
428 const float eeMaxNoise = 1.;
431 const float ebMinE = 0.;
432 const float ebMaxE = 120.;
434 const float eeMinE = 0.;
435 const float eeMaxE = 120.;
437 const float ebMinE = ebMinNoise;
438 const float ebMaxE = ebMaxNoise;
440 const float eeMinE = eeMinNoise;
441 const float eeMaxE = eeMaxNoise;
445 const int evtMax = 500;
448 "Crystal reconstructed energy;E (GeV);Event count",
449 100, ebMinE, ebMaxE);
452 "EE <E_hit>;event #;<E_hit> (GeV)",
453 evtMax, .5, evtMax + .5);
457 "(rec E of crystal without deposited energy)"
458 ";Rec E (GeV);Event count",
459 100, ebMinNoise, ebMaxNoise);
462 "Emulated ouput of ZS FIR filter for EB "
463 "low interest crystals;"
469 "Emulated ouput of ZS FIR filter for EB "
470 "high interest crystals;"
484 100, ebMinE, ebMaxE);
487 "EB rec energy of hit crystals",
488 100, ebMinE, ebMaxE);
491 "Crystal simulated vs reconstructed energy;"
492 "Esim (GeV);Erec GeV);Event count",
494 100, ebMinE, ebMaxE);
497 "Crystal no-zs simulated vs reconstructed "
499 "Esim (GeV);Erec GeV);Event count",
501 100, ebMinE, ebMaxE);
504 "EE crystal reconstructed energy;E (GeV);"
506 100, eeMinE, eeMaxE);
509 "<E_{EE hit}>;event;<E_{hit}> (GeV)",
510 evtMax, .5, evtMax + .5);
515 "(rec E of crystal without deposited energy);"
516 "E (GeV);Event count",
517 200, eeMinNoise, eeMaxNoise);
520 "Emulated ouput of ZS FIR filter for EE "
521 "low interest crystals;"
527 "Emulated ouput of ZS FIR filter for EE "
528 "high interest crystals;"
543 100, eeMinE, eeMaxE);
546 "EE rec energy of hit crystals",
547 100, eeMinE, eeMaxE);
550 "EE crystal simulated vs reconstructed energy;"
551 "Esim (GeV);Erec GeV);Event count",
553 100, eeMinE, eeMaxE);
556 "EE crystal no-zs simulated vs "
558 "energy;Esim (GeV);Erec GeV);Event count",
560 100, eeMinE, eeMaxE);
563 "TTFlags and SR Flags mismatch;"
564 "iX - 40 / iEta / iX + 20;"
565 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
572 "Incomplete full-readout-flagged readout units;"
573 "iX - 40 / iEta / iX + 20;"
574 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
580 "Number of incomplete full-readout-flagged "
582 "Number of RUs;Event count;",
587 "Incomplete full-readout-flagged readout units;"
588 "iX - 40 / iEta / iX + 20;"
589 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
590 "Incomplete error rate",
596 "Dropped full-readout-flagged readout units;"
597 "iX - 40 / iEta / iX + 20;"
598 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
604 "Number of dropped full-readout-flagged "
605 "RU count;RU count;Event count",
609 "Number of zero-suppressed-flagged RU fully "
611 "RU count;Event count",
615 buf <<
"Number of LI EB channels below the " << ebZsThr_/4. <<
" ADC count ZS threshold;"
616 "Channel count;Event count",
622 buf <<
"Number of LI EE channels below the " <<
eeZsThr_/4. <<
" ADC count ZS theshold;"
623 "Channel count;Event count",
629 "Number of LI channels below the ZS threshold;"
630 "Channel count;Event count",
634 "Number of EB channels below the ZS "
635 "threshold in a LI but fully readout RU;"
636 "Channel count;Event count;",
640 "Number EE channels below the ZS threshold"
641 " in a LI but fully readout RU;"
642 "Channel count;Event count",
646 "Number of LI channels below the ZS threshold "
647 "in a LI but fully readout RU;"
648 "Channel count;Event count",
654 "Dropped full-readout-flagged readout units"
655 "iX - 40 / iEta / iX + 20;"
656 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
662 "Complete zero-suppressed-flagged readout units;"
663 "iX - 40 / iEta / iX + 20;"
664 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
671 "Complete zero-suppressed-flagged readout units;"
672 "iX - 40 / iEta / iX + 20;"
673 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
684 for(set<string>::iterator it =
histList_.begin();
687 if(*it!=
string(
"all")
689 s << (s.str().size()==0?
"":
", ") << *it;
692 if(s.str().size()!=0){
694 <<
"Parameter 'histList' contains some unknown histogram(s). "
695 "Check spelling. Following name were not found: "
702 const int32_t bx =
event.bunchCrossing();
703 if(bx<1 || bx > 3564)
return;
706 int64_t
t =
event.bunchCrossing() + (
event.orbitNumber()-1)*3564;
720 LogDebug(
"EcalSrValid") << __FILE__ <<
":" << __LINE__ <<
": "
721 <<
"Tmax = " <<
tmax <<
" x 25ns; Tmin = " <<
tmin
722 <<
" x 25ns; L1A(Tmax) = " <<
l1aOfTmax <<
"; L1A(Tmin) = "
744 edm::LogInfo(
"EcalSrValid") <<
"Size of TP collection: " <<
tps_->size() <<
"\n"
745 <<
"Size of EB SRF collection read from data: "
747 <<
"Size of EB SRF collection computed from data TTFs: "
749 <<
"Size of EE SRF collection read from data: "
751 <<
"Size of EE SRF collection computed from data TTFs: "
825 bool eventError =
false;
830 for(
int iZ0=0; iZ0<
nEndcaps; ++iZ0){
831 for(
int iX0=0; iX0<
nEeX; ++iX0){
832 for(
int iY0=0; iY0<
nEeY; ++iY0){
851 PgTiming t(
"analyzeEE: unsupressed digis");
858 int iZ0 = frame.
id().
zside()>0?1:0;
860 if(iX0<0 || iX0>=
nEeX){
861 edm::LogError(
"EcalSrValid") <<
"iX0 (= " << iX0 <<
") is out of range ("
862 <<
"[0," <<
nEeX -1 <<
"]\n";
864 if(iY0<0 || iY0>=
nEeY){
865 edm::LogError(
"EcalSrValid") <<
"iY0 (= " << iY0 <<
") is out of range ("
866 <<
"[0," <<
nEeY -1 <<
"]\n";
872 for(
int i = 0;
i< frame.
size(); ++
i){
873 const int gain12Code = 0x1;
893 int iX0 =
iXY2cIndex(static_cast<const EEDetId&>(hit.
id()).ix());
894 int iY0 =
iXY2cIndex(static_cast<const EEDetId&>(hit.
id()).iy());
897 if(iX0<0 || iX0>=
nEeX){
898 LogError(
"EcalSrValid") <<
"iX0 (= " << iX0 <<
") is out of range ("
899 <<
"[0," <<
nEeX -1 <<
"]\n";
901 if(iY0<0 || iY0>=
nEeY){
902 LogError(
"EcalSrValid") <<
"iY0 (= " << iY0 <<
") is out of range ("
903 <<
"[0," <<
nEeY -1 <<
"]\n";
914 for(vector<PCaloHit>::const_iterator it =
eeSimHits_->begin();
922 int iZ0 = detId.zside()>0?1:0;
929 PgTiming t(
"analyzeEE: suppressed digis");
935 int iX0 =
iXY2cIndex(static_cast<const EEDetId&>(frame.
id()).ix());
936 int iY0 =
iXY2cIndex(static_cast<const EEDetId&>(frame.
id()).iy());
938 if(iX0<0 || iX0>=
nEeX){
939 LogError(
"EcalSrValid") <<
"iX0 (= " << iX0 <<
") is out of range ("
940 <<
"[0," <<
nEeX -1 <<
"]\n";
942 if(iY0<0 || iY0>=
nEeY){
943 LogError(
"EcalSrValid") <<
"iY0 (= " << iY0 <<
") is out of range ("
944 <<
"[0," <<
nEeY -1 <<
"]\n";
952 for(
int i = 0;
i< frame.
size(); ++
i){
953 const int gain12Code = 0x1;
954 if(frame[
i].
gainId()!=gain12Code){
964 bool highInterest =
false;
970 highInterest = ((srf->value() & ~
EcalSrFlag::SRF_FORCED_MASK)
982 pair<int,int> ru =
dccCh(frame.
id());
986 <<
"RU " << frame.
id() <<
", "
987 <<
"DCC " << ru.first
988 <<
" Ch : " << ru.second <<
": "
989 <<
"LI channel under ZS threshold.\n";
993 <<
"more ZS errors for this event...\n";
1003 for(
int iZ0=0; iZ0<
nEndcaps; ++iZ0){
1004 for(
int iX0=0; iX0<
nEeX; ++iX0){
1005 for(
int iY0=0; iY0<
nEeY; ++iY0){
1034 char eeSrfMark[2][100][100];
1035 bzero(eeSrfMark,
sizeof(eeSrfMark));
1040 int iX = srf.
id().
ix();
1041 int iY = srf.
id().
iy();
1043 if(iX<1 || iY > 100)
throw cms::Exception(
"EcalSelectiveReadoutValidation")
1044 <<
"Found an endcap SRF with an invalid det ID: " << srf.
id() <<
".\n";
1045 ++eeSrfMark[iZ>0?1:0][iX-1][iY-1];
1046 if(eeSrfMark[iZ>0?1:0][iX-1][iY-1] > 1)
throw cms::Exception(
"EcalSelectiveReadoutValidation")
1047 <<
"Duplicate SRF for supercrystal " << srf.
id() <<
".\n";
1065 PgTiming t(
"analyzeEE: SR appli error log");
1069 <<
" ZS-flagged EE channels under "
1071 <<
" in a complete RU.\n";
1079 bool eventError =
false;
1081 vector<pair<int,int> > xtalEtaPhi;
1087 for(
int iEta0=0; iEta0<
nEbEta; ++iEta0){
1088 for(
int iPhi0=0; iPhi0<
nEbPhi; ++iPhi0){
1094 xtalEtaPhi.push_back(pair<int,int>(iEta0, iPhi0));
1102 PgTiming t1(
"analyzeEB: geomRetrieval");
1111 PgTiming t(
"analyzeEB: unsuppressed digi loop");
1116 int iEta0 =
iEta2cIndex(static_cast<const EBDetId&>(frame.
id()).ieta());
1117 int iPhi0 =
iPhi2cIndex(static_cast<const EBDetId&>(frame.
id()).iphi());
1118 if(iEta0<0 || iEta0>=
nEbEta){
1120 s <<
"EcalSelectiveReadoutValidation: "
1121 <<
"iEta0 (= " << iEta0 <<
") is out of range ("
1122 <<
"[0," <<
nEbEta -1 <<
"]\n";
1125 if(iPhi0<0 || iPhi0>=
nEbPhi){
1127 s <<
"EcalSelectiveReadoutValidation: "
1128 <<
"iPhi0 (= " << iPhi0 <<
") is out of range ("
1129 <<
"[0," <<
nEbPhi -1 <<
"]\n";
1135 for(
int i = 0;
i< frame.
size(); ++
i){
1136 const int gain12Code = 0x1;
1152 for(vector<PCaloHit>::const_iterator it =
ebSimHits_->begin();
1156 int iEta = detId.
ieta();
1158 int iPhi = detId.iphi();
1167 PgTiming t(
"analyzeEB: suppressed digi loop init");
1169 for(
int iEta0=0; iEta0<
nEbEta; ++iEta0){
1170 for(
int iPhi0=0; iPhi0<
nEbPhi; ++iPhi0){
1171 crystalShot[iEta0][iPhi0] =
false;
1179 PgTiming t(
"analyzeEB: suppressed digi loop");
1185 int iEta =
static_cast<const EBDetId&
>(frame.
id()).ieta();
1186 int iPhi =
static_cast<const EBDetId&
>(frame.
id()).iphi();
1189 if(iEta0<0 || iEta0>=
nEbEta){
1191 <<
"iEta0 (= " << iEta0 <<
") is out of range ("
1192 <<
"[0," <<
nEbEta -1 <<
"]");
1194 if(iPhi0<0 || iPhi0>=
nEbPhi){
1196 <<
"iPhi0 (= " << iPhi0 <<
") is out of range ("
1197 <<
"[0," <<
nEbPhi -1 <<
"]");
1201 if(!crystalShot[iEta0][iPhi0]){
1202 crystalShot[iEta0][iPhi0] =
true;
1204 cout <<
"Error: several digi for same crystal!";
1212 for(
int i = 0;
i< frame.
size(); ++
i){
1213 const int gain12Code = 0x1;
1214 if(frame[
i].
gainId()!=gain12Code){
1223 bool highInterest =
false;
1231 highInterest = ((srf->value() & ~
EcalSrFlag::SRF_FORCED_MASK)
1244 pair<int,int> ru =
dccCh(frame.
id());
1248 <<
"RU " << frame.
id() <<
", "
1249 <<
"DCC " << ru.first
1250 <<
" Ch : " << ru.second <<
": "
1251 <<
"LI channel under ZS threshold.\n";
1255 <<
"more ZS errors for this event...\n";
1272 int iEta =
static_cast<const EBDetId&
>(hit.
id()).ieta();
1273 int iPhi =
static_cast<const EBDetId&
>(hit.
id()).iphi();
1276 if(iEta0<0 || iEta0>=
nEbEta){
1277 LogError(
"EcalSrValid") <<
"iEta0 (= " << iEta0 <<
") is out of range ("
1278 <<
"[0," <<
nEbEta -1 <<
"]\n";
1280 if(iPhi0<0 || iPhi0>=
nEbPhi){
1281 LogError(
"EcalSrValid") <<
"iPhi0 (= " << iPhi0 <<
") is out of range ("
1282 <<
"[0," <<
nEbPhi -1 <<
"]\n";
1301 PgTiming t(
"analyzeEB: loop on energies");
1303 for(
unsigned int i=0;
i<xtalEtaPhi.size(); ++
i){
1304 int iEta0 = xtalEtaPhi[
i].first;
1305 int iPhi0= xtalEtaPhi[
i].second;
1308 double recE = energies.
recE;
1331 char ebSrfMark[2][17][72];
1332 bzero(ebSrfMark,
sizeof(ebSrfMark));
1338 int iPhi = srf.
id().
iphi();
1344 if(iEtaAbs < 1 || iEtaAbs > 17
1345 || iPhi < 1 || iPhi > 72)
throw cms::Exception(
"EcalSelectiveReadoutValidation")
1346 <<
"Found a barrel SRF with an invalid det ID: " << srf.
id() <<
".\n";
1347 ++ebSrfMark[iZ>0?1:0][iEtaAbs-1][iPhi-1];
1348 if(ebSrfMark[iZ>0?1:0][iEtaAbs-1][iPhi-1] > 1)
throw cms::Exception(
"EcalSelectiveReadoutValidation")
1349 <<
"Duplicate SRF for RU " << srf.
id() <<
".\n";
1369 <<
" ZS-flagged EB channels under "
1371 <<
" in a complete RU.\n";
1402 #if (CMSSW_COMPAT_VERSION>=210)
1410 it !=
tps_->end(); ++it){
1425 #if (CMSSW_COMPAT_VERSION<210)
1428 tpEt = ecalScale.
getTPGInGeV(it->compressedEt(), it->id()) ;
1431 tpEt = it->compressedEt();
1433 int iEta = it->id().ieta();
1435 int iPhi = it->id().iphi();
1437 double etSum =
ttEtSums[iEta0][iPhi0];
1441 if((it->ttFlag() & 0x3) == 0){
1444 if((it->ttFlag() & 0x3) == 1){
1447 if((it->ttFlag() & 0x3) == 3){
1450 if((it->ttFlag() & 0x4)){
1476 for (
unsigned int digis=0; digis<
ebDigis_->
size(); ++digis){
1482 for (
unsigned int digis=0; digis<
eeDigis_->
size(); ++digis){
1488 for(
unsigned iDcc0 = 0; iDcc0 <
nDccs_; ++iDcc0){
1525 template<
class T,
class U>
1527 const U& srFlagColl){
1528 const DetId& xtalId = frame.id();
1529 typedef typename U::key_type RuDetId;
1531 typename U::const_iterator srf = srFlagColl.find(ruId);
1533 bool highInterest =
false;
1536 if(srf != srFlagColl.end()){
1541 flag = srf->value() & ~
EcalSrFlag::SRF_FORCED_MASK;
1549 pair<int,int> ch =
dccCh(xtalId);
1558 int iEta0 =
iEta2cIndex(static_cast<const EBDetId&>(xtalId).ieta());
1559 int iPhi0 =
iPhi2cIndex(static_cast<const EBDetId&>(xtalId).iphi());
1583 int iX0 =
iXY2cIndex(static_cast<const EEDetId&>(frame.id()).ix());
1584 int iY0 =
iXY2cIndex(static_cast<const EEDetId&>(frame.id()).iy());
1585 int iZ0 =
static_cast<const EEDetId&
>(frame.id()).
zside()>0?1:0;
1605 if(ch.second < 1 || ch.second > 68){
1607 <<
"Error in DCC channel retrieval for crystal with detId "
1608 << xtalId.
rawId() <<
"DCC channel out of allowed range [1..68]\n";
1638 static bool firstCall =
true;
1648 double adc2GeV = 0.;
1662 double gainInv[] = {12., 1., 6., 12.};
1664 for(
int i=0;
i <
n; ++
i){
1665 acc +=
weights_[
i]*frame[
i].adc()*gainInv[frame[
i].gainId()]*adc2GeV;
1686 <<
"Wrong type of DetId passed to the "
1687 "EcalSelectiveReadoutValidation::dccCh(const DetId&). "
1688 "An ECAL DetId was expected.\n";
1701 const int oneXtalPhi0 = iTtPhi0 * 5;
1702 const int oneXtalEta0 = (iTtEta0 -
nOneEeTtEta) * 5;
1709 if(detId.
rawId() & 0x8000){
1725 <<
"Wrong type of DetId passed to the method "
1726 "EcalSelectiveReadoutValidation::dccCh(const DetId&). "
1727 "A valid EcalTriggerTower, EcalBarrel or EcalEndcap DetId was expected. "
1728 "detid = " << xtalId.
rawId() <<
".\n";
1734 result.first = EcalElecId.
dccId();
1738 <<
"Got an invalid DCC ID, DCCID = " << result.first
1739 <<
" for DetId 0x" << hex << detId.
rawId()
1740 <<
" and 0x" << xtalId.
rawId() <<
dec <<
"\n";
1743 result.second = EcalElecId.
towerId();
1745 if(result.second < 1 || result.second > 68){
1747 <<
"Got an invalid DCC channel ID, DCC_CH = " << result.second
1748 <<
" for DetId 0x" << hex << detId.
rawId()
1749 <<
" and 0x" << xtalId.
rawId() <<
dec <<
"\n";
1761 (xtalId.
iy()-1)/scEdge+1,
1803 int iDCC= EcalElecId.
dccId();
1804 int iDccChan = EcalElecId.
towerId();
1805 const bool ignoreSingle =
true;
1817 if(eeGeometry==0 || ebGeometry==0){
1827 for(
int iEta0 = 0; iEta0 <
nTtEta; ++iEta0){
1828 for(
int iPhi0 = 0; iPhi0 <
nTtPhi; ++iPhi0){
1851 it != eeDigis.
end(); ++it){
1868 int innerTTEtas[] = {0, 1, 54, 55};
1869 for(
unsigned iRing = 0; iRing <
sizeof(innerTTEtas)/
sizeof(innerTTEtas[0]);
1871 int iTtEta0 = innerTTEtas[iRing];
1887 for(
unsigned iTtPhi0 = 0; iTtPhi0 <
nTtPhi-1; iTtPhi0 += 2){
1888 double et = .5*(
ttEtSums[iTtEta0][iTtPhi0]
1904 double weights[] = {0., -1/3., -1/3., -1/3., 0., 1.};
1906 double adc2GeV = 0.;
1914 << __FILE__ <<
":" << __LINE__ <<
": "
1915 <<
"this is a bug. Please report it.\n";
1920 const int n = min<int>(frame.size(),
sizeof(
weights)/
sizeof(weights[0]));
1922 double gainInv[] = {12., 1., 6., 12};
1924 for(
int i=offset;
i <
n; ++
i){
1926 if(iframe>=0 && iframe<frame.size()){
1927 acc += weights[
i]*frame[iframe].adc()
1928 *gainInv[frame[iframe].gainId()]*adc2GeV;
1943 <<
"Failed to book integer DQM monitor element" <<
name;
1954 <<
"Failed to book histogram " <<
name;
1962 nybins, ymin, ymax);
1965 <<
"Failed to book histogram " <<
name;
1976 <<
"Failed to book histogram " <<
name;
1984 =
dbe_->bookProfile2D(name,
1992 <<
"Failed to book histogram " <<
name;
2022 log <<
"Avalailable histograms (DQM monitor elements): \n";
2026 log << it->first <<
": " << it->second <<
"\n";
2028 log <<
"\nTo include an histogram add its name in the vstring parameter "
2029 "'histograms' of the EcalSelectiveReadoutValidation module\n";
2033 double ruHeaderPayload = 0.;
2034 const int firstEbDcc0 =
nEeDccs/2;
2035 for(
int iDcc0 = firstEbDcc0; iDcc0 < firstEbDcc0 +
nEbDccs; ++iDcc0){
2044 double ruHeaderPayload = 0.;
2045 const unsigned firstEbDcc0 =
nEeDccs/2;
2046 for(
unsigned iDcc0 = 0; iDcc0 <
nDccs_; ++iDcc0){
2048 if(iDcc0== firstEbDcc0) iDcc0 +=
nEbDccs;
2062 double scale = 1./eventCount;
2064 for(
unsigned i = 0;
i <
sizeof(mes)/
sizeof(mes[0]); ++
i){
2065 if(mes[
i] == 0)
continue;
2067 if(dynamic_cast<TH2*>(h)){
2068 h->GetZaxis()->SetTitle(
"Frequency");
2070 h->GetYaxis()->SetTitle(
"<Count>");
2072 buf <<
"Normalising " << h->GetName() <<
". Factor: " << scale <<
"\n";
2076 h->SetBit(TH1::kIsAverage);
2085 const std::vector<int>& firWeights,
2088 const int nFIRTaps = 6;
2090 const vector<int>&
w = firWeights;
2094 bool gain12saturated =
false;
2095 const int gain12 = 0x01;
2096 const int lastFIRSample = firstFIRSample + nFIRTaps - 1;
2099 for(
int iSample=firstFIRSample-1;
2100 iSample<lastFIRSample; ++iSample, ++iWeight){
2101 if(iSample>=0 && iSample < frame.
size()){
2103 if(sample.
gainId()!=gain12) gain12saturated =
true;
2104 LogTrace(
"DccFir") << (iSample>=firstFIRSample?
"+":
"") << sample.
adc()
2105 <<
"*(" << w[iWeight] <<
")";
2106 acc+=sample.
adc()*w[iWeight];
2109 ": Not enough samples in data frame or 'ecalDccZs1stSample' module "
2110 "parameter is not valid...";
2117 acc = (acc>=0)?(acc >> 8):-(-acc >> 8);
2122 LogTrace(
"DccFir") <<
"acc: " << acc <<
"\n"
2123 <<
"saturated: " << (gain12saturated?
"yes":
"no") <<
"\n";
2126 *saturated = gain12saturated;
2135 const int nFIRTaps = 6;
2136 vector<int> firWeights(nFIRTaps, 0);
2137 const static int maxWeight = 0xEFF;
2138 for(
unsigned i=0;
i <
min((
size_t)nFIRTaps,normalizedWeights.size()); ++
i){
2139 firWeights[
i] = lround(normalizedWeights[
i] * (1<<10));
2140 if(
abs(firWeights[
i])>maxWeight){
2141 firWeights[
i] = firWeights[
i]<0?-maxWeight:maxWeight;
2149 bool notNormalized =
false;
2150 bool notInt =
false;
2151 for(
unsigned i=0;
i < weightsForZsFIR.size(); ++
i){
2152 if(weightsForZsFIR[
i] > 1.) notNormalized =
true;
2153 if((
int)weightsForZsFIR[
i]!=weightsForZsFIR[
i]) notInt =
true;
2155 if(notInt && notNormalized){
2157 <<
"weigtsForZsFIR paramater values are not valid: they "
2158 <<
"must either be integer and uses the hardware representation "
2159 <<
"of the weights or less or equal than 1 and used the normalized "
2160 <<
"representation.";
2164 firWeights_ = vector<int>(weightsForZsFIR.size());
2165 for(
unsigned i = 0;
i< weightsForZsFIR.size(); ++
i){
2172 log <<
"Input weights for FIR: ";
2173 for(
unsigned i = 0;
i < weightsForZsFIR.size(); ++
i){
2174 log << weightsForZsFIR[
i] <<
"\t";
2178 log <<
"\nActual FIR weights: ";
2181 s2 += firWeights_[
i]*firWeights_[
i];
2185 log <<
"\nNormalized FIR weights after hw representation rounding: ";
2198 <<
"Failed to open the log file '"
2200 <<
"' for SRP algorithm result check.\n";
2208 <<
"Failed to open the log file '"
2210 <<
"' for Selective Readout decision application check.\n";
2220 typedef typename T::const_iterator SrFlagCollectionConstIt;
2221 typedef typename T::key_type MyRuDetIdType;
2222 SrFlagCollectionConstIt itSrfFromData = srfFromData.begin();
2223 SrFlagCollectionConstIt itComputedSr = computedSrf.begin();
2230 while(itSrfFromData != srfFromData.end()
2231 || itComputedSr != computedSrf.end()){
2233 MyRuDetIdType inconsistentRu = 0;
2234 bool inconsistent =
false;
2235 if(itComputedSr == computedSrf.end() ||
2236 (itSrfFromData != srfFromData.end()
2237 && itSrfFromData->id() < itComputedSr->id())){
2239 pair<int, int> ch =
dccCh(itSrfFromData->id());
2241 <<
", DCC " << ch.first <<
" ch " << ch.second
2242 <<
" found in data (SRF:" << itSrfFromData->flagName()
2243 <<
") but not in the set of SRFs computed from the data TTF.\n";
2244 inconsistentRu = itSrfFromData->id();
2245 inconsistent =
true;
2247 }
else if(itSrfFromData==srfFromData.end() ||
2248 (itComputedSr != computedSrf.end()
2249 && itComputedSr->id() < itSrfFromData->id())){
2251 pair<int, int> ch =
dccCh(itComputedSr->id());
2254 <<
", DCC " << ch.first <<
" ch " << ch.second
2255 <<
" not found in data. Computed SRF: "
2256 << itComputedSr->flagName() <<
".\n";
2257 inconsistentRu = itComputedSr->id();
2258 inconsistent =
true;
2263 if(itComputedSr->value()!=itSrfFromData->value()){
2265 pair<int, int> ch =
dccCh(itSrfFromData->id());
2267 << itSrfFromData->id()
2268 <<
", DCC " << ch.first <<
" ch " << ch.second
2269 <<
", SRF inconsistency: "
2270 <<
"from data: " << itSrfFromData->flagName()
2271 <<
", computed from TTF: "
2272 << itComputedSr->flagName()
2275 inconsistentRu = itComputedSr->id();
2276 inconsistent =
true;
2278 if(itComputedSr != computedSrf.end()) ++itComputedSr;
2279 if(itSrfFromData != srfFromData.end()) ++itSrfFromData;
2296 <<
"Argument of EcalSelectiveReadoutValidation::dccId(const EcalTrigTowerDetId&) "
2297 <<
"must be a barrel trigger tower Id\n";
2299 return dccCh(detId).first;
2335 buf <<
"List of DCCs found in the first processed event: ";
2337 for(
unsigned iDcc = 0; iDcc <
nDccs_; ++iDcc){
2339 buf << (first?
"":
", ") << (iDcc +
minDccId_);
2343 buf <<
"\nOnly DCCs from this list will be considered for error logging\n";
2346 LogInfo(
"EcalSrValid") << buf;
2353 typedef typename T::const_iterator SrFlagCollectionConstIt;
2354 typedef typename T::key_type MyRuDetIdType;
2356 for(SrFlagCollectionConstIt itSrf = srfs.begin();
2357 itSrf != srfs.end(); ++itSrf){
2359 pair<int,int> ru =
dccCh(itSrf->id());
2375 << itSrf->id() <<
" (DCC " << ru.first
2376 <<
" ch " << ru.second <<
") is 'Full readout' "
2377 <<
"while none of its channel was read out\n";
2387 << itSrf->id() <<
" (DCC " << ru.first
2388 <<
" ch " << ru.second <<
") is 'Full readout' "
2392 <<
" channels were read out.\n";
2417 if(iDcc < minDccId_ || iDcc >
maxDccId_){
2419 }
else if (10 <= iDcc && iDcc <= 45) {
2423 if(iDcc < 10) iDccPhi = iDcc;
2424 else iDccPhi = iDcc - 45;
2425 switch(iDccPhi*100+iDccCh){
void configFirWeights(const std::vector< double > &weightsForZsFIR)
void printAvailableHists()
double getDccSrDependentPayload(int iDcc0, double nReadRus, double nReadXtals) const
MonitorElement * meEbFullRoCnt_
int iPhi2cIndex(int iPhi) const
T getParameter(std::string const &) const
std::string srApplicationErrorLogFileName_
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meEbRecVsSimE_
MonitorElement * meForcedRu_
MonitorElement * meChOcc_
bool gain12
eta crystal position
MonitorElement * bookProfile(const std::string &name, const std::string &title, int nbins, double xmin, double xmax)
int getCrystalCount(int iDcc, int iDccCh)
CollHandle< EBDigiCollection > ebNoZsDigis_
MonitorElement * meEeEMean_
std::ofstream srApplicationErrorLog_
Output ascii file for unconsistency between Xtals and RU Flags.
MonitorElement * meZsErrType1Cnt_
MonitorElement * meTtfVsTp_
double getDccOverhead(subdet_t subdet) const
static const int nEeX
EE crystal grid size along X.
MonitorElement * meDroppedFROMap_
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
int xtalGraphX(const EEDetId &id) const
double getDccEventSize(int iDcc0, double nReadXtals) const
int nIncompleteFRO_
Counter of FRO-flagged RU only partial data.
MonitorElement * meCompleteZSRateMap_
MonitorElement * meEeFullRoCnt_
int cIndex2iPhi(int i) const
void setEventSetup(const edm::EventSetup &evtSetup)
int gainId(sample_type sample)
get the gainId (2 bits)
bool verbose_
Verbosity switch.
double phi
number of sim hits
static const int nEbPhi
number of crystals along Phi in EB
MonitorElement * meEeZsErrCnt_
MonitorElement * meEeFixedPayload_
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
MonitorElement * meEbNoise_
int iXY2cIndex(int iX) const
static const int SRF_FORCED_MASK
static const double rad2deg
Conversion factor from radian to degree.
energiesEe_t eeEnergies[nEndcaps][nEeX][nEeY]
MonitorElement * meEeZsErrType1Cnt_
int simHit
energy reconstructed from zero-suppressed digi
CollHandle< EcalTrigPrimDigiCollection > tps_
Sin< T >::type sin(const T &t)
MonitorElement * meVolBLI_
Geom::Phi< T > phi() const
void analyzeEB(const edm::Event &event, const edm::EventSetup &es)
std::vector< EcalRecHit >::const_iterator const_iterator
Geom::Theta< T > theta() const
int simHit
energy reconstructed from zero-suppressed digi
void analyze(edm::Event const &e, edm::EventSetup const &c)
Analyzes the event.
MonitorElement * meEbHiZsFir_
MonitorElement * meDccVolFromData_
void endRun(const edm::Run &r, const edm::EventSetup &c)
Calls at end of run.
int nEeZsErrors_
Counter of EE ZS errors (LI channel below ZS threshold)
CollHandle< FEDRawDataCollection > fedRaw_
int towerId() const
get the tower id
MonitorElement * meTpVsEtSum_
MonitorElement * meDccLiVol_
void beginRun(const edm::Run &r, const edm::EventSetup &c)
Calls at begin of run.
void analyzeEE(const edm::Event &event, const edm::EventSetup &es)
MonitorElement * meEeNoise_
const_iterator begin() const
MonitorElement * meVolELI_
static const int nEeDccs
number of DCCs for EE
double getTPGInGeV(const EcalTriggerPrimitiveDigi &tpDigi)
double eta
phi crystal position in degrees
std::pair< int, int > getDCCandSC(EcalScDetId id) const
int gainId() const
get the gainId (2 bits)
MonitorElement * meTtfVsEtSum_
double ttEtSums[nTtEta][nTtPhi]
MonitorElement * meEbZsErrCnt_
MonitorElement * meEeLiZsFir_
MonitorElement * meDroppedFROCnt_
MonitorElement * meTpMap_
unsigned ttId(DetId const &)
size_t size() const
Lenght of the data buffer in bytes.
MonitorElement * meDccHiVol_
MonitorElement * meEbLiZsFir_
MonitorElement * meLiTtf_
bool registerHist(const std::string &name, const std::string &title)
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
int ieta() const
get the tower ieta
void setTtEtSums(const edm::EventSetup &es, const EBDigiCollection &ebDigis, const EEDigiCollection &eeDigis)
int zside() const
get the z-side of the tower (1/-1)
MonitorElement * book1D(const std::string &name, const std::string &title, int nbins, double xmin, double xmax)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
MonitorElement * meVolBHI_
static const int minDccId_
static const int nEbEta
number of crystals along Eta in EB
uint32_t rawId() const
get the raw id
MonitorElement * meIncompleteFROMap_
double frame2EnergyForTp(const T &frame, int offset=0) const
CaloGeometryRecord MyCaloGeometryRecord
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
CollHandle< EESrFlagCollection > eeComputedSrFlags_
static const int nTtPhi
Number of Trigger Towers along Phi.
int xtalGraphY(const EEDetId &id) const
CollHandle< EEDigiCollection > eeDigis_
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
std::vector< int > firWeights_
void checkSrApplication(const edm::Event &event, T &srfs)
std::string outputFile_
Output file for histograms.
CollHandle< RecHitCollection > eeRecHits_
int ietaAbs() const
get the absolute value of the tower ieta
static const int maxDccId_
void analyzeDataVolume(const edm::Event &e, const edm::EventSetup &es)
double getL1aRate() const
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
int iTtEta2cIndex(int iEta) const
double eta
phi crystal position in degrees
MonitorElement * meEeHiZsFir_
void anaDigi(const T &frame, const U &srFlagColl)
CollHandle< EBSrFlagCollection > ebSrFlags_
MonitorElement * meEbNoZsRecVsSimE_
MonitorElement * meEeSimE_
void updateL1aRate(const edm::Event &event)
static const int SRF_FULL
Abs< T >::type abs(const T &t)
double noZsRecE
sim hit energy sum
int nCompleteZS_
Counter of ZS-flagged RU fully read out.
CollHandle< std::vector< PCaloHit > > eeSimHits_
MonitorElement * meDroppedFRORateMap_
static int dccZsFIR(const EcalDataFrame &frame, const std::vector< int > &firWeights, int firstFIRSample, bool *saturated=0)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
DQMStore * dbe_
Histogramming interface.
int nEeFROCnt_
Counter of EE FRO-flagged RUs.
MonitorElement * bookFloat(const std::string &name)
int ieta() const
get the crystal ieta
bool logSrApplicationErrors_
std::vector< double > weights_
MonitorElement * meCompleteZSCnt_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
int iTtPhi2cIndex(int iPhi) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
int iEta2cIndex(int iEta) const
MonitorElement * book2D(const std::string &name, const std::string &title, int nxbins, double xmin, double xmax, int nybins, double ymin, double ymax)
MonitorElement * meMiTtf_
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
MonitorElement * meVolEHI_
void read(const edm::Event &event)
EcalScDetId superCrystalOf(const EEDetId &xtalId) const
int cIndex2iEta(int i) const
std::vector< EcalScDetId > getEcalScDetId(int DCCid, int DCC_Channel, bool ignoreSingleCrystal=true) const
CollHandle< EESrFlagCollection > eeSrFlags_
static const int nDccRus_[nDccs_]
number of RUs for each DCC
MonitorElement * meEeRecVsSimE_
energiesEb_t ebEnergies[nEbEta][nEbPhi]
static const int nOneEeTtEta
Number of Trigger Towers in an endcap along Eta.
int nEbFROCnt_
Counter of EB FRO-flagged RUs.
static const int nEbDccs
number of DCCs for EB
MonitorElement * meZsErrCnt_
CollHandle< std::vector< PCaloHit > > ebSimHits_
int nEbZsErrors_
Counter of EB ZS errors (LI channel below ZS threshold)
static const int scEdge
Number of crystals along a supercrystal edge.
MonitorElement * meFullRoCnt_
double recE
energy reconstructed from unsuppressed digi
static const double tmax[3]
void readAllCollections(const edm::Event &e)
static std::vector< int > getFIRWeights(const std::vector< double > &normalizedWeights)
int iphi() const
get the tower iphi
static const int ebTtEdge
Number of crystals along an EB TT.
EcalSelectiveReadoutValidation(const edm::ParameterSet &ps)
Constructor.
DetId id() const
get the id
double getEeEventSize(double nReadXtals) const
MonitorElement * meForcedTtf_
MonitorElement * meDccVol_
static const int kByte_
number of bytes in 1 kByte:
MonitorElement * meEbFixedPayload_
const EcalScDetId & id() const
MonitorElement * meVolLI_
bool ebRuActive_[nEbEta/ebTtEdge][nEbPhi/ebTtEdge]
double getBytesPerCrystal() const
int nPerRu_[nDccs_][nDccChs_]
PgTiming(const std::string &mess)
T const * product() const
int getRuCount(int iDcc0) const
MonitorElement * meCompleteZSMap_
MonitorElement * meIncompleteFRORateMap_
MonitorElement * meVolHI_
EcalTrigTowerDetId readOutUnitOf(const EBDetId &xtalId) const
CollHandle< EEDigiCollection > eeNoZsDigis_
double recE
energy reconstructed from unsuppressed digi
const EcalTrigTowerDetId & id() const
int dccId(const EcalScDetId &detId) const
MonitorElement * meEeRecE_
std::map< std::string, std::string > availableHistList_
const_iterator end() const
ESHandle< TrackerGeometry > geometry
bool isRuComplete_[nDccs_][nDccChs_]
int ruGraphX(const EcalScDetId &id) const
double phi
number of sim hits
void normalizeHists(double eventCount)
static const int nTtEta
Number of Trigger Towers along Eta.
MonitorElement * meEeNoZsRecVsSimE_
MonitorElement * meEbZsErrType1Cnt_
MonitorElement * meFixedPayload_
MonitorElement * meEbRecE_
MonitorElement * meEeRecEHitXtal_
int nDroppedFRO_
Counter of FRO-flagged RU dropped from data.
void setToken(edm::ConsumesCollector &collector)
void fill(MonitorElement *me, float x)
MonitorElement * meL1aRate_
int ruGraphY(const EcalScDetId &id) const
volatile std::atomic< bool > shutdown_flag false
void compareSrfColl(const edm::Event &event, T &srfFromData, T &computedSrf)
std::pair< int, int > dccCh(const DetId &xtalId) const
double frame2Energy(const EcalDataFrame &frame) const
double noZsRecE
sim hit energy sum
MonitorElement * meEbRecEHitXtal_
MonitorElement * meEbSimE_
std::ofstream srpAlgoErrorLog_
Output ascii file for unconsistency on SR flags.
static const int nEeY
EE crystal grid size along Y.
CollHandle< EBDigiCollection > ebDigis_
double getEbEventSize(double nReadXtals) const
Detector det() const
get the detector field from this detid
MonitorElement * meSRFlagsConsistency_
static const unsigned nDccs_
Total number of DCCs.
MonitorElement * meZs1Ru_
MonitorElement * meFullRoRu_
std::string srpAlgoErrorLogFileName_
~EcalSelectiveReadoutValidation()
Destructor.
MonitorElement * meHiTtf_
std::vector< bool > logErrForDccs_
static const int nEndcaps
number of endcaps
const EcalTrigTowerConstituentsMap * triggerTowerMap_
void analyzeTP(const edm::Event &event, const edm::EventSetup &es)
std::set< std::string > histList_
const EcalElectronicsMapping * elecMap_
CollHandle< RecHitCollection > ebRecHits_
int adc() const
get the ADC sample (12 bits)
bool eeRuActive_[nEndcaps][nEeX/scEdge][nEeY/scEdge]
bool gain12
eta crystal position
MonitorElement * meIncompleteFROCnt_
CollHandle< EBSrFlagCollection > ebComputedSrFlags_
MonitorElement * meEbEMean_
MonitorElement * bookProfile2D(const std::string &name, const std::string &title, int nbinx, double xmin, double xmax, int nbiny, double ymin, double ymax, const char *option="")