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 &) override
 
virtual void beginJob () override
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 
virtual void endJob () override
 
virtual void endRun (const edm::Run &, const edm::EventSetup &) override
 
 HLTMuonCertSummary (const edm::ParameterSet &pset)
 
 ~HLTMuonCertSummary ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) 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
 
- 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::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 59 of file HLTMuonCertSummary.cc.

Constructor & Destructor Documentation

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

Definition at line 86 of file HLTMuonCertSummary.cc.

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

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

Definition at line 108 of file HLTMuonCertSummary.cc.

109 {
110 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 119 of file HLTMuonCertSummary.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 129 of file HLTMuonCertSummary.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 141 of file HLTMuonCertSummary.cc.

References edm::RunBase::id().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 135 of file HLTMuonCertSummary.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 152 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.

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

Member Data Documentation

DQMStore* HLTMuonCertSummary::dbe_
private

Definition at line 76 of file HLTMuonCertSummary.cc.

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

Definition at line 79 of file HLTMuonCertSummary.cc.