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

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
 
 ~EDProducerBase () 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)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
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)
 
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 31 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 35 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 34 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 37 of file JetConstituentSelector.cc.

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

37  :
38  srcToken_{consumes<edm::View<T>>(params.getParameter<edm::InputTag>("src"))},
39  selector_{params.getParameter<std::string>("cut")}
40  {
41  produces<JetsOutput>();
42  produces<ConstituentsOutput>("constituents");
43  }
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 45 of file JetConstituentSelector.cc.

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

46  {
48  desc.add<edm::InputTag>("src")->setComment("InputTag used for retrieving jets in event.");
49  desc.add<std::string>("cut")->setComment("Cut used by which to select jets. For example:\n"
50  " \"pt > 100.0 && abs(rapidity()) < 2.4\".");
51 
52  // addDefault must be used here instead of add unless this function is specialized
53  // for different sets of template parameter types. Each specialization would need
54  // a different module label. Otherwise the generated cfi filenames will conflict
55  // for the different plugins.
56  descriptions.addDefault(desc);
57  }
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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 59 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().

60  {
61  auto jets = std::make_unique<JetsOutput>();
62  auto candsOut = std::make_unique<ConstituentsOutput>();
63 
65  iEvent.getByToken(srcToken_, h_jets);
66 
67  // Now set the Ptrs with the orphan handles.
68  for (auto const& jet : *h_jets) {
69  // Check the selection
70  if (selector_(jet)) {
71  // Add the jets that pass to the output collection
72  jets->push_back(jet);
73  for (unsigned int ida {}; ida < jet.numberOfDaughters(); ++ida) {
74  candsOut->emplace_back(jet.daughterPtr(ida), jet.daughterPtr(ida));
75  }
76  }
77  }
78 
79  iEvent.put(std::move(jets));
80  iEvent.put(std::move(candsOut), "constituents");
81  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
StringCutObjectSelector< T > const selector_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
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 84 of file JetConstituentSelector.cc.

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