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
HLTMuonCertSummary Class Reference
Inheritance diagram for HLTMuonCertSummary:
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 &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
 HLTMuonCertSummary (const edm::ParameterSet &pset)
 
 ~HLTMuonCertSummary ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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 60 of file HLTMuonCertSummary.cc.

Constructor & Destructor Documentation

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

Definition at line 87 of file HLTMuonCertSummary.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 ("DQMGenericClient") << "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 (HLTMuonCertSummary) <<<" << endl;
105 
106 }
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet parameters_
void setVerbose(unsigned level)
Definition: DQMStore.cc:398
HLTMuonCertSummary::~HLTMuonCertSummary ( )

Definition at line 109 of file HLTMuonCertSummary.cc.

110 {
111 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 120 of file HLTMuonCertSummary.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 130 of file HLTMuonCertSummary.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 142 of file HLTMuonCertSummary.cc.

References edm::RunBase::id().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 136 of file HLTMuonCertSummary.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 153 of file HLTMuonCertSummary.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), dbe_, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getName(), MonitorElement::getQReports(), MonitorElement::getTH2F(), i, DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

154 {
155 
156  using namespace edm;
157  if(verbose_) LogInfo ("HLTMuonVal") << ">>> EndRun (HLTMuonCertSummary) <<<" << std::endl;
158 
159  if(!dbe_) {
160  LogInfo ("DQMGenericClient") << "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 
170 
171  dbe_->setCurrentFolder("HLT/EventInfo/muonQuality");
172 
173  MonitorElement* reportSummary = dbe_->bookFloat("HLT_MUON_REPORT_SUMMARY");
174 
175  int SummaryBitResult = 100;
176 
177  MonitorElement* CertificationSummary = dbe_->bookFloat("HLT_MUON_CERTIFICATION_SUMMARY");
178 
179 
180 
181  //for now these will hold values from eta/phi tests for spikes/holes
182  MonitorElement* reportSummaryMap = dbe_->book2D("HLT_MUON_ReportSummaryMap","HLT_MUON: ReportSummaryMap",6,-0.5,5.5,1,-0.5,0.5);
183  MonitorElement* CertificationSummaryMap = dbe_->book2D("HLT_MUON_CertificationSummaryMap","HLT_MUON: CertificationSummaryMap",6,-0.5,5.5,1,-0.5,0.5);
184 
185  TH2 * reportSummaryMapTH2 = reportSummaryMap->getTH2F();
186 
187  reportSummaryMapTH2->GetXaxis()->SetBinLabel(1,"PhiEtaOccAll");
188  reportSummaryMapTH2->GetXaxis()->SetBinLabel(2,"PhiEtaOccMatch");
189  reportSummaryMapTH2->GetXaxis()->SetBinLabel(3,"PhiEtaEff");
190  reportSummaryMapTH2->GetXaxis()->SetBinLabel(4,"PhiEff");
191  reportSummaryMapTH2->GetXaxis()->SetBinLabel(5,"EtaEff");
192  reportSummaryMapTH2->GetXaxis()->SetBinLabel(6,"PtEff");
193 
194  reportSummaryMapTH2->GetYaxis()->SetBinLabel(1,"HLT_Mu5_allMuons");
195 
196 
197  TH2 * CertificationSummaryMapTH2 = CertificationSummaryMap->getTH2F();
198 
199  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(1,"PhiEtaOccAll");
200  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(2,"PhiEtaOccMatch");
201  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(3,"PhiEtaEff");
202  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(4,"PhiEff");
203  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(5,"EtaEff");
204  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(6,"PtEff");
205 
206  CertificationSummaryMapTH2->GetYaxis()->SetBinLabel(1,"HLT_Mu5_allMuons");
207 
208 
209  histoNameVector.push_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recPhiVsRecEta_All");
210  histoNameVector.push_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recPhiVsRecEta_L3Filtered");
211  histoNameVector.push_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffPhiVsEta_L3Filtered");
212  histoNameVector.push_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffPt_L3Filtered");
213  histoNameVector.push_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffPhi_L3Filtered");
214  histoNameVector.push_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffEta_L3Filtered");
215 
216  // to do: what do we want in certification contents?
217  // dbe_->setCurrentFolder("Egamma/EventInfo/CertificationContents/");
218 
219 
220  // //looping over histograms to be tested
221  if(verbose_) LogInfo ("HLTMuonVal") << "\n>>> looping over histograms to be tested <<<\n\n";
222 
223  for(std::vector<string>::iterator it=histoNameVector.begin();it!=histoNameVector.end();++it){
224 
225  string HistoName = (*it);
226  if(verbose_) LogInfo ("HLTMuonVal") << ">>> " << HistoName;
227 
228 
229  MonitorElement * TestHist=0;
230 
231  TestHist = dbe_->get(HistoName);
232 
233  bool validMe = TestHist!=0;
234  if(verbose_) LogInfo ("HLTMuonVal") << " is valid? " << validMe << "\n";
235  if(!validMe) continue;
236 
237  string histNameNoPath = TestHist->getName();
238 
239  if(verbose_) LogInfo ("HLTMuonVal") << ">>> TestHist Name: " << histNameNoPath << "\n\n";
240 
241 
242 
243  //get QReports associated to each ME
244  std::vector<QReport *> myQReports = TestHist->getQReports();
245  if(verbose_) LogInfo ("HLTMuonVal") << TestHist->getName() <<": myQReports.size() = " << myQReports.size() << "\n\n";
246  for(uint i=0;i!=myQReports.size();++i) {
247 
248  std::string qtname = myQReports[i]->getQRName() ; // get QT name
249  float qtresult = myQReports[i]->getQTresult(); // get QT result value
250  int qtstatus = myQReports[i]->getStatus() ; // get QT status value
251 
252  if(verbose_) LogInfo ("HLTMuonVal") << "\tTest " << i << ": qtname: " << qtname << "\n";
253  if(verbose_) LogInfo ("HLTMuonVal") << "\tTest " << i << ": qtresult: " << qtresult << std::endl;
254  if(verbose_) LogInfo ("HLTMuonVal") << "\tTest " << i << ": qtstatus: " << qtstatus << "\n\n";
255 
256 
257  //book and fill float for each test done
258  dbe_->setCurrentFolder("HLT/EventInfo/muonQuality/");
259  MonitorElement * qValueInt = dbe_->bookFloat(histNameNoPath+"_HLT_Mu5_"+qtname);
260  qValueInt->Fill(qtstatus);
261 
262  // We're assuming that you want all of the bits to go into the decision
263 
264 
265  if (HistoName.find("recPhiVsRecEta_All") != std::string::npos) {
266  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(1,1), qtstatus);
267  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(1,1), qtstatus );
268  if ( (qtstatus == 200) && (SummaryBitResult < 300)) SummaryBitResult = 200;
269  if ( (qtstatus == 300) ) SummaryBitResult = 300;
270 
271  }
272 
273  if (HistoName.find("recPhiVsRecEta_L3Filtered") != std::string::npos) {
274  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(2,1), qtstatus);
275  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(2,1), qtstatus);
276  if ( (qtstatus == 200) && (SummaryBitResult < 300)) SummaryBitResult = 200;
277  if (qtstatus == 300 ) SummaryBitResult = 300;
278 
279  }
280 
281  if (HistoName.find("recEffPhiVsEta_L3Filtered") != std::string::npos) {
282  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(3,1), qtstatus );
283  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(3,1), qtstatus);
284  if ( (qtstatus == 200) && (SummaryBitResult < 300)) SummaryBitResult = 200;
285  if (qtstatus == 300 ) SummaryBitResult = 300;
286  }
287 
288  if (HistoName.find("recEffPhi_L3Filtered") != std::string::npos) {
289  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(4,1), qtstatus);
290  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(4,1), qtstatus);
291  }
292 
293  if (HistoName.find("recEffEta_L3Filtered") != std::string::npos) {
294  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(5,1), qtstatus);
295  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(5,1), qtstatus);
296  }
297 
298  if (HistoName.find("recEffPt_L3Filtered") != std::string::npos) {
299  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(6,1), qtstatus);
300  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(6,1), qtstatus);
301  }
302 
303 
304  }
305  }
306 
307 
308  reportSummary->Fill(SummaryBitResult);
309  CertificationSummary->Fill(SummaryBitResult);
310 
311 
312 
313  // Set the final bits
314 
315  dbe_->setCurrentFolder("HLT/EventInfo/reportSummaryContents");
316  MonitorElement* muonHLTQualityBinaryBit = dbe_->bookFloat ("HLT_Muon");
317 
318  if (SummaryBitResult == 100){
319  muonHLTQualityBinaryBit->Fill(1);
320  } else {
321  muonHLTQualityBinaryBit->Fill(0);
322  }
323 
324 
325 
326 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:659
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:1473
std::vector< QReport * > getQReports(void) const
get map of QReports
std::string HistoName
TH2F * getTH2F(void) const
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:850
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434

Member Data Documentation

DQMStore* HLTMuonCertSummary::dbe_
private

Definition at line 77 of file HLTMuonCertSummary.cc.

edm::ParameterSet HLTMuonCertSummary::parameters_
private
bool HLTMuonCertSummary::verbose_
private

Definition at line 80 of file HLTMuonCertSummary.cc.