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
HLTMonPhotonClient Class Reference

#include <HLTMonPhotonClient.h>

Inheritance diagram for HLTMonPhotonClient:
edm::EDAnalyzer

Public Member Functions

 HLTMonPhotonClient (const edm::ParameterSet &)
 
 ~HLTMonPhotonClient ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 

Private Attributes

MonitorElementcumFilterEff
 
DQMStoredbe
 
std::string dirname_
 
MonitorElementeventCounter
 
ofstream logFile_
 
bool monitorDaemon_
 
std::string outputFile_
 
MonitorElementpixelhistosEt [4]
 
MonitorElementpixelhistosEta [4]
 
MonitorElementpixelhistosEtaOut [4]
 
MonitorElementpixelhistosEtOut [4]
 
MonitorElementpixelhistosPhi [4]
 
MonitorElementpixelhistosPhiOut [4]
 
MonitorElementrelFilterEff
 
std::string sourcedirname_
 
edm::InputTag sourcetag_
 
std::vector< edm::InputTagtheHLTCollectionLabels
 

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 30 of file HLTMonPhotonClient.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file HLTMonPhotonClient.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LogDebug, NULL, and cmsCodeRules.cppFunctionSkipper::operator.

15 {
16 
17  LogDebug("HLTMonPhotonClient") << "constructor...." ;
18 
19  logFile_.open("HLTMonPhotonClient.log");
20 
21  dbe = NULL;
22  if (iConfig.getUntrackedParameter < bool > ("DQMStore", false)) {
24  dbe->setVerbose(0);
25  }
26 
27  outputFile_ =
28  iConfig.getUntrackedParameter <std::string>("outputFile", "");
29  if (outputFile_.size() != 0) {
30  LogInfo("HLTMonPhotonClient") << "Photon Trigger Monitoring histograms will be saved to "
31  << outputFile_ ;
32  }
33  else {
34  outputFile_ = "PhotonDQM.root";
35  }
36 
37  bool disable =
38  iConfig.getUntrackedParameter < bool > ("disableROOToutput", false);
39  if (disable) {
40  outputFile_ = "";
41  }
42 
43  sourcetag_=iConfig.getParameter<edm::InputTag>("SourceTag");
44 
45  theHLTCollectionLabels = iConfig.getParameter<std::vector<edm::InputTag> >("theHLTCollectionLabels");
46 
47  dirname_="HLT/HLTMonPhoton/"+iConfig.getParameter<std::string>("@module_label");
48  sourcedirname_="HLT/HLTMonPhoton/"+sourcetag_.label();
49 
50  if (dbe != NULL) {
51  dbe->setCurrentFolder(dirname_);
52  }
53 
54 }
#define LogDebug(id)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
#define NULL
Definition: scimark2.h:8
std::vector< edm::InputTag > theHLTCollectionLabels
void setVerbose(unsigned level)
Definition: DQMStore.cc:196
std::string sourcedirname_
std::string const & label() const
Definition: InputTag.h:25
edm::InputTag sourcetag_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
HLTMonPhotonClient::~HLTMonPhotonClient ( )

Definition at line 57 of file HLTMonPhotonClient.cc.

58 {
59 
60  // do anything here that needs to be done at desctruction time
61  // (e.g. close files, deallocate resources etc.)
62 
63 }

Member Function Documentation

void HLTMonPhotonClient::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 72 of file HLTMonPhotonClient.cc.

References i, and j.

