CMS 3D CMS Logo

List of all members | Protected Member Functions | Private Attributes
ScoutingAnalyzerBase Class Reference

#include <ScoutingAnalyzerBase.h>

Inheritance diagram for ScoutingAnalyzerBase:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... > AlphaTVarAnalyzer DiJetVarAnalyzer RazorVarAnalyzer ScoutingTestAnalyzer

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
MonitorElementbookH1 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH1andDivide (DQMStore::IBooker &, const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH1BinArray (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, float *xbinsize, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH1withSumw2 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH1withSumw2BinArray (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, float *xbinsize, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH2 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
 
MonitorElementbookH2andDivide (DQMStore::IBooker &, const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH2withSumw2 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
 
MonitorElementbookP1 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="E1 P")
 
std::string newName (const std::string &name)
 
void prepareBooking (DQMStore::IBooker &)
 
MonitorElementprofileX (DQMStore::IBooker &, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
MonitorElementprofileY (DQMStore::IBooker &, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
 ScoutingAnalyzerBase (const edm::ParameterSet &conf)
 
 ~ScoutingAnalyzerBase () override
 

Private Attributes

std::string m_MEsPath
 
std::string m_modulePath
 
unsigned m_verbosityLevel
 

Additional Inherited Members

- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Detailed Description

Definition at line 21 of file ScoutingAnalyzerBase.h.

Constructor & Destructor Documentation

ScoutingAnalyzerBase::ScoutingAnalyzerBase ( const edm::ParameterSet conf)
explicitprotected

Definition at line 10 of file ScoutingAnalyzerBase.cc.

References edm::ParameterSet::getUntrackedParameter(), m_MEsPath, m_modulePath, m_verbosityLevel, and AlCaHLTBitMon_QueryRunRegistry::string.

10  {
11  m_MEsPath = conf.getUntrackedParameter<std::string>("rootPath", "DataScouting");
12  m_modulePath = conf.getUntrackedParameter<std::string>("modulePath", "DataScouting");
13  m_verbosityLevel = conf.getUntrackedParameter<unsigned int>("verbosityLevel", 0);
14  if (!m_modulePath.empty()) {
15  m_MEsPath += "/" + m_modulePath;
16  }
17 }
T getUntrackedParameter(std::string const &, T const &) const
ScoutingAnalyzerBase::~ScoutingAnalyzerBase ( )
overrideprotected

Definition at line 19 of file ScoutingAnalyzerBase.cc.

19 {}

Member Function Documentation

void ScoutingAnalyzerBase::analyze ( const edm::Event e,
const edm::EventSetup c 
)
inlineoverrideprotected
MonitorElement * ScoutingAnalyzerBase::bookH1 ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
const std::string &  titleX = "",
const std::string &  titleY = "Events",
Option_t *  option = "E1 P" 
)
protected

Definition at line 28 of file ScoutingAnalyzerBase.cc.

References DQMStore::IBooker::book1DD(), MonitorElement::getTH1(), and newName().

Referenced by analyze().

36  {
37  MonitorElement *me = iBooker.book1DD(newName(name), title, nchX, lowX, highX);
38  if (!titleX.empty()) {
39  me->getTH1()->GetXaxis()->SetTitle(titleX.c_str());
40  }
41  if (!titleY.empty()) {
42  me->getTH1()->GetYaxis()->SetTitle(titleY.c_str());
43  }
44  if (TString(option) != "") {
45  me->getTH1()->SetOption(option);
46  }
47  return me;
48 }
TH1 * getTH1() const
std::string newName(const std::string &name)
MonitorElement * book1DD(Args &&...args)
Definition: DQMStore.h:108
MonitorElement * ScoutingAnalyzerBase::bookH1andDivide ( DQMStore::IBooker iBooker,
const std::string &  name,
MonitorElement num,
MonitorElement denom,
const std::string &  titleX,
const std::string &  titleY,
const std::string &  title = "" 
)
protected

Definition at line 195 of file ScoutingAnalyzerBase.cc.

References DQMStore::IBooker::book1DD(), MonitorElement::getTH1(), m_verbosityLevel, newName(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze().

201  {
202  std::string name2 = newName(name);
203  TH1D *h_temp = dynamic_cast<TH1D *>(num->getTH1()->Clone(name2.c_str()));
204  h_temp->Reset();
205  h_temp->Divide(num->getTH1(), denom->getTH1(), 1, 1, "b");
206  h_temp->GetXaxis()->SetTitle(titleX.c_str());
207  h_temp->GetYaxis()->SetTitle(titleY.c_str());
208  if (!title.empty()) {
209  h_temp->SetTitle(title.c_str());
210  }
211  if (m_verbosityLevel > 0) {
212  h_temp->Print();
213  }
214  MonitorElement *me = iBooker.book1DD(name2, h_temp);
215  delete h_temp;
216  return me;
217 }
TH1 * getTH1() const
std::string newName(const std::string &name)
MonitorElement * book1DD(Args &&...args)
Definition: DQMStore.h:108
MonitorElement * ScoutingAnalyzerBase::bookH1BinArray ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  title,
int  nchX,
float *  xbinsize,
const std::string &  titleX = "",
const std::string &  titleY = "Events",
Option_t *  option = "E1 P" 
)
protected

Definition at line 74 of file ScoutingAnalyzerBase.cc.

References DQMStore::IBooker::book1D(), MonitorElement::getTH1(), and newName().

Referenced by analyze().

81  {
82  MonitorElement *me = iBooker.book1D(newName(name), title, nchX, xbinsize);
83  // book1DD not implemented in DQMServices/Core/src/DQMStore.cc
84  if (!titleX.empty()) {
85  me->getTH1()->GetXaxis()->SetTitle(titleX.c_str());
86  }
87  if (!titleY.empty()) {
88  me->getTH1()->GetYaxis()->SetTitle(titleY.c_str());
89  }
90  if (TString(option) != "") {
91  me->getTH1()->SetOption(option);
92  }
93  return me;
94 }
TH1 * getTH1() const
std::string newName(const std::string &name)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * ScoutingAnalyzerBase::bookH1withSumw2 ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
const std::string &  titleX = "",
const std::string &  titleY = "Events",
Option_t *  option = "E1 P" 
)
protected

Definition at line 50 of file ScoutingAnalyzerBase.cc.

References DQMStore::IBooker::book1DD(), gather_cfg::cout, MonitorElement::getTH1(), and newName().

Referenced by analyze(), AlphaTVarAnalyzer::bookHistograms(), ScoutingTestAnalyzer::bookHistograms(), and DiJetVarAnalyzer::bookHistograms().

58  {
59  std::cout << newName(name) << std::endl;
60  MonitorElement *me = iBooker.book1DD(newName(name), title, nchX, lowX, highX);
61  me->getTH1()->Sumw2();
62  if (!titleX.empty()) {
63  me->getTH1()->GetXaxis()->SetTitle(titleX.c_str());
64  }
65  if (!titleY.empty()) {
66  me->getTH1()->GetYaxis()->SetTitle(titleY.c_str());
67  }
68  if (TString(option) != "") {
69  me->getTH1()->SetOption(option);
70  }
71  return me;
72 }
TH1 * getTH1() const
std::string newName(const std::string &name)
MonitorElement * book1DD(Args &&...args)
Definition: DQMStore.h:108
MonitorElement * ScoutingAnalyzerBase::bookH1withSumw2BinArray ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  title,
int  nchX,
float *  xbinsize,
const std::string &  titleX = "",
const std::string &  titleY = "Events",
Option_t *  option = "E1 P" 
)
protected

Definition at line 96 of file ScoutingAnalyzerBase.cc.

References DQMStore::IBooker::book1D(), gather_cfg::cout, MonitorElement::getTH1(), and newName().

Referenced by analyze(), and DiJetVarAnalyzer::bookHistograms().

103  {
104  std::cout << newName(name) << std::endl;
105  MonitorElement *me = iBooker.book1D(newName(name), title, nchX, xbinsize);
106  // book1DD not implemented in DQMServices/Core/src/DQMStore.cc
107  me->getTH1()->Sumw2();
108  if (!titleX.empty()) {
109  me->getTH1()->GetXaxis()->SetTitle(titleX.c_str());
110  }
111  if (!titleY.empty()) {
112  me->getTH1()->GetYaxis()->SetTitle(titleY.c_str());
113  }
114  if (TString(option) != "") {
115  me->getTH1()->SetOption(option);
116  }
117  return me;
118 }
TH1 * getTH1() const
std::string newName(const std::string &name)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * ScoutingAnalyzerBase::bookH2 ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
const std::string &  titleX = "",
const std::string &  titleY = "",
Option_t *  option = "COLZ" 
)
protected

Definition at line 120 of file ScoutingAnalyzerBase.cc.

References DQMStore::IBooker::book2DD(), MonitorElement::getTH1(), and newName().

Referenced by analyze().

131  {
132  MonitorElement *me = iBooker.book2DD(newName(name), title, nchX, lowX, highX, nchY, lowY, highY);
133  if (!titleX.empty()) {
134  me->getTH1()->GetXaxis()->SetTitle(titleX.c_str());
135  }
136  if (!titleY.empty()) {
137  me->getTH1()->GetYaxis()->SetTitle(titleY.c_str());
138  }
139  if (TString(option) != "") {
140  me->getTH1()->SetOption(option);
141  }
142  return me;
143 }
TH1 * getTH1() const
std::string newName(const std::string &name)
MonitorElement * book2DD(Args &&...args)
Definition: DQMStore.h:111
MonitorElement * ScoutingAnalyzerBase::bookH2andDivide ( DQMStore::IBooker iBooker,
const std::string &  name,
MonitorElement num,
MonitorElement denom,
const std::string &  titleX,
const std::string &  titleY,
const std::string &  title = "" 
)
protected

Definition at line 219 of file ScoutingAnalyzerBase.cc.

References DQMStore::IBooker::book2DD(), MonitorElement::getTH1(), m_verbosityLevel, newName(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze().

225  {
226  std::string name2 = newName(name);
227  TH2D *h_temp = dynamic_cast<TH2D *>(num->getTH1()->Clone(name2.c_str()));
228  h_temp->Reset();
229  h_temp->Divide(num->getTH1(), denom->getTH1(), 1, 1, "b");
230  h_temp->GetXaxis()->SetTitle(titleX.c_str());
231  h_temp->GetYaxis()->SetTitle(titleY.c_str());
232  if (!title.empty()) {
233  h_temp->SetTitle(title.c_str());
234  }
235  if (m_verbosityLevel > 0) {
236  h_temp->Print();
237  }
238  MonitorElement *me = iBooker.book2DD(name2, h_temp);
239  delete h_temp;
240  return me;
241 }
TH1 * getTH1() const
std::string newName(const std::string &name)
MonitorElement * book2DD(Args &&...args)
Definition: DQMStore.h:111
MonitorElement * ScoutingAnalyzerBase::bookH2withSumw2 ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
const std::string &  titleX = "",
const std::string &  titleY = "",
Option_t *  option = "COLZ" 
)
protected

Definition at line 145 of file ScoutingAnalyzerBase.cc.

References DQMStore::IBooker::book2DD(), MonitorElement::getTH1(), and newName().

Referenced by analyze(), AlphaTVarAnalyzer::bookHistograms(), ScoutingTestAnalyzer::bookHistograms(), RazorVarAnalyzer::bookHistograms(), and DiJetVarAnalyzer::bookHistograms().

156  {
157  MonitorElement *me = iBooker.book2DD(newName(name), title, nchX, lowX, highX, nchY, lowY, highY);
158  me->getTH1()->Sumw2();
159  if (!titleX.empty()) {
160  me->getTH1()->GetXaxis()->SetTitle(titleX.c_str());
161  }
162  if (!titleY.empty()) {
163  me->getTH1()->GetYaxis()->SetTitle(titleY.c_str());
164  }
165  if (TString(option) != "") {
166  me->getTH1()->SetOption(option);
167  }
168  return me;
169 }
TH1 * getTH1() const
std::string newName(const std::string &name)
MonitorElement * book2DD(Args &&...args)
Definition: DQMStore.h:111
MonitorElement * ScoutingAnalyzerBase::bookP1 ( DQMStore::IBooker iBooker,
const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
double  lowY,
double  highY,
const std::string &  titleX = "",
const std::string &  titleY = "",
Option_t *  option = "E1 P" 
)
protected

Definition at line 171 of file ScoutingAnalyzerBase.cc.

References DQMStore::IBooker::bookProfile(), MonitorElement::getTProfile(), and newName().

Referenced by analyze().

181  {
182  MonitorElement *me = iBooker.bookProfile(newName(name), title, nchX, lowX, highX, lowY, highY, " ");
183  if (!titleX.empty()) {
184  me->getTProfile()->GetXaxis()->SetTitle(titleX.c_str());
185  }
186  if (!titleY.empty()) {
187  me->getTProfile()->GetYaxis()->SetTitle(titleY.c_str());
188  }
189  if (TString(option) != "") {
190  me->getTProfile()->SetOption(option);
191  }
192  return me;
193 }
TProfile * getTProfile() const
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:113
std::string newName(const std::string &name)
std::string ScoutingAnalyzerBase::newName ( const std::string &  name)
inlineprotected

Definition at line 21 of file ScoutingAnalyzerBase.cc.

References dataset::name.

Referenced by analyze(), bookH1(), bookH1andDivide(), bookH1BinArray(), bookH1withSumw2(), bookH1withSumw2BinArray(), bookH2(), bookH2andDivide(), bookH2withSumw2(), and bookP1().

21  {
22  // let's keep it in case we need massage
23  return name;
24 }
void ScoutingAnalyzerBase::prepareBooking ( DQMStore::IBooker iBooker)
protected
MonitorElement * ScoutingAnalyzerBase::profileX ( DQMStore::IBooker iBooker,
MonitorElement me2d,
const std::string &  title = "",
const std::string &  titleX = "",
const std::string &  titleY = "",
Double_t  minimum = -1111,
Double_t  maximum = -1111 
)
protected

Definition at line 243 of file ScoutingAnalyzerBase.cc.

References DQMStore::IBooker::bookProfile(), MonitorElement::getName(), MonitorElement::getTH2D(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze().

249  {
250  std::string name2 = me2d->getName() + "_pfx";
251  TProfile *p1_temp = me2d->getTH2D()->ProfileX();
252  if (!title.empty()) {
253  p1_temp->SetTitle(title.c_str());
254  }
255  if (!titleX.empty()) {
256  p1_temp->GetXaxis()->SetTitle(titleX.c_str());
257  }
258  if (!titleY.empty()) {
259  p1_temp->GetYaxis()->SetTitle(titleY.c_str());
260  }
261  if (minimum != -1111) {
262  p1_temp->SetMinimum(minimum);
263  }
264  if (maximum != -1111) {
265  p1_temp->SetMaximum(maximum);
266  }
267  MonitorElement *me = iBooker.bookProfile(name2, p1_temp);
268  delete p1_temp;
269  return me;
270 }
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:113
const std::string & getName() const
get name of ME
TH2D * getTH2D() const
MonitorElement * ScoutingAnalyzerBase::profileY ( DQMStore::IBooker iBooker,
MonitorElement me2d,
const std::string &  title = "",
const std::string &  titleX = "",
const std::string &  titleY = "",
Double_t  minimum = -1111,
Double_t  maximum = -1111 
)
protected

Definition at line 272 of file ScoutingAnalyzerBase.cc.

References DQMStore::IBooker::bookProfile(), MonitorElement::getName(), MonitorElement::getTH2D(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze().

278  {
279  std::string name2 = me2d->getName() + "_pfy";
280  TProfile *p1_temp = me2d->getTH2D()->ProfileY();
281  if (!title.empty()) {
282  p1_temp->SetTitle(title.c_str());
283  }
284  if (!titleX.empty()) {
285  p1_temp->GetXaxis()->SetTitle(titleX.c_str());
286  }
287  if (!titleY.empty()) {
288  p1_temp->GetYaxis()->SetTitle(titleY.c_str());
289  }
290  if (minimum != -1111) {
291  p1_temp->SetMinimum(minimum);
292  }
293  if (maximum != -1111) {
294  p1_temp->SetMaximum(maximum);
295  }
296  MonitorElement *me = iBooker.bookProfile(name2, p1_temp);
297  delete p1_temp;
298  return me;
299 }
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:113
const std::string & getName() const
get name of ME
TH2D * getTH2D() const

Member Data Documentation

std::string ScoutingAnalyzerBase::m_MEsPath
private

Definition at line 144 of file ScoutingAnalyzerBase.h.

Referenced by prepareBooking(), and ScoutingAnalyzerBase().

std::string ScoutingAnalyzerBase::m_modulePath
private

Definition at line 143 of file ScoutingAnalyzerBase.h.

Referenced by ScoutingAnalyzerBase().

unsigned ScoutingAnalyzerBase::m_verbosityLevel
private

Definition at line 145 of file ScoutingAnalyzerBase.h.

Referenced by bookH1andDivide(), bookH2andDivide(), and ScoutingAnalyzerBase().