CMS 3D CMS Logo

SiStripActionExecutor.cc

Go to the documentation of this file.
00001 
00002 #include "DQM/SiStripMonitorClient/interface/SiStripActionExecutor.h"
00003 #include "DQMServices/Core/interface/DQMStore.h"
00004 
00005 #include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h"
00006 #include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h"
00007 
00008 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
00009 #include "DataFormats/SiStripDetId/interface/TECDetId.h"
00010 #include "DataFormats/SiStripDetId/interface/TIBDetId.h"
00011 #include "DataFormats/SiStripDetId/interface/TOBDetId.h"
00012 #include "DataFormats/SiStripDetId/interface/TIDDetId.h"
00013 
00014 #include "DQM/SiStripCommon/interface/SiStripFolderOrganizer.h"
00015 #include "DQM/SiStripMonitorClient/interface/SiStripUtility.h"
00016 #include "DQM/SiStripMonitorClient/interface/SiStripSummaryCreator.h"
00017 #include "DQM/SiStripMonitorClient/interface/SiStripTrackerMapCreator.h"
00018 
00019 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00020 
00021 
00022 #include <iostream>
00023 #include <iomanip>
00024 using namespace std;
00025 //
00026 // -- Constructor
00027 // 
00028 SiStripActionExecutor::SiStripActionExecutor() {
00029   edm::LogInfo("SiStripActionExecutor") << 
00030     " Creating SiStripActionExecutor " << "\n" ;
00031   summaryCreator_= 0;
00032   tkMapCreator_ = 0; 
00033 
00034   bookedGlobalStatus_ = false;
00035 }
00036 //
00037 // --  Destructor
00038 // 
00039 SiStripActionExecutor::~SiStripActionExecutor() {
00040   edm::LogInfo("SiStripActionExecutor") << 
00041     " Deleting SiStripActionExecutor " << "\n" ;
00042   if (summaryCreator_) delete   summaryCreator_;
00043   if (tkMapCreator_) delete   tkMapCreator_;
00044 }
00045 //
00046 // -- Read Configurationn File
00047 //
00048 bool SiStripActionExecutor::readConfiguration() {
00049   
00050   if (!summaryCreator_) {
00051     summaryCreator_ = new SiStripSummaryCreator();
00052   }
00053   if (summaryCreator_->readConfiguration()) return true;
00054   else return false;
00055 }
00056 //
00057 // -- Read Configurationn File
00058 //
00059 bool SiStripActionExecutor::readTkMapConfiguration() {
00060   
00061   if (tkMapCreator_) delete tkMapCreator_;
00062   tkMapCreator_ = new SiStripTrackerMapCreator();
00063   if (tkMapCreator_->readConfiguration()) return true;
00064   else return false;
00065 }
00066 //
00067 // -- Read Configurationn File
00068 //
00069 bool SiStripActionExecutor::readConfiguration(int& sum_freq) {
00070   bool result = false;
00071   if (readConfiguration()) {
00072     sum_freq = summaryCreator_->getFrequency();
00073     if (sum_freq != -1) result = true;
00074   }
00075   return result;
00076 }
00077 //
00078 // -- Create and Fill Summary Monitor Elements
00079 //
00080 void SiStripActionExecutor::createSummary(DQMStore* dqm_store) {
00081   if (summaryCreator_) {
00082     dqm_store->cd();
00083     string dname = "SiStrip/MechanicalView";
00084     if (dqm_store->dirExists(dname)) {
00085       dqm_store->cd(dname);
00086       summaryCreator_->createSummary(dqm_store);
00087     }
00088   }
00089 }
00090 //
00091 // -- Create and Fill Summary Monitor Elements
00092 //
00093 void SiStripActionExecutor::createSummaryOffline(DQMStore* dqm_store) {
00094   if (summaryCreator_) {
00095     dqm_store->cd();
00096     string dname = "MechanicalView";
00097     if (goToDir(dqm_store, dname)) {
00098       summaryCreator_->createSummary(dqm_store);
00099     }
00100   }
00101 }
00102 //
00103 // -- create tracker map
00104 //
00105 void SiStripActionExecutor::createTkMap(const edm::ParameterSet & tkmapPset, 
00106            const edm::ESHandle<SiStripFedCabling>& fedcabling, DQMStore* dqm_store) {
00107   if (tkMapCreator_) tkMapCreator_->create(tkmapPset, fedcabling, dqm_store);
00108 }
00109 //
00110 // -- create reportSummary MEs
00111 //
00112 void SiStripActionExecutor::bookGlobalStatus(DQMStore* dqm_store) {
00113 
00114   if (!bookedGlobalStatus_) {
00115     dqm_store->cd();
00116     
00117     dqm_store->setCurrentFolder("SiStrip/EventInfo");    
00118     SummaryReport = dqm_store->bookFloat("reportSummary");
00119     
00120     SummaryReportMap = dqm_store->book2D("reportSummaryMap","SiStrip Report Summary Map",6,0.5,6.5,9,0.5,9.5);
00121     SummaryReportMap->setAxisTitle("Sub Detector Type", 1);
00122     SummaryReportMap->setAxisTitle("Layer/Disc Number", 2);
00123     SummaryReportMap->setBinLabel(1, "TIB");
00124     SummaryReportMap->setBinLabel(2, "TOB");
00125     SummaryReportMap->setBinLabel(3, "TIDF");
00126     SummaryReportMap->setBinLabel(4, "TIDB");
00127     SummaryReportMap->setBinLabel(5, "TECF");
00128     SummaryReportMap->setBinLabel(6, "TECB");
00129     
00130     dqm_store->setCurrentFolder("SiStrip/EventInfo/reportSummaryContents");      
00131     
00132     SummaryTIB  = dqm_store->bookFloat("SiStrip_TIB");
00133     SummaryTOB  = dqm_store->bookFloat("SiStrip_TOB");
00134     SummaryTIDF = dqm_store->bookFloat("SiStrip_TIDF");
00135     SummaryTIDB = dqm_store->bookFloat("SiStrip_TIDB");
00136     SummaryTECF = dqm_store->bookFloat("SiStrip_TECF");
00137     SummaryTECB = dqm_store->bookFloat("SiStrip_TECB");
00138 
00139     dqm_store->setCurrentFolder("SiStrip/Tracks");      
00140     OnTrackClusterReport = dqm_store->book1D("OnTrackClustersReport", "OnTrackClusterReport",34,0.5,34.5);
00141     OnTrackClusterReport->setAxisTitle("# of On Track Clusters", 2);
00142     OnTrackClusterReport->setBinLabel(1,"TIB_L1");
00143     OnTrackClusterReport->setBinLabel(2,"TIB_L2");
00144     OnTrackClusterReport->setBinLabel(3,"TIB_L3");
00145     OnTrackClusterReport->setBinLabel(4,"TOB_L4");
00146     OnTrackClusterReport->setBinLabel(5,"TOB_L1");
00147     OnTrackClusterReport->setBinLabel(6,"TOB_L2");
00148     OnTrackClusterReport->setBinLabel(7,"TOB_L3");
00149     OnTrackClusterReport->setBinLabel(8,"TOB_L4");
00150     OnTrackClusterReport->setBinLabel(9,"TOB_L5");
00151     OnTrackClusterReport->setBinLabel(10,"TOB_L6");
00152     OnTrackClusterReport->setBinLabel(11,"TIDF_W1");
00153     OnTrackClusterReport->setBinLabel(12,"TIDF_W2");
00154     OnTrackClusterReport->setBinLabel(13,"TIDF_W2");
00155     OnTrackClusterReport->setBinLabel(14,"TIDB_W1");
00156     OnTrackClusterReport->setBinLabel(15,"TIDB_W2");
00157     OnTrackClusterReport->setBinLabel(16,"TIDB_W2");
00158     OnTrackClusterReport->setBinLabel(17,"TECF_W1");
00159     OnTrackClusterReport->setBinLabel(18,"TECF_W2");
00160     OnTrackClusterReport->setBinLabel(19,"TECF_W3");
00161     OnTrackClusterReport->setBinLabel(20,"TECF_W4");
00162     OnTrackClusterReport->setBinLabel(21,"TECF_W5");
00163     OnTrackClusterReport->setBinLabel(22,"TECF_W6");
00164     OnTrackClusterReport->setBinLabel(23,"TECF_W7");
00165     OnTrackClusterReport->setBinLabel(24,"TECF_W8");
00166     OnTrackClusterReport->setBinLabel(25,"TECF_W9");
00167     OnTrackClusterReport->setBinLabel(26,"TECB_W1");
00168     OnTrackClusterReport->setBinLabel(27,"TECB_W2");
00169     OnTrackClusterReport->setBinLabel(28,"TECB_W3");
00170     OnTrackClusterReport->setBinLabel(29,"TECB_W4");
00171     OnTrackClusterReport->setBinLabel(30,"TECB_W5");
00172     OnTrackClusterReport->setBinLabel(31,"TECB_W6");
00173     OnTrackClusterReport->setBinLabel(32,"TECB_W7");
00174     OnTrackClusterReport->setBinLabel(33,"TECB_W8");
00175     OnTrackClusterReport->setBinLabel(34,"TECB_W9");
00176     
00177     bookedGlobalStatus_ = true;
00178     fillDummyGlobalStatus();
00179   }
00180 }
00181 //
00182 // -- Fill Dummy Global Status
00183 //
00184 void SiStripActionExecutor::fillDummyGlobalStatus(){
00185   
00186   resetGlobalStatus();
00187 
00188   SummaryReport->Fill(-1.0);
00189 
00190   SummaryTIB->Fill(-1.0);
00191   SummaryTOB->Fill(-1.0);
00192   SummaryTIDF->Fill(-1.0);
00193   SummaryTIDB->Fill(-1.0);
00194   SummaryTECF->Fill(-1.0);
00195   SummaryTECB->Fill(-1.0);
00196   
00197   for (unsigned int xbin = 1; xbin < 7; xbin++) {
00198     for (unsigned int ybin = 1; ybin < 10; ybin++) {
00199       SummaryReportMap->Fill(xbin, ybin, -1.0);
00200     }
00201   }
00202 }
00203 // 
00204 // -- Fill Global Status
00205 //
00206 void SiStripActionExecutor::fillGlobalStatusFromModule(DQMStore* dqm_store) {
00207   if (!bookedGlobalStatus_) bookGlobalStatus(dqm_store);
00208   float gStatus = -1.0;
00209   int nDetErr = 0;
00210   int nDetTot = 0;
00211   int nDetTIBErr, nDetTOBErr, nDetTIDFErr, nDetTIDBErr, nDetTECFErr, nDetTECBErr;
00212   int nDetTIBTot, nDetTOBTot, nDetTIDFTot, nDetTIDBTot, nDetTECFTot, nDetTECBTot;
00213   float statusTIB, statusTOB,  statusTIDF,  statusTIDB,  statusTECF,  statusTECB;
00214 
00215   statusTIB  = statusTOB  = statusTIDF  = statusTIDB  = statusTECF  = statusTECB  = -1;
00216   nDetTIBErr = nDetTOBErr = nDetTIDFErr = nDetTIDBErr = nDetTECFErr = nDetTECBErr = 0;
00217   nDetTIBTot = nDetTOBTot = nDetTIDFTot = nDetTIDBTot = nDetTECFTot = nDetTECBTot = 0;
00218 
00219   fillDummyGlobalStatus();
00220   string dname;
00221   // Get Status for TIB
00222   dname = "SiStrip/MechanicalView/TIB";
00223   fillSubDetStatusFromModule(dqm_store, dname, nDetTIBTot, nDetTIBErr, 1);
00224   fillClusterReport(dqm_store, dname, 0);
00225   // Get Status for TOB
00226   dname = "SiStrip/MechanicalView/TOB";
00227   fillSubDetStatusFromModule(dqm_store, dname, nDetTOBTot, nDetTOBErr, 2);  
00228   fillClusterReport(dqm_store, dname, 4);
00229   // Get Status for TIDF
00230   dname = "SiStrip/MechanicalView/TID/side_2";
00231   fillSubDetStatusFromModule(dqm_store, dname, nDetTIDFTot, nDetTIDFErr, 3);  
00232   fillClusterReport(dqm_store, dname, 10);
00233   // Get Status for TIDB 
00234   dname = "SiStrip/MechanicalView/TID/side_1";
00235   fillSubDetStatusFromModule(dqm_store, dname, nDetTIDBTot, nDetTIDBErr, 4);  
00236   fillClusterReport(dqm_store, dname, 13);
00237   // Get Status for TECF 
00238   dname = "SiStrip/MechanicalView/TEC/side_2";
00239   fillSubDetStatusFromModule(dqm_store, dname, nDetTECFTot, nDetTECFErr, 5);  
00240   fillClusterReport(dqm_store, dname, 16);
00241   // Get Status for TECB
00242   dname = "SiStrip/MechanicalView/TEC/side_1";
00243   fillSubDetStatusFromModule(dqm_store, dname, nDetTECBTot, nDetTECBErr, 6);  
00244   fillClusterReport(dqm_store, dname, 25);
00245 
00246   nDetTot = nDetTIBTot + nDetTOBTot + nDetTIDFTot + nDetTIDBTot + nDetTECFTot + nDetTECBTot;
00247   nDetErr = nDetTIBErr + nDetTOBErr + nDetTIDFErr + nDetTIDBErr + nDetTECFErr + nDetTECBErr;
00248   if (nDetTot > 0) gStatus = (1 - nDetErr*1.0/nDetTot);
00249   
00250   if (nDetTIBTot  > 0) statusTIB  = (1 - nDetTIBErr*1.0/nDetTIBTot);
00251   if (nDetTOBTot  > 0) statusTOB  = (1 - nDetTOBErr*1.0/nDetTOBTot);
00252   if (nDetTIDFTot > 0) statusTIDF = (1 - nDetTIDFErr*1.0/nDetTIDFTot);
00253   if (nDetTIDBTot > 0) statusTIDB = (1 - nDetTIDBErr*1.0/nDetTIDBTot);
00254   if (nDetTECFTot > 0) statusTECF = (1 - nDetTECFErr*1.0/nDetTECFTot);
00255   if (nDetTECBTot > 0) statusTECB = (1 - nDetTECBErr*1.0/nDetTECBTot);
00256   
00257   SummaryReport->Fill(gStatus);
00258     
00259   SummaryTIB->Fill(statusTIB);
00260   SummaryTOB->Fill(statusTOB);
00261   SummaryTIDF->Fill(statusTIDF);
00262   SummaryTIDB->Fill(statusTIDB);
00263   SummaryTECF->Fill(statusTECF);
00264   SummaryTECB->Fill(statusTECB);
00265     
00266   cout <<"# of Det TIB : (tot)"<<setw(5)<<nDetTIBTot<< " (error) "<<nDetTIBErr <<" ==> "<<statusTIB<< endl; 
00267   cout <<"# of Det TOB : (tot)"<<setw(5)<<nDetTOBTot<< " (error) "<<nDetTOBErr <<" ==> "<<statusTOB<< endl; 
00268   cout <<"# of Det TIDF: (tot)"<<setw(5)<<nDetTIDFTot<<" (error) "<<nDetTIDFErr<<" ==> "<<statusTIDF<< endl; 
00269   cout <<"# of Det TIDB: (tot)"<<setw(5)<<nDetTIDBTot<<" (error) "<<nDetTIDBErr<<" ==> "<<statusTIDB<< endl; 
00270   cout <<"# of Det TECF: (tot)"<<setw(5)<<nDetTECFTot<<" (error) "<<nDetTECFErr<<" ==> "<<statusTECF<< endl; 
00271   cout <<"# of Det TECB: (tot)"<<setw(5)<<nDetTECBTot<<" (error) "<<nDetTECBErr<<" ==> "<<statusTECB<< endl; 
00272 }
00273 // 
00274 // -- Fill Global Status for Tier0
00275 //
00276 void SiStripActionExecutor::fillGlobalStatusFromLayer(DQMStore* dqm_store) {
00277   if (!bookedGlobalStatus_) bookGlobalStatus(dqm_store);
00278   float gStatus = -1.0;
00279   int nDetErr = 0;
00280   int nDetTot = 0;
00281   int nDetTIBErr, nDetTOBErr, nDetTIDFErr, nDetTIDBErr, nDetTECFErr, nDetTECBErr;
00282   int nDetTIBTot, nDetTOBTot, nDetTIDFTot, nDetTIDBTot, nDetTECFTot, nDetTECBTot;
00283   float statusTIB, statusTOB,  statusTIDF,  statusTIDB,  statusTECF,  statusTECB;
00284 
00285   statusTIB  = statusTOB  = statusTIDF  = statusTIDB  = statusTECF  = statusTECB  = -1;
00286   nDetTIBErr = nDetTOBErr = nDetTIDFErr = nDetTIDBErr = nDetTECFErr = nDetTECBErr = 0;
00287   nDetTIBTot = nDetTOBTot = nDetTIDFTot = nDetTIDBTot = nDetTECFTot = nDetTECBTot = 0;
00288 
00289   fillDummyGlobalStatus();
00290 
00291   string dname;
00292   dname = "SiStrip/MechanicalView/TIB";
00293   fillSubDetStatusFromLayer(dqm_store, dname, nDetTIBTot, nDetTIBErr, 1);
00294   fillClusterReport(dqm_store, dname, 0);  
00295   dname = "SiStrip/MechanicalView/TOB";
00296   fillSubDetStatusFromLayer(dqm_store, dname, nDetTOBTot, nDetTOBErr, 2);  
00297   fillClusterReport(dqm_store, dname, 4);
00298   dname = "SiStrip/MechanicalView/TID/side_2";
00299   fillSubDetStatusFromLayer(dqm_store, dname,  nDetTIDFTot, nDetTIDFErr, 3);  
00300   fillClusterReport(dqm_store, dname, 10);
00301   dname = "SiStrip/MechanicalView/TID/side_1";
00302   fillSubDetStatusFromLayer(dqm_store, dname,  nDetTIDBTot, nDetTIDBErr, 4);  
00303   fillClusterReport(dqm_store, dname, 13);
00304   dname = "SiStrip/MechanicalView/TEC/side_2";
00305   fillSubDetStatusFromLayer(dqm_store, dname,  nDetTECFTot, nDetTECFErr, 5);  
00306   fillClusterReport(dqm_store, dname, 16);
00307   dname = "SiStrip/MechanicalView/TEC/side_1";
00308   fillSubDetStatusFromLayer(dqm_store, dname,  nDetTECBTot, nDetTECBErr, 6);  
00309   fillClusterReport(dqm_store, dname, 25);
00310   
00311   nDetTot = nDetTIBTot + nDetTOBTot + nDetTIDFTot + nDetTIDBTot + nDetTECFTot + nDetTECBTot;
00312   nDetErr = nDetTIBErr + nDetTOBErr + nDetTIDFErr + nDetTIDBErr + nDetTECFErr + nDetTECBErr;
00313   if (nDetTot > 0) gStatus = (1 - nDetErr*1.0/nDetTot);
00314   
00315   if (nDetTIBTot  > 0) statusTIB  = (1 - nDetTIBErr*1.0/nDetTIBTot);
00316   if (nDetTOBTot  > 0) statusTOB  = (1 - nDetTOBErr*1.0/nDetTOBTot);
00317   if (nDetTIDFTot > 0) statusTIDF = (1 - nDetTIDFErr*1.0/nDetTIDFTot);
00318   if (nDetTIDBTot > 0) statusTIDB = (1 - nDetTIDBErr*1.0/nDetTIDBTot);
00319   if (nDetTECFTot > 0) statusTECF = (1 - nDetTECFErr*1.0/nDetTECFTot);
00320   if (nDetTECBTot > 0) statusTECB = (1 - nDetTECBErr*1.0/nDetTECBTot);
00321   
00322 
00323   SummaryReport->Fill(gStatus);
00324   
00325   SummaryTIB->Fill(statusTIB);
00326   SummaryTOB->Fill(statusTOB);
00327   SummaryTIDF->Fill(statusTIDF);
00328   SummaryTIDB->Fill(statusTIDB);
00329   SummaryTECF->Fill(statusTECF);
00330   SummaryTECB->Fill(statusTECB);
00331 
00332   cout <<"# of Det TIB : (tot)"<<setw(5)<<nDetTIBTot<< " (error) "<<nDetTIBErr <<" ==> "<<statusTIB<< endl; 
00333   cout <<"# of Det TOB : (tot)"<<setw(5)<<nDetTOBTot<< " (error) "<<nDetTOBErr <<" ==> "<<statusTOB<< endl; 
00334   cout <<"# of Det TIDF: (tot)"<<setw(5)<<nDetTIDFTot<<" (error) "<<nDetTIDFErr<<" ==> "<<statusTIDF<< endl; 
00335   cout <<"# of Det TIDB: (tot)"<<setw(5)<<nDetTIDBTot<<" (error) "<<nDetTIDBErr<<" ==> "<<statusTIDB<< endl; 
00336   cout <<"# of Det TECF: (tot)"<<setw(5)<<nDetTECFTot<<" (error) "<<nDetTECFErr<<" ==> "<<statusTECF<< endl; 
00337   cout <<"# of Det TECB: (tot)"<<setw(5)<<nDetTECBTot<<" (error) "<<nDetTECBErr<<" ==> "<<statusTECB<< endl; 
00338 }
00339 //
00340 // -- fill subDetStatus
00341 //
00342 void SiStripActionExecutor::fillSubDetStatusFromModule(DQMStore* dqm_store, string& dname,   
00343              int& tot_subdet, int& error_subdet, unsigned int xbin) {
00344   if (SummaryReportMap->kind() != MonitorElement::DQM_KIND_TH2F) return;
00345   TH2F* hist2 = SummaryReportMap->getTH2F();
00346   if (!hist2) return;
00347   if (dqm_store->dirExists(dname)) {
00348     dqm_store->cd(dname);
00349     SiStripFolderOrganizer folder_organizer;
00350     vector<string> subDirVec = dqm_store->getSubdirs();
00351     unsigned int ybin = 0;
00352     tot_subdet = 0, error_subdet =0;
00353     for (vector<string>::const_iterator ic = subDirVec.begin();
00354          ic != subDirVec.end(); ic++) {
00355       dqm_store->cd((*ic));
00356       vector<string> mids;
00357       SiStripUtility::getModuleFolderList(dqm_store, mids);
00358       int ndet = 0;
00359       int errdet = 0;       
00360       for (vector<string>::const_iterator im = mids.begin();
00361            im != mids.end(); im++) {
00362          uint32_t detId = atoi((*im).c_str());
00363          string subdir_path;
00364          folder_organizer.getFolderName(detId, subdir_path);
00365          vector<MonitorElement*> meVec = dqm_store->getContents(subdir_path);
00366          if (meVec.size() == 0) continue;
00367          ndet++; 
00368          int err_me = 0;
00369          for (vector<MonitorElement*>::const_iterator it = meVec.begin();
00370               it != meVec.end(); it++) {
00371            MonitorElement * me = (*it);     
00372            if (!me) continue;
00373            if (me->getQReports().size() == 0) continue;
00374            int istat =  SiStripUtility::getMEStatus((*it)); 
00375            if (istat == dqm::qstatus::ERROR)   err_me++;
00376          }
00377          if (err_me > 0) errdet++;
00378       }
00379       tot_subdet   += ndet;
00380       error_subdet += errdet;
00381       ybin++;
00382       float eff_fac = 1 - (errdet*1.0/ndet);
00383       if ( ndet > 0) hist2->SetBinContent(xbin,ybin, eff_fac);
00384     }
00385   }
00386 }
00387 void SiStripActionExecutor::fillSubDetStatusFromLayer(DQMStore* dqm_store, string& dname,  
00388            int& tot_subdet, int& error_subdet, unsigned int xbin) {
00389   if (SummaryReportMap->kind() != MonitorElement::DQM_KIND_TH2F) return;
00390   TH2F* hist2 = SummaryReportMap->getTH2F();
00391   if (!hist2) return;
00392   if (dqm_store->dirExists(dname)) {
00393     dqm_store->cd(dname);
00394     vector<string> subDirVec = dqm_store->getSubdirs();
00395     unsigned int ybin = 0;
00396     tot_subdet = error_subdet = 0;
00397     for (vector<string>::const_iterator ic = subDirVec.begin();
00398          ic != subDirVec.end(); ic++) {
00399       vector<MonitorElement*> meVec;
00400       meVec = dqm_store->getContents((*ic));
00401       int errdet = 0;
00402       int ndet = 0;
00403       for (vector<MonitorElement*>::const_iterator it = meVec.begin();
00404                it != meVec.end(); it++) {
00405         MonitorElement * me = (*it);
00406         if (!me) continue;
00407         string name = me->getName();     
00408 
00409         if (me->getQReports().size() != 0 && name.find("Profile") != string::npos) {
00410           int nbin = me->getNbinsX();
00411           int istat, nbad;
00412           istat =  SiStripUtility::getMEStatus((*it), nbad);
00413           if (nbin > ndet) ndet = nbin;
00414           if (nbad > errdet) errdet = nbad;
00415         }
00416       }
00417       tot_subdet   += ndet;
00418       error_subdet += errdet;
00419       ybin++;
00420       float eff_fac = 1 - (errdet*1.0/ndet);
00421       if ( ndet > 0) hist2->SetBinContent(xbin,ybin, eff_fac);
00422     }
00423   }
00424 }
00425 void SiStripActionExecutor::fillClusterReport(DQMStore* dqm_store, string& dname, int xbin) {
00426   if (OnTrackClusterReport->kind() != MonitorElement::DQM_KIND_TH1F) return;
00427   TH1F* hist1 = OnTrackClusterReport->getTH1F();
00428   if (!hist1) return;
00429   if (dqm_store->dirExists(dname)) {
00430     dqm_store->cd(dname);
00431     vector<string> subDirVec = dqm_store->getSubdirs();
00432     unsigned int ilayer;
00433     for (vector<string>::const_iterator ic = subDirVec.begin();
00434          ic != subDirVec.end(); ic++) {
00435       string currDir = (*ic);
00436       ilayer = atoi((currDir.substr(currDir.find_last_of("_")+1)).c_str());
00437 
00438       vector<MonitorElement*> meVec;
00439       meVec = dqm_store->getContents(currDir);
00440       for (vector<MonitorElement*>::const_iterator it = meVec.begin();
00441            it != meVec.end(); it++) {
00442         MonitorElement * me = (*it);
00443         if (!me) continue;
00444         string name = me->getName();
00445         if (name.find("Summary_ClusterStoNCorr__OnTrack") != string::npos) {
00446           float entries = me->getEntries();
00447           hist1->SetBinContent(xbin+ilayer, entries);
00448           break;
00449         }
00450       }  
00451     }
00452   }
00453 }
00454 //
00455 // -- create reportSummary MEs
00456 //
00457 void SiStripActionExecutor::resetGlobalStatus() {
00458   if (bookedGlobalStatus_) {
00459     
00460     SummaryReport->Reset();
00461     
00462     SummaryReportMap->Reset();
00463     
00464     SummaryTIB->Reset();
00465     SummaryTOB->Reset();
00466     SummaryTIDF->Reset();
00467     SummaryTIDB->Reset();
00468     SummaryTECF->Reset();
00469     SummaryTECB->Reset();
00470 
00471     OnTrackClusterReport->Reset();
00472   }
00473 }
00474 //
00475 // -- go to a given Directory
00476 //
00477 bool SiStripActionExecutor::goToDir(DQMStore * dqm_store, string name) {
00478   string currDir = dqm_store->pwd();
00479   string dirName = currDir.substr(currDir.find_last_of("/")+1);
00480   if (dirName.find(name) == 0) {
00481     return true;
00482   }
00483   vector<string> subDirVec = dqm_store->getSubdirs();
00484   for (vector<string>::const_iterator ic = subDirVec.begin();
00485        ic != subDirVec.end(); ic++) {
00486     dqm_store->cd(*ic);
00487     if (!goToDir(dqm_store, name))  dqm_store->goUp();
00488     else return true;
00489   }
00490   return false;  
00491 }

Generated on Tue Jun 9 17:33:34 2009 for CMSSW by  doxygen 1.5.4