CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HLTOverallSummary Class Reference
Inheritance diagram for HLTOverallSummary:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endJob () override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
 HLTOverallSummary (const edm::ParameterSet &pset)
 
 ~HLTOverallSummary () override
 
- 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
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

DQMStoredbe_
 
edm::ParameterSet parameters_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 HLTOverallSummary.cc.

Constructor & Destructor Documentation

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

Definition at line 86 of file HLTOverallSummary.cc.

References dbe_, Utilities::operator, muonDTDigis_cfi::pset, and ~HLTOverallSummary().

88 {
89 
90  using namespace edm;
91  dbe_ = nullptr;
93  if (!dbe_) {
94  LogInfo ("HLTMuonVal") << "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 (HLTOverallSummary) <<<" << endl;
104 
105 }
T getUntrackedParameter(std::string const &, T const &) const
HLT enums.
edm::ParameterSet parameters_
HLTOverallSummary::~HLTOverallSummary ( )
overridedefault

Referenced by HLTOverallSummary().

Member Function Documentation

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

Definition at line 117 of file HLTOverallSummary.cc.

118 {
119  using namespace edm;
120 
121  if(verbose_) LogInfo ("HLTMuonVal") << ">>> Analyze (HLTOverallSummary) <<<" << std::endl;
122 
123 }
HLT enums.
void HLTOverallSummary::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 127 of file HLTOverallSummary.cc.

128 {
129 }
void HLTOverallSummary::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
override

Definition at line 139 of file HLTOverallSummary.cc.

References edm::RunBase::id().

140 {
141 
142  using namespace edm;
143  if(verbose_) LogInfo ("HLTMuonVal") << ">>> BeginRun (HLTOverallSummary) <<<" << std::endl;
144  if(verbose_) LogInfo ("HLTMuonVal") << ">>> "<< run.id() << std::endl;
145 
146 }
RunID const & id() const
Definition: RunBase.h:39
HLT enums.
void HLTOverallSummary::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 133 of file HLTOverallSummary.cc.

134 {
135 }
void HLTOverallSummary::endRun ( const edm::Run run,
const edm::EventSetup c 
)
override

Definition at line 150 of file HLTOverallSummary.cc.

References dbe_, DEFINE_FWK_MODULE, MonitorElement::Fill(), MonitorElement::getFloatValue(), and MonitorElement::getTH2F().

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

Member Data Documentation

DQMStore* HLTOverallSummary::dbe_
private

Definition at line 76 of file HLTOverallSummary.cc.

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

Definition at line 79 of file HLTOverallSummary.cc.