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
 
- Public Member Functions inherited from edm::stream::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~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)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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::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 38 of file AlCaIsolatedBunchSelector.cc.

Constructor & Destructor Documentation

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

Definition at line 68 of file AlCaIsolatedBunchSelector.cc.

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

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

Definition at line 84 of file AlCaIsolatedBunchSelector.cc.

84 {}

Member Function Documentation

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

Reimplemented from edm::stream::EDFilterBase.

Definition at line 141 of file AlCaIsolatedBunchSelector.cc.

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

141  {
142  bool changed(false);
143  edm::LogInfo("AlCaIsoBunch") << "Run[" << nRun_ << "] " << iRun.run()
144  << " hltconfig.init "
145  << hltConfig_.init(iRun,iSetup,processName_,changed)
146  << std::endl;
147 }
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 149 of file AlCaIsolatedBunchSelector.cc.

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

149  {
150  ++nRun_;
151  edm::LogInfo("AlCaIsoBunch") << "endRun[" << nRun_ << "] " << iRun.run()
152  << std::endl;
153 }
void AlCaIsolatedBunchSelector::endStream ( )
overridevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 129 of file AlCaIsolatedBunchSelector.cc.

References nAll_, and nGood_.

129  {
130  globalCache()->nAll_ += nAll_;
131  globalCache()->nGood_ += nGood_;
132 }
void AlCaIsolatedBunchSelector::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 156 of file AlCaIsolatedBunchSelector.cc.

References edm::ConfigurationDescriptions::addDefault(), DEFINE_FWK_MODULE, and edm::ParameterSetDescription::setUnknown().

156  {
157  //The following says we do not know what parameters are allowed so do no validation
158  // Please change this to state exactly what you do use, even if it is no parameters
160  desc.setUnknown();
161  descriptions.addDefault(desc);
162 }
void addDefault(ParameterSetDescription const &psetDescription)
bool AlCaIsolatedBunchSelector::filter ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements edm::stream::EDFilterBase.

Definition at line 91 of file AlCaIsolatedBunchSelector.cc.

References accept(), edm::HLTGlobalStatus::accept(), edm::EventBase::bunchCrossing(), edm::EventID::event(), spr::find(), edm::Event::getByToken(), edm::EventBase::id(), edm::HandleBase::isValid(), edm::EventBase::luminosityBlock(), nAll_, nGood_, edm::EventID::run(), edm::HLTGlobalStatus::size(), tok_trigRes_, edm::TriggerNames::triggerNames(), edm::Event::triggerNames(), triggerResults, and trigName_.

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

92  {
93  bool accept(false);
94  ++nAll_;
95 #ifdef DebugLog
96  edm::LogInfo("AlCaIsoBunch") << "Run " << iEvent.id().run() << " Event "
97  << iEvent.id().event() << " Luminosity "
98  << iEvent.luminosityBlock() << " Bunch "
99  << iEvent.bunchCrossing() << std::endl;
100 #endif
101  //Step1: Find if the event passes the chosen trigger
103  iEvent.getByToken(tok_trigRes_, triggerResults);
104  if (triggerResults.isValid()) {
105  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
106  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
107  for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
108  int hlt = triggerResults->accept(iHLT);
109  if (triggerNames_[iHLT].find(trigName_)!=std::string::npos) {
110  if (hlt > 0) {
111  accept = true;
112 #ifdef DebugLog
113  edm::LogInfo("AlCaIsoBunch") << triggerNames_[iHLT]
114  << " has got HLT flag " << hlt
115  << ":" << accept << std::endl;
116 #endif
117  break;
118  }
119  }
120  }
121  }
122 
123  // Step 2: Return the acceptance flag
124  if (accept) ++nGood_;
125  return accept;
126 
127 } // AlCaIsolatedBunchSelector::filter
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
bool accept() const
Has at least one path accepted the event?
int bunchCrossing() const
Definition: EventBase.h:66
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
unsigned int size() const
Get number of paths stored.
static std::string const triggerResults
Definition: EdmProvDump.cc:41
bool isValid() const
Definition: HandleBase.h:74
edm::EventID id() const
Definition: EventBase.h:60
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:272
void AlCaIsolatedBunchSelector::globalEndJob ( const AlCaIsolatedBunch::Counters counters)
static

Definition at line 134 of file AlCaIsolatedBunchSelector.cc.

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

134  {
135  edm::LogInfo("AlCaIsoBunch") << "Selects " << count->nGood_ << " in "
136  << count->nAll_ << " events" << std::endl;
137 }
static std::unique_ptr<AlCaIsolatedBunch::Counters> AlCaIsolatedBunchSelector::initializeGlobalCache ( edm::ParameterSet const &  iConfig)
inlinestatic

Definition at line 43 of file AlCaIsolatedBunchSelector.cc.

References Ecal2004TBTDCRanges_v1_cff::endRun, and ALCARECOTkAlBeamHalo_cff::filter.

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

Member Data Documentation

HLTConfigProvider AlCaIsolatedBunchSelector::hltConfig_
private

Definition at line 57 of file AlCaIsolatedBunchSelector.cc.

Referenced by beginRun().

unsigned int AlCaIsolatedBunchSelector::nAll_
private

Definition at line 61 of file AlCaIsolatedBunchSelector.cc.

Referenced by endStream(), and filter().

unsigned int AlCaIsolatedBunchSelector::nGood_
private

Definition at line 61 of file AlCaIsolatedBunchSelector.cc.

Referenced by endStream(), and filter().

unsigned int AlCaIsolatedBunchSelector::nRun_
private

Definition at line 61 of file AlCaIsolatedBunchSelector.cc.

Referenced by beginRun(), and endRun().

std::string AlCaIsolatedBunchSelector::processName_
private

Definition at line 60 of file AlCaIsolatedBunchSelector.cc.

Referenced by AlCaIsolatedBunchSelector(), and beginRun().

edm::InputTag AlCaIsolatedBunchSelector::theTriggerResultsLabel_
private

Definition at line 59 of file AlCaIsolatedBunchSelector.cc.

Referenced by AlCaIsolatedBunchSelector().

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

Definition at line 62 of file AlCaIsolatedBunchSelector.cc.

Referenced by AlCaIsolatedBunchSelector(), and filter().

std::string AlCaIsolatedBunchSelector::trigName_
private

Definition at line 58 of file AlCaIsolatedBunchSelector.cc.

Referenced by AlCaIsolatedBunchSelector(), and filter().