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) )
75 assert(!infile.fail());
77 if (
isUpgrade) { nTOTmodules=1856; }
else { nTOTmodules=1440; }
78 while(!infile.eof()&&nModsInFile<nTOTmodules) {
84 LogInfo (
"PixelDQM") <<
"SiPixelDigiSource::SiPixelDigiSource: Got DQM BackEnd interface"<<endl;
92 LogInfo (
"PixelDQM") <<
"SiPixelDigiSource::~SiPixelDigiSource: Destructor"<<endl;
97 LogInfo (
"PixelDQM") <<
" SiPixelDigiSource::beginJob - Initialisation ... " << std::endl;
103 LogInfo (
"PixelDQM") <<
"2DIM IS " <<
twoDimOn <<
" and set to high resolution? " <<
hiRes <<
"\n";
190 int nEventDigis = 0;
int nActiveModules = 0;
209 std::map<uint32_t,SiPixelDigiModule*>::iterator struct_iter;
213 int NzeroROCs[2] = {0,-672};
214 int NloEffROCs[2] = {0,-672};
216 int numberOfDigisMod = (*struct_iter).second->fill(*input,
226 if(numberOfDigisMod>0){
227 nEventDigis = nEventDigis + numberOfDigisMod;
240 for(
int i=0;
i!=nBPiXmodules; ++
i){
241 if((*struct_iter).first ==
I_detId[
i]){
243 int index1 = 0;
int index2 = 0;
262 if(panel==1){
if(module==1)
nDM1P1M1+=numberOfDigisMod;
263 else if(module==2)
nDM1P1M2+=numberOfDigisMod;
264 else if(module==3)
nDM1P1M3+=numberOfDigisMod;
265 else if(module==4)
nDM1P1M4+=numberOfDigisMod;}
266 else if(panel==2){
if(module==1)
nDM1P2M1+=numberOfDigisMod;
267 else if(module==2)
nDM1P2M2+=numberOfDigisMod;
268 else if(module==3)
nDM1P2M3+=numberOfDigisMod; }
269 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
272 if(panel==1){
if(module==1)
nDM2P1M1+=numberOfDigisMod;
273 else if(module==2)
nDM2P1M2+=numberOfDigisMod;
274 else if(module==3)
nDM2P1M3+=numberOfDigisMod;
275 else if(module==4)
nDM2P1M4+=numberOfDigisMod;}
276 else if(panel==2){
if(module==1)
nDM2P2M1+=numberOfDigisMod;
277 else if(module==2)
nDM2P2M2+=numberOfDigisMod;
278 else if(module==3)
nDM2P2M3+=numberOfDigisMod; }
279 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
284 if(panel==1){
if(module==1)
nDM1P1M1+=numberOfDigisMod;
285 else if(module==2)
nDM1P1M2+=numberOfDigisMod;
286 else if(module==3)
nDM1P1M3+=numberOfDigisMod;
287 else if(module==4)
nDM1P1M4+=numberOfDigisMod;}
288 else if(panel==2){
if(module==1)
nDM1P2M1+=numberOfDigisMod;
289 else if(module==2)
nDM1P2M2+=numberOfDigisMod;
290 else if(module==3)
nDM1P2M3+=numberOfDigisMod; }
291 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
294 if(panel==1){
if(module==1)
nDM2P1M1+=numberOfDigisMod;
295 else if(module==2)
nDM2P1M2+=numberOfDigisMod;
296 else if(module==3)
nDM2P1M3+=numberOfDigisMod;
297 else if(module==4)
nDM2P1M4+=numberOfDigisMod;}
298 else if(panel==2){
if(module==1)
nDM2P2M1+=numberOfDigisMod;
299 else if(module==2)
nDM2P2M2+=numberOfDigisMod;
300 else if(module==3)
nDM2P2M3+=numberOfDigisMod; }
301 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
306 if(panel==1){
if(module==1)
nDP1P1M1+=numberOfDigisMod;
307 else if(module==2)
nDP1P1M2+=numberOfDigisMod;
308 else if(module==3)
nDP1P1M3+=numberOfDigisMod;
309 else if(module==4)
nDP1P1M4+=numberOfDigisMod;}
310 else if(panel==2){
if(module==1)
nDP1P2M1+=numberOfDigisMod;
311 else if(module==2)
nDP1P2M2+=numberOfDigisMod;
312 else if(module==3)
nDP1P2M3+=numberOfDigisMod; }
313 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
316 if(panel==1){
if(module==1)
nDP2P1M1+=numberOfDigisMod;
317 else if(module==2)
nDP2P1M2+=numberOfDigisMod;
318 else if(module==3)
nDP2P1M3+=numberOfDigisMod;
319 else if(module==4)
nDP2P1M4+=numberOfDigisMod;}
320 else if(panel==2){
if(module==1)
nDP2P2M1+=numberOfDigisMod;
321 else if(module==2)
nDP2P2M2+=numberOfDigisMod;
322 else if(module==3)
nDP2P2M3+=numberOfDigisMod; }
323 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
328 if(panel==1){
if(module==1)
nDP1P1M1+=numberOfDigisMod;
329 else if(module==2)
nDP1P1M2+=numberOfDigisMod;
330 else if(module==3)
nDP1P1M3+=numberOfDigisMod;
331 else if(module==4)
nDP1P1M4+=numberOfDigisMod;}
332 else if(panel==2){
if(module==1)
nDP1P2M1+=numberOfDigisMod;
333 else if(module==2)
nDP1P2M2+=numberOfDigisMod;
334 else if(module==3)
nDP1P2M3+=numberOfDigisMod; }
335 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
338 if(panel==1){
if(module==1)
nDP2P1M1+=numberOfDigisMod;
339 else if(module==2)
nDP2P1M2+=numberOfDigisMod;
340 else if(module==3)
nDP2P1M3+=numberOfDigisMod;
341 else if(module==4)
nDP2P1M4+=numberOfDigisMod;}
342 else if(panel==2){
if(module==1)
nDP2P2M1+=numberOfDigisMod;
343 else if(module==2)
nDP2P2M2+=numberOfDigisMod;
344 else if(module==3)
nDP2P2M3+=numberOfDigisMod; }
345 if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
350 for(
int i=nBPiXmodules; i!=nTOTmodules; i++){
351 if((*struct_iter).first ==
I_detId[i]){
369 if(panel==1){
if(module==1)
nDM1P1M1+=numberOfDigisMod; }
370 else if(panel==2){
if(module==1)
nDM1P2M1+=numberOfDigisMod; }
371 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
374 if(panel==1){
if(module==1)
nDM2P1M1+=numberOfDigisMod; }
375 else if(panel==2){
if(module==1)
nDM2P2M1+=numberOfDigisMod; }
376 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
379 if(panel==1){
if(module==1)
nDM3P1M1+=numberOfDigisMod; }
380 else if(panel==2){
if(module==1)
nDM3P2M1+=numberOfDigisMod; }
381 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
386 if(panel==1){
if(module==1)
nDM1P1M1+=numberOfDigisMod; }
387 else if(panel==2){
if(module==1)
nDM1P2M1+=numberOfDigisMod; }
388 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
391 if(panel==1){
if(module==1)
nDM2P1M1+=numberOfDigisMod; }
392 else if(panel==2){
if(module==1)
nDM2P2M1+=numberOfDigisMod; }
393 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
396 if(panel==1){
if(module==1)
nDM3P1M1+=numberOfDigisMod; }
397 else if(panel==2){
if(module==1)
nDM3P2M1+=numberOfDigisMod; }
398 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
403 if(panel==1){
if(module==1)
nDP1P1M1+=numberOfDigisMod; }
404 else if(panel==2){
if(module==1)
nDP1P2M1+=numberOfDigisMod; }
405 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
408 if(panel==1){
if(module==1)
nDP2P1M1+=numberOfDigisMod; }
409 else if(panel==2){
if(module==1)
nDP2P2M1+=numberOfDigisMod; }
410 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
413 if(panel==1){
if(module==1)
nDP3P1M1+=numberOfDigisMod; }
414 else if(panel==2){
if(module==1)
nDP3P2M1+=numberOfDigisMod; }
415 if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
420 if(panel==1){
if(module==1)
nDP1P1M1+=numberOfDigisMod; }
421 else if(panel==2){
if(module==1)
nDP1P2M1+=numberOfDigisMod; }
422 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
425 if(panel==1){
if(module==1)
nDP2P1M1+=numberOfDigisMod; }
426 else if(panel==2){
if(module==1)
nDP2P2M1+=numberOfDigisMod; }
427 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
430 if(panel==1){
if(module==1)
nDP3P1M1+=numberOfDigisMod; }
431 else if(panel==2){
if(module==1)
nDP3P2M1+=numberOfDigisMod; }
432 if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
436 for(
int i=nBPiXmodules; i!=nTOTmodules; i++){
437 if((*struct_iter).first ==
I_detId[i]){
445 std::pair<int,int> tempPair = (*struct_iter).second->getZeroLoEffROCs();
447 NzeroROCs[0] += tempPair.first;
448 NloEffROCs[0] += tempPair.second;
451 NzeroROCs[1] += tempPair.first;
452 NloEffROCs[1] += tempPair.second;
457 if (lumiSection%10> 2){
458 for (
int i =0;
i < 2; ++
i) NloEffROCs[
i] = NloEffROCs[
i] - NzeroROCs[
i];
524 if(nActiveModules>=4){
532 for(
int i=0;
i!=32;
i++){
535 for(
int i=0;
i!=40;
i++){
536 float averageOcc = 0.;
538 float averageBPIXFed = float(
nBPIXDigis-maxfed)/31.;
539 if(averageBPIXFed>0.) averageOcc =
nDigisPerFed[
i]/averageBPIXFed;
542 if(averageFPIXFed>0.) averageOcc =
nDigisPerFed[
i]/averageFPIXFed;
545 int lumiSections8 = int(lumiSection/8);
564 LogInfo (
"PixelDQM") <<
" SiPixelDigiSource::buildStructure" ;
568 LogVerbatim (
"PixelDQM") <<
" *** Geometry node for TrackerGeom is "<<&(*pDD)<<std::endl;
569 LogVerbatim (
"PixelDQM") <<
" *** I have " << pDD->dets().size() <<
" detectors"<<std::endl;
570 LogVerbatim (
"PixelDQM") <<
" *** I have " << pDD->detTypes().size() <<
" types"<<std::endl;
572 for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){
574 if(dynamic_cast<PixelGeomDetUnit const *>((*it))!=0){
576 DetId detId = (*it)->geographicalId();
577 const GeomDetUnit * geoUnit = pDD->idToDetUnit( detId );
584 LogDebug (
"PixelDQM") <<
" ---> Adding Barrel Module " << detId.
rawId() << endl;
585 uint32_t
id = detId();
590 LogDebug (
"PixelDQM") <<
" ---> Adding Endcap Module " << detId.
rawId() << endl;
591 uint32_t
id = detId();
600 char sside[80]; sprintf(sside,
"HalfCylinder_%i",side);
601 char sdisk[80]; sprintf(sdisk,
"Disk_%i",disk);
602 char sblade[80]; sprintf(sblade,
"Blade_%02i",blade);
603 char spanel[80]; sprintf(spanel,
"Panel_%i",panel);
604 char smodule[80];sprintf(smodule,
"Module_%i",module);
607 bool mask = side_str.find(
"HalfCylinder_1")!=string::npos||
608 side_str.find(
"HalfCylinder_2")!=string::npos||
609 side_str.find(
"HalfCylinder_4")!=string::npos||
610 disk_str.find(
"Disk_2")!=string::npos;
613 if(
isPIB && mask)
continue;
617 LogDebug (
"PixelDQM") <<
" ---> Adding Endcap Module " << detId.
rawId() << endl;
618 uint32_t
id = detId();
627 char sside[80]; sprintf(sside,
"HalfCylinder_%i",side);
628 char sdisk[80]; sprintf(sdisk,
"Disk_%i",disk);
629 char sblade[80]; sprintf(sblade,
"Blade_%02i",blade);
630 char spanel[80]; sprintf(spanel,
"Panel_%i",panel);
631 char smodule[80];sprintf(smodule,
"Module_%i",module);
634 bool mask = side_str.find(
"HalfCylinder_1")!=string::npos||
635 side_str.find(
"HalfCylinder_2")!=string::npos||
636 side_str.find(
"HalfCylinder_4")!=string::npos||
637 disk_str.find(
"Disk_2")!=string::npos;
640 if(
isPIB && mask)
continue;
656 char title[80]; sprintf(title,
"Rate of events with >%i digis;LumiSection;Rate [Hz]",
bigEventSize);
658 char title1[80]; sprintf(title1,
"Pixel events vs. BX;BX;# events");
660 char title2[80]; sprintf(title2,
"Rate of Pixel events;LumiSection;Rate [Hz]");
662 char title3[80]; sprintf(title3,
"Number of Zero-Occupancy Barrel ROCs;LumiSection;N_{ZERO-OCCUPANCY} Barrel ROCs");
664 char title4[80]; sprintf(title4,
"Number of Low-Efficiency Barrel ROCs;LumiSection;N_{LO EFF} Barrel ROCs");
666 char title5[80]; sprintf(title5,
"Number of Zero-Occupancy Endcap ROCs;LumiSection;N_{ZERO-OCCUPANCY} Endcap ROCs");
668 char title6[80]; sprintf(title6,
"Number of Low-Efficiency Endcap ROCs;LumiSection;N_{LO EFF} Endcap ROCs");
670 char title7[80]; sprintf(title7,
"Average digi occupancy per FED;FED;NDigis/<NDigis>");
674 char title4[80]; sprintf(title4,
"FED Digi Occupancy (NDigis/<NDigis>) vs LumiSections;Lumi Section;FED");
677 std::map<uint32_t,SiPixelDigiModule*>::iterator struct_iter;
689 <<
"[SiPixelDigiSource::bookMEs] Creation of DQM folder failed";
696 LogDebug (
"PixelDQM") <<
"PROBLEM WITH LADDER-FOLDER\n";
704 LogDebug (
"PixelDQM") <<
"PROBLEM WITH LAYER-FOLDER\n";
712 LogDebug (
"PixelDQM") <<
"PROBLEM WITH PHI-FOLDER\n";
719 LogDebug (
"PixelDQM") <<
"PROBLEM WITH BLADE-FOLDER\n";
726 LogDebug (
"PixelDQM") <<
"PROBLEM WITH DISK-FOLDER\n";
733 LogDebug (
"PixelDQM") <<
"PROBLEM WITH RING-FOLDER\n";
737 iBooker.
cd(
"Pixel/Barrel");
827 iBooker.
cd(
"Pixel/Endcap");
int plaquetteName() const
plaquetteId (in pannel)
T getParameter(std::string const &) const
MonitorElement * meNDigisCHANBarrelCh19_
virtual void bookMEs(DQMStore::IBooker &)
MonitorElement * meNDigisCHANBarrelCh35_
MonitorElement * meNDigisCHANBarrelCh2_
MonitorElement * meNDigisCHANEndcapDm3_
MonitorElement * meNDigisCHANBarrelCh30_
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * meNDigisCHANEndcapDp1_
MonitorElement * meNDigisCHANBarrelCh31_
MonitorElement * meNDigisCHANBarrelCh8_
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
MonitorElement * meNDigisCHANBarrelL4_
MonitorElement * meNDigisCHANEndcapDm1_
edm::LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * meNDigisCOMBEndcap_
MonitorElement * meNDigisCHANBarrelCh14_
MonitorElement * meNDigisCHANBarrelCh12_
MonitorElement * meNDigisCHANBarrelL3_
MonitorElement * meNDigisCHANBarrelCh29_
int plaquetteName() const
plaquetteId (in pannel)
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
SiPixelDigiSource(const edm::ParameterSet &conf)
MonitorElement * meNDigisCHANEndcapDm2_
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_
int bladeName() const
blade id
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
int diskName() const
disk id
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_
MonitorElement * meNDigisCHANBarrelCh18_
MonitorElement * meNDigisCHANEndcapDp2_
MonitorElement * meNDigisCHANEndcapDp3_
MonitorElement * bigEventRate
MonitorElement * meNDigisCHANBarrelCh20_
MonitorElement * avgfedDigiOccvsLumi
int pannelName() const
pannel id
MonitorElement * meNDigisCHANBarrelCh22_
int diskName() const
disk id
MonitorElement * pixEvtsPerBX
volatile std::atomic< bool > shutdown_flag false
std::map< uint32_t, SiPixelDigiModule * > thePixelStructure
MonitorElement * meNDigisCHANBarrelL1_
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
HalfCylinder halfCylinder() const
MonitorElement * meNDigisCHANBarrelCh16_
HalfCylinder halfCylinder() const
MonitorElement * meNDigisCHANBarrelCh11_
int pannelName() const
pannel id
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
virtual void buildStructure(edm::EventSetup const &)
MonitorElement * meNDigisCHANBarrelL2_
MonitorElement * meNDigisCHANBarrelCh24_