CMS 3D CMS Logo

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

Public Member Functions

void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 TrackingParticleBHadronRefSelector (const edm::ParameterSet &iConfig)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT
< TrackingParticleCollection
tpToken_
 
HistoryBase tracer_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 16 of file TrackingParticleBHadronRefSelector.cc.

Constructor & Destructor Documentation

TrackingParticleBHadronRefSelector::TrackingParticleBHadronRefSelector ( const edm::ParameterSet iConfig)

Definition at line 30 of file TrackingParticleBHadronRefSelector.cc.

References HistoryBase::depth(), and tracer_.

31  : tpToken_(consumes<TrackingParticleCollection>(iConfig.getParameter<edm::InputTag>("src"))) {
32  tracer_.depth(-2); // as in SimTracker/TrackHistory/src/TrackClassifier.cc
33 
34  produces<TrackingParticleRefVector>();
35 }
edm::EDGetTokenT< TrackingParticleCollection > tpToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void depth(int d)
Set the depth of the history.
Definition: HistoryBase.h:49

Member Function Documentation

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

Definition at line 37 of file TrackingParticleBHadronRefSelector.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

37  {
39  desc.add<edm::InputTag>("src", edm::InputTag("mix", "MergedTrackTruth"));
40  descriptions.add("trackingParticleBHadronRefSelectorDefault", desc);
41 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void TrackingParticleBHadronRefSelector::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 43 of file TrackingParticleBHadronRefSelector.cc.

References dataset::end, HistoryBase::evaluate(), edm::Event::getByToken(), mps_fire::i, eostools::move(), edm::Event::put(), HistoryBase::recoGenParticleTrail(), runTheMatrix::ret, tpToken_, and tracer_.

43  {
45  iEvent.getByToken(tpToken_, h_tps);
46 
47  auto ret = std::make_unique<TrackingParticleRefVector>();
48 
49  // Logic is similar to SimTracker/TrackHistory
50  for (size_t i = 0, end = h_tps->size(); i < end; ++i) {
51  auto tpRef = TrackingParticleRef(h_tps, i);
52  if (tracer_.evaluate(tpRef)) { // ignore TP if history can not be traced
53  // following is from TrackClassifier::processesAtGenerator()
54  HistoryBase::RecoGenParticleTrail const &recoGenParticleTrail = tracer_.recoGenParticleTrail();
55  for (const auto &particle : recoGenParticleTrail) {
56  HepPDT::ParticleID particleID(particle->pdgId());
57  if (particleID.hasBottom()) {
58  ret->push_back(tpRef);
59  break;
60  }
61  }
62  }
63  }
64 
65  iEvent.put(std::move(ret));
66 }
tuple ret
prodAgent to be discontinued
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
std::vector< const reco::GenParticle * > RecoGenParticleTrail
reco::GenParticle trail type.
Definition: HistoryBase.h:18
def move
Definition: eostools.py:511
edm::EDGetTokenT< TrackingParticleCollection > tpToken_
bool evaluate(TrackingParticleRef tpr)
Evaluate track history using a TrackingParticleRef.
Definition: HistoryBase.h:96
string end
Definition: dataset.py:937
RecoGenParticleTrail const & recoGenParticleTrail() const
Return all reco::GenParticle in the history.
Definition: HistoryBase.h:64
edm::Ref< TrackingParticleCollection > TrackingParticleRef

Member Data Documentation

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

Definition at line 25 of file TrackingParticleBHadronRefSelector.cc.

Referenced by produce().

HistoryBase TrackingParticleBHadronRefSelector::tracer_
private