CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
 EDFilter (const EDFilter &)=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 EDFilteroperator= (const EDFilter &)=delete
 
- 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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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::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
 
bool registeredToConsumeMany (TypeID const &, 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::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::Counters
initializeGlobalCache (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_
 
const std::string processName_
 
const edm::InputTag theTriggerResultsLabel_
 
const edm::EDGetTokenT
< edm::TriggerResults
tok_trigRes_
 
const std::string trigName_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDFilter< edm::GlobalCache< AlCaIsolatedBunch::Counters > >
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 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
ProducesCollector producesCollector ()
 
- 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 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<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 37 of file AlCaIsolatedBunchSelector.cc.

Constructor & Destructor Documentation

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

Definition at line 67 of file AlCaIsolatedBunchSelector.cc.

References processName_, theTriggerResultsLabel_, and trigName_.

69  : nRun_(0),
70  nAll_(0),
71  nGood_(0),
72  trigName_(iConfig.getParameter<std::string>("triggerName")),
73  processName_(iConfig.getParameter<std::string>("processName")),
74  theTriggerResultsLabel_(iConfig.getParameter<edm::InputTag>("triggerResultLabel")),
75  tok_trigRes_(consumes<edm::TriggerResults>(theTriggerResultsLabel_)) {
76  edm::LogVerbatim("AlCaIsoBunch") << "Input tag for trigger results " << theTriggerResultsLabel_
77  << " with trigger name " << trigName_ << " and process " << processName_
78  << std::endl;
79 }
Log< level::Info, true > LogVerbatim
const edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
const edm::InputTag theTriggerResultsLabel_
AlCaIsolatedBunchSelector::~AlCaIsolatedBunchSelector ( )
override

Definition at line 81 of file AlCaIsolatedBunchSelector.cc.

81 {}

Member Function Documentation

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

Reimplemented from edm::stream::EDFilterBase.

Definition at line 132 of file AlCaIsolatedBunchSelector.cc.

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

132  {
133  bool changed(false);
134  edm::LogVerbatim("AlCaIsoBunch") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init "
135  << hltConfig_.init(iRun, iSetup, processName_, changed) << std::endl;
136 }
Log< level::Info, true > LogVerbatim
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
void AlCaIsolatedBunchSelector::endRun ( edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 138 of file AlCaIsolatedBunchSelector.cc.

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

138  {
139  ++nRun_;
140  edm::LogVerbatim("AlCaIsoBunch") << "endRun[" << nRun_ << "] " << iRun.run() << std::endl;
141 }
Log< level::Info, true > LogVerbatim
void AlCaIsolatedBunchSelector::endStream ( )
overridevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 122 of file AlCaIsolatedBunchSelector.cc.

References nAll_, and nGood_.

122  {
123  globalCache()->nAll_ += nAll_;
124  globalCache()->nGood_ += nGood_;
125 }
void AlCaIsolatedBunchSelector::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 144 of file AlCaIsolatedBunchSelector.cc.

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

144  {
146  desc.add<edm::InputTag>("triggerResultLabel", edm::InputTag("TriggerResults", "", "HLT"));
147  desc.add<std::string>("processName", "HLT");
148  desc.add<std::string>("triggerName", "HLT_HcalIsolatedBunch");
149  descriptions.add("alcaIsolatedBunchSelector", desc);
150 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool AlCaIsolatedBunchSelector::filter ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements edm::stream::EDFilterBase.

Definition at line 88 of file AlCaIsolatedBunchSelector.cc.

References accept(), edm::EventBase::bunchCrossing(), edm::EventID::event(), spr::find(), edm::Event::getHandle(), ValidationMatrix::hlt, edm::EventBase::id(), edm::EventBase::luminosityBlock(), nAll_, nGood_, edm::EventID::run(), tok_trigRes_, edm::TriggerNames::triggerNames(), L1TMuonDQMOffline_cfi::triggerNames, edm::Event::triggerNames(), triggerResults, and trigName_.

88  {
89  bool accept(false);
90  ++nAll_;
91 #ifdef EDM_ML_DEBUG
92  edm::LogVerbatim("AlCaIsoBunch") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity "
93  << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << std::endl;
94 #endif
95  //Step1: Find if the event passes the chosen trigger
96  auto const& triggerResults = iEvent.getHandle(tok_trigRes_);
97  if (triggerResults.isValid()) {
99  const std::vector<std::string>& triggerNames_ = triggerNames.triggerNames();
100  for (unsigned int iHLT = 0; iHLT < triggerResults->size(); iHLT++) {
101  int hlt = triggerResults->accept(iHLT);
102  if (triggerNames_[iHLT].find(trigName_) != std::string::npos) {
103  if (hlt > 0) {
104  accept = true;
105 #ifdef EDM_ML_DEBUG
106  edm::LogVerbatim("AlCaIsoBunch")
107  << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" << accept << std::endl;
108 #endif
109  break;
110  }
111  }
112  }
113  }
114 
115  // Step 2: Return the acceptance flag
116  if (accept)
117  ++nGood_;
118  return accept;
119 
120 } // AlCaIsolatedBunchSelector::filter
RunNumber_t run() const
Definition: EventID.h:38
Log< level::Info, true > LogVerbatim
EventNumber_t event() const
Definition: EventID.h:40
int bunchCrossing() const
Definition: EventBase.h:64
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
Strings const & triggerNames() const
Definition: TriggerNames.cc:48
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:275
const edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
static std::string const triggerResults
Definition: EdmProvDump.cc:44
edm::EventID id() const
Definition: EventBase.h:59
void AlCaIsolatedBunchSelector::globalEndJob ( const AlCaIsolatedBunch::Counters counters)
static

Definition at line 127 of file AlCaIsolatedBunchSelector.cc.

References AlCaIsolatedBunch::Counters::nAll_, and AlCaIsolatedBunch::Counters::nGood_.

127  {
128  edm::LogVerbatim("AlCaIsoBunch") << "Selects " << count->nGood_ << " in " << count->nAll_ << " events" << std::endl;
129 }
Log< level::Info, true > LogVerbatim
static std::unique_ptr<AlCaIsolatedBunch::Counters> AlCaIsolatedBunchSelector::initializeGlobalCache ( edm::ParameterSet const &  iConfig)
inlinestatic

Definition at line 42 of file AlCaIsolatedBunchSelector.cc.

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

Member Data Documentation

HLTConfigProvider AlCaIsolatedBunchSelector::hltConfig_
private

Definition at line 56 of file AlCaIsolatedBunchSelector.cc.

Referenced by beginRun().

unsigned int AlCaIsolatedBunchSelector::nAll_
private

Definition at line 57 of file AlCaIsolatedBunchSelector.cc.

Referenced by endStream(), and filter().

unsigned int AlCaIsolatedBunchSelector::nGood_
private

Definition at line 57 of file AlCaIsolatedBunchSelector.cc.

Referenced by endStream(), and filter().

unsigned int AlCaIsolatedBunchSelector::nRun_
private

Definition at line 57 of file AlCaIsolatedBunchSelector.cc.

Referenced by beginRun(), and endRun().

const std::string AlCaIsolatedBunchSelector::processName_
private

Definition at line 59 of file AlCaIsolatedBunchSelector.cc.

Referenced by AlCaIsolatedBunchSelector(), and beginRun().

const edm::InputTag AlCaIsolatedBunchSelector::theTriggerResultsLabel_
private

Definition at line 60 of file AlCaIsolatedBunchSelector.cc.

Referenced by AlCaIsolatedBunchSelector().

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

Definition at line 61 of file AlCaIsolatedBunchSelector.cc.

Referenced by filter().

const std::string AlCaIsolatedBunchSelector::trigName_
private

Definition at line 58 of file AlCaIsolatedBunchSelector.cc.

Referenced by AlCaIsolatedBunchSelector(), and filter().