CMS 3D CMS Logo

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

Public Member Functions

 AlCaIsolatedBunchFilter (edm::ParameterSet const &, const AlCaIsolatedBunch::Counters *count)
 
void endStream () override
 
bool filter (edm::Event &, edm::EventSetup const &) override
 
 ~AlCaIsolatedBunchFilter () override
 
- Public Member Functions inherited from edm::stream::EDFilter< edm::GlobalCache< AlCaIsolatedBunch::Counters > >
 EDFilter ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
- 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)
 
 ~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
 
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
 
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::vector< std::string > trigIsoBunchNames_
 
std::vector< std::string > trigJetNames_
 

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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 AlCaIsolatedBunchFilter.cc.

Constructor & Destructor Documentation

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

Definition at line 68 of file AlCaIsolatedBunchFilter.cc.

References edm::ParameterSet::getParameter(), gen::k, processName_, AlCaHLTBitMon_QueryRunRegistry::string, theTriggerResultsLabel_, tok_trigRes_, trigIsoBunchNames_, and trigJetNames_.

70  : nRun_(0), nAll_(0), nGood_(0) {
71  //now do what ever initialization is needed
72  trigJetNames_ = iConfig.getParameter<std::vector<std::string> >("triggerJet");
73  trigIsoBunchNames_ = iConfig.getParameter<std::vector<std::string> >("triggerIsoBunch");
74  processName_ = iConfig.getParameter<std::string>("processName");
75  theTriggerResultsLabel_ = iConfig.getParameter<edm::InputTag>("triggerResultLabel");
76 
77  // define tokens for access
78  tok_trigRes_ = consumes<edm::TriggerResults>(theTriggerResultsLabel_);
79 
80  edm::LogInfo("AlCaIsoBunch") << "Input tag for trigger results " << theTriggerResultsLabel_ << " with "
81  << trigIsoBunchNames_.size() << ":" << trigJetNames_.size() << " trigger names and"
82  << " process " << processName_ << std::endl;
83  for (unsigned int k = 0; k < trigIsoBunchNames_.size(); ++k)
84  edm::LogInfo("AlCaIsoBunch") << "Isolated Bunch[" << k << "] " << trigIsoBunchNames_[k] << std::endl;
85  for (unsigned int k = 0; k < trigJetNames_.size(); ++k)
86  edm::LogInfo("AlCaIsoBunch") << "Jet Trigger[" << k << "] " << trigJetNames_[k] << std::endl;
87 }
std::vector< std::string > trigIsoBunchNames_
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
int k[5][pyjets_maxn]
std::vector< std::string > trigJetNames_
AlCaIsolatedBunchFilter::~AlCaIsolatedBunchFilter ( )
override

Definition at line 89 of file AlCaIsolatedBunchFilter.cc.

89 {}

Member Function Documentation

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

Reimplemented from edm::stream::EDFilterBase.

Definition at line 171 of file AlCaIsolatedBunchFilter.cc.

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

