CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
pat::PATGenCandsFromSimTracksProducer Class Reference

Produces reco::GenParticle from SimTracks. More...

Inheritance diagram for pat::PATGenCandsFromSimTracksProducer:
edm::stream::EDProducer<>

Classes

struct  GlobalContext
 Global context for all recursive methods. More...
 
struct  LessById
 

Public Member Functions

 PATGenCandsFromSimTracksProducer (const edm::ParameterSet &)
 
 ~PATGenCandsFromSimTracksProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Types

typedef StringCutObjectSelector< reco::GenParticleStrFilter
 

Private Member Functions

const SimTrackfindGeantMother (const SimTrack &tk, const GlobalContext &g) const
 Find the mother of a given GEANT track (or NULL if it can't be found). More...
 
edm::Ref< reco::GenParticleCollectionfindRef (const SimTrack &tk, GlobalContext &g) const
 
edm::Ref< reco::GenParticleCollectiongeneratorRef_ (const SimTrack &tk, const GlobalContext &g) const
 Used by findRef if the track is a PYTHIA particle. More...
 
reco::GenParticle makeGenParticle_ (const SimTrack &tk, const edm::Ref< reco::GenParticleCollection > &mother, const GlobalContext &g) const
 Make a GenParticle for this SimTrack, with a given mother. More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

const StrFilter filter_
 
bool firstEvent_
 
edm::EDGetTokenT< std::vector< int > > genBarcodesToken_
 
edm::EDGetTokenT< reco::GenParticleCollectiongenParticlesToken_
 Collection of GenParticles I need to make refs to. It must also have its associated vector<int> of barcodes, aligned with them. More...
 
bool makeMotherLink_
 If true, I'll try to make a link from the GEANT particle to a GenParticle. More...
 
std::set< int > motherPdgIds_
 
std::vector< PdtEntrymotherPdts_
 
std::set< int > pdgIds_
 
std::vector< PdtEntrypdts_
 
int setStatus_
 
edm::EDGetTokenT< edm::SimTrackContainersimTracksToken_
 
edm::EDGetTokenT< edm::SimVertexContainersimVertexToken_
 
bool writeAncestors_
 If true, I'll save GenParticles corresponding to the ancestors of this GEANT particle. Common ancestors are only written once. More...
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Produces reco::GenParticle from SimTracks.

The PATGenCandsFromSimTracksProducer produces GenParticles from SimTracks, so they can be used for MC matching.

Author
Jordan Tucker (original module), Giovanni Petrucciani (PAT integration)
Version
Id
PATGenCandsFromSimTracksProducer.cc,v 1.8 2010/10/20 23:09:25 wmtan Exp

Definition at line 30 of file PATGenCandsFromSimTracksProducer.cc.

Member Typedef Documentation

◆ StrFilter

Definition at line 47 of file PATGenCandsFromSimTracksProducer.cc.

Constructor & Destructor Documentation

◆ PATGenCandsFromSimTracksProducer()

PATGenCandsFromSimTracksProducer::PATGenCandsFromSimTracksProducer ( const edm::ParameterSet cfg)
explicit

Definition at line 122 of file PATGenCandsFromSimTracksProducer.cc.

123  : firstEvent_(true),
124  simTracksToken_(consumes<SimTrackContainer>(cfg.getParameter<InputTag>("src"))), // source sim tracks
125  simVertexToken_(consumes<SimVertexContainer>(cfg.getParameter<InputTag>("src"))), // source sim vertices
126  setStatus_(cfg.getParameter<int32_t>("setStatus")), // set status of GenParticle to this code
127  filter_(cfg.existsAs<string>("filter") ? cfg.getParameter<string>("filter") : std::string("1 == 1")),
128  makeMotherLink_(cfg.existsAs<bool>("makeMotherLink") ? cfg.getParameter<bool>("makeMotherLink") : false),
129  writeAncestors_(cfg.existsAs<bool>("writeAncestors") ? cfg.getParameter<bool>("writeAncestors") : false),
130  genParticlesToken_(mayConsume<GenParticleCollection>(cfg.getParameter<InputTag>("genParticles"))),
131  genBarcodesToken_(mayConsume<std::vector<int> >(cfg.getParameter<InputTag>("genParticles"))) {
132  // Possibly allow a list of particle types
133  if (cfg.exists("particleTypes")) {
134  pdts_ = cfg.getParameter<vector<PdtEntry> >("particleTypes");
135  }
136  if (cfg.exists("motherTypes")) {
137  motherPdts_ = cfg.getParameter<vector<PdtEntry> >("motherTypes");
138  }
139 
141  edm::LogWarning("Configuration")
142  << "PATGenCandsFromSimTracksProducer: "
143  << "you have set 'writeAncestors' to 'true' and 'makeMotherLink' to false;"
144  << "GEANT particles with generator level (e.g.PYHIA) mothers won't have mother links.\n";
145  }
146  produces<GenParticleCollection>();
147 }

