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

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
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 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
 
- 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

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_, cppFunctionSkipper::operator, processname_, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), AlCaHLTBitMon_QueryRunRegistry::string, 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:631
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
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(), DQMStore::getSubdirs(), MonitorElement::getTH1F(), i, j, gen::k, ConfigFiles::l, LogDebug, mergeVDriftHistosByStation::name, DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, 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  }
92  else {
93  continue;
94  }
95 
96  // Look at all subfolders, go to the subfolder which includes the string "Eff"
97  std::vector<std::string> fullSubPathHLTFolders = dbe_->getSubdirs();
98  for(unsigned int j=0;j<fullSubPathHLTFolders.size();j++) {
99 
100  if (debug_) std::cout << fullSubPathHLTFolders[j] << std::endl;
101  dbe_->setCurrentFolder(fullSubPathHLTFolders[j]);
102 
103  //std::cout << "PhatDEBUG: " << fullSubPathHLTFolders[j] << std::endl;
104 
105  // Look at all MonitorElements in this folder
106  hltMEs = dbe_->getContents(fullSubPathHLTFolders[j]);
107  LogDebug("JetMETHLTOfflineClient")<< "Number of MEs for this HLT path = " << hltMEs.size() << std::endl;
108 
109  for(unsigned int k=0;k<hltMEs.size();k++) {
110  if (debug_) std::cout << hltMEs[k]->getName() << std::endl;
111 
112  //-----
113  if ((hltMEs[k]->getName().find("ME_Numerator")!=std::string::npos) && hltMEs[k]->getName().find("ME_Numerator")==0){
114 
115  std::string name = hltMEs[k]->getName();
116  name.erase(0,12); // Removed "ME_Numerator"
117  if (debug_) std::cout <<"==name=="<< name << std::endl;
118 // if( name.find("EtaPhi") !=std::string::npos ) continue; // do not consider EtaPhi 2D plots
119 
120 // MonitorElement* eff ;
121 
122  //std::cout << "PhatDEBUG: name = " << name << std::endl;
123 
124  for(unsigned int l=0;l<hltMEs.size();l++) {
125  if (hltMEs[l]->getName() == "ME_Denominator"+name){
126  // found denominator too
127  if(name.find("EtaPhi") !=std::string::npos) {
128  TH2F* tNumerator = hltMEs[k]->getTH2F();
129  TH2F* tDenominator = hltMEs[l]->getTH2F();
130 
131  std::string title = "Eff_"+hltMEs[k]->getTitle();
132 
133  TH2F *teff = (TH2F*) tNumerator->Clone(title.c_str());
134  teff->Divide(tNumerator,tDenominator,1,1);
135  dbe_->book2D("ME_Eff_"+name,teff);
136  delete teff;
137  //std::cout << "PhatDEBUG: EtaPhiEff" <<std::endl;
138  }
139  else{
140  TH1F* tNumerator = hltMEs[k]->getTH1F();
141  TH1F* tDenominator = hltMEs[l]->getTH1F();
142 
143  std::string title = "Eff_"+hltMEs[k]->getTitle();
144 
145  TH1F *teff = (TH1F*) tNumerator->Clone(title.c_str());
146  teff->Divide(tNumerator,tDenominator,1,1);
147  dbe_->book1D("ME_Eff_"+name,teff);
148  delete teff;
149  //std::cout << "PhatDEBUG: MMMM" <<std::endl;
150  }
151  } // Denominator
152  } // Loop-l
153  } // Numerator
154 
155 
156  } // Loop-k
157  } // fullSubPath
158  } // fullPath
159 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1659
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
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::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1737
int k[5][pyjets_maxn]
TH1F * getTH1F(void) const
tuple cout
Definition: gather_cfg.py:121
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

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().