CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DQM/DTMonitorClient/src/DTEfficiencyTest.cc

Go to the documentation of this file.
00001 
00002 
00003 /*
00004  *  See header file for a description of this class.
00005  *
00006  *  $Date: 2011/11/24 09:17:30 $
00007  *  $Revision: 1.20 $
00008  *  \author G. Mila - INFN Torino
00009  */
00010 
00011 
00012 #include <DQM/DTMonitorClient/src/DTEfficiencyTest.h>
00013 
00014 // Framework
00015 #include <FWCore/Framework/interface/EventSetup.h>
00016 
00017 
00018 // Geometry
00019 #include "Geometry/Records/interface/MuonGeometryRecord.h"
00020 #include "Geometry/DTGeometry/interface/DTGeometry.h"
00021 #include "Geometry/DTGeometry/interface/DTLayer.h"
00022 #include "Geometry/DTGeometry/interface/DTTopology.h"
00023 
00024 #include "DQMServices/Core/interface/DQMStore.h"
00025 #include "DQMServices/Core/interface/MonitorElement.h"
00026 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00027 
00028 #include <stdio.h>
00029 #include <sstream>
00030 #include <math.h>
00031 
00032 
00033 using namespace edm;
00034 using namespace std;
00035 
00036 DTEfficiencyTest::DTEfficiencyTest(const edm::ParameterSet& ps){
00037 
00038   edm::LogVerbatim ("efficiency") << "[DTEfficiencyTest]: Constructor";
00039 
00040   parameters = ps;
00041 
00042   dbe = edm::Service<DQMStore>().operator->();
00043   
00044   prescaleFactor = parameters.getUntrackedParameter<int>("diagnosticPrescale", 1);
00045 
00046   percentual = parameters.getUntrackedParameter<int>("BadSLpercentual", 10);
00047 
00048 }
00049 
00050 DTEfficiencyTest::~DTEfficiencyTest(){
00051 
00052   edm::LogVerbatim ("efficiency") << "DTEfficiencyTest: analyzed " << nevents << " events";
00053 
00054 }
00055 
00056 
00057 void DTEfficiencyTest::beginJob(){
00058 
00059   edm::LogVerbatim ("efficiency") << "[DTEfficiencyTest]: BeginJob";
00060 
00061   nevents = 0;
00062 
00063 }
00064 
00065 void DTEfficiencyTest::beginRun(Run const& run, EventSetup const& context) {
00066 
00067   // Get the geometry
00068   context.get<MuonGeometryRecord>().get(muonGeom);
00069 
00070 }
00071 
00072 void DTEfficiencyTest::beginLuminosityBlock(LuminosityBlock const& lumiSeg, EventSetup const& context) {
00073 
00074   edm::LogVerbatim ("efficiency") <<"[DTEfficiencyTest]: Begin of LS transition";
00075 
00076   // Get the run number
00077   run = lumiSeg.run();
00078 
00079 }
00080 
00081 
00082 void DTEfficiencyTest::analyze(const edm::Event& e, const edm::EventSetup& context){
00083 
00084   nevents++;
00085   edm::LogVerbatim ("efficiency") << "[DTEfficiencyTest]: "<<nevents<<" events";
00086 }
00087 
00088 
00089 void DTEfficiencyTest::endLuminosityBlock(LuminosityBlock const& lumiSeg, EventSetup const& context) {
00090   
00091   // counts number of updats (online mode) or number of events (standalone mode)
00092   //nevents++;
00093   // if running in standalone perform diagnostic only after a reasonalbe amount of events
00094   //if ( parameters.getUntrackedParameter<bool>("runningStandalone", false) && 
00095   //     nevents%parameters.getUntrackedParameter<int>("diagnosticPrescale", 1000) != 0 ) return;
00096 
00097 
00098   for(map<int, MonitorElement*> ::const_iterator histo = wheelHistos.begin();
00099       histo != wheelHistos.end();
00100       histo++) {
00101     (*histo).second->Reset();
00102   }
00103 
00104   for(map<int, MonitorElement*> ::const_iterator histo = wheelUnassHistos.begin();
00105       histo != wheelUnassHistos.end();
00106       histo++) {
00107     (*histo).second->Reset();
00108   }
00109 
00110   edm::LogVerbatim ("efficiency") <<"[DTEfficiencyTest]: End of LS transition, performing the DQM client operation"; 
00111 
00112   // counts number of lumiSegs 
00113   nLumiSegs = lumiSeg.id().luminosityBlock();
00114 
00115   // prescale factor
00116   if ( nLumiSegs%prescaleFactor != 0 ) return;
00117 
00118   edm::LogVerbatim ("efficiency") <<"[DTEfficiencyTest]: "<<nLumiSegs<<" updates";
00119   
00120   vector<DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
00121   vector<DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
00122 
00123   edm::LogVerbatim ("efficiency") << "[DTEfficiencyTest]: Efficiency tests results";
00124 
00125   
00126   map <DTLayerId, vector<double> > LayerBadCells;
00127   LayerBadCells.clear();
00128   map <DTLayerId, vector<double> > LayerUnassBadCells;
00129   LayerUnassBadCells.clear();
00130   map <DTSuperLayerId, vector<double> > SuperLayerBadCells;
00131   SuperLayerBadCells.clear();
00132   map <DTSuperLayerId,vector<double> > SuperLayerUnassBadCells;
00133   SuperLayerUnassBadCells.clear();
00134   map <pair<int,int>, int> cmsHistos;
00135   cmsHistos.clear();
00136   map <pair<int,int>, bool> filled;
00137   for(int i=-2; i<3; i++){
00138     for(int j=1; j<15; j++){
00139       filled[make_pair(i,j)]=false;
00140     }
00141   }
00142   map <pair<int,int>, int> cmsUnassHistos;
00143   cmsUnassHistos.clear();
00144   map <pair<int,int>, bool> UnassFilled;
00145   for(int i=-2; i<3; i++){
00146     for(int j=1; j<15; j++){
00147       UnassFilled[make_pair(i,j)]=false;
00148     }
00149   }
00150   
00151   
00152 
00153   // Loop over the chambers
00154   for (; ch_it != ch_end; ++ch_it) {
00155     DTChamberId chID = (*ch_it)->id();
00156     vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin(); 
00157     vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
00158 
00159     // Loop over the SuperLayers
00160     for(; sl_it != sl_end; ++sl_it) {
00161       DTSuperLayerId slID = (*sl_it)->id();
00162       vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
00163       vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
00164       
00165       // Loop over the layers
00166       for(; l_it != l_end; ++l_it) {
00167         DTLayerId lID = (*l_it)->id();
00168          
00169         stringstream wheel; wheel << chID.wheel();
00170         stringstream station; station << chID.station();
00171         stringstream sector; sector << chID.sector();
00172         stringstream superLayer; superLayer << slID.superlayer();
00173         stringstream layer; layer << lID.layer();
00174         
00175         string HistoName = "W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() +  "_SL" + superLayer.str() +  "_L" + layer.str();
00176         
00177         // Get the ME produced by EfficiencyTask Source
00178         MonitorElement * occupancy_histo = dbe->get(getMEName("hEffOccupancy", lID));   
00179         MonitorElement * unassOccupancy_histo = dbe->get(getMEName("hEffUnassOccupancy", lID));
00180         MonitorElement * recSegmOccupancy_histo = dbe->get(getMEName("hRecSegmOccupancy", lID));
00181          
00182         // ME -> TH1F
00183         if(occupancy_histo && unassOccupancy_histo && recSegmOccupancy_histo) {   
00184           TH1F * occupancy_histo_root = occupancy_histo->getTH1F();
00185           TH1F * unassOccupancy_histo_root = unassOccupancy_histo->getTH1F();
00186           TH1F * recSegmOccupancy_histo_root = recSegmOccupancy_histo->getTH1F();
00187 
00188           const int firstWire = muonGeom->layer(lID)->specificTopology().firstChannel();
00189           const int lastWire = muonGeom->layer(lID)->specificTopology().lastChannel();
00190 
00191           // Loop over the TH1F bin and fill the ME to be used for the Quality Test
00192           for(int bin=firstWire; bin <= lastWire; bin++) {
00193             if((recSegmOccupancy_histo_root->GetBinContent(bin))!=0) {
00194               //cout<<"book histos"<<endl;
00195               if (EfficiencyHistos.find(lID) == EfficiencyHistos.end()) bookHistos(lID, firstWire, lastWire);
00196               float efficiency = occupancy_histo_root->GetBinContent(bin) / recSegmOccupancy_histo_root->GetBinContent(bin);
00197               float errorEff = sqrt(efficiency*(1-efficiency) / recSegmOccupancy_histo_root->GetBinContent(bin));
00198               EfficiencyHistos.find(lID)->second->setBinContent(bin, efficiency);
00199               EfficiencyHistos.find(lID)->second->setBinError(bin, errorEff);
00200                   
00201               if (UnassEfficiencyHistos.find(lID) == EfficiencyHistos.end()) bookHistos(lID, firstWire, lastWire);
00202               float unassEfficiency = unassOccupancy_histo_root->GetBinContent(bin) / recSegmOccupancy_histo_root->GetBinContent(bin);
00203               float errorUnassEff = sqrt(unassEfficiency*(1-unassEfficiency) / recSegmOccupancy_histo_root->GetBinContent(bin));
00204               UnassEfficiencyHistos.find(lID)->second->setBinContent(bin, unassEfficiency);     
00205               UnassEfficiencyHistos.find(lID)->second->setBinError(bin, errorUnassEff);
00206             }
00207           }
00208         }
00209       } // loop on layers
00210     } // loop on superlayers
00211   } //loop on chambers
00212   
00213 
00214 
00215   // Efficiency test 
00216   //cout<<"[DTEfficiencyTest]: Efficiency Tests results"<<endl;
00217   string EfficiencyCriterionName = parameters.getUntrackedParameter<string>("EfficiencyTestName","EfficiencyInRange"); 
00218   for(map<DTLayerId, MonitorElement*>::const_iterator hEff = EfficiencyHistos.begin();
00219       hEff != EfficiencyHistos.end();
00220       hEff++) {
00221     const QReport * theEfficiencyQReport = (*hEff).second->getQReport(EfficiencyCriterionName);
00222     double counter=0;
00223     if(theEfficiencyQReport) {
00224       vector<dqm::me_util::Channel> badChannels = theEfficiencyQReport->getBadChannels();
00225       for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); 
00226            channel != badChannels.end(); channel++) {
00227         edm::LogError ("efficiency") <<"LayerID : "<<getMEName("hEffOccupancy",(*hEff).first)<< " Bad efficiency channels: "<<(*channel).getBin()<<"  Contents : "<<(*channel).getContents();
00228         counter++;
00229       }
00230       LayerBadCells[(*hEff).first].push_back(counter);
00231       LayerBadCells[(*hEff).first].push_back(muonGeom->layer((*hEff).first)->specificTopology().channels());
00232       // FIXME: getMessage() sometimes returns and invalid string (null pointer inside QReport data member)
00233       // edm::LogWarning ("efficiency") << "-------- "<<theEfficiencyQReport->getMessage()<<" ------- "<<theEfficiencyQReport->getStatus();
00234     }
00235   }
00236 
00237 
00238         
00239   // UnassEfficiency test 
00240   //cout<<"[DTEfficiencyTest]: UnassEfficiency Tests results"<<endl;
00241   string UnassEfficiencyCriterionName = parameters.getUntrackedParameter<string>("UnassEfficiencyTestName","UnassEfficiencyInRange"); 
00242   for(map<DTLayerId, MonitorElement*>::const_iterator hUnassEff = UnassEfficiencyHistos.begin();
00243       hUnassEff != UnassEfficiencyHistos.end();
00244       hUnassEff++) {
00245     const QReport * theUnassEfficiencyQReport = (*hUnassEff).second->getQReport(UnassEfficiencyCriterionName);
00246     double counter=0;
00247     if(theUnassEfficiencyQReport) {
00248       vector<dqm::me_util::Channel> badChannels = theUnassEfficiencyQReport->getBadChannels();
00249       for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); 
00250            channel != badChannels.end(); channel++) {
00251         edm::LogError ("efficiency") << "Bad unassEfficiency channels: "<<(*channel).getBin()<<" "<<(*channel).getContents();
00252         counter++;
00253       }
00254       LayerUnassBadCells[(*hUnassEff).first].push_back(counter);
00255       LayerUnassBadCells[(*hUnassEff).first].push_back(double(muonGeom->layer((*hUnassEff).first)->specificTopology().channels()));
00256       // FIXME: getMessage() sometimes returns and invalid string (null pointer inside QReport data member)
00257       // edm::LogWarning ("efficiency") << theUnassEfficiencyQReport->getMessage()<<" ------- "<<theUnassEfficiencyQReport->getStatus();
00258     }
00259   }
00260 
00261   
00262   vector<DTChamber*>::const_iterator ch2_it = muonGeom->chambers().begin();
00263   vector<DTChamber*>::const_iterator ch2_end = muonGeom->chambers().end();
00264   for (; ch2_it != ch2_end; ++ch2_it) {
00265     vector<const DTSuperLayer*>::const_iterator sl2_it = (*ch2_it)->superLayers().begin(); 
00266     vector<const DTSuperLayer*>::const_iterator sl2_end = (*ch2_it)->superLayers().end();
00267     // Loop over the SLs
00268     for(; sl2_it != sl2_end; ++sl2_it) {
00269       DTSuperLayerId sl = (*sl2_it)->id();
00270       double superLayerBadC=0;
00271       double superLayerTotC=0;
00272       double superLayerUnassBadC=0;
00273       double superLayerUnassTotC=0;
00274       bool fill=false;
00275       vector<const DTLayer*>::const_iterator l2_it = (*sl2_it)->layers().begin(); 
00276       vector<const DTLayer*>::const_iterator l2_end = (*sl2_it)->layers().end();
00277       // Loop over the Ls
00278       for(; l2_it != l2_end; ++l2_it) {
00279         DTLayerId layerId = (*l2_it)->id();
00280         if(LayerBadCells.find(layerId) != LayerBadCells.end() &&
00281            LayerUnassBadCells.find(layerId) != LayerUnassBadCells.end()){
00282           fill=true;
00283           superLayerBadC+=LayerBadCells[layerId][0];
00284           superLayerTotC+=LayerBadCells[layerId][1];
00285           superLayerUnassBadC+=LayerUnassBadCells[layerId][0];
00286           superLayerUnassTotC+=LayerUnassBadCells[layerId][1];
00287         }
00288       }
00289       if(fill){
00290         SuperLayerBadCells[sl].push_back(superLayerBadC);
00291         SuperLayerBadCells[sl].push_back(superLayerTotC);
00292         SuperLayerUnassBadCells[sl].push_back(superLayerUnassBadC);
00293         SuperLayerUnassBadCells[sl].push_back(superLayerUnassTotC);
00294       }
00295     }
00296   }
00297 
00298 
00299   for(map<DTSuperLayerId, vector<double> >::const_iterator SLBCells = SuperLayerBadCells.begin();
00300       SLBCells != SuperLayerBadCells.end();
00301       SLBCells++) {
00302     if((*SLBCells).second[0]/(*SLBCells).second[1] > double(percentual/100)){
00303       if(wheelHistos.find((*SLBCells).first.wheel()) == wheelHistos.end()) bookHistos((*SLBCells).first.wheel());
00304       if(!((*SLBCells).first.station() == 4 && (*SLBCells).first.superlayer() == 3))
00305         wheelHistos[(*SLBCells).first.wheel()]->Fill((*SLBCells).first.sector()-1,((*SLBCells).first.superlayer()-1)+3*((*SLBCells).first.station()-1));
00306       else
00307         wheelHistos[(*SLBCells).first.wheel()]->Fill((*SLBCells).first.sector()-1,10);
00308       // fill the cms summary histo if the percentual of SL which have not passed the test 
00309       // is more than a predefined treshold
00310       cmsHistos[make_pair((*SLBCells).first.wheel(),(*SLBCells).first.sector())]++;
00311       if(((*SLBCells).first.sector()<13 &&
00312           double(cmsHistos[make_pair((*SLBCells).first.wheel(),(*SLBCells).first.sector())])/11>double(percentual)/100 &&
00313           filled[make_pair((*SLBCells).first.wheel(),(*SLBCells).first.sector())]==false) ||
00314          ((*SLBCells).first.sector()>=13 && 
00315           double(cmsHistos[make_pair((*SLBCells).first.wheel(),(*SLBCells).first.sector())])/2>double(percentual)/100 &&
00316           filled[make_pair((*SLBCells).first.wheel(),(*SLBCells).first.sector())]==false)){
00317         filled[make_pair((*SLBCells).first.wheel(),(*SLBCells).first.sector())]=true;
00318         wheelHistos[3]->Fill((*SLBCells).first.sector()-1,(*SLBCells).first.wheel());
00319       }
00320     }
00321   }
00322 
00323 
00324   for(map<DTSuperLayerId, vector<double> >::const_iterator SLUBCells = SuperLayerUnassBadCells.begin();
00325       SLUBCells != SuperLayerUnassBadCells.end();
00326       SLUBCells++) {
00327     if((*SLUBCells).second[0]/(*SLUBCells).second[1] > double(percentual/100)){
00328       if(wheelUnassHistos.find((*SLUBCells).first.wheel()) == wheelUnassHistos.end()) bookHistos((*SLUBCells).first.wheel());
00329       if(!((*SLUBCells).first.station() == 4 && (*SLUBCells).first.superlayer() == 3))
00330         wheelUnassHistos[(*SLUBCells).first.wheel()]->Fill((*SLUBCells).first.sector()-1,((*SLUBCells).first.superlayer()-1)+3*((*SLUBCells).first.station()-1));
00331       else
00332         wheelUnassHistos[(*SLUBCells).first.wheel()]->Fill((*SLUBCells).first.sector()-1,10);
00333       // fill the cms summary histo if the percentual of SL which have not passed the test 
00334       // is more than a predefined treshold
00335       cmsUnassHistos[make_pair((*SLUBCells).first.wheel(),(*SLUBCells).first.sector())]++;
00336       if(((*SLUBCells).first.sector()<13 &&
00337           double(cmsUnassHistos[make_pair((*SLUBCells).first.wheel(),(*SLUBCells).first.sector())])/11>double(percentual)/100 &&
00338           UnassFilled[make_pair((*SLUBCells).first.wheel(),(*SLUBCells).first.sector())]==false) ||
00339          ((*SLUBCells).first.sector()>=13 && 
00340           double(cmsUnassHistos[make_pair((*SLUBCells).first.wheel(),(*SLUBCells).first.sector())])/2>double(percentual)/100 &&
00341           UnassFilled[make_pair((*SLUBCells).first.wheel(),(*SLUBCells).first.sector())]==false)){
00342         UnassFilled[make_pair((*SLUBCells).first.wheel(),(*SLUBCells).first.sector())]=true;
00343         wheelUnassHistos[3]->Fill((*SLUBCells).first.sector()-1,(*SLUBCells).first.wheel());
00344       }
00345     }
00346   }
00347 
00348 
00349   
00350 }
00351 
00352 
00353 void DTEfficiencyTest::endJob(){
00354 
00355   edm::LogVerbatim ("efficiency") << "[DTEfficiencyTest] endjob called!";
00356 
00357   dbe->rmdir("DT/Tests/DTEfficiency");
00358 
00359 }
00360 
00361 
00362 string DTEfficiencyTest::getMEName(string histoTag, const DTLayerId & lID) {
00363 
00364   stringstream wheel; wheel << lID.superlayerId().wheel();
00365   stringstream station; station << lID.superlayerId().station();
00366   stringstream sector; sector << lID.superlayerId().sector();
00367   stringstream superLayer; superLayer << lID.superlayerId().superlayer();
00368   stringstream layer; layer << lID.layer();
00369 
00370  string folderRoot = parameters.getUntrackedParameter<string>("folderRoot", "Collector/FU0/");
00371  string folderName = 
00372     folderRoot + "DT/DTEfficiencyTask/Wheel" +  wheel.str() +
00373     "/Station" + station.str() +
00374     "/Sector" + sector.str() + 
00375     "/SuperLayer" + superLayer.str() + "/";
00376 
00377   string histoname = folderName + histoTag  
00378     + "_W" + wheel.str() 
00379     + "_St" + station.str() 
00380     + "_Sec" + sector.str() 
00381     + "_SL" + superLayer.str()
00382     + "_L" + layer.str();
00383   
00384   return histoname;
00385   
00386 }
00387 
00388 
00389 void DTEfficiencyTest::bookHistos(const DTLayerId & lId, int firstWire, int lastWire) {
00390 
00391   stringstream wheel; wheel << lId.superlayerId().wheel();
00392   stringstream station; station << lId.superlayerId().station();        
00393   stringstream sector; sector << lId.superlayerId().sector();
00394   stringstream superLayer; superLayer << lId.superlayerId().superlayer();
00395   stringstream layer; layer << lId.layer();
00396 
00397   string HistoName = "W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() +  "_SL" + superLayer.str() +  "_L" + layer.str();
00398   string EfficiencyHistoName =  "Efficiency_" + HistoName; 
00399   string UnassEfficiencyHistoName =  "UnassEfficiency_" + HistoName; 
00400 
00401   dbe->setCurrentFolder("DT/Tests/DTEfficiency/Wheel" + wheel.str() +
00402                            "/Station" + station.str() +
00403                            "/Sector" + sector.str());
00404 
00405   EfficiencyHistos[lId] = dbe->book1D(EfficiencyHistoName.c_str(),EfficiencyHistoName.c_str(),lastWire-firstWire+1, firstWire-0.5, lastWire+0.5);
00406   UnassEfficiencyHistos[lId] = dbe->book1D(UnassEfficiencyHistoName.c_str(),UnassEfficiencyHistoName.c_str(),lastWire-firstWire+1, firstWire-0.5, lastWire+0.5);
00407 
00408 }
00409 
00410 
00411 void DTEfficiencyTest::bookHistos(int wh) {
00412   
00413   dbe->setCurrentFolder("DT/Tests/DTEfficiency/SummaryPlot");
00414 
00415   if(wheelHistos.find(3) == wheelHistos.end()){
00416     string histoName =  "ESummary_testFailedByAtLeastBadSL";
00417     wheelHistos[3] = dbe->book2D(histoName.c_str(),histoName.c_str(),14,0,14,5,-2,2);
00418     wheelHistos[3]->setBinLabel(1,"Sector1",1);
00419     wheelHistos[3]->setBinLabel(1,"Sector1",1);
00420     wheelHistos[3]->setBinLabel(2,"Sector2",1);
00421     wheelHistos[3]->setBinLabel(3,"Sector3",1);
00422     wheelHistos[3]->setBinLabel(4,"Sector4",1);
00423     wheelHistos[3]->setBinLabel(5,"Sector5",1);
00424     wheelHistos[3]->setBinLabel(6,"Sector6",1);
00425     wheelHistos[3]->setBinLabel(7,"Sector7",1);
00426     wheelHistos[3]->setBinLabel(8,"Sector8",1);
00427     wheelHistos[3]->setBinLabel(9,"Sector9",1);
00428     wheelHistos[3]->setBinLabel(10,"Sector10",1);
00429     wheelHistos[3]->setBinLabel(11,"Sector11",1);
00430     wheelHistos[3]->setBinLabel(12,"Sector12",1);
00431     wheelHistos[3]->setBinLabel(13,"Sector13",1);
00432     wheelHistos[3]->setBinLabel(14,"Sector14",1);
00433     wheelHistos[3]->setBinLabel(1,"Wheel-2",2);
00434     wheelHistos[3]->setBinLabel(2,"Wheel-1",2);
00435     wheelHistos[3]->setBinLabel(3,"Wheel0",2);
00436     wheelHistos[3]->setBinLabel(4,"Wheel+1",2);
00437     wheelHistos[3]->setBinLabel(5,"Wheel+2",2);
00438   }
00439   if(wheelUnassHistos.find(3) == wheelUnassHistos.end()){
00440     string histoName =  "UESummary_testFailedByAtLeastBadSL";
00441     wheelUnassHistos[3] = dbe->book2D(histoName.c_str(),histoName.c_str(),14,0,14,5,-2,2);
00442     wheelUnassHistos[3]->setBinLabel(1,"Sector1",1);
00443     wheelUnassHistos[3]->setBinLabel(1,"Sector1",1);
00444     wheelUnassHistos[3]->setBinLabel(2,"Sector2",1);
00445     wheelUnassHistos[3]->setBinLabel(3,"Sector3",1);
00446     wheelUnassHistos[3]->setBinLabel(4,"Sector4",1);
00447     wheelUnassHistos[3]->setBinLabel(5,"Sector5",1);
00448     wheelUnassHistos[3]->setBinLabel(6,"Sector6",1);
00449     wheelUnassHistos[3]->setBinLabel(7,"Sector7",1);
00450     wheelUnassHistos[3]->setBinLabel(8,"Sector8",1);
00451     wheelUnassHistos[3]->setBinLabel(9,"Sector9",1);
00452     wheelUnassHistos[3]->setBinLabel(10,"Sector10",1);
00453     wheelUnassHistos[3]->setBinLabel(11,"Sector11",1);
00454     wheelUnassHistos[3]->setBinLabel(12,"Sector12",1);
00455     wheelUnassHistos[3]->setBinLabel(13,"Sector13",1);
00456     wheelUnassHistos[3]->setBinLabel(14,"Sector14",1);
00457     wheelUnassHistos[3]->setBinLabel(1,"Wheel-2",2);
00458     wheelUnassHistos[3]->setBinLabel(2,"Wheel-1",2);
00459     wheelUnassHistos[3]->setBinLabel(3,"Wheel0",2);
00460     wheelUnassHistos[3]->setBinLabel(4,"Wheel+1",2);
00461     wheelUnassHistos[3]->setBinLabel(5,"Wheel+2",2);
00462   }
00463 
00464 
00465   stringstream wheel; wheel <<wh;
00466 
00467   if(wheelHistos.find(wh) == wheelHistos.end()){
00468     string histoName =  "ESummary_testFailed_W" + wheel.str();
00469     wheelHistos[wh] = dbe->book2D(histoName.c_str(),histoName.c_str(),14,0,14,11,0,11);
00470     wheelHistos[wh]->setBinLabel(1,"Sector1",1);
00471     wheelHistos[wh]->setBinLabel(2,"Sector2",1);
00472     wheelHistos[wh]->setBinLabel(3,"Sector3",1);
00473     wheelHistos[wh]->setBinLabel(4,"Sector4",1);
00474     wheelHistos[wh]->setBinLabel(5,"Sector5",1);
00475     wheelHistos[wh]->setBinLabel(6,"Sector6",1);
00476     wheelHistos[wh]->setBinLabel(7,"Sector7",1);
00477     wheelHistos[wh]->setBinLabel(8,"Sector8",1);
00478     wheelHistos[wh]->setBinLabel(9,"Sector9",1);
00479     wheelHistos[wh]->setBinLabel(10,"Sector10",1);
00480     wheelHistos[wh]->setBinLabel(11,"Sector11",1);
00481     wheelHistos[wh]->setBinLabel(12,"Sector12",1);
00482     wheelHistos[wh]->setBinLabel(13,"Sector13",1);
00483     wheelHistos[wh]->setBinLabel(14,"Sector14",1);
00484     wheelHistos[wh]->setBinLabel(1,"MB1_SL1",2);
00485     wheelHistos[wh]->setBinLabel(2,"MB1_SL2",2);
00486     wheelHistos[wh]->setBinLabel(3,"MB1_SL3",2);
00487     wheelHistos[wh]->setBinLabel(4,"MB2_SL1",2);
00488     wheelHistos[wh]->setBinLabel(5,"MB2_SL2",2);
00489     wheelHistos[wh]->setBinLabel(6,"MB2_SL3",2);
00490     wheelHistos[wh]->setBinLabel(7,"MB3_SL1",2);
00491     wheelHistos[wh]->setBinLabel(8,"MB3_SL2",2);
00492     wheelHistos[wh]->setBinLabel(9,"MB3_SL3",2);
00493     wheelHistos[wh]->setBinLabel(10,"MB4_SL1",2);
00494     wheelHistos[wh]->setBinLabel(11,"MB4_SL3",2);
00495   }  
00496   if(wheelUnassHistos.find(wh) == wheelUnassHistos.end()){  
00497     string histoName =  "UESummary_testFailed_W" + wheel.str();
00498     wheelUnassHistos[wh] = dbe->book2D(histoName.c_str(),histoName.c_str(),14,0,14,11,0,11);
00499     wheelUnassHistos[wh]->setBinLabel(1,"Sector1",1);
00500     wheelUnassHistos[wh]->setBinLabel(2,"Sector2",1);
00501     wheelUnassHistos[wh]->setBinLabel(3,"Sector3",1);
00502     wheelUnassHistos[wh]->setBinLabel(4,"Sector4",1);
00503     wheelUnassHistos[wh]->setBinLabel(5,"Sector5",1);
00504     wheelUnassHistos[wh]->setBinLabel(6,"Sector6",1);
00505     wheelUnassHistos[wh]->setBinLabel(7,"Sector7",1);
00506     wheelUnassHistos[wh]->setBinLabel(8,"Sector8",1);
00507     wheelUnassHistos[wh]->setBinLabel(9,"Sector9",1);
00508     wheelUnassHistos[wh]->setBinLabel(10,"Sector10",1);
00509     wheelUnassHistos[wh]->setBinLabel(11,"Sector11",1);
00510     wheelUnassHistos[wh]->setBinLabel(12,"Sector12",1);
00511     wheelUnassHistos[wh]->setBinLabel(13,"Sector13",1);
00512     wheelUnassHistos[wh]->setBinLabel(14,"Sector14",1);
00513     wheelUnassHistos[wh]->setBinLabel(1,"MB1_SL1",2);
00514     wheelUnassHistos[wh]->setBinLabel(2,"MB1_SL2",2);
00515     wheelUnassHistos[wh]->setBinLabel(3,"MB1_SL3",2);
00516     wheelUnassHistos[wh]->setBinLabel(4,"MB2_SL1",2);
00517     wheelUnassHistos[wh]->setBinLabel(5,"MB2_SL2",2);
00518     wheelUnassHistos[wh]->setBinLabel(6,"MB2_SL3",2);
00519     wheelUnassHistos[wh]->setBinLabel(7,"MB3_SL1",2);
00520     wheelUnassHistos[wh]->setBinLabel(8,"MB3_SL2",2);
00521     wheelUnassHistos[wh]->setBinLabel(9,"MB3_SL3",2);
00522     wheelUnassHistos[wh]->setBinLabel(10,"MB4_SL1",2);
00523     wheelUnassHistos[wh]->setBinLabel(11,"MB4_SL3",2);
00524   }
00525 
00526 }
00527