00001
00002
00003
00004
00005
00006
00014
00015
00016
00017
00018
00019
00020 #include "DQM/SiPixelMonitorDigi/interface/SiPixelDigiSource.h"
00021
00022 #include "FWCore/ServiceRegistry/interface/Service.h"
00023 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00024 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00025
00026 #include "DQM/SiPixelCommon/interface/SiPixelFolderOrganizer.h"
00027 #include "DQMServices/Core/interface/DQMStore.h"
00028
00029 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00030 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
00031 #include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h"
00032 #include "Geometry/CommonTopologies/interface/PixelTopology.h"
00033
00034 #include "DataFormats/DetId/interface/DetId.h"
00035 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
00036 #include "DataFormats/SiPixelDetId/interface/PixelBarrelName.h"
00037 #include "DataFormats/SiPixelDetId/interface/PixelEndcapName.h"
00038
00039 #include <string>
00040 #include <stdlib.h>
00041 #include <iostream>
00042 #include <fstream>
00043
00044 using namespace std;
00045 using namespace edm;
00046
00047 SiPixelDigiSource::SiPixelDigiSource(const edm::ParameterSet& iConfig) :
00048 conf_(iConfig),
00049 src_( conf_.getParameter<edm::InputTag>( "src" ) ),
00050 saveFile( conf_.getUntrackedParameter<bool>("saveFile",false) ),
00051 isPIB( conf_.getUntrackedParameter<bool>("isPIB",false) ),
00052 slowDown( conf_.getUntrackedParameter<bool>("slowDown",false) ),
00053 modOn( conf_.getUntrackedParameter<bool>("modOn",true) ),
00054 twoDimOn( conf_.getUntrackedParameter<bool>("twoDimOn",true) ),
00055 twoDimModOn( conf_.getUntrackedParameter<bool>("twoDimModOn",true) ),
00056 twoDimOnlyLayDisk( conf_.getUntrackedParameter<bool>("twoDimOnlyLayDisk",false) ),
00057 hiRes( conf_.getUntrackedParameter<bool>("hiRes",false) ),
00058 reducedSet( conf_.getUntrackedParameter<bool>("reducedSet",false) ),
00059 ladOn( conf_.getUntrackedParameter<bool>("ladOn",false) ),
00060 layOn( conf_.getUntrackedParameter<bool>("layOn",false) ),
00061 phiOn( conf_.getUntrackedParameter<bool>("phiOn",false) ),
00062 ringOn( conf_.getUntrackedParameter<bool>("ringOn",false) ),
00063 bladeOn( conf_.getUntrackedParameter<bool>("bladeOn",false) ),
00064 diskOn( conf_.getUntrackedParameter<bool>("diskOn",false) ),
00065 bigEventSize( conf_.getUntrackedParameter<int>("bigEventSize",1000) )
00066 {
00067 theDMBE = edm::Service<DQMStore>().operator->();
00068 LogInfo ("PixelDQM") << "SiPixelDigiSource::SiPixelDigiSource: Got DQM BackEnd interface"<<endl;
00069 }
00070
00071
00072 SiPixelDigiSource::~SiPixelDigiSource()
00073 {
00074
00075
00076 LogInfo ("PixelDQM") << "SiPixelDigiSource::~SiPixelDigiSource: Destructor"<<endl;
00077 }
00078
00079
00080 void SiPixelDigiSource::beginJob(){
00081 firstRun = true;
00082
00083 ifstream infile(edm::FileInPath("DQM/SiPixelMonitorClient/test/detId.dat").fullPath().c_str(),ios::in);
00084 int nModsInFile=0;
00085 assert(!infile.fail());
00086 while(!infile.eof()&&nModsInFile<1440) {
00087 infile >> I_name[nModsInFile] >> I_detId[nModsInFile] >> I_fedId[nModsInFile] >> I_linkId1[nModsInFile] >> I_linkId2[nModsInFile];
00088
00089 nModsInFile++;
00090 }
00091 infile.close();
00092 }
00093
00094 void SiPixelDigiSource::beginRun(const edm::Run& r, const edm::EventSetup& iSetup){
00095 LogInfo ("PixelDQM") << " SiPixelDigiSource::beginJob - Initialisation ... " << std::endl;
00096 LogInfo ("PixelDQM") << "Mod/Lad/Lay/Phi " << modOn << "/" << ladOn << "/"
00097 << layOn << "/" << phiOn << std::endl;
00098 LogInfo ("PixelDQM") << "Blade/Disk/Ring" << bladeOn << "/" << diskOn << "/"
00099 << ringOn << std::endl;
00100
00101 LogInfo ("PixelDQM") << "2DIM IS " << twoDimOn << " and set to high resolution? " << hiRes << "\n";
00102
00103 if(firstRun){
00104 eventNo = 0;
00105 lumSec = 0;
00106 nLumiSecs = 0;
00107 nBigEvents = 0;
00108 nBPIXDigis = 0;
00109 nFPIXDigis = 0;
00110 for(int i=0; i!=40; i++) nDigisPerFed[i]=0;
00111 for(int i=0; i!=4; i++) nDigisPerDisk[i]=0;
00112 nDP1P1M1 = 0;
00113 nDP1P1M2 = 0;
00114 nDP1P1M3 = 0;
00115 nDP1P1M4 = 0;
00116 nDP1P2M1 = 0;
00117 nDP1P2M2 = 0;
00118 nDP1P2M3 = 0;
00119 nDP2P1M1 = 0;
00120 nDP2P1M2 = 0;
00121 nDP2P1M3 = 0;
00122 nDP2P1M4 = 0;
00123 nDP2P2M1 = 0;
00124 nDP2P2M2 = 0;
00125 nDP2P2M3 = 0;
00126 nDM1P1M1 = 0;
00127 nDM1P1M2 = 0;
00128 nDM1P1M3 = 0;
00129 nDM1P1M4 = 0;
00130 nDM1P2M1 = 0;
00131 nDM1P2M2 = 0;
00132 nDM1P2M3 = 0;
00133 nDM2P1M1 = 0;
00134 nDM2P1M2 = 0;
00135 nDM2P1M3 = 0;
00136 nDM2P1M4 = 0;
00137 nDM2P2M1 = 0;
00138 nDM2P2M2 = 0;
00139 nDM2P2M3 = 0;
00140 nL1M1 = 0;
00141 nL1M2 = 0;
00142 nL1M3 = 0;
00143 nL1M4 = 0;
00144 nL2M1 = 0;
00145 nL2M2 = 0;
00146 nL2M3 = 0;
00147 nL2M4 = 0;
00148 nL3M1 = 0;
00149 nL3M2 = 0;
00150 nL3M3 = 0;
00151 nL3M4 = 0;
00152
00153
00154
00155 buildStructure(iSetup);
00156
00157 bookMEs();
00158 firstRun = false;
00159 }
00160 }
00161
00162
00163 void SiPixelDigiSource::endJob(void){
00164
00165 if(saveFile) {
00166 LogInfo ("PixelDQM") << " SiPixelDigiSource::endJob - Saving Root File " << std::endl;
00167 std::string outputFile = conf_.getParameter<std::string>("outputFile");
00168 theDMBE->save( outputFile.c_str() );
00169 }
00170
00171 }
00172
00173
00174
00175
00176 void SiPixelDigiSource::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00177 {
00178 eventNo++;
00179
00180
00181
00182 edm::Handle< edm::DetSetVector<PixelDigi> > input;
00183 iEvent.getByLabel( src_, input );
00184 if (!input.isValid()) return;
00185
00186 DQMStore* theDMBE = edm::Service<DQMStore>().operator->();
00187
00188
00189 int bx = iEvent.bunchCrossing();
00190
00191 int lumiSection = (int)iEvent.luminosityBlock();
00192 int nEventDigis = 0; int nActiveModules = 0;
00193
00194
00195 if(modOn){
00196 MonitorElement* meReset = theDMBE->get("Pixel/averageDigiOccupancy");
00197
00198 if(meReset && lumiSection%8==0){
00199 meReset->Reset();
00200 nBPIXDigis = 0;
00201 nFPIXDigis = 0;
00202 for(int i=0; i!=40; i++) nDigisPerFed[i]=0;
00203 }
00204
00205 std::string baseDirs[2] = {"Pixel/Barrel", "Pixel/Endcap"};
00206 for (int i = 0; i < 2; ++i){
00207 theDMBE->cd(baseDirs[i]);
00208 vector<string> shellDirs = theDMBE->getSubdirs();
00209 for (vector<string>::const_iterator it = shellDirs.begin(); it != shellDirs.end(); it++) {
00210 theDMBE->cd(*it);
00211 vector<string> layDirs = theDMBE->getSubdirs();
00212 for (vector<string>::const_iterator itt = layDirs.begin(); itt != layDirs.end(); itt++) {
00213 theDMBE->cd(*itt);
00214 vector<string> contents = theDMBE->getMEs();
00215 for (vector<string>::const_iterator im = contents.begin(); im != contents.end(); im++) {
00216 if ((*im).find("rocmap") == string::npos) continue;
00217 MonitorElement* me = theDMBE->get((*itt)+"/"+(*im));
00218 if(me && lumiSection%10==0) me->Reset();}}}}
00219 }
00220 if(!modOn){
00221 MonitorElement* meReset = theDMBE->get("Pixel/averageDigiOccupancy");
00222 if(meReset && lumiSection%1==0){
00223 meReset->Reset();
00224 nBPIXDigis = 0;
00225 nFPIXDigis = 0;
00226 for(int i=0; i!=40; i++) nDigisPerFed[i]=0;
00227 }
00228 }
00229
00230 std::map<uint32_t,SiPixelDigiModule*>::iterator struct_iter;
00231 for(int i=0; i!=192; i++) numberOfDigis[i]=0;
00232 for(int i=0; i!=1152; i++) nDigisPerChan[i]=0;
00233 for(int i=0; i!=4; i++) nDigisPerDisk[i]=0;
00234 for (struct_iter = thePixelStructure.begin() ; struct_iter != thePixelStructure.end() ; struct_iter++) {
00235 int numberOfDigisMod = (*struct_iter).second->fill(*input, modOn,
00236 ladOn, layOn, phiOn,
00237 bladeOn, diskOn, ringOn,
00238 twoDimOn, reducedSet, twoDimModOn, twoDimOnlyLayDisk,
00239 nDigisA, nDigisB);
00240 if(numberOfDigisMod>0){
00241
00242
00243 nEventDigis = nEventDigis + numberOfDigisMod;
00244 nActiveModules++;
00245 bool barrel = DetId((*struct_iter).first).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
00246 bool endcap = DetId((*struct_iter).first).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
00247
00248 if(barrel){
00249
00250 nBPIXDigis = nBPIXDigis + numberOfDigisMod;
00251
00252 for(int i=0; i!=768; ++i){
00253
00254 if((*struct_iter).first == I_detId[i]){
00255
00256 nDigisPerFed[I_fedId[i]]=nDigisPerFed[I_fedId[i]]+numberOfDigisMod;
00257
00258 int index1 = 0; int index2 = 0;
00259 if(I_linkId1[i]>0) index1 = I_fedId[i]*36+(I_linkId1[i]-1);
00260 if(I_linkId2[i]>0) index2 = I_fedId[i]*36+(I_linkId2[i]-1);
00261 if(nDigisA>0 && I_linkId1[i]>0) nDigisPerChan[index1]=nDigisPerChan[index1]+nDigisA;
00262 if(nDigisB>0 && I_linkId2[i]>0) nDigisPerChan[index2]=nDigisPerChan[index2]+nDigisB;
00263
00264 i=767;
00265 }
00266 }
00267
00268 }else if(endcap){
00269
00270
00271 nFPIXDigis = nFPIXDigis + numberOfDigisMod;
00272
00273 PixelEndcapName::HalfCylinder side = PixelEndcapName(DetId((*struct_iter).first)).halfCylinder();
00274 int disk = PixelEndcapName(DetId((*struct_iter).first)).diskName();
00275 int blade = PixelEndcapName(DetId((*struct_iter).first)).bladeName();
00276 int panel = PixelEndcapName(DetId((*struct_iter).first)).pannelName();
00277 int module = PixelEndcapName(DetId((*struct_iter).first)).plaquetteName();
00278
00279 int iter=0; int i=0;
00280 if(side==PixelEndcapName::mI){
00281 if(disk==1){
00282 i=0;
00283 if(panel==1){ if(module==1) nDM1P1M1+=numberOfDigisMod;
00284 else if(module==2) nDM1P1M2+=numberOfDigisMod;
00285 else if(module==3) nDM1P1M3+=numberOfDigisMod;
00286 else if(module==4) nDM1P1M4+=numberOfDigisMod;}
00287 else if(panel==2){ if(module==1) nDM1P2M1+=numberOfDigisMod;
00288 else if(module==2) nDM1P2M2+=numberOfDigisMod;
00289 else if(module==3) nDM1P2M3+=numberOfDigisMod; }
00290 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00291 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00292 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00293 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00294 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00295 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00296 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00297 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00298 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00299 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00300 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00301 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00302 }else if(disk==2){
00303 i=24;
00304 if(panel==1){ if(module==1) nDM2P1M1+=numberOfDigisMod;
00305 else if(module==2) nDM2P1M2+=numberOfDigisMod;
00306 else if(module==3) nDM2P1M3+=numberOfDigisMod;
00307 else if(module==4) nDM2P1M4+=numberOfDigisMod;}
00308 else if(panel==2){ if(module==1) nDM2P2M1+=numberOfDigisMod;
00309 else if(module==2) nDM2P2M2+=numberOfDigisMod;
00310 else if(module==3) nDM2P2M3+=numberOfDigisMod; }
00311 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00312 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00313 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00314 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00315 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00316 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00317 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00318 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00319 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00320 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00321 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00322 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00323 }
00324 }else if(side==PixelEndcapName::mO){
00325 if(disk==1){
00326 i=48;
00327 if(panel==1){ if(module==1) nDM1P1M1+=numberOfDigisMod;
00328 else if(module==2) nDM1P1M2+=numberOfDigisMod;
00329 else if(module==3) nDM1P1M3+=numberOfDigisMod;
00330 else if(module==4) nDM1P1M4+=numberOfDigisMod;}
00331 else if(panel==2){ if(module==1) nDM1P2M1+=numberOfDigisMod;
00332 else if(module==2) nDM1P2M2+=numberOfDigisMod;
00333 else if(module==3) nDM1P2M3+=numberOfDigisMod; }
00334 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00335 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00336 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00337 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00338 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00339 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00340 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00341 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00342 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00343 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00344 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00345 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00346 }else if(disk==2){
00347 i=72;
00348 if(panel==1){ if(module==1) nDM2P1M1+=numberOfDigisMod;
00349 else if(module==2) nDM2P1M2+=numberOfDigisMod;
00350 else if(module==3) nDM2P1M3+=numberOfDigisMod;
00351 else if(module==4) nDM2P1M4+=numberOfDigisMod;}
00352 else if(panel==2){ if(module==1) nDM2P2M1+=numberOfDigisMod;
00353 else if(module==2) nDM2P2M2+=numberOfDigisMod;
00354 else if(module==3) nDM2P2M3+=numberOfDigisMod; }
00355 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00356 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00357 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00358 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00359 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00360 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00361 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00362 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00363 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00364 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00365 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00366 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00367 }
00368 }else if(side==PixelEndcapName::pI){
00369 if(disk==1){
00370 i=96;
00371 if(panel==1){ if(module==1) nDP1P1M1+=numberOfDigisMod;
00372 else if(module==2) nDP1P1M2+=numberOfDigisMod;
00373 else if(module==3) nDP1P1M3+=numberOfDigisMod;
00374 else if(module==4) nDP1P1M4+=numberOfDigisMod;}
00375 else if(panel==2){ if(module==1) nDP1P2M1+=numberOfDigisMod;
00376 else if(module==2) nDP1P2M2+=numberOfDigisMod;
00377 else if(module==3) nDP1P2M3+=numberOfDigisMod; }
00378 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00379 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00380 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00381 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00382 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00383 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00384 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00385 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00386 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00387 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00388 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00389 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00390 }else if(disk==2){
00391 i=120;
00392 if(panel==1){ if(module==1) nDP2P1M1+=numberOfDigisMod;
00393 else if(module==2) nDP2P1M2+=numberOfDigisMod;
00394 else if(module==3) nDP2P1M3+=numberOfDigisMod;
00395 else if(module==4) nDP2P1M4+=numberOfDigisMod;}
00396 else if(panel==2){ if(module==1) nDP2P2M1+=numberOfDigisMod;
00397 else if(module==2) nDP2P2M2+=numberOfDigisMod;
00398 else if(module==3) nDP2P2M3+=numberOfDigisMod; }
00399 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00400 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00401 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00402 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00403 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00404 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00405 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00406 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00407 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00408 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00409 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00410 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00411 }
00412 }else if(side==PixelEndcapName::pO){
00413 if(disk==1){
00414 i=144;
00415 if(panel==1){ if(module==1) nDP1P1M1+=numberOfDigisMod;
00416 else if(module==2) nDP1P1M2+=numberOfDigisMod;
00417 else if(module==3) nDP1P1M3+=numberOfDigisMod;
00418 else if(module==4) nDP1P1M4+=numberOfDigisMod;}
00419 else if(panel==2){ if(module==1) nDP1P2M1+=numberOfDigisMod;
00420 else if(module==2) nDP1P2M2+=numberOfDigisMod;
00421 else if(module==3) nDP1P2M3+=numberOfDigisMod; }
00422 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00423 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00424 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00425 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00426 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00427 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00428 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00429 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00430 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00431 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00432 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00433 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00434 }else if(disk==2){
00435 i=168;
00436 if(panel==1){ if(module==1) nDP2P1M1+=numberOfDigisMod;
00437 else if(module==2) nDP2P1M2+=numberOfDigisMod;
00438 else if(module==3) nDP2P1M3+=numberOfDigisMod;
00439 else if(module==4) nDP2P1M4+=numberOfDigisMod;}
00440 else if(panel==2){ if(module==1) nDP2P2M1+=numberOfDigisMod;
00441 else if(module==2) nDP2P2M2+=numberOfDigisMod;
00442 else if(module==3) nDP2P2M3+=numberOfDigisMod; }
00443 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00444 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00445 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00446 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00447 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00448 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00449 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00450 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00451 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00452 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00453 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00454 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00455 }
00456 }
00457 numberOfDigis[iter]=numberOfDigis[iter]+numberOfDigisMod;
00458
00459
00460
00461
00462 for(int i=768; i!=1440; i++){
00463
00464 if((*struct_iter).first == I_detId[i]){
00465
00466 nDigisPerFed[I_fedId[i]]=nDigisPerFed[I_fedId[i]]+numberOfDigisMod;
00467
00468 i=1439;
00469 }
00470 }
00471
00472 }
00473
00474
00475 }
00476 }
00477
00478
00479 int NzeroROCs[2] = {0,-672};
00480 int NloEffROCs[2] = {0,-672};
00481 std::string baseDirs[2] = {"Pixel/Barrel", "Pixel/Endcap"};
00482 for (int i = 0; i < 2; ++i){
00483 theDMBE->cd(baseDirs[i]);
00484 vector<string> shellDirs = theDMBE->getSubdirs();
00485 for (vector<string>::const_iterator it = shellDirs.begin(); it != shellDirs.end(); it++) {
00486 theDMBE->cd(*it);
00487 vector<string> layDirs = theDMBE->getSubdirs();
00488 for (vector<string>::const_iterator itt = layDirs.begin(); itt != layDirs.end(); itt++) {
00489 theDMBE->cd(*itt);
00490 vector<string> contents = theDMBE->getMEs();
00491 for (vector<string>::const_iterator im = contents.begin(); im != contents.end(); im++) {
00492 if ((*im).find("rocmap") == string::npos) continue;
00493 MonitorElement* me = theDMBE->get((*itt)+"/"+(*im));
00494 if(!me) continue;
00495 float SF = 1.0; if (me->getEntries() > 0) SF = float(me->getNbinsX()*me->getNbinsY()/me->getEntries());
00496 for (int ii = 1; ii < me->getNbinsX()+1; ++ii){for (int jj = 1; jj < me->getNbinsY()+1; ++jj){
00497 if (me->getBinContent(ii,jj) < 1) ++NzeroROCs[i];
00498 if (me->getBinContent(ii,jj)*SF < 0.25) ++NloEffROCs[i];}}
00499 }
00500 }
00501 }
00502 }
00503 for (int i =0; i < 2; ++i) NloEffROCs[i] = NloEffROCs[i] - NzeroROCs[i];
00504 MonitorElement* menoOcc=theDMBE->get("Pixel/noOccROCsBarrel");
00505 MonitorElement* meloOcc=theDMBE->get("Pixel/loOccROCsBarrel");
00506 if(menoOcc) menoOcc->setBinContent(lumiSection/10, NzeroROCs[0]);
00507 if(meloOcc) meloOcc->setBinContent(lumiSection/10, NloEffROCs[0]);
00508 MonitorElement* menoOcc1=theDMBE->get("Pixel/noOccROCsEndcap");
00509 MonitorElement* meloOcc1=theDMBE->get("Pixel/loOccROCsEndcap");
00510 if(menoOcc1) menoOcc1->setBinContent(lumiSection/10, NzeroROCs[1]);
00511 if(meloOcc1) meloOcc1->setBinContent(lumiSection/10, NloEffROCs[1]);
00512 theDMBE->cd();
00513
00514
00515
00516
00517 MonitorElement* meE; MonitorElement* meE1; MonitorElement* meE2; MonitorElement* meE3; MonitorElement* meE4;
00518 meE=theDMBE->get("Pixel/Endcap/ALLMODS_ndigisCHAN_Endcap");
00519 if(meE){ for(int j=0; j!=192; j++) if(numberOfDigis[j]>0) meE->Fill((float)numberOfDigis[j]);}
00520 meE1=theDMBE->get("Pixel/Endcap/ALLMODS_ndigisCHAN_EndcapDm1");
00521 if(meE1){ for(int j=0; j!=72; j++) if((j<24||j>47)&&numberOfDigis[j]>0) meE1->Fill((float)numberOfDigis[j]);}
00522 meE2=theDMBE->get("Pixel/Endcap/ALLMODS_ndigisCHAN_EndcapDm2");
00523 if(meE2){ for(int j=24; j!=96; j++) if((j<48||j>71)&&numberOfDigis[j]>0) meE2->Fill((float)numberOfDigis[j]);}
00524 meE3=theDMBE->get("Pixel/Endcap/ALLMODS_ndigisCHAN_EndcapDp1");
00525 if(meE3){ for(int j=96; j!=168; j++) if((j<120||j>143)&&numberOfDigis[j]>0) meE3->Fill((float)numberOfDigis[j]);}
00526 meE4=theDMBE->get("Pixel/Endcap/ALLMODS_ndigisCHAN_EndcapDp2");
00527 if(meE4){ for(int j=120; j!=192; j++) if((j<144||j>167)&&numberOfDigis[j]>0) meE4->Fill((float)numberOfDigis[j]);}
00528
00529 MonitorElement* me1; MonitorElement* me2; MonitorElement* me3; MonitorElement* me4; MonitorElement* me5;
00530 MonitorElement* me6; MonitorElement* me7; MonitorElement* me8; MonitorElement* me9; MonitorElement* me10; MonitorElement* me11;
00531 MonitorElement* me12; MonitorElement* me13; MonitorElement* me14; MonitorElement* me15; MonitorElement* me16; MonitorElement* me17;
00532 MonitorElement* me18; MonitorElement* me19; MonitorElement* me20; MonitorElement* me21; MonitorElement* me22; MonitorElement* me23;
00533 MonitorElement* me24; MonitorElement* me25; MonitorElement* me26; MonitorElement* me27; MonitorElement* me28; MonitorElement* me29;
00534 MonitorElement* me30; MonitorElement* me31; MonitorElement* me32; MonitorElement* me33; MonitorElement* me34; MonitorElement* me35;
00535 MonitorElement* me36;
00536 me1=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh1");
00537 if(me1){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+0]>0) me1->Fill((float)nDigisPerChan[i*36+0]);}
00538 me2=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh2");
00539 if(me2){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+1]>0) me2->Fill((float)nDigisPerChan[i*36+1]);}
00540 me3=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh3");
00541 if(me3){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+2]>0) me3->Fill((float)nDigisPerChan[i*36+2]);}
00542 me4=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh4");
00543 if(me4){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+3]>0) me4->Fill((float)nDigisPerChan[i*36+3]);}
00544 me5=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh5");
00545 if(me5){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+4]>0) me5->Fill((float)nDigisPerChan[i*36+4]);}
00546 me6=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh6");
00547 if(me6){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+5]>0) me6->Fill((float)nDigisPerChan[i*36+5]);}
00548 me7=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh7");
00549 if(me7){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+6]>0) me7->Fill((float)nDigisPerChan[i*36+6]);}
00550 me8=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh8");
00551 if(me8){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+7]>0) me8->Fill((float)nDigisPerChan[i*36+7]);}
00552 me9=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh9");
00553 if(me9){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+8]>0) me9->Fill((float)nDigisPerChan[i*36+8]);}
00554 me10=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh10");
00555 if(me10){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+9]>0) me10->Fill((float)nDigisPerChan[i*36+9]);}
00556 me11=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh11");
00557 if(me11){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+10]>0) me11->Fill((float)nDigisPerChan[i*36+10]);}
00558 me12=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh12");
00559 if(me12){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+11]>0) me12->Fill((float)nDigisPerChan[i*36+11]);}
00560 me13=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh13");
00561 if(me13){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+12]>0) me13->Fill((float)nDigisPerChan[i*36+12]);}
00562 me14=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh14");
00563 if(me14){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+13]>0) me14->Fill((float)nDigisPerChan[i*36+13]);}
00564 me15=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh15");
00565 if(me15){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+14]>0) me15->Fill((float)nDigisPerChan[i*36+14]);}
00566 me16=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh16");
00567 if(me16){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+15]>0) me16->Fill((float)nDigisPerChan[i*36+15]);}
00568 me17=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh17");
00569 if(me17){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+16]>0) me17->Fill((float)nDigisPerChan[i*36+16]);}
00570 me18=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh18");
00571 if(me18){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+17]>0) me18->Fill((float)nDigisPerChan[i*36+17]);}
00572 me19=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh19");
00573 if(me19){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+18]>0) me19->Fill((float)nDigisPerChan[i*36+18]);}
00574 me20=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh20");
00575 if(me20){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+19]>0) me20->Fill((float)nDigisPerChan[i*36+19]);}
00576 me21=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh21");
00577 if(me21){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+20]>0) me21->Fill((float)nDigisPerChan[i*36+20]);}
00578 me22=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh22");
00579 if(me22){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+21]>0) me22->Fill((float)nDigisPerChan[i*36+21]);}
00580 me23=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh23");
00581 if(me23){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+22]>0) me23->Fill((float)nDigisPerChan[i*36+22]);}
00582 me24=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh24");
00583 if(me24){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+23]>0) me24->Fill((float)nDigisPerChan[i*36+23]);}
00584 me25=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh25");
00585 if(me25){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+24]>0) me25->Fill((float)nDigisPerChan[i*36+24]);}
00586 me26=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh26");
00587 if(me26){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+25]>0) me26->Fill((float)nDigisPerChan[i*36+25]);}
00588 me27=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh27");
00589 if(me27){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+26]>0) me27->Fill((float)nDigisPerChan[i*36+26]);}
00590 me28=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh28");
00591 if(me28){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+27]>0) me28->Fill((float)nDigisPerChan[i*36+27]);}
00592 me29=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh29");
00593 if(me29){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+28]>0) me29->Fill((float)nDigisPerChan[i*36+28]);}
00594 me30=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh30");
00595 if(me30){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+29]>0) me30->Fill((float)nDigisPerChan[i*36+29]);}
00596 me31=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh31");
00597 if(me31){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+30]>0) me31->Fill((float)nDigisPerChan[i*36+30]);}
00598 me32=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh32");
00599 if(me32){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+31]>0) me32->Fill((float)nDigisPerChan[i*36+31]);}
00600 me33=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh33");
00601 if(me33){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+32]>0) me33->Fill((float)nDigisPerChan[i*36+32]);}
00602 me34=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh34");
00603 if(me34){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+33]>0) me34->Fill((float)nDigisPerChan[i*36+33]);}
00604 me35=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh35");
00605 if(me35){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+34]>0) me35->Fill((float)nDigisPerChan[i*36+34]);}
00606 me36=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh36");
00607 if(me36){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+35]>0) me36->Fill((float)nDigisPerChan[i*36+35]);}
00608
00609
00610 MonitorElement* meX1;
00611 if(nEventDigis>bigEventSize){
00612 meX1 = theDMBE->get("Pixel/bigEventRate");
00613 if(meX1) meX1->Fill(lumiSection,1./23.);
00614 }
00615
00616
00617
00618 MonitorElement* meX2; MonitorElement* meX3;
00619 if(nActiveModules>=4){
00620 meX2 = theDMBE->get("Pixel/pixEvtsPerBX");
00621 if(meX2) meX2->Fill(float(bx));
00622 meX3 = theDMBE->get("Pixel/pixEventRate");
00623 if(meX3) meX3->Fill(lumiSection, 1./23.);
00624 }
00625
00626
00627 MonitorElement* meX4; MonitorElement* meX5;
00628 meX4 = theDMBE->get("Pixel/averageDigiOccupancy");
00629 meX5 = theDMBE->get("Pixel/avgfedDigiOccvsLumi");
00630 if(meX4){
00631 int maxfed=0;
00632 for(int i=0; i!=32; i++){
00633 if(nDigisPerFed[i]>maxfed) maxfed=nDigisPerFed[i];
00634 }
00635 for(int i=0; i!=40; i++){
00636 float averageOcc = 0.;
00637 if(i<32){
00638 float averageBPIXFed = float(nBPIXDigis-maxfed)/31.;
00639 if(averageBPIXFed>0.) averageOcc = nDigisPerFed[i]/averageBPIXFed;
00640
00641 }else{
00642 float averageFPIXFed = float(nFPIXDigis)/8.;
00643 if(averageFPIXFed>0.) averageOcc = nDigisPerFed[i]/averageFPIXFed;
00644
00645 }
00646 meX4->setBinContent(i+1,averageOcc);
00647 int lumiSections8 = int(lumiSection/8);
00648 if (modOn){
00649 if (meX5){
00650 meX5->setBinContent(1+lumiSections8, i+1, averageOcc);
00651 }
00652 }
00653 }
00654 }
00655
00656
00657 if(slowDown) usleep(10000);
00658
00659 }
00660
00661
00662
00663
00664 void SiPixelDigiSource::buildStructure(const edm::EventSetup& iSetup){
00665
00666 LogInfo ("PixelDQM") <<" SiPixelDigiSource::buildStructure" ;
00667 edm::ESHandle<TrackerGeometry> pDD;
00668 iSetup.get<TrackerDigiGeometryRecord>().get( pDD );
00669
00670 LogVerbatim ("PixelDQM") << " *** Geometry node for TrackerGeom is "<<&(*pDD)<<std::endl;
00671 LogVerbatim ("PixelDQM") << " *** I have " << pDD->dets().size() <<" detectors"<<std::endl;
00672 LogVerbatim ("PixelDQM") << " *** I have " << pDD->detTypes().size() <<" types"<<std::endl;
00673
00674 for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){
00675
00676 if(dynamic_cast<PixelGeomDetUnit*>((*it))!=0){
00677
00678 DetId detId = (*it)->geographicalId();
00679 const GeomDetUnit * geoUnit = pDD->idToDetUnit( detId );
00680 const PixelGeomDetUnit * pixDet = dynamic_cast<const PixelGeomDetUnit*>(geoUnit);
00681 int nrows = (pixDet->specificTopology()).nrows();
00682 int ncols = (pixDet->specificTopology()).ncolumns();
00683
00684 if(detId.subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) {
00685 if(isPIB) continue;
00686 LogDebug ("PixelDQM") << " ---> Adding Barrel Module " << detId.rawId() << endl;
00687 uint32_t id = detId();
00688 SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows);
00689 thePixelStructure.insert(pair<uint32_t,SiPixelDigiModule*> (id,theModule));
00690
00691 } else if(detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) {
00692 LogDebug ("PixelDQM") << " ---> Adding Endcap Module " << detId.rawId() << endl;
00693 uint32_t id = detId();
00694 SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows);
00695
00696 PixelEndcapName::HalfCylinder side = PixelEndcapName(DetId(id)).halfCylinder();
00697 int disk = PixelEndcapName(DetId(id)).diskName();
00698 int blade = PixelEndcapName(DetId(id)).bladeName();
00699 int panel = PixelEndcapName(DetId(id)).pannelName();
00700 int module = PixelEndcapName(DetId(id)).plaquetteName();
00701
00702 char sside[80]; sprintf(sside, "HalfCylinder_%i",side);
00703 char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
00704 char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
00705 char spanel[80]; sprintf(spanel, "Panel_%i",panel);
00706 char smodule[80];sprintf(smodule,"Module_%i",module);
00707 std::string side_str = sside;
00708 std::string disk_str = sdisk;
00709 bool mask = side_str.find("HalfCylinder_1")!=string::npos||
00710 side_str.find("HalfCylinder_2")!=string::npos||
00711 side_str.find("HalfCylinder_4")!=string::npos||
00712 disk_str.find("Disk_2")!=string::npos;
00713
00714 mask = false;
00715 if(isPIB && mask) continue;
00716
00717 thePixelStructure.insert(pair<uint32_t,SiPixelDigiModule*> (id,theModule));
00718 }
00719
00720 }
00721 }
00722 LogInfo ("PixelDQM") << " *** Pixel Structure Size " << thePixelStructure.size() << endl;
00723 }
00724
00725
00726
00727 void SiPixelDigiSource::bookMEs(){
00728
00729
00730 DQMStore* theDMBE = edm::Service<DQMStore>().operator->();
00731 theDMBE->setCurrentFolder("Pixel");
00732 char title[80]; sprintf(title, "Rate of events with >%i digis;LumiSection;Rate [Hz]",bigEventSize);
00733 bigEventRate = theDMBE->book1D("bigEventRate",title,5000,0.,5000.);
00734 char title1[80]; sprintf(title1, "Pixel events vs. BX;BX;# events");
00735 pixEvtsPerBX = theDMBE->book1D("pixEvtsPerBX",title1,3565,0.,3565.);
00736 char title2[80]; sprintf(title2, "Rate of Pixel events;LumiSection;Rate [Hz]");
00737 pixEventRate = theDMBE->book1D("pixEventRate",title2,5000,0.,5000.);
00738 char title3[80]; sprintf(title3, "Number of Disabled Barrel ROCs;LumiSection;N_{DISABLED} Barrel ROCs");
00739 noOccROCsBarrel = theDMBE->book1D("noOccROCsBarrel",title3,500,0.,5000.);
00740 char title4[80]; sprintf(title4, "Number of Low-Efficiency Barrel ROCs;LumiSection;N_{LO EFF} Barrel ROCs");
00741 loOccROCsBarrel = theDMBE->book1D("loOccROCsBarrel",title4,500,0.,5000.);
00742 char title5[80]; sprintf(title5, "Number of Disabled Endcap ROCs;LumiSection;N_{DISABLED} Endcap ROCs");
00743 noOccROCsEndcap = theDMBE->book1D("noOccROCsEndcap",title5,500,0.,5000.);
00744 char title6[80]; sprintf(title6, "Number of Low-Efficiency Endcap ROCs;LumiSection;N_{LO EFF} Endcap ROCs");
00745 loOccROCsEndcap = theDMBE->book1D("loOccROCsEndcap",title6,500,0.,5000.);
00746 char title7[80]; sprintf(title7, "Average digi occupancy per FED;FED;NDigis/<NDigis>");
00747 averageDigiOccupancy = theDMBE->book1D("averageDigiOccupancy",title7,40,-0.5,39.5);
00748 averageDigiOccupancy->setLumiFlag();
00749 if(modOn){
00750 char title4[80]; sprintf(title4, "FED Digi Occupancy (NDigis/<NDigis>) vs LumiSections;Lumi Section;FED");
00751 avgfedDigiOccvsLumi = theDMBE->book2D ("avgfedDigiOccvsLumi", title4, 400,0., 3200., 40, -0.5, 39.5);
00752 }
00753 std::map<uint32_t,SiPixelDigiModule*>::iterator struct_iter;
00754
00755 SiPixelFolderOrganizer theSiPixelFolder;
00756
00757 for(struct_iter = thePixelStructure.begin(); struct_iter != thePixelStructure.end(); struct_iter++){
00759 if(modOn){
00760 if(theSiPixelFolder.setModuleFolder((*struct_iter).first)){
00761 (*struct_iter).second->book( conf_,0,twoDimOn,hiRes, reducedSet, twoDimModOn);
00762 } else {
00763
00764 if(!isPIB) throw cms::Exception("LogicError")
00765 << "[SiPixelDigiSource::bookMEs] Creation of DQM folder failed";
00766 }
00767 }
00768 if(ladOn){
00769 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,1)){
00770 (*struct_iter).second->book( conf_,1,twoDimOn,hiRes, reducedSet);
00771 } else {
00772 LogDebug ("PixelDQM") << "PROBLEM WITH LADDER-FOLDER\n";
00773 }
00774
00775 }
00776 if(layOn || twoDimOnlyLayDisk){
00777 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,2)){
00778 (*struct_iter).second->book( conf_,2,twoDimOn,hiRes, reducedSet, twoDimOnlyLayDisk);
00779 } else {
00780 LogDebug ("PixelDQM") << "PROBLEM WITH LAYER-FOLDER\n";
00781 }
00782 }
00783
00784 if(phiOn){
00785 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,3)){
00786 (*struct_iter).second->book( conf_,3,twoDimOn,hiRes, reducedSet);
00787 } else {
00788 LogDebug ("PixelDQM") << "PROBLEM WITH PHI-FOLDER\n";
00789 }
00790 }
00791 if(bladeOn){
00792 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,4)){
00793 (*struct_iter).second->book( conf_,4,twoDimOn,hiRes, reducedSet);
00794 } else {
00795 LogDebug ("PixelDQM") << "PROBLEM WITH BLADE-FOLDER\n";
00796 }
00797 }
00798 if(diskOn || twoDimOnlyLayDisk){
00799 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,5)){
00800 (*struct_iter).second->book( conf_,5,twoDimOn,hiRes, reducedSet, twoDimOnlyLayDisk);
00801 } else {
00802 LogDebug ("PixelDQM") << "PROBLEM WITH DISK-FOLDER\n";
00803 }
00804 }
00805 if(ringOn){
00806 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,6)){
00807 (*struct_iter).second->book( conf_,6,twoDimOn,hiRes, reducedSet);
00808 } else {
00809 LogDebug ("PixelDQM") << "PROBLEM WITH RING-FOLDER\n";
00810 }
00811 }
00812 }
00813 std::string currDir = theDMBE->pwd();
00814 theDMBE->cd("Pixel/Barrel");
00815 meNDigisCOMBBarrel_ = theDMBE->book1D("ALLMODS_ndigisCOMB_Barrel","Number of Digis",200,0.,400.);
00816 meNDigisCOMBBarrel_->setAxisTitle("Number of digis per module per event",1);
00817 meNDigisCHANBarrel_ = theDMBE->book1D("ALLMODS_ndigisCHAN_Barrel","Number of Digis",100,0.,1000.);
00818 meNDigisCHANBarrel_->setAxisTitle("Number of digis per FED channel per event",1);
00819 meNDigisCHANBarrelL1_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelL1","Number of Digis L1",100,0.,1000.);
00820 meNDigisCHANBarrelL1_->setAxisTitle("Number of digis per FED channel per event",1);
00821 meNDigisCHANBarrelL2_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelL2","Number of Digis L2",100,0.,1000.);
00822 meNDigisCHANBarrelL2_->setAxisTitle("Number of digis per FED channel per event",1);
00823 meNDigisCHANBarrelL3_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelL3","Number of Digis L3",100,0.,1000.);
00824 meNDigisCHANBarrelL3_->setAxisTitle("Number of digis per FED channel per event",1);
00825 meNDigisCHANBarrelCh1_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh1","Number of Digis Ch1",100,0.,1000.);
00826 meNDigisCHANBarrelCh1_->setAxisTitle("Number of digis per FED channel per event",1);
00827 meNDigisCHANBarrelCh2_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh2","Number of Digis Ch2",100,0.,1000.);
00828 meNDigisCHANBarrelCh2_->setAxisTitle("Number of digis per FED channel per event",1);
00829 meNDigisCHANBarrelCh3_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh3","Number of Digis Ch3",100,0.,1000.);
00830 meNDigisCHANBarrelCh3_->setAxisTitle("Number of digis per FED channel per event",1);
00831 meNDigisCHANBarrelCh4_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh4","Number of Digis Ch4",100,0.,1000.);
00832 meNDigisCHANBarrelCh4_->setAxisTitle("Number of digis per FED channel per event",1);
00833 meNDigisCHANBarrelCh5_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh5","Number of Digis Ch5",100,0.,1000.);
00834 meNDigisCHANBarrelCh5_->setAxisTitle("Number of digis per FED channel per event",1);
00835 meNDigisCHANBarrelCh6_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh6","Number of Digis Ch6",100,0.,1000.);
00836 meNDigisCHANBarrelCh6_->setAxisTitle("Number of digis per FED channel per event",1);
00837 meNDigisCHANBarrelCh7_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh7","Number of Digis Ch7",100,0.,1000.);
00838 meNDigisCHANBarrelCh7_->setAxisTitle("Number of digis per FED channel per event",1);
00839 meNDigisCHANBarrelCh8_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh8","Number of Digis Ch8",100,0.,1000.);
00840 meNDigisCHANBarrelCh8_->setAxisTitle("Number of digis per FED channel per event",1);
00841 meNDigisCHANBarrelCh9_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh9","Number of Digis Ch9",100,0.,1000.);
00842 meNDigisCHANBarrelCh9_->setAxisTitle("Number of digis per FED channel per event",1);
00843 meNDigisCHANBarrelCh10_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh10","Number of Digis Ch10",100,0.,1000.);
00844 meNDigisCHANBarrelCh10_->setAxisTitle("Number of digis per FED channel per event",1);
00845 meNDigisCHANBarrelCh11_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh11","Number of Digis Ch11",100,0.,1000.);
00846 meNDigisCHANBarrelCh11_->setAxisTitle("Number of digis per FED channel per event",1);
00847 meNDigisCHANBarrelCh12_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh12","Number of Digis Ch12",100,0.,1000.);
00848 meNDigisCHANBarrelCh12_->setAxisTitle("Number of digis per FED channel per event",1);
00849 meNDigisCHANBarrelCh13_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh13","Number of Digis Ch13",100,0.,1000.);
00850 meNDigisCHANBarrelCh13_->setAxisTitle("Number of digis per FED channel per event",1);
00851 meNDigisCHANBarrelCh14_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh14","Number of Digis Ch14",100,0.,1000.);
00852 meNDigisCHANBarrelCh14_->setAxisTitle("Number of digis per FED channel per event",1);
00853 meNDigisCHANBarrelCh15_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh15","Number of Digis Ch15",100,0.,1000.);
00854 meNDigisCHANBarrelCh15_->setAxisTitle("Number of digis per FED channel per event",1);
00855 meNDigisCHANBarrelCh16_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh16","Number of Digis Ch16",100,0.,1000.);
00856 meNDigisCHANBarrelCh16_->setAxisTitle("Number of digis per FED channel per event",1);
00857 meNDigisCHANBarrelCh17_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh17","Number of Digis Ch17",100,0.,1000.);
00858 meNDigisCHANBarrelCh17_->setAxisTitle("Number of digis per FED channel per event",1);
00859 meNDigisCHANBarrelCh18_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh18","Number of Digis Ch18",100,0.,1000.);
00860 meNDigisCHANBarrelCh18_->setAxisTitle("Number of digis per FED channel per event",1);
00861 meNDigisCHANBarrelCh19_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh19","Number of Digis Ch19",100,0.,1000.);
00862 meNDigisCHANBarrelCh19_->setAxisTitle("Number of digis per FED channel per event",1);
00863 meNDigisCHANBarrelCh20_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh20","Number of Digis Ch20",100,0.,1000.);
00864 meNDigisCHANBarrelCh20_->setAxisTitle("Number of digis per FED channel per event",1);
00865 meNDigisCHANBarrelCh21_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh21","Number of Digis Ch21",100,0.,1000.);
00866 meNDigisCHANBarrelCh21_->setAxisTitle("Number of digis per FED channel per event",1);
00867 meNDigisCHANBarrelCh22_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh22","Number of Digis Ch22",100,0.,1000.);
00868 meNDigisCHANBarrelCh22_->setAxisTitle("Number of digis per FED channel per event",1);
00869 meNDigisCHANBarrelCh23_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh23","Number of Digis Ch23",100,0.,1000.);
00870 meNDigisCHANBarrelCh23_->setAxisTitle("Number of digis per FED channel per event",1);
00871 meNDigisCHANBarrelCh24_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh24","Number of Digis Ch24",100,0.,1000.);
00872 meNDigisCHANBarrelCh24_->setAxisTitle("Number of digis per FED channel per event",1);
00873 meNDigisCHANBarrelCh25_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh25","Number of Digis Ch25",100,0.,1000.);
00874 meNDigisCHANBarrelCh25_->setAxisTitle("Number of digis per FED channel per event",1);
00875 meNDigisCHANBarrelCh26_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh26","Number of Digis Ch26",100,0.,1000.);
00876 meNDigisCHANBarrelCh26_->setAxisTitle("Number of digis per FED channel per event",1);
00877 meNDigisCHANBarrelCh27_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh27","Number of Digis Ch27",100,0.,1000.);
00878 meNDigisCHANBarrelCh27_->setAxisTitle("Number of digis per FED channel per event",1);
00879 meNDigisCHANBarrelCh28_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh28","Number of Digis Ch28",100,0.,1000.);
00880 meNDigisCHANBarrelCh28_->setAxisTitle("Number of digis per FED channel per event",1);
00881 meNDigisCHANBarrelCh29_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh29","Number of Digis Ch29",100,0.,1000.);
00882 meNDigisCHANBarrelCh29_->setAxisTitle("Number of digis per FED channel per event",1);
00883 meNDigisCHANBarrelCh30_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh30","Number of Digis Ch30",100,0.,1000.);
00884 meNDigisCHANBarrelCh30_->setAxisTitle("Number of digis per FED channel per event",1);
00885 meNDigisCHANBarrelCh31_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh31","Number of Digis Ch31",100,0.,1000.);
00886 meNDigisCHANBarrelCh31_->setAxisTitle("Number of digis per FED channel per event",1);
00887 meNDigisCHANBarrelCh32_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh32","Number of Digis Ch32",100,0.,1000.);
00888 meNDigisCHANBarrelCh32_->setAxisTitle("Number of digis per FED channel per event",1);
00889 meNDigisCHANBarrelCh33_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh33","Number of Digis Ch33",100,0.,1000.);
00890 meNDigisCHANBarrelCh33_->setAxisTitle("Number of digis per FED channel per event",1);
00891 meNDigisCHANBarrelCh34_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh34","Number of Digis Ch34",100,0.,1000.);
00892 meNDigisCHANBarrelCh34_->setAxisTitle("Number of digis per FED channel per event",1);
00893 meNDigisCHANBarrelCh35_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh35","Number of Digis Ch35",100,0.,1000.);
00894 meNDigisCHANBarrelCh35_->setAxisTitle("Number of digis per FED channel per event",1);
00895 meNDigisCHANBarrelCh36_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh36","Number of Digis Ch36",100,0.,1000.);
00896 meNDigisCHANBarrelCh36_->setAxisTitle("Number of digis per FED channel per event",1);
00897 theDMBE->cd("Pixel/Endcap");
00898 meNDigisCOMBEndcap_ = theDMBE->book1D("ALLMODS_ndigisCOMB_Endcap","Number of Digis",200,0.,400.);
00899 meNDigisCOMBEndcap_->setAxisTitle("Number of digis per module per event",1);
00900 meNDigisCHANEndcap_ = theDMBE->book1D("ALLMODS_ndigisCHAN_Endcap","Number of Digis",100,0.,1000.);
00901 meNDigisCHANEndcap_->setAxisTitle("Number of digis per FED channel per event",1);
00902 meNDigisCHANEndcapDp1_ = theDMBE->book1D("ALLMODS_ndigisCHAN_EndcapDp1","Number of Digis Disk p1",100,0.,1000.);
00903 meNDigisCHANEndcapDp1_->setAxisTitle("Number of digis per FED channel per event",1);
00904 meNDigisCHANEndcapDp2_ = theDMBE->book1D("ALLMODS_ndigisCHAN_EndcapDp2","Number of Digis Disk p2",100,0.,1000.);
00905 meNDigisCHANEndcapDp2_->setAxisTitle("Number of digis per FED channel per event",1);
00906 meNDigisCHANEndcapDm1_ = theDMBE->book1D("ALLMODS_ndigisCHAN_EndcapDm1","Number of Digis Disk m1",100,0.,1000.);
00907 meNDigisCHANEndcapDm1_->setAxisTitle("Number of digis per FED channel per event",1);
00908 meNDigisCHANEndcapDm2_ = theDMBE->book1D("ALLMODS_ndigisCHAN_EndcapDm2","Number of Digis Disk m2",100,0.,1000.);
00909 meNDigisCHANEndcapDm2_->setAxisTitle("Number of digis per FED channel per event",1);
00910 theDMBE->cd(currDir);
00911 }
00912
00913
00914 DEFINE_FWK_MODULE(SiPixelDigiSource);