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 Attributes
JetMETHLTOfflineClient Class Reference

#include <JetMETHLTOfflineClient.h>

Inheritance diagram for JetMETHLTOfflineClient:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &run, const edm::EventSetup &c)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
virtual void endRun (const edm::Run &run, const edm::EventSetup &c)
 
 JetMETHLTOfflineClient (const edm::ParameterSet &)
 
virtual void runClient_ ()
 
virtual ~JetMETHLTOfflineClient ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

edm::ParameterSet conf_
 
DQMStoredbe_
 
bool debug_
 
std::string dirName_
 
std::string hltTag_
 
std::string processname_
 
bool verbose_
 

Additional Inherited Members

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

Detailed Description

Definition at line 51 of file JetMETHLTOfflineClient.h.

Constructor & Destructor Documentation

JetMETHLTOfflineClient::JetMETHLTOfflineClient ( const edm::ParameterSet iConfig)
explicit

Definition at line 11 of file JetMETHLTOfflineClient.cc.

References gather_cfg::cout, dbe_, debug_, dirName_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hltTag_, cmsCodeRules.cppFunctionSkipper::operator, processname_, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), and verbose_.

11  :conf_(iConfig)
12 {
14  if (!dbe_) {
15  edm::LogError("JetMETHLTOfflineClient") << "unable to get DQMStore service, upshot is no client histograms will be made";
16  }
17  if(iConfig.getUntrackedParameter<bool>("DQMStore", false)) {
18  if(dbe_) dbe_->setVerbose(0);
19  }
20 
21  debug_ = false;
22  verbose_ = false;
23 
24  processname_ = iConfig.getParameter<std::string>("processname");
25 
26  hltTag_ = iConfig.getParameter<std::string>("hltTag");
27  if (debug_) std::cout << hltTag_ << std::endl;
28 
29  dirName_=iConfig.getParameter<std::string>("DQMDirName");
31 
32 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void setVerbose(unsigned level)
Definition: DQMStore.cc:196
tuple cout
Definition: gather_cfg.py:41
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
JetMETHLTOfflineClient::~JetMETHLTOfflineClient ( )
virtual

Definition at line 35 of file JetMETHLTOfflineClient.cc.

36 {
37 
38 }

Member Function Documentation

void JetMETHLTOfflineClient::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 63 of file JetMETHLTOfflineClient.cc.

64 {
65 
66 }
void JetMETHLTOfflineClient::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 40 of file JetMETHLTOfflineClient.cc.

41 {
42 
43 
44 }
void JetMETHLTOfflineClient::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 51 of file JetMETHLTOfflineClient.cc.

52 {
53 
54 }
void JetMETHLTOfflineClient::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 46 of file JetMETHLTOfflineClient.cc.

47 {
48 
49 }
void JetMETHLTOfflineClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 68 of file JetMETHLTOfflineClient.cc.

References runClient_().

69 {
70  runClient_();
71 }
void JetMETHLTOfflineClient::endRun ( const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 57 of file JetMETHLTOfflineClient.cc.

References runClient_().

58 {
59  runClient_();
60 }
void JetMETHLTOfflineClient::runClient_ ( )
virtual

Definition at line 73 of file JetMETHLTOfflineClient.cc.

References DQMStore::book1D(), DQMStore::book2D(), gather_cfg::cout, dbe_, debug_, dirName_, spr::find(), DQMStore::getContents(), edm::getName(), DQMStore::getSubdirs(), MonitorElement::getTH1F(), MonitorElement::getTH2F(), i, j, gen::k, prof2calltree::l, LogDebug, mergeVDriftHistosByStation::name, DQMStore::setCurrentFolder(), and indexGen::title.

Referenced by endLuminosityBlock(), and endRun().

74 {
75  if(!dbe_) return; //we dont have the DQMStore so we cant do anything
77 
78  LogDebug("JetMETHLTOfflineClient") << "runClient" << std::endl;
79  if (debug_) std::cout << "runClient" << std::endl;
80 
81  std::vector<MonitorElement*> hltMEs;
82 
83  // Look at all folders, go to the subfolder which includes the string "Eff"
84  std::vector<std::string> fullPathHLTFolders = dbe_->getSubdirs();
85  for(unsigned int i=0;i<fullPathHLTFolders.size();i++) {
86 
87  // Move on only if the folder name contains "Eff" Or "Trigger Summary"
88  if (debug_) std::cout << fullPathHLTFolders[i] << std::endl;
89  if ((fullPathHLTFolders[i].find("Eff")!=std::string::npos)) {
90  dbe_->setCurrentFolder(fullPathHLTFolders[i]);
91  } else {
92  continue;
93  }
94 
95  // Look at all subfolders, go to the subfolder which includes the string "Eff"
96  std::vector<std::string> fullSubPathHLTFolders = dbe_->getSubdirs();
97  for(unsigned int j=0;j<fullSubPathHLTFolders.size();j++) {
98 
99  if (debug_) std::cout << fullSubPathHLTFolders[j] << std::endl;
100  dbe_->setCurrentFolder(fullSubPathHLTFolders[j]);
101 
102  // Look at all MonitorElements in this folder
103  hltMEs = dbe_->getContents(fullSubPathHLTFolders[j]);
104  LogDebug("JetMETHLTOfflineClient")<< "Number of MEs for this HLT path = " << hltMEs.size() << std::endl;
105 
106  for(unsigned int k=0;k<hltMEs.size();k++) {
107  if (debug_) std::cout << hltMEs[k]->getName() << std::endl;
108 
109  //-----
110  if ((hltMEs[k]->getName().find("ME_Numerator")!=std::string::npos) && hltMEs[k]->getName().find("ME_Numerator")==0){
111 
112  std::string name = hltMEs[k]->getName();
113  name.erase(0,12); // Removed "ME_Numerator"
114  if (debug_) std::cout <<"==name=="<< name << std::endl;
115 // if( name.find("EtaPhi") !=std::string::npos ) continue; // do not consider EtaPhi 2D plots
116 
117 // MonitorElement* eff ;
118 
119  for(unsigned int l=0;l<hltMEs.size();l++) {
120  if (hltMEs[l]->getName() == "ME_Denominator"+name){
121  // found denominator too
122  if(name.find("EtaPhi") !=std::string::npos)
123  {
124  MonitorElement* eff ;
125  TH2F* tNumerator = hltMEs[k]->getTH2F();
126  TH2F* tDenominator = hltMEs[l]->getTH2F();
127 
128  std::string title = "Eff_"+hltMEs[k]->getTitle();
129 
130  TH2F *teff = (TH2F*) tNumerator->Clone(title.c_str());
131  teff->Divide(tNumerator,tDenominator,1,1);
132  eff= dbe_->book2D("ME_Eff_"+name,teff);
133  delete teff;
134  }else{
135  MonitorElement* eff ;
136  TH1F* tNumerator = hltMEs[k]->getTH1F();
137  TH1F* tDenominator = hltMEs[l]->getTH1F();
138 
139  std::string title = "Eff_"+hltMEs[k]->getTitle();
140 
141  TH1F *teff = (TH1F*) tNumerator->Clone(title.c_str());
142  teff->Divide(tNumerator,tDenominator,1,1);
143  eff= dbe_->book1D("ME_Eff_"+name,teff);
144  delete teff;
145  }
146  } // Denominator
147  } // Loop-l
148  } // Numerator
149 
150 
151  } // Loop-k
152  } // fullSubPath
153  } // fullPath
154 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1216
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
int j
Definition: DBlmapReader.cc:9
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1294
int k[5][pyjets_maxn]
TH1F * getTH1F(void) const
tuple cout
Definition: gather_cfg.py:41
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:642
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232

Member Data Documentation

edm::ParameterSet JetMETHLTOfflineClient::conf_
private

Definition at line 56 of file JetMETHLTOfflineClient.h.

DQMStore* JetMETHLTOfflineClient::dbe_
private

Definition at line 54 of file JetMETHLTOfflineClient.h.

Referenced by JetMETHLTOfflineClient(), and runClient_().

bool JetMETHLTOfflineClient::debug_
private

Definition at line 58 of file JetMETHLTOfflineClient.h.

Referenced by JetMETHLTOfflineClient(), and runClient_().

std::string JetMETHLTOfflineClient::dirName_
private

Definition at line 61 of file JetMETHLTOfflineClient.h.

Referenced by JetMETHLTOfflineClient(), and runClient_().

std::string JetMETHLTOfflineClient::hltTag_
private

Definition at line 62 of file JetMETHLTOfflineClient.h.

Referenced by JetMETHLTOfflineClient().

std::string JetMETHLTOfflineClient::processname_
private

Definition at line 63 of file JetMETHLTOfflineClient.h.

Referenced by JetMETHLTOfflineClient().

bool JetMETHLTOfflineClient::verbose_
private

Definition at line 59 of file JetMETHLTOfflineClient.h.

Referenced by JetMETHLTOfflineClient().