CMS 3D CMS Logo

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

#include <Work/HLTFEDSizeFilter/src/HLTFEDSizeFilter.cc>

Inheritance diagram for HLTFEDSizeFilter:
HLTFilter edm::global::EDFilter<> edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTFEDSizeFilter (const edm::ParameterSet &)
 
 ~HLTFEDSizeFilter () override
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module (edm::Event const &) const
 
const std::string * moduleLabel () const
 
int path (edm::Event const &) const
 
const std::string * pathName (edm::Event const &) const
 
std::pair< int, int > pmid (edm::Event const &) const
 
bool saveTags () const
 
 ~HLTFilter () override
 
- Public Member Functions inherited from edm::global::EDFilter<>
 EDFilter ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::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 HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::global::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 

Private Attributes

unsigned int fedStart_
 
unsigned int fedStop_
 
edm::InputTag RawCollection_
 
edm::EDGetTokenT< FEDRawDataCollectionRawCollectionToken_
 
bool requireAllFEDs_
 
unsigned int threshold_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase 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 HLTFEDSizeFilter.cc.

Constructor & Destructor Documentation

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

Definition at line 61 of file HLTFEDSizeFilter.cc.

References fedStart_, fedStop_, edm::ParameterSet::getParameter(), RawCollection_, RawCollectionToken_, requireAllFEDs_, and threshold_.

61  : HLTFilter(iConfig)
62 {
63  threshold_ = iConfig.getParameter<unsigned int>("threshold");
64  RawCollection_ = iConfig.getParameter<edm::InputTag>("rawData");
65  // For a list of FEDs by subdetector, see DataFormats/FEDRawData/src/FEDNumbering.cc
66  fedStart_ = iConfig.getParameter<unsigned int>("firstFED");
67  fedStop_ = iConfig.getParameter<unsigned int>("lastFED");
68  requireAllFEDs_ = iConfig.getParameter<bool>("requireAllFEDs");
69 
70  RawCollectionToken_ = consumes<FEDRawDataCollection>(RawCollection_);
71 }
T getParameter(std::string const &) const
edm::InputTag RawCollection_
edm::EDGetTokenT< FEDRawDataCollection > RawCollectionToken_
unsigned int fedStart_
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
unsigned int threshold_
unsigned int fedStop_
HLTFEDSizeFilter::~HLTFEDSizeFilter ( )
override

Definition at line 74 of file HLTFEDSizeFilter.cc.

75 {
76  // do anything here that needs to be done at desctruction time
77  // (e.g. close files, deallocate resources etc.)
78 }

Member Function Documentation

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

Definition at line 82 of file HLTFEDSizeFilter.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLTFilter::makeHLTFilterDescription().

82  {
85  desc.add<edm::InputTag>("rawData",edm::InputTag("source","",""));
86  desc.add<unsigned int>("threshold",0)->
87  setComment(" # 0 is pass-through, 1 means *FED ispresent*, higher values are just FED size");
88  desc.add<unsigned int>("firstFED",0)->
89  setComment(" # first FED, inclusive");
90  desc.add<unsigned int>("lastFED",39)->
91  setComment(" # last FED, inclusive");
92  desc.add<bool>("requireAllFEDs",false)->
93  setComment(" # if True, *all* FEDs must be above threshold; if False, only *one* is required");
94  descriptions.add("hltFEDSizeFilter",desc);
95 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:29
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool HLTFEDSizeFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overrideprivatevirtual

Implements HLTFilter.

Definition at line 103 of file HLTFEDSizeFilter.cc.

References DEFINE_FWK_MODULE, FEDRawDataCollection::FEDData(), fedStart_, fedStop_, edm::Event::getByToken(), mps_fire::i, RawCollectionToken_, requireAllFEDs_, mps_fire::result, FEDRawData::size(), and threshold_.

103  {
104 
105  // get the RAW data collction
107  iEvent.getByToken(RawCollectionToken_, h_raw);
108  // do NOT handle the case where the collection is not available - let the framework handle the exception
109  const FEDRawDataCollection theRaw = * h_raw;
110 
111  bool result = false;
112 
113  if (not requireAllFEDs_) {
114  // require that *at least one* FED in the given range has size above or equal to the threshold
115  result = false;
116  for (unsigned int i = fedStart_; i <= fedStop_; i++)
117  if (theRaw.FEDData(i).size() >= threshold_) {
118  result = true;
119  break;
120  }
121  } else {
122  // require that *all* FEDs in the given range have size above or equal to the threshold
123  result = true;
124  for (unsigned int i = fedStart_; i <= fedStop_; i++)
125  if (theRaw.FEDData(i).size() < threshold_) {
126  result = false;
127  break;
128  }
129  }
130 
131  return result;
132 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
edm::EDGetTokenT< FEDRawDataCollection > RawCollectionToken_
unsigned int fedStart_
unsigned int threshold_
unsigned int fedStop_

Member Data Documentation

unsigned int HLTFEDSizeFilter::fedStart_
private

Definition at line 53 of file HLTFEDSizeFilter.cc.

Referenced by HLTFEDSizeFilter(), and hltFilter().

unsigned int HLTFEDSizeFilter::fedStop_
private

Definition at line 53 of file HLTFEDSizeFilter.cc.

Referenced by HLTFEDSizeFilter(), and hltFilter().

edm::InputTag HLTFEDSizeFilter::RawCollection_
private

Definition at line 51 of file HLTFEDSizeFilter.cc.

Referenced by HLTFEDSizeFilter().

edm::EDGetTokenT<FEDRawDataCollection> HLTFEDSizeFilter::RawCollectionToken_
private

Definition at line 50 of file HLTFEDSizeFilter.cc.

Referenced by HLTFEDSizeFilter(), and hltFilter().

bool HLTFEDSizeFilter::requireAllFEDs_
private

Definition at line 54 of file HLTFEDSizeFilter.cc.

Referenced by HLTFEDSizeFilter(), and hltFilter().

unsigned int HLTFEDSizeFilter::threshold_
private

Definition at line 52 of file HLTFEDSizeFilter.cc.

Referenced by HLTFEDSizeFilter(), and hltFilter().