CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
JetConstituentSelector< T, C > Class Template Reference
Inheritance diagram for JetConstituentSelector< T, C >:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

using ConstituentsOutput = C
 
using JetsOutput = std::vector< T >
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 JetConstituentSelector (edm::ParameterSet const &params)
 
void produce (edm::Event &iEvent, edm::EventSetup const &iSetup) override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

StringCutObjectSelector< T > const selector_
 
edm::EDGetTokenT< edm::View< T > > const srcToken_
 

Additional Inherited Members

- 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

template<class T, typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
class JetConstituentSelector< T, C >

Definition at line 30 of file JetConstituentSelector.cc.

Member Typedef Documentation

template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
using JetConstituentSelector< T, C >::ConstituentsOutput = C

Definition at line 34 of file JetConstituentSelector.cc.

template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
using JetConstituentSelector< T, C >::JetsOutput = std::vector<T>

Definition at line 33 of file JetConstituentSelector.cc.

Constructor & Destructor Documentation

template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
JetConstituentSelector< T, C >::JetConstituentSelector ( edm::ParameterSet const &  params)
inline

Definition at line 36 of file JetConstituentSelector.cc.

References edm::ParameterSet::getParameter(), JetConstituentSelector< T, C >::selector_, and AlCaHLTBitMon_QueryRunRegistry::string.

36  :
37  srcToken_{consumes<edm::View<T>>(params.getParameter<edm::InputTag>("src"))},
38  selector_{params.getParameter<std::string>("cut")}
39  {
40  produces<JetsOutput>();
41  produces<ConstituentsOutput>("constituents");
42  }
StringCutObjectSelector< T > const selector_
edm::EDGetTokenT< edm::View< T > > const srcToken_

Member Function Documentation

template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
static void JetConstituentSelector< T, C >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 44 of file JetConstituentSelector.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and AlCaHLTBitMon_QueryRunRegistry::string.

45  {
47  desc.add<edm::InputTag>("src")->setComment("InputTag used for retrieving jets in event.");
48  desc.add<std::string>("cut")->setComment("Cut used by which to select jets. For example:\n"
49  " \"pt > 100.0 && abs(rapidity()) < 2.4\".");
50  descriptions.add("JetConsituentSelector", desc);
51  }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
void JetConstituentSelector< T, C >::produce ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
inlineoverridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 53 of file JetConstituentSelector.cc.

References edm::Event::getByToken(), metsig::jet, fwrapper::jets, eostools::move(), edm::Event::put(), JetConstituentSelector< T, C >::selector_, and JetConstituentSelector< T, C >::srcToken_.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

54  {
55  auto jets = std::make_unique<JetsOutput>();
56  auto candsOut = std::make_unique<ConstituentsOutput>();
57 
59  iEvent.getByToken(srcToken_, h_jets);
60 
61  // Now set the Ptrs with the orphan handles.
62  for (auto const& jet : *h_jets) {
63  // Check the selection
64  if (selector_(jet)) {
65  // Add the jets that pass to the output collection
66  jets->push_back(jet);
67  for (unsigned int ida {}; ida < jet.numberOfDaughters(); ++ida) {
68  candsOut->emplace_back(jet.daughterPtr(ida), jet.daughterPtr(ida));
69  }
70  }
71  }
72 
73  iEvent.put(std::move(jets));
74  iEvent.put(std::move(candsOut), "constituents");
75  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
StringCutObjectSelector< T > const selector_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
vector< PseudoJet > jets
edm::EDGetTokenT< edm::View< T > > const srcToken_
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
StringCutObjectSelector<T> const JetConstituentSelector< T, C >::selector_
private
template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
edm::EDGetTokenT<edm::View<T> > const JetConstituentSelector< T, C >::srcToken_
private

Definition at line 78 of file JetConstituentSelector.cc.

Referenced by JetConstituentSelector< T, C >::produce().