CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
PhotonOfflineClient Class Reference

#include <PhotonOfflineClient.h>

Inheritance diagram for PhotonOfflineClient:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
std::vector< std::vector
< MonitorElement * > > 
book2DHistoVector (std::string histoType, std::string histoName, std::string title, int xbin, double xmin, double xmax, int ybin=1, double ymin=1, double ymax=2)
 
std::vector< std::vector
< std::vector< MonitorElement * > > > 
book3DHistoVector (std::string histoType, std::string histoName, std::string title, int xbin, double xmin, double xmax, int ybin=1, double ymin=1, double ymax=2)
 
MonitorElementbookHisto (std::string histoName, std::string title, int bin, double min, double max)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
 PhotonOfflineClient (const edm::ParameterSet &pset)
 
MonitorElementretrieveHisto (std::string dir, std::string name)
 
virtual void runClient ()
 
virtual ~PhotonOfflineClient ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

void dividePlots (MonitorElement *dividend, MonitorElement *numerator, MonitorElement *denominator)
 
void dividePlots (MonitorElement *dividend, MonitorElement *numerator, double denominator)
 

Private Attributes

bool batch_
 
std::stringstream currentFolder_
 
double cutStep_
 
DQMStoredbe_
 
int etaBin
 
double etaMax
 
double etaMin
 
int etBin
 
double etMax
 
double etMin
 
int histo_index_conversions_
 
int histo_index_efficiency_
 
int histo_index_invMass_
 
int histo_index_photons_
 
std::string inputFileName_
 
int numberOfSteps_
 
std::string outputFileName_
 
std::vector< std::vector
< MonitorElement * > > 
p_badChannelsFractionVsEt_
 
std::vector< std::vector
< MonitorElement * > > 
p_badChannelsFractionVsEta_
 
std::vector< std::vector
< MonitorElement * > > 
p_badChannelsFractionVsPhi_
 
std::vector< std::vector
< MonitorElement * > > 
p_convFractionVsEt_
 
std::vector< std::vector
< MonitorElement * > > 
p_convFractionVsEta_
 
MonitorElementp_convFractionVsEtaLoose_
 
MonitorElementp_convFractionVsEtaTight_
 
MonitorElementp_convFractionVsEtLoose_
 
MonitorElementp_convFractionVsEtTight_
 
std::vector< std::vector
< std::vector< MonitorElement * > > > 
p_convFractionVsPhi_
 
MonitorElementp_efficiencyVsEtaHLT_
 
MonitorElementp_efficiencyVsEtaLoose_
 
MonitorElementp_efficiencyVsEtaTight_
 
MonitorElementp_efficiencyVsEtHLT_
 
MonitorElementp_efficiencyVsEtLoose_
 
MonitorElementp_efficiencyVsEtTight_
 
MonitorElementp_vertexReconstructionEfficiencyVsEta_
 
edm::ParameterSet parameters_
 
std::vector< std::string > parts_
 
int phiBin
 
double phiMax
 
double phiMin
 
bool standAlone_
 
std::vector< std::string > types_
 
int verbosity_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

$Id: PhotonOfflineClient

Date:
2010/11/17 18:04:36

authors: Nancy Marinelli, U. of Notre Dame, US Jamie Antonelli, U. of Notre Dame, US

$Id: PhotonOfflineClient

Date:
2010/11/29 00:25:44

authors: Nancy Marinelli, U. of Notre Dame, US Jamie Antonelli, U. of Notre Dame, US

Definition at line 59 of file PhotonOfflineClient.h.

Constructor & Destructor Documentation

PhotonOfflineClient::PhotonOfflineClient ( const edm::ParameterSet pset)
explicit

Definition at line 26 of file PhotonOfflineClient.cc.

References dbe_, jptDQMConfig_cff::etaMax, jptDQMConfig_cff::etaMin, jptDQMConfig_cff::etMax, reco::tau::qcuts::etMin(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), cmsCodeRules.cppFunctionSkipper::operator, jptDQMConfig_cff::phiMax, jptDQMConfig_cff::phiMin, MultipleCompare::pset, and DQMStore::setVerbose().

