CMS 3D CMS Logo

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

bool filter (edm::Event &, const edm::EventSetup &) override
 
 IsTBH4Type (const edm::ParameterSet &)
 
 ~IsTBH4Type () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () 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)
 

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
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
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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: 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 ( )
override

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 
)
override

Definition at line 57 of file IsTBH4Type.cc.

References eventHeaderProducer_, EcalTBEventHeader::eventType(), edm::Event::getByLabel(), edm::HandleBase::isValid(), notFound_, nullptr, edm::Handle< T >::product(), and typeToFlag_.

58 {
59 
60  using namespace edm;
61 
62  Handle<EcalTBEventHeader> pEventHeader ;
63  const EcalTBEventHeader* evtHeader=nullptr ;
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
#define nullptr
std::string eventType() const
bool notFound_
what to return in case no header is found
Definition: IsTBH4Type.h:54
bool isValid() const
Definition: HandleBase.h:74
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
std::string eventHeaderProducer_
producer of the event header
Definition: IsTBH4Type.h:50
T const * product() const
Definition: Handle.h:74
HLT enums.

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().