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 if (lumiSection%10==0){
00205
00206 std::string baseDirs[2] = {"Pixel/Barrel", "Pixel/Endcap"};
00207 for (int i = 0; i < 2; ++i){
00208 theDMBE->cd(baseDirs[i]);
00209 vector<string> shellDirs = theDMBE->getSubdirs();
00210 for (vector<string>::const_iterator it = shellDirs.begin(); it != shellDirs.end(); it++) {
00211 theDMBE->cd(*it);
00212 vector<string> layDirs = theDMBE->getSubdirs();
00213 for (vector<string>::const_iterator itt = layDirs.begin(); itt != layDirs.end(); itt++) {
00214 theDMBE->cd(*itt);
00215 vector<string> contents = theDMBE->getMEs();
00216 for (vector<string>::const_iterator im = contents.begin(); im != contents.end(); im++) {
00217 if ((*im).find("rocmap") == string::npos) continue;
00218 MonitorElement* me = theDMBE->get((*itt)+"/"+(*im));
00219 if(me) me->Reset();}}}}
00220 }
00221 }
00222 if(!modOn){
00223 MonitorElement* meReset = theDMBE->get("Pixel/averageDigiOccupancy");
00224 if(meReset && lumiSection%1==0){
00225 meReset->Reset();
00226 nBPIXDigis = 0;
00227 nFPIXDigis = 0;
00228 for(int i=0; i!=40; i++) nDigisPerFed[i]=0;
00229 }
00230 }
00231
00232 std::map<uint32_t,SiPixelDigiModule*>::iterator struct_iter;
00233 for(int i=0; i!=192; i++) numberOfDigis[i]=0;
00234 for(int i=0; i!=1152; i++) nDigisPerChan[i]=0;
00235 for(int i=0; i!=4; i++) nDigisPerDisk[i]=0;
00236 for (struct_iter = thePixelStructure.begin() ; struct_iter != thePixelStructure.end() ; struct_iter++) {
00237 int numberOfDigisMod = (*struct_iter).second->fill(*input, modOn,
00238 ladOn, layOn, phiOn,
00239 bladeOn, diskOn, ringOn,
00240 twoDimOn, reducedSet, twoDimModOn, twoDimOnlyLayDisk,
00241 nDigisA, nDigisB);
00242 if(numberOfDigisMod>0){
00243
00244
00245 nEventDigis = nEventDigis + numberOfDigisMod;
00246 nActiveModules++;
00247 bool barrel = DetId((*struct_iter).first).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
00248 bool endcap = DetId((*struct_iter).first).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
00249
00250 if(barrel){
00251
00252 nBPIXDigis = nBPIXDigis + numberOfDigisMod;
00253
00254 for(int i=0; i!=768; ++i){
00255
00256 if((*struct_iter).first == I_detId[i]){
00257
00258 nDigisPerFed[I_fedId[i]]=nDigisPerFed[I_fedId[i]]+numberOfDigisMod;
00259
00260 int index1 = 0; int index2 = 0;
00261 if(I_linkId1[i]>0) index1 = I_fedId[i]*36+(I_linkId1[i]-1);
00262 if(I_linkId2[i]>0) index2 = I_fedId[i]*36+(I_linkId2[i]-1);
00263 if(nDigisA>0 && I_linkId1[i]>0) nDigisPerChan[index1]=nDigisPerChan[index1]+nDigisA;
00264 if(nDigisB>0 && I_linkId2[i]>0) nDigisPerChan[index2]=nDigisPerChan[index2]+nDigisB;
00265
00266 i=767;
00267 }
00268 }
00269
00270 }else if(endcap){
00271
00272
00273 nFPIXDigis = nFPIXDigis + numberOfDigisMod;
00274
00275 PixelEndcapName::HalfCylinder side = PixelEndcapName(DetId((*struct_iter).first)).halfCylinder();
00276 int disk = PixelEndcapName(DetId((*struct_iter).first)).diskName();
00277 int blade = PixelEndcapName(DetId((*struct_iter).first)).bladeName();
00278 int panel = PixelEndcapName(DetId((*struct_iter).first)).pannelName();
00279 int module = PixelEndcapName(DetId((*struct_iter).first)).plaquetteName();
00280
00281 int iter=0; int i=0;
00282 if(side==PixelEndcapName::mI){
00283 if(disk==1){
00284 i=0;
00285 if(panel==1){ if(module==1) nDM1P1M1+=numberOfDigisMod;
00286 else if(module==2) nDM1P1M2+=numberOfDigisMod;
00287 else if(module==3) nDM1P1M3+=numberOfDigisMod;
00288 else if(module==4) nDM1P1M4+=numberOfDigisMod;}
00289 else if(panel==2){ if(module==1) nDM1P2M1+=numberOfDigisMod;
00290 else if(module==2) nDM1P2M2+=numberOfDigisMod;
00291 else if(module==3) nDM1P2M3+=numberOfDigisMod; }
00292 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00293 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00294 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00295 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00296 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00297 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00298 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00299 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00300 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00301 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00302 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00303 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00304 }else if(disk==2){
00305 i=24;
00306 if(panel==1){ if(module==1) nDM2P1M1+=numberOfDigisMod;
00307 else if(module==2) nDM2P1M2+=numberOfDigisMod;
00308 else if(module==3) nDM2P1M3+=numberOfDigisMod;
00309 else if(module==4) nDM2P1M4+=numberOfDigisMod;}
00310 else if(panel==2){ if(module==1) nDM2P2M1+=numberOfDigisMod;
00311 else if(module==2) nDM2P2M2+=numberOfDigisMod;
00312 else if(module==3) nDM2P2M3+=numberOfDigisMod; }
00313 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00314 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00315 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00316 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00317 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00318 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00319 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00320 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00321 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00322 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00323 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00324 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00325 }
00326 }else if(side==PixelEndcapName::mO){
00327 if(disk==1){
00328 i=48;
00329 if(panel==1){ if(module==1) nDM1P1M1+=numberOfDigisMod;
00330 else if(module==2) nDM1P1M2+=numberOfDigisMod;
00331 else if(module==3) nDM1P1M3+=numberOfDigisMod;
00332 else if(module==4) nDM1P1M4+=numberOfDigisMod;}
00333 else if(panel==2){ if(module==1) nDM1P2M1+=numberOfDigisMod;
00334 else if(module==2) nDM1P2M2+=numberOfDigisMod;
00335 else if(module==3) nDM1P2M3+=numberOfDigisMod; }
00336 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00337 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00338 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00339 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00340 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00341 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00342 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00343 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00344 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00345 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00346 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00347 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00348 }else if(disk==2){
00349 i=72;
00350 if(panel==1){ if(module==1) nDM2P1M1+=numberOfDigisMod;
00351 else if(module==2) nDM2P1M2+=numberOfDigisMod;
00352 else if(module==3) nDM2P1M3+=numberOfDigisMod;
00353 else if(module==4) nDM2P1M4+=numberOfDigisMod;}
00354 else if(panel==2){ if(module==1) nDM2P2M1+=numberOfDigisMod;
00355 else if(module==2) nDM2P2M2+=numberOfDigisMod;
00356 else if(module==3) nDM2P2M3+=numberOfDigisMod; }
00357 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00358 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00359 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00360 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00361 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00362 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00363 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00364 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00365 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00366 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00367 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00368 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00369 }
00370 }else if(side==PixelEndcapName::pI){
00371 if(disk==1){
00372 i=96;
00373 if(panel==1){ if(module==1) nDP1P1M1+=numberOfDigisMod;
00374 else if(module==2) nDP1P1M2+=numberOfDigisMod;
00375 else if(module==3) nDP1P1M3+=numberOfDigisMod;
00376 else if(module==4) nDP1P1M4+=numberOfDigisMod;}
00377 else if(panel==2){ if(module==1) nDP1P2M1+=numberOfDigisMod;
00378 else if(module==2) nDP1P2M2+=numberOfDigisMod;
00379 else if(module==3) nDP1P2M3+=numberOfDigisMod; }
00380 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00381 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00382 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00383 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00384 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00385 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00386 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00387 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00388 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00389 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00390 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00391 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00392 }else if(disk==2){
00393 i=120;
00394 if(panel==1){ if(module==1) nDP2P1M1+=numberOfDigisMod;
00395 else if(module==2) nDP2P1M2+=numberOfDigisMod;
00396 else if(module==3) nDP2P1M3+=numberOfDigisMod;
00397 else if(module==4) nDP2P1M4+=numberOfDigisMod;}
00398 else if(panel==2){ if(module==1) nDP2P2M1+=numberOfDigisMod;
00399 else if(module==2) nDP2P2M2+=numberOfDigisMod;
00400 else if(module==3) nDP2P2M3+=numberOfDigisMod; }
00401 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00402 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00403 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00404 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00405 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00406 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00407 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00408 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00409 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00410 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00411 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00412 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00413 }
00414 }else if(side==PixelEndcapName::pO){
00415 if(disk==1){
00416 i=144;
00417 if(panel==1){ if(module==1) nDP1P1M1+=numberOfDigisMod;
00418 else if(module==2) nDP1P1M2+=numberOfDigisMod;
00419 else if(module==3) nDP1P1M3+=numberOfDigisMod;
00420 else if(module==4) nDP1P1M4+=numberOfDigisMod;}
00421 else if(panel==2){ if(module==1) nDP1P2M1+=numberOfDigisMod;
00422 else if(module==2) nDP1P2M2+=numberOfDigisMod;
00423 else if(module==3) nDP1P2M3+=numberOfDigisMod; }
00424 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00425 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00426 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00427 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00428 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00429 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00430 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00431 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00432 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00433 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00434 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00435 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00436 }else if(disk==2){
00437 i=168;
00438 if(panel==1){ if(module==1) nDP2P1M1+=numberOfDigisMod;
00439 else if(module==2) nDP2P1M2+=numberOfDigisMod;
00440 else if(module==3) nDP2P1M3+=numberOfDigisMod;
00441 else if(module==4) nDP2P1M4+=numberOfDigisMod;}
00442 else if(panel==2){ if(module==1) nDP2P2M1+=numberOfDigisMod;
00443 else if(module==2) nDP2P2M2+=numberOfDigisMod;
00444 else if(module==3) nDP2P2M3+=numberOfDigisMod; }
00445 if(blade==1){ if(panel==1) iter=i; else if(panel==2) iter=i+1; }
00446 if(blade==2){ if(panel==1) iter=i+2; else if(panel==2) iter=i+3; }
00447 if(blade==3){ if(panel==1) iter=i+4; else if(panel==2) iter=i+5; }
00448 if(blade==4){ if(panel==1) iter=i+6; else if(panel==2) iter=i+7; }
00449 if(blade==5){ if(panel==1) iter=i+8; else if(panel==2) iter=i+9; }
00450 if(blade==6){ if(panel==1) iter=i+10; else if(panel==2) iter=i+11; }
00451 if(blade==7){ if(panel==1) iter=i+12; else if(panel==2) iter=i+13; }
00452 if(blade==8){ if(panel==1) iter=i+14; else if(panel==2) iter=i+15; }
00453 if(blade==9){ if(panel==1) iter=i+16; else if(panel==2) iter=i+17; }
00454 if(blade==10){ if(panel==1) iter=i+18; else if(panel==2) iter=i+19; }
00455 if(blade==11){ if(panel==1) iter=i+20; else if(panel==2) iter=i+21; }
00456 if(blade==12){ if(panel==1) iter=i+22; else if(panel==2) iter=i+23; }
00457 }
00458 }
00459 numberOfDigis[iter]=numberOfDigis[iter]+numberOfDigisMod;
00460
00461
00462
00463
00464 for(int i=768; i!=1440; i++){
00465
00466 if((*struct_iter).first == I_detId[i]){
00467
00468 nDigisPerFed[I_fedId[i]]=nDigisPerFed[I_fedId[i]]+numberOfDigisMod;
00469
00470 i=1439;
00471 }
00472 }
00473
00474 }
00475
00476
00477 }
00478 }
00479
00480
00481 int NzeroROCs[2] = {0,-672};
00482 int NloEffROCs[2] = {0,-672};
00483 std::string baseDirs[2] = {"Pixel/Barrel", "Pixel/Endcap"};
00484 if (lumiSection%10> 2){
00485 for (int i = 0; i < 2; ++i){
00486 theDMBE->cd(baseDirs[i]);
00487 vector<string> shellDirs = theDMBE->getSubdirs();
00488 for (vector<string>::const_iterator it = shellDirs.begin(); it != shellDirs.end(); it++) {
00489 theDMBE->cd(*it);
00490 vector<string> layDirs = theDMBE->getSubdirs();
00491 for (vector<string>::const_iterator itt = layDirs.begin(); itt != layDirs.end(); itt++) {
00492 theDMBE->cd(*itt);
00493 vector<string> contents = theDMBE->getMEs();
00494 for (vector<string>::const_iterator im = contents.begin(); im != contents.end(); im++) {
00495 if ((*im).find("rocmap") == string::npos) continue;
00496 MonitorElement* me = theDMBE->get((*itt)+"/"+(*im));
00497 if(!me) continue;
00498 MonitorElement* me2;
00499 me2 = theDMBE->get((*itt)+"/zeroOccROC_map");
00500 float SF = 1.0; if (me->getEntries() > 0) SF = float(me->getNbinsX()*me->getNbinsY()/me->getEntries());
00501 for (int ii = 1; ii < me->getNbinsX()+1; ++ii){for (int jj = 1; jj < me->getNbinsY()+1; ++jj){
00502
00503 float localX = float(ii)-0.5;
00504 float localY = float(jj)/2.0 + 1.25;
00505 if (i ==1) localY = float(jj)/2.0 + 0.75;
00506 if (me->getBinContent(ii,jj) < 1) {++NzeroROCs[i]; if (me2) me2->Fill(localX, localY);}
00507 if (me->getBinContent(ii,jj)*SF < 0.25) ++NloEffROCs[i];}}
00508 }
00509 }
00510 }
00511 }
00512 for (int i =0; i < 2; ++i) NloEffROCs[i] = NloEffROCs[i] - NzeroROCs[i];
00513 MonitorElement* menoOcc=theDMBE->get("Pixel/noOccROCsBarrel");
00514 MonitorElement* meloOcc=theDMBE->get("Pixel/loOccROCsBarrel");
00515 if(menoOcc) menoOcc->setBinContent(1+lumiSection/10, NzeroROCs[0]);
00516 if(meloOcc) meloOcc->setBinContent(1+lumiSection/10, NloEffROCs[0]);
00517 MonitorElement* menoOcc1=theDMBE->get("Pixel/noOccROCsEndcap");
00518 MonitorElement* meloOcc1=theDMBE->get("Pixel/loOccROCsEndcap");
00519 if(menoOcc1) menoOcc1->setBinContent(1+lumiSection/10, NzeroROCs[1]);
00520 if(meloOcc1) meloOcc1->setBinContent(1+lumiSection/10, NloEffROCs[1]);
00521 theDMBE->cd();
00522 }
00523
00524
00525
00526
00527 MonitorElement* meE; MonitorElement* meE1; MonitorElement* meE2; MonitorElement* meE3; MonitorElement* meE4;
00528 meE=theDMBE->get("Pixel/Endcap/ALLMODS_ndigisCHAN_Endcap");
00529 if(meE){ for(int j=0; j!=192; j++) if(numberOfDigis[j]>0) meE->Fill((float)numberOfDigis[j]);}
00530 meE1=theDMBE->get("Pixel/Endcap/ALLMODS_ndigisCHAN_EndcapDm1");
00531 if(meE1){ for(int j=0; j!=72; j++) if((j<24||j>47)&&numberOfDigis[j]>0) meE1->Fill((float)numberOfDigis[j]);}
00532 meE2=theDMBE->get("Pixel/Endcap/ALLMODS_ndigisCHAN_EndcapDm2");
00533 if(meE2){ for(int j=24; j!=96; j++) if((j<48||j>71)&&numberOfDigis[j]>0) meE2->Fill((float)numberOfDigis[j]);}
00534 meE3=theDMBE->get("Pixel/Endcap/ALLMODS_ndigisCHAN_EndcapDp1");
00535 if(meE3){ for(int j=96; j!=168; j++) if((j<120||j>143)&&numberOfDigis[j]>0) meE3->Fill((float)numberOfDigis[j]);}
00536 meE4=theDMBE->get("Pixel/Endcap/ALLMODS_ndigisCHAN_EndcapDp2");
00537 if(meE4){ for(int j=120; j!=192; j++) if((j<144||j>167)&&numberOfDigis[j]>0) meE4->Fill((float)numberOfDigis[j]);}
00538
00539 MonitorElement* me1; MonitorElement* me2; MonitorElement* me3; MonitorElement* me4; MonitorElement* me5;
00540 MonitorElement* me6; MonitorElement* me7; MonitorElement* me8; MonitorElement* me9; MonitorElement* me10; MonitorElement* me11;
00541 MonitorElement* me12; MonitorElement* me13; MonitorElement* me14; MonitorElement* me15; MonitorElement* me16; MonitorElement* me17;
00542 MonitorElement* me18; MonitorElement* me19; MonitorElement* me20; MonitorElement* me21; MonitorElement* me22; MonitorElement* me23;
00543 MonitorElement* me24; MonitorElement* me25; MonitorElement* me26; MonitorElement* me27; MonitorElement* me28; MonitorElement* me29;
00544 MonitorElement* me30; MonitorElement* me31; MonitorElement* me32; MonitorElement* me33; MonitorElement* me34; MonitorElement* me35;
00545 MonitorElement* me36;
00546 me1=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh1");
00547 if(me1){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+0]>0) me1->Fill((float)nDigisPerChan[i*36+0]);}
00548 me2=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh2");
00549 if(me2){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+1]>0) me2->Fill((float)nDigisPerChan[i*36+1]);}
00550 me3=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh3");
00551 if(me3){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+2]>0) me3->Fill((float)nDigisPerChan[i*36+2]);}
00552 me4=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh4");
00553 if(me4){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+3]>0) me4->Fill((float)nDigisPerChan[i*36+3]);}
00554 me5=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh5");
00555 if(me5){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+4]>0) me5->Fill((float)nDigisPerChan[i*36+4]);}
00556 me6=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh6");
00557 if(me6){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+5]>0) me6->Fill((float)nDigisPerChan[i*36+5]);}
00558 me7=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh7");
00559 if(me7){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+6]>0) me7->Fill((float)nDigisPerChan[i*36+6]);}
00560 me8=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh8");
00561 if(me8){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+7]>0) me8->Fill((float)nDigisPerChan[i*36+7]);}
00562 me9=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh9");
00563 if(me9){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+8]>0) me9->Fill((float)nDigisPerChan[i*36+8]);}
00564 me10=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh10");
00565 if(me10){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+9]>0) me10->Fill((float)nDigisPerChan[i*36+9]);}
00566 me11=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh11");
00567 if(me11){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+10]>0) me11->Fill((float)nDigisPerChan[i*36+10]);}
00568 me12=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh12");
00569 if(me12){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+11]>0) me12->Fill((float)nDigisPerChan[i*36+11]);}
00570 me13=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh13");
00571 if(me13){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+12]>0) me13->Fill((float)nDigisPerChan[i*36+12]);}
00572 me14=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh14");
00573 if(me14){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+13]>0) me14->Fill((float)nDigisPerChan[i*36+13]);}
00574 me15=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh15");
00575 if(me15){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+14]>0) me15->Fill((float)nDigisPerChan[i*36+14]);}
00576 me16=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh16");
00577 if(me16){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+15]>0) me16->Fill((float)nDigisPerChan[i*36+15]);}
00578 me17=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh17");
00579 if(me17){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+16]>0) me17->Fill((float)nDigisPerChan[i*36+16]);}
00580 me18=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh18");
00581 if(me18){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+17]>0) me18->Fill((float)nDigisPerChan[i*36+17]);}
00582 me19=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh19");
00583 if(me19){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+18]>0) me19->Fill((float)nDigisPerChan[i*36+18]);}
00584 me20=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh20");
00585 if(me20){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+19]>0) me20->Fill((float)nDigisPerChan[i*36+19]);}
00586 me21=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh21");
00587 if(me21){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+20]>0) me21->Fill((float)nDigisPerChan[i*36+20]);}
00588 me22=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh22");
00589 if(me22){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+21]>0) me22->Fill((float)nDigisPerChan[i*36+21]);}
00590 me23=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh23");
00591 if(me23){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+22]>0) me23->Fill((float)nDigisPerChan[i*36+22]);}
00592 me24=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh24");
00593 if(me24){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+23]>0) me24->Fill((float)nDigisPerChan[i*36+23]);}
00594 me25=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh25");
00595 if(me25){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+24]>0) me25->Fill((float)nDigisPerChan[i*36+24]);}
00596 me26=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh26");
00597 if(me26){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+25]>0) me26->Fill((float)nDigisPerChan[i*36+25]);}
00598 me27=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh27");
00599 if(me27){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+26]>0) me27->Fill((float)nDigisPerChan[i*36+26]);}
00600 me28=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh28");
00601 if(me28){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+27]>0) me28->Fill((float)nDigisPerChan[i*36+27]);}
00602 me29=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh29");
00603 if(me29){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+28]>0) me29->Fill((float)nDigisPerChan[i*36+28]);}
00604 me30=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh30");
00605 if(me30){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+29]>0) me30->Fill((float)nDigisPerChan[i*36+29]);}
00606 me31=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh31");
00607 if(me31){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+30]>0) me31->Fill((float)nDigisPerChan[i*36+30]);}
00608 me32=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh32");
00609 if(me32){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+31]>0) me32->Fill((float)nDigisPerChan[i*36+31]);}
00610 me33=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh33");
00611 if(me33){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+32]>0) me33->Fill((float)nDigisPerChan[i*36+32]);}
00612 me34=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh34");
00613 if(me34){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+33]>0) me34->Fill((float)nDigisPerChan[i*36+33]);}
00614 me35=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh35");
00615 if(me35){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+34]>0) me35->Fill((float)nDigisPerChan[i*36+34]);}
00616 me36=theDMBE->get("Pixel/Barrel/ALLMODS_ndigisCHAN_BarrelCh36");
00617 if(me36){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+35]>0) me36->Fill((float)nDigisPerChan[i*36+35]);}
00618
00619
00620 MonitorElement* meX1;
00621 if(nEventDigis>bigEventSize){
00622 meX1 = theDMBE->get("Pixel/bigEventRate");
00623 if(meX1) meX1->Fill(lumiSection,1./23.);
00624 }
00625
00626
00627
00628 MonitorElement* meX2; MonitorElement* meX3;
00629 if(nActiveModules>=4){
00630 meX2 = theDMBE->get("Pixel/pixEvtsPerBX");
00631 if(meX2) meX2->Fill(float(bx));
00632 meX3 = theDMBE->get("Pixel/pixEventRate");
00633 if(meX3) meX3->Fill(lumiSection, 1./23.);
00634 }
00635
00636
00637 MonitorElement* meX4; MonitorElement* meX5;
00638 meX4 = theDMBE->get("Pixel/averageDigiOccupancy");
00639 meX5 = theDMBE->get("Pixel/avgfedDigiOccvsLumi");
00640 if(meX4){
00641 int maxfed=0;
00642 for(int i=0; i!=32; i++){
00643 if(nDigisPerFed[i]>maxfed) maxfed=nDigisPerFed[i];
00644 }
00645 for(int i=0; i!=40; i++){
00646 float averageOcc = 0.;
00647 if(i<32){
00648 float averageBPIXFed = float(nBPIXDigis-maxfed)/31.;
00649 if(averageBPIXFed>0.) averageOcc = nDigisPerFed[i]/averageBPIXFed;
00650
00651 }else{
00652 float averageFPIXFed = float(nFPIXDigis)/8.;
00653 if(averageFPIXFed>0.) averageOcc = nDigisPerFed[i]/averageFPIXFed;
00654
00655 }
00656 meX4->setBinContent(i+1,averageOcc);
00657 int lumiSections8 = int(lumiSection/8);
00658 if (modOn){
00659 if (meX5){
00660 meX5->setBinContent(1+lumiSections8, i+1, averageOcc);
00661 }
00662 }
00663 }
00664 }
00665
00666
00667 if(slowDown) usleep(10000);
00668
00669 }
00670
00671
00672
00673
00674 void SiPixelDigiSource::buildStructure(const edm::EventSetup& iSetup){
00675
00676 LogInfo ("PixelDQM") <<" SiPixelDigiSource::buildStructure" ;
00677 edm::ESHandle<TrackerGeometry> pDD;
00678 iSetup.get<TrackerDigiGeometryRecord>().get( pDD );
00679
00680 LogVerbatim ("PixelDQM") << " *** Geometry node for TrackerGeom is "<<&(*pDD)<<std::endl;
00681 LogVerbatim ("PixelDQM") << " *** I have " << pDD->dets().size() <<" detectors"<<std::endl;
00682 LogVerbatim ("PixelDQM") << " *** I have " << pDD->detTypes().size() <<" types"<<std::endl;
00683
00684 for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){
00685
00686 if(dynamic_cast<PixelGeomDetUnit*>((*it))!=0){
00687
00688 DetId detId = (*it)->geographicalId();
00689 const GeomDetUnit * geoUnit = pDD->idToDetUnit( detId );
00690 const PixelGeomDetUnit * pixDet = dynamic_cast<const PixelGeomDetUnit*>(geoUnit);
00691 int nrows = (pixDet->specificTopology()).nrows();
00692 int ncols = (pixDet->specificTopology()).ncolumns();
00693
00694 if(detId.subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) {
00695 if(isPIB) continue;
00696 LogDebug ("PixelDQM") << " ---> Adding Barrel Module " << detId.rawId() << endl;
00697 uint32_t id = detId();
00698 SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows);
00699 thePixelStructure.insert(pair<uint32_t,SiPixelDigiModule*> (id,theModule));
00700
00701 } else if(detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) {
00702 LogDebug ("PixelDQM") << " ---> Adding Endcap Module " << detId.rawId() << endl;
00703 uint32_t id = detId();
00704 SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows);
00705
00706 PixelEndcapName::HalfCylinder side = PixelEndcapName(DetId(id)).halfCylinder();
00707 int disk = PixelEndcapName(DetId(id)).diskName();
00708 int blade = PixelEndcapName(DetId(id)).bladeName();
00709 int panel = PixelEndcapName(DetId(id)).pannelName();
00710 int module = PixelEndcapName(DetId(id)).plaquetteName();
00711
00712 char sside[80]; sprintf(sside, "HalfCylinder_%i",side);
00713 char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
00714 char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
00715 char spanel[80]; sprintf(spanel, "Panel_%i",panel);
00716 char smodule[80];sprintf(smodule,"Module_%i",module);
00717 std::string side_str = sside;
00718 std::string disk_str = sdisk;
00719 bool mask = side_str.find("HalfCylinder_1")!=string::npos||
00720 side_str.find("HalfCylinder_2")!=string::npos||
00721 side_str.find("HalfCylinder_4")!=string::npos||
00722 disk_str.find("Disk_2")!=string::npos;
00723
00724 mask = false;
00725 if(isPIB && mask) continue;
00726
00727 thePixelStructure.insert(pair<uint32_t,SiPixelDigiModule*> (id,theModule));
00728 }
00729
00730 }
00731 }
00732 LogInfo ("PixelDQM") << " *** Pixel Structure Size " << thePixelStructure.size() << endl;
00733 }
00734
00735
00736
00737 void SiPixelDigiSource::bookMEs(){
00738
00739
00740 DQMStore* theDMBE = edm::Service<DQMStore>().operator->();
00741 theDMBE->setCurrentFolder("Pixel");
00742 char title[80]; sprintf(title, "Rate of events with >%i digis;LumiSection;Rate [Hz]",bigEventSize);
00743 bigEventRate = theDMBE->book1D("bigEventRate",title,5000,0.,5000.);
00744 char title1[80]; sprintf(title1, "Pixel events vs. BX;BX;# events");
00745 pixEvtsPerBX = theDMBE->book1D("pixEvtsPerBX",title1,3565,0.,3565.);
00746 char title2[80]; sprintf(title2, "Rate of Pixel events;LumiSection;Rate [Hz]");
00747 pixEventRate = theDMBE->book1D("pixEventRate",title2,5000,0.,5000.);
00748 char title3[80]; sprintf(title3, "Number of Zero-Occupancy Barrel ROCs;LumiSection;N_{ZERO-OCCUPANCY} Barrel ROCs");
00749 noOccROCsBarrel = theDMBE->book1D("noOccROCsBarrel",title3,500,0.,5000.);
00750 char title4[80]; sprintf(title4, "Number of Low-Efficiency Barrel ROCs;LumiSection;N_{LO EFF} Barrel ROCs");
00751 loOccROCsBarrel = theDMBE->book1D("loOccROCsBarrel",title4,500,0.,5000.);
00752 char title5[80]; sprintf(title5, "Number of Zero-Occupancy Endcap ROCs;LumiSection;N_{ZERO-OCCUPANCY} Endcap ROCs");
00753 noOccROCsEndcap = theDMBE->book1D("noOccROCsEndcap",title5,500,0.,5000.);
00754 char title6[80]; sprintf(title6, "Number of Low-Efficiency Endcap ROCs;LumiSection;N_{LO EFF} Endcap ROCs");
00755 loOccROCsEndcap = theDMBE->book1D("loOccROCsEndcap",title6,500,0.,5000.);
00756 char title7[80]; sprintf(title7, "Average digi occupancy per FED;FED;NDigis/<NDigis>");
00757 averageDigiOccupancy = theDMBE->book1D("averageDigiOccupancy",title7,40,-0.5,39.5);
00758 averageDigiOccupancy->setLumiFlag();
00759 if(modOn){
00760 char title4[80]; sprintf(title4, "FED Digi Occupancy (NDigis/<NDigis>) vs LumiSections;Lumi Section;FED");
00761 avgfedDigiOccvsLumi = theDMBE->book2D ("avgfedDigiOccvsLumi", title4, 400,0., 3200., 40, -0.5, 39.5);
00762 }
00763 std::map<uint32_t,SiPixelDigiModule*>::iterator struct_iter;
00764
00765 SiPixelFolderOrganizer theSiPixelFolder;
00766
00767 for(struct_iter = thePixelStructure.begin(); struct_iter != thePixelStructure.end(); struct_iter++){
00769 if(modOn){
00770 if(theSiPixelFolder.setModuleFolder((*struct_iter).first)){
00771 (*struct_iter).second->book( conf_,0,twoDimOn,hiRes, reducedSet, twoDimModOn);
00772 } else {
00773
00774 if(!isPIB) throw cms::Exception("LogicError")
00775 << "[SiPixelDigiSource::bookMEs] Creation of DQM folder failed";
00776 }
00777 }
00778 if(ladOn){
00779 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,1)){
00780 (*struct_iter).second->book( conf_,1,twoDimOn,hiRes, reducedSet);
00781 } else {
00782 LogDebug ("PixelDQM") << "PROBLEM WITH LADDER-FOLDER\n";
00783 }
00784
00785 }
00786 if(layOn || twoDimOnlyLayDisk){
00787 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,2)){
00788 (*struct_iter).second->book( conf_,2,twoDimOn,hiRes, reducedSet, twoDimOnlyLayDisk);
00789 } else {
00790 LogDebug ("PixelDQM") << "PROBLEM WITH LAYER-FOLDER\n";
00791 }
00792 }
00793
00794 if(phiOn){
00795 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,3)){
00796 (*struct_iter).second->book( conf_,3,twoDimOn,hiRes, reducedSet);
00797 } else {
00798 LogDebug ("PixelDQM") << "PROBLEM WITH PHI-FOLDER\n";
00799 }
00800 }
00801 if(bladeOn){
00802 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,4)){
00803 (*struct_iter).second->book( conf_,4,twoDimOn,hiRes, reducedSet);
00804 } else {
00805 LogDebug ("PixelDQM") << "PROBLEM WITH BLADE-FOLDER\n";
00806 }
00807 }
00808 if(diskOn || twoDimOnlyLayDisk){
00809 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,5)){
00810 (*struct_iter).second->book( conf_,5,twoDimOn,hiRes, reducedSet, twoDimOnlyLayDisk);
00811 } else {
00812 LogDebug ("PixelDQM") << "PROBLEM WITH DISK-FOLDER\n";
00813 }
00814 }
00815 if(ringOn){
00816 if(theSiPixelFolder.setModuleFolder((*struct_iter).first,6)){
00817 (*struct_iter).second->book( conf_,6,twoDimOn,hiRes, reducedSet);
00818 } else {
00819 LogDebug ("PixelDQM") << "PROBLEM WITH RING-FOLDER\n";
00820 }
00821 }
00822 }
00823 std::string currDir = theDMBE->pwd();
00824 theDMBE->cd("Pixel/Barrel");
00825 meNDigisCOMBBarrel_ = theDMBE->book1D("ALLMODS_ndigisCOMB_Barrel","Number of Digis",200,0.,400.);
00826 meNDigisCOMBBarrel_->setAxisTitle("Number of digis per module per event",1);
00827 meNDigisCHANBarrel_ = theDMBE->book1D("ALLMODS_ndigisCHAN_Barrel","Number of Digis",100,0.,1000.);
00828 meNDigisCHANBarrel_->setAxisTitle("Number of digis per FED channel per event",1);
00829 meNDigisCHANBarrelL1_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelL1","Number of Digis L1",100,0.,1000.);
00830 meNDigisCHANBarrelL1_->setAxisTitle("Number of digis per FED channel per event",1);
00831 meNDigisCHANBarrelL2_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelL2","Number of Digis L2",100,0.,1000.);
00832 meNDigisCHANBarrelL2_->setAxisTitle("Number of digis per FED channel per event",1);
00833 meNDigisCHANBarrelL3_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelL3","Number of Digis L3",100,0.,1000.);
00834 meNDigisCHANBarrelL3_->setAxisTitle("Number of digis per FED channel per event",1);
00835 meNDigisCHANBarrelCh1_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh1","Number of Digis Ch1",100,0.,1000.);
00836 meNDigisCHANBarrelCh1_->setAxisTitle("Number of digis per FED channel per event",1);
00837 meNDigisCHANBarrelCh2_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh2","Number of Digis Ch2",100,0.,1000.);
00838 meNDigisCHANBarrelCh2_->setAxisTitle("Number of digis per FED channel per event",1);
00839 meNDigisCHANBarrelCh3_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh3","Number of Digis Ch3",100,0.,1000.);
00840 meNDigisCHANBarrelCh3_->setAxisTitle("Number of digis per FED channel per event",1);
00841 meNDigisCHANBarrelCh4_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh4","Number of Digis Ch4",100,0.,1000.);
00842 meNDigisCHANBarrelCh4_->setAxisTitle("Number of digis per FED channel per event",1);
00843 meNDigisCHANBarrelCh5_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh5","Number of Digis Ch5",100,0.,1000.);
00844 meNDigisCHANBarrelCh5_->setAxisTitle("Number of digis per FED channel per event",1);
00845 meNDigisCHANBarrelCh6_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh6","Number of Digis Ch6",100,0.,1000.);
00846 meNDigisCHANBarrelCh6_->setAxisTitle("Number of digis per FED channel per event",1);
00847 meNDigisCHANBarrelCh7_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh7","Number of Digis Ch7",100,0.,1000.);
00848 meNDigisCHANBarrelCh7_->setAxisTitle("Number of digis per FED channel per event",1);
00849 meNDigisCHANBarrelCh8_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh8","Number of Digis Ch8",100,0.,1000.);
00850 meNDigisCHANBarrelCh8_->setAxisTitle("Number of digis per FED channel per event",1);
00851 meNDigisCHANBarrelCh9_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh9","Number of Digis Ch9",100,0.,1000.);
00852 meNDigisCHANBarrelCh9_->setAxisTitle("Number of digis per FED channel per event",1);
00853 meNDigisCHANBarrelCh10_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh10","Number of Digis Ch10",100,0.,1000.);
00854 meNDigisCHANBarrelCh10_->setAxisTitle("Number of digis per FED channel per event",1);
00855 meNDigisCHANBarrelCh11_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh11","Number of Digis Ch11",100,0.,1000.);
00856 meNDigisCHANBarrelCh11_->setAxisTitle("Number of digis per FED channel per event",1);
00857 meNDigisCHANBarrelCh12_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh12","Number of Digis Ch12",100,0.,1000.);
00858 meNDigisCHANBarrelCh12_->setAxisTitle("Number of digis per FED channel per event",1);
00859 meNDigisCHANBarrelCh13_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh13","Number of Digis Ch13",100,0.,1000.);
00860 meNDigisCHANBarrelCh13_->setAxisTitle("Number of digis per FED channel per event",1);
00861 meNDigisCHANBarrelCh14_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh14","Number of Digis Ch14",100,0.,1000.);
00862 meNDigisCHANBarrelCh14_->setAxisTitle("Number of digis per FED channel per event",1);
00863 meNDigisCHANBarrelCh15_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh15","Number of Digis Ch15",100,0.,1000.);
00864 meNDigisCHANBarrelCh15_->setAxisTitle("Number of digis per FED channel per event",1);
00865 meNDigisCHANBarrelCh16_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh16","Number of Digis Ch16",100,0.,1000.);
00866 meNDigisCHANBarrelCh16_->setAxisTitle("Number of digis per FED channel per event",1);
00867 meNDigisCHANBarrelCh17_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh17","Number of Digis Ch17",100,0.,1000.);
00868 meNDigisCHANBarrelCh17_->setAxisTitle("Number of digis per FED channel per event",1);
00869 meNDigisCHANBarrelCh18_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh18","Number of Digis Ch18",100,0.,1000.);
00870 meNDigisCHANBarrelCh18_->setAxisTitle("Number of digis per FED channel per event",1);
00871 meNDigisCHANBarrelCh19_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh19","Number of Digis Ch19",100,0.,1000.);
00872 meNDigisCHANBarrelCh19_->setAxisTitle("Number of digis per FED channel per event",1);
00873 meNDigisCHANBarrelCh20_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh20","Number of Digis Ch20",100,0.,1000.);
00874 meNDigisCHANBarrelCh20_->setAxisTitle("Number of digis per FED channel per event",1);
00875 meNDigisCHANBarrelCh21_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh21","Number of Digis Ch21",100,0.,1000.);
00876 meNDigisCHANBarrelCh21_->setAxisTitle("Number of digis per FED channel per event",1);
00877 meNDigisCHANBarrelCh22_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh22","Number of Digis Ch22",100,0.,1000.);
00878 meNDigisCHANBarrelCh22_->setAxisTitle("Number of digis per FED channel per event",1);
00879 meNDigisCHANBarrelCh23_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh23","Number of Digis Ch23",100,0.,1000.);
00880 meNDigisCHANBarrelCh23_->setAxisTitle("Number of digis per FED channel per event",1);
00881 meNDigisCHANBarrelCh24_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh24","Number of Digis Ch24",100,0.,1000.);
00882 meNDigisCHANBarrelCh24_->setAxisTitle("Number of digis per FED channel per event",1);
00883 meNDigisCHANBarrelCh25_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh25","Number of Digis Ch25",100,0.,1000.);
00884 meNDigisCHANBarrelCh25_->setAxisTitle("Number of digis per FED channel per event",1);
00885 meNDigisCHANBarrelCh26_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh26","Number of Digis Ch26",100,0.,1000.);
00886 meNDigisCHANBarrelCh26_->setAxisTitle("Number of digis per FED channel per event",1);
00887 meNDigisCHANBarrelCh27_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh27","Number of Digis Ch27",100,0.,1000.);
00888 meNDigisCHANBarrelCh27_->setAxisTitle("Number of digis per FED channel per event",1);
00889 meNDigisCHANBarrelCh28_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh28","Number of Digis Ch28",100,0.,1000.);
00890 meNDigisCHANBarrelCh28_->setAxisTitle("Number of digis per FED channel per event",1);
00891 meNDigisCHANBarrelCh29_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh29","Number of Digis Ch29",100,0.,1000.);
00892 meNDigisCHANBarrelCh29_->setAxisTitle("Number of digis per FED channel per event",1);
00893 meNDigisCHANBarrelCh30_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh30","Number of Digis Ch30",100,0.,1000.);
00894 meNDigisCHANBarrelCh30_->setAxisTitle("Number of digis per FED channel per event",1);
00895 meNDigisCHANBarrelCh31_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh31","Number of Digis Ch31",100,0.,1000.);
00896 meNDigisCHANBarrelCh31_->setAxisTitle("Number of digis per FED channel per event",1);
00897 meNDigisCHANBarrelCh32_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh32","Number of Digis Ch32",100,0.,1000.);
00898 meNDigisCHANBarrelCh32_->setAxisTitle("Number of digis per FED channel per event",1);
00899 meNDigisCHANBarrelCh33_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh33","Number of Digis Ch33",100,0.,1000.);
00900 meNDigisCHANBarrelCh33_->setAxisTitle("Number of digis per FED channel per event",1);
00901 meNDigisCHANBarrelCh34_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh34","Number of Digis Ch34",100,0.,1000.);
00902 meNDigisCHANBarrelCh34_->setAxisTitle("Number of digis per FED channel per event",1);
00903 meNDigisCHANBarrelCh35_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh35","Number of Digis Ch35",100,0.,1000.);
00904 meNDigisCHANBarrelCh35_->setAxisTitle("Number of digis per FED channel per event",1);
00905 meNDigisCHANBarrelCh36_ = theDMBE->book1D("ALLMODS_ndigisCHAN_BarrelCh36","Number of Digis Ch36",100,0.,1000.);
00906 meNDigisCHANBarrelCh36_->setAxisTitle("Number of digis per FED channel per event",1);
00907 theDMBE->cd("Pixel/Endcap");
00908 meNDigisCOMBEndcap_ = theDMBE->book1D("ALLMODS_ndigisCOMB_Endcap","Number of Digis",200,0.,400.);
00909 meNDigisCOMBEndcap_->setAxisTitle("Number of digis per module per event",1);
00910 meNDigisCHANEndcap_ = theDMBE->book1D("ALLMODS_ndigisCHAN_Endcap","Number of Digis",100,0.,1000.);
00911 meNDigisCHANEndcap_->setAxisTitle("Number of digis per FED channel per event",1);
00912 meNDigisCHANEndcapDp1_ = theDMBE->book1D("ALLMODS_ndigisCHAN_EndcapDp1","Number of Digis Disk p1",100,0.,1000.);
00913 meNDigisCHANEndcapDp1_->setAxisTitle("Number of digis per FED channel per event",1);
00914 meNDigisCHANEndcapDp2_ = theDMBE->book1D("ALLMODS_ndigisCHAN_EndcapDp2","Number of Digis Disk p2",100,0.,1000.);
00915 meNDigisCHANEndcapDp2_->setAxisTitle("Number of digis per FED channel per event",1);
00916 meNDigisCHANEndcapDm1_ = theDMBE->book1D("ALLMODS_ndigisCHAN_EndcapDm1","Number of Digis Disk m1",100,0.,1000.);
00917 meNDigisCHANEndcapDm1_->setAxisTitle("Number of digis per FED channel per event",1);
00918 meNDigisCHANEndcapDm2_ = theDMBE->book1D("ALLMODS_ndigisCHAN_EndcapDm2","Number of Digis Disk m2",100,0.,1000.);
00919 meNDigisCHANEndcapDm2_->setAxisTitle("Number of digis per FED channel per event",1);
00920 theDMBE->cd(currDir);
00921 }
00922
00923
00924 DEFINE_FWK_MODULE(SiPixelDigiSource);