CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Private Attributes
HLTMuonCertSummary Class Reference
Inheritance diagram for HLTMuonCertSummary:

Public Member Functions

void beginJob () override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
 HLTMuonCertSummary (const edm::ParameterSet &pset)
 
 ~HLTMuonCertSummary () override
 

Private Attributes

edm::ParameterSet parameters_
 
bool verbose_
 

Detailed Description

Definition at line 51 of file HLTMuonCertSummary.cc.

Constructor & Destructor Documentation

◆ HLTMuonCertSummary()

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

Definition at line 68 of file HLTMuonCertSummary.cc.

References muonDTDigis_cfi::pset.

70 {
71  using namespace edm;
72 
73  parameters_ = pset;
74  verbose_ = parameters_.getUntrackedParameter<bool>("verbose", false);
75 
76  if (verbose_)
77  LogInfo("HLTMuonVal") << ">>> Constructor (HLTMuonCertSummary) <<<" << endl;
78 }
edm::ParameterSet parameters_
T getUntrackedParameter(std::string const &, T const &) const
Log< level::Info, false > LogInfo
HLT enums.

◆ ~HLTMuonCertSummary()

HLTMuonCertSummary::~HLTMuonCertSummary ( )
overridedefault

Member Function Documentation

◆ beginJob()

void HLTMuonCertSummary::beginJob ( void  )
override

Definition at line 87 of file HLTMuonCertSummary.cc.

87 {}

◆ beginRun()

void HLTMuonCertSummary::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
override

Definition at line 90 of file HLTMuonCertSummary.cc.

References writedatasetfile::run.

90  {
91  using namespace edm;
92  if (verbose_)
93  LogInfo("HLTMuonVal") << ">>> BeginRun (HLTMuonCertSummary) <<<" << std::endl;
94  if (verbose_)
95  LogInfo("HLTMuonVal") << ">>> " << run.id() << std::endl;
96 }
Log< level::Info, false > LogInfo
HLT enums.

◆ dqmEndJob()

void HLTMuonCertSummary::dqmEndJob ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
override

Definition at line 99 of file HLTMuonCertSummary.cc.

References dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::bookFloat(), dqm::impl::MonitorElement::Fill(), dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getName(), dqm::impl::MonitorElement::getQReports(), dqm::legacy::MonitorElement::getTH2F(), mps_fire::i, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and parallelization::uint.