27 {
28 
29  dbe_ = 0;
31  dbe_->setVerbose(0);
32  parameters_ = pset;
33 
34  cutStep_ = pset.getParameter<double>("cutStep");
35  numberOfSteps_ = pset.getParameter<int>("numberOfSteps");
36 
37  etMin = pset.getParameter<double>("etMin");
38  etMax = pset.getParameter<double>("etMax");
39  etBin = pset.getParameter<int>("etBin");
40  etaMin = pset.getParameter<double>("etaMin");
41  etaMax = pset.getParameter<double>("etaMax");
42  etaBin = pset.getParameter<int>("etaBin");
43  phiMin = pset.getParameter<double>("phiMin");
44  phiMax = pset.getParameter<double>("phiMax");
45  phiBin = pset.getParameter<int>("phiBin");
46 
47  standAlone_ = pset.getParameter<bool>("standAlone");
48  batch_ = pset.getParameter<bool>("batch");
49 
50  outputFileName_ = pset.getParameter<string>("OutputFileName");
51  inputFileName_ = pset.getUntrackedParameter<string>("InputFileName");
52 
57 
58  types_.push_back("All");
59  types_.push_back("GoodCandidate");
60  types_.push_back("Background");
61 
62  parts_.push_back("AllEcal");
63  parts_.push_back("Barrel");
64  parts_.push_back("Endcaps");
65 
66 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > parts_
std::vector< std::string > types_
void setVerbose(unsigned level)
Definition: DQMStore.cc:196
edm::ParameterSet parameters_
PhotonOfflineClient::~PhotonOfflineClient ( )
virtual

Definition at line 68 of file PhotonOfflineClient.cc.

69 {}

Member Function Documentation

void PhotonOfflineClient::analyze ( const edm::Event e,
const edm::EventSetup esup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 72 of file PhotonOfflineClient.cc.

73 {}
void PhotonOfflineClient::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 70 of file PhotonOfflineClient.cc.

71 {}
vector< vector< MonitorElement * > > PhotonOfflineClient::book2DHistoVector ( std::string  histoType,
std::string  histoName,
std::string  title,
int  xbin,
double  xmin,
double  xmax,
int  ybin = 1,
double  ymin = 1,
double  ymax = 2 
)

Definition at line 391 of file PhotonOfflineClient.cc.

References DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookProfile(), align_tpl::cut, dbe_, DQMStore::pwd(), DQMStore::setCurrentFolder(), and indexGen::title.

394 {
395  int histo_index = 0;
396 
397  vector<MonitorElement*> temp1DVector;
398  vector<vector<MonitorElement*> > temp2DVector;
399 
400  //determining which folder we're in
401  bool conversionPlot = false;
402  if(dbe_->pwd().find( "Conversions" ) != string::npos) conversionPlot = true;
403 
404 
405  if(conversionPlot){
407  histo_index = histo_index_conversions_;
408  }
409  else{
411  histo_index = histo_index_photons_;
412  }
413 
414 
415  stringstream histo_number_stream;
416  histo_number_stream << "h_";
417  if(histo_index<10) histo_number_stream << "0";
418  histo_number_stream << histo_index << "_";
419 
420 
421  for(int cut = 0; cut != numberOfSteps_; ++cut){ //looping over Et cut values
422 
423  for(uint type=0;type!=types_.size();++type){ //looping over isolation type
424 
425  currentFolder_.str("");
426  currentFolder_ << "Egamma/PhotonAnalyzer/" << types_[type] << "Photons/Et above " << (cut+1)*cutStep_ << " GeV";
427  if(conversionPlot) currentFolder_ << "/Conversions";
428 
430 
431  string kind;
432  if(conversionPlot) kind = " Conversions: ";
433  else kind = " Photons: ";
434 
435  if(histoType=="1D") temp1DVector.push_back(dbe_->book1D(histo_number_stream.str()+histoName,types_[type]+kind+title,xbin,xmin,xmax));
436  else if(histoType=="2D") temp1DVector.push_back(dbe_->book2D(histo_number_stream.str()+histoName,types_[type]+kind+title,xbin,xmin,xmax,ybin,ymin,ymax));
437  else if(histoType=="Profile") temp1DVector.push_back(dbe_->bookProfile(histo_number_stream.str()+histoName,types_[type]+kind+title,xbin,xmin,xmax,ybin,ymin,ymax,""));
438  //else cout << "bad histoType\n";
439  }
440 
441  temp2DVector.push_back(temp1DVector);
442  temp1DVector.clear();
443  }
444 
445  return temp2DVector;
446 
447 }
type
Definition: HCALResponse.h:22
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
std::vector< std::string > types_
std::stringstream currentFolder_
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:828
tuple cut
Definition: align_tpl.py:88
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:642
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
const std::string & pwd(void) const
Definition: DQMStore.cc:204
vector< vector< vector< MonitorElement * > > > PhotonOfflineClient::book3DHistoVector ( std::string  histoType,
std::string  histoName,
std::string  title,
int  xbin,
double  xmin,
double  xmax,
int  ybin = 1,
double  ymin = 1,
double  ymax = 2 
)

Definition at line 451 of file PhotonOfflineClient.cc.

References DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookProfile(), align_tpl::cut, dbe_, DQMStore::pwd(), DQMStore::setCurrentFolder(), and indexGen::title.

454 {
455  int histo_index = 0;
456 
457  vector<MonitorElement*> temp1DVector;
458  vector<vector<MonitorElement*> > temp2DVector;
459  vector<vector<vector<MonitorElement*> > > temp3DVector;
460 
461 
462  //determining which folder we're in
463  bool conversionPlot = false;
464  if(dbe_->pwd().find( "Conversions" ) != string::npos) conversionPlot = true;
465 
466 
467  if(conversionPlot){
469  histo_index = histo_index_conversions_;
470  }
471  else{
473  histo_index = histo_index_photons_;
474  }
475 
476  stringstream histo_number_stream;
477  histo_number_stream << "h_";
478  if(histo_index<10) histo_number_stream << "0";
479  histo_number_stream << histo_index << "_";
480 
481 
482  for(int cut = 0; cut != numberOfSteps_; ++cut){ //looping over Et cut values
483 
484  for(uint type=0;type!=types_.size();++type){ //looping over isolation type
485 
486  for(uint part=0;part!=parts_.size();++part){ //looping over different parts of the ecal
487 
488  currentFolder_.str("");
489  currentFolder_ << "Egamma/PhotonAnalyzer/" << types_[type] << "Photons/Et above " << (cut+1)*cutStep_ << " GeV";
490  if(conversionPlot) currentFolder_ << "/Conversions";
491 
493 
494  string kind;
495  if(conversionPlot) kind = " Conversions: ";
496  else kind = " Photons: ";
497 
498  if(histoType=="1D") temp1DVector.push_back(dbe_->book1D( histo_number_stream.str()+histoName+parts_[part],types_[type]+kind+parts_[part]+": "+title,xbin,xmin,xmax));
499  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));
500  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,""));
501  //else cout << "bad histoType\n";
502 
503 
504  }
505 
506  temp2DVector.push_back(temp1DVector);
507  temp1DVector.clear();
508  }
509 
510  temp3DVector.push_back(temp2DVector);
511  temp2DVector.clear();
512  }
513 
514  return temp3DVector;
515 }
type
Definition: HCALResponse.h:22
std::vector< std::string > parts_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
std::vector< std::string > types_
std::stringstream currentFolder_
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:828
tuple cut
Definition: align_tpl.py:88
part
Definition: HCALResponse.h:21
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:642
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
const std::string & pwd(void) const
Definition: DQMStore.cc:204
MonitorElement * PhotonOfflineClient::bookHisto ( std::string  histoName,
std::string  title,
int  bin,
double  min,
double  max 
)