References looper::cfg, makeMotherLink_, motherPdts_, pdts_, and writeAncestors_.

◆ ~PATGenCandsFromSimTracksProducer()

pat::PATGenCandsFromSimTracksProducer::~PATGenCandsFromSimTracksProducer ( )
inlineoverride

Definition at line 33 of file PATGenCandsFromSimTracksProducer.cc.

33 {}

Member Function Documentation

◆ findGeantMother()

const SimTrack * PATGenCandsFromSimTracksProducer::findGeantMother ( const SimTrack tk,
const GlobalContext g 
) const
private

Find the mother of a given GEANT track (or NULL if it can't be found).

Definition at line 149 of file PATGenCandsFromSimTracksProducer.cc.

149  {
150  assert(tk.genpartIndex() == -1); // MUST NOT be called with a PYTHIA track
151  if (!tk.noVertex()) {
152  const SimVertex &vtx = g.simvtxs[tk.vertIndex()];
153  if (!vtx.noParent()) {
154  unsigned int idx = vtx.parentIndex();
155  SimTrackContainer::const_iterator it = std::lower_bound(g.simtks.begin(), g.simtks.end(), idx, LessById());
156  if ((it != g.simtks.end()) && (it->trackId() == idx)) {
157  return &*it;
158  }
159  }
160  }
161  return nullptr;
162 }

References cms::cuda::assert(), g, SimTrack::genpartIndex(), heavyIonCSV_trainingSettings::idx, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, SimTrack::noVertex(), SimTrack::vertIndex(), and extraflags_cff::vtx.

Referenced by findRef(), and produce().

◆ findRef()

edm::Ref< reco::GenParticleCollection > PATGenCandsFromSimTracksProducer::findRef ( const SimTrack tk,
GlobalContext g 
) const
private

Find the GenParticle reference for a given GEANT or PYTHIA track.

  • if the track corresponds to a PYTHIA particle, return a ref to that particle
  • otherwise, if this simtrack has no mother simtrack, return a null ref
  • otherwise, if writeAncestors is true, make a GenParticle for it and return a ref to it
  • otherwise, if writeAncestors is false, return the ref to the GEANT mother of this track

Definition at line 164 of file PATGenCandsFromSimTracksProducer.cc.

165  {
166  if (tk.genpartIndex() != -1)
168  const SimTrack *simMother = findGeantMother(tk, g);
169 
171  if (simMother != nullptr)
172  motherRef = findRef(*simMother, g);
173 
174  if (writeAncestors_) {
175  // If writing ancestors, I need to serialize myself, and then to return a ref to me
176  // But first check if I've already been serialized
177  std::map<unsigned int, int>::const_iterator it = g.simTksProcessed.find(tk.trackId());
178  if (it != g.simTksProcessed.end()) {
179  // just return a ref to it
180  assert(it->second > 0);
181  return edm::Ref<reco::GenParticleCollection>(g.refprod, (it->second) - 1);
182  } else {
183  // make genParticle, save, update the map, and return ref to myself
184  reco::GenParticle p = makeGenParticle_(tk, motherRef, g);
185  g.output.push_back(p);
186  g.simTksProcessed[tk.trackId()] = g.output.size();
187  return edm::Ref<reco::GenParticleCollection>(g.refprod, g.output.size() - 1);
188  }
189  } else {
190  // Otherwise, I just return a ref to my mum
191  return motherRef;
192  }
193 }

References cms::cuda::assert(), findGeantMother(), g, generatorRef_(), SimTrack::genpartIndex(), makeGenParticle_(), makeMotherLink_, AlCaHLTBitMon_ParallelJobs::p, CoreSimTrack::trackId(), and writeAncestors_.

Referenced by produce().

◆ generatorRef_()

edm::Ref< reco::GenParticleCollection > PATGenCandsFromSimTracksProducer::generatorRef_ ( const SimTrack tk,
const GlobalContext g 
) const
private

Used by findRef if the track is a PYTHIA particle.

Definition at line 195 of file PATGenCandsFromSimTracksProducer.cc.

196  {
197  assert(st.genpartIndex() != -1);
198  // Note that st.genpartIndex() is the barcode, not the index within GenParticleCollection, so I have to search the particle
199  std::vector<int>::const_iterator it;
200  if (g.barcodesAreSorted) {
201  it = std::lower_bound(g.genBarcodes->begin(), g.genBarcodes->end(), st.genpartIndex());
202  } else {
203  it = std::find(g.genBarcodes->begin(), g.genBarcodes->end(), st.genpartIndex());
204  }
205 
206  // Check that I found something
207  // I need to check '*it == st.genpartIndex()' because lower_bound just finds the right spot for an item in a sorted list, not the item
208  if ((it != g.genBarcodes->end()) && (*it == st.genpartIndex())) {
209  return reco::GenParticleRef(g.gens, it - g.genBarcodes->begin());
210  } else {
211  return reco::GenParticleRef();
212  }
213 }

References cms::cuda::assert(), spr::find(), g, SimTrack::genpartIndex(), and pfDeepBoostedJetPreprocessParams_cfi::lower_bound.

Referenced by findRef().

◆ makeGenParticle_()

reco::GenParticle PATGenCandsFromSimTracksProducer::makeGenParticle_ ( const SimTrack tk,
const edm::Ref< reco::GenParticleCollection > &  mother,
const GlobalContext g 
) const
private

Make a GenParticle for this SimTrack, with a given mother.

Definition at line 215 of file PATGenCandsFromSimTracksProducer.cc.

216  {
217  // Make up a GenParticleCandidate from the GEANT track info.
218  int charge = static_cast<int>(tk.charge());
219  const Particle::LorentzVector &p4 = tk.momentum();
220  Particle::Point vtx; // = (0,0,0) by default
221  if (!tk.noVertex())
222  vtx = g.simvtxs[tk.vertIndex()].position();
223  GenParticle gp(charge, p4, vtx, tk.type(), setStatus_, true);
224  if (mother.isNonnull())
225  gp.addMother(mother);
226  return gp;
227 }

References CoreSimTrack::charge(), ALCARECOTkAlJpsiMuMu_cff::charge, g, runTauDisplay::gp, edm::Ref< C, T, F >::isNonnull(), CoreSimTrack::momentum(), SimTrack::noVertex(), p4, setStatus_, CoreSimTrack::type(), SimTrack::vertIndex(), and extraflags_cff::vtx.

Referenced by findRef(), and produce().

◆ produce()

void PATGenCandsFromSimTracksProducer::produce ( edm::Event event,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 229 of file PATGenCandsFromSimTracksProducer.cc.

229  {
230  if (firstEvent_) {
231  if (!pdts_.empty()) {
232  pdgIds_.clear();
233  for (vector<PdtEntry>::iterator itp = pdts_.begin(), edp = pdts_.end(); itp != edp; ++itp) {
234  itp->setup(iSetup); // decode string->pdgId and vice-versa
235  pdgIds_.insert(std::abs(itp->pdgId()));
236  }
237  pdts_.clear();
238  }
239  if (!motherPdts_.empty()) {
240  motherPdgIds_.clear();
241  for (vector<PdtEntry>::iterator itp = motherPdts_.begin(), edp = motherPdts_.end(); itp != edp; ++itp) {
242  itp->setup(iSetup); // decode string->pdgId and vice-versa
243  motherPdgIds_.insert(std::abs(itp->pdgId()));
244  }
245  motherPdts_.clear();
246  }
247  firstEvent_ = false;
248  }
249 
250  // Simulated tracks (i.e. GEANT particles).
251  Handle<SimTrackContainer> simtracks;
252  event.getByToken(simTracksToken_, simtracks);
253 
254  // Need to check that SimTrackContainer is sorted; otherwise, copy and sort :-(
255  std::unique_ptr<SimTrackContainer> simtracksTmp;
256  const SimTrackContainer *simtracksSorted = &*simtracks;
258  if (!__gnu_cxx::is_sorted(simtracks->begin(), simtracks->end(), LessById())) {
259  simtracksTmp = std::make_unique<SimTrackContainer>(*simtracks);
260  std::sort(simtracksTmp->begin(), simtracksTmp->end(), LessById());
261  simtracksSorted = &*simtracksTmp;
262  }
263  }
264 
265  // Get the associated vertices
266  Handle<SimVertexContainer> simvertices;
267  event.getByToken(simVertexToken_, simvertices);
268 
269  // Get the GenParticles and barcodes, if needed to set mother links
271  Handle<std::vector<int> > genBarcodes;
272  bool barcodesAreSorted = true;
273  if (makeMotherLink_) {
274  event.getByToken(genParticlesToken_, gens);
275  event.getByToken(genBarcodesToken_, genBarcodes);
276  if (gens->size() != genBarcodes->size())
277  throw cms::Exception("Corrupt data") << "Barcodes not of the same size as GenParticles!\n";
278  barcodesAreSorted = __gnu_cxx::is_sorted(genBarcodes->begin(), genBarcodes->end());
279  }
280 
281  // make the output collection
282  auto cands = std::make_unique<GenParticleCollection>();
283  edm::RefProd<GenParticleCollection> refprod = event.getRefBeforePut<GenParticleCollection>();
284 
285  GlobalContext globals(*simtracksSorted, *simvertices, gens, genBarcodes, barcodesAreSorted, *cands, refprod);
286 
287  for (SimTrackContainer::const_iterator isimtrk = simtracks->begin(); isimtrk != simtracks->end(); ++isimtrk) {
288  // Skip PYTHIA tracks.
289  if (isimtrk->genpartIndex() != -1)
290  continue;
291 
292  // Maybe apply the PdgId filter
293  if (!pdgIds_.empty()) { // if we have a filter on pdg ids
294  if (pdgIds_.find(std::abs(isimtrk->type())) == pdgIds_.end())
295  continue;
296  }
297 
299 
300  // Maybe apply filter on the particle
301  if (!(filter_(genp)))
302  continue;
303 
304  if (!motherPdgIds_.empty()) {
305  const SimTrack *motherSimTk = findGeantMother(*isimtrk, globals);
306  if (motherSimTk == nullptr)
307  continue;
308  if (motherPdgIds_.find(std::abs(motherSimTk->type())) == motherPdgIds_.end())
309  continue;
310  }
311 
313  Ref<GenParticleCollection> motherRef;
314  const SimTrack *mother = findGeantMother(*isimtrk, globals);
315  if (mother != nullptr)
316  motherRef = findRef(*mother, globals);
317  if (motherRef.isNonnull())
318  genp.addMother(motherRef);
319  }
320 
321  cands->push_back(genp);
322  }
323 
324  // Write to the Event, and get back a handle (which can be useful for debugging)
326 
327 #ifdef DEBUG_PATGenCandsFromSimTracksProducer
328  std::cout << "Produced a list of " << orphans->size() << " genParticles." << std::endl;
329  for (GenParticleCollection::const_iterator it = orphans->begin(), ed = orphans->end(); it != ed; ++it) {
330  std::cout << " ";
331  std::cout << "GenParticle #" << (it - orphans->begin()) << ": pdgId " << it->pdgId() << ", pt = " << it->pt()
332  << ", eta = " << it->eta() << ", phi = " << it->phi() << ", rho = " << it->vertex().Rho()
333  << ", z = " << it->vertex().Z() << std::endl;
334  edm::Ref<GenParticleCollection> mom = it->motherRef();
335  size_t depth = 2;
336  while (mom.isNonnull()) {
337  if (mom.id() == orphans.id()) {
338  // I need to re-make the ref because they are not working until this module returns.
339  mom = edm::Ref<GenParticleCollection>(orphans, mom.key());
340  }
341  for (size_t i = 0; i < depth; ++i)
342  std::cout << " ";
343  std::cout << "GenParticleRef [" << mom.id() << "/" << mom.key() << "]: pdgId " << mom->pdgId()
344  << ", status = " << mom->status() << ", pt = " << mom->pt() << ", eta = " << mom->eta()
345  << ", phi = " << mom->phi() << ", rho = " << mom->vertex().Rho() << ", z = " << mom->vertex().Z()
346  << std::endl;
347  if (mom.id() != orphans.id())
348  break;
349  if ((mom->motherRef().id() == mom.id()) && (mom->motherRef().key() == mom.key())) {
350  throw cms::Exception("Corrupt Data") << "A particle is it's own mother.\n";
351  }
352  mom = mom->motherRef();
353  depth++;
354  }
355  }
356  std::cout << std::endl;
357 #endif
358 }

