CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
HLTOverallSummary Class Reference
Inheritance diagram for HLTOverallSummary:
edm::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
 HLTOverallSummary (const edm::ParameterSet &pset)
 
 ~HLTOverallSummary () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

DQMStoredbe_
 
edm::ParameterSet parameters_
 
bool verbose_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 50 of file HLTOverallSummary.cc.

Member Typedef Documentation

◆ DQMStore

Definition at line 53 of file HLTOverallSummary.cc.

◆ MonitorElement

Definition at line 52 of file HLTOverallSummary.cc.

Constructor & Destructor Documentation

◆ HLTOverallSummary()

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

Definition at line 71 of file HLTOverallSummary.cc.

References Utilities::operator, and muonDTDigis_cfi::pset.

73 {
74  usesResource("DQMStore");
75  using namespace edm;
76  dbe_ = nullptr;
78  if (!dbe_) {
79  LogInfo("HLTMuonVal") << "Can't find DQMStore, no results will be saved" << endl;
80  }
81 
82  parameters_ = pset;
83  verbose_ = parameters_.getUntrackedParameter<bool>("verbose", false);
84 
85  if (verbose_)
86  LogInfo("HLTMuonVal") << ">>> Constructor (HLTOverallSummary) <<<" << endl;
87 }
T getUntrackedParameter(std::string const &, T const &) const
Log< level::Info, false > LogInfo
HLT enums.
edm::ParameterSet parameters_

◆ ~HLTOverallSummary()

HLTOverallSummary::~HLTOverallSummary ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 96 of file HLTOverallSummary.cc.

96  {
97  using namespace edm;
98 
99  if (verbose_)
100  LogInfo("HLTMuonVal") << ">>> Analyze (HLTOverallSummary) <<<" << std::endl;
101 }
Log< level::Info, false > LogInfo
HLT enums.

◆ beginRun()

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

Definition at line 104 of file HLTOverallSummary.cc.

References writedatasetfile::run.

104  {
105  using namespace edm;
106  if (verbose_)
107  LogInfo("HLTMuonVal") << ">>> BeginRun (HLTOverallSummary) <<<" << std::endl;
108  if (verbose_)
109  LogInfo("HLTMuonVal") << ">>> " << run.id() << std::endl;
110 }
Log< level::Info, false > LogInfo
HLT enums.

◆ endRun()

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

Definition at line 113 of file HLTOverallSummary.cc.

References dqm::impl::MonitorElement::Fill(), dqm::impl::MonitorElement::getFloatValue(), and dqm::legacy::MonitorElement::getTH2F().

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

Member Data Documentation

◆ dbe_

DQMStore* HLTOverallSummary::dbe_
private

Definition at line 63 of file HLTOverallSummary.cc.

◆ parameters_

edm::ParameterSet HLTOverallSummary::parameters_
private

◆ verbose_

bool HLTOverallSummary::verbose_
private

Definition at line 66 of file HLTOverallSummary.cc.