test
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
HLTOverallSummary Class Reference
Inheritance diagram for HLTOverallSummary:
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
 
 HLTOverallSummary (const edm::ParameterSet &pset)
 
 ~HLTOverallSummary ()
 
- 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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
 
- 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_, cppFunctionSkipper::operator, and TrackValidation_cff::pset.

88 {
89 
90  using namespace edm;
91  dbe_ = 0;
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
edm::ParameterSet parameters_
HLTOverallSummary::~HLTOverallSummary ( )

Definition at line 108 of file HLTOverallSummary.cc.

109 {
110 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 119 of file HLTOverallSummary.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 129 of file HLTOverallSummary.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 141 of file HLTOverallSummary.cc.

References edm::RunBase::id().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 135 of file HLTOverallSummary.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 152 of file HLTOverallSummary.cc.

References dbe_.

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

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.