CMS 3D CMS Logo

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

#include <filter/HLTHcalNZSFilter/src/HLTHcalNZSFilter.cc>

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

Public Member Functions

 HLTHcalNZSFilter (const edm::ParameterSet &)
 
 ~HLTHcalNZSFilter () 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

edm::InputTag dataInputTag_
 
edm::EDGetTokenT< FEDRawDataCollectiondataInputToken_
 

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: Filter to select HCAL abort gap events

Implementation: <Notes on="" implementation>="">

Description: Filter to select HCAL non-ZS events

Implementation: <Notes on="" implementation>="">

Definition at line 41 of file HLTHcalNZSFilter.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file HLTHcalNZSFilter.cc.

References dataInputTag_, dataInputToken_, and edm::ParameterSet::getParameter().

44  : HLTFilter(iConfig)
45 {
46  //now do what ever initialization is needed
47 
48  dataInputTag_ = iConfig.getParameter<edm::InputTag>("InputTag") ;
49  dataInputToken_ = consumes<FEDRawDataCollection>(dataInputTag_);
50 }
T getParameter(std::string const &) const
edm::EDGetTokenT< FEDRawDataCollection > dataInputToken_
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
edm::InputTag dataInputTag_
HLTHcalNZSFilter::~HLTHcalNZSFilter ( )
override

Definition at line 53 of file HLTHcalNZSFilter.cc.

54 {
55 
56  // do anything here that needs to be done at desctruction time
57  // (e.g. close files, deallocate resources etc.)
58 
59 }

Member Function Documentation

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

Definition at line 62 of file HLTHcalNZSFilter.cc.

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

62  {
65  desc.add<edm::InputTag>("InputTag",edm::InputTag("source"));
66  descriptions.add("hltHcalNZSFilter",desc);
67 }
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 HLTHcalNZSFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overrideprivatevirtual

Implements HLTFilter.

Definition at line 75 of file HLTHcalNZSFilter.cc.

References FEDRawData::data(), dataInputToken_, DEFINE_FWK_MODULE, funct::false, FEDRawDataCollection::FEDData(), edm::Event::getByToken(), HcalHTRData::getFirmwareFlavor(), HcalDCCHeader::getSpigotData(), HcalDCCHeader::getSpigotPresent(), mps_fire::i, edm::EventBase::isRealData(), HcalHTRData::isUnsuppressed(), FEDNumbering::MAXHCALFEDID, FEDNumbering::MINHCALFEDID, matplotRender::rawdata, FEDRawData::size(), HcalDCCHeader::SPIGOT_COUNT, and funct::true.

76 {
77  using namespace edm;
78 
79  // MC treatment for this filter(NZS not fully emulated in HTR for MC)
80  if (!iEvent.isRealData()) return false;
81 
83  iEvent.getByToken(dataInputToken_,rawdata);
84 
85  int nFEDs = 0 ; int nNZSfed = 0 ; int nZSfed = 0 ;
87  const FEDRawData& fedData = rawdata->FEDData(i) ;
88  if ( fedData.size() < 24 ) continue ;
89  nFEDs++ ;
90 
91  // Check for Zero-suppression
92  HcalHTRData htr;
93  const HcalDCCHeader* dccHeader = (const HcalDCCHeader*)(fedData.data()) ;
94  int nZS = 0 ; int nUS = 0 ; int nSpigot = 0 ;
95  for (int spigot=0; spigot<HcalDCCHeader::SPIGOT_COUNT; spigot++) {
96  if (!dccHeader->getSpigotPresent(spigot)) continue;
97 
98  // Load the given decoder with the pointer and length from this spigot.
99  dccHeader->getSpigotData(spigot,htr, fedData.size());
100  if ((htr.getFirmwareFlavor()&0xE0)==0x80) continue ; // This is TTP data
101 
102  nSpigot++ ;
103  // check min length, correct wordcount, empty event, or total length if histo event.
104  if ( htr.isUnsuppressed() ) nUS++ ;
105  else nZS++ ;
106  }
107 
108  if ( nUS == nSpigot ) nNZSfed++ ;
109  else {
110  nZSfed++ ;
111  if ( nUS > 0 ) LogWarning("HLTHcalNZSFilter") << "Mixture of ZS(" << nZS
112  << ") and NZS(" << nUS
113  << ") spigots in FED " << i ;
114  }
115  }
116 
117  if ( (nNZSfed == nFEDs) && (nFEDs > 0) ) { return true ; }
118  else {
119  if ( nNZSfed > 0 ) LogWarning("HLTHcalNZSFilter") << "Mixture of ZS(" << nZSfed
120  << ") and NZS(" << nNZSfed
121  << ") FEDs in this event" ;
122  return false ;
123  }
124 
125 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< FEDRawDataCollection > dataInputToken_
int getSpigotData(int nspigot, HcalHTRData &decodeTool, int validSize) const
bool isRealData() const
Definition: EventBase.h:62
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
bool isUnsuppressed() const
Is this event an unsuppresed event?
Definition: HcalHTRData.cc:354
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
bool getSpigotPresent(unsigned int nspigot) const
Read the "PRESENT" bit for this spigot.
int getFirmwareFlavor() const
Get the HTR firmware flavor.
Definition: HcalHTRData.cc:410
static const int SPIGOT_COUNT
Definition: HcalDCCHeader.h:19
HLT enums.
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28

Member Data Documentation

edm::InputTag HLTHcalNZSFilter::dataInputTag_
private

Definition at line 53 of file HLTHcalNZSFilter.h.

Referenced by HLTHcalNZSFilter().

edm::EDGetTokenT<FEDRawDataCollection> HLTHcalNZSFilter::dataInputToken_
private

Definition at line 52 of file HLTHcalNZSFilter.h.

Referenced by hltFilter(), and HLTHcalNZSFilter().