CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
L1TGMTClient Class Reference

#include <L1TGMTClient.h>

Inheritance diagram for L1TGMTClient:
edm::EDAnalyzer

Public Member Functions

 L1TGMTClient (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~L1TGMTClient ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Fake Analyze. More...
 
void beginJob (void)
 BeginJob. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun. More...
 
void endJob ()
 Endjob. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 DQM Client Diagnostic. More...
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 EndRun. More...
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Member Functions

MonitorElementbookClone1D (std::string name, std::string title, std::string hrefName)
 
MonitorElementbookClone1DVB (std::string name, std::string title, std::string hrefName)
 
MonitorElementbookClone2D (std::string name, std::string title, std::string hrefName)
 
TH1F * get1DHisto (std::string meName, DQMStore *dbi)
 
TH2F * get2DHisto (std::string meName, DQMStore *dbi)
 
void initialize ()
 
void makeEfficiency1D (MonitorElement *meeff, std::string heName, std::string hiName)
 
void makeEfficiency2D (MonitorElement *meeff, std::string heName, std::string hiName)
 
void makeRatio1D (MonitorElement *mer, std::string h1Name, std::string h2Name)
 
void process ()
 

Private Attributes

int counterEvt_
 counter More...
 
int counterLS_
 
DQMStoredbe_
 
MonitorElementeff_eta_dtcsc
 prescale on number of events More...
 
MonitorElementeff_eta_rpc
 
MonitorElementeff_etaphi_dtcsc
 
MonitorElementeff_etaphi_rpc
 
MonitorElementeff_phi_dtcsc
 
MonitorElementeff_phi_rpc
 
std::string input_dir_
 
std::string monitorName_
 
std::string output_dir_
 
edm::ParameterSet parameters_
 
int prescaleEvt_
 units of lumi sections More...
 
int prescaleLS_
 counter More...
 

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)
 

Detailed Description

Definition at line 11 of file L1TGMTClient.h.

Constructor & Destructor Documentation

L1TGMTClient::L1TGMTClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 14 of file L1TGMTClient.cc.

15 {
16  parameters_=ps;
17  initialize();
18 }
void initialize()
Definition: L1TGMTClient.cc:25
edm::ParameterSet parameters_
Definition: L1TGMTClient.h:58
L1TGMTClient::~L1TGMTClient ( )
virtual

Destructor.

Definition at line 20 of file L1TGMTClient.cc.

20  {
21  LogInfo("TriggerDQM")<<"[TriggerDQM]: ending... ";
22 }

Member Function Documentation

void L1TGMTClient::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Fake Analyze.

Implements edm::EDAnalyzer.

Definition at line 113 of file L1TGMTClient.cc.

References align_tpl::process.

113  {
114  counterEvt_++;
115  if (prescaleEvt_<1) return;
116  if (prescaleEvt_>0 && counterEvt_%prescaleEvt_ != 0) return;
117  process();
118 }
int counterEvt_
counter
Definition: L1TGMTClient.h:64
int prescaleEvt_
units of lumi sections
Definition: L1TGMTClient.h:66
void L1TGMTClient::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 51 of file L1TGMTClient.cc.

51  {
52 
53  LogInfo("TriggerDQM")<<"[TriggerDQM]: Begin Job";
54 
55 }
void L1TGMTClient::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 97 of file L1TGMTClient.cc.

97  {
98  // optionally reset histograms here
99  // clientHisto->Reset();
100 }
void L1TGMTClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 58 of file L1TGMTClient.cc.

References dbe_, cmsCodeRules.cppFunctionSkipper::operator, and DQMStore::setCurrentFolder().