171  {
172  bool changed(false);
173  edm::LogInfo("AlCaIsoBunch") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init "
174  << hltConfig_.init(iRun, iSetup, processName_, changed) << std::endl;
175 }
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
void AlCaIsolatedBunchFilter::endRun ( edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 177 of file AlCaIsolatedBunchFilter.cc.

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

177  {
178  ++nRun_;
179  edm::LogInfo("AlCaIsoBunch") << "endRun[" << nRun_ << "] " << iRun.run() << std::endl;
180 }
void AlCaIsolatedBunchFilter::endStream ( )
overridevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 161 of file AlCaIsolatedBunchFilter.cc.

References nAll_, and nGood_.

161  {
162  globalCache()->nAll_ += nAll_;
163  globalCache()->nGood_ += nGood_;
164 }
void AlCaIsolatedBunchFilter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 183 of file AlCaIsolatedBunchFilter.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, and AlCaHLTBitMon_QueryRunRegistry::string.

183  {
185  desc.add<edm::InputTag>("triggerResultLabel", edm::InputTag("TriggerResults", "", "HLT"));
186  desc.add<std::string>("processName", "HLT");
187  std::vector<std::string> isobunch = {"HLT_ZeroBias_IsolatedBunches"};
188  desc.add<std::vector<std::string> >("triggerIsoBunch", isobunch);
189  std::vector<std::string> triggers = {"HLT_AK8PFJet",
190  "HLT_AK8PFHT",
191  "HLT_CaloJet",
192  "HLT_HT",
193  "HLT_JetE",
194  "HLT_PFHT",
195  "HLT_DiPFJet",
196  "HLT_PFJet",
197  "HLT_DiCentralPFJet",
198  "HLT_QuadPFJet",
199  "HLT_L1_TripleJet_VBF",
200  "HLT_QuadJet",
201  "HLT_DoubleJet",
202  "HLT_AK8DiPFJet",
203  "HLT_AK4CaloJet",
204  "HLT_AK4PFJet"};
205  desc.add<std::vector<std::string> >("triggerJet", triggers);
206  descriptions.add("alcaIsolatedBunchFilter", desc);
207 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool AlCaIsolatedBunchFilter::filter ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements edm::stream::EDFilterBase.

Definition at line 96 of file AlCaIsolatedBunchFilter.cc.

References accept(), edm::HLTGlobalStatus::accept(), edm::EventBase::bunchCrossing(), edm::EventID::event(), spr::find(), edm::Event::getByToken(), ValidationMatrix::hlt, mps_fire::i, edm::EventBase::id(), edm::HandleBase::isValid(), metsig::jet, edm::EventBase::luminosityBlock(), nAll_, nGood_, edm::EventID::run(), edm::HLTGlobalStatus::size(), tok_trigRes_, edm::TriggerNames::triggerNames(), edm::Event::triggerNames(), triggerResults, trigIsoBunchNames_, and trigJetNames_.

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().

96  {
97  bool accept(false);
98  ++nAll_;
99 #ifdef DebugLog
100  edm::LogInfo("AlCaIsoBunch") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity "
101  << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << std::endl;
102 #endif
103  //Step1: Find if the event passes one of the chosen triggers
104  if ((trigIsoBunchNames_.empty()) && (trigJetNames_.empty())) {
105  accept = true;
106  } else {
109  iEvent.getByToken(tok_trigRes_, triggerResults);
110  if (triggerResults.isValid()) {
111  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerResults);
112  const std::vector<std::string>& triggerNames_ = triggerNames.triggerNames();
113  bool jet(false), isobunch(false);
114  for (unsigned int iHLT = 0; iHLT < triggerResults->size(); iHLT++) {
115  int hlt = triggerResults->accept(iHLT);
116  if (!jet) {
117  for (unsigned int i = 0; i < trigJetNames_.size(); ++i) {
118  if (triggerNames_[iHLT].find(trigJetNames_[i]) != std::string::npos) {
119  if (hlt > 0)
120  jet = true;
121  if (jet) {
122 #ifdef DebugLog
123  edm::LogInfo("AlCaIsoBunch")
124  << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" << jet << ":" << isobunch << std::endl;
125 #endif
126  break;
127  }
128  }
129  }
130  }
131  if (!isobunch) {
132  for (unsigned int i = 0; i < trigIsoBunchNames_.size(); ++i) {
133  if (triggerNames_[iHLT].find(trigIsoBunchNames_[i]) != std::string::npos) {
134  if (hlt > 0)
135  isobunch = true;
136  if (isobunch) {
137 #ifdef DebugLog
138  edm::LogInfo("AlCaIsoBunch")
139  << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" << jet << ":" << isobunch << std::endl;
140 #endif
141  break;
142  }
143  }
144  }
145  }
146  if (jet && isobunch) {
147  accept = true;
148  break;
149  }
150  }
151  }
152  }
153 
154  // Step 2: Return the acceptance flag
155  if (accept)
156  ++nGood_;
157  return accept;
158 
159 } // AlCaIsolatedBunchFilter::filter
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
std::vector< std::string > trigIsoBunchNames_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
bool accept() const
Has at least one path accepted the event?
int bunchCrossing() const
Definition: EventBase.h:64
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
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:20
unsigned int size() const
Get number of paths stored.
static std::string const triggerResults
Definition: EdmProvDump.cc:45
bool isValid() const
Definition: HandleBase.h:74
edm::EventID id() const
Definition: EventBase.h:59
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:256
std::vector< std::string > trigJetNames_
void AlCaIsolatedBunchFilter::globalEndJob ( const AlCaIsolatedBunch::Counters counters)
static

Definition at line 166 of file AlCaIsolatedBunchFilter.cc.

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

166  {
167  edm::LogInfo("AlCaIsoBunch") << "Selects " << count->nGood_ << " in " << count->nAll_ << " events" << std::endl;
168 }
static std::unique_ptr<AlCaIsolatedBunch::Counters> AlCaIsolatedBunchFilter::initializeGlobalCache ( edm::ParameterSet const &  iConfig)
inlinestatic

Definition at line 43 of file AlCaIsolatedBunchFilter.cc.

References Ecal2004TBTDCRanges_v1_cff::endRun, fillDescriptions(), and ALCARECOTkAlBeamHalo_cff::filter.

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

Member Data Documentation

HLTConfigProvider AlCaIsolatedBunchFilter::hltConfig_
private

Definition at line 57 of file AlCaIsolatedBunchFilter.cc.

Referenced by beginRun().

unsigned int AlCaIsolatedBunchFilter::nAll_
private

Definition at line 61 of file AlCaIsolatedBunchFilter.cc.

Referenced by endStream(), and filter().

unsigned int AlCaIsolatedBunchFilter::nGood_
private

Definition at line 61 of file AlCaIsolatedBunchFilter.cc.

Referenced by endStream(), and filter().

unsigned int AlCaIsolatedBunchFilter::nRun_
private

Definition at line 61 of file AlCaIsolatedBunchFilter.cc.

Referenced by beginRun(), and endRun().

std::string AlCaIsolatedBunchFilter::processName_
private

Definition at line 60 of file AlCaIsolatedBunchFilter.cc.

Referenced by AlCaIsolatedBunchFilter(), and beginRun().

edm::InputTag AlCaIsolatedBunchFilter::theTriggerResultsLabel_
private

Definition at line 59 of file AlCaIsolatedBunchFilter.cc.

Referenced by AlCaIsolatedBunchFilter().

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

Definition at line 62 of file AlCaIsolatedBunchFilter.cc.

Referenced by AlCaIsolatedBunchFilter(), and filter().

std::vector<std::string> AlCaIsolatedBunchFilter::trigIsoBunchNames_
private

Definition at line 58 of file AlCaIsolatedBunchFilter.cc.

Referenced by AlCaIsolatedBunchFilter(), and filter().

std::vector<std::string> AlCaIsolatedBunchFilter::trigJetNames_
private

Definition at line 58 of file AlCaIsolatedBunchFilter.cc.

Referenced by AlCaIsolatedBunchFilter(), and filter().