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
HLTOverallSummary Class Reference
Inheritance diagram for HLTOverallSummary:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
 HLTOverallSummary (const edm::ParameterSet &pset)
 
 ~HLTOverallSummary ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

DQMStoredbe_
 
edm::ParameterSet parameters_
 
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)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 60 of file HLTOverallSummary.cc.

Constructor & Destructor Documentation

HLTOverallSummary::HLTOverallSummary ( const edm::ParameterSet pset)
explicit

Definition at line 87 of file HLTOverallSummary.cc.

References dbe_, edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, and DQMStore::setVerbose().

89 {
90 
91  using namespace edm;
92  dbe_ = 0;
94  if (!dbe_) {
95  LogInfo ("HLTMuonVal") << "Can't find DQMStore, no results will be saved"
96  << endl;
97  } else {
98  dbe_->setVerbose(0);
99  }
100 
101  parameters_ = pset;
102  verbose_ = parameters_.getUntrackedParameter<bool>("verbose", false);
103 
104  if(verbose_) LogInfo ("HLTMuonVal") << ">>> Constructor (HLTOverallSummary) <<<" << endl;
105 
106 }
T getUntrackedParameter(std::string const &, T const &) const
void setVerbose(unsigned level)
Definition: DQMStore.cc:393
edm::ParameterSet parameters_
HLTOverallSummary::~HLTOverallSummary ( )

Definition at line 109 of file HLTOverallSummary.cc.

110 {
111 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 120 of file HLTOverallSummary.cc.

121 {
122  using namespace edm;
123 
124  if(verbose_) LogInfo ("HLTMuonVal") << ">>> Analyze (HLTOverallSummary) <<<" << std::endl;
125 
126 }
void HLTOverallSummary::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 130 of file HLTOverallSummary.cc.

131 {
132 }
void HLTOverallSummary::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 142 of file HLTOverallSummary.cc.

References edm::RunBase::id().

143 {
144 
145  using namespace edm;
146  if(verbose_) LogInfo ("HLTMuonVal") << ">>> BeginRun (HLTOverallSummary) <<<" << std::endl;
147  if(verbose_) LogInfo ("HLTMuonVal") << ">>> "<< run.id() << std::endl;
148 
149 }
RunID const & id() const
Definition: RunBase.h:41
void HLTOverallSummary::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 136 of file HLTOverallSummary.cc.

137 {
138 }
void HLTOverallSummary::endRun ( const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 153 of file HLTOverallSummary.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), DQMStore::bookInt(), dbe_, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getTH2F(), and DQMStore::setCurrentFolder().

154 {
155 
156  using namespace edm;
157  if(verbose_) LogInfo ("HLTMuonVal") << ">>> EndRun (HLTOverallSummary) <<<" << std::endl;
158 
159  if(!dbe_) {
160  LogInfo ("HLTMuonVal") << "No dqmstore... skipping processing step" << endl;
161  return;
162  }
163 
164  std::vector<string> histoNameVector;
165 
166 
167  //booking histograms according to naming conventions
168 
169  float defaultValueIfNotFound = 1.0;
170 
171  dbe_->setCurrentFolder("HLT/EventInfo/reportSummaryContent");
172 
173 
174  //============ Unpack information ==========
175 
176 
177  MonitorElement* muonQualityBit = 0;
178  muonQualityBit = dbe_->get("HLT_Muon");
179 
180  if (!muonQualityBit) {
181  LogInfo ("HLTMuonVal") << "Can't find muonQuality bit... making a bit, setting it to zero" << endl;
182 
183  muonQualityBit = dbe_->bookFloat("HLT_Muon");
184  muonQualityBit->Fill(defaultValueIfNotFound);
185 
186  }
187 
188  MonitorElement* eleQualityBit = 0;
189  eleQualityBit = dbe_->get("HLT_Electron");
190 
191  if (!eleQualityBit) {
192  LogInfo ("HLTMuonVal") << "Can't find eleQuality bit... making a bit, setting it to zero" << endl;
193 
194  eleQualityBit = dbe_->bookFloat("HLT_Electron");
195  eleQualityBit->Fill(defaultValueIfNotFound);
196  }
197 
198  MonitorElement* photonQualityBit = 0;
199  photonQualityBit = dbe_->get("HLT_Photon");
200 
201  if (!photonQualityBit) {
202  LogInfo ("HLTMuonVal") << "Can't find photonQuality bit... making a bit, setting it to zero" << endl;
203 
204  photonQualityBit = dbe_->bookFloat("HLT_Photon");
205  photonQualityBit->Fill(defaultValueIfNotFound);
206  }
207 
208 
209  //============ Book new storage locations =============
210 
211  dbe_->setCurrentFolder("HLT/EventInfo");
212  MonitorElement* hltQualityBit = dbe_->bookFloat("reportSummary");
213 
214  MonitorElement* hltQualitySummaryWord = dbe_->bookInt ("HLT_SUMMARY_WORD");
215 
216  //for now these will hold values from eta/phi tests for spikes/holes
217  MonitorElement* reportSummaryMap = dbe_->book2D("reportSummaryMap","HLT: ReportSummaryMap",3,-0.5,2.5,1,-0.5,0.5);
218  MonitorElement* CertificationSummaryMap = dbe_->book2D("certificationSummaryMap","HLT: CertificationSummaryMap",3,-0.5,2.5,1,-0.5,0.5);
219 
220  TH2 * reportSummaryMapTH2 = reportSummaryMap->getTH2F();
221 
222  reportSummaryMapTH2->GetXaxis()->SetBinLabel(1,"Muon");
223  reportSummaryMapTH2->GetXaxis()->SetBinLabel(2,"Electron");
224  reportSummaryMapTH2->GetXaxis()->SetBinLabel(3,"Photon");
225 
226  reportSummaryMapTH2->GetYaxis()->SetBinLabel(1,"Quality");
227 
228 
229  TH2 * CertificationSummaryMapTH2 = CertificationSummaryMap->getTH2F();
230 
231  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(1,"Muon");
232  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(2,"Electron");
233  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(3,"Photon");
234  CertificationSummaryMapTH2->GetYaxis()->SetBinLabel(1,"Quality");
235 
236 
237 
238  //=================== Interpret bits and store result
239 
240  float photonValue = photonQualityBit->getFloatValue();
241 
242  float electronValue = eleQualityBit->getFloatValue();
243 
244  float muonValue = muonQualityBit->getFloatValue();
245 
246  float hltOverallValue = 1.0;
247 
248  if ( (photonValue > 0.99)
249  && (electronValue > 0.99)
250  && (muonValue > 0.99) ) {
251 
252  hltOverallValue = 1.0;
253 
254  } else {
255 
256  hltOverallValue = 0.0;
257 
258  }
259 
260  hltQualityBit->Fill(hltOverallValue);
261 
262  unsigned int hltSummaryValue = 0x0; //
263 
264  unsigned int ELECTRON_MASK = 0x1;
265  unsigned int PHOTON_MASK = 0x2;
266  unsigned int MUON_MASK = 0x4;
267 
268  if (electronValue > 0.99) hltSummaryValue = hltSummaryValue | ELECTRON_MASK;
269  if (photonValue > 0.99) hltSummaryValue = hltSummaryValue | PHOTON_MASK;
270  if (muonValue > 0.99) hltSummaryValue = hltSummaryValue | MUON_MASK;
271 
272  hltQualitySummaryWord->Fill(hltSummaryValue);
273 
274  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(1,1), muonValue);
275  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(2,1), electronValue);
276  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(3,1), photonValue);
277 
278  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(1,1), muonValue);
279  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(2,1), electronValue);
280  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(3,1), photonValue);
281 
282 
283 
284 
285 
286 
287 
288 
289 
290 
291 }
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
void Fill(long long x)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
TH2F * getTH2F(void) const
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:624
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:845
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429

Member Data Documentation

DQMStore* HLTOverallSummary::dbe_
private

Definition at line 77 of file HLTOverallSummary.cc.

edm::ParameterSet HLTOverallSummary::parameters_
private
bool HLTOverallSummary::verbose_
private

Definition at line 80 of file HLTOverallSummary.cc.