CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
AlCaIsolatedBunchSelector Class Reference
Inheritance diagram for AlCaIsolatedBunchSelector:
edm::stream::EDFilter< edm::GlobalCache< AlCaIsolatedBunch::Counters > > edm::stream::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 AlCaIsolatedBunchSelector (edm::ParameterSet const &, const AlCaIsolatedBunch::Counters *count)
 
void endStream () override
 
bool filter (edm::Event &, edm::EventSetup const &) override
 
 ~AlCaIsolatedBunchSelector () override
 
- Public Member Functions inherited from edm::stream::EDFilter< edm::GlobalCache< AlCaIsolatedBunch::Counters > >
 EDFilter ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
- Public Member Functions inherited from edm::stream::EDFilterBase
 EDFilterBase ()
 
 EDFilterBase (const EDFilterBase &)=delete
 
ModuleDescription const & moduleDescription () const
 
const EDFilterBaseoperator= (const EDFilterBase &)=delete
 
 ~EDFilterBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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
 
std::vector< ESProxyIndex > 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::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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void globalEndJob (const AlCaIsolatedBunch::Counters *counters)
 
static std::unique_ptr< AlCaIsolatedBunch::CountersinitializeGlobalCache (edm::ParameterSet const &iConfig)
 
- Static Public Member Functions inherited from edm::stream::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

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

Private Attributes

HLTConfigProvider hltConfig_
 
unsigned int nAll_
 
unsigned int nGood_
 
unsigned int nRun_
 
std::string processName_
 
edm::InputTag theTriggerResultsLabel_
 
edm::EDGetTokenT< edm::TriggerResultstok_trigRes_
 
std::string trigName_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDFilter< edm::GlobalCache< AlCaIsolatedBunch::Counters > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDFilterBase
typedef EDFilterAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- 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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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 38 of file AlCaIsolatedBunchSelector.cc.

Constructor & Destructor Documentation

◆ AlCaIsolatedBunchSelector()

AlCaIsolatedBunchSelector::AlCaIsolatedBunchSelector ( edm::ParameterSet const &  iConfig,
const AlCaIsolatedBunch::Counters count 
)
explicit

Definition at line 68 of file AlCaIsolatedBunchSelector.cc.

70  : nRun_(0), nAll_(0), nGood_(0) {
71  //now do what ever initialization is needed
72  trigName_ = iConfig.getParameter<std::string>("triggerName");
73  processName_ = iConfig.getParameter<std::string>("processName");
74  theTriggerResultsLabel_ = iConfig.getParameter<edm::InputTag>("triggerResultLabel");
75 
76  // define tokens for access
77  tok_trigRes_ = consumes<edm::TriggerResults>(theTriggerResultsLabel_);
78 
79  edm::LogVerbatim("AlCaIsoBunch") << "Input tag for trigger results " << theTriggerResultsLabel_
80  << " with trigger name " << trigName_ << " and process " << processName_
81  << std::endl;
82 }

References edm::ParameterSet::getParameter(), processName_, AlCaHLTBitMon_QueryRunRegistry::string, theTriggerResultsLabel_, tok_trigRes_, and trigName_.

◆ ~AlCaIsolatedBunchSelector()

AlCaIsolatedBunchSelector::~AlCaIsolatedBunchSelector ( )
override

Definition at line 84 of file AlCaIsolatedBunchSelector.cc.

84 {}

Member Function Documentation

◆ beginRun()

void AlCaIsolatedBunchSelector::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 136 of file AlCaIsolatedBunchSelector.cc.

136  {
137  bool changed(false);
138  edm::LogVerbatim("AlCaIsoBunch") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init "
139  << hltConfig_.init(iRun, iSetup, processName_, changed) << std::endl;
140 }

References hltConfig_, HLTConfigProvider::init(), nRun_, processName_, and edm::RunBase::run().

◆ endRun()

