CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
P2GTTriggerResultsConverter Class Reference
Inheritance diagram for P2GTTriggerResultsConverter:
edm::stream::EDProducer<>

Public Types

enum  DecisionType { beforeBxMaskAndPrescale, beforePrescale, final }
 
- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

 P2GTTriggerResultsConverter (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

const edm::EDGetTokenT< P2GTAlgoBlockMapalgoBlockToken_
 
std::vector< std::string > algoNames_
 
const DecisionType decisionEnum_
 
const std::string decisionName_
 
const std::string prefix_
 

Detailed Description

Definition at line 22 of file P2GTTriggerResultsConverter.cc.

Member Enumeration Documentation

◆ DecisionType

Constructor & Destructor Documentation

◆ P2GTTriggerResultsConverter()

P2GTTriggerResultsConverter::P2GTTriggerResultsConverter ( const edm::ParameterSet params)
explicit

Definition at line 42 of file P2GTTriggerResultsConverter.cc.

43  : algoBlockToken_(consumes<P2GTAlgoBlockMap>(params.getParameter<edm::InputTag>("src"))),
44  prefix_(params.getParameter<std::string>("prefix")),
45  decisionName_(params.getParameter<std::string>("decision")),
46  decisionEnum_(decisionName_ == "beforeBxMaskAndPrescale" ? beforeBxMaskAndPrescale
47  : decisionName_ == "beforePrescale" ? beforePrescale
48  : final) {
49  produces<edm::TriggerResults>();
50 }
const edm::EDGetTokenT< P2GTAlgoBlockMap > algoBlockToken_

Member Function Documentation

◆ beginRun()

void P2GTTriggerResultsConverter::beginRun ( const edm::Run ,
const edm::EventSetup  
)
overrideprivate

Definition at line 52 of file P2GTTriggerResultsConverter.cc.

References algoNames_.

52 { algoNames_.clear(); }
std::vector< std::string > algoNames_

◆ fillDescriptions()

void P2GTTriggerResultsConverter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 82 of file P2GTTriggerResultsConverter.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

82  {
84  desc.add<edm::InputTag>("src");
85  desc.add<std::string>("prefix", "L1_");
86  desc.ifValue(edm::ParameterDescription<std::string>("decision", "final", true),
87  edm::allowedValues<std::string>("beforeBxMaskAndPrescale", "beforePrescale", "final"));
88  descriptions.addWithDefaultLabel(desc);
89 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

void P2GTTriggerResultsConverter::produce ( edm::Event event,
const edm::EventSetup  
)
overrideprivate

Definition at line 54 of file P2GTTriggerResultsConverter.cc.

References algoBlockToken_, MillePedeAlignmentAlgorithm_cfi::algoName, algoNames_, beforeBxMaskAndPrescale, beforePrescale, decisionEnum_, decisionName_, edm::hlt::Fail, edm::hlt::Pass, and prefix_.

54  {
55  const P2GTAlgoBlockMap& algoBlockMap = event.get(algoBlockToken_);
56 
57  edm::HLTGlobalStatus gtDecisions(algoBlockMap.size());
58 
59  bool fillAlgoNames = false;
60 
61  if (algoNames_.size() == 0) {
62  algoNames_ = std::vector<std::string>(algoBlockMap.size());
63  fillAlgoNames = true;
64  }
65 
66  std::size_t algoIdx = 0;
67  for (const auto& [algoName, algoBlock] : algoBlockMap) {
68  bool decision = decisionEnum_ == beforeBxMaskAndPrescale ? algoBlock.decisionBeforeBxMaskAndPrescale()
69  : decisionEnum_ == beforePrescale ? algoBlock.decisionBeforePrescale()
70  : algoBlock.decisionFinal();
71 
72  gtDecisions[algoIdx] = edm::HLTPathStatus(decision ? edm::hlt::Pass : edm::hlt::Fail);
73  if (fillAlgoNames) {
74  algoNames_[algoIdx] = prefix_ + algoName + "_" + decisionName_;
75  }
76  algoIdx++;
77  }
78 
79  event.put(std::make_unique<edm::TriggerResults>(gtDecisions, algoNames_));
80 }
reject
Definition: HLTenums.h:19
std::vector< std::string > algoNames_
std::map< std::string, P2GTAlgoBlock > P2GTAlgoBlockMap
Definition: P2GTAlgoBlock.h:11
const edm::EDGetTokenT< P2GTAlgoBlockMap > algoBlockToken_
accept
Definition: HLTenums.h:18

Member Data Documentation

◆ algoBlockToken_

const edm::EDGetTokenT<P2GTAlgoBlockMap> P2GTTriggerResultsConverter::algoBlockToken_
private

Definition at line 34 of file P2GTTriggerResultsConverter.cc.

Referenced by produce().

◆ algoNames_

std::vector<std::string> P2GTTriggerResultsConverter::algoNames_
private

Definition at line 39 of file P2GTTriggerResultsConverter.cc.

Referenced by beginRun(), and produce().

◆ decisionEnum_

const DecisionType P2GTTriggerResultsConverter::decisionEnum_
private

Definition at line 37 of file P2GTTriggerResultsConverter.cc.

Referenced by produce().

◆ decisionName_

const std::string P2GTTriggerResultsConverter::decisionName_
private

Definition at line 36 of file P2GTTriggerResultsConverter.cc.

Referenced by produce().

◆ prefix_

const std::string P2GTTriggerResultsConverter::prefix_
private

Definition at line 35 of file P2GTTriggerResultsConverter.cc.

Referenced by produce().