73 {
74  TH1F* refhisto = eventCounter->getTH1F();
75  if(refhisto->GetBinContent(1) != 0){
76  // relFilterEff->setBinContent(6,refhisto->GetBinContent(5)/refhisto->GetBinContent(2));
77  // cumFilterEff->setBinContent(5,refhisto->GetBinContent(5)/refhisto->GetBinContent(1));
78  cumFilterEff->setBinContent(4,refhisto->GetBinContent(4)/refhisto->GetBinContent(1));
79  cumFilterEff->setBinContent(3,refhisto->GetBinContent(3)/refhisto->GetBinContent(1));
80  cumFilterEff->setBinContent(2,refhisto->GetBinContent(2)/refhisto->GetBinContent(1));
81  }else{
87  }
88  for(int i = 0; i<4; i++){
89  if(refhisto->GetBinContent(4-i) != 0){
90  relFilterEff->setBinContent(5-i,refhisto->GetBinContent(5-i)/refhisto->GetBinContent(4-i));
91  }else{
93  }
94  }
95  if(refhisto->GetBinContent(1) != 0){
96  relFilterEff->setBinContent(1,refhisto->GetBinContent(1)/refhisto->GetBinContent(1));
97  cumFilterEff->setBinContent(2,refhisto->GetBinContent(2)/refhisto->GetBinContent(1));
98  cumFilterEff->setBinContent(1,refhisto->GetBinContent(1)/refhisto->GetBinContent(1));
99  }else{
103  }
104 
105  TH1F* num;
106  TH1F* denom;
107 
108  for(int i=0; i<3; i++){
109  denom = pixelhistosEt[0]->getTH1F();
110  num = pixelhistosEt[i+1]->getTH1F();
111  for(int j=1; j <= pixelhistosEtOut[i]->getNbinsX();j++ ){
112  if(denom->GetBinContent(j)!=0){
113  pixelhistosEtOut[i]->setBinContent(j,num->GetBinContent(j)/denom->GetBinContent(j));
114  }
115  else{
117  }
118  }
119  denom = pixelhistosEta[0]->getTH1F();
120  num = pixelhistosEta[i+1]->getTH1F();
121  for(int j=1; j <= pixelhistosEtaOut[i]->getNbinsX();j++ ){
122  if(denom->GetBinContent(j)!=0)
123  pixelhistosEtaOut[i]->setBinContent(j,num->GetBinContent(j)/denom->GetBinContent(j));
124  else
126  }
127  denom = pixelhistosPhi[0]->getTH1F();
128  num = pixelhistosPhi[i+1]->getTH1F();
129  for(int j=1; j <= pixelhistosPhiOut[i]->getNbinsX();j++ ){
130  if(denom->GetBinContent(j)!=0)
131  pixelhistosPhiOut[i]->setBinContent(j,num->GetBinContent(j)/denom->GetBinContent(j));
132  else
134  }
135  }
136 
137  denom = pixelhistosEt[0]->getTH1F();
138  num = pixelhistosEt[3]->getTH1F();
139  for(int j=1; j <= pixelhistosEtOut[3]->getNbinsX();j++ ){
140  if(denom->GetBinContent(j)!=0){
141  pixelhistosEtOut[3]->setBinContent(j,num->GetBinContent(j)/denom->GetBinContent(j));
142  }
143  else{
145  }
146  }
147 
148  denom = pixelhistosEta[0]->getTH1F();
149  num = pixelhistosEta[3]->getTH1F();
150  for(int j=1; j <= pixelhistosEtaOut[3]->getNbinsX();j++ ){
151  if(denom->GetBinContent(j)!=0){
152  pixelhistosEtaOut[3]->setBinContent(j,num->GetBinContent(j)/denom->GetBinContent(j));
153  }
154  else{
156  }
157  }
158 
159  denom = pixelhistosPhi[0]->getTH1F();
160  num = pixelhistosPhi[3]->getTH1F();
161  for(int j=1; j <= pixelhistosPhiOut[3]->getNbinsX();j++ ){
162  if(denom->GetBinContent(j)!=0){
163  pixelhistosPhiOut[3]->setBinContent(j,num->GetBinContent(j)/denom->GetBinContent(j));
164  }
165  else{
167  }
168  }
169 
170 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * cumFilterEff
MonitorElement * pixelhistosPhiOut[4]
int j
Definition: DBlmapReader.cc:9
MonitorElement * pixelhistosEta[4]
MonitorElement * pixelhistosEtOut[4]
MonitorElement * pixelhistosEtaOut[4]
MonitorElement * eventCounter
TH1F * getTH1F(void) const
long long int num
Definition: procUtils.cc:71
int getNbinsX(void) const
get # of bins in X-axis
MonitorElement * relFilterEff
MonitorElement * pixelhistosEt[4]
MonitorElement * pixelhistosPhi[4]
void HLTMonPhotonClient::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 175 of file HLTMonPhotonClient.cc.

References DQMStore::book1D(), DQMStore::get(), MonitorElement::getTH1F(), i, cmsCodeRules.cppFunctionSkipper::operator, DQMStore::rmdir(), MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

176 {
177 
178  DQMStore *dbe = 0;
179  dbe = Service < DQMStore > ().operator->();
180 
181  if (dbe) {
183  dbe->rmdir(dirname_);
184  }
185 
186  if (dbe) {
188 
189  std::string tmpname = "";
190 
191  for(int i = 0; i<4; i++){
192  LogInfo("HLTMonPhotonClient") << "loop iteration: "<<i ;
193  tmpname = sourcedirname_ + "/" + theHLTCollectionLabels[i].label() + " Eta Dist";
194  pixelhistosEta[i]=dbe->get(tmpname);
195  tmpname = sourcedirname_ + "/" + theHLTCollectionLabels[i].label() + " Et Dist";
196  pixelhistosEt[i]=dbe->get(tmpname);
197  tmpname = sourcedirname_ + "/" + theHLTCollectionLabels[i].label() + " Phi Dist";
198  pixelhistosPhi[i]=dbe->get(tmpname);
199  }
200 
201  TH1F* refhist;
202  int nBins;
203  double xMin;
204  double xMax;
205 
206  refhist = pixelhistosEt[0]->getTH1F();
207  nBins = refhist->GetNbinsX();
208  xMin = refhist->GetXaxis()->GetXmin();
209  xMax = refhist->GetXaxis()->GetXmax();
210  pixelhistosEtOut[0] =dbe->book1D("EcalIsol Eff vs Et","EcalIsol Eff vs Et",nBins,xMin,xMax);
211  pixelhistosEtOut[1] =dbe->book1D("HcalIsol Eff vs Et","HcalIsol Eff vs Et",nBins,xMin,xMax);
212  pixelhistosEtOut[2] =dbe->book1D("Track Isol Eff vs Et","Track Isol Eff vs Et",nBins,xMin,xMax);
213  pixelhistosEtOut[3] =dbe->book1D("Total Eff vs Et","Total Eff vs Et",nBins,xMin,xMax);
214 
215  refhist = pixelhistosEta[0]->getTH1F();
216  nBins = refhist->GetNbinsX();
217  xMin = refhist->GetXaxis()->GetXmin();
218  xMax = refhist->GetXaxis()->GetXmax();
219  pixelhistosEtaOut[0] =dbe->book1D("EcalIsol Eff vs Eta","EcalIsol Eff vs Eta",nBins,xMin,xMax);
220  pixelhistosEtaOut[1] =dbe->book1D("HcalIsol Eff vs Eta","HcalIsol Eff vs Eta",nBins,xMin,xMax);
221  pixelhistosEtaOut[2] =dbe->book1D("Track Isol Eff vs Eta","Track Isol Eff vs Eta",nBins,xMin,xMax);
222  pixelhistosEtaOut[3] =dbe->book1D("Total Eff vs Eta","Total Eff vs Eta",nBins,xMin,xMax);
223 
224  refhist = pixelhistosPhi[0]->getTH1F();
225  nBins = refhist->GetNbinsX();
226  xMin = refhist->GetXaxis()->GetXmin();
227  xMax = refhist->GetXaxis()->GetXmax();
228  pixelhistosPhiOut[0] =dbe->book1D("EcalIsol Eff vs Phi","EcalIsol Eff vs Phi",nBins,xMin,xMax);
229  pixelhistosPhiOut[1] =dbe->book1D("HcalIsol Eff vs Phi","HcalIsol Eff vs Phi",nBins,xMin,xMax);
230  pixelhistosPhiOut[2] =dbe->book1D("Track Isol Eff vs Phi","Track Isol Eff vs Phi",nBins,xMin,xMax);
231  pixelhistosPhiOut[3] =dbe->book1D("Total Eff vs Phi","Total Eff vs Phi",nBins,xMin,xMax);
232 
233  tmpname = sourcedirname_ + "/Evts Passing Filters";
234  eventCounter = dbe->get(tmpname);
235 
236  relFilterEff = dbe->book1D("Relative Filter Effs","Relative Filter Effs",5,0,5);
237  relFilterEff->setBinLabel(1,"HLTIsoEtFilterEff");
238  relFilterEff->setBinLabel(2,"HLTIsoEcalIsolEff");
239  relFilterEff->setBinLabel(3,"HLTIsoHcalIsolEff");
240  relFilterEff->setBinLabel(4,"HLTIsoTrackIsolEff");
241  // relFilterEff->setBinLabel(5,"FIXME");
242  // relFilterEff->setBinLabel(6,"FIXME");
243 
244  cumFilterEff = dbe->book1D("Cumulative Filter Effs","Cumulative Filter Effs",5,0,5);
245  cumFilterEff->setBinLabel(1,"HLTIsoEtFilterEff");
246  cumFilterEff->setBinLabel(2,"HLTIsoEcalIsolEff");
247  cumFilterEff->setBinLabel(3,"HLTIsoHcalIsolEff");
248  cumFilterEff->setBinLabel(4,"HLTIsoTrackIsolEff");
249  // cumFilterEff->setBinLabel(5,"TrackIsolEff");
250 
251  } // end "if(dbe)"
252 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * cumFilterEff
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2311
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
std::vector< edm::InputTag > theHLTCollectionLabels
MonitorElement * pixelhistosPhiOut[4]
MonitorElement * pixelhistosEta[4]
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1265
MonitorElement * pixelhistosEtOut[4]
MonitorElement * pixelhistosEtaOut[4]
std::string sourcedirname_
MonitorElement * eventCounter
TH1F * getTH1F(void) const
MonitorElement * relFilterEff
MonitorElement * pixelhistosEt[4]
MonitorElement * pixelhistosPhi[4]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
void HLTMonPhotonClient::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 256 of file HLTMonPhotonClient.cc.

256  {
257 
258 // std::cout << "HLTMonPhotonClient: end job...." << std::endl;
259 
260  if (outputFile_.size() != 0 && dbe)
261  dbe->save(outputFile_);
262 
263  return;
264 }
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:1898

Member Data Documentation

MonitorElement* HLTMonPhotonClient::cumFilterEff
private

Definition at line 55 of file HLTMonPhotonClient.h.

DQMStore* HLTMonPhotonClient::dbe
private

Definition at line 43 of file HLTMonPhotonClient.h.

std::string HLTMonPhotonClient::dirname_
private

Definition at line 57 of file HLTMonPhotonClient.h.

MonitorElement* HLTMonPhotonClient::eventCounter
private

Definition at line 53 of file HLTMonPhotonClient.h.

ofstream HLTMonPhotonClient::logFile_
private

Definition at line 60 of file HLTMonPhotonClient.h.

bool HLTMonPhotonClient::monitorDaemon_
private

Definition at line 59 of file HLTMonPhotonClient.h.

std::string HLTMonPhotonClient::outputFile_
private

Definition at line 61 of file HLTMonPhotonClient.h.

MonitorElement* HLTMonPhotonClient::pixelhistosEt[4]
private

Definition at line 47 of file HLTMonPhotonClient.h.

MonitorElement* HLTMonPhotonClient::pixelhistosEta[4]
private

Definition at line 48 of file HLTMonPhotonClient.h.

MonitorElement* HLTMonPhotonClient::pixelhistosEtaOut[4]
private

Definition at line 51 of file HLTMonPhotonClient.h.

MonitorElement* HLTMonPhotonClient::pixelhistosEtOut[4]
private

Definition at line 50 of file HLTMonPhotonClient.h.

MonitorElement* HLTMonPhotonClient::pixelhistosPhi[4]
private

Definition at line 49 of file HLTMonPhotonClient.h.

MonitorElement* HLTMonPhotonClient::pixelhistosPhiOut[4]
private

Definition at line 52 of file HLTMonPhotonClient.h.

MonitorElement* HLTMonPhotonClient::relFilterEff
private

Definition at line 54 of file HLTMonPhotonClient.h.

std::string HLTMonPhotonClient::sourcedirname_
private

Definition at line 58 of file HLTMonPhotonClient.h.

edm::InputTag HLTMonPhotonClient::sourcetag_
private

Definition at line 45 of file HLTMonPhotonClient.h.

std::vector<edm::InputTag> HLTMonPhotonClient::theHLTCollectionLabels
private

Definition at line 62 of file HLTMonPhotonClient.h.