CMS 3D CMS Logo

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

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

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 ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

DQMStoredbe_
 
edm::ParameterSet parameters_
 
bool verbose_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 51 of file HLTOverallSummary.cc.

Member Typedef Documentation

◆ DQMStore

Definition at line 54 of file HLTOverallSummary.cc.

◆ MonitorElement

Definition at line 53 of file HLTOverallSummary.cc.

Constructor & Destructor Documentation

◆ HLTOverallSummary()

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

Definition at line 74 of file HLTOverallSummary.cc.

76 {
77  using namespace edm;
78  dbe_ = nullptr;
79  dbe_ = edm::Service<DQMStore>().operator->();
80  if (!dbe_) {
81  LogInfo("HLTMuonVal") << "Can't find DQMStore, no results will be saved" << endl;
82  }
83 
84  parameters_ = pset;
85  verbose_ = parameters_.getUntrackedParameter<bool>("verbose", false);
86 
87  if (verbose_)
88  LogInfo("HLTMuonVal") << ">>> Constructor (HLTOverallSummary) <<<" << endl;
89 }

References dbe_, and muonDTDigis_cfi::pset.

◆ ~HLTOverallSummary()

HLTOverallSummary::~HLTOverallSummary ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 98 of file HLTOverallSummary.cc.

98  {
99  using namespace edm;
100 
101  if (verbose_)
102  LogInfo("HLTMuonVal") << ">>> Analyze (HLTOverallSummary) <<<" << std::endl;
103 }

◆ beginJob()

void HLTOverallSummary::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 106 of file HLTOverallSummary.cc.

106 {}

◆ beginRun()

void HLTOverallSummary::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 112 of file HLTOverallSummary.cc.

112  {
113  using namespace edm;
114  if (verbose_)
115  LogInfo("HLTMuonVal") << ">>> BeginRun (HLTOverallSummary) <<<" << std::endl;
116  if (verbose_)
117  LogInfo("HLTMuonVal") << ">>> " << run.id() << std::endl;
118 }

References writedatasetfile::run.

◆ endJob()

void HLTOverallSummary::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 109 of file HLTOverallSummary.cc.

109 {}

◆ endRun()

void HLTOverallSummary::endRun ( const edm::Run run,
const edm::EventSetup c 
)
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 121 of file HLTOverallSummary.cc.

