CMS 3D CMS Logo

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 59 of file HLTMuonCertSummary.cc.

Constructor & Destructor Documentation

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

Definition at line 83 of file HLTMuonCertSummary.cc.

References muonDTDigis_cfi::pset, and ~HLTMuonCertSummary().

85 {
86 
87  using namespace edm;
88 
89  parameters_ = pset;
90  verbose_ = parameters_.getUntrackedParameter<bool>("verbose", false);
91 
92  if(verbose_) LogInfo ("HLTMuonVal") << ">>> Constructor (HLTMuonCertSummary) <<<" << endl;
93 
94 }
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet parameters_
HLT enums.
HLTMuonCertSummary::~HLTMuonCertSummary ( )
overridedefault

Referenced by HLTMuonCertSummary().

Member Function Documentation

void HLTMuonCertSummary::beginJob ( void  )
override

Definition at line 108 of file HLTMuonCertSummary.cc.

109 {
110 
111 }
void HLTMuonCertSummary::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
override

Definition at line 117 of file HLTMuonCertSummary.cc.

References edm::RunBase::id().

118 {
119 
120  using namespace edm;
121  if(verbose_) LogInfo ("HLTMuonVal") << ">>> BeginRun (HLTMuonCertSummary) <<<" << std::endl;
122  if(verbose_) LogInfo ("HLTMuonVal") << ">>> "<< run.id() << std::endl;
123 
124 }
RunID const & id() const
Definition: RunBase.h:39
HLT enums.
void HLTMuonCertSummary::dqmEndJob ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
override

Definition at line 130 of file HLTMuonCertSummary.cc.

References DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), DEFINE_FWK_MODULE, MonitorElement::Fill(), DQMStore::IGetter::get(), MonitorElement::getName(), MonitorElement::getQReports(), MonitorElement::getTH2F(), mps_fire::i, DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and parallelization::uint().