void AlCaIsolatedBunchSelector::endRun ( edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 142 of file AlCaIsolatedBunchSelector.cc.

142  {
143  ++nRun_;
144  edm::LogVerbatim("AlCaIsoBunch") << "endRun[" << nRun_ << "] " << iRun.run() << std::endl;
145 }

References nRun_, and edm::RunBase::run().

◆ endStream()

void AlCaIsolatedBunchSelector::endStream ( )
overridevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 126 of file AlCaIsolatedBunchSelector.cc.

126  {
127  globalCache()->nAll_ += nAll_;
128  globalCache()->nGood_ += nGood_;
129 }

References nAll_, and nGood_.

◆ fillDescriptions()

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

Definition at line 148 of file AlCaIsolatedBunchSelector.cc.

148  {
150  desc.add<edm::InputTag>("triggerResultLabel", edm::InputTag("TriggerResults", "", "HLT"));
151  desc.add<std::string>("processName", "HLT");
152  desc.add<std::string>("triggerName", "HLT_HcalIsolatedBunch");
153  descriptions.add("alcaIsolatedBunchSelector", desc);
154 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ filter()

bool AlCaIsolatedBunchSelector::filter ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements edm::stream::EDFilterBase.

Definition at line 91 of file AlCaIsolatedBunchSelector.cc.

91  {
92  bool accept(false);
93  ++nAll_;
94 #ifdef EDM_ML_DEBUG
95  edm::LogVerbatim("AlCaIsoBunch") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity "
96  << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << std::endl;
97 #endif
98  //Step1: Find if the event passes the chosen trigger
100  iEvent.getByToken(tok_trigRes_, triggerResults);
101  if (triggerResults.isValid()) {
102  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerResults);
103  const std::vector<std::string>& triggerNames_ = triggerNames.triggerNames();
104  for (unsigned int iHLT = 0; iHLT < triggerResults->size(); iHLT++) {
105  int hlt = triggerResults->accept(iHLT);
106  if (triggerNames_[iHLT].find(trigName_) != std::string::npos) {
107  if (hlt > 0) {
108  accept = true;
109 #ifdef EDM_ML_DEBUG
110  edm::LogVerbatim("AlCaIsoBunch")
111  << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" << accept << std::endl;
112 #endif
113  break;
114  }
115  }
116  }
117  }
118 
119  // Step 2: Return the acceptance flag
120  if (accept)
121  ++nGood_;
122  return accept;
123 
124 } // AlCaIsolatedBunchSelector::filter

References accept(), spr::find(), ValidationMatrix::hlt, iEvent, nAll_, nGood_, tok_trigRes_, L1TEGammaOffline_cfi::triggerNames, triggerResults, and trigName_.

◆ globalEndJob()

void AlCaIsolatedBunchSelector::globalEndJob ( const AlCaIsolatedBunch::Counters counters)
static

Definition at line 131 of file AlCaIsolatedBunchSelector.cc.

131  {
132  edm::LogVerbatim("AlCaIsoBunch") << "Selects " << count->nGood_ << " in " << count->nAll_ << " events" << std::endl;
133 }

References submitPVResolutionJobs::count.

◆ initializeGlobalCache()

static std::unique_ptr<AlCaIsolatedBunch::Counters> AlCaIsolatedBunchSelector::initializeGlobalCache ( edm::ParameterSet const &  iConfig)
inlinestatic

Definition at line 43 of file AlCaIsolatedBunchSelector.cc.

43  {
44  return std::make_unique<AlCaIsolatedBunch::Counters>();
45  }

Member Data Documentation

◆ hltConfig_

HLTConfigProvider AlCaIsolatedBunchSelector::hltConfig_
private

Definition at line 57 of file AlCaIsolatedBunchSelector.cc.

Referenced by beginRun().

◆ nAll_

unsigned int AlCaIsolatedBunchSelector::nAll_
private

Definition at line 61 of file AlCaIsolatedBunchSelector.cc.

Referenced by endStream(), and filter().

◆ nGood_

unsigned int AlCaIsolatedBunchSelector::nGood_
private

Definition at line 61 of file AlCaIsolatedBunchSelector.cc.

Referenced by endStream(), and filter().

◆ nRun_

unsigned int AlCaIsolatedBunchSelector::nRun_
private

Definition at line 61 of file AlCaIsolatedBunchSelector.cc.

Referenced by beginRun(), and endRun().

◆ processName_

std::string AlCaIsolatedBunchSelector::processName_
private

Definition at line 60 of file AlCaIsolatedBunchSelector.cc.

Referenced by AlCaIsolatedBunchSelector(), and beginRun().

◆ theTriggerResultsLabel_

edm::InputTag AlCaIsolatedBunchSelector::theTriggerResultsLabel_
private

Definition at line 59 of file AlCaIsolatedBunchSelector.cc.

Referenced by AlCaIsolatedBunchSelector().

◆ tok_trigRes_

edm::EDGetTokenT<edm::TriggerResults> AlCaIsolatedBunchSelector::tok_trigRes_
private

Definition at line 62 of file AlCaIsolatedBunchSelector.cc.

Referenced by AlCaIsolatedBunchSelector(), and filter().

◆ trigName_

std::string AlCaIsolatedBunchSelector::trigName_
private

Definition at line 58 of file AlCaIsolatedBunchSelector.cc.

Referenced by AlCaIsolatedBunchSelector(), and filter().

AlCaIsolatedBunchSelector::trigName_
std::string trigName_
Definition: AlCaIsolatedBunchSelector.cc:58
AlCaIsolatedBunchSelector::theTriggerResultsLabel_
edm::InputTag theTriggerResultsLabel_
Definition: AlCaIsolatedBunchSelector.cc:59
AlCaIsolatedBunchSelector::tok_trigRes_
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
Definition: AlCaIsolatedBunchSelector.cc:62
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
triggerResults
static const std::string triggerResults
Definition: EdmProvDump.cc:45
AlCaIsolatedBunchSelector::nRun_
unsigned int nRun_
Definition: AlCaIsolatedBunchSelector.cc:61
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::Handle< edm::TriggerResults >
AlCaIsolatedBunchSelector::processName_
std::string processName_
Definition: AlCaIsolatedBunchSelector.cc:60
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
L1TEGammaOffline_cfi.triggerNames
triggerNames
Definition: L1TEGammaOffline_cfi.py:40
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
AlCaIsolatedBunchSelector::hltConfig_
HLTConfigProvider hltConfig_
Definition: AlCaIsolatedBunchSelector.cc:57
iEvent
int iEvent
Definition: GenABIO.cc:224
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
HLTConfigProvider::init
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
Definition: HLTConfigProvider.cc:36
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
edm::TriggerNames
Definition: TriggerNames.h:55
AlCaIsolatedBunchSelector::nAll_
unsigned int nAll_
Definition: AlCaIsolatedBunchSelector.cc:61
AlCaIsolatedBunchSelector::nGood_
unsigned int nGood_
Definition: AlCaIsolatedBunchSelector.cc:61
edm::InputTag
Definition: InputTag.h:15
ValidationMatrix.hlt
hlt
Definition: ValidationMatrix.py:459