|
|
Go to the documentation of this file.
20 #include "Math/QuantFuncMathCore.h"
41 <<
"\". Legal values are \"job\", \"run\", \"lumi\", \"event\" and \"never\".";
62 std::vector<std::vector<unsigned int> >
const& hlIndex,
63 std::vector<std::vector<unsigned int> >
const& dsIndex)
68 hlWasRun_(numHLNames),
71 hlAccept_(numHLNames),
72 hlAccTot_(numHLNames),
73 hlErrors_(numHLNames),
74 hlAccTotDS_(hlIndex.
size()),
75 hlAllTotDS_(hlIndex.
size()),
76 dsAccTotS_(dsIndex.
size()),
77 dsAllTotS_(dsIndex.
size()) {
78 for (
size_t ds = 0; ds < hlIndex.size(); ++ds) {
82 for (
size_t s = 0;
s < dsIndex.size(); ++
s) {
93 auto vsum = [](
auto&
to,
auto const& from) {
94 for (
size_t i = 0;
i < from.size(); ++
i) {
111 auto vvsum = [](
auto&
to,
auto const& from) {
112 for (
size_t i = 0;
i < from.size(); ++
i) {
114 for (
size_t j = 0;
j < from[
i].size(); ++
j) {
142 auto vvreset = [&vreset](
auto&
to) {
148 vvreset(hlAccTotDS_);
153 : hlTriggerResults_(iConfig.getParameter<
edm::
InputTag>(
"HLTriggerResults")),
162 isCustomDatasets_(
false),
166 isCustomStreams_(
false),
167 refPath_(
"HLTriggerFinalPath"),
169 refRate_(iConfig.getUntrackedParameter<double>(
"ReferenceRate", 100.0)),
170 reportBy_(
decode(iConfig.getUntrackedParameter<
std::
string>(
"reportBy",
"job"))),
171 resetBy_(
decode(iConfig.getUntrackedParameter<
std::
string>(
"resetBy",
"never"))),
172 serviceBy_(
decode(iConfig.getUntrackedParameter<
std::
string>(
"serviceBy",
"never"))),
219 desc.addUntracked<
double>(
"ReferenceRate", 100.0);
221 descriptions.
add(
"hltTrigReport",
desc);
240 for (
unsigned int i = 0;
i <
n; ++
i) {
244 for (
unsigned int j = 0;
j < moduleLabels.size(); ++
j) {
246 if (
label ==
"HLTLevel1GTSeed")
248 else if (
label ==
"HLTPrescaler")
269 for (
unsigned int p = 0;
p <
size; ++
p) {
283 for (
unsigned int ds = 0; ds <
size; ++ds) {
300 <<
"Using HLTriggerFinalPath instead.";
306 <<
"Using first path in table (index=0) instead.";
355 stream <<
"Summary for Run " <<
run.run();
367 return std::make_shared<Accumulate>();
371 return std::shared_ptr<Accumulate>();
389 stream <<
"Summary for Run " <<
lumi.run() <<
", LumiSection " <<
lumi.luminosityBlock();
420 accumulate.nEvents_++;
427 accumulate.nWasRun_++;
429 LogDebug(
"HLTrigReport") <<
"HLT TriggerResults decision: " <<
accept;
431 ++accumulate.nAccept_;
433 accumulate.nErrors_++;
436 accumulate.nErrors_++;
446 bool acceptedByPrevoiusPaths =
false;
447 for (
unsigned int i = 0;
i !=
n; ++
i) {
449 accumulate.hlWasRun_[
i]++;
451 acceptedByPrevoiusPaths =
true;
452 accumulate.hlAccept_[
i]++;
454 if (acceptedByPrevoiusPaths)
455 accumulate.hlAccTot_[
i]++;
457 accumulate.hlErrors_[
i]++;
461 accumulate.hltL1s_[
i]++;
463 accumulate.hltPre_[
i]++;
466 accumulate.hltL1s_[
i]++;
468 accumulate.hltPre_[
i]++;
473 std::vector<bool> acceptedByDS(
hlIndex_.size(),
false);
474 for (
size_t ds = 0; ds <
hlIndex_.size(); ++ds) {
477 acceptedByDS[ds] =
true;
478 accumulate.hlAccTotDS_[ds][
p]++;
481 if (acceptedByDS[ds])
482 accumulate.hlAllTotDS_[ds]++;
487 bool acceptedByS =
false;
488 for (
size_t ds = 0; ds <
dsIndex_[
s].size(); ++ds) {
489 if (acceptedByS
or acceptedByDS[
dsIndex_[
s][ds]]) {
491 accumulate.dsAccTotS_[
s][ds]++;
495 accumulate.dsAllTotS_[
s]++;
500 stream <<
"Summary for Run " <<
iEvent.run() <<
", LumiSection " <<
iEvent.luminosityBlock() <<
", Event "
525 if ((
n == 0) and (accumulate.
nEvents_ == 0))
530 <<
"---------- Event Summary ------------" << endl;
534 <<
" Events total = " << accumulate.
nEvents_ <<
" wasrun = " << accumulate.
nWasRun_
535 <<
" passed = " << accumulate.
nAccept_ <<
" errors = " << accumulate.
nErrors_ << endl;
542 double alpha = 1 - (1.0 - .6854) / 2;
546 <<
"---------- HLTrig Summary ------------" << endl;
547 LogVerbatim(
"HLTrigReport") <<
"HLT-Report " << right << setw(7) <<
"HLT #"
548 <<
" " << right << setw(7) <<
"WasRun"
549 <<
" " << right << setw(7) <<
"L1S"
550 <<
" " << right << setw(7) <<
"Pre"
551 <<
" " << right << setw(7) <<
"HLT"
552 <<
" " << right << setw(9) <<
"%L1sPre"
553 <<
" " << right << setw(7) <<
"Rate"
554 <<
" " << right << setw(7) <<
"RateHi"
555 <<
" " << right << setw(7) <<
"Errors"
560 for (
unsigned int i = 0;
i !=
n; ++
i) {
562 <<
"HLT-Report " << right << setw(7) <<
i <<
" " << right << setw(7) << accumulate.
hlWasRun_[
i] <<
" "
563 << right << setw(7) << accumulate.
hltL1s_[
i] <<
" " << right << setw(7) << accumulate.
hltPre_[
i] <<
" "
564 << right << setw(7) << accumulate.
hlAccept_[
i] <<
" " << right << setw(9) <<
fixed << setprecision(5)
565 << static_cast<float>(100 * accumulate.
hlAccept_[
i]) / static_cast<float>(
max(accumulate.
hltPre_[
i], 1u))
566 <<
" " << right << setw(7) <<
fixed << setprecision(1) <<
scale * accumulate.
hlAccept_[
i] <<
" " << right
567 << setw(7) <<
fixed << setprecision(1)
579 <<
"---------- HLTrig Summary ------------" << endl;
580 LogVerbatim(
"HLTrigRprtTt") <<
"HLT-Report " << right << setw(7) <<
"HLT #"
581 <<
" " << right << setw(7) <<
"WasRun"
582 <<
" " << right << setw(7) <<
"L1S"
583 <<
" " << right << setw(7) <<
"Pre"
584 <<
" " << right << setw(7) <<
"HLT"
585 <<
" " << right << setw(9) <<
"%L1sPre"
586 <<
" " << right << setw(7) <<
"Rate"
587 <<
" " << right << setw(7) <<
"RateHi"
588 <<
" " << right << setw(7) <<
"HLTtot"
589 <<
" " << right << setw(7) <<
"RateTot"
590 <<
" " << right << setw(7) <<
"Errors"
595 for (
unsigned int i = 0;
i !=
n; ++
i) {
597 <<
"HLT-Report " << right << setw(7) <<
i <<
" " << right << setw(7) << accumulate.
hlWasRun_[
i] <<
" "
598 << right << setw(7) << accumulate.
hltL1s_[
i] <<
" " << right << setw(7) << accumulate.
hltPre_[
i] <<
" "
599 << right << setw(7) << accumulate.
hlAccept_[
i] <<
" " << right << setw(9) <<
fixed << setprecision(5)
600 << static_cast<float>(100 * accumulate.
hlAccept_[
i]) / static_cast<float>(
max(accumulate.
hltPre_[
i], 1u))
601 <<
" " << right << setw(7) <<
fixed << setprecision(1) <<
scale * accumulate.
hlAccept_[
i] <<
" " << right
602 << setw(7) <<
fixed << setprecision(1)
608 <<
" " << right << setw(7) << accumulate.
hlAccTot_[
i] <<
" " << right << setw(7) <<
fixed << setprecision(1)
614 for (
size_t ds = 0; ds <
hlIndex_.size(); ++ds) {
617 <<
"---------- Dataset Summary: " <<
datasetNames_[ds] <<
" ------------"
619 LogVerbatim(
"HLTrigRprtPD") <<
"HLT-Report " << right << setw(7) <<
"HLT #"
620 <<
" " << right << setw(7) <<
"WasRun"
621 <<
" " << right << setw(7) <<
"L1S"
622 <<
" " << right << setw(7) <<
"Pre"
623 <<
" " << right << setw(7) <<
"HLT"
624 <<
" " << right << setw(9) <<
"%L1sPre"
625 <<
" " << right << setw(7) <<
"Rate"
626 <<
" " << right << setw(7) <<
"RateHi"
627 <<
" " << right << setw(7) <<
"HLTtot"
628 <<
" " << right << setw(7) <<
"RateTot"
629 <<
" " << right << setw(7) <<
"Errors"
634 <<
"HLT-Report " << right << setw(7) <<
p <<
" " << right << setw(7)
636 <<
" " << right << setw(7) << accumulate.
hltPre_[
hlIndex_[ds][
p]] <<
" " << right << setw(7)
641 <<
" " << right << setw(7) <<
fixed << setprecision(1)
643 ?
refRate_ * ROOT::Math::beta_quantile(
648 <<
" " << right << setw(7) << accumulate.
hlAccTotDS_[ds][
p] <<
" " << right << setw(7) <<
fixed
649 << setprecision(1) <<
scale * accumulate.
hlAccTotDS_[ds][
p] <<
" " << right << setw(7)
658 <<
"---------- Stream Summary: " <<
streamNames_[
s] <<
" ------------"
660 LogVerbatim(
"HLTrigRprtST") <<
"HLT-Report " << right << setw(10) <<
"Dataset #"
661 <<
" " << right << setw(10) <<
"Individual"
662 <<
" " << right << setw(10) <<
"Total"
663 <<
" " << right << setw(10) <<
"Rate"
664 <<
" " << right << setw(10) <<
"RateHi"
665 <<
" " << right << setw(10) <<
"RateTot"
668 for (
size_t ds = 0; ds <
dsIndex_[
s].size(); ++ds) {
671 <<
"HLT-Report " << right << setw(10) << ds <<
" " << right << setw(10) << acceptedDS <<
" " << right
672 << setw(10) << accumulate.
dsAccTotS_[
s][ds] <<
" " << right << setw(10) <<
fixed << setprecision(1)
673 <<
scale * acceptedDS <<
" " << right << setw(10) <<
fixed << setprecision(1)
678 <<
" " << right << setw(10) <<
fixed << setprecision(1) <<
scale * accumulate.
dsAccTotS_[
s][ds] <<
" "
684 LogVerbatim(
"HLTrigReport") <<
"HLT-Report - No HLT paths found!" << endl;
688 LogVerbatim(
"HLTrigReport") <<
"HLT-Report end!" << endl;
HLTrigReport(const edm::ParameterSet &)
std::vector< unsigned int > hltL1s_
std::vector< unsigned int > hlAccTot_
const std::string moduleType(const std::string &module) const
C++ class name of module.
std::vector< std::vector< unsigned int > > dsAccTotS_
HLTConfigProvider hltConfig_
alpha
zGenParticlesMatch = cms.InputTag(""),
std::vector< std::string > streamNames_
bool wasrun() const
Was at least one path run?
std::vector< unsigned int > hlAllTotDS_
bool error() const
Has any path encountered an error (exception)
T getUntrackedParameter(std::string const &, T const &) const
std::vector< unsigned int > hlErrors_
std::vector< std::vector< unsigned int > > hlIndex_
Log< level::Warning, false > LogWarning
const ReportEvery serviceBy_
std::vector< int > posL1s_
std::vector< unsigned int > hltPre_
unsigned int index(const unsigned int i) const
Get index (slot position) of module giving the decision of the ith path.
void beginRun(edm::Run const &, edm::EventSetup const &) override
std::vector< std::vector< unsigned int > > dsIndex_
std::vector< std::string > hlNames_
bool readAfterLumi() const
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
std::vector< std::string > datasetNames_
std::vector< std::vector< std::string > > datasetContents_
#define DEFINE_FWK_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void analyze(const edm::Event &, const edm::EventSetup &) override
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
std::vector< unsigned int > dsAllTotS_
std::vector< unsigned int > hlAccept_
const std::vector< std::string > & streamNames() const
std::vector< int > posPre_
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
bool useLumiCache() const
const ReportEvery reportBy_
static ReportEvery decode(const std::string &value)
const std::vector< std::string > & streamNames() const
std::vector< unsigned int > hlWasRun_
void accumulate(Accumulate const &)
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
const std::vector< std::string > & datasetNames() const
void endRun(edm::Run const &, edm::EventSetup const &) override
hltrigreport::Accumulate Accumulate
bool decode(bool &, std::string const &)
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
Log< level::Info, true > LogVerbatim
const std::vector< std::vector< std::string > > & datasetContents() const
names of trigger paths for all datasets
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::vector< std::vector< std::string > > & streamContents() const
names of datasets for all streams
std::shared_ptr< Accumulate > globalBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const override
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
T getParameter(std::string const &) const
bool accept() const
Has at least one path accepted the event?
const edm::InputTag hlTriggerResults_
std::vector< std::vector< unsigned int > > hlAccTotDS_
hltrigreport::Accumulate accumulate_
hltrigreport::Accumulate & chooseAccumulate(edm::LuminosityBlockIndex index)
const std::vector< std::string > & triggerNames() const
names of trigger paths
const edm::EDGetTokenT< edm::TriggerResults > hlTriggerResultsToken_
void dumpReport(hltrigreport::Accumulate const &accumulate, std::string const &header=std::string()) const
void updateService(Accumulate const &accumulate) const
const std::vector< std::string > & datasetNames() const
const ReportEvery resetBy_
std::vector< std::vector< std::string > > streamContents_