49 src_( conf_.getParameter<edm::
InputTag>(
"src" ) ),
50 saveFile( conf_.getUntrackedParameter<bool>(
"saveFile",
false) ),
51 isPIB( conf_.getUntrackedParameter<bool>(
"isPIB",
false) ),
52 slowDown( conf_.getUntrackedParameter<bool>(
"slowDown",
false) ),
53 modOn( conf_.getUntrackedParameter<bool>(
"modOn",
true) ),
54 twoDimOn( conf_.getUntrackedParameter<bool>(
"twoDimOn",
true) ),
55 twoDimModOn( conf_.getUntrackedParameter<bool>(
"twoDimModOn",
true) ),
56 twoDimOnlyLayDisk( conf_.getUntrackedParameter<bool>(
"twoDimOnlyLayDisk",
false) ),
57 hiRes( conf_.getUntrackedParameter<bool>(
"hiRes",
false) ),
58 reducedSet( conf_.getUntrackedParameter<bool>(
"reducedSet",
false) ),
59 ladOn( conf_.getUntrackedParameter<bool>(
"ladOn",
false) ),
60 layOn( conf_.getUntrackedParameter<bool>(
"layOn",
false) ),
61 phiOn( conf_.getUntrackedParameter<bool>(
"phiOn",
false) ),
62 ringOn( conf_.getUntrackedParameter<bool>(
"ringOn",
false) ),
63 bladeOn( conf_.getUntrackedParameter<bool>(
"bladeOn",
false) ),
64 diskOn( conf_.getUntrackedParameter<bool>(
"diskOn",
false) ),
65 bigEventSize( conf_.getUntrackedParameter<int>(
"bigEventSize",1000) ),
66 isUpgrade( conf_.getUntrackedParameter<bool>(
"isUpgrade",
false) ),
81 if (
isUpgrade) { nTOTmodules=1856; }
else { nTOTmodules=1440; }
82 while(!infile.eof()&&nModsInFile<nTOTmodules) {
88 LogInfo (
"PixelDQM") <<
"SiPixelDigiSource::SiPixelDigiSource: Got DQM BackEnd interface"<<endl;
96 LogInfo (
"PixelDQM") <<
"SiPixelDigiSource::~SiPixelDigiSource: Destructor"<<endl;
131 for(
int i=0;
i!=40;
i++){
133 float averageOcc = 0.;
135 if(averageBPIXFed>0.) averageOcc =
nDigisPerFed[
i]/averageBPIXFed;
137 if(averageFPIXFed>0.) averageOcc =
nDigisPerFed[
i]/averageFPIXFed;
155 LogInfo (
"PixelDQM") <<
" SiPixelDigiSource::beginJob - Initialisation ... " << std::endl;
161 LogInfo (
"PixelDQM") <<
"2DIM IS " <<
twoDimOn <<
" and set to high resolution? " <<
hiRes <<
"\n";
252 int nEventDigis = 0;
int nActiveModules = 0;
254 std::map<uint32_t,SiPixelDigiModule*>::iterator struct_iter;
258 int NzeroROCs[2] = {0,-672};
259 int NloEffROCs[2] = {0,-672};
261 int numberOfDigisMod = (*struct_iter).second->fill(*input, iSetup,
272 if(numberOfDigisMod>0){
273 nEventDigis = nEventDigis + numberOfDigisMod;
286 for(
int i=0;
i!=nBPiXmodules; ++
i){
287 if((*struct_iter).first ==
I_detId[
i]){
289 int index1 = 0;
int index2 = 0;
308 if(panel==1){
if(module==1)
nDM1P1M1+=numberOfDigisMod;
309 else if(module==2)
nDM1P1M2+=numberOfDigisMod;
310 else if(module==3)
nDM1P1M3+=numberOfDigisMod;
311 else if(module==4)
nDM1P1M4+=numberOfDigisMod;}
312 else if(panel==2){
if(module==1)
nDM1P2M1+=numberOfDigisMod;
313 else if(module==2)
nDM1P2M2+=numberOfDigisMod;
314 else if(module==3)
nDM1P2M3+=numberOfDigisMod; }
315 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
318 if(panel==1){
if(module==1)
nDM2P1M1+=numberOfDigisMod;
319 else if(module==2)
nDM2P1M2+=numberOfDigisMod;
320 else if(module==3)
nDM2P1M3+=numberOfDigisMod;
321 else if(module==4)
nDM2P1M4+=numberOfDigisMod;}
322 else if(panel==2){
if(module==1)
nDM2P2M1+=numberOfDigisMod;
323 else if(module==2)
nDM2P2M2+=numberOfDigisMod;
324 else if(module==3)
nDM2P2M3+=numberOfDigisMod; }
325 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
330 if(panel==1){
if(module==1)
nDM1P1M1+=numberOfDigisMod;
331 else if(module==2)
nDM1P1M2+=numberOfDigisMod;
332 else if(module==3)
nDM1P1M3+=numberOfDigisMod;
333 else if(module==4)
nDM1P1M4+=numberOfDigisMod;}
334 else if(panel==2){
if(module==1)
nDM1P2M1+=numberOfDigisMod;
335 else if(module==2)
nDM1P2M2+=numberOfDigisMod;
336 else if(module==3)
nDM1P2M3+=numberOfDigisMod; }
337 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
340 if(panel==1){
if(module==1)
nDM2P1M1+=numberOfDigisMod;
341 else if(module==2)
nDM2P1M2+=numberOfDigisMod;
342 else if(module==3)
nDM2P1M3+=numberOfDigisMod;
343 else if(module==4)
nDM2P1M4+=numberOfDigisMod;}
344 else if(panel==2){
if(module==1)
nDM2P2M1+=numberOfDigisMod;
345 else if(module==2)
nDM2P2M2+=numberOfDigisMod;
346 else if(module==3)
nDM2P2M3+=numberOfDigisMod; }
347 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
352 if(panel==1){
if(module==1)
nDP1P1M1+=numberOfDigisMod;
353 else if(module==2)
nDP1P1M2+=numberOfDigisMod;
354 else if(module==3)
nDP1P1M3+=numberOfDigisMod;
355 else if(module==4)
nDP1P1M4+=numberOfDigisMod;}
356 else if(panel==2){
if(module==1)
nDP1P2M1+=numberOfDigisMod;
357 else if(module==2)
nDP1P2M2+=numberOfDigisMod;
358 else if(module==3)
nDP1P2M3+=numberOfDigisMod; }
359 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
362 if(panel==1){
if(module==1)
nDP2P1M1+=numberOfDigisMod;
363 else if(module==2)
nDP2P1M2+=numberOfDigisMod;
364 else if(module==3)
nDP2P1M3+=numberOfDigisMod;
365 else if(module==4)
nDP2P1M4+=numberOfDigisMod;}
366 else if(panel==2){
if(module==1)
nDP2P2M1+=numberOfDigisMod;
367 else if(module==2)
nDP2P2M2+=numberOfDigisMod;
368 else if(module==3)
nDP2P2M3+=numberOfDigisMod; }
369 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
374 if(panel==1){
if(module==1)
nDP1P1M1+=numberOfDigisMod;
375 else if(module==2)
nDP1P1M2+=numberOfDigisMod;
376 else if(module==3)
nDP1P1M3+=numberOfDigisMod;
377 else if(module==4)
nDP1P1M4+=numberOfDigisMod;}
378 else if(panel==2){
if(module==1)
nDP1P2M1+=numberOfDigisMod;
379 else if(module==2)
nDP1P2M2+=numberOfDigisMod;
380 else if(module==3)
nDP1P2M3+=numberOfDigisMod; }
381 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
384 if(panel==1){
if(module==1)
nDP2P1M1+=numberOfDigisMod;
385 else if(module==2)
nDP2P1M2+=numberOfDigisMod;
386 else if(module==3)
nDP2P1M3+=numberOfDigisMod;
387 else if(module==4)
nDP2P1M4+=numberOfDigisMod;}
388 else if(panel==2){
if(module==1)
nDP2P2M1+=numberOfDigisMod;
389 else if(module==2)
nDP2P2M2+=numberOfDigisMod;
390 else if(module==3)
nDP2P2M3+=numberOfDigisMod; }
391 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
396 for(
int i=nBPiXmodules; i!=nTOTmodules; i++){
397 if((*struct_iter).first ==
I_detId[i]){
415 if(panel==1){
if(module==1)
nDM1P1M1+=numberOfDigisMod; }
416 else if(panel==2){
if(module==1)
nDM1P2M1+=numberOfDigisMod; }
417 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
420 if(panel==1){
if(module==1)
nDM2P1M1+=numberOfDigisMod; }
421 else if(panel==2){
if(module==1)
nDM2P2M1+=numberOfDigisMod; }
422 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
425 if(panel==1){
if(module==1)
nDM3P1M1+=numberOfDigisMod; }
426 else if(panel==2){
if(module==1)
nDM3P2M1+=numberOfDigisMod; }
427 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
432 if(panel==1){
if(module==1)
nDM1P1M1+=numberOfDigisMod; }
433 else if(panel==2){
if(module==1)
nDM1P2M1+=numberOfDigisMod; }
434 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
437 if(panel==1){
if(module==1)
nDM2P1M1+=numberOfDigisMod; }
438 else if(panel==2){
if(module==1)
nDM2P2M1+=numberOfDigisMod; }
439 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
442 if(panel==1){
if(module==1)
nDM3P1M1+=numberOfDigisMod; }
443 else if(panel==2){
if(module==1)
nDM3P2M1+=numberOfDigisMod; }
444 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
449 if(panel==1){
if(module==1)
nDP1P1M1+=numberOfDigisMod; }
450 else if(panel==2){
if(module==1)
nDP1P2M1+=numberOfDigisMod; }
451 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
454 if(panel==1){
if(module==1)
nDP2P1M1+=numberOfDigisMod; }
455 else if(panel==2){
if(module==1)
nDP2P2M1+=numberOfDigisMod; }
456 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
459 if(panel==1){
if(module==1)
nDP3P1M1+=numberOfDigisMod; }
460 else if(panel==2){
if(module==1)
nDP3P2M1+=numberOfDigisMod; }
461 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
466 if(panel==1){
if(module==1)
nDP1P1M1+=numberOfDigisMod; }
467 else if(panel==2){
if(module==1)
nDP1P2M1+=numberOfDigisMod; }
468 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
471 if(panel==1){
if(module==1)
nDP2P1M1+=numberOfDigisMod; }
472 else if(panel==2){
if(module==1)
nDP2P2M1+=numberOfDigisMod; }
473 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
476 if(panel==1){
if(module==1)
nDP3P1M1+=numberOfDigisMod; }
477 else if(panel==2){
if(module==1)
nDP3P2M1+=numberOfDigisMod; }
478 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
482 for(
int i=nBPiXmodules; i!=nTOTmodules; i++){
483 if((*struct_iter).first ==
I_detId[i]){
492 std::pair<int,int> tempPair = (*struct_iter).second->getZeroLoEffROCs();
494 NzeroROCs[0] += tempPair.first;
495 NloEffROCs[0] += tempPair.second;
498 NzeroROCs[1] += tempPair.first;
499 NloEffROCs[1] += tempPair.second;
504 if (lumiSection%10> 2){
505 for (
int i =0;
i < 2; ++
i) NloEffROCs[
i] = NloEffROCs[
i] - NzeroROCs[
i];
572 if(nActiveModules>=4){
590 LogInfo (
"PixelDQM") <<
" SiPixelDigiSource::buildStructure" ;
594 LogVerbatim (
"PixelDQM") <<
" *** Geometry node for TrackerGeom is "<<&(*pDD)<<std::endl;
595 LogVerbatim (
"PixelDQM") <<
" *** I have " << pDD->dets().size() <<
" detectors"<<std::endl;
596 LogVerbatim (
"PixelDQM") <<
" *** I have " << pDD->detTypes().size() <<
" types"<<std::endl;
598 for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){
600 if(dynamic_cast<PixelGeomDetUnit const *>((*it))!=0){
602 DetId detId = (*it)->geographicalId();
603 const GeomDetUnit * geoUnit = pDD->idToDetUnit( detId );
610 LogDebug (
"PixelDQM") <<
" ---> Adding Barrel Module " << detId.
rawId() << endl;
611 uint32_t
id = detId();
618 LogDebug (
"PixelDQM") <<
" ---> Adding Endcap Module " << detId.
rawId() << endl;
619 uint32_t
id = detId();
629 char sside[80]; sprintf(sside,
"HalfCylinder_%i",side);
630 char sdisk[80]; sprintf(sdisk,
"Disk_%i",disk);
631 char sblade[80]; sprintf(sblade,
"Blade_%02i",blade);
632 char spanel[80]; sprintf(spanel,
"Panel_%i",panel);
633 char smodule[80];sprintf(smodule,
"Module_%i",module);
636 bool mask = side_str.find(
"HalfCylinder_1")!=string::npos||
637 side_str.find(
"HalfCylinder_2")!=string::npos||
638 side_str.find(
"HalfCylinder_4")!=string::npos||
639 disk_str.find(
"Disk_2")!=string::npos;
642 if(
isPIB && mask)
continue;
646 LogDebug (
"PixelDQM") <<
" ---> Adding Endcap Module " << detId.
rawId() << endl;
647 uint32_t
id = detId();
657 char sside[80]; sprintf(sside,
"HalfCylinder_%i",side);
658 char sdisk[80]; sprintf(sdisk,
"Disk_%i",disk);
659 char sblade[80]; sprintf(sblade,
"Blade_%02i",blade);
660 char spanel[80]; sprintf(spanel,
"Panel_%i",panel);
661 char smodule[80];sprintf(smodule,
"Module_%i",module);
664 bool mask = side_str.find(
"HalfCylinder_1")!=string::npos||
665 side_str.find(
"HalfCylinder_2")!=string::npos||
666 side_str.find(
"HalfCylinder_4")!=string::npos||
667 disk_str.find(
"Disk_2")!=string::npos;
670 if(
isPIB && mask)
continue;
686 char title[80]; sprintf(title,
"Rate of events with >%i digis;LumiSection;Rate [Hz]",
bigEventSize);
688 char title1[80]; sprintf(title1,
"Pixel events vs. BX;BX;# events");
690 char title2[80]; sprintf(title2,
"Rate of Pixel events;LumiSection;Rate [Hz]");
692 char title3[80]; sprintf(title3,
"Number of Zero-Occupancy Barrel ROCs;LumiSection;N_{ZERO-OCCUPANCY} Barrel ROCs");
694 char title4[80]; sprintf(title4,
"Number of Low-Efficiency Barrel ROCs;LumiSection;N_{LO EFF} Barrel ROCs");
696 char title5[80]; sprintf(title5,
"Number of Zero-Occupancy Endcap ROCs;LumiSection;N_{ZERO-OCCUPANCY} Endcap ROCs");
698 char title6[80]; sprintf(title6,
"Number of Low-Efficiency Endcap ROCs;LumiSection;N_{LO EFF} Endcap ROCs");
700 char title7[80]; sprintf(title7,
"Average digi occupancy per FED;FED;NDigis/<NDigis>");
704 char title4[80]; sprintf(title4,
"FED Digi Occupancy (NDigis/<NDigis>) vs LumiSections;Lumi Section;FED");
707 std::map<uint32_t,SiPixelDigiModule*>::iterator struct_iter;
719 <<
"[SiPixelDigiSource::bookMEs] Creation of DQM folder failed";
726 LogDebug (
"PixelDQM") <<
"PROBLEM WITH LADDER-FOLDER\n";
734 LogDebug (
"PixelDQM") <<
"PROBLEM WITH LAYER-FOLDER\n";
742 LogDebug (
"PixelDQM") <<
"PROBLEM WITH PHI-FOLDER\n";
749 LogDebug (
"PixelDQM") <<
"PROBLEM WITH BLADE-FOLDER\n";
756 LogDebug (
"PixelDQM") <<
"PROBLEM WITH DISK-FOLDER\n";
763 LogDebug (
"PixelDQM") <<
"PROBLEM WITH RING-FOLDER\n";
772 std::stringstream ss1, ss2;
775 ss1.str(
std::string()); ss1 <<
"ALLMODS_ndigisCHAN_BarrelL" <<
i;
776 ss2.str(
std::string()); ss2 <<
"Number of Digis L" <<
i;
859 ss1.str(
std::string()); ss1 <<
"ALLMODS_ndigisCHAN_EndcapDp" <<
i;
860 ss2.str(
std::string()); ss2 <<
"Number of Digis Disk p" <<
i;
866 ss1.str(
std::string()); ss1 <<
"ALLMODS_ndigisCHAN_EndcapDm" <<
i;
867 ss2.str(
std::string()); ss2 <<
"Number of Digis Disk m" <<
i;
int plaquetteName() const
plaquetteId (in pannel)
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
#define DEFINE_FWK_MODULE(type)
MonitorElement * loOccROCsEndcap
MonitorElement * meNDigisCHANBarrelCh17_
MonitorElement * meNDigisCHANBarrelCh25_
MonitorElement * meNDigisCHANBarrelCh6_
MonitorElement * meNDigisCOMBBarrel_
int bunchCrossing() const
std::string topFolderName_
edm::LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * meNDigisCOMBEndcap_
MonitorElement * meNDigisCHANBarrelCh14_
MonitorElement * meNDigisCHANBarrelCh12_
MonitorElement * meNDigisCHANBarrelCh29_
static std::string const input
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > srcToken_
uint32_t rawId() const
get the raw id
MonitorElement * meNDigisCHANBarrelCh27_
int bladeName() const
blade id
virtual void bookMEs(DQMStore::IBooker &, const edm::EventSetup &iSetup)
SiPixelDigiSource(const edm::ParameterSet &conf)
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
MonitorElement * meNDigisCHANEndcap_
MonitorElement * book1D(Args &&...args)
MonitorElement * meNDigisCHANBarrelCh28_
MonitorElement * noOccROCsEndcap
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * meNDigisCHANBarrel_
std::vector< MonitorElement * > meNDigisCHANEndcapDms_
virtual void dqmBeginRun(const edm::Run &, edm::EventSetup const &)
MonitorElement * meNDigisCHANBarrelCh33_
MonitorElement * pixEventRate
MonitorElement * meNDigisCHANBarrelCh21_
unsigned int I_detId[1856]
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
MonitorElement * meNDigisCHANBarrelCh32_
MonitorElement * meNDigisCHANBarrelCh10_
MonitorElement * loOccROCsBarrel
MonitorElement * meNDigisCHANBarrelCh1_
MonitorElement * averageDigiOccupancy
void setCurrentFolder(const std::string &fullpath)
MonitorElement * meNDigisCHANBarrelCh5_
MonitorElement * book2D(Args &&...args)
virtual 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
T const * product() const
MonitorElement * meNDigisCHANBarrelCh18_
MonitorElement * bigEventRate
virtual 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
std::vector< MonitorElement * > meNDigisCHANEndcapDps_
MonitorElement * pixEvtsPerBX
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
volatile std::atomic< bool > shutdown_flag false
std::vector< MonitorElement * > meNDigisCHANBarrelLs_
std::map< uint32_t, SiPixelDigiModule * > thePixelStructure
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
HalfCylinder halfCylinder() const
MonitorElement * meNDigisCHANBarrelCh16_
MonitorElement * meNDigisCHANBarrelCh11_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
virtual void buildStructure(edm::EventSetup const &)
MonitorElement * meNDigisCHANBarrelCh24_