89 while (!
infile.eof() && nModsInFile < nTOTmodules) {
96 LogInfo(
"PixelDQM") <<
"SiPixelDigiSource::SiPixelDigiSource: Got DQM BackEnd interface" << endl;
102 LogInfo(
"PixelDQM") <<
"SiPixelDigiSource::~SiPixelDigiSource: Destructor" << endl;
108 bool resetCounters = (
currentLS % 10 == 0) ?
true :
false;
109 return std::make_shared<bool>(resetCounters);
114 const bool resetCounters = luminosityBlockCache(lb.
index());
120 for (
int i = 0;
i != 40;
i++) {
121 float averageOcc = 0.;
123 if (averageBPIXFed > 0.)
126 if (averageFPIXFed > 0.)
136 if (thisls % 10 == 0)
149 if (
modOn && thisls % 10 == 0) {
151 int(thisls / 10), averageBPIXFed);
153 int(thisls / 10), averageFPIXFed);
162 for (
int i = 0;
i != 40;
i++)
169 for (
int i = 0;
i != 40;
i++)
173 if (
modOn && resetCounters) {
176 for (
int i = 0;
i < 2;
i++)
178 for (
int i = 0;
i < 2;
i++)
217 LogInfo(
"PixelDQM") <<
" SiPixelDigiSource::beginJob - Initialisation ... " << std::endl;
220 LogInfo(
"PixelDQM") <<
"2DIM IS " <<
twoDimOn <<
" and set to high resolution? " <<
hiRes <<
"\n";
226 for (
int i = 0;
i != 40;
i++)
228 for (
int i = 0;
i != 4;
i++)
309 for (
int i = 0;
i < 2;
i++)
311 for (
int i = 0;
i < 2;
i++)
335 if (!
input.isValid())
340 int lumiSection = (
int)
iEvent.luminosityBlock();
342 int nActiveModules = 0;
344 std::map<uint32_t, SiPixelDigiModule*>::iterator struct_iter;
345 for (
int i = 0;
i != 192;
i++)
347 for (
int i = 0;
i != 1152;
i++)
349 for (
int i = 0;
i != 4;
i++)
353 int numberOfDigisMod = (*struct_iter)
354 .second->fill(*
input,
378 if (numberOfDigisMod > 0) {
379 nEventDigis = nEventDigis + numberOfDigisMod;
426 for (
int i = 0;
i != nBPiXmodules; ++
i) {
427 if ((*struct_iter).first ==
I_detId[
i]) {
439 i = (nBPiXmodules - 1);
488 }
else if (panel == 2) {
496 if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
497 iter =
i + 2 * (blade - 1) + (panel - 1);
498 }
else if (disk == 2) {
509 }
else if (panel == 2) {
517 if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
518 iter =
i + 2 * (blade - 1) + (panel - 1);
532 }
else if (panel == 2) {
540 if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
541 iter =
i + 2 * (blade - 1) + (panel - 1);
542 }
else if (disk == 2) {
553 }
else if (panel == 2) {
561 if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
562 iter =
i + 2 * (blade - 1) + (panel - 1);
576 }
else if (panel == 2) {
584 if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
585 iter =
i + 2 * (blade - 1) + (panel - 1);
586 }
else if (disk == 2) {
597 }
else if (panel == 2) {
605 if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
606 iter =
i + 2 * (blade - 1) + (panel - 1);
620 }
else if (panel == 2) {
628 if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
629 iter =
i + 2 * (blade - 1) + (panel - 1);
630 }
else if (disk == 2) {
641 }
else if (panel == 2) {
649 if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
650 iter =
i + 2 * (blade - 1) + (panel - 1);
655 for (
int i = nBPiXmodules;
i != nTOTmodules;
i++) {
656 if ((*struct_iter).first ==
I_detId[
i]) {
679 }
else if (panel == 2) {
683 if (blade < 12 && blade > 0 && (panel == 1 || panel == 2))
684 iter =
i + 2 * (blade - 1) + (panel - 1);
685 }
else if (disk == 2) {
690 }
else if (panel == 2) {
694 if (blade < 12 && blade > 0 && (panel == 1 || panel == 2))
695 iter =
i + 2 * (blade - 1) + (panel - 1);
696 }
else if (disk == 3) {
701 }
else if (panel == 2) {
705 if (blade < 12 && blade > 0 && (panel == 1 || panel == 2))
706 iter =
i + 2 * (blade - 1) + (panel - 1);
714 }
else if (panel == 2) {
718 if (blade < 18 && blade > 0 && (panel == 1 || panel == 2))
719 iter =
i + 2 * (blade - 1) + (panel - 1);
720 }
else if (disk == 2) {
725 }
else if (panel == 2) {
729 if (blade < 18 && blade > 0 && (panel == 1 || panel == 2))
730 iter =
i + 2 * (blade - 1) + (panel - 1);
731 }
else if (disk == 3) {
736 }
else if (panel == 2) {
740 if (blade < 18 && blade > 0 && (panel == 1 || panel == 2))
741 iter =
i + 2 * (blade - 1) + (panel - 1);
749 }
else if (panel == 2) {
753 if (blade < 12 && blade > 0 && (panel == 1 || panel == 2))
754 iter =
i + 2 * (blade - 1) + (panel - 1);
755 }
else if (disk == 2) {
760 }
else if (panel == 2) {
764 if (blade < 12 && blade > 0 && (panel == 1 || panel == 2))
765 iter =
i + 2 * (blade - 1) + (panel - 1);
766 }
else if (disk == 3) {
771 }
else if (panel == 2) {
775 if (blade < 12 && blade > 0 && (panel == 1 || panel == 2))
776 iter =
i + 2 * (blade - 1) + (panel - 1);
784 }
else if (panel == 2) {
788 if (blade < 18 && blade > 0 && (panel == 1 || panel == 2))
789 iter =
i + 2 * (blade - 1) + (panel - 1);
790 }
else if (disk == 2) {
795 }
else if (panel == 2) {
799 if (blade < 18 && blade > 0 && (panel == 1 || panel == 2))
800 iter =
i + 2 * (blade - 1) + (panel - 1);
801 }
else if (disk == 3) {
806 }
else if (panel == 2) {
810 if (blade < 18 && blade > 0 && (panel == 1 || panel == 2))
811 iter =
i + 2 * (blade - 1) + (panel - 1);
815 for (
int i = nBPiXmodules;
i != nTOTmodules;
i++) {
816 if ((*struct_iter).first ==
I_detId[
i]) {
826 for (
int i = 0;
i < 2; ++
i)
842 for (
int j = 0;
j != 192;
j++)
847 for (
int j = 0;
j != 72;
j++)
852 for (
int j = 24;
j != 96;
j++)
857 for (
int j = 96;
j != 168;
j++)
862 for (
int j = 120;
j != 192;
j++)
868 for (
int j = 0;
j != 336;
j++)
873 for (
int j = 0;
j != 100;
j++)
878 for (
int j = 22;
j != 134;
j++)
883 for (
int j = 44;
j != 168;
j++)
888 for (
int j = 168;
j != 268;
j++)
893 for (
int j = 190;
j != 302;
j++)
898 for (
int j = 212;
j != 336;
j++)
905 for (
int i = 0;
i != 32;
i++)
910 for (
int i = 0;
i != 32;
i++)
915 for (
int i = 0;
i != 32;
i++)
920 for (
int i = 0;
i != 32;
i++)
925 for (
int i = 0;
i != 32;
i++)
930 for (
int i = 0;
i != 32;
i++)
935 for (
int i = 0;
i != 32;
i++)
940 for (
int i = 0;
i != 32;
i++)
945 for (
int i = 0;
i != 32;
i++)
950 for (
int i = 0;
i != 32;
i++)
955 for (
int i = 0;
i != 32;
i++)
960 for (
int i = 0;
i != 32;
i++)
965 for (
int i = 0;
i != 32;
i++)
970 for (
int i = 0;
i != 32;
i++)
975 for (
int i = 0;
i != 32;
i++)
980 for (
int i = 0;
i != 32;
i++)
985 for (
int i = 0;
i != 32;
i++)
990 for (
int i = 0;
i != 32;
i++)
995 for (
int i = 0;
i != 32;
i++)
1000 for (
int i = 0;
i != 32;
i++)
1005 for (
int i = 0;
i != 32;
i++)
1010 for (
int i = 0;
i != 32;
i++)
1015 for (
int i = 0;
i != 32;
i++)
1020 for (
int i = 0;
i != 32;
i++)
1025 for (
int i = 0;
i != 32;
i++)
1030 for (
int i = 0;
i != 32;
i++)
1035 for (
int i = 0;
i != 32;
i++)
1040 for (
int i = 0;
i != 32;
i++)
1045 for (
int i = 0;
i != 32;
i++)
1050 for (
int i = 0;
i != 32;
i++)
1055 for (
int i = 0;
i != 32;
i++)
1060 for (
int i = 0;
i != 32;
i++)
1065 for (
int i = 0;
i != 32;
i++)
1070 for (
int i = 0;
i != 32;
i++)
1075 for (
int i = 0;
i != 32;
i++)
1080 for (
int i = 0;
i != 32;
i++)
1092 if (nActiveModules >= 4) {
1110 LogInfo(
"PixelDQM") <<
" SiPixelDigiSource::buildStructure";
1113 LogVerbatim(
"PixelDQM") <<
" *** Geometry node for TrackerGeom is " << &(*pDD) << std::endl;
1114 LogVerbatim(
"PixelDQM") <<
" *** I have " << pDD->
dets().size() <<
" detectors" << std::endl;
1115 LogVerbatim(
"PixelDQM") <<
" *** I have " << pDD->
detTypes().size() <<
" types" << std::endl;
1117 for (TrackerGeometry::DetContainer::const_iterator it = pDD->
dets().begin(); it != pDD->
dets().end(); it++) {
1118 if (dynamic_cast<PixelGeomDetUnit const*>((*it)) !=
nullptr) {
1128 LogDebug(
"PixelDQM") <<
" ---> Adding Barrel Module " <<
detId.rawId() << endl;
1129 uint32_t
id =
detId();
1137 LogDebug(
"PixelDQM") <<
" ---> Adding Endcap Module " <<
detId.rawId() << endl;
1138 uint32_t
id =
detId();
1150 sprintf(sside,
"HalfCylinder_%i", side);
1152 sprintf(sdisk,
"Disk_%i", disk);
1154 sprintf(sblade,
"Blade_%02i", blade);
1156 sprintf(spanel,
"Panel_%i", panel);
1158 sprintf(smodule,
"Module_%i",
module);
1161 bool mask = side_str.find(
"HalfCylinder_1") != string::npos ||
1162 side_str.find(
"HalfCylinder_2") != string::npos ||
1163 side_str.find(
"HalfCylinder_4") != string::npos || disk_str.find(
"Disk_2") != string::npos;
1171 LogDebug(
"PixelDQM") <<
" ---> Adding Endcap Module " <<
detId.rawId() << endl;
1172 uint32_t
id =
detId();
1184 sprintf(sside,
"HalfCylinder_%i", side);
1186 sprintf(sdisk,
"Disk_%i", disk);
1188 sprintf(sblade,
"Blade_%02i", blade);
1190 sprintf(spanel,
"Panel_%i", panel);
1192 sprintf(smodule,
"Module_%i",
module);
1195 bool mask = side_str.find(
"HalfCylinder_1") != string::npos ||
1196 side_str.find(
"HalfCylinder_2") != string::npos ||
1197 side_str.find(
"HalfCylinder_4") != string::npos || disk_str.find(
"Disk_2") != string::npos;
1216 sprintf(
title,
"Rate of events with >%i digis;LumiSection;Rate [Hz]",
bigEventSize);
1219 sprintf(title1,
"Pixel events vs. BX;BX;# events");
1222 sprintf(title2,
"Rate of Pixel events;LumiSection;Rate [Hz]");
1225 sprintf(title3,
"Number of Zero-Occupancy Barrel ROCs;LumiSection;N_{ZERO-OCCUPANCY} Barrel ROCs");
1228 sprintf(title4,
"Number of Low-Efficiency Barrel ROCs;LumiSection;N_{LO EFF} Barrel ROCs");
1231 sprintf(title5,
"Number of Zero-Occupancy Endcap ROCs;LumiSection;N_{ZERO-OCCUPANCY} Endcap ROCs");
1234 sprintf(title6,
"Number of Low-Efficiency Endcap ROCs;LumiSection;N_{LO EFF} Endcap ROCs");
1237 sprintf(title7,
"Average digi occupancy per FED;FED;NDigis/<NDigis>");
1239 sprintf(title8,
"FED Digi Occupancy (NDigis/<NDigis>) vs LumiSections;Lumi Section;FED");
1247 "avgBarrelFedOccvsLumi",
1248 "Average Barrel FED digi occupancy (<NDigis>) vs LumiSections;Lumi Section;Average digi occupancy per FED",
1253 "avgEndcapFedOccvsLumi",
1254 "Average Endcap FED digi occupancy (<NDigis>) vs LumiSections;Lumi Section;Average digi occupancy per FED",
1261 "averageDigiOccupancy", title7, 40, -0.5, 39.5);
1264 std::map<uint32_t, SiPixelDigiModule*>::iterator struct_iter;
1278 throw cms::Exception(
"LogicError") <<
"[SiPixelDigiSource::bookMEs] Creation of DQM folder failed";
1285 LogDebug(
"PixelDQM") <<
"PROBLEM WITH LADDER-FOLDER\n";
1292 LogDebug(
"PixelDQM") <<
"PROBLEM WITH LAYER-FOLDER\n";
1300 LogDebug(
"PixelDQM") <<
"PROBLEM WITH PHI-FOLDER\n";
1307 LogDebug(
"PixelDQM") <<
"PROBLEM WITH BLADE-FOLDER\n";
1314 LogDebug(
"PixelDQM") <<
"PROBLEM WITH DISK-FOLDER\n";
1321 LogDebug(
"PixelDQM") <<
"PROBLEM WITH RING-FOLDER\n";
1330 std::stringstream ss1, ss2;
1333 ss1 <<
"ALLMODS_ndigisCHAN_BarrelL" <<
i;
1335 ss2 <<
"Number of Digis L" <<
i;
1418 ss1 <<
"ALLMODS_ndigisCHAN_EndcapDp" <<
i;
1420 ss2 <<
"Number of Digis Disk p" <<
i;
1426 ss1 <<
"ALLMODS_ndigisCHAN_EndcapDm" <<
i;
1428 ss2 <<
"Number of Digis Disk m" <<
i;
1436 std::pair<int, int> tempPair =
mod->getZeroLoEffROCs();
Log< level::Info, true > LogVerbatim
uint32_t second(const DetId &id) const
MonitorElement * meNDigisCHANBarrelCh19_
MonitorElement * meNDigisCHANBarrelCh35_
MonitorElement * meNDigisCHANBarrelCh2_
MonitorElement * meNDigisCHANBarrelCh30_
LuminosityBlockNumber_t luminosityBlock() const
T getParameter(std::string const &) const
MonitorElement * meNDigisCHANBarrelCh31_
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
MonitorElement * meNDigisCHANBarrelCh8_
virtual void setCurrentFolder(std::string const &fullpath)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoTokenBeginRun_
MonitorElement * meNDigisCHANBarrelCh36_
int bladeName() const
blade id
MonitorElement * loOccROCsEndcap
MonitorElement * meNDigisCHANBarrelCh17_
MonitorElement * meNDigisCHANBarrelCh25_
MonitorElement * meNDigisCHANBarrelCh6_
MonitorElement * meNDigisCOMBBarrel_
std::string topFolderName_
MonitorElement * meNDigisCOMBEndcap_
MonitorElement * meNDigisCHANBarrelCh14_
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
MonitorElement * meNDigisCHANBarrelCh12_
MonitorElement * meNDigisCHANBarrelCh29_
static std::string const input
MonitorElement * avgBarrelFedOccvsLumi
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > srcToken_
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
MonitorElement * meNDigisCHANBarrelCh27_
virtual void bookMEs(DQMStore::IBooker &, const edm::EventSetup &iSetup)
SiPixelDigiSource(const edm::ParameterSet &conf)
T const * product() const
std::shared_ptr< bool > globalBeginLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &iSetup) const override
MonitorElement * meNDigisCHANBarrelCh3_
MonitorElement * meNDigisCHANBarrelCh9_
MonitorElement * meNDigisCHANBarrelCh4_
int diskName() const
disk id
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
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
HalfCylinder halfCylinder() const
MonitorElement * meNDigisCHANEndcap_
void dqmBeginRun(const edm::Run &, edm::EventSetup const &) override
MonitorElement * meNDigisCHANBarrelCh28_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomTokenBeginRun_
~SiPixelDigiSource() override
MonitorElement * noOccROCsEndcap
MonitorElement * meNDigisCHANBarrel_
std::vector< MonitorElement * > meNDigisCHANEndcapDms_
#define DEFINE_FWK_MODULE(type)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoToken_
std::map< uint32_t, SiPixelDigiModule * > thePixelStructure
MonitorElement * meNDigisCHANBarrelCh33_
UseScope< MonitorElementData::Scope::LUMI > UseLumiScope
MonitorElement * pixEventRate
MonitorElement * meNDigisCHANBarrelCh21_
unsigned int I_detId[1856]
MonitorElement * meNDigisCHANBarrelCh32_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
MonitorElement * meNDigisCHANBarrelCh10_
MonitorElement * loOccROCsBarrel
MonitorElement * meNDigisCHANBarrelCh1_
MonitorElement * averageDigiOccupancy
Log< level::Info, false > LogInfo
MonitorElement * meNDigisCHANBarrelCh5_
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
LuminosityBlockID id() const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * meNDigisCHANBarrelCh7_
MonitorElement * meNDigisCHANBarrelCh15_
MonitorElement * meNDigisCHANBarrelCh13_
int layerName() const
layer id
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * meNDigisCHANBarrelCh23_
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
MonitorElement * meNDigisCHANBarrelCh18_
LuminosityBlockIndex index() const
MonitorElement * bigEventRate
MonitorElement * meNDigisCHANBarrelCh20_
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
MonitorElement * avgfedDigiOccvsLumi
MonitorElement * meNDigisCHANBarrelCh22_
MonitorElement * avgEndcapFedOccvsLumi
std::vector< MonitorElement * > meNDigisCHANEndcapDps_
MonitorElement * pixEvtsPerBX
std::vector< MonitorElement * > meNDigisCHANBarrelLs_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * meNDigisCHANBarrelCh16_
MonitorElement * meNDigisCHANBarrelCh11_
T mod(const T &a, const T &b)
modOn
online/offline RawDataErrors
virtual void CountZeroROCsInSubstructure(bool, bool &, SiPixelDigiModule *)
virtual void buildStructure(edm::EventSetup const &)
int pannelName() const
pannel id
MonitorElement * meNDigisCHANBarrelCh24_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
int plaquetteName() const
plaquetteId (in pannel)