99  {
100  using namespace edm;
101  if (verbose_)
102  LogInfo("HLTMuonVal") << ">>> EndRun (HLTMuonCertSummary) <<<" << std::endl;
103 
104  std::vector<string> histoNameVector;
105 
106  //booking histograms according to naming conventions
107 
108  iBooker.setCurrentFolder("HLT/EventInfo/muonQuality");
109 
110  MonitorElement* reportSummary = iBooker.bookFloat("HLT_MUON_REPORT_SUMMARY");
111 
112  int SummaryBitResult = 100;
113 
114  MonitorElement* CertificationSummary = iBooker.bookFloat("HLT_MUON_CERTIFICATION_SUMMARY");
115 
116  //for now these will hold values from eta/phi tests for spikes/holes
117  MonitorElement* reportSummaryMap =
118  iBooker.book2D("HLT_MUON_ReportSummaryMap", "HLT_MUON: ReportSummaryMap", 6, -0.5, 5.5, 1, -0.5, 0.5);
119  MonitorElement* CertificationSummaryMap = iBooker.book2D(
120  "HLT_MUON_CertificationSummaryMap", "HLT_MUON: CertificationSummaryMap", 6, -0.5, 5.5, 1, -0.5, 0.5);
121 
122  TH2* reportSummaryMapTH2 = reportSummaryMap->getTH2F();
123 
124  reportSummaryMapTH2->GetXaxis()->SetBinLabel(1, "PhiEtaOccAll");
125  reportSummaryMapTH2->GetXaxis()->SetBinLabel(2, "PhiEtaOccMatch");
126  reportSummaryMapTH2->GetXaxis()->SetBinLabel(3, "PhiEtaEff");
127  reportSummaryMapTH2->GetXaxis()->SetBinLabel(4, "PhiEff");
128  reportSummaryMapTH2->GetXaxis()->SetBinLabel(5, "EtaEff");
129  reportSummaryMapTH2->GetXaxis()->SetBinLabel(6, "PtEff");
130 
131  reportSummaryMapTH2->GetYaxis()->SetBinLabel(1, "HLT_Mu5_allMuons");
132 
133  TH2* CertificationSummaryMapTH2 = CertificationSummaryMap->getTH2F();
134 
135  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(1, "PhiEtaOccAll");
136  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(2, "PhiEtaOccMatch");
137  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(3, "PhiEtaEff");
138  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(4, "PhiEff");
139  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(5, "EtaEff");
140  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(6, "PtEff");
141 
142  CertificationSummaryMapTH2->GetYaxis()->SetBinLabel(1, "HLT_Mu5_allMuons");
143 
144  histoNameVector.emplace_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recPhiVsRecEta_All");
145  histoNameVector.emplace_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recPhiVsRecEta_L3Filtered");
146  histoNameVector.emplace_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffPhiVsEta_L3Filtered");
147  histoNameVector.emplace_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffPt_L3Filtered");
148  histoNameVector.emplace_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffPhi_L3Filtered");
149  histoNameVector.emplace_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffEta_L3Filtered");
150 
151  // to do: what do we want in certification contents?
152  // iBooker.setCurrentFolder("Egamma/EventInfo/CertificationContents/");
153 
154  // //looping over histograms to be tested
155  if (verbose_)
156  LogInfo("HLTMuonVal") << "\n>>> looping over histograms to be tested <<<\n\n";
157 
158  for (auto& it : histoNameVector) {
159  const string& HistoName = it;
160  if (verbose_)
161  LogInfo("HLTMuonVal") << ">>> " << HistoName;
162 
163  MonitorElement* TestHist = nullptr;
164 
165  TestHist = iGetter.get(HistoName);
166 
167  bool validMe = TestHist != nullptr;
168  if (verbose_)
169  LogInfo("HLTMuonVal") << " is valid? " << validMe << "\n";
170  if (!validMe)
171  continue;
172 
173  string histNameNoPath = TestHist->getName();
174 
175  if (verbose_)
176  LogInfo("HLTMuonVal") << ">>> TestHist Name: " << histNameNoPath << "\n\n";
177 
178  //get QReports associated to each ME
179  std::vector<QReport*> myQReports = TestHist->getQReports();
180  if (verbose_)
181  LogInfo("HLTMuonVal") << TestHist->getName() << ": myQReports.size() = " << myQReports.size() << "\n\n";
182  for (uint i = 0; i != myQReports.size(); ++i) {
183  std::string qtname = myQReports[i]->getQRName(); // get QT name
184  float qtresult = myQReports[i]->getQTresult(); // get QT result value
185  int qtstatus = myQReports[i]->getStatus(); // get QT status value
186 
187  if (verbose_)
188  LogInfo("HLTMuonVal") << "\tTest " << i << ": qtname: " << qtname << "\n";
189  if (verbose_)
190  LogInfo("HLTMuonVal") << "\tTest " << i << ": qtresult: " << qtresult << std::endl;
191  if (verbose_)
192  LogInfo("HLTMuonVal") << "\tTest " << i << ": qtstatus: " << qtstatus << "\n\n";
193 
194  //book and fill float for each test done
195  iBooker.setCurrentFolder("HLT/EventInfo/muonQuality/");
196  MonitorElement* qValueInt = iBooker.bookFloat(histNameNoPath + "_HLT_Mu5_" + qtname);
197  qValueInt->Fill(qtstatus);
198 
199  // We're assuming that you want all of the bits to go into the decision
200 
201  if (HistoName.find("recPhiVsRecEta_All") != std::string::npos) {
202  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(1, 1), qtstatus);
203  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(1, 1), qtstatus);
204  if ((qtstatus == 200) && (SummaryBitResult < 300))
205  SummaryBitResult = 200;
206  if (qtstatus == 300)
207  SummaryBitResult = 300;
208  }
209 
210  if (HistoName.find("recPhiVsRecEta_L3Filtered") != std::string::npos) {
211  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(2, 1), qtstatus);
212  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(2, 1), qtstatus);
213  if ((qtstatus == 200) && (SummaryBitResult < 300))
214  SummaryBitResult = 200;
215  if (qtstatus == 300)
216  SummaryBitResult = 300;
217  }
218 
219  if (HistoName.find("recEffPhiVsEta_L3Filtered") != std::string::npos) {
220  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(3, 1), qtstatus);
221  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(3, 1), qtstatus);
222  if ((qtstatus == 200) && (SummaryBitResult < 300))
223  SummaryBitResult = 200;
224  if (qtstatus == 300)
225  SummaryBitResult = 300;
226  }
227 
228  if (HistoName.find("recEffPhi_L3Filtered") != std::string::npos) {
229  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(4, 1), qtstatus);
230  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(4, 1), qtstatus);
231  }
232 
233  if (HistoName.find("recEffEta_L3Filtered") != std::string::npos) {
234  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(5, 1), qtstatus);
235  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(5, 1), qtstatus);
236  }
237 
238  if (HistoName.find("recEffPt_L3Filtered") != std::string::npos) {
239  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(6, 1), qtstatus);
240  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(6, 1), qtstatus);
241  }
242  }
243  }
244 
245  reportSummary->Fill(SummaryBitResult);
246  CertificationSummary->Fill(SummaryBitResult);
247 
248  // Set the final bits
249 
250  iBooker.setCurrentFolder("HLT/EventInfo/reportSummaryContents");
251  MonitorElement* muonHLTQualityBinaryBit = iBooker.bookFloat("HLT_Muon");
252 
253  if (SummaryBitResult == 100) {
254  muonHLTQualityBinaryBit->Fill(1);
255  } else {
256  muonHLTQualityBinaryBit->Fill(0);
257  }
258 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
std::vector< MonitorElementData::QReport * > getQReports() const
get map of QReports
void Fill(long long x)
virtual TH2F * getTH2F() const
Log< level::Info, false > LogInfo
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
std::string HistoName
const std::string & getName() const
get name of ME
HLT enums.

Member Data Documentation

◆ parameters_

edm::ParameterSet HLTMuonCertSummary::parameters_
private

◆ verbose_

bool HLTMuonCertSummary::verbose_
private

Definition at line 63 of file HLTMuonCertSummary.cc.