121  {
122  using namespace edm;
123  if (verbose_)
124  LogInfo("HLTMuonVal") << ">>> EndRun (HLTOverallSummary) <<<" << std::endl;
125 
126  if (!dbe_) {
127  LogInfo("HLTMuonVal") << "No dqmstore... skipping processing step" << endl;
128  return;
129  }
130 
131  std::vector<string> histoNameVector;
132 
133  //booking histograms according to naming conventions
134 
135  float defaultValueIfNotFound = 1.0;
136 
137  dbe_->setCurrentFolder("HLT/EventInfo/reportSummaryContent");
138 
139  //============ Unpack information ==========
140 
141  MonitorElement* muonQualityBit = nullptr;
142  muonQualityBit = dbe_->get("HLT_Muon");
143 
144  if (!muonQualityBit) {
145  LogInfo("HLTMuonVal") << "Can't find muonQuality bit... making a bit, setting it to zero" << endl;
146 
147  muonQualityBit = dbe_->bookFloat("HLT_Muon");
148  muonQualityBit->Fill(defaultValueIfNotFound);
149  }
150 
151  MonitorElement* eleQualityBit = nullptr;
152  eleQualityBit = dbe_->get("HLT_Electron");
153 
154  if (!eleQualityBit) {
155  LogInfo("HLTMuonVal") << "Can't find eleQuality bit... making a bit, setting it to zero" << endl;
156 
157  eleQualityBit = dbe_->bookFloat("HLT_Electron");
158  eleQualityBit->Fill(defaultValueIfNotFound);
159  }
160 
161  MonitorElement* photonQualityBit = nullptr;
162  photonQualityBit = dbe_->get("HLT_Photon");
163 
164  if (!photonQualityBit) {
165  LogInfo("HLTMuonVal") << "Can't find photonQuality bit... making a bit, setting it to zero" << endl;
166 
167  photonQualityBit = dbe_->bookFloat("HLT_Photon");
168  photonQualityBit->Fill(defaultValueIfNotFound);
169  }
170 
171  //============ Book new storage locations =============
172 
173  dbe_->setCurrentFolder("HLT/EventInfo");
174  MonitorElement* hltQualityBit = dbe_->bookFloat("reportSummary");
175 
176  MonitorElement* hltQualitySummaryWord = dbe_->bookInt("HLT_SUMMARY_WORD");
177 
178  //for now these will hold values from eta/phi tests for spikes/holes
179  MonitorElement* reportSummaryMap =
180  dbe_->book2D("reportSummaryMap", "HLT: ReportSummaryMap", 3, -0.5, 2.5, 1, -0.5, 0.5);
181  MonitorElement* CertificationSummaryMap =
182  dbe_->book2D("certificationSummaryMap", "HLT: CertificationSummaryMap", 3, -0.5, 2.5, 1, -0.5, 0.5);
183 
184  TH2* reportSummaryMapTH2 = reportSummaryMap->getTH2F();
185 
186  reportSummaryMapTH2->GetXaxis()->SetBinLabel(1, "Muon");
187  reportSummaryMapTH2->GetXaxis()->SetBinLabel(2, "Electron");
188  reportSummaryMapTH2->GetXaxis()->SetBinLabel(3, "Photon");
189 
190  reportSummaryMapTH2->GetYaxis()->SetBinLabel(1, "Quality");
191 
192  TH2* CertificationSummaryMapTH2 = CertificationSummaryMap->getTH2F();
193 
194  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(1, "Muon");
195  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(2, "Electron");
196  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(3, "Photon");
197  CertificationSummaryMapTH2->GetYaxis()->SetBinLabel(1, "Quality");
198 
199  //=================== Interpret bits and store result
200 
201  float photonValue = photonQualityBit->getFloatValue();
202 
203  float electronValue = eleQualityBit->getFloatValue();
204 
205  float muonValue = muonQualityBit->getFloatValue();
206 
207  float hltOverallValue = 1.0;
208 
209  if ((photonValue > 0.99) && (electronValue > 0.99) && (muonValue > 0.99)) {
210  hltOverallValue = 1.0;
211 
212  } else {
213  hltOverallValue = 0.0;
214  }
215 
216  hltQualityBit->Fill(hltOverallValue);
217 
218  unsigned int hltSummaryValue = 0x0; //
219 
220  unsigned int ELECTRON_MASK = 0x1;
221  unsigned int PHOTON_MASK = 0x2;
222  unsigned int MUON_MASK = 0x4;
223 
224  if (electronValue > 0.99)
225  hltSummaryValue = hltSummaryValue | ELECTRON_MASK;
226  if (photonValue > 0.99)
227  hltSummaryValue = hltSummaryValue | PHOTON_MASK;
228  if (muonValue > 0.99)
229  hltSummaryValue = hltSummaryValue | MUON_MASK;
230 
231  hltQualitySummaryWord->Fill(hltSummaryValue);
232 
233  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(1, 1), muonValue);
234  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(2, 1), electronValue);
235  reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(3, 1), photonValue);
236 
237  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(1, 1), muonValue);
238  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(2, 1), electronValue);
239  CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(3, 1), photonValue);
240 }

References dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::bookFloat(), dqm::implementation::IBooker::bookInt(), dbe_, dqm::impl::MonitorElement::Fill(), dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getFloatValue(), dqm::legacy::MonitorElement::getTH2F(), and dqm::implementation::DQMStore::setCurrentFolder().

Member Data Documentation

◆ dbe_

DQMStore* HLTOverallSummary::dbe_
private

Definition at line 66 of file HLTOverallSummary.cc.

◆ parameters_

edm::ParameterSet HLTOverallSummary::parameters_
private

◆ verbose_

bool HLTOverallSummary::verbose_
private

Definition at line 69 of file HLTOverallSummary.cc.

dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::LogInfo
Definition: MessageLogger.h:254
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
dqm::impl::MonitorElement::getFloatValue
virtual double getFloatValue() const
Definition: MonitorElement.cc:917
dqm::implementation::IBooker::bookInt
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
edm::Service
Definition: Service.h:30
HLTOverallSummary::parameters_
edm::ParameterSet parameters_
Definition: HLTOverallSummary.cc:67
writedatasetfile.run
run
Definition: writedatasetfile.py:27
dqm::implementation::IBooker::book2D
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:177
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
HLTOverallSummary::dbe_
DQMStore * dbe_
Definition: HLTOverallSummary.cc:66
HLTOverallSummary::verbose_
bool verbose_
Definition: HLTOverallSummary.cc:69
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:490