References funct::abs(), HLT_FULL_cff::cands, gather_cfg::cout, LEDCalibrationChannels::depth, Exception, filter_, findGeantMother(), findRef(), firstEvent_, genBarcodesToken_, EgammaValidation_cff::genp, genParticlesToken_, mps_fire::i, edm::OrphanHandleBase::id(), edm::Ref< C, T, F >::id(), edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), makeGenParticle_(), makeMotherLink_, motherPdgIds_, motherPdts_, eostools::move(), pdgIds_, pdts_, simTracksToken_, simVertexToken_, CoreSimTrack::type(), and writeAncestors_.

Member Data Documentation

◆ filter_

const StrFilter pat::PATGenCandsFromSimTracksProducer::filter_
private

Definition at line 48 of file PATGenCandsFromSimTracksProducer.cc.

Referenced by produce().

◆ firstEvent_

bool pat::PATGenCandsFromSimTracksProducer::firstEvent_
private

Definition at line 38 of file PATGenCandsFromSimTracksProducer.cc.

Referenced by produce().

◆ genBarcodesToken_

edm::EDGetTokenT<std::vector<int> > pat::PATGenCandsFromSimTracksProducer::genBarcodesToken_
private

Definition at line 57 of file PATGenCandsFromSimTracksProducer.cc.

