CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
TriggerRulePrefireVetoFilter Class Reference

#include <L1Trigger/PrefireAnalysis/plugins/TriggerRulePrefireVetoFilter.cc>

Inheritance diagram for TriggerRulePrefireVetoFilter:
edm::stream::EDFilter<> edm::stream::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TriggerRulePrefireVetoFilter (const edm::ParameterSet &)
 
 ~TriggerRulePrefireVetoFilter () override
 
- Public Member Functions inherited from edm::stream::EDFilter<>
 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 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 beginStream (edm::StreamID) override
 
void endStream () override
 
bool filter (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT< TCDSRecordtcdsRecordToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDFilter<>
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

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 40 of file TriggerRulePrefireVetoFilter.cc.

Constructor & Destructor Documentation

TriggerRulePrefireVetoFilter::TriggerRulePrefireVetoFilter ( const edm::ParameterSet iConfig)
explicit

Definition at line 72 of file TriggerRulePrefireVetoFilter.cc.

72  :
73  tcdsRecordToken_(consumes<TCDSRecord>(iConfig.getParameter<edm::InputTag>("tcdsRecordLabel")))
74 {
75  //now do what ever initialization is needed
76 
77 }
edm::EDGetTokenT< TCDSRecord > tcdsRecordToken_
T getParameter(std::string const &) const
TriggerRulePrefireVetoFilter::~TriggerRulePrefireVetoFilter ( )
override

Definition at line 80 of file TriggerRulePrefireVetoFilter.cc.

81 {
82 
83  // do anything here that needs to be done at destruction time
84  // (e.g. close files, deallocate resources etc.)
85 
86 }

Member Function Documentation

void TriggerRulePrefireVetoFilter::beginStream ( edm::StreamID  )
overrideprivatevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 142 of file TriggerRulePrefireVetoFilter.cc.

143 {
144 }
void TriggerRulePrefireVetoFilter::endStream ( )
overrideprivatevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 148 of file TriggerRulePrefireVetoFilter.cc.

148  {
149 }
void TriggerRulePrefireVetoFilter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 185 of file TriggerRulePrefireVetoFilter.cc.

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

185  {
186  //The following says we do not know what parameters are allowed so do no validation
187  // Please change this to state exactly what you do use, even if it is no parameters
189  desc.setUnknown();
190  descriptions.addDefault(desc);
191 }
void addDefault(ParameterSetDescription const &psetDescription)
bool TriggerRulePrefireVetoFilter::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 95 of file TriggerRulePrefireVetoFilter.cc.

References edm::Event::getByToken(), edm::Handle< T >::product(), and tcdsRecordToken_.

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  edm::Handle<TCDSRecord> tcdsRecordH;
98  iEvent.getByToken(tcdsRecordToken_, tcdsRecordH);
99  const auto& tcdsRecord = *tcdsRecordH.product();
100 
101  uint64_t thisEvent = (tcdsRecord.getBXID()-1) + tcdsRecord.getOrbitNr()*3564ull;
102 
103  std::vector<uint64_t> eventHistory;
104  for (auto&& l1a : tcdsRecord.getFullL1aHistory()) {
105  eventHistory.push_back(thisEvent - ((l1a.getBXID()-1) + l1a.getOrbitNr()*3564ull));
106  }
107 
108  // should be 16 according to TCDSRecord.h, we only care about the last 4
109  if ( eventHistory.size() < 4 ) {
110  edm::LogError("TriggerRulePrefireVetoFilter") << "Unexpectedly small L1A history from TCDSRecord";
111  }
112 
113  // No more than 1 L1A in 3 BX
114  if ( eventHistory[0] < 3ull ) {
115  edm::LogError("TriggerRulePrefireVetoFilter") << "Found an L1A in an impossible location?! (1 in 3)";
116  }
117  if ( eventHistory[0] == 3ull ) return true;
118 
119  // No more than 2 L1As in 25 BX
120  if ( eventHistory[0] < 25ull and eventHistory[1] < 25ull ) {
121  edm::LogError("TriggerRulePrefireVetoFilter") << "Found an L1A in an impossible location?! (2 in 25)";
122  }
123  if ( eventHistory[0] < 25ull and eventHistory[1] == 25ull ) return true;
124 
125  // No more than 3 L1As in 100 BX
126  if ( eventHistory[0] < 100ull and eventHistory[1] < 100ull and eventHistory[2] < 100ull ) {
127  edm::LogError("TriggerRulePrefireVetoFilter") << "Found an L1A in an impossible location?! (3 in 100)";
128  }
129  if ( eventHistory[0] < 100ull and eventHistory[1] < 100ull and eventHistory[2] == 100ull ) return true;
130 
131  // No more than 4 L1As in 240 BX
132  if ( eventHistory[0] < 240ull and eventHistory[1] < 240ull and eventHistory[2] < 240ull and eventHistory[3] < 240ull ) {
133  edm::LogError("TriggerRulePrefireVetoFilter") << "Found an L1A in an impossible location?! (4 in 240)";
134  }
135  if ( eventHistory[0] < 240ull and eventHistory[1] < 240ull and eventHistory[2] < 240ull and eventHistory[3] == 240ull ) return true;
136 
137  return false;
138 }
edm::EDGetTokenT< TCDSRecord > tcdsRecordToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
T const * product() const
Definition: Handle.h:74
unsigned long long uint64_t
Definition: Time.h:15

Member Data Documentation

edm::EDGetTokenT<TCDSRecord> TriggerRulePrefireVetoFilter::tcdsRecordToken_
private

Definition at line 58 of file TriggerRulePrefireVetoFilter.cc.

Referenced by filter().