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:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void book2DHistoVector (DQMStore::IBooker &iBooker, std::vector< std::vector< MonitorElement * > > &vecOfHist, std::string histoType, std::string histoName, std::string title, int xbin, double xmin, double xmax, int ybin=1, double ymin=1, double ymax=2)
 
void book3DHistoVector (DQMStore::IBooker &iBooker, std::vector< std::vector< std::vector< MonitorElement * > > > &vecOfHist, 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 (DQMStore::IBooker &iBooker, std::string histoName, std::string title, int bin, double min, double max)
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
 PhotonOfflineClient (const edm::ParameterSet &pset)
 
MonitorElementretrieveHisto (DQMStore::IGetter &iGetter, std::string dir, std::string name)
 
virtual void runClient (DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter)
 
virtual ~PhotonOfflineClient ()
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 64 of file PhotonOfflineClient.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file PhotonOfflineClient.cc.

References HLT_25ns14e33_v1_cff::etaMax, HLT_25ns14e33_v1_cff::etaMin, HLT_25ns14e33_v1_cff::etMin, edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

26 {
27 
28  //dbe_ = 0;
29  //dbe_ = edm::Service<DQMStore>().operator->();
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_
edm::ParameterSet parameters_
PhotonOfflineClient::~PhotonOfflineClient ( )
virtual

Definition at line 69 of file PhotonOfflineClient.cc.

70 {}

Member Function Documentation

void PhotonOfflineClient::book2DHistoVector ( DQMStore::IBooker iBooker,
std::vector< std::vector< MonitorElement * > > &  vecOfHist,
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 360 of file PhotonOfflineClient.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookProfile(), GOODCOLL_filter_cfg::cut, class-composition::kind, DQMStore::IBooker::pwd(), DQMStore::IBooker::setCurrentFolder(), indexGen::title, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

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

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookProfile(), GOODCOLL_filter_cfg::cut, class-composition::kind, DQMStore::IBooker::pwd(), DQMStore::IBooker::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 
431  //determining which folder we're in
432  bool conversionPlot = false;
433  if(iBooker.pwd().find( "Conversions" ) != string::npos) conversionPlot = true;
434 
435 
436  if(conversionPlot){
438  histo_index = histo_index_conversions_;
439  }
440  else{
442  histo_index = histo_index_photons_;
443  }
444 
445  stringstream histo_number_stream;
446  histo_number_stream << "h_";
447  if(histo_index<10) histo_number_stream << "0";
448  histo_number_stream << histo_index << "_";
449 
450 
451  for(int cut = 0; cut != numberOfSteps_; ++cut){ //looping over Et cut values
452 
453  for(uint type=0;type!=types_.size();++type){ //looping over isolation type
454 
455  for(uint part=0;part!=parts_.size();++part){ //looping over different parts of the ecal
456 
457  currentFolder_.str("");
458  currentFolder_ << "Egamma/"+analyzerName_+"/" << types_[type] << "Photons/Et above " << (cut+1)*cutStep_ << " GeV";
459  if(conversionPlot) currentFolder_ << "/Conversions";
460 
461  iBooker.setCurrentFolder(currentFolder_.str());
462 
463  string kind;
464  if(conversionPlot) kind = " Conversions: ";
465  else kind = " Photons: ";
466 
467  if(histoType=="1D") temp1DVector.push_back(iBooker.book1D( histo_number_stream.str()+histoName+parts_[part],types_[type]+kind+parts_[part]+": "+title,xbin,xmin,xmax));
468  else if(histoType=="2D") temp1DVector.push_back(iBooker.book2D( histo_number_stream.str()+histoName+parts_[part],types_[type]+kind+parts_[part]+": "+title,xbin,xmin,xmax,ybin,ymin,ymax));
469  else if(histoType=="Profile") temp1DVector.push_back(iBooker.bookProfile( histo_number_stream.str()+histoName+parts_[part],types_[type]+kind+parts_[part]+": "+title,xbin,xmin,xmax,ybin,ymin,ymax,""));
470  //else cout << "bad histoType\n";
471 
472 
473  }
474 
475  temp2DVector.push_back(temp1DVector);
476  temp1DVector.clear();
477  }
478 
479  temp3DVector.push_back(temp2DVector);
480  temp2DVector.clear();
481  }
482 
483 
484 }
type
Definition: HCALResponse.h:21
std::vector< std::string > parts_
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
const std::string & pwd(void)
Definition: DQMStore.cc:282
std::vector< std::string > types_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::stringstream currentFolder_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
part
Definition: HCALResponse.h:20
MonitorElement * PhotonOfflineClient::bookHisto ( DQMStore::IBooker iBooker,
std::string  histoName,
std::string  title,
int  bin,
double  min,
double  max 
)

Definition at line 334 of file PhotonOfflineClient.cc.

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

335 {
336 
337  int histo_index = 0;
338  stringstream histo_number_stream;
339 
340 
341  //determining which folder we're in
342  if(iBooker.pwd().find( "InvMass" ) != string::npos){
344  histo_index = histo_index_invMass_;
345  }
346  if(iBooker.pwd().find( "Efficiencies" ) != string::npos){
348  histo_index = histo_index_efficiency_;
349  }
350  histo_number_stream << "h_";
351  if(histo_index<10) histo_number_stream << "0";
352  histo_number_stream << histo_index;
353 
354  return iBooker.book1D(histo_number_stream.str()+"_"+histoName,title,bin,min,max);
355 
356 }
const std::string & pwd(void)
Definition: DQMStore.cc:282
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
T min(T a, T b)
Definition: MathUtil.h:58
void PhotonOfflineClient::dividePlots ( MonitorElement dividend,
MonitorElement numerator,
MonitorElement denominator 
)
private

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

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

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

316  {
317  double value,err;
318 
319  dividend->setEfficiencyFlag();
320  for (int j=1; j<=numerator->getNbinsX(); j++){
321  if (denominator!=0){
322  value = ((double) numerator->getBinContent(j))/denominator;
323  err = sqrt( value*(1-value) / denominator);
324  dividend->setBinContent(j, value);
325  dividend->setBinError(j,err);
326  }
327  else {
328  dividend->setBinContent(j, 0);
329  }
330  }
331 
332 }
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::dqmEndJob ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
overridevirtual

Implements DQMEDHarvester.

Definition at line 75 of file PhotonOfflineClient.cc.

76 {
77  if(!standAlone_) runClient(iBooker, iGetter);
78 }
virtual void runClient(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter)
MonitorElement * PhotonOfflineClient::retrieveHisto ( DQMStore::IGetter iGetter,
std::string  dir,
std::string  name 
)

Definition at line 487 of file PhotonOfflineClient.cc.

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

487  {
488  //cout << "dir = " << dir << endl;
489  //cout << "name = " << name << endl;
490  vector<MonitorElement*> histoVector;
491  uint indexOfRelevantHistogram=0;
492  string fullMEName = "";
493  histoVector = iGetter.getContents(dir);
494  for(uint index=0;index!=histoVector.size();index++){
495  string MEName = histoVector[index]->getName();
496  if(MEName.find( name ) != string::npos){
497  indexOfRelevantHistogram = index;
498  break;
499  }
500  }
501  return histoVector[indexOfRelevantHistogram];
502 }
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:197
dbl *** dir
Definition: mlp_gen.cc:35
void PhotonOfflineClient::runClient ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
virtual

Definition at line 81 of file PhotonOfflineClient.cc.

References gather_cfg::cout, GOODCOLL_filter_cfg::cut, cuy::denominator, DQMStore::IGetter::dirExists(), HLT_25ns14e33_v1_cff::etaMax, HLT_25ns14e33_v1_cff::etaMin, HLT_25ns14e33_v1_cff::etMin, DQMStore::IGetter::get(), MonitorElement::getIntValue(), cuy::numerator, DQMStore::IGetter::removeElement(), and DQMStore::IGetter::setCurrentFolder().

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

Member Data Documentation

std::string PhotonOfflineClient::analyzerName_
private

Definition at line 102 of file PhotonOfflineClient.h.

bool PhotonOfflineClient::batch_
private

Definition at line 149 of file PhotonOfflineClient.h.

std::stringstream PhotonOfflineClient::currentFolder_
private

Definition at line 154 of file PhotonOfflineClient.h.

double PhotonOfflineClient::cutStep_
private

Definition at line 133 of file PhotonOfflineClient.h.

DQMStore* PhotonOfflineClient::dbe_
private

Definition at line 128 of file PhotonOfflineClient.h.

int PhotonOfflineClient::etaBin
private

Definition at line 143 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etaMax
private

Definition at line 142 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etaMin
private

Definition at line 141 of file PhotonOfflineClient.h.

int PhotonOfflineClient::etBin
private

Definition at line 140 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etMax
private

Definition at line 139 of file PhotonOfflineClient.h.

double PhotonOfflineClient::etMin
private

Definition at line 138 of file PhotonOfflineClient.h.

bool PhotonOfflineClient::excludeBkgHistos_
private

Definition at line 136 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_conversions_
private

Definition at line 157 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_efficiency_
private

Definition at line 158 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_invMass_
private

Definition at line 159 of file PhotonOfflineClient.h.

int PhotonOfflineClient::histo_index_photons_
private

Definition at line 156 of file PhotonOfflineClient.h.

std::string PhotonOfflineClient::inputFileName_
private

Definition at line 152 of file PhotonOfflineClient.h.

bool PhotonOfflineClient::minimalSetOfHistos_
private

Definition at line 135 of file PhotonOfflineClient.h.

int PhotonOfflineClient::numberOfSteps_
private

Definition at line 134 of file PhotonOfflineClient.h.

std::string PhotonOfflineClient::outputFileName_
private

Definition at line 151 of file PhotonOfflineClient.h.

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

Definition at line 121 of file PhotonOfflineClient.h.

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

Definition at line 119 of file PhotonOfflineClient.h.

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

Definition at line 120 of file PhotonOfflineClient.h.

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

Definition at line 117 of file PhotonOfflineClient.h.

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

Definition at line 115 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtaLoose_
private

Definition at line 110 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtaTight_
private

Definition at line 112 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtLoose_
private

Definition at line 111 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_convFractionVsEtTight_
private

Definition at line 113 of file PhotonOfflineClient.h.

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

Definition at line 116 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtaHLT_
private

Definition at line 107 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtaLoose_
private

Definition at line 103 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtaTight_
private

Definition at line 105 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtHLT_
private

Definition at line 108 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtLoose_
private

Definition at line 104 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_efficiencyVsEtTight_
private

Definition at line 106 of file PhotonOfflineClient.h.

MonitorElement* PhotonOfflineClient::p_vertexReconstructionEfficiencyVsEta_
private

Definition at line 123 of file PhotonOfflineClient.h.

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

Definition at line 162 of file PhotonOfflineClient.h.

int PhotonOfflineClient::phiBin
private

Definition at line 146 of file PhotonOfflineClient.h.

double PhotonOfflineClient::phiMax
private

Definition at line 145 of file PhotonOfflineClient.h.

double PhotonOfflineClient::phiMin
private

Definition at line 144 of file PhotonOfflineClient.h.

bool PhotonOfflineClient::standAlone_
private

Definition at line 148 of file PhotonOfflineClient.h.

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

Definition at line 161 of file PhotonOfflineClient.h.

int PhotonOfflineClient::verbosity_
private

Definition at line 129 of file PhotonOfflineClient.h.