Referenced by produce().

◆ genParticlesToken_

edm::EDGetTokenT<reco::GenParticleCollection> pat::PATGenCandsFromSimTracksProducer::genParticlesToken_
private

Collection of GenParticles I need to make refs to. It must also have its associated vector<int> of barcodes, aligned with them.

Definition at line 56 of file PATGenCandsFromSimTracksProducer.cc.

Referenced by produce().

◆ makeMotherLink_

bool pat::PATGenCandsFromSimTracksProducer::makeMotherLink_
private

If true, I'll try to make a link from the GEANT particle to a GenParticle.

Definition at line 51 of file PATGenCandsFromSimTracksProducer.cc.

Referenced by findRef(), PATGenCandsFromSimTracksProducer(), and produce().

◆ motherPdgIds_

std::set<int> pat::PATGenCandsFromSimTracksProducer::motherPdgIds_
private

Definition at line 44 of file PATGenCandsFromSimTracksProducer.cc.

Referenced by produce().

◆ motherPdts_

std::vector<PdtEntry> pat::PATGenCandsFromSimTracksProducer::motherPdts_
private

◆ pdgIds_

std::set<int> pat::PATGenCandsFromSimTracksProducer::pdgIds_
private

Definition at line 42 of file PATGenCandsFromSimTracksProducer.cc.

