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 Attributes
IsTBH4Type Class Reference

#include <RecoTBCalo/IsTBH4Type/src/IsTBH4Type.cc>

Inheritance diagram for IsTBH4Type:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &)
 
 IsTBH4Type (const edm::ParameterSet &)
 
 ~IsTBH4Type ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::string eventHeaderCollection_
 collection of the event header More...
 
std::string eventHeaderProducer_
 producer of the event header More...
 
bool notFound_
 what to return in case no header is found More...
 
std::string typeToFlag_
 type of run to flag More...
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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 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: tag a given type of run

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

Definition at line 36 of file IsTBH4Type.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file IsTBH4Type.cc.

References eventHeaderCollection_, eventHeaderProducer_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), notFound_, AlCaHLTBitMon_QueryRunRegistry::string, and typeToFlag_.

35 {
36  //now do what ever initialization is needed
37  eventHeaderCollection_ = iConfig.getParameter<std::string> ("eventHeaderCollection") ;
38  eventHeaderProducer_ = iConfig.getParameter<std::string> ("eventHeaderProducer") ;
39  typeToFlag_ = iConfig.getParameter<std::string> ("typeToFlag") ;
40  notFound_ = iConfig.getUntrackedParameter<bool> ("ifHeaderNotFound",false) ;
41 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string typeToFlag_
type of run to flag
Definition: IsTBH4Type.h:52
std::string eventHeaderCollection_
collection of the event header
Definition: IsTBH4Type.h:48
bool notFound_
what to return in case no header is found
Definition: IsTBH4Type.h:54
std::string eventHeaderProducer_
producer of the event header
Definition: IsTBH4Type.h:50
IsTBH4Type::~IsTBH4Type ( )

Definition at line 44 of file IsTBH4Type.cc.

45 {
46  // do anything here that needs to be done at desctruction time
47  // (e.g. close files, deallocate resources etc.)
48 }

Member Function Documentation

bool IsTBH4Type::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDFilter.

Definition at line 57 of file IsTBH4Type.cc.

References eventHeaderProducer_, edm::Event::getByLabel(), notFound_, and typeToFlag_.

58 {
59 
60  using namespace edm;
61 
62  Handle<EcalTBEventHeader> pEventHeader ;
63  const EcalTBEventHeader* evtHeader=0 ;
64  iEvent.getByLabel ( eventHeaderProducer_ , pEventHeader ) ;
65  if (!pEventHeader.isValid()) {
66  edm::LogError("IsTBH4Type") << "Event Header collection not found" ;
67  } else {
68  evtHeader = pEventHeader.product () ; // get a ptr to the product
69  }
70 
71  if (!evtHeader) return notFound_ ;
72 // std::cout << "PIETRO " << evtHeader->eventType () << std::endl ;
73 // std::cout << "PIETRO " << (evtHeader->eventType () != typeToFlag_) << std::endl ;
74  if (evtHeader->eventType () != typeToFlag_) return false ;
75 
76  return true;
77 }
std::string typeToFlag_
type of run to flag
Definition: IsTBH4Type.h:52
bool notFound_
what to return in case no header is found
Definition: IsTBH4Type.h:54
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
std::string eventHeaderProducer_
producer of the event header
Definition: IsTBH4Type.h:50

Member Data Documentation

std::string IsTBH4Type::eventHeaderCollection_
private

collection of the event header

Definition at line 48 of file IsTBH4Type.h.

Referenced by IsTBH4Type().

std::string IsTBH4Type::eventHeaderProducer_
private

producer of the event header

Definition at line 50 of file IsTBH4Type.h.

Referenced by filter(), and IsTBH4Type().

bool IsTBH4Type::notFound_
private

what to return in case no header is found

Definition at line 54 of file IsTBH4Type.h.

Referenced by filter(), and IsTBH4Type().

std::string IsTBH4Type::typeToFlag_
private

type of run to flag

Definition at line 52 of file IsTBH4Type.h.

Referenced by filter(), and IsTBH4Type().