CMS 3D CMS Logo

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 () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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 Member Functions

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

Private Attributes

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

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::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 16 of file HSCParticleSelector.cc.

Constructor & Destructor Documentation

◆ HSCParticleSelector()

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

Definition at line 33 of file HSCParticleSelector.cc.

33  {
34  // What is being produced
35  produces<susybsm::HSCParticleCollection>();
36 
37  // Input products
38  sourceToken_ = consumes<susybsm::HSCParticleCollection>(iConfig.getParameter<edm::InputTag>("source"));
39  Filter_ = iConfig.getParameter<bool>("filter");
40 
41  // Load all the selections
42  std::vector<edm::ParameterSet> SelectionParameters =
43  iConfig.getParameter<std::vector<edm::ParameterSet> >("SelectionParameters");
44  for (unsigned int i = 0; i < SelectionParameters.size(); i++) {
46  }
47 }

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

◆ ~HSCParticleSelector()

HSCParticleSelector::~HSCParticleSelector ( )
override

Definition at line 50 of file HSCParticleSelector.cc.

50 {}

Member Function Documentation

◆ beginJob()

void HSCParticleSelector::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 53 of file HSCParticleSelector.cc.

53 {}

◆ endJob()

void HSCParticleSelector::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 56 of file HSCParticleSelector.cc.

56 {}

◆ filter()

bool HSCParticleSelector::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDFilter.

Definition at line 59 of file HSCParticleSelector.cc.

59  {
60  // Source Collection
62  if (!iEvent.getByToken(sourceToken_, SourceHandle)) {
63  edm::LogError("") << ">>> HSCParticleCollection does not exist !!!";
64  return false;
65  }
67 
68  // Output Collection
70  std::unique_ptr<susybsm::HSCParticleCollection> result(output);
71 
72  // cleanup the collection based on the input selection
73  for (susybsm::HSCParticleCollection::iterator hscpcandidate = Source.begin(); hscpcandidate < Source.end();
74  ++hscpcandidate) {
75  bool decision = false;
76  for (unsigned int i = 0; i < Selectors.size(); i++) {
77  decision |= Selectors[i]->isSelected(*hscpcandidate);
78  }
79  if (decision) {
80  susybsm::HSCParticle* newhscp = new susybsm::HSCParticle(*hscpcandidate);
81  output->push_back(*newhscp);
82  }
83  }
84 
85  bool filterResult = !Filter_ || (Filter_ && !output->empty());
86 
87  iEvent.put(std::move(result));
88 
89  return filterResult;
90 }

References Filter_, mps_fire::i, iEvent, eostools::move(), convertSQLitetoXML_cfg::output, edm::Handle< T >::product(), mps_fire::result, Selectors, CollectionTags_cfi::Source, and sourceToken_.

Member Data Documentation

◆ Filter_

bool HSCParticleSelector::Filter_
private

Definition at line 28 of file HSCParticleSelector.cc.

Referenced by filter(), and HSCParticleSelector().

◆ Selectors

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

Definition at line 29 of file HSCParticleSelector.cc.

Referenced by filter(), and HSCParticleSelector().

◆ sourceToken_

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

Definition at line 26 of file HSCParticleSelector.cc.

Referenced by filter(), and HSCParticleSelector().

susybsm::HSCParticle
Definition: HSCParticle.h:42
mps_fire.i
i
Definition: mps_fire.py:355
edm::Handle::product
T const * product() const
Definition: Handle.h:70
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
susybsm::HSCParticleCollection
std::vector< HSCParticle > HSCParticleCollection
Definition: HSCParticle.h:86
edm::Handle
Definition: AssociativeIterator.h:50
HSCParticleSelector::sourceToken_
edm::EDGetTokenT< susybsm::HSCParticleCollection > sourceToken_
Definition: HSCParticleSelector.cc:26
HSCParticleProducer_cff.SelectionParameters
SelectionParameters
Definition: HSCParticleProducer_cff.py:89
edm::LogError
Definition: MessageLogger.h:183
iEvent
int iEvent
Definition: GenABIO.cc:224
HSCParticleSelector::Selectors
std::vector< CandidateSelector * > Selectors
Definition: HSCParticleSelector.cc:29
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CandidateSelector
Definition: CandidateSelector.h:18
eostools.move
def move(src, dest)
Definition: eostools.py:511
mps_fire.result
result
Definition: mps_fire.py:303
HSCParticleSelector::Filter_
bool Filter_
Definition: HSCParticleSelector.cc:28
edm::InputTag
Definition: InputTag.h:15
CollectionTags_cfi.Source
Source
Definition: CollectionTags_cfi.py:11