Referenced by produce().

◆ pdts_

std::vector<PdtEntry> pat::PATGenCandsFromSimTracksProducer::pdts_
private

◆ setStatus_

int pat::PATGenCandsFromSimTracksProducer::setStatus_
private

Definition at line 41 of file PATGenCandsFromSimTracksProducer.cc.

Referenced by makeGenParticle_().

◆ simTracksToken_

edm::EDGetTokenT<edm::SimTrackContainer> pat::PATGenCandsFromSimTracksProducer::simTracksToken_
private

Definition at line 39 of file PATGenCandsFromSimTracksProducer.cc.

Referenced by produce().

◆ simVertexToken_

edm::EDGetTokenT<edm::SimVertexContainer> pat::PATGenCandsFromSimTracksProducer::simVertexToken_
private

Definition at line 40 of file PATGenCandsFromSimTracksProducer.cc.

Referenced by produce().

◆ writeAncestors_

bool pat::PATGenCandsFromSimTracksProducer::writeAncestors_
private

If true, I'll save GenParticles corresponding to the ancestors of this GEANT particle. Common ancestors are only written once.

Definition at line 53 of file PATGenCandsFromSimTracksProducer.cc.

Referenced by findRef(), PATGenCandsFromSimTracksProducer(), and produce().

edm::RefProd< GenParticleCollection >
reco::GenParticleRef
edm::Ref< GenParticleCollection > GenParticleRef
persistent reference to a GenParticle
Definition: GenParticleFwd.h:17
CoreSimTrack::momentum
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:19
mps_fire.i
i
Definition: mps_fire.py:428
SimVertex
Definition: SimVertex.h:5
pat::PATGenCandsFromSimTracksProducer::makeMotherLink_
bool makeMotherLink_
If true, I'll try to make a link from the GEANT particle to a GenParticle.
Definition: PATGenCandsFromSimTracksProducer.cc:51
reco::LeafCandidate::Point
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:27
reco::GenParticle
Definition: GenParticle.h:21
EgammaValidation_cff.genp
genp
produce generated paricles in acceptance #
Definition: EgammaValidation_cff.py:115
pat::PATGenCandsFromSimTracksProducer::filter_
const StrFilter filter_
Definition: PATGenCandsFromSimTracksProducer.cc:48
pat::PATGenCandsFromSimTracksProducer::motherPdts_
std::vector< PdtEntry > motherPdts_
Definition: PATGenCandsFromSimTracksProducer.cc:45
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
reco::GenParticleCollection
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
Definition: GenParticleFwd.h:13
pat::PATGenCandsFromSimTracksProducer::simTracksToken_
edm::EDGetTokenT< edm::SimTrackContainer > simTracksToken_
Definition: PATGenCandsFromSimTracksProducer.cc:39
cms::cuda::assert
assert(be >=bs)
CoreSimTrack::charge
float charge() const
charge
Definition: CoreSimTrack.cc:17
pat::PATGenCandsFromSimTracksProducer::pdts_
std::vector< PdtEntry > pdts_
Definition: PATGenCandsFromSimTracksProducer.cc:43
pat::PATGenCandsFromSimTracksProducer::findRef
edm::Ref< reco::GenParticleCollection > findRef(const SimTrack &tk, GlobalContext &g) const
Definition: PATGenCandsFromSimTracksProducer.cc:164
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::Handle
Definition: AssociativeIterator.h:50
GenParticle
Definition: GenParticle.py:1
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
pat::PATGenCandsFromSimTracksProducer::setStatus_
int setStatus_
Definition: PATGenCandsFromSimTracksProducer.cc:41
pat::PATGenCandsFromSimTracksProducer::findGeantMother
const SimTrack * findGeantMother(const SimTrack &tk, const GlobalContext &g) const
Find the mother of a given GEANT track (or NULL if it can't be found).
Definition: PATGenCandsFromSimTracksProducer.cc:149
edm::Ref
Definition: AssociativeIterator.h:58
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
SimTrack::noVertex
bool noVertex() const
Definition: SimTrack.h:31
pat::PATGenCandsFromSimTracksProducer::firstEvent_
bool firstEvent_
Definition: PATGenCandsFromSimTracksProducer.cc:38
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
pat::PATGenCandsFromSimTracksProducer::genBarcodesToken_
edm::EDGetTokenT< std::vector< int > > genBarcodesToken_
Definition: PATGenCandsFromSimTracksProducer.cc:57
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
HLT_FULL_cff.cands
cands
Definition: HLT_FULL_cff.py:15205
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
edm::GlobalContext
Definition: GlobalContext.h:29
pat::PATGenCandsFromSimTracksProducer::simVertexToken_
edm::EDGetTokenT< edm::SimVertexContainer > simVertexToken_
Definition: PATGenCandsFromSimTracksProducer.cc:40
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
pat::PATGenCandsFromSimTracksProducer::makeGenParticle_
reco::GenParticle makeGenParticle_(const SimTrack &tk, const edm::Ref< reco::GenParticleCollection > &mother, const GlobalContext &g) const
Make a GenParticle for this SimTrack, with a given mother.
Definition: PATGenCandsFromSimTracksProducer.cc:215
p4
double p4[4]
Definition: TauolaWrapper.h:92
pat::PATGenCandsFromSimTracksProducer::motherPdgIds_
std::set< int > motherPdgIds_
Definition: PATGenCandsFromSimTracksProducer.cc:44
CoreSimTrack::type
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:22
looper.cfg
cfg
Definition: looper.py:297
CoreSimTrack::trackId
unsigned int trackId() const
Definition: CoreSimTrack.h:31
edm::OrphanHandleBase::id
ProductID id() const
Definition: OrphanHandleBase.cc:6
edm::Ref::id
ProductID id() const
Accessor for product ID.
Definition: Ref.h:244
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
edm::SimTrackContainer
std::vector< SimTrack > SimTrackContainer
Definition: SimTrackContainer.h:12
SimTrack
Definition: SimTrack.h:6
Exception
Definition: hltDiff.cc:246
pat::PATGenCandsFromSimTracksProducer::writeAncestors_
bool writeAncestors_
If true, I'll save GenParticles corresponding to the ancestors of this GEANT particle....
Definition: PATGenCandsFromSimTracksProducer.cc:53
SimTrack::vertIndex
int vertIndex() const
index of the vertex in the Event container (-1 if no vertex)
Definition: SimTrack.h:30
pat::PATGenCandsFromSimTracksProducer::genParticlesToken_
edm::EDGetTokenT< reco::GenParticleCollection > genParticlesToken_
Collection of GenParticles I need to make refs to. It must also have its associated vector<int> of ba...
Definition: PATGenCandsFromSimTracksProducer.cc:56
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
cms::Exception
Definition: Exception.h:70
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
pat::PATGenCandsFromSimTracksProducer::pdgIds_
std::set< int > pdgIds_
Definition: PATGenCandsFromSimTracksProducer.cc:42
SimTrack::genpartIndex
int genpartIndex() const
index of the corresponding Generator particle in the Event container (-1 if no Genpart)
Definition: SimTrack.h:34
edm::InputTag
Definition: InputTag.h:15
g
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
reco::LeafCandidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: LeafCandidate.h:23
pat::PATGenCandsFromSimTracksProducer::generatorRef_
edm::Ref< reco::GenParticleCollection > generatorRef_(const SimTrack &tk, const GlobalContext &g) const
Used by findRef if the track is a PYTHIA particle.
Definition: PATGenCandsFromSimTracksProducer.cc:195