CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DQMOffline/EGamma/plugins/PhotonOfflineClient.cc

Go to the documentation of this file.
00001 #include <iostream>
00002 //
00003 
00004 #include "DQMOffline/EGamma/plugins/PhotonOfflineClient.h"
00005 
00006 
00007 //#define TWOPI 6.283185308
00008 //
00009 
00023 using namespace std;
00024 using std::cout;
00025 
00026 PhotonOfflineClient::PhotonOfflineClient(const edm::ParameterSet& pset)
00027 {
00028 
00029   dbe_ = 0;
00030   dbe_ = edm::Service<DQMStore>().operator->();
00031   dbe_->setVerbose(0);
00032   parameters_ = pset;
00033 
00034   cutStep_       = pset.getParameter<double>("cutStep");
00035   numberOfSteps_ = pset.getParameter<int>("numberOfSteps");
00036 
00037   etMin  = pset.getParameter<double>("etMin");
00038   etMax  = pset.getParameter<double>("etMax");
00039   etBin  = pset.getParameter<int>("etBin");
00040   etaMin = pset.getParameter<double>("etaMin");
00041   etaMax = pset.getParameter<double>("etaMax");
00042   etaBin = pset.getParameter<int>("etaBin");
00043   phiMin = pset.getParameter<double>("phiMin");
00044   phiMax = pset.getParameter<double>("phiMax");
00045   phiBin = pset.getParameter<int>("phiBin");
00046 
00047   standAlone_ = pset.getParameter<bool>("standAlone");
00048   batch_ = pset.getParameter<bool>("batch");
00049   excludeBkgHistos_ =  pset.getParameter<bool>("excludeBkgHistos");
00050 
00051   outputFileName_ = pset.getParameter<string>("OutputFileName");
00052   inputFileName_  = pset.getUntrackedParameter<string>("InputFileName");
00053 
00054   histo_index_photons_ = 0;
00055   histo_index_conversions_ = 0;
00056   histo_index_efficiency_ = 0;
00057   histo_index_invMass_ = 0;
00058 
00059   types_.push_back("All");
00060   types_.push_back("GoodCandidate");
00061   if (!excludeBkgHistos_)  types_.push_back("Background");
00062 
00063   parts_.push_back("AllEcal");
00064   parts_.push_back("Barrel");
00065   parts_.push_back("Endcaps");
00066 
00067 }
00068 
00069 PhotonOfflineClient::~PhotonOfflineClient()
00070 {}
00071 void PhotonOfflineClient::beginJob()
00072 {}
00073 void PhotonOfflineClient::analyze(const edm::Event& e, const edm::EventSetup& esup)
00074 {}
00075 void PhotonOfflineClient::endLuminosityBlock( const edm::LuminosityBlock& , const edm::EventSetup& setup)
00076 {}
00077 
00078 
00079 
00080 void PhotonOfflineClient::endJob()
00081 {
00082   if(standAlone_) runClient();
00083 }
00084 void PhotonOfflineClient::endRun(const edm::Run& run, const edm::EventSetup& setup)
00085 {
00086   if(!standAlone_) runClient();
00087 }
00088 
00089 
00090 
00091 
00092 void PhotonOfflineClient::runClient()
00093 {
00094   if(!dbe_) return;
00095 
00096   if(batch_)  dbe_->open(inputFileName_);
00097 
00098   if(!dbe_->dirExists("Egamma/PhotonAnalyzer")){
00099     //cout << "egamma directory doesn't exist..." << std::endl;
00100     return;
00101   }
00102 
00103   //find out how many histograms are in the various folders
00104   histo_index_photons_     = dbe_->get("Egamma/PhotonAnalyzer/numberOfHistogramsInPhotonsFolder")->getIntValue();
00105   histo_index_conversions_ = dbe_->get("Egamma/PhotonAnalyzer/numberOfHistogramsInConversionsFolder")->getIntValue();
00106   histo_index_efficiency_  = dbe_->get("Egamma/PhotonAnalyzer/numberOfHistogramsInEfficiencyFolder")->getIntValue();
00107   histo_index_invMass_     = dbe_->get("Egamma/PhotonAnalyzer/numberOfHistogramsInInvMassFolder")->getIntValue();
00108 
00109   dbe_->setCurrentFolder("Egamma/PhotonAnalyzer/");
00110   dbe_->removeElement("numberOfHistogramsInPhotonsFolder");
00111   dbe_->removeElement("numberOfHistogramsInConversionsFolder");
00112   dbe_->removeElement("numberOfHistogramsInEfficiencyFolder");
00113   dbe_->removeElement("numberOfHistogramsInInvMassFolder");
00114 
00115 
00116   string AllPath    = "Egamma/PhotonAnalyzer/AllPhotons/";
00117   string IsoPath    = "Egamma/PhotonAnalyzer/GoodCandidatePhotons/";
00118   string NonisoPath = "Egamma/PhotonAnalyzer/BackgroundPhotons/";
00119   string EffPath    = "Egamma/PhotonAnalyzer/Efficiencies/";
00120 
00121 
00122   //booking efficiency histograms
00123   dbe_->setCurrentFolder(EffPath);
00124 
00125   p_efficiencyVsEtaLoose_ = bookHisto("EfficiencyVsEtaLoose","Fraction of Photons passing Loose Isolation vs #eta;#eta",etaBin,etaMin, etaMax);
00126   p_efficiencyVsEtLoose_  = bookHisto("EfficiencyVsEtLoose", "Fraction of Photons passing Loose Isolation vs E_{T};E_{T} (GeV)",etBin,etMin,etMax);
00127   p_efficiencyVsEtaTight_ = bookHisto("EfficiencyVsEtaTight","Fraction of Photons passing Tight Isolation vs #eta;#eta",etaBin,etaMin, etaMax);
00128   p_efficiencyVsEtTight_  = bookHisto("EfficiencyVsEtTight", "Fraction of Photons passing Tight Isolation vs E_{T};E_{T} (GeV)",etBin,etMin,etMax);
00129 
00130 
00131   p_efficiencyVsEtaHLT_ = bookHisto("EfficiencyVsEtaHLT","Fraction of Photons firing HLT vs #eta;#eta",etaBin,etaMin, etaMax);
00132   p_efficiencyVsEtHLT_  = bookHisto("EfficiencyVsEtHLT", "Fraction of Photons firing HLT vs E_{T};E_{T} (GeV)",etBin,etMin,etMax);
00133 
00134 
00135   p_convFractionVsEtaLoose_ = bookHisto("ConvFractionVsEtaLoose","Fraction of Loosely Isolated Photons which are matched to two tracks vs #eta;#eta",etaBin,etaMin, etaMax);
00136   p_convFractionVsEtLoose_  = bookHisto("ConvFractionVsEtLoose", "Fraction of Loosely Isolated Photons which are matched to two tracks vs E_{T};E_{T} (GeV)",etBin,etMin,etMax);
00137   p_convFractionVsEtaTight_ = bookHisto("ConvFractionVsEtaTight","Fraction of Tightly Isolated Photons which are matched to two tracks vs #eta;#eta",etaBin,etaMin, etaMax);
00138   p_convFractionVsEtTight_  = bookHisto("ConvFractionVsEtTight", "Fraction of Tightly Isolated Photons which are matched to two tracks vs E_{T};E_{T} (GeV)",etBin,etMin,etMax);
00139 
00140   p_vertexReconstructionEfficiencyVsEta_ = bookHisto("VertexReconstructionEfficiencyVsEta","Fraction of Converted Photons which have a valid vertex vs #eta;#eta",etaBin,etaMin, etaMax);
00141 
00142 
00143   //booking conversion fraction histograms
00144   dbe_->setCurrentFolder(AllPath+"Et above 20 GeV/Conversions");
00145   p_convFractionVsEt_  = book2DHistoVector("1D","convFractionVsEt", "Fraction of Converted Photons vs E_{T};E_{T} (GeV)",etBin,etMin,etMax);
00146   p_convFractionVsPhi_ = book3DHistoVector("1D","convFractionVsPhi","Fraction of Converted Photons vs #phi;#phi",phiBin,phiMin,phiMax);
00147   p_convFractionVsEta_ = book2DHistoVector("1D","convFractionVsEta","Fraction of Converted Photons vs #eta;#eta",etaBin,etaMin,etaMax);
00148 
00149 
00150   //booking bad channel fraction histograms
00151   dbe_->setCurrentFolder(AllPath+"Et above 20 GeV/");
00152   p_badChannelsFractionVsPhi_ = book2DHistoVector("1D","badChannelsFractionVsPhi","Fraction of Photons which have at least one bad channel vs #phi;#phi",phiBin,phiMin,phiMax);
00153   p_badChannelsFractionVsEta_ = book2DHistoVector("1D","badChannelsFractionVsEta","Fraction of Photons which have at least one bad channel vs #eta;#eta",etaBin,etaMin, etaMax);
00154   p_badChannelsFractionVsEt_  = book2DHistoVector("1D","badChannelsFractionVsEt", "Fraction of Photons which have at least one bad channel vs E_{T};E_{T} (GeV)",etBin,etMin,etMax);
00155 
00156 
00157 
00158   //making efficiency plots
00159 
00160   MonitorElement * dividend;
00161   MonitorElement * numerator;
00162   MonitorElement * denominator;
00163 
00164   currentFolder_.str("");
00165   currentFolder_ << AllPath << "Et above 20 GeV/";
00166 
00167   //HLT efficiency plots
00168   dividend    = retrieveHisto(EffPath,"EfficiencyVsEtaHLT");
00169   numerator   = retrieveHisto(EffPath,"phoEtaPostHLT");
00170   denominator = retrieveHisto(EffPath,"phoEtaPreHLT");
00171   dividePlots(dividend,numerator,denominator);
00172 
00173   dividend    = retrieveHisto(EffPath,"EfficiencyVsEtHLT");
00174   numerator   = retrieveHisto(EffPath,"phoEtPostHLT");
00175   denominator = retrieveHisto(EffPath,"phoEtPreHLT");
00176   dividePlots(dividend,numerator,denominator);
00177 
00178 
00179   //efficiencies vs Eta
00180   denominator = retrieveHisto(currentFolder_.str(),"phoEta");
00181 
00182   dividend    = retrieveHisto(EffPath,"EfficiencyVsEtaLoose");
00183   numerator   = retrieveHisto(EffPath,"phoEtaLoose");
00184   dividePlots(dividend,numerator,denominator);
00185 
00186   dividend    = retrieveHisto(EffPath,"EfficiencyVsEtaTight");
00187   numerator   = retrieveHisto(EffPath,"phoEtaTight");
00188   dividePlots(dividend,numerator,denominator);
00189 
00190 
00191   //efficiencies vs Et
00192   denominator = retrieveHisto(currentFolder_.str(),"phoEtAllEcal");
00193 
00194   dividend    = retrieveHisto(EffPath,"EfficiencyVsEtLoose");
00195   numerator   = retrieveHisto(EffPath,"phoEtLoose");
00196   dividePlots(dividend,numerator,denominator);
00197 
00198   dividend    = retrieveHisto(EffPath,"EfficiencyVsEtTight");
00199   numerator   = retrieveHisto(EffPath,"phoEtTight");
00200   dividePlots(dividend,numerator,denominator);
00201 
00202 
00203   //conversion fractions vs Eta
00204   dividend    = retrieveHisto(EffPath,"ConvFractionVsEtaLoose");
00205   numerator   = retrieveHisto(EffPath,"convEtaLoose");
00206   denominator = retrieveHisto(EffPath,"phoEtaLoose");
00207   dividePlots(dividend,numerator,denominator);
00208 
00209   dividend    = retrieveHisto(EffPath,"ConvFractionVsEtaTight");
00210   numerator   = retrieveHisto(EffPath,"convEtaTight");
00211   denominator = retrieveHisto(EffPath,"phoEtaTight");
00212   dividePlots(dividend,numerator,denominator);
00213 
00214 
00215   //conversion fractions vs Et
00216   dividend    = retrieveHisto(EffPath,"ConvFractionVsEtLoose");
00217   numerator   = retrieveHisto(EffPath,"convEtLoose");
00218   denominator = retrieveHisto(EffPath,"phoEtLoose");
00219   dividePlots(dividend,numerator,denominator);
00220 
00221   dividend    = retrieveHisto(EffPath,"ConvFractionVsEtTight");
00222   numerator   = retrieveHisto(EffPath,"convEtTight");
00223   denominator = retrieveHisto(EffPath,"phoEtTight");
00224   dividePlots(dividend,numerator,denominator);
00225 
00226 
00227   //conversion vertex recontruction efficiency
00228   dividend    = retrieveHisto(EffPath,"VertexReconstructionEfficiencyVsEta");
00229   numerator   = retrieveHisto(currentFolder_.str()+"Conversions/","phoConvEta");
00230   denominator = retrieveHisto(EffPath,"phoEtaVertex");
00231   dividePlots(dividend,numerator,denominator);
00232 
00233 
00234   dbe_->setCurrentFolder(EffPath);
00235 
00236 
00237   dbe_->removeElement("phoEtaPreHLT");
00238   dbe_->removeElement("phoEtPreHLT");
00239   dbe_->removeElement("phoEtaPostHLT");
00240   dbe_->removeElement("phoEtPostHLT");
00241   dbe_->removeElement("phoEtaLoose");
00242   dbe_->removeElement("phoEtaTight");
00243   dbe_->removeElement("phoEtLoose");
00244   dbe_->removeElement("phoEtTight");
00245   dbe_->removeElement("phoEtaVertex");
00246   dbe_->removeElement("convEtaLoose");
00247   dbe_->removeElement("convEtaTight");
00248   dbe_->removeElement("convEtLoose");
00249   dbe_->removeElement("convEtTight");
00250 
00251 
00252   for(uint type=0;type!=types_.size();++type){
00253 
00254     for (int cut = 0; cut !=numberOfSteps_; ++cut) {
00255 
00256       currentFolder_.str("");
00257       currentFolder_ << "Egamma/PhotonAnalyzer/" << types_[type] << "Photons/Et above " << (cut+1)*cutStep_ << " GeV/";
00258 
00259       //making bad channel histograms
00260 
00261       //vs Et
00262       dividend    = retrieveHisto(currentFolder_.str(),"badChannelsFractionVsEt");
00263       numerator   = retrieveHisto(currentFolder_.str(),"phoEtBadChannels");
00264       denominator = retrieveHisto(currentFolder_.str(),"phoEtAllEcal");
00265       dividePlots(dividend,numerator,denominator);
00266 
00267       //vs eta
00268       dividend    = retrieveHisto(currentFolder_.str(),"badChannelsFractionVsEta");
00269       numerator   = retrieveHisto(currentFolder_.str(),"phoEtaBadChannels");
00270       denominator = retrieveHisto(currentFolder_.str(),"phoEta");
00271       dividePlots(dividend,numerator,denominator);
00272 
00273       //vs phi
00274       dividend    = retrieveHisto(currentFolder_.str(),"badChannelsFractionVsPhi");
00275       numerator   = retrieveHisto(currentFolder_.str(),"phoPhiBadChannels");
00276       denominator = retrieveHisto(currentFolder_.str(),"phoPhiAllEcal");
00277       dividePlots(dividend,numerator,denominator);
00278 
00279       //making conversion fraction histograms
00280 
00281       //vs Et
00282       dividend    = retrieveHisto(currentFolder_.str()+"Conversions/","convFractionVsEt");
00283       numerator   = retrieveHisto(currentFolder_.str()+"Conversions/","phoConvEtAllEcal");
00284       denominator = retrieveHisto(currentFolder_.str(),"phoEtAllEcal");
00285       dividePlots(dividend,numerator,denominator);
00286 
00287       //vs eta
00288       dividend    = retrieveHisto(currentFolder_.str()+"Conversions/","convFractionVsEta");
00289       numerator   = retrieveHisto(currentFolder_.str()+"Conversions/","phoConvEtaForEfficiency");
00290       denominator = retrieveHisto(currentFolder_.str(),"phoEta");
00291       dividePlots(dividend,numerator,denominator);
00292 
00293       //vs phi
00294       dividend    = retrieveHisto(currentFolder_.str()+"Conversions/","convFractionVsPhiAllEcal");
00295       numerator   = retrieveHisto(currentFolder_.str()+"Conversions/","phoConvPhiForEfficiencyAllEcal");
00296       denominator = retrieveHisto(currentFolder_.str(),"phoPhiAllEcal");
00297       dividePlots(dividend,numerator,denominator);
00298       dividend    = retrieveHisto(currentFolder_.str()+"Conversions/","convFractionVsPhiBarrel");
00299       numerator   = retrieveHisto(currentFolder_.str()+"Conversions/","phoConvPhiForEfficiencyBarrel");
00300       denominator = retrieveHisto(currentFolder_.str(),"phoPhiBarrel");
00301       dividePlots(dividend,numerator,denominator);
00302       dividend    = retrieveHisto(currentFolder_.str()+"Conversions/","convFractionVsPhiEndcaps");
00303       numerator   = retrieveHisto(currentFolder_.str()+"Conversions/","phoConvPhiForEfficiencyEndcaps");
00304       denominator = retrieveHisto(currentFolder_.str(),"phoPhiEndcaps");
00305       dividePlots(dividend,numerator,denominator);
00306 
00307 
00308       dbe_->setCurrentFolder(currentFolder_.str()+"Conversions/");
00309       dbe_->removeElement("phoConvEtaForEfficiency");
00310       dbe_->removeElement("phoConvPhiForEfficiencyAllEcal");
00311       dbe_->removeElement("phoConvPhiForEfficiencyBarrel");
00312       dbe_->removeElement("phoConvPhiForEfficiencyEndcaps");
00313 
00314     }
00315 
00316 
00317   }
00318 
00319 
00320   if(standAlone_) dbe_->save(outputFileName_);
00321   else if(batch_) dbe_->save(inputFileName_);
00322 
00323 
00324 }
00325 
00326 
00327 
00328 
00329 void  PhotonOfflineClient::dividePlots(MonitorElement* dividend, MonitorElement* numerator, MonitorElement* denominator){
00330   double value,err;
00331 
00332   dividend->setEfficiencyFlag(); 
00333   if(denominator->getEntries()==0) return;
00334 
00335   for (int j=1; j<=numerator->getNbinsX(); j++){
00336     if (denominator->getBinContent(j)!=0){
00337       value = ((double) numerator->getBinContent(j))/((double) denominator->getBinContent(j));
00338       err = sqrt( value*(1-value) / ((double) denominator->getBinContent(j)) );
00339       dividend->setBinContent(j, value);
00340       dividend->setBinError(j,err);
00341     }
00342     else {
00343       dividend->setBinContent(j, 0);
00344       dividend->setBinError(j,0);
00345     }
00346     dividend->setEntries(numerator->getEntries());
00347   }
00348 }
00349 
00350 
00351 void  PhotonOfflineClient::dividePlots(MonitorElement* dividend, MonitorElement* numerator, double denominator){
00352   double value,err;
00353 
00354   dividend->setEfficiencyFlag(); 
00355   for (int j=1; j<=numerator->getNbinsX(); j++){
00356     if (denominator!=0){
00357       value = ((double) numerator->getBinContent(j))/denominator;
00358       err = sqrt( value*(1-value) / denominator);
00359       dividend->setBinContent(j, value);
00360       dividend->setBinError(j,err);
00361     }
00362     else {
00363       dividend->setBinContent(j, 0);
00364     }
00365   }
00366 
00367 }
00368 
00369 MonitorElement* PhotonOfflineClient::bookHisto(string histoName, string title, int bin, double min, double max)
00370 {
00371 
00372   int histo_index = 0;
00373   stringstream histo_number_stream;
00374 
00375 
00376   //determining which folder we're in
00377   if(dbe_->pwd().find( "InvMass" ) != string::npos){
00378     histo_index_invMass_++;
00379     histo_index = histo_index_invMass_;
00380   }
00381   if(dbe_->pwd().find( "Efficiencies" ) != string::npos){
00382     histo_index_efficiency_++;
00383     histo_index = histo_index_efficiency_;
00384   }
00385   histo_number_stream << "h_";
00386   if(histo_index<10)   histo_number_stream << "0";
00387   histo_number_stream << histo_index;
00388 
00389   return dbe_->book1D(histo_number_stream.str()+"_"+histoName,title,bin,min,max);
00390 
00391 }
00392 
00393 vector<vector<MonitorElement*> > PhotonOfflineClient::book2DHistoVector(string histoType, string histoName, string title,
00394                                                                              int xbin, double xmin,double xmax,
00395                                                                              int ybin, double ymin, double ymax)
00396 {
00397   int histo_index = 0;
00398 
00399   vector<MonitorElement*> temp1DVector;
00400   vector<vector<MonitorElement*> > temp2DVector;
00401 
00402   //determining which folder we're in
00403   bool conversionPlot = false;
00404   if(dbe_->pwd().find( "Conversions" ) != string::npos) conversionPlot = true;
00405 
00406 
00407   if(conversionPlot){
00408     histo_index_conversions_++;
00409     histo_index = histo_index_conversions_;
00410   }
00411   else{
00412     histo_index_photons_++;
00413     histo_index = histo_index_photons_;
00414   }
00415 
00416 
00417   stringstream histo_number_stream;
00418   histo_number_stream << "h_";
00419   if(histo_index<10)   histo_number_stream << "0";
00420   histo_number_stream << histo_index << "_";
00421 
00422 
00423   for(int cut = 0; cut != numberOfSteps_; ++cut){ //looping over Et cut values
00424 
00425     for(uint type=0;type!=types_.size();++type){  //looping over isolation type
00426 
00427       currentFolder_.str("");
00428       currentFolder_ << "Egamma/PhotonAnalyzer/" << types_[type] << "Photons/Et above " << (cut+1)*cutStep_ << " GeV";
00429       if(conversionPlot) currentFolder_ << "/Conversions";
00430 
00431       dbe_->setCurrentFolder(currentFolder_.str());
00432 
00433       string kind;
00434       if(conversionPlot) kind = " Conversions: ";
00435       else kind = " Photons: ";
00436 
00437       if(histoType=="1D")           temp1DVector.push_back(dbe_->book1D(histo_number_stream.str()+histoName,types_[type]+kind+title,xbin,xmin,xmax));
00438       else if(histoType=="2D")      temp1DVector.push_back(dbe_->book2D(histo_number_stream.str()+histoName,types_[type]+kind+title,xbin,xmin,xmax,ybin,ymin,ymax));
00439       else if(histoType=="Profile") temp1DVector.push_back(dbe_->bookProfile(histo_number_stream.str()+histoName,types_[type]+kind+title,xbin,xmin,xmax,ybin,ymin,ymax,""));
00440       //else cout << "bad histoType\n";
00441     }
00442 
00443     temp2DVector.push_back(temp1DVector);
00444     temp1DVector.clear();
00445   }
00446 
00447   return temp2DVector;
00448 
00449 }
00450 
00451 
00452 
00453 vector<vector<vector<MonitorElement*> > > PhotonOfflineClient::book3DHistoVector(string histoType, string histoName, string title,
00454                                                                              int xbin, double xmin,double xmax,
00455                                                                              int ybin, double ymin, double ymax)
00456 {
00457   int histo_index = 0;
00458 
00459   vector<MonitorElement*> temp1DVector;
00460   vector<vector<MonitorElement*> > temp2DVector;
00461   vector<vector<vector<MonitorElement*> > > temp3DVector;
00462 
00463 
00464   //determining which folder we're in
00465   bool conversionPlot = false;
00466   if(dbe_->pwd().find( "Conversions" ) != string::npos) conversionPlot = true;
00467 
00468 
00469   if(conversionPlot){
00470     histo_index_conversions_++;
00471     histo_index = histo_index_conversions_;
00472   }
00473   else{
00474     histo_index_photons_++;
00475     histo_index = histo_index_photons_;
00476   }
00477 
00478   stringstream histo_number_stream;
00479   histo_number_stream << "h_";
00480   if(histo_index<10)   histo_number_stream << "0";
00481   histo_number_stream << histo_index << "_";
00482 
00483 
00484   for(int cut = 0; cut != numberOfSteps_; ++cut){     //looping over Et cut values
00485 
00486     for(uint type=0;type!=types_.size();++type){      //looping over isolation type
00487 
00488       for(uint part=0;part!=parts_.size();++part){    //looping over different parts of the ecal
00489 
00490         currentFolder_.str("");
00491         currentFolder_ << "Egamma/PhotonAnalyzer/" << types_[type] << "Photons/Et above " << (cut+1)*cutStep_ << " GeV";
00492         if(conversionPlot) currentFolder_ << "/Conversions";
00493 
00494         dbe_->setCurrentFolder(currentFolder_.str());
00495 
00496         string kind;
00497         if(conversionPlot) kind = " Conversions: ";
00498         else kind = " Photons: ";
00499 
00500         if(histoType=="1D")           temp1DVector.push_back(dbe_->book1D(      histo_number_stream.str()+histoName+parts_[part],types_[type]+kind+parts_[part]+": "+title,xbin,xmin,xmax));
00501         else if(histoType=="2D")      temp1DVector.push_back(dbe_->book2D(      histo_number_stream.str()+histoName+parts_[part],types_[type]+kind+parts_[part]+": "+title,xbin,xmin,xmax,ybin,ymin,ymax));
00502         else if(histoType=="Profile") temp1DVector.push_back(dbe_->bookProfile( histo_number_stream.str()+histoName+parts_[part],types_[type]+kind+parts_[part]+": "+title,xbin,xmin,xmax,ybin,ymin,ymax,""));
00503         //else cout << "bad histoType\n";
00504 
00505 
00506       }
00507 
00508       temp2DVector.push_back(temp1DVector);
00509       temp1DVector.clear();
00510     }
00511 
00512     temp3DVector.push_back(temp2DVector);
00513     temp2DVector.clear();
00514   }
00515 
00516   return temp3DVector;
00517 }
00518 
00519 
00520 MonitorElement* PhotonOfflineClient::retrieveHisto(string dir, string name){
00521   //cout << "dir = " << dir << endl;
00522   //cout << "name = " << name << endl;
00523   vector<MonitorElement*> histoVector;
00524   uint indexOfRelevantHistogram=0;
00525   string fullMEName = "";
00526   histoVector = dbe_->getContents(dir);
00527   for(uint index=0;index!=histoVector.size();index++){
00528     string MEName = histoVector[index]->getName();
00529     if(MEName.find( name ) != string::npos){
00530       indexOfRelevantHistogram = index;
00531       break;
00532     }
00533   }
00534   return histoVector[indexOfRelevantHistogram];
00535 }
00536