test
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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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

std::string analyzerName_
 
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_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, and DQMStore::setVerbose().

26 {
27 
28  dbe_ = 0;
30  dbe_->setVerbose(0);
31  parameters_ = pset;
32 
33  analyzerName_ = pset.getParameter<string>("analyzerName");
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  excludeBkgHistos_ = pset.getParameter<bool>("excludeBkgHistos");
50 
51  outputFileName_ = pset.getParameter<string>("OutputFileName");
52  inputFileName_ = pset.getUntrackedParameter<string>("InputFileName");
53 
58 
59  types_.push_back("All");
60  types_.push_back("GoodCandidate");
61  if (!excludeBkgHistos_) types_.push_back("Background");
62 
63  parts_.push_back("AllEcal");
64  parts_.push_back("Barrel");
65  parts_.push_back("Endcaps");
66 
67 }
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:631
edm::ParameterSet parameters_
PhotonOfflineClient::~PhotonOfflineClient ( )
virtual

Definition at line 69 of file PhotonOfflineClient.cc.

70 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 73 of file PhotonOfflineClient.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 71 of file PhotonOfflineClient.cc.

72 {}
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 364 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.

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

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

Definition at line 340 of file PhotonOfflineClient.cc.

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

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

Definition at line 300 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.

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

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

322  {
323  double value,err;
324 
325  dividend->setEfficiencyFlag();
326  for (int j=1; j<=numerator->getNbinsX(); j++){
327  if (denominator!=0){
328  value = ((double) numerator->getBinContent(j))/denominator;
329  err = sqrt( value*(1-value) / denominator);
330  dividend->setBinContent(j, value);
331  dividend->setBinError(j,err);
332  }
333  else {
334  dividend->setBinContent(j, 0);
335  }
336  }
337 
338 }
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 78 of file PhotonOfflineClient.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 75 of file PhotonOfflineClient.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 82 of file PhotonOfflineClient.cc.

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

Definition at line 491 of file PhotonOfflineClient.cc.

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

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

Definition at line 87 of file PhotonOfflineClient.cc.

References gather_cfg::cout, GOODCOLL_filter_cfg::cut, dbe_, cuy::denominator, DQMStore::dirExists(), DQMStore::get(), MonitorElement::getIntValue(), cuy::numerator, DQMStore::open(), DQMStore::removeElement(), DQMStore::save(), and DQMStore::setCurrentFolder().

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

Member Data Documentation

std::string PhotonOfflineClient::analyzerName_
private

Definition at line 97 of file PhotonOfflineClient.h.

bool PhotonOfflineClient::batch_
private

Definition at line 144 of file PhotonOfflineClient.h.

std::stringstream PhotonOfflineClient::currentFolder_
private

Definition at line 149 of file PhotonOfflineClient.h.

double PhotonOfflineClient::cutStep_
private

Definition at line 128 of file PhotonOfflineClient.h.

DQMStore* PhotonOfflineClient::dbe_
private

Definition at line 123 of file PhotonOfflineClient.h.

int PhotonOfflineClient::etaBin
private

Definition at line 138 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etaMax
private

Definition at line 137 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etaMin
private

Definition at line 136 of file PhotonOfflineClient.h.

int PhotonOfflineClient::etBin
private

Definition at line 135 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etMax
private

Definition at line 134 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etMin
private

Definition at line 133 of file PhotonOfflineClient.h.

bool PhotonOfflineClient::excludeBkgHistos_
private

Definition at line 131 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_conversions_
private

Definition at line 152 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_efficiency_
private

Definition at line 153 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_invMass_
private

Definition at line 154 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_photons_
private

Definition at line 151 of file PhotonOfflineClient.h.

std::string PhotonOfflineClient::inputFileName_
private

Definition at line 147 of file PhotonOfflineClient.h.

bool PhotonOfflineClient::minimalSetOfHistos_
private

Definition at line 130 of file PhotonOfflineClient.h.

int PhotonOfflineClient::numberOfSteps_
private

Definition at line 129 of file PhotonOfflineClient.h.

std::string PhotonOfflineClient::outputFileName_
private

Definition at line 146 of file PhotonOfflineClient.h.

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

Definition at line 116 of file PhotonOfflineClient.h.

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

Definition at line 114 of file PhotonOfflineClient.h.

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

Definition at line 115 of file PhotonOfflineClient.h.

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

Definition at line 112 of file PhotonOfflineClient.h.

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

Definition at line 110 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtaLoose_
private

Definition at line 105 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtaTight_
private

Definition at line 107 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtLoose_
private

Definition at line 106 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtTight_
private

Definition at line 108 of file PhotonOfflineClient.h.

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

Definition at line 111 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtaHLT_
private

Definition at line 102 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtaLoose_
private

Definition at line 98 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtaTight_
private

Definition at line 100 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtHLT_
private

Definition at line 103 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtLoose_
private

Definition at line 99 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtTight_
private

Definition at line 101 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_vertexReconstructionEfficiencyVsEta_
private

Definition at line 118 of file PhotonOfflineClient.h.

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

Definition at line 157 of file PhotonOfflineClient.h.

int PhotonOfflineClient::phiBin
private

Definition at line 141 of file PhotonOfflineClient.h.

double PhotonOfflineClient::phiMax
private

Definition at line 140 of file PhotonOfflineClient.h.

double PhotonOfflineClient::phiMin
private

Definition at line 139 of file PhotonOfflineClient.h.

bool PhotonOfflineClient::standAlone_
private

Definition at line 143 of file PhotonOfflineClient.h.

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

Definition at line 156 of file PhotonOfflineClient.h.

int PhotonOfflineClient::verbosity_
private

Definition at line 124 of file PhotonOfflineClient.h.