CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
TrackingParticleConversionSelector Class Reference
Inheritance diagram for TrackingParticleConversionSelector:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 TrackingParticleConversionSelector (const edm::ParameterSet &iConfig)
 
- 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)
 
 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 ()
 

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

edm::EDGetTokenT
< TrackingParticleCollection
tpToken_
 

Additional Inherited Members

- 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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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
 
- 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 12 of file TrackingParticleConversionSelector.cc.

Constructor & Destructor Documentation

TrackingParticleConversionSelector::TrackingParticleConversionSelector ( const edm::ParameterSet iConfig)

Definition at line 25 of file TrackingParticleConversionSelector.cc.

25  :
26  tpToken_(consumes<TrackingParticleCollection>(iConfig.getParameter<edm::InputTag>("src")))
27 {
28  produces<TrackingParticleCollection>();
29 }
T getParameter(std::string const &) const
edm::EDGetTokenT< TrackingParticleCollection > tpToken_

Member Function Documentation

void TrackingParticleConversionSelector::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 31 of file TrackingParticleConversionSelector.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_25ns10e33_v2_cff::InputTag.

31  {
33  desc.add<edm::InputTag>("src", edm::InputTag("mix", "MergedTrackTruth"));
34  descriptions.add("trackingParticleConversionSelector", desc);
35 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void TrackingParticleConversionSelector::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 37 of file TrackingParticleConversionSelector.cc.

References funct::abs(), edm::Event::getByToken(), eostools::move(), edm::Event::put(), runTheMatrix::ret, and tpToken_.

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

37  {
39  iEvent.getByToken(tpToken_, h_tps);
40 
41  // Copy TPs because currently we can't process RefVectors of TPs in downstream
42  auto ret = std::make_unique<TrackingParticleCollection>();
43 
44  // Logic is similar to Validation/RecoEgamma/plugins/PhotonValidator.cc
45  // and RecoEgamma/EgammaMCTools/src/PhotonMCTruthFinder.cc,
46  // but implemented purely in terms of TrackingParticles (simpler and works for pileup too)
47  for(const auto& tp: *h_tps) {
48  if(tp.pdgId() == 22) {
49  for(const auto& vertRef: tp.decayVertices()) {
50  for(const auto& tpRef: vertRef->daughterTracks()) {
51  if(std::abs(tpRef->pdgId()) == 11) {
52  ret->push_back(*tpRef);
53  }
54  }
55  }
56  }
57  }
58 
59  iEvent.put(std::move(ret));
60 }
tuple ret
prodAgent to be discontinued
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< TrackingParticleCollection > tpToken_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
def move
Definition: eostools.py:510
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

edm::EDGetTokenT<TrackingParticleCollection> TrackingParticleConversionSelector::tpToken_
private

Definition at line 21 of file TrackingParticleConversionSelector.cc.

Referenced by produce().