Definition at line 367 of file PhotonOfflineClient.cc.

References newFWLiteAna::bin, DQMStore::book1D(), dbe_, max(), min, DQMStore::pwd(), and indexGen::title.

368 {
369 
370  int histo_index = 0;
371  stringstream histo_number_stream;
372 
373 
374  //determining which folder we're in
375  if(dbe_->pwd().find( "InvMass" ) != string::npos){
377  histo_index = histo_index_invMass_;
378  }
379  if(dbe_->pwd().find( "Efficiencies" ) != string::npos){
381  histo_index = histo_index_efficiency_;
382  }
383  histo_number_stream << "h_";
384  if(histo_index<10) histo_number_stream << "0";
385  histo_number_stream << histo_index;
386 
387  return dbe_->book1D(histo_number_stream.str()+"_"+histoName,title,bin,min,max);
388 
389 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
#define min(a, b)
Definition: mlp_lapack.h:161
const T & max(const T &a, const T &b)
const std::string & pwd(void) const
Definition: DQMStore.cc:204
void PhotonOfflineClient::dividePlots ( MonitorElement dividend,
MonitorElement numerator,
MonitorElement denominator 
)
private

Definition at line 329 of file PhotonOfflineClient.cc.

References MonitorElement::getBinContent(), MonitorElement::getEntries(), MonitorElement::getNbinsX(), j, MonitorElement::setBinContent(), MonitorElement::setBinError(), MonitorElement::setEntries(), mathSSE::sqrt(), and relativeConstraints::value.

329  {
330  double value,err;
331 
332  if(denominator->getEntries()==0) return;
333 
334  for (int j=1; j<=numerator->getNbinsX(); j++){
335  if (denominator->getBinContent(j)!=0){
336  value = ((double) numerator->getBinContent(j))/((double) denominator->getBinContent(j));
337  err = sqrt( value*(1-value) / ((double) denominator->getBinContent(j)) );
338  dividend->setBinContent(j, value);
339  dividend->setBinError(j,err);
340  }
341  else {
342  dividend->setBinContent(j, 0);
343  dividend->setBinError(j,0);
344  }
345  dividend->setEntries(numerator->getEntries());
346  }
347 }
void setBinContent(int binx, double content)
set content of bin (1-D)
double getEntries(void) const
get # of entries
T sqrt(T t)
Definition: SSEVec.h:28
int j
Definition: DBlmapReader.cc:9
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
void setEntries(double nentries)
set # of entries
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
void PhotonOfflineClient::dividePlots ( MonitorElement dividend,
MonitorElement numerator,
double  denominator 
)
private

Definition at line 350 of file PhotonOfflineClient.cc.

References MonitorElement::getBinContent(), MonitorElement::getNbinsX(), j, MonitorElement::setBinContent(), MonitorElement::setBinError(), mathSSE::sqrt(), and relativeConstraints::value.

350  {
351  double value,err;
352 
353  for (int j=1; j<=numerator->getNbinsX(); j++){
354  if (denominator!=0){
355  value = ((double) numerator->getBinContent(j))/denominator;
356  err = sqrt( value*(1-value) / denominator);
357  dividend->setBinContent(j, value);
358  dividend->setBinError(j,err);
359  }
360  else {
361  dividend->setBinContent(j, 0);
362  }
363  }
364 
365 }
void setBinContent(int binx, double content)
set content of bin (1-D)
T sqrt(T t)
Definition: SSEVec.h:28
int j
Definition: DBlmapReader.cc:9
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
void PhotonOfflineClient::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 79 of file PhotonOfflineClient.cc.

80 {
81  if(standAlone_) runClient();
82 }
void PhotonOfflineClient::endLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup setup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 74 of file PhotonOfflineClient.cc.

75 {}
void PhotonOfflineClient::endRun ( const edm::Run run,
const edm::EventSetup setup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 83 of file PhotonOfflineClient.cc.

84 {
85  if(!standAlone_) runClient();
86 }
MonitorElement * PhotonOfflineClient::retrieveHisto ( std::string  dir,
std::string  name 
)

Definition at line 518 of file PhotonOfflineClient.cc.

References dbe_, DQMStore::getContents(), and getHLTprescales::index.

518  {
519  //cout << "dir = " << dir << endl;
520  //cout << "name = " << name << endl;
521  vector<MonitorElement*> histoVector;
522  uint indexOfRelevantHistogram=0;
523  string fullMEName = "";
524  histoVector = dbe_->getContents(dir);
525  for(uint index=0;index!=histoVector.size();index++){
526  string MEName = histoVector[index]->getName();
527  if(MEName.find( name ) != string::npos){
528  indexOfRelevantHistogram = index;
529  break;
530  }
531  }
532  return histoVector[indexOfRelevantHistogram];
533 }
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1294
dbl *** dir
Definition: mlp_gen.cc:35
void PhotonOfflineClient::runClient ( )
virtual

Definition at line 91 of file PhotonOfflineClient.cc.

References align_tpl::cut, dbe_, RecoTauValidation_cfi::denominator, DQMStore::dirExists(), jptDQMConfig_cff::etaMax, jptDQMConfig_cff::etaMin, jptDQMConfig_cff::etMax, reco::tau::qcuts::etMin(), DQMStore::get(), MonitorElement::getIntValue(), DQMStore::open(), jptDQMConfig_cff::phiMax, jptDQMConfig_cff::phiMin, DQMStore::removeElement(), DQMStore::save(), and DQMStore::setCurrentFolder().

92 {
93  if(!dbe_) return;
94 
96 
97  if(!dbe_->dirExists("Egamma/PhotonAnalyzer")){
98  //cout << "egamma directory doesn't exist..." << std::endl;
99  return;
100  }
101 
102  //find out how many histograms are in the various folders
103  histo_index_photons_ = dbe_->get("Egamma/PhotonAnalyzer/numberOfHistogramsInPhotonsFolder")->getIntValue();
104  histo_index_conversions_ = dbe_->get("Egamma/PhotonAnalyzer/numberOfHistogramsInConversionsFolder")->getIntValue();
105  histo_index_efficiency_ = dbe_->get("Egamma/PhotonAnalyzer/numberOfHistogramsInEfficiencyFolder")->getIntValue();
106  histo_index_invMass_ = dbe_->get("Egamma/PhotonAnalyzer/numberOfHistogramsInInvMassFolder")->getIntValue();
107 
108  dbe_->setCurrentFolder("Egamma/PhotonAnalyzer/");
109  dbe_->removeElement("numberOfHistogramsInPhotonsFolder");
110  dbe_->removeElement("numberOfHistogramsInConversionsFolder");
111  dbe_->removeElement("numberOfHistogramsInEfficiencyFolder");
112  dbe_->removeElement("numberOfHistogramsInInvMassFolder");
113 
114 
115  string AllPath = "Egamma/PhotonAnalyzer/AllPhotons/";
116  string IsoPath = "Egamma/PhotonAnalyzer/GoodCandidatePhotons/";
117  string NonisoPath = "Egamma/PhotonAnalyzer/BackgroundPhotons/";
118  string EffPath = "Egamma/PhotonAnalyzer/Efficiencies/";
119 
120 
121  //booking efficiency histograms
122  dbe_->setCurrentFolder(EffPath);
123 
124  p_efficiencyVsEtaLoose_ = bookHisto("EfficiencyVsEtaLoose","Fraction of Photons passing Loose Isolation vs #eta;#eta",etaBin,etaMin, etaMax);
125  p_efficiencyVsEtLoose_ = bookHisto("EfficiencyVsEtLoose", "Fraction of Photons passing Loose Isolation vs E_{T};E_{T} (GeV)",etBin,etMin,etMax);
126  p_efficiencyVsEtaTight_ = bookHisto("EfficiencyVsEtaTight","Fraction of Photons passing Tight Isolation vs #eta;#eta",etaBin,etaMin, etaMax);
127  p_efficiencyVsEtTight_ = bookHisto("EfficiencyVsEtTight", "Fraction of Photons passing Tight Isolation vs E_{T};E_{T} (GeV)",etBin,etMin,etMax);
128 
129 
130  p_efficiencyVsEtaHLT_ = bookHisto("EfficiencyVsEtaHLT","Fraction of Photons firing HLT vs #eta;#eta",etaBin,etaMin, etaMax);
131  p_efficiencyVsEtHLT_ = bookHisto("EfficiencyVsEtHLT", "Fraction of Photons firing HLT vs E_{T};E_{T} (GeV)",etBin,etMin,etMax);
132 
133 
134  p_convFractionVsEtaLoose_ = bookHisto("ConvFractionVsEtaLoose","Fraction of Loosely Isolated Photons which are matched to two tracks vs #eta;#eta",etaBin,etaMin, etaMax);
135  p_convFractionVsEtLoose_ = bookHisto("ConvFractionVsEtLoose", "Fraction of Loosely Isolated Photons which are matched to two tracks vs E_{T};E_{T} (GeV)",etBin,etMin,etMax);
136  p_convFractionVsEtaTight_ = bookHisto("ConvFractionVsEtaTight","Fraction of Tightly Isolated Photons which are matched to two tracks vs #eta;#eta",etaBin,etaMin, etaMax);
137  p_convFractionVsEtTight_ = bookHisto("ConvFractionVsEtTight", "Fraction of Tightly Isolated Photons which are matched to two tracks vs E_{T};E_{T} (GeV)",etBin,etMin,etMax);
138 
139  p_vertexReconstructionEfficiencyVsEta_ = bookHisto("VertexReconstructionEfficiencyVsEta","Fraction of Converted Photons which have a valid vertex vs #eta;#eta",etaBin,etaMin, etaMax);
140 
141 
142  //booking conversion fraction histograms
143  dbe_->setCurrentFolder(AllPath+"Et above 20 GeV/Conversions");
144  p_convFractionVsEt_ = book2DHistoVector("1D","convFractionVsEt", "Fraction of Converted Photons vs E_{T};E_{T} (GeV)",etBin,etMin,etMax);
145  p_convFractionVsPhi_ = book3DHistoVector("1D","convFractionVsPhi","Fraction of Converted Photons vs #phi;#phi",phiBin,phiMin,phiMax);
146  p_convFractionVsEta_ = book2DHistoVector("1D","convFractionVsEta","Fraction of Converted Photons vs #eta;#eta",etaBin,etaMin,etaMax);
147 
148 
149  //booking bad channel fraction histograms
150  dbe_->setCurrentFolder(AllPath+"Et above 20 GeV/");
151  p_badChannelsFractionVsPhi_ = book2DHistoVector("1D","badChannelsFractionVsPhi","Fraction of Photons which have at least one bad channel vs #phi;#phi",phiBin,phiMin,phiMax);
152  p_badChannelsFractionVsEta_ = book2DHistoVector("1D","badChannelsFractionVsEta","Fraction of Photons which have at least one bad channel vs #eta;#eta",etaBin,etaMin, etaMax);
153  p_badChannelsFractionVsEt_ = book2DHistoVector("1D","badChannelsFractionVsEt", "Fraction of Photons which have at least one bad channel vs E_{T};E_{T} (GeV)",etBin,etMin,etMax);
154 
155 
156 
157  //making efficiency plots
158 
159  MonitorElement * dividend;
160  MonitorElement * numerator;
162 
163  currentFolder_.str("");
164  currentFolder_ << AllPath << "Et above 20 GeV/";
165 
166  //HLT efficiency plots
167  dividend = retrieveHisto(EffPath,"EfficiencyVsEtaHLT");
168  numerator = retrieveHisto(EffPath,"phoEtaPostHLT");
169  denominator = retrieveHisto(EffPath,"phoEtaPreHLT");
170  dividePlots(dividend,numerator,denominator);
171 
172  dividend = retrieveHisto(EffPath,"EfficiencyVsEtHLT");
173  numerator = retrieveHisto(EffPath,"phoEtPostHLT");
174  denominator = retrieveHisto(EffPath,"phoEtPreHLT");
175  dividePlots(dividend,numerator,denominator);
176 
177 
178  //efficiencies vs Eta
179  denominator = retrieveHisto(currentFolder_.str(),"phoEta");
180 
181  dividend = retrieveHisto(EffPath,"EfficiencyVsEtaLoose");
182  numerator = retrieveHisto(EffPath,"phoEtaLoose");
183  dividePlots(dividend,numerator,denominator);
184 
185  dividend = retrieveHisto(EffPath,"EfficiencyVsEtaTight");
186  numerator = retrieveHisto(EffPath,"phoEtaTight");
187  dividePlots(dividend,numerator,denominator);
188 
189 
190  //efficiencies vs Et
191  denominator = retrieveHisto(currentFolder_.str(),"phoEtAllEcal");
192 
193  dividend = retrieveHisto(EffPath,"EfficiencyVsEtLoose");
194  numerator = retrieveHisto(EffPath,"phoEtLoose");
195  dividePlots(dividend,numerator,denominator);
196 
197  dividend = retrieveHisto(EffPath,"EfficiencyVsEtTight");
198  numerator = retrieveHisto(EffPath,"phoEtTight");
199  dividePlots(dividend,numerator,denominator);
200 
201 
202  //conversion fractions vs Eta
203  dividend = retrieveHisto(EffPath,"ConvFractionVsEtaLoose");
204  numerator = retrieveHisto(EffPath,"convEtaLoose");
205  denominator = retrieveHisto(EffPath,"phoEtaLoose");
206  dividePlots(dividend,numerator,denominator);
207 
208  dividend = retrieveHisto(EffPath,"ConvFractionVsEtaTight");
209  numerator = retrieveHisto(EffPath,"convEtaTight");
210  denominator = retrieveHisto(EffPath,"phoEtaTight");
211  dividePlots(dividend,numerator,denominator);
212 
213 
214  //conversion fractions vs Et
215  dividend = retrieveHisto(EffPath,"ConvFractionVsEtLoose");
216  numerator = retrieveHisto(EffPath,"convEtLoose");
217  denominator = retrieveHisto(EffPath,"phoEtLoose");
218  dividePlots(dividend,numerator,denominator);
219 
220  dividend = retrieveHisto(EffPath,"ConvFractionVsEtTight");
221  numerator = retrieveHisto(EffPath,"convEtTight");
222  denominator = retrieveHisto(EffPath,"phoEtTight");
223  dividePlots(dividend,numerator,denominator);
224 
225 
226  //conversion vertex recontruction efficiency
227  dividend = retrieveHisto(EffPath,"VertexReconstructionEfficiencyVsEta");
228  numerator = retrieveHisto(currentFolder_.str()+"Conversions/","phoConvEta");
229  denominator = retrieveHisto(EffPath,"phoEtaVertex");
230  dividePlots(dividend,numerator,denominator);
231 
232 
233  dbe_->setCurrentFolder(EffPath);
234 
235 
236  dbe_->removeElement("phoEtaPreHLT");
237  dbe_->removeElement("phoEtPreHLT");
238  dbe_->removeElement("phoEtaPostHLT");
239  dbe_->removeElement("phoEtPostHLT");
240  dbe_->removeElement("phoEtaLoose");
241  dbe_->removeElement("phoEtaTight");
242  dbe_->removeElement("phoEtLoose");
243  dbe_->removeElement("phoEtTight");
244  dbe_->removeElement("phoEtaVertex");
245  dbe_->removeElement("convEtaLoose");
246  dbe_->removeElement("convEtaTight");
247  dbe_->removeElement("convEtLoose");
248  dbe_->removeElement("convEtTight");
249 
250 
251 
252  for(uint type=0;type!=types_.size();++type){
253 
254  for (int cut = 0; cut !=numberOfSteps_; ++cut) {
255 
256  currentFolder_.str("");
257  currentFolder_ << "Egamma/PhotonAnalyzer/" << types_[type] << "Photons/Et above " << (cut+1)*cutStep_ << " GeV/";
258 
259  //making bad channel histograms
260 
261  //vs Et
262  dividend = retrieveHisto(currentFolder_.str(),"badChannelsFractionVsEt");
263  numerator = retrieveHisto(currentFolder_.str(),"phoEtBadChannels");
264  denominator = retrieveHisto(currentFolder_.str(),"phoEtAllEcal");
265  dividePlots(dividend,numerator,denominator);
266 
267  //vs eta
268  dividend = retrieveHisto(currentFolder_.str(),"badChannelsFractionVsEta");
269  numerator = retrieveHisto(currentFolder_.str(),"phoEtaBadChannels");
270  denominator = retrieveHisto(currentFolder_.str(),"phoEta");
271  dividePlots(dividend,numerator,denominator);
272 
273  //vs phi
274  dividend = retrieveHisto(currentFolder_.str(),"badChannelsFractionVsPhi");
275  numerator = retrieveHisto(currentFolder_.str(),"phoPhiBadChannels");
276  denominator = retrieveHisto(currentFolder_.str(),"phoPhiAllEcal");
277  dividePlots(dividend,numerator,denominator);
278 
279  //making conversion fraction histograms
280 
281  //vs Et
282  dividend = retrieveHisto(currentFolder_.str()+"Conversions/","convFractionVsEt");
283  numerator = retrieveHisto(currentFolder_.str()+"Conversions/","phoConvEtAllEcal");
284  denominator = retrieveHisto(currentFolder_.str(),"phoEtAllEcal");
285  dividePlots(dividend,numerator,denominator);
286 
287  //vs eta
288  dividend = retrieveHisto(currentFolder_.str()+"Conversions/","convFractionVsEta");
289  numerator = retrieveHisto(currentFolder_.str()+"Conversions/","phoConvEtaForEfficiency");
290  denominator = retrieveHisto(currentFolder_.str(),"phoEta");
291  dividePlots(dividend,numerator,denominator);
292 
293  //vs phi
294  dividend = retrieveHisto(currentFolder_.str()+"Conversions/","convFractionVsPhiAllEcal");
295  numerator = retrieveHisto(currentFolder_.str()+"Conversions/","phoConvPhiForEfficiencyAllEcal");
296  denominator = retrieveHisto(currentFolder_.str(),"phoPhiAllEcal");
297  dividePlots(dividend,numerator,denominator);
298  dividend = retrieveHisto(currentFolder_.str()+"Conversions/","convFractionVsPhiBarrel");
299  numerator = retrieveHisto(currentFolder_.str()+"Conversions/","phoConvPhiForEfficiencyBarrel");
300  denominator = retrieveHisto(currentFolder_.str(),"phoPhiBarrel");
301  dividePlots(dividend,numerator,denominator);
302  dividend = retrieveHisto(currentFolder_.str()+"Conversions/","convFractionVsPhiEndcaps");
303  numerator = retrieveHisto(currentFolder_.str()+"Conversions/","phoConvPhiForEfficiencyEndcaps");
304  denominator = retrieveHisto(currentFolder_.str(),"phoPhiEndcaps");
305  dividePlots(dividend,numerator,denominator);
306 
307 
308  dbe_->setCurrentFolder(currentFolder_.str()+"Conversions/");
309  dbe_->removeElement("phoConvEtaForEfficiency");
310  dbe_->removeElement("phoConvPhiForEfficiencyAllEcal");
311  dbe_->removeElement("phoConvPhiForEfficiencyBarrel");
312  dbe_->removeElement("phoConvPhiForEfficiencyEndcaps");
313 
314  }
315 
316 
317  }
318 
319 
321  else if(batch_) dbe_->save(inputFileName_);
322 
323 
324 }
type
Definition: HCALResponse.h:22
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:1898
std::vector< std::vector< MonitorElement * > > p_badChannelsFractionVsEta_
std::vector< std::string > types_
std::vector< std::vector< MonitorElement * > > p_convFractionVsEta_
std::vector< std::vector< MonitorElement * > > p_convFractionVsEt_
MonitorElement * p_convFractionVsEtaLoose_
MonitorElement * p_vertexReconstructionEfficiencyVsEta_
std::vector< std::vector< std::vector< MonitorElement * > > > book3DHistoVector(std::string histoType, std::string histoName, std::string title, int xbin, double xmin, double xmax, int ybin=1, double ymin=1, double ymax=2)
std::vector< std::vector< MonitorElement * > > book2DHistoVector(std::string histoType, std::string histoName, std::string title, int xbin, double xmin, double xmax, int ybin=1, double ymin=1, double ymax=2)
std::vector< std::vector< MonitorElement * > > p_badChannelsFractionVsPhi_
MonitorElement * p_efficiencyVsEtHLT_
void removeElement(const std::string &name)
Definition: DQMStore.cc:2353
void dividePlots(MonitorElement *dividend, MonitorElement *numerator, MonitorElement *denominator)
std::stringstream currentFolder_
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1265
MonitorElement * p_efficiencyVsEtaLoose_
MonitorElement * p_convFractionVsEtaTight_
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:296
tuple cut
Definition: align_tpl.py:88
MonitorElement * retrieveHisto(std::string dir, std::string name)
MonitorElement * bookHisto(std::string histoName, std::string title, int bin, double min, double max)
int64_t getIntValue(void) const
MonitorElement * p_efficiencyVsEtaHLT_
MonitorElement * p_efficiencyVsEtLoose_
MonitorElement * p_efficiencyVsEtaTight_
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2213
MonitorElement * p_convFractionVsEtTight_
std::vector< std::vector< MonitorElement * > > p_badChannelsFractionVsEt_
MonitorElement * p_convFractionVsEtLoose_
std::vector< std::vector< std::vector< MonitorElement * > > > p_convFractionVsPhi_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
MonitorElement * p_efficiencyVsEtTight_

Member Data Documentation

bool PhotonOfflineClient::batch_
private

Definition at line 137 of file PhotonOfflineClient.h.

std::stringstream PhotonOfflineClient::currentFolder_
private

Definition at line 142 of file PhotonOfflineClient.h.

double PhotonOfflineClient::cutStep_
private

Definition at line 123 of file PhotonOfflineClient.h.

DQMStore* PhotonOfflineClient::dbe_
private

Definition at line 118 of file PhotonOfflineClient.h.

int PhotonOfflineClient::etaBin
private

Definition at line 131 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etaMax
private

Definition at line 130 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etaMin
private

Definition at line 129 of file PhotonOfflineClient.h.

int PhotonOfflineClient::etBin
private

Definition at line 128 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etMax
private

Definition at line 127 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etMin
private

Definition at line 126 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_conversions_
private

Definition at line 145 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_efficiency_
private

Definition at line 146 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_invMass_
private

Definition at line 147 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_photons_
private

Definition at line 144 of file PhotonOfflineClient.h.

std::string PhotonOfflineClient::inputFileName_
private

Definition at line 140 of file PhotonOfflineClient.h.

int PhotonOfflineClient::numberOfSteps_
private

Definition at line 124 of file PhotonOfflineClient.h.

std::string PhotonOfflineClient::outputFileName_
private

Definition at line 139 of file PhotonOfflineClient.h.

std::vector<std::vector<MonitorElement*> > PhotonOfflineClient::p_badChannelsFractionVsEt_
private

Definition at line 109 of file PhotonOfflineClient.h.

std::vector<std::vector<MonitorElement*> > PhotonOfflineClient::p_badChannelsFractionVsEta_
private

Definition at line 107 of file PhotonOfflineClient.h.

std::vector<std::vector<MonitorElement*> > PhotonOfflineClient::p_badChannelsFractionVsPhi_
private

Definition at line 108 of file PhotonOfflineClient.h.

std::vector<std::vector<MonitorElement*> > PhotonOfflineClient::p_convFractionVsEt_
private

Definition at line 105 of file PhotonOfflineClient.h.

std::vector<std::vector<MonitorElement*> > PhotonOfflineClient::p_convFractionVsEta_
private

Definition at line 103 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtaLoose_
private

Definition at line 98 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtaTight_
private

Definition at line 100 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtLoose_
private

Definition at line 99 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtTight_
private

Definition at line 101 of file PhotonOfflineClient.h.

std::vector<std::vector<std::vector<MonitorElement*> > > PhotonOfflineClient::p_convFractionVsPhi_
private

Definition at line 104 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtaHLT_
private

Definition at line 95 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtaLoose_
private

Definition at line 91 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtaTight_
private

Definition at line 93 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtHLT_
private

Definition at line 96 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtLoose_
private

Definition at line 92 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtTight_
private

Definition at line 94 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_vertexReconstructionEfficiencyVsEta_
private

Definition at line 111 of file PhotonOfflineClient.h.

edm::ParameterSet PhotonOfflineClient::parameters_
private
std::vector<std::string> PhotonOfflineClient::parts_
private

Definition at line 150 of file PhotonOfflineClient.h.

int PhotonOfflineClient::phiBin
private

Definition at line 134 of file PhotonOfflineClient.h.

double PhotonOfflineClient::phiMax
private

Definition at line 133 of file PhotonOfflineClient.h.

double PhotonOfflineClient::phiMin
private

Definition at line 132 of file PhotonOfflineClient.h.

bool PhotonOfflineClient::standAlone_
private

Definition at line 136 of file PhotonOfflineClient.h.

std::vector<std::string> PhotonOfflineClient::types_
private

Definition at line 149 of file PhotonOfflineClient.h.

int PhotonOfflineClient::verbosity_
private

Definition at line 119 of file PhotonOfflineClient.h.