CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HLTHcalNZSFilter Class Reference

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

Inheritance diagram for HLTHcalNZSFilter:
HLTFilter edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 HLTHcalNZSFilter (const edm::ParameterSet &)
 
virtual ~HLTHcalNZSFilter ()
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module () const
 
const std::string * moduleLabel () const
 
int path () const
 
const std::string * pathName () const
 
std::pair< int, int > pmid () const
 
bool saveTags () const
 
virtual ~HLTFilter ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

virtual void beginJob (void)
 
virtual void endJob (void)
 
virtual bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct)
 

Private Attributes

edm::InputTag dataInputTag_
 
int eventsNZS_
 
bool summary_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Description: Filter to select HCAL non-ZS events

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

Description: Filter to select HCAL abort gap events

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

Definition at line 35 of file HLTHcalNZSFilter.h.

Constructor & Destructor Documentation

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

Definition at line 47 of file HLTHcalNZSFilter.cc.

References dataInputTag_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and summary_.

47  : HLTFilter(iConfig)
48 {
49  //now do what ever initialization is needed
50 
51  dataInputTag_ = iConfig.getParameter<edm::InputTag>("InputTag") ;
52  summary_ = iConfig.getUntrackedParameter<bool>("FilterSummary",false) ;
53 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:18
edm::InputTag dataInputTag_
HLTHcalNZSFilter::~HLTHcalNZSFilter ( )
virtual

Definition at line 56 of file HLTHcalNZSFilter.cc.

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

Member Function Documentation

void HLTHcalNZSFilter::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 125 of file HLTHcalNZSFilter.cc.

References eventsNZS_.

126 {
127  eventsNZS_ = 0 ;
128 }
void HLTHcalNZSFilter::endJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 132 of file HLTHcalNZSFilter.cc.

References eventsNZS_, and summary_.

132  {
133  if ( summary_ ) edm::LogWarning("HLTHcalNZSFilter") << "Kept " << eventsNZS_ << " non-ZS events" ;
134 }
bool HLTHcalNZSFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
)
privatevirtual

Implements HLTFilter.

Definition at line 71 of file HLTHcalNZSFilter.cc.

References FEDRawData::data(), dataInputTag_, eventsNZS_, funct::false, edm::Event::getByLabel(), HcalHTRData::getFirmwareFlavor(), HcalDCCHeader::getSpigotData(), HcalDCCHeader::getSpigotPresent(), i, edm::EventBase::isRealData(), HcalHTRData::isUnsuppressed(), FEDNumbering::MAXHCALFEDID, FEDNumbering::MINHCALFEDID, lumiPlot::rawdata, FEDRawData::size(), HcalDCCHeader::SPIGOT_COUNT, and funct::true.

72 {
73  using namespace edm;
74 
75  // MC treatment for this hltFilter(NZS not fully emulated in HTR for MC, trigger::TriggerFilterObjectWithRefs & filterproduct)
76  if (!iEvent.isRealData()) return false;
77 
80 
81  int nFEDs = 0 ; int nNZSfed = 0 ; int nZSfed = 0 ;
83  const FEDRawData& fedData = rawdata->FEDData(i) ;
84  if ( fedData.size() < 24 ) continue ;
85  nFEDs++ ;
86 
87  // Check for Zero-suppression
88  HcalHTRData htr;
89  const HcalDCCHeader* dccHeader = (const HcalDCCHeader*)(fedData.data()) ;
90  int nZS = 0 ; int nUS = 0 ; int nSpigot = 0 ;
91  for (int spigot=0; spigot<HcalDCCHeader::SPIGOT_COUNT; spigot++) {
92  if (!dccHeader->getSpigotPresent(spigot)) continue;
93 
94  // Load the given decoder with the pointer and length from this spigot.
95  dccHeader->getSpigotData(spigot,htr, fedData.size());
96  if ((htr.getFirmwareFlavor()&0xE0)==0x80) continue ; // This is TTP data
97 
98  nSpigot++ ;
99  // check min length, correct wordcount, empty event, or total length if histo event.
100  if ( htr.isUnsuppressed() ) nUS++ ;
101  else nZS++ ;
102  }
103 
104  if ( nUS == nSpigot ) nNZSfed++ ;
105  else {
106  nZSfed++ ;
107  if ( nUS > 0 ) LogWarning("HLTHcalNZSFilter") << "Mixture of ZS(" << nZS
108  << ") and NZS(" << nUS
109  << ") spigots in FED " << i ;
110  }
111  }
112 
113  if ( (nNZSfed == nFEDs) && (nFEDs > 0) ) { eventsNZS_++ ; return true ; }
114  else {
115  if ( nNZSfed > 0 ) LogWarning("HLTHcalNZSFilter") << "Mixture of ZS(" << nZSfed
116  << ") and NZS(" << nNZSfed
117  << ") FEDs in this event" ;
118  return false ;
119  }
120 
121 }
int i
Definition: DBlmapReader.cc:9
int getSpigotData(int nspigot, HcalHTRData &decodeTool, int validSize) const
bool isRealData() const
Definition: EventBase.h:60
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
bool isUnsuppressed() const
Is this event an unsuppresed event?
Definition: HcalHTRData.cc:355
bool getSpigotPresent(unsigned int nspigot) const
Read the &quot;PRESENT&quot; bit for this spigot.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
int getFirmwareFlavor() const
Get the HTR firmware flavor.
Definition: HcalHTRData.cc:411
static const int SPIGOT_COUNT
Definition: HcalDCCHeader.h:21
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
dictionary rawdata
Definition: lumiPlot.py:393
edm::InputTag dataInputTag_

Member Data Documentation

edm::InputTag HLTHcalNZSFilter::dataInputTag_
private

Definition at line 47 of file HLTHcalNZSFilter.h.

Referenced by hltFilter(), and HLTHcalNZSFilter().

int HLTHcalNZSFilter::eventsNZS_
private

Definition at line 49 of file HLTHcalNZSFilter.h.

Referenced by beginJob(), endJob(), and hltFilter().

bool HLTHcalNZSFilter::summary_
private

Definition at line 48 of file HLTHcalNZSFilter.h.

Referenced by endJob(), and HLTHcalNZSFilter().