CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
PFTICLProducer Class Reference
Inheritance diagram for PFTICLProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PFTICLProducer (const edm::ParameterSet &)
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 ~PFTICLProducer () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

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

Private Attributes

const edm::EDGetTokenT< edm::View< TICLCandidate > > ticl_candidates_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase 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
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 PFTICLProducer.cc.

Constructor & Destructor Documentation

PFTICLProducer::PFTICLProducer ( const edm::ParameterSet conf)

Definition at line 32 of file PFTICLProducer.cc.

34  produces<reco::PFCandidateCollection>();
35 }
T getParameter(std::string const &) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< edm::View< TICLCandidate > > ticl_candidates_
PFTICLProducer::~PFTICLProducer ( )
inlineoverride

Definition at line 19 of file PFTICLProducer.cc.

References fillDescriptions(), and produce().

19 {}

Member Function Documentation

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

Definition at line 37 of file PFTICLProducer.cc.

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

Referenced by ~PFTICLProducer().

37  {
39  desc.add<edm::InputTag>("ticlCandidateSrc", edm::InputTag("ticlCandidateFromTrackstersProducer"));
40  descriptions.add("pfTICLProducer", desc);
41 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void PFTICLProducer::produce ( edm::StreamID  ,
edm::Event evt,
const edm::EventSetup es 
) const
override

Definition at line 43 of file PFTICLProducer.cc.

References funct::abs(), HLT_2018_cff::candidates, ALCARECOTkAlJpsiMuMu_cff::charge, reco::PFCandidate::e, reco::PFCandidate::gamma, edm::Event::getByToken(), reco::PFCandidate::h, reco::PFCandidate::h0, createfilelist::int, eostools::move(), reco::PFCandidate::mu, edm::Event::productGetter(), edm::Event::put(), ticl_candidates_, and reco::PFCandidate::X.

Referenced by ~PFTICLProducer().

43  {
44  //get TICLCandidates
46  evt.getByToken(ticl_candidates_, ticl_cand_h);
47  const auto ticl_candidates = *ticl_cand_h;
48 
49  auto candidates = std::make_unique<reco::PFCandidateCollection>();
50 
51  for (const auto& ticl_cand : ticl_candidates) {
52  const auto abs_pdg_id = std::abs(ticl_cand.pdgId());
53  const auto charge = ticl_cand.charge();
54  const auto& four_mom = ticl_cand.p4();
55 
57  switch (abs_pdg_id) {
58  case 11:
59  part_type = reco::PFCandidate::e;
60  break;
61  case 13:
62  part_type = reco::PFCandidate::mu;
63  break;
64  case 22:
65  part_type = reco::PFCandidate::gamma;
66  break;
67  case 130:
68  part_type = reco::PFCandidate::h0;
69  break;
70  case 211:
71  part_type = reco::PFCandidate::h;
72  break;
73  // default also handles neutral pions (111) for the time being (not yet foreseen in PFCandidate)
74  default:
75  part_type = reco::PFCandidate::X;
76  }
77 
78  candidates->emplace_back(charge, four_mom, part_type);
79 
80  auto& candidate = candidates->back();
81  if (candidate.charge()) { // otherwise PFCandidate throws
82  // Construct edm::Ref from edm::Ptr. As of now, assumes type to be reco::Track. To be extended (either via
83  // dynamic type checking or configuration) if additional track types are needed.
84  reco::TrackRef ref(ticl_cand.trackPtr().id(), int(ticl_cand.trackPtr().key()), &evt.productGetter());
85  candidate.setTrackRef(ref);
86  }
87  candidate.setTime(ticl_cand.time(), ticl_cand.timeError());
88  }
89 
90  evt.put(std::move(candidates));
91 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
ParticleType
particle types
Definition: PFCandidate.h:43
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
EDProductGetter const & productGetter() const
Definition: Event.cc:102
const edm::EDGetTokenT< edm::View< TICLCandidate > > ticl_candidates_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

const edm::EDGetTokenT<edm::View<TICLCandidate> > PFTICLProducer::ticl_candidates_
private

Definition at line 27 of file PFTICLProducer.cc.

Referenced by produce().