52 saveFile( conf_.getUntrackedParameter<
bool>(
"saveFile",
false) ),
53 isPIB( conf_.getUntrackedParameter<
bool>(
"isPIB",
false) ),
54 slowDown( conf_.getUntrackedParameter<
bool>(
"slowDown",
false) ),
55 modOn( conf_.getUntrackedParameter<
bool>(
"modOn",
true) ),
56 twoDimOn( conf_.getUntrackedParameter<
bool>(
"twoDimOn",
true) ),
57 twoDimModOn( conf_.getUntrackedParameter<
bool>(
"twoDimModOn",
true) ),
58 twoDimOnlyLayDisk( conf_.getUntrackedParameter<
bool>(
"twoDimOnlyLayDisk",
false) ),
59 hiRes( conf_.getUntrackedParameter<
bool>(
"hiRes",
false) ),
60 reducedSet( conf_.getUntrackedParameter<
bool>(
"reducedSet",
false) ),
61 ladOn( conf_.getUntrackedParameter<
bool>(
"ladOn",
false) ),
62 layOn( conf_.getUntrackedParameter<
bool>(
"layOn",
false) ),
63 phiOn( conf_.getUntrackedParameter<
bool>(
"phiOn",
false) ),
64 ringOn( conf_.getUntrackedParameter<
bool>(
"ringOn",
false) ),
65 bladeOn( conf_.getUntrackedParameter<
bool>(
"bladeOn",
false) ),
66 diskOn( conf_.getUntrackedParameter<
bool>(
"diskOn",
false) ),
67 bigEventSize( conf_.getUntrackedParameter<
int>(
"bigEventSize",1000) ),
68 isUpgrade( conf_.getUntrackedParameter<
bool>(
"isUpgrade",
false) ),
81 assert(!infile.fail());
83 if (
isUpgrade) { nTOTmodules=1856; }
else { nTOTmodules=1440; }
84 while(!infile.eof()&&nModsInFile<nTOTmodules) {
90 LogInfo (
"PixelDQM") <<
"SiPixelDigiSource::SiPixelDigiSource: Got DQM BackEnd interface"<<endl;
98 LogInfo (
"PixelDQM") <<
"SiPixelDigiSource::~SiPixelDigiSource: Destructor"<<endl;
120 if (
modOn && thisls % 10 == 0) {
172 for(
int i=0;
i!=40;
i++){
174 float averageOcc = 0.;
176 if(averageBPIXFed>0.) averageOcc =
nDigisPerFed[
i]/averageBPIXFed;
178 if(averageFPIXFed>0.) averageOcc =
nDigisPerFed[
i]/averageFPIXFed;
185 if (thisls % 10 == 0)
192 if(
modOn && thisls % 10 == 0) {
202 LogInfo (
"PixelDQM") <<
" SiPixelDigiSource::beginJob - Initialisation ... " << std::endl;
207 LogInfo (
"PixelDQM") <<
"2DIM IS " <<
twoDimOn <<
" and set to high resolution? " <<
hiRes <<
"\n";
326 int nEventDigis = 0;
int nActiveModules = 0;
328 std::map<uint32_t,SiPixelDigiModule*>::iterator struct_iter;
335 int numberOfDigisMod = (*struct_iter).second->fill(*input, iSetup,
346 if(numberOfDigisMod>0){
347 nEventDigis = nEventDigis + numberOfDigisMod;
382 for(
int i=0;
i!=nBPiXmodules; ++
i){
383 if((*struct_iter).first ==
I_detId[
i]){
385 int index1 = 0;
int index2 = 0;
420 if(panel==1){
if(module==1)
nDM1P1M1+=numberOfDigisMod;
421 else if(module==2)
nDM1P1M2+=numberOfDigisMod;
422 else if(module==3)
nDM1P1M3+=numberOfDigisMod;
423 else if(module==4)
nDM1P1M4+=numberOfDigisMod;}
424 else if(panel==2){
if(module==1)
nDM1P2M1+=numberOfDigisMod;
425 else if(module==2)
nDM1P2M2+=numberOfDigisMod;
426 else if(module==3)
nDM1P2M3+=numberOfDigisMod; }
427 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
430 if(panel==1){
if(module==1)
nDM2P1M1+=numberOfDigisMod;
431 else if(module==2)
nDM2P1M2+=numberOfDigisMod;
432 else if(module==3)
nDM2P1M3+=numberOfDigisMod;
433 else if(module==4)
nDM2P1M4+=numberOfDigisMod;}
434 else if(panel==2){
if(module==1)
nDM2P2M1+=numberOfDigisMod;
435 else if(module==2)
nDM2P2M2+=numberOfDigisMod;
436 else if(module==3)
nDM2P2M3+=numberOfDigisMod; }
437 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
442 if(panel==1){
if(module==1)
nDM1P1M1+=numberOfDigisMod;
443 else if(module==2)
nDM1P1M2+=numberOfDigisMod;
444 else if(module==3)
nDM1P1M3+=numberOfDigisMod;
445 else if(module==4)
nDM1P1M4+=numberOfDigisMod;}
446 else if(panel==2){
if(module==1)
nDM1P2M1+=numberOfDigisMod;
447 else if(module==2)
nDM1P2M2+=numberOfDigisMod;
448 else if(module==3)
nDM1P2M3+=numberOfDigisMod; }
449 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
452 if(panel==1){
if(module==1)
nDM2P1M1+=numberOfDigisMod;
453 else if(module==2)
nDM2P1M2+=numberOfDigisMod;
454 else if(module==3)
nDM2P1M3+=numberOfDigisMod;
455 else if(module==4)
nDM2P1M4+=numberOfDigisMod;}
456 else if(panel==2){
if(module==1)
nDM2P2M1+=numberOfDigisMod;
457 else if(module==2)
nDM2P2M2+=numberOfDigisMod;
458 else if(module==3)
nDM2P2M3+=numberOfDigisMod; }
459 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
464 if(panel==1){
if(module==1)
nDP1P1M1+=numberOfDigisMod;
465 else if(module==2)
nDP1P1M2+=numberOfDigisMod;
466 else if(module==3)
nDP1P1M3+=numberOfDigisMod;
467 else if(module==4)
nDP1P1M4+=numberOfDigisMod;}
468 else if(panel==2){
if(module==1)
nDP1P2M1+=numberOfDigisMod;
469 else if(module==2)
nDP1P2M2+=numberOfDigisMod;
470 else if(module==3)
nDP1P2M3+=numberOfDigisMod; }
471 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
474 if(panel==1){
if(module==1)
nDP2P1M1+=numberOfDigisMod;
475 else if(module==2)
nDP2P1M2+=numberOfDigisMod;
476 else if(module==3)
nDP2P1M3+=numberOfDigisMod;
477 else if(module==4)
nDP2P1M4+=numberOfDigisMod;}
478 else if(panel==2){
if(module==1)
nDP2P2M1+=numberOfDigisMod;
479 else if(module==2)
nDP2P2M2+=numberOfDigisMod;
480 else if(module==3)
nDP2P2M3+=numberOfDigisMod; }
481 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
486 if(panel==1){
if(module==1)
nDP1P1M1+=numberOfDigisMod;
487 else if(module==2)
nDP1P1M2+=numberOfDigisMod;
488 else if(module==3)
nDP1P1M3+=numberOfDigisMod;
489 else if(module==4)
nDP1P1M4+=numberOfDigisMod;}
490 else if(panel==2){
if(module==1)
nDP1P2M1+=numberOfDigisMod;
491 else if(module==2)
nDP1P2M2+=numberOfDigisMod;
492 else if(module==3)
nDP1P2M3+=numberOfDigisMod; }
493 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
496 if(panel==1){
if(module==1)
nDP2P1M1+=numberOfDigisMod;
497 else if(module==2)
nDP2P1M2+=numberOfDigisMod;
498 else if(module==3)
nDP2P1M3+=numberOfDigisMod;
499 else if(module==4)
nDP2P1M4+=numberOfDigisMod;}
500 else if(panel==2){
if(module==1)
nDP2P2M1+=numberOfDigisMod;
501 else if(module==2)
nDP2P2M2+=numberOfDigisMod;
502 else if(module==3)
nDP2P2M3+=numberOfDigisMod; }
503 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
508 for(
int i=nBPiXmodules; i!=nTOTmodules; i++){
509 if((*struct_iter).first ==
I_detId[i]){
527 if(panel==1){
if(module==1)
nDM1P1M1+=numberOfDigisMod; }
528 else if(panel==2){
if(module==1)
nDM1P2M1+=numberOfDigisMod; }
529 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
532 if(panel==1){
if(module==1)
nDM2P1M1+=numberOfDigisMod; }
533 else if(panel==2){
if(module==1)
nDM2P2M1+=numberOfDigisMod; }
534 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
537 if(panel==1){
if(module==1)
nDM3P1M1+=numberOfDigisMod; }
538 else if(panel==2){
if(module==1)
nDM3P2M1+=numberOfDigisMod; }
539 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
544 if(panel==1){
if(module==1)
nDM1P1M1+=numberOfDigisMod; }
545 else if(panel==2){
if(module==1)
nDM1P2M1+=numberOfDigisMod; }
546 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
549 if(panel==1){
if(module==1)
nDM2P1M1+=numberOfDigisMod; }
550 else if(panel==2){
if(module==1)
nDM2P2M1+=numberOfDigisMod; }
551 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
554 if(panel==1){
if(module==1)
nDM3P1M1+=numberOfDigisMod; }
555 else if(panel==2){
if(module==1)
nDM3P2M1+=numberOfDigisMod; }
556 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
561 if(panel==1){
if(module==1)
nDP1P1M1+=numberOfDigisMod; }
562 else if(panel==2){
if(module==1)
nDP1P2M1+=numberOfDigisMod; }
563 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
566 if(panel==1){
if(module==1)
nDP2P1M1+=numberOfDigisMod; }
567 else if(panel==2){
if(module==1)
nDP2P2M1+=numberOfDigisMod; }
568 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
571 if(panel==1){
if(module==1)
nDP3P1M1+=numberOfDigisMod; }
572 else if(panel==2){
if(module==1)
nDP3P2M1+=numberOfDigisMod; }
573 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
578 if(panel==1){
if(module==1)
nDP1P1M1+=numberOfDigisMod; }
579 else if(panel==2){
if(module==1)
nDP1P2M1+=numberOfDigisMod; }
580 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
583 if(panel==1){
if(module==1)
nDP2P1M1+=numberOfDigisMod; }
584 else if(panel==2){
if(module==1)
nDP2P2M1+=numberOfDigisMod; }
585 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
588 if(panel==1){
if(module==1)
nDP3P1M1+=numberOfDigisMod; }
589 else if(panel==2){
if(module==1)
nDP3P2M1+=numberOfDigisMod; }
590 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
594 for(
int i=nBPiXmodules; i!=nTOTmodules; i++){
595 if((*struct_iter).first ==
I_detId[i]){
675 if(nActiveModules>=4){
693 LogInfo (
"PixelDQM") <<
" SiPixelDigiSource::buildStructure" ;
697 LogVerbatim (
"PixelDQM") <<
" *** Geometry node for TrackerGeom is "<<&(*pDD)<<std::endl;
698 LogVerbatim (
"PixelDQM") <<
" *** I have " << pDD->
dets().size() <<
" detectors"<<std::endl;
699 LogVerbatim (
"PixelDQM") <<
" *** I have " << pDD->
detTypes().size() <<
" types"<<std::endl;
701 for(TrackerGeometry::DetContainer::const_iterator it = pDD->
dets().begin(); it != pDD->
dets().end(); it++){
703 if(dynamic_cast<PixelGeomDetUnit const *>((*it))!=
nullptr){
705 DetId detId = (*it)->geographicalId();
713 LogDebug (
"PixelDQM") <<
" ---> Adding Barrel Module " << detId.
rawId() << endl;
714 uint32_t
id = detId();
721 LogDebug (
"PixelDQM") <<
" ---> Adding Endcap Module " << detId.
rawId() << endl;
722 uint32_t
id = detId();
732 char sside[80]; sprintf(sside,
"HalfCylinder_%i",side);
733 char sdisk[80]; sprintf(sdisk,
"Disk_%i",disk);
734 char sblade[80]; sprintf(sblade,
"Blade_%02i",blade);
735 char spanel[80]; sprintf(spanel,
"Panel_%i",panel);
736 char smodule[80];sprintf(smodule,
"Module_%i",module);
739 bool mask = side_str.find(
"HalfCylinder_1")!=string::npos||
740 side_str.find(
"HalfCylinder_2")!=string::npos||
741 side_str.find(
"HalfCylinder_4")!=string::npos||
742 disk_str.find(
"Disk_2")!=string::npos;
745 if(
isPIB && mask)
continue;
749 LogDebug (
"PixelDQM") <<
" ---> Adding Endcap Module " << detId.
rawId() << endl;
750 uint32_t
id = detId();
760 char sside[80]; sprintf(sside,
"HalfCylinder_%i",side);
761 char sdisk[80]; sprintf(sdisk,
"Disk_%i",disk);
762 char sblade[80]; sprintf(sblade,
"Blade_%02i",blade);
763 char spanel[80]; sprintf(spanel,
"Panel_%i",panel);
764 char smodule[80];sprintf(smodule,
"Module_%i",module);
767 bool mask = side_str.find(
"HalfCylinder_1")!=string::npos||
768 side_str.find(
"HalfCylinder_2")!=string::npos||
769 side_str.find(
"HalfCylinder_4")!=string::npos||
770 disk_str.find(
"Disk_2")!=string::npos;
773 if(
isPIB && mask)
continue;
789 char title[80]; sprintf(title,
"Rate of events with >%i digis;LumiSection;Rate [Hz]",
bigEventSize);
791 char title1[80]; sprintf(title1,
"Pixel events vs. BX;BX;# events");
793 char title2[80]; sprintf(title2,
"Rate of Pixel events;LumiSection;Rate [Hz]");
795 char title3[80]; sprintf(title3,
"Number of Zero-Occupancy Barrel ROCs;LumiSection;N_{ZERO-OCCUPANCY} Barrel ROCs");
797 char title4[80]; sprintf(title4,
"Number of Low-Efficiency Barrel ROCs;LumiSection;N_{LO EFF} Barrel ROCs");
799 char title5[80]; sprintf(title5,
"Number of Zero-Occupancy Endcap ROCs;LumiSection;N_{ZERO-OCCUPANCY} Endcap ROCs");
801 char title6[80]; sprintf(title6,
"Number of Low-Efficiency Endcap ROCs;LumiSection;N_{LO EFF} Endcap ROCs");
803 char title7[80]; sprintf(title7,
"Average digi occupancy per FED;FED;NDigis/<NDigis>");
804 char title8[80]; sprintf(title8,
"FED Digi Occupancy (NDigis/<NDigis>) vs LumiSections;Lumi Section;FED");
810 "Average Barrel FED digi occupancy (<NDigis>) vs LumiSections;Lumi Section;Average digi occupancy per FED", 320,0., 3200.);
812 "Average Endcap FED digi occupancy (<NDigis>) vs LumiSections;Lumi Section;Average digi occupancy per FED", 320,0., 3200.);
818 std::map<uint32_t,SiPixelDigiModule*>::iterator struct_iter;
830 <<
"[SiPixelDigiSource::bookMEs] Creation of DQM folder failed";
837 LogDebug (
"PixelDQM") <<
"PROBLEM WITH LADDER-FOLDER\n";
845 LogDebug (
"PixelDQM") <<
"PROBLEM WITH LAYER-FOLDER\n";
853 LogDebug (
"PixelDQM") <<
"PROBLEM WITH PHI-FOLDER\n";
860 LogDebug (
"PixelDQM") <<
"PROBLEM WITH BLADE-FOLDER\n";
867 LogDebug (
"PixelDQM") <<
"PROBLEM WITH DISK-FOLDER\n";
874 LogDebug (
"PixelDQM") <<
"PROBLEM WITH RING-FOLDER\n";
883 std::stringstream ss1, ss2;
886 ss1.str(
std::string()); ss1 <<
"ALLMODS_ndigisCHAN_BarrelL" <<
i;
887 ss2.str(
std::string()); ss2 <<
"Number of Digis L" <<
i;
970 ss1.str(
std::string()); ss1 <<
"ALLMODS_ndigisCHAN_EndcapDp" <<
i;
971 ss2.str(
std::string()); ss2 <<
"Number of Digis Disk p" <<
i;
977 ss1.str(
std::string()); ss1 <<
"ALLMODS_ndigisCHAN_EndcapDm" <<
i;
978 ss2.str(
std::string()); ss2 <<
"Number of Digis Disk m" <<
i;
int plaquetteName() const
plaquetteId (in pannel)
LuminosityBlockID id() const
T getParameter(std::string const &) const
MonitorElement * meNDigisCHANBarrelCh19_
MonitorElement * meNDigisCHANBarrelCh35_
MonitorElement * meNDigisCHANBarrelCh2_
MonitorElement * meNDigisCHANBarrelCh30_
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * meNDigisCHANBarrelCh31_
MonitorElement * meNDigisCHANBarrelCh8_
MonitorElement * bookProfile(Args &&...args)
MonitorElement * meNDigisCHANBarrelCh36_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * loOccROCsEndcap
MonitorElement * meNDigisCHANBarrelCh17_
MonitorElement * meNDigisCHANBarrelCh25_
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
MonitorElement * meNDigisCHANBarrelCh6_
MonitorElement * meNDigisCOMBBarrel_
constexpr uint32_t rawId() const
get the raw id
int bunchCrossing() const
std::string topFolderName_
edm::LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * meNDigisCOMBEndcap_
std::pair< int, int > getZeroLoEffROCs()
MonitorElement * meNDigisCHANBarrelCh14_
MonitorElement * meNDigisCHANBarrelCh12_
MonitorElement * meNDigisCHANBarrelCh29_
static std::string const input
MonitorElement * avgBarrelFedOccvsLumi
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > srcToken_
MonitorElement * meNDigisCHANBarrelCh27_
int bladeName() const
blade id
virtual void bookMEs(DQMStore::IBooker &, const edm::EventSetup &iSetup)
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
SiPixelDigiSource(const edm::ParameterSet &conf)
#define DEFINE_FWK_MODULE(type)
void setLumiFlag()
this ME is meant to be stored for each luminosity section
void setCurrentFolder(std::string const &fullpath)
MonitorElement * meNDigisCHANBarrelCh3_
MonitorElement * meNDigisCHANBarrelCh9_
MonitorElement * meNDigisCHANBarrelCh4_
MonitorElement * meNDigisCHANBarrelCh34_
MonitorElement * meNDigisCHANBarrelCh26_
bool setModuleFolder(const uint32_t &rawdetid=0, int type=0, bool isUpgrade=false)
Set folder name for a module or plaquette.
MonitorElement * noOccROCsBarrel
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * meNDigisCHANEndcap_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
MonitorElement * book1D(Args &&...args)
void dqmBeginRun(const edm::Run &, edm::EventSetup const &) override
MonitorElement * meNDigisCHANBarrelCh28_
~SiPixelDigiSource() override
MonitorElement * noOccROCsEndcap
MonitorElement * meNDigisCHANBarrel_
std::vector< MonitorElement * > meNDigisCHANEndcapDms_
MonitorElement * meNDigisCHANBarrelCh33_
MonitorElement * pixEventRate
MonitorElement * meNDigisCHANBarrelCh21_
unsigned int I_detId[1856]
MonitorElement * meNDigisCHANBarrelCh32_
MonitorElement * meNDigisCHANBarrelCh10_
MonitorElement * loOccROCsBarrel
MonitorElement * meNDigisCHANBarrelCh1_
MonitorElement * averageDigiOccupancy
MonitorElement * meNDigisCHANBarrelCh5_
MonitorElement * book2D(Args &&...args)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * meNDigisCHANBarrelCh7_
MonitorElement * meNDigisCHANBarrelCh15_
MonitorElement * meNDigisCHANBarrelCh13_
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
MonitorElement * meNDigisCHANBarrelCh23_
int layerName() const
layer id
LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * meNDigisCHANBarrelCh18_
MonitorElement * bigEventRate
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
MonitorElement * meNDigisCHANBarrelCh20_
MonitorElement * avgfedDigiOccvsLumi
int pannelName() const
pannel id
MonitorElement * meNDigisCHANBarrelCh22_
int diskName() const
disk id
MonitorElement * avgEndcapFedOccvsLumi
std::vector< MonitorElement * > meNDigisCHANEndcapDps_
MonitorElement * pixEvtsPerBX
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
std::vector< MonitorElement * > meNDigisCHANBarrelLs_
std::map< uint32_t, SiPixelDigiModule * > thePixelStructure
HalfCylinder halfCylinder() const
MonitorElement * meNDigisCHANBarrelCh16_
MonitorElement * meNDigisCHANBarrelCh11_
T mod(const T &a, const T &b)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const
virtual void CountZeroROCsInSubstructure(bool, bool &, SiPixelDigiModule *)
virtual void buildStructure(edm::EventSetup const &)
MonitorElement * meNDigisCHANBarrelCh24_