58  {
59 
60  // get backendinterface
62 
64 
65  // booking
66  eff_eta_dtcsc = bookClone1DVB("eff_eta_dtcsc","efficiency DTCSC vs eta","eta_DTCSC_and_RPC");
67  eff_eta_dtcsc->setAxisTitle("eta",1);
68  eff_eta_dtcsc->getTH1F()->Sumw2();
69 
70  eff_eta_rpc = bookClone1DVB("eff_eta_rpc","efficiency RPC vs eta","eta_DTCSC_and_RPC");
71  eff_eta_rpc->setAxisTitle("eta",1);
72  eff_eta_rpc->getTH1F()->Sumw2();
73 
74 
75  eff_phi_dtcsc = bookClone1D("eff_phi_dtcsc","efficiency DTCSC vs phi","phi_DTCSC_and_RPC");
76  eff_phi_dtcsc->setAxisTitle("phi (deg)",1);
77  eff_phi_dtcsc->getTH1F()->Sumw2();
78 
79  eff_phi_rpc = bookClone1D("eff_phi_rpc","efficiency RPC vs phi","phi_DTCSC_and_RPC");
80  eff_phi_rpc->setAxisTitle("phi (deg)",1);
81  eff_phi_rpc->getTH1F()->Sumw2();
82 
83 
84  eff_etaphi_dtcsc = bookClone2D("eff_etaphi_dtcsc","efficiency DTCSC vs eta and phi","etaphi_DTCSC_and_RPC");
86  eff_etaphi_dtcsc->setAxisTitle("phi (deg)",2);
87  eff_etaphi_dtcsc->getTH2F()->Sumw2();
88 
89  eff_etaphi_rpc = bookClone2D("eff_etaphi_rpc","efficiency RPC vs eta and phi","etaphi_DTCSC_and_RPC");
90  eff_etaphi_rpc->setAxisTitle("eta",1);
91  eff_etaphi_rpc->setAxisTitle("phi (deg)",2);
92  eff_etaphi_rpc->getTH2F()->Sumw2();
93 
94 }
MonitorElement * bookClone1D(std::string name, std::string title, std::string hrefName)
MonitorElement * eff_eta_rpc
Definition: L1TGMTClient.h:70
MonitorElement * eff_etaphi_dtcsc
Definition: L1TGMTClient.h:73
DQMStore * dbe_
Definition: L1TGMTClient.h:59
MonitorElement * bookClone1DVB(std::string name, std::string title, std::string hrefName)
MonitorElement * eff_etaphi_rpc
Definition: L1TGMTClient.h:74
MonitorElement * eff_phi_rpc
Definition: L1TGMTClient.h:72
MonitorElement * eff_eta_dtcsc
prescale on number of events
Definition: L1TGMTClient.h:69
MonitorElement * eff_phi_dtcsc
Definition: L1TGMTClient.h:71
TH1F * getTH1F(void) const
MonitorElement * bookClone2D(std::string name, std::string title, std::string hrefName)
std::string output_dir_
Definition: L1TGMTClient.h:62
TH2F * getTH2F(void) const
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
MonitorElement * L1TGMTClient::bookClone1D ( std::string  name,
std::string  title,
std::string  hrefName 
)
private

Definition at line 205 of file L1TGMTClient.cc.

References DQMStore::book1D(), dbe_, and NULL.

