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
BooleanFlagFilter Class Reference

#include <CommonTools/RecoAlgos/plugins/BooleanFlagFilter.cc>

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

Public Member Functions

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

virtual void beginJob () override
 
virtual void endJob () override
 
virtual bool filter (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT< bool > inputToken_
 
bool reverse_
 

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: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 36 of file BooleanFlagFilter.cc.

Constructor & Destructor Documentation

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

Definition at line 67 of file BooleanFlagFilter.cc.

References edm::ParameterSet::getParameter(), inputToken_, and reverse_.

68 {
69  //now do what ever initialization is needed
70  inputToken_ = consumes<bool>(iConfig.getParameter<edm::InputTag>("inputLabel"));
71  reverse_ = iConfig.getParameter<bool>("reverseDecision");
72 }
T getParameter(std::string const &) const
edm::EDGetTokenT< bool > inputToken_
BooleanFlagFilter::~BooleanFlagFilter ( )

Definition at line 75 of file BooleanFlagFilter.cc.

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

Member Function Documentation

void BooleanFlagFilter::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 111 of file BooleanFlagFilter.cc.

112 {
113 }
void BooleanFlagFilter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 117 of file BooleanFlagFilter.cc.

117  {
118 }
bool BooleanFlagFilter::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDFilter.

Definition at line 90 of file BooleanFlagFilter.cc.

References Exception, edm::Event::getByToken(), inputToken_, edm::errors::ProductNotFound, query::result, and reverse_.

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

91 {
92  using namespace edm;
93 
94  Handle<bool> pIn;
95  iEvent.getByToken(inputToken_, pIn);
96  if (!pIn.isValid())
97  {
98  throw edm::Exception(edm::errors::ProductNotFound) << " could not find requested flag\n";
99  return true;
100  }
101 
102  bool result = *pIn;
103  if (reverse_)
104  result = !result;
105 
106  return result;
107 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
tuple result
Definition: query.py:137
edm::EDGetTokenT< bool > inputToken_

Member Data Documentation

edm::EDGetTokenT<bool> BooleanFlagFilter::inputToken_
private

Definition at line 52 of file BooleanFlagFilter.cc.

Referenced by BooleanFlagFilter(), and filter().

bool BooleanFlagFilter::reverse_
private

Definition at line 53 of file BooleanFlagFilter.cc.

Referenced by BooleanFlagFilter(), and filter().