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
HSCParticleSelector Class Reference
Inheritance diagram for HSCParticleSelector:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HSCParticleSelector (const edm::ParameterSet &)
 
 ~HSCParticleSelector ()
 
- 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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

bool Filter_
 
std::vector< CandidateSelector * > Selectors
 
edm::EDGetTokenT
< susybsm::HSCParticleCollection
sourceToken_
 

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

Definition at line 16 of file HSCParticleSelector.cc.

Constructor & Destructor Documentation

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

Definition at line 34 of file HSCParticleSelector.cc.

References Filter_, edm::ParameterSet::getParameter(), i, Selectors, and sourceToken_.

35 {
36  // What is being produced
37  produces<susybsm::HSCParticleCollection >();
38 
39  // Input products
40  sourceToken_ = consumes<susybsm::HSCParticleCollection>(iConfig.getParameter<edm::InputTag> ("source"));
41  Filter_ = iConfig.getParameter<bool> ("filter");
42 
43  // Load all the selections
44  std::vector<edm::ParameterSet> SelectionParameters = iConfig.getParameter<std::vector<edm::ParameterSet> >("SelectionParameters");
45  for(unsigned int i=0;i<SelectionParameters.size();i++){
46  Selectors.push_back(new CandidateSelector(SelectionParameters[i]) );
47  }
48 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< susybsm::HSCParticleCollection > sourceToken_
std::vector< CandidateSelector * > Selectors
HSCParticleSelector::~HSCParticleSelector ( )

Definition at line 51 of file HSCParticleSelector.cc.

51  {
52 }

Member Function Documentation

void HSCParticleSelector::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 55 of file HSCParticleSelector.cc.

55  {
56 }
void HSCParticleSelector::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 59 of file HSCParticleSelector.cc.

59  {
60 }
bool HSCParticleSelector::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDFilter.

Definition at line 63 of file HSCParticleSelector.cc.

References Filter_, edm::Event::getByToken(), i, convertSQLitetoXML_cfg::output, edm::Handle< T >::product(), edm::Event::put(), mps_fire::result, Selectors, popcon_last_value_cfg::Source, and sourceToken_.

64 {
65  // Source Collection
67  if (!iEvent.getByToken(sourceToken_, SourceHandle)) {
68  edm::LogError("") << ">>> HSCParticleCollection does not exist !!!";
69  return false;
70  }
72 
73 
74  // Output Collection
76  std::auto_ptr<susybsm::HSCParticleCollection> result(output);
77 
78  // cleanup the collection based on the input selection
79  for(susybsm::HSCParticleCollection::iterator hscpcandidate = Source.begin(); hscpcandidate < Source.end(); ++hscpcandidate){
80  bool decision = false;
81  for(unsigned int i=0;i<Selectors.size();i++){decision |= Selectors[i]->isSelected(*hscpcandidate);}
82  if(decision){
83  susybsm::HSCParticle* newhscp = new susybsm::HSCParticle(*hscpcandidate);
84  output->push_back(*newhscp);
85  }
86  }
87 
88  bool filterResult = !Filter_ || (Filter_ && output->size()>=1);
89 
90  iEvent.put(result);
91 
92  return filterResult;
93 }
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
tuple result
Definition: mps_fire.py:84
std::vector< HSCParticle > HSCParticleCollection
Definition: HSCParticle.h:94
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
edm::EDGetTokenT< susybsm::HSCParticleCollection > sourceToken_
T const * product() const
Definition: Handle.h:81
std::vector< CandidateSelector * > Selectors

Member Data Documentation

bool HSCParticleSelector::Filter_
private

Definition at line 28 of file HSCParticleSelector.cc.

Referenced by filter(), and HSCParticleSelector().

std::vector<CandidateSelector*> HSCParticleSelector::Selectors
private

Definition at line 29 of file HSCParticleSelector.cc.

Referenced by filter(), and HSCParticleSelector().

edm::EDGetTokenT<susybsm::HSCParticleCollection> HSCParticleSelector::sourceToken_
private

Definition at line 26 of file HSCParticleSelector.cc.

Referenced by filter(), and HSCParticleSelector().