205  {
206  MonitorElement* me;
207 
208  TH1F* href = get1DHisto(input_dir_+"/"+hrefName,dbe_);
209  if(href) {
210  const unsigned nbx = href->GetNbinsX();
211  const double xmin = href->GetXaxis()->GetXmin();
212  const double xmax = href->GetXaxis()->GetXmax();
213  me = dbe_->book1D(name,title,nbx,xmin,xmax);
214  } else {
215  me = NULL;
216  }
217 
218  return me;
219 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
DQMStore * dbe_
Definition: L1TGMTClient.h:59
#define NULL
Definition: scimark2.h:8
std::string input_dir_
Definition: L1TGMTClient.h:61
TH1F * get1DHisto(std::string meName, DQMStore *dbi)
MonitorElement * L1TGMTClient::bookClone1DVB ( std::string  name,
std::string  title,
std::string  hrefName 
)
private

Definition at line 221 of file L1TGMTClient.cc.

References DQMStore::book1D(), dbe_, i, NULL, and fw3dlego::xbins.

221  {
222  MonitorElement* me;
223 
224  TH1F* href = get1DHisto(input_dir_+"/"+hrefName,dbe_);
225  if(href) {
226  int nbx = href->GetNbinsX();
227  if(nbx>99) nbx=99;
228  float xbins[100];
229  for(int i=0; i<nbx; i++) {
230  xbins[i]=href->GetBinLowEdge(i+1);
231  }
232  xbins[nbx]=href->GetXaxis()->GetXmax();
233  me = dbe_->book1D(name,title,nbx,xbins);
234  } else {
235  me = NULL;
236  }
237 
238  return me;
239 }
int i
Definition: DBlmapReader.cc:9
const double xbins[]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
DQMStore * dbe_
Definition: L1TGMTClient.h:59
#define NULL
Definition: scimark2.h:8
std::string input_dir_
Definition: L1TGMTClient.h:61
TH1F * get1DHisto(std::string meName, DQMStore *dbi)
MonitorElement * L1TGMTClient::bookClone2D ( std::string  name,
std::string  title,
std::string  hrefName 
)
private

Definition at line 241 of file L1TGMTClient.cc.

References DQMStore::book2D(), dbe_, and NULL.

241  {
242  MonitorElement* me;
243 
244  TH2F* href = get2DHisto(input_dir_+"/"+hrefName,dbe_);
245  if(href) {
246  const unsigned nbx = href->GetNbinsX();
247  const double xmin = href->GetXaxis()->GetXmin();
248  const double xmax = href->GetXaxis()->GetXmax();
249  const unsigned nby = href->GetNbinsY();
250  const double ymin = href->GetYaxis()->GetXmin();
251  const double ymax = href->GetYaxis()->GetXmax();
252  me = dbe_->book2D(name,title,nbx,xmin,xmax,nby,ymin,ymax);
253  } else {
254  me = NULL;
255  }
256 
257  return me;
258 }
DQMStore * dbe_
Definition: L1TGMTClient.h:59
#define NULL
Definition: scimark2.h:8
std::string input_dir_
Definition: L1TGMTClient.h:61
TH2F * get2DHisto(std::string meName, DQMStore *dbi)
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:647
void L1TGMTClient::endJob ( void  )
protectedvirtual

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 141 of file L1TGMTClient.cc.

141  {
142 }
void L1TGMTClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protectedvirtual

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 103 of file L1TGMTClient.cc.

References align_tpl::process.

104  {
105  counterLS_++;
106  if (prescaleLS_<1) return;
107  if (prescaleLS_>0 && counterLS_%prescaleLS_ != 0) return;
108 // cout << "L1TGMTClient::endLumi" << endl;
109 
110  process();
111 }
int prescaleLS_
counter
Definition: L1TGMTClient.h:65
void L1TGMTClient::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 136 of file L1TGMTClient.cc.

References align_tpl::process.

136  {
137  process();
138 }
TH1F * L1TGMTClient::get1DHisto ( std::string  meName,
DQMStore dbi 
)
private

Definition at line 184 of file L1TGMTClient.cc.

References DQMStore::get(), MonitorElement::getTH1F(), and NULL.

184  {
185  MonitorElement * me_ = dbi->get(meName);
186 
187  if (!me_) {
188  LogInfo("TriggerDQM") << "L1TGMT: " << meName << " NOT FOUND.";
189  return NULL;
190  }
191  return me_->getTH1F();
192 }
#define NULL
Definition: scimark2.h:8
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1270
TH1F * getTH1F(void) const
TH2F * L1TGMTClient::get2DHisto ( std::string  meName,
DQMStore dbi 
)
private

Definition at line 195 of file L1TGMTClient.cc.

References DQMStore::get(), MonitorElement::getTH2F(), and NULL.

195  {
196  MonitorElement * me_ = dbi->get(meName);
197 
198  if (!me_) {
199  LogInfo("TriggerDQM") << "L1TGMT: " << meName << " NOT FOUND.";
200  return NULL;
201  }
202  return me_->getTH2F();
203 }
#define NULL
Definition: scimark2.h:8
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1270
TH2F * getTH2F(void) const
void L1TGMTClient::initialize ( )
private

Definition at line 25 of file L1TGMTClient.cc.

References gather_cfg::cout, dbe_, and cmsCodeRules.cppFunctionSkipper::operator.

25  {
26 
27  counterLS_=0;
28  counterEvt_=0;
29 
30  // get back-end interface
32 
33  // base folder for the contents of this job
34  monitorName_ = parameters_.getUntrackedParameter<string>("monitorName","");
35  cout << "Monitor name = " << monitorName_ << endl;
36  prescaleLS_ = parameters_.getUntrackedParameter<int>("prescaleLS", -1);
37  cout << "DQM lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< endl;
38  prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt", -1);
39  cout << "DQM event prescale = " << prescaleEvt_ << " events(s)"<< endl;
40  output_dir_ = parameters_.getUntrackedParameter<string>("output_dir","");
41  cout << "DQM output dir = " << output_dir_ << endl;
42  input_dir_ = parameters_.getUntrackedParameter<string>("input_dir","");
43  cout << "DQM input dir = " << input_dir_ << endl;
44 
45  LogInfo( "TriggerDQM");
46 
47 
48 }
T getUntrackedParameter(std::string const &, T const &) const
std::string monitorName_
Definition: L1TGMTClient.h:60
DQMStore * dbe_
Definition: L1TGMTClient.h:59
std::string input_dir_
Definition: L1TGMTClient.h:61
int counterEvt_
counter
Definition: L1TGMTClient.h:64
std::string output_dir_
Definition: L1TGMTClient.h:62
tuple cout
Definition: gather_cfg.py:41
int prescaleLS_
counter
Definition: L1TGMTClient.h:65
edm::ParameterSet parameters_
Definition: L1TGMTClient.h:58
int prescaleEvt_
units of lumi sections
Definition: L1TGMTClient.h:66
void L1TGMTClient::makeEfficiency1D ( MonitorElement meeff,
std::string  heName,
std::string  hiName 
)
private

Definition at line 156 of file L1TGMTClient.cc.

References dbe_, and MonitorElement::getTH1F().

156  {
157  TH1F* he = get1DHisto(input_dir_+"/"+heName,dbe_);
158  TH1F* hi = get1DHisto(input_dir_+"/"+hiName,dbe_);
159  TH1F* heff = meeff->getTH1F();
160 
161  if(heff && he && hi) {
162  TH1F* hall = (TH1F*) he->Clone("hall");
163  hall->Add(hi);
164  heff->Divide(he,hall,1.,1.,"B");
165  delete hall;
166  }
167 }
DQMStore * dbe_
Definition: L1TGMTClient.h:59
std::string input_dir_
Definition: L1TGMTClient.h:61
TH1F * getTH1F(void) const
TH1F * get1DHisto(std::string meName, DQMStore *dbi)
void L1TGMTClient::makeEfficiency2D ( MonitorElement meeff,
std::string  heName,
std::string  hiName 
)
private

Definition at line 170 of file L1TGMTClient.cc.

References dbe_, and MonitorElement::getTH2F().

170  {
171  TH2F* he = get2DHisto(input_dir_+"/"+heName,dbe_);
172  TH2F* hi = get2DHisto(input_dir_+"/"+hiName,dbe_);
173  TH2F* heff = meeff->getTH2F();
174 
175  if(heff && he && hi) {
176  TH2F* hall = (TH2F*) he->Clone("hall");
177  hall->Add(hi);
178  heff->Divide(he,hall,1.,1.,"B");
179  delete hall;
180  }
181 }
DQMStore * dbe_
Definition: L1TGMTClient.h:59
std::string input_dir_
Definition: L1TGMTClient.h:61
TH2F * get2DHisto(std::string meName, DQMStore *dbi)
TH2F * getTH2F(void) const
void L1TGMTClient::makeRatio1D ( MonitorElement mer,
std::string  h1Name,
std::string  h2Name 
)
private

Definition at line 145 of file L1TGMTClient.cc.

References dbe_, and MonitorElement::getTH1F().

145  {
146  TH1F* h1 = get1DHisto(input_dir_+"/"+h1Name,dbe_);
147  TH1F* h2 = get1DHisto(input_dir_+"/"+h2Name,dbe_);
148  TH1F* hr = mer->getTH1F();
149 
150  if(hr && h1 && h2) {
151  hr->Divide(h1,h2,1.,1.," ");
152  }
153 }
DQMStore * dbe_
Definition: L1TGMTClient.h:59
std::string input_dir_
Definition: L1TGMTClient.h:61
TH1F * getTH1F(void) const
TH1F * get1DHisto(std::string meName, DQMStore *dbi)
void L1TGMTClient::process ( )
private

Definition at line 121 of file L1TGMTClient.cc.

Referenced by python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::dumpPython(), python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::open(), python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::outputEventContent(), python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProcess(), and python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProperty().

121  {
122 
123 // cout << "L1TGMTClient: processing..." << endl;
124 
125  makeEfficiency1D(eff_eta_dtcsc,"eta_DTCSC_and_RPC","eta_RPC_only");
126  makeEfficiency1D(eff_eta_rpc ,"eta_DTCSC_and_RPC","eta_DTCSC_only");
127 
128  makeEfficiency1D(eff_phi_dtcsc,"phi_DTCSC_and_RPC","phi_RPC_only");
129  makeEfficiency1D(eff_phi_rpc ,"phi_DTCSC_and_RPC","phi_DTCSC_only");
130 
131  makeEfficiency2D(eff_etaphi_dtcsc,"etaphi_DTCSC_and_RPC","etaphi_RPC_only");
132  makeEfficiency2D(eff_etaphi_rpc ,"etaphi_DTCSC_and_RPC","etaphi_DTCSC_only");
133 
134 }
MonitorElement * eff_eta_rpc
Definition: L1TGMTClient.h:70
MonitorElement * eff_etaphi_dtcsc
Definition: L1TGMTClient.h:73
MonitorElement * eff_etaphi_rpc
Definition: L1TGMTClient.h:74
MonitorElement * eff_phi_rpc
Definition: L1TGMTClient.h:72
MonitorElement * eff_eta_dtcsc
prescale on number of events
Definition: L1TGMTClient.h:69
MonitorElement * eff_phi_dtcsc
Definition: L1TGMTClient.h:71
void makeEfficiency1D(MonitorElement *meeff, std::string heName, std::string hiName)
void makeEfficiency2D(MonitorElement *meeff, std::string heName, std::string hiName)

Member Data Documentation

int L1TGMTClient::counterEvt_
private

counter

Definition at line 64 of file L1TGMTClient.h.

int L1TGMTClient::counterLS_
private

Definition at line 63 of file L1TGMTClient.h.

DQMStore* L1TGMTClient::dbe_
private

Definition at line 59 of file L1TGMTClient.h.

MonitorElement* L1TGMTClient::eff_eta_dtcsc
private

prescale on number of events

Definition at line 69 of file L1TGMTClient.h.

MonitorElement* L1TGMTClient::eff_eta_rpc
private

Definition at line 70 of file L1TGMTClient.h.

MonitorElement* L1TGMTClient::eff_etaphi_dtcsc
private

Definition at line 73 of file L1TGMTClient.h.

MonitorElement* L1TGMTClient::eff_etaphi_rpc
private

Definition at line 74 of file L1TGMTClient.h.

MonitorElement* L1TGMTClient::eff_phi_dtcsc
private

Definition at line 71 of file L1TGMTClient.h.

MonitorElement* L1TGMTClient::eff_phi_rpc
private

Definition at line 72 of file L1TGMTClient.h.

std::string L1TGMTClient::input_dir_
private

Definition at line 61 of file L1TGMTClient.h.

std::string L1TGMTClient::monitorName_
private

Definition at line 60 of file L1TGMTClient.h.

std::string L1TGMTClient::output_dir_
private

Definition at line 62 of file L1TGMTClient.h.

edm::ParameterSet L1TGMTClient::parameters_
private
int L1TGMTClient::prescaleEvt_
private

units of lumi sections

Definition at line 66 of file L1TGMTClient.h.

int L1TGMTClient::prescaleLS_
private

counter

Definition at line 65 of file L1TGMTClient.h.