131 {
132 
133  using namespace edm;
134  if(verbose_) LogInfo ("HLTMuonVal") << ">>> EndRun (HLTMuonCertSummary) <<<" << std::endl;
135 
136  std::vector<string> histoNameVector;
137 
138 
139  //booking histograms according to naming conventions
140 
141 
142 
143  iBooker.setCurrentFolder("HLT/EventInfo/muonQuality");
144 
145  MonitorElement* reportSummary = iBooker.bookFloat("HLT_MUON_REPORT_SUMMARY");
146 
147  int SummaryBitResult = 100;
148 
149  MonitorElement* CertificationSummary = iBooker.bookFloat("HLT_MUON_CERTIFICATION_SUMMARY");
150 
151 
152 
153  //for now these will hold values from eta/phi tests for spikes/holes
154  MonitorElement* reportSummaryMap = iBooker.book2D("HLT_MUON_ReportSummaryMap","HLT_MUON: ReportSummaryMap",6,-0.5,5.5,1,-0.5,0.5);
155  MonitorElement* CertificationSummaryMap = iBooker.book2D("HLT_MUON_CertificationSummaryMap","HLT_MUON: CertificationSummaryMap",6,-0.5,5.5,1,-0.5,0.5);
156 
157  TH2 * reportSummaryMapTH2 = reportSummaryMap->getTH2F();
158 
159  reportSummaryMapTH2->GetXaxis()->SetBinLabel(1,"PhiEtaOccAll");
160  reportSummaryMapTH2->GetXaxis()->SetBinLabel(2,"PhiEtaOccMatch");
161  reportSummaryMapTH2->GetXaxis()->SetBinLabel(3,"PhiEtaEff");
162  reportSummaryMapTH2->GetXaxis()->SetBinLabel(4,"PhiEff");
163  reportSummaryMapTH2->GetXaxis()->SetBinLabel(5,"EtaEff");
164  reportSummaryMapTH2->GetXaxis()->SetBinLabel(6,"PtEff");
165 
166  reportSummaryMapTH2->GetYaxis()->SetBinLabel(1,"HLT_Mu5_allMuons");
167 
168 
169  TH2 * CertificationSummaryMapTH2 = CertificationSummaryMap->getTH2F();
170 
171  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(1,"PhiEtaOccAll");
172  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(2,"PhiEtaOccMatch");
173  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(3,"PhiEtaEff");
174  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(4,"PhiEff");
175  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(5,"EtaEff");
176  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(6,"PtEff");
177 
178  CertificationSummaryMapTH2->GetYaxis()->SetBinLabel(1,"HLT_Mu5_allMuons");
179 
180 
181  histoNameVector.emplace_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recPhiVsRecEta_All");
182  histoNameVector.emplace_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recPhiVsRecEta_L3Filtered");
183  histoNameVector.emplace_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffPhiVsEta_L3Filtered");
184  histoNameVector.emplace_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffPt_L3Filtered");
185  histoNameVector.emplace_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffPhi_L3Filtered");
186  histoNameVector.emplace_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffEta_L3Filtered");
187 
188  // to do: what do we want in certification contents?
189  // iBooker.setCurrentFolder("Egamma/EventInfo/CertificationContents/");
190 
191 
192  // //looping over histograms to be tested
193  if(verbose_) LogInfo ("HLTMuonVal") << "\n>>> looping over histograms to be tested <<<\n\n";
194 
195  for(auto & it : histoNameVector){
196 
197  const string& HistoName = it;
198  if(verbose_) LogInfo ("HLTMuonVal") << ">>> " << HistoName;
199 
200 
201  MonitorElement * TestHist=nullptr;
202 
203  TestHist = iGetter.get(HistoName);
204 
205  bool validMe = TestHist!=nullptr;
206  if(verbose_) LogInfo ("HLTMuonVal") << " is valid? " << validMe << "\n";
207  if(!validMe) continue;
208 
209  string histNameNoPath = TestHist->getName();
210 
211  if(verbose_) LogInfo ("HLTMuonVal") << ">>> TestHist Name: " << histNameNoPath << "\n\n";
212 
213 
214 
215  //get QReports associated to each ME
216  std::vector<QReport *> myQReports = TestHist->getQReports();
217  if(verbose_) LogInfo ("HLTMuonVal") << TestHist->getName() <<": myQReports.size() = " << myQReports.size() << "\n\n";
218  for(uint i=0;i!=myQReports.size();++i) {
219 
220  std::string qtname = myQReports[i]->getQRName() ; // get QT name
221  float qtresult = myQReports[i]->getQTresult(); // get QT result value
222  int qtstatus = myQReports[i]->getStatus() ; // get QT status value
223 
224  if(verbose_) LogInfo ("HLTMuonVal") << "\tTest " << i << ": qtname: " << qtname << "\n";
225  if(verbose_) LogInfo ("HLTMuonVal") << "\tTest " << i << ": qtresult: " << qtresult << std::endl;
226  if(verbose_) LogInfo ("HLTMuonVal") << "\tTest " << i << ": qtstatus: " << qtstatus << "\n\n";
227 
228 
229  //book and fill float for each test done
230  iBooker.setCurrentFolder("HLT/EventInfo/muonQuality/");
231  MonitorElement * qValueInt = iBooker.bookFloat(histNameNoPath+"_HLT_Mu5_"+qtname);
232  qValueInt->Fill(qtstatus);
233 
234  // We're assuming that you want all of the bits to go into the decision
235 
236 
237  if (HistoName.find("recPhiVsRecEta_All") != std::string::npos) {
238  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(1,1), qtstatus);
239  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(1,1), qtstatus );
240  if ( (qtstatus == 200) && (SummaryBitResult < 300)) SummaryBitResult = 200;
241  if ( qtstatus == 300 ) SummaryBitResult = 300;
242 
243  }
244 
245  if (HistoName.find("recPhiVsRecEta_L3Filtered") != std::string::npos) {
246  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(2,1), qtstatus);
247  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(2,1), qtstatus);
248  if ( (qtstatus == 200) && (SummaryBitResult < 300)) SummaryBitResult = 200;
249  if (qtstatus == 300 ) SummaryBitResult = 300;
250 
251  }
252 
253  if (HistoName.find("recEffPhiVsEta_L3Filtered") != std::string::npos) {
254  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(3,1), qtstatus );
255  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(3,1), qtstatus);
256  if ( (qtstatus == 200) && (SummaryBitResult < 300)) SummaryBitResult = 200;
257  if (qtstatus == 300 ) SummaryBitResult = 300;
258  }
259 
260  if (HistoName.find("recEffPhi_L3Filtered") != std::string::npos) {
261  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(4,1), qtstatus);
262  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(4,1), qtstatus);
263  }
264 
265  if (HistoName.find("recEffEta_L3Filtered") != std::string::npos) {
266  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(5,1), qtstatus);
267  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(5,1), qtstatus);
268  }
269 
270  if (HistoName.find("recEffPt_L3Filtered") != std::string::npos) {
271  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(6,1), qtstatus);
272  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(6,1), qtstatus);
273  }
274 
275 
276  }
277  }
278 
279 
280  reportSummary->Fill(SummaryBitResult);
281  CertificationSummary->Fill(SummaryBitResult);
282 
283 
284 
285  // Set the final bits
286 
287  iBooker.setCurrentFolder("HLT/EventInfo/reportSummaryContents");
288  MonitorElement* muonHLTQualityBinaryBit = iBooker.bookFloat ("HLT_Muon");
289 
290  if (SummaryBitResult == 100){
291  muonHLTQualityBinaryBit->Fill(1);
292  } else {
293  muonHLTQualityBinaryBit->Fill(0);
294  }
295 
296 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
const std::string & getName() const
get name of ME
void Fill(long long x)
TH2F * getTH2F() const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
def uint(string)
std::vector< QReport * > getQReports() const
get map of QReports
std::string HistoName
HLT enums.
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:112

Member Data Documentation

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

Definition at line 76 of file HLTMuonCertSummary.cc.