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 edm::EDConsumerBase

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 
bool excludeBkgHistos_
 
int histo_index_conversions_
 
int histo_index_efficiency_
 
int histo_index_invMass_
 
int histo_index_photons_
 
std::string inputFileName_
 
bool minimalSetOfHistos_
 
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
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

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

Definition at line 65 of file PhotonOfflineClient.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file PhotonOfflineClient.cc.

References dbe_, jptDQMConfig_cff::etaMax, jptDQMConfig_cff::etaMin, jptDQMConfig_cff::etMax, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, jptDQMConfig_cff::phiMax, jptDQMConfig_cff::phiMin, and DQMStore::setVerbose().

26 {
27 
28  dbe_ = 0;
30  dbe_->setVerbose(0);
31  parameters_ = pset;
32 
33  cutStep_ = pset.getParameter<double>("cutStep");
34  numberOfSteps_ = pset.getParameter<int>("numberOfSteps");
35 
36  etMin = pset.getParameter<double>("etMin");
37  etMax = pset.getParameter<double>("etMax");
38  etBin = pset.getParameter<int>("etBin");
39  etaMin = pset.getParameter<double>("etaMin");
40  etaMax = pset.getParameter<double>("etaMax");
41  etaBin = pset.getParameter<int>("etaBin");
42  phiMin = pset.getParameter<double>("phiMin");
43  phiMax = pset.getParameter<double>("phiMax");
44  phiBin = pset.getParameter<int>("phiBin");
45 
46  standAlone_ = pset.getParameter<bool>("standAlone");
47  batch_ = pset.getParameter<bool>("batch");
48  excludeBkgHistos_ = pset.getParameter<bool>("excludeBkgHistos");
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  if (!excludeBkgHistos_) 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:548
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 362 of file PhotonOfflineClient.cc.

References DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookProfile(), GOODCOLL_filter_cfg::cut, dbe_, DQMStore::pwd(), DQMStore::setCurrentFolder(), indexGen::title, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

365 {
366  int histo_index = 0;
367 
368  vector<MonitorElement*> temp1DVector;
369  vector<vector<MonitorElement*> > temp2DVector;
370 
371  //determining which folder we're in
372  bool conversionPlot = false;
373  if(dbe_->pwd().find( "Conversions" ) != string::npos) conversionPlot = true;
374 
375 
376  if(conversionPlot){
378  histo_index = histo_index_conversions_;
379  }
380  else{
382  histo_index = histo_index_photons_;
383  }
384 
385 
386  stringstream histo_number_stream;
387  histo_number_stream << "h_";
388  if(histo_index<10) histo_number_stream << "0";
389  histo_number_stream << histo_index << "_";
390 
391 
392  for(int cut = 0; cut != numberOfSteps_; ++cut){ //looping over Et cut values
393 
394  for(uint type=0;type!=types_.size();++type){ //looping over isolation type
395 
396  currentFolder_.str("");
397  currentFolder_ << "Egamma/PhotonAnalyzer/" << types_[type] << "Photons/Et above " << (cut+1)*cutStep_ << " GeV";
398  if(conversionPlot) currentFolder_ << "/Conversions";
399 
401 
402  string kind;
403  if(conversionPlot) kind = " Conversions: ";
404  else kind = " Photons: ";
405 
406  if(histoType=="1D") temp1DVector.push_back(dbe_->book1D(histo_number_stream.str()+histoName,types_[type]+kind+title,xbin,xmin,xmax));
407  else if(histoType=="2D") temp1DVector.push_back(dbe_->book2D(histo_number_stream.str()+histoName,types_[type]+kind+title,xbin,xmin,xmax,ybin,ymin,ymax));
408  else if(histoType=="Profile") temp1DVector.push_back(dbe_->bookProfile(histo_number_stream.str()+histoName,types_[type]+kind+title,xbin,xmin,xmax,ybin,ymin,ymax,""));
409  //else cout << "bad histoType\n";
410  }
411 
412  temp2DVector.push_back(temp1DVector);
413  temp1DVector.clear();
414  }
415 
416  return temp2DVector;
417 
418 }
type
Definition: HCALResponse.h:21
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
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:1186
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:1000
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
const std::string & pwd(void) const
Definition: DQMStore.cc:556
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 422 of file PhotonOfflineClient.cc.

References DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookProfile(), GOODCOLL_filter_cfg::cut, dbe_, DQMStore::pwd(), DQMStore::setCurrentFolder(), indexGen::title, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

425 {
426  int histo_index = 0;
427 
428  vector<MonitorElement*> temp1DVector;
429  vector<vector<MonitorElement*> > temp2DVector;
430  vector<vector<vector<MonitorElement*> > > temp3DVector;
431 
432 
433  //determining which folder we're in
434  bool conversionPlot = false;
435  if(dbe_->pwd().find( "Conversions" ) != string::npos) conversionPlot = true;
436 
437 
438  if(conversionPlot){
440  histo_index = histo_index_conversions_;
441  }
442  else{
444  histo_index = histo_index_photons_;
445  }
446 
447  stringstream histo_number_stream;
448  histo_number_stream << "h_";
449  if(histo_index<10) histo_number_stream << "0";
450  histo_number_stream << histo_index << "_";
451 
452 
453  for(int cut = 0; cut != numberOfSteps_; ++cut){ //looping over Et cut values
454 
455  for(uint type=0;type!=types_.size();++type){ //looping over isolation type
456 
457  for(uint part=0;part!=parts_.size();++part){ //looping over different parts of the ecal
458 
459  currentFolder_.str("");
460  currentFolder_ << "Egamma/PhotonAnalyzer/" << types_[type] << "Photons/Et above " << (cut+1)*cutStep_ << " GeV";
461  if(conversionPlot) currentFolder_ << "/Conversions";
462 
464 
465  string kind;
466  if(conversionPlot) kind = " Conversions: ";
467  else kind = " Photons: ";
468 
469  if(histoType=="1D") temp1DVector.push_back(dbe_->book1D( histo_number_stream.str()+histoName+parts_[part],types_[type]+kind+parts_[part]+": "+title,xbin,xmin,xmax));
470  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));
471  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,""));
472  //else cout << "bad histoType\n";
473 
474 
475  }
476 
477  temp2DVector.push_back(temp1DVector);
478  temp1DVector.clear();
479  }
480 
481  temp3DVector.push_back(temp2DVector);
482  temp2DVector.clear();
483  }
484 
485  return temp3DVector;
486 }
type
Definition: HCALResponse.h:21
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:872
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:1186
part
Definition: HCALResponse.h:20
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:1000
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
const std::string & pwd(void) const
Definition: DQMStore.cc:556
MonitorElement * PhotonOfflineClient::bookHisto ( std::string  histoName,
std::string  title,
int  bin,
double  min,
double  max 
)

Definition at line 338 of file PhotonOfflineClient.cc.

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

339 {
340 
341  int histo_index = 0;
342  stringstream histo_number_stream;
343 
344 
345  //determining which folder we're in
346  if(dbe_->pwd().find( "InvMass" ) != string::npos){
348  histo_index = histo_index_invMass_;
349  }
350  if(dbe_->pwd().find( "Efficiencies" ) != string::npos){
352  histo_index = histo_index_efficiency_;
353  }
354  histo_number_stream << "h_";
355  if(histo_index<10) histo_number_stream << "0";
356  histo_number_stream << histo_index;
357 
358  return dbe_->book1D(histo_number_stream.str()+"_"+histoName,title,bin,min,max);
359 
360 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
const T & max(const T &a, const T &b)
const std::string & pwd(void) const
Definition: DQMStore.cc:556
void PhotonOfflineClient::dividePlots ( MonitorElement dividend,
MonitorElement numerator,
MonitorElement denominator 
)
private

Definition at line 298 of file PhotonOfflineClient.cc.

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

298  {
299  double value,err;
300 
301  dividend->setEfficiencyFlag();
302  if(denominator->getEntries()==0) return;
303 
304  for (int j=1; j<=numerator->getNbinsX(); j++){
305  if (denominator->getBinContent(j)!=0){
306  value = ((double) numerator->getBinContent(j))/((double) denominator->getBinContent(j));
307  err = sqrt( value*(1-value) / ((double) denominator->getBinContent(j)) );
308  dividend->setBinContent(j, value);
309  dividend->setBinError(j,err);
310  }
311  else {
312  dividend->setBinContent(j, 0);
313  dividend->setBinError(j,0);
314  }
315  dividend->setEntries(numerator->getEntries());
316  }
317 }
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:48
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 setEfficiencyFlag(void)
void PhotonOfflineClient::dividePlots ( MonitorElement dividend,
MonitorElement numerator,
double  denominator 
)
private

Definition at line 320 of file PhotonOfflineClient.cc.

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

320  {
321  double value,err;
322 
323  dividend->setEfficiencyFlag();
324  for (int j=1; j<=numerator->getNbinsX(); j++){
325  if (denominator!=0){
326  value = ((double) numerator->getBinContent(j))/denominator;
327  err = sqrt( value*(1-value) / denominator);
328  dividend->setBinContent(j, value);
329  dividend->setBinError(j,err);
330  }
331  else {
332  dividend->setBinContent(j, 0);
333  }
334  }
335 
336 }
void setBinContent(int binx, double content)
set content of bin (1-D)
list denominator
Definition: cuy.py:484
T sqrt(T t)
Definition: SSEVec.h:48
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 setEfficiencyFlag(void)
void PhotonOfflineClient::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 77 of file PhotonOfflineClient.cc.

78 {
79  if(standAlone_) runClient();
80 }
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 81 of file PhotonOfflineClient.cc.

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

Definition at line 489 of file PhotonOfflineClient.cc.

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

489  {
490  //cout << "dir = " << dir << endl;
491  //cout << "name = " << name << endl;
492  vector<MonitorElement*> histoVector;
493  uint indexOfRelevantHistogram=0;
494  string fullMEName = "";
495  histoVector = dbe_->getContents(dir);
496  for(uint index=0;index!=histoVector.size();index++){
497  string MEName = histoVector[index]->getName();
498  if(MEName.find( name ) != string::npos){
499  indexOfRelevantHistogram = index;
500  break;
501  }
502  }
503  return histoVector[indexOfRelevantHistogram];
504 }
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1652
dbl *** dir
Definition: mlp_gen.cc:35
void PhotonOfflineClient::runClient ( )
virtual

Definition at line 86 of file PhotonOfflineClient.cc.

References GOODCOLL_filter_cfg::cut, dbe_, cuy::denominator, DQMStore::dirExists(), jptDQMConfig_cff::etaMax, jptDQMConfig_cff::etaMin, jptDQMConfig_cff::etMax, DQMStore::get(), MonitorElement::getIntValue(), cuy::numerator, DQMStore::open(), jptDQMConfig_cff::phiMax, jptDQMConfig_cff::phiMin, DQMStore::removeElement(), DQMStore::save(), and DQMStore::setCurrentFolder().

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

Member Data Documentation

bool PhotonOfflineClient::batch_
private

Definition at line 143 of file PhotonOfflineClient.h.

std::stringstream PhotonOfflineClient::currentFolder_
private

Definition at line 148 of file PhotonOfflineClient.h.

double PhotonOfflineClient::cutStep_
private

Definition at line 127 of file PhotonOfflineClient.h.

DQMStore* PhotonOfflineClient::dbe_
private

Definition at line 122 of file PhotonOfflineClient.h.

int PhotonOfflineClient::etaBin
private

Definition at line 137 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etaMax
private

Definition at line 136 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etaMin
private

Definition at line 135 of file PhotonOfflineClient.h.

int PhotonOfflineClient::etBin
private

Definition at line 134 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etMax
private

Definition at line 133 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etMin
private

Definition at line 132 of file PhotonOfflineClient.h.

bool PhotonOfflineClient::excludeBkgHistos_
private

Definition at line 130 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_conversions_
private

Definition at line 151 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_efficiency_
private

Definition at line 152 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_invMass_
private

Definition at line 153 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_photons_
private

Definition at line 150 of file PhotonOfflineClient.h.

std::string PhotonOfflineClient::inputFileName_
private

Definition at line 146 of file PhotonOfflineClient.h.

bool PhotonOfflineClient::minimalSetOfHistos_
private

Definition at line 129 of file PhotonOfflineClient.h.

int PhotonOfflineClient::numberOfSteps_
private

Definition at line 128 of file PhotonOfflineClient.h.

std::string PhotonOfflineClient::outputFileName_
private

Definition at line 145 of file PhotonOfflineClient.h.

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

Definition at line 115 of file PhotonOfflineClient.h.

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

Definition at line 113 of file PhotonOfflineClient.h.

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

Definition at line 114 of file PhotonOfflineClient.h.

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

Definition at line 111 of file PhotonOfflineClient.h.

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

Definition at line 109 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtaLoose_
private

Definition at line 104 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtaTight_
private

Definition at line 106 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtLoose_
private

Definition at line 105 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtTight_
private

Definition at line 107 of file PhotonOfflineClient.h.

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

Definition at line 110 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtaHLT_
private

Definition at line 101 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtaLoose_
private

Definition at line 97 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtaTight_
private

Definition at line 99 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtHLT_
private

Definition at line 102 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtLoose_
private

Definition at line 98 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtTight_
private

Definition at line 100 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_vertexReconstructionEfficiencyVsEta_
private

Definition at line 117 of file PhotonOfflineClient.h.

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

Definition at line 156 of file PhotonOfflineClient.h.

int PhotonOfflineClient::phiBin
private

Definition at line 140 of file PhotonOfflineClient.h.

double PhotonOfflineClient::phiMax
private

Definition at line 139 of file PhotonOfflineClient.h.

double PhotonOfflineClient::phiMin
private

Definition at line 138 of file PhotonOfflineClient.h.

bool PhotonOfflineClient::standAlone_
private

Definition at line 142 of file PhotonOfflineClient.h.

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

Definition at line 155 of file PhotonOfflineClient.h.

int PhotonOfflineClient::verbosity_
private

Definition at line 123 of file PhotonOfflineClient.h.