CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
TrackingTruthAccumulator Class Reference

Replacement for TrackingTruthProducer in the new pileup mixing setup. More...

#include <TrackingTruthAccumulator.h>

Inheritance diagram for TrackingTruthAccumulator:
DigiAccumulatorMixMod

Classes

struct  OutputCollections
 

Public Member Functions

 TrackingTruthAccumulator (const edm::ParameterSet &config, edm::ProducesCollector, edm::ConsumesCollector &iC)
 
- Public Member Functions inherited from DigiAccumulatorMixMod
virtual void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
virtual void beginRun (edm::Run const &run, edm::EventSetup const &setup)
 
 DigiAccumulatorMixMod ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
virtual void endRun (edm::Run const &run, edm::EventSetup const &setup)
 
virtual void finalizeBunchCrossing (edm::Event &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual PileupMixingContentgetEventPileupInfo ()
 
virtual void initializeBunchCrossing (edm::Event const &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual void StorePileupInformation (std::vector< int > &numInteractionList, std::vector< int > &bunchCrossingList, std::vector< float > &TrueInteractionList, std::vector< edm::EventID > &eventList, int bunchSpace)
 
virtual ~DigiAccumulatorMixMod ()
 

Private Member Functions

void accumulate (const edm::Event &event, const edm::EventSetup &setup) override
 
void accumulate (const PileUpEventPrincipal &event, const edm::EventSetup &setup, edm::StreamID const &) override
 
template<class T >
void accumulateEvent (const T &event, const edm::EventSetup &setup, const edm::Handle< edm::HepMCProduct > &hepMCproduct)
 Both forms of accumulate() delegate to this templated method. More...
 
template<class T >
void fillSimHits (std::vector< const PSimHit * > &returnValue, const T &event, const edm::EventSetup &setup)
 Fills the supplied vector with pointers to the SimHits, checking for bad modules if required. More...
 
void finalizeEvent (edm::Event &event, const edm::EventSetup &setup) override
 
void initializeEvent (const edm::Event &event, const edm::EventSetup &setup) override
 

Private Attributes

const bool addAncestors_
 
bool allowDifferentProcessTypeForDifferentDetectors_
 When counting hits, allows hits in different detectors to have a different process type. More...
 
bool chargedOnly_
 
std::vector< edm::InputTagcollectionTags_
 
const bool createInitialVertexCollection_
 
const bool createMergedCollection_
 
const bool createUnmergedCollection_
 
edm::InputTag genParticleLabel_
 
edm::InputTag hepMCproductLabel_
 Needed to add HepMC::GenVertex to SimVertex. More...
 
const bool ignoreTracksOutsideVolume_
 
const unsigned int maximumPreviousBunchCrossing_
 
const unsigned int maximumSubsequentBunchCrossing_
 
OutputCollections mergedOutput_
 
const std::string messageCategory_
 
std::unique_ptr< TrackingVertexCollectionpInitialVertices_
 
const bool removeDeadModules_
 As of 11/Feb/2013 this option hasn't been implemented yet. More...
 
TrackingParticleSelector selector_
 
bool selectorFlag_
 
bool signalOnly_
 
const edm::InputTag simTrackLabel_
 
const edm::InputTag simVertexLabel_
 
OutputCollections unmergedOutput_
 
const double vertexDistanceCut_
 maximum distance for HepMC::GenVertex to be added to SimVertex More...
 
const double volumeRadius_
 
const double volumeZ_
 

Detailed Description

Replacement for TrackingTruthProducer in the new pileup mixing setup.

The configuration parameters are:

Parameter name Type Description
volumeRadius double The volume radius in cm used if ignoreTracksOutsideVolume is true.
volumeZ double The volume z in cm used if ignoreTracksOutsideVolume is true.
ignoreTracksOutsideVolume bool If true, sim tracks that have a production vertex outside the volume specified by volumeRadius and volumeZ won't be turned into TrackingParticles. Doesn't make much difference to be honest, over a huge range of volume sizes so there must be a cut earlier in the simulation.
maximumPreviousBunchCrossing unsigned int Bunch crossings before this number (inclusive; use positive integer) won't be included. Setting to zero means only in-time.
maximumSubsequentBunchCrossing unsigned int Bunch crossings after this won't create any TrackingParticles.
createUnmergedCollection bool Whether to create the TrackingParticle collection without bremsstrahlung merged.
createMergedBremsstrahlung bool Whether to create the TrackingParticle collection with bremsstrahlung merged. At least one of createUnmergedCollection or createMergedBremsstrahlung should be true otherwise nothing will be produced.
createInitialVertexCollection bool Whether to create a collection of just the initial vertices. You can usually get this information from one of the other collections (merged or unmerged bremsstrahlung), but for this collection no selection is applied. Hence you will always have all of the initial vertices regardless of how tightly you select TrackingParticles with the "select" parameter. Note that the collection will have no links to the products of these vertices. If you want to know what came off these vertices you will have to look in one of the other collections. The name of the collection will be "InitialVertices".
alwaysAddAncestors bool If a sim track passes selection and is turned into a TrackingParticle, all of it's parents will also be created even if they fail the selection. This was the default behaviour for the old TrackingParticleProducer.
removeDeadModules bool Hasn't been implemented yet (as of 22/May/2013).
simTrackCollection edm::InputTag The input SimTrack collection
simVertexCollection edm::InputTag The input SimVerted collection
simHitCollections edm::ParameterSet A ParameterSet of vectors of InputTags that are the input PSimHits
genParticleCollection edm::InputTag The input reco::GenParticle collection. Note that there's a difference between reco::GenParticle and HepMC::GenParticle; the old TrackingTruthProducer used to use HepMC::GenParticle.
allowDifferentSimHitProcesses bool Should be false for FullSim and true for FastSim. There's more documentation in the code if you're really interested.
select edm::ParameterSet A ParameterSet used to configure a TrackingParticleSelector. If the TrackingParticle doesn't pass this selector then it's not added to the output.

Author
Mark Grimes (mark..nosp@m.grim.nosp@m.es@br.nosp@m.isto.nosp@m.l.ac..nosp@m.uk)
Date
11/Oct/2012

Definition at line 89 of file TrackingTruthAccumulator.h.

Constructor & Destructor Documentation

◆ TrackingTruthAccumulator()

TrackingTruthAccumulator::TrackingTruthAccumulator ( const edm::ParameterSet config,
edm::ProducesCollector  producesCollector,
edm::ConsumesCollector iC 
)
explicit

Definition at line 260 of file TrackingTruthAccumulator.cc.

263  : messageCategory_("TrackingTruthAccumulator"),
264  volumeRadius_(config.getParameter<double>("volumeRadius")),
265  volumeZ_(config.getParameter<double>("volumeZ")),
266  vertexDistanceCut_(config.getParameter<double>("vertexDistanceCut")),
267  ignoreTracksOutsideVolume_(config.getParameter<bool>("ignoreTracksOutsideVolume")),
268  maximumPreviousBunchCrossing_(config.getParameter<unsigned int>("maximumPreviousBunchCrossing")),
269  maximumSubsequentBunchCrossing_(config.getParameter<unsigned int>("maximumSubsequentBunchCrossing")),
270  createUnmergedCollection_(config.getParameter<bool>("createUnmergedCollection")),
271  createMergedCollection_(config.getParameter<bool>("createMergedBremsstrahlung")),
272  createInitialVertexCollection_(config.getParameter<bool>("createInitialVertexCollection")),
273  addAncestors_(config.getParameter<bool>("alwaysAddAncestors")),
274  removeDeadModules_(config.getParameter<bool>("removeDeadModules")),
275  simTrackLabel_(config.getParameter<edm::InputTag>("simTrackCollection")),
276  simVertexLabel_(config.getParameter<edm::InputTag>("simVertexCollection")),
277  collectionTags_(),
278  genParticleLabel_(config.getParameter<edm::InputTag>("genParticleCollection")),
279  hepMCproductLabel_(config.getParameter<edm::InputTag>("HepMCProductLabel")),
280  allowDifferentProcessTypeForDifferentDetectors_(config.getParameter<bool>("allowDifferentSimHitProcesses")) {
281  //
282  // Make sure at least one of the merged and unmerged collections have been set
283  // to be created.
284  //
286  edm::LogError(messageCategory_) << "Both \"createUnmergedCollection\" and "
287  "\"createMergedBremsstrahlung\" have been"
288  << "set to false, which means no collections will be created";
289 
290  // Initialize selection for building TrackingParticles
291  //
292  if (config.exists("select")) {
293  edm::ParameterSet param = config.getParameter<edm::ParameterSet>("select");
294  selector_ = TrackingParticleSelector(param.getParameter<double>("ptMinTP"),
295  param.getParameter<double>("ptMaxTP"),
296  param.getParameter<double>("minRapidityTP"),
297  param.getParameter<double>("maxRapidityTP"),
298  param.getParameter<double>("tipTP"),
299  param.getParameter<double>("lipTP"),
300  param.getParameter<int>("minHitTP"),
301  param.getParameter<bool>("signalOnlyTP"),
302  param.getParameter<bool>("intimeOnlyTP"),
303  param.getParameter<bool>("chargedOnlyTP"),
304  param.getParameter<bool>("stableOnlyTP"),
305  param.getParameter<std::vector<int>>("pdgIdTP"));
306  selectorFlag_ = true;
307 
308  // Also set these two variables, which are used to drop out early if the
309  // SimTrack doesn't conform. The selector_ requires a full TrackingParticle
310  // object, but these two variables can veto things early.
311  chargedOnly_ = param.getParameter<bool>("chargedOnlyTP");
312  signalOnly_ = param.getParameter<bool>("signalOnlyTP");
313  } else {
314  selectorFlag_ = false;
315  chargedOnly_ = false;
316  signalOnly_ = false;
317  }
318 
319  //
320  // Need to state what collections are going to be added to the event. This
321  // depends on which of the merged and unmerged collections have been
322  // configured to be created.
323  //
325  producesCollector.produces<TrackingVertexCollection>();
326  producesCollector.produces<TrackingParticleCollection>();
327  }
328 
330  producesCollector.produces<TrackingParticleCollection>("MergedTrackTruth");
331  producesCollector.produces<TrackingVertexCollection>("MergedTrackTruth");
332  }
333 
335  producesCollector.produces<TrackingVertexCollection>("InitialVertices");
336  }
337 
338  iC.consumes<std::vector<SimTrack>>(simTrackLabel_);
339  iC.consumes<std::vector<SimVertex>>(simVertexLabel_);
340  iC.consumes<std::vector<reco::GenParticle>>(genParticleLabel_);
341  iC.consumes<std::vector<int>>(genParticleLabel_);
342  iC.consumes<std::vector<int>>(hepMCproductLabel_);
343 
344  // Fill the collection tags
345  const edm::ParameterSet &simHitCollectionConfig = config.getParameterSet("simHitCollections");
346  std::vector<std::string> parameterNames = simHitCollectionConfig.getParameterNames();
347 
348  for (const auto &parameterName : parameterNames) {
349  std::vector<edm::InputTag> tags = simHitCollectionConfig.getParameter<std::vector<edm::InputTag>>(parameterName);
350  collectionTags_.insert(collectionTags_.end(), tags.begin(), tags.end());
351  }
352 
353  for (const auto &collectionTag : collectionTags_) {
354  iC.consumes<std::vector<PSimHit>>(collectionTag);
355  }
356 }

References chargedOnly_, collectionTags_, edm::ConsumesCollector::consumes(), createInitialVertexCollection_, createMergedCollection_, createUnmergedCollection_, genParticleLabel_, edm::ParameterSet::getParameter(), hepMCproductLabel_, messageCategory_, edm::ProducesCollector::produces(), selector_, selectorFlag_, signalOnly_, simTrackLabel_, simVertexLabel_, and triggerMatcherToHLTDebug_cfi::tags.

Member Function Documentation

◆ accumulate() [1/2]

void TrackingTruthAccumulator::accumulate ( const edm::Event event,
const edm::EventSetup setup 
)
overrideprivatevirtual

create handle to edm::HepMCProduct here because event.getByLabel with edm::HepMCProduct only works for edm::Event but not for PileUpEventPrincipal; PileUpEventPrincipal::getByLabel tries to call T::value_type and T::iterator (where T is the type of the object one wants to get a handle to) which is only implemented for container-like objects like std::vector but not for edm::HepMCProduct!

Implements DigiAccumulatorMixMod.

Definition at line 388 of file TrackingTruthAccumulator.cc.

388  {
389  // Call the templated version that does the same for both signal and pileup
390  // events
391 
393  event.getByLabel(hepMCproductLabel_, hepmc);
394 
395  accumulateEvent(event, setup, hepmc);
396 }

References accumulateEvent(), hepMCproductLabel_, and singleTopDQM_cfi::setup.

◆ accumulate() [2/2]

void TrackingTruthAccumulator::accumulate ( const PileUpEventPrincipal event,
const edm::EventSetup setup,
edm::StreamID const &   
)
overrideprivatevirtual

Implements DigiAccumulatorMixMod.

Definition at line 398 of file TrackingTruthAccumulator.cc.

400  {
401  // If this bunch crossing is outside the user configured limit, don't do
402  // anything.
403  if (event.bunchCrossing() >= -static_cast<int>(maximumPreviousBunchCrossing_) &&
404  event.bunchCrossing() <= static_cast<int>(maximumSubsequentBunchCrossing_)) {
405  // edm::LogInfo(messageCategory_) << "Analysing pileup event for bunch
406  // crossing " << event.bunchCrossing();
407 
408  // simply create empty handle as we do not have a HepMCProduct in PU anyway
410  accumulateEvent(event, setup, hepmc);
411  } else
412  edm::LogInfo(messageCategory_) << "Skipping pileup event for bunch crossing " << event.bunchCrossing();
413 }

References accumulateEvent(), maximumPreviousBunchCrossing_, maximumSubsequentBunchCrossing_, messageCategory_, and singleTopDQM_cfi::setup.

◆ accumulateEvent()

template<class T >
void TrackingTruthAccumulator::accumulateEvent ( const T event,
const edm::EventSetup setup,
const edm::Handle< edm::HepMCProduct > &  hepMCproduct 
)
private

Both forms of accumulate() delegate to this templated method.

Definition at line 443 of file TrackingTruthAccumulator.cc.

445  {
446  //
447  // Get the collections
448  //
452  edm::Handle<std::vector<int>> hGenParticleIndices;
453 
454  event.getByLabel(simTrackLabel_, hSimTracks);
455  event.getByLabel(simVertexLabel_, hSimVertices);
456 
457  try {
458  event.getByLabel(genParticleLabel_, hGenParticles);
459  event.getByLabel(genParticleLabel_, hGenParticleIndices);
460  } catch (cms::Exception &exception) {
461  //
462  // The Monte Carlo is not always available, e.g. for pileup events. The
463  // information is only used if it's available, but for some reason the
464  // PileUpEventPrincipal wrapper throws an exception here rather than waiting
465  // to see if the handle is used (as is the case for edm::Event). So I just
466  // want to catch this exception and use the normal handle checking later on.
467  //
468  }
469 
470  // Retrieve tracker topology from geometry
471  edm::ESHandle<TrackerTopology> tTopoHandle;
472  setup.get<TrackerTopologyRcd>().get(tTopoHandle);
473  const TrackerTopology *const tTopo = tTopoHandle.product();
474 
475  // Run through the collections and work out the decay chain of each
476  // track/vertex. The information in SimTrack and SimVertex only allows
477  // traversing upwards, but this will allow traversal in both directions. This
478  // is required for things like grouping electrons that bremsstrahlung as one
479  // TrackingParticle if "mergedBremsstrahlung" is set in the config file.
480  DecayChain decayChain(*hSimTracks, *hSimVertices);
481 
482  // I only want to create these collections if they're actually required
483  std::unique_ptr<::OutputCollectionWrapper> pUnmergedCollectionWrapper;
484  std::unique_ptr<::OutputCollectionWrapper> pMergedCollectionWrapper;
486  pUnmergedCollectionWrapper = std::make_unique<::OutputCollectionWrapper>(decayChain, unmergedOutput_);
488  pMergedCollectionWrapper = std::make_unique<::OutputCollectionWrapper>(decayChain, mergedOutput_);
489 
490  std::vector<const PSimHit *> simHitPointers;
491  fillSimHits(simHitPointers, event, setup);
492  TrackingParticleFactory objectFactory(decayChain,
493  hGenParticles,
494  hepMCproduct,
495  hGenParticleIndices,
496  simHitPointers,
498  volumeZ_,
501 
502 #if defined(DO_DEBUG_TESTING)
503  // While I'm testing, perform some checks.
504  // TODO - drop this call once I'm happy it works in all situations.
505  decayChain.integrityCheck();
506 #endif
507 
508  TrackingParticleSelector *pSelector = nullptr;
509  if (selectorFlag_)
510  pSelector = &selector_;
511 
512  // Run over all of the SimTracks, but because I'm interested in the decay
513  // hierarchy do it through the DecayChainTrack objects. These are looped over
514  // in sequence here but they have the hierarchy information for the functions
515  // called to traverse the decay chain.
516 
517  for (size_t index = 0; index < decayChain.decayTracksSize; ++index) {
518  ::DecayChainTrack *pDecayTrack = &decayChain.decayTracks[index];
519  const SimTrack &simTrack = hSimTracks->at(pDecayTrack->simTrackIndex);
520 
521  // Perform some quick checks to see if we can drop out early. Note that
522  // these are a subset of the cuts in the selector_ so the created
523  // TrackingParticle could still fail. The selector_ requires the full
524  // TrackingParticle to be made however, which can be computationally
525  // expensive.
526  if (chargedOnly_ && simTrack.charge() == 0)
527  continue;
528  if (signalOnly_ && (simTrack.eventId().bunchCrossing() != 0 || simTrack.eventId().event() != 0))
529  continue;
530 
531  // Also perform a check to see if the production vertex is inside the
532  // tracker volume (if required).
534  const SimVertex &simVertex = hSimVertices->at(pDecayTrack->pParentVertex->simVertexIndex);
535  if (!objectFactory.vectorIsInsideVolume(simVertex.position()))
536  continue;
537  }
538 
539  // This function creates the TrackinParticle and adds it to the collection
540  // if it passes the selection criteria specified in the configuration. If
541  // the config specifies adding ancestors, the function is called recursively
542  // to do that.
543  ::addTrack(pDecayTrack,
544  pSelector,
545  pUnmergedCollectionWrapper.get(),
546  pMergedCollectionWrapper.get(),
547  objectFactory,
549  tTopo);
550  }
551 
552  // If configured to create a collection of initial vertices, add them from
553  // this bunch crossing. No selection is applied on this collection, but it
554  // also has no links to the TrackingParticle decay products. There are a lot
555  // of "initial vertices", I'm not entirely sure what they all are (nuclear
556  // interactions in the detector maybe?), but the one for the main event is the
557  // one with vertexId==0.
559  // Pretty sure the one with vertexId==0 is always the first one, but doesn't
560  // hurt to check
561  for (const auto &pRootVertex : decayChain.rootVertices) {
562  const SimVertex &vertex = hSimVertices->at(decayChain.rootVertices[0]->simVertexIndex);
563  if (vertex.vertexId() != 0)
564  continue;
565 
566  pInitialVertices_->push_back(objectFactory.createTrackingVertex(pRootVertex));
567  break;
568  }
569  }
570 }

References addAncestors_, allowDifferentProcessTypeForDifferentDetectors_, chargedOnly_, createInitialVertexCollection_, createMergedCollection_, createUnmergedCollection_, cppFunctionSkipper::exception, fillSimHits(), genParticleLabel_, get, ignoreTracksOutsideVolume_, mergedOutput_, pInitialVertices_, edm::ESHandle< T >::product(), selector_, selectorFlag_, singleTopDQM_cfi::setup, signalOnly_, muonSimHitMatcherPSet::simTrack, simTrackLabel_, HLTEgPhaseIITestSequence_cff::simVertex, simVertexLabel_, unmergedOutput_, bphysicsOniaDQM_cfi::vertex, vertexDistanceCut_, volumeRadius_, and volumeZ_.

Referenced by accumulate().

◆ fillSimHits()

template<class T >
void TrackingTruthAccumulator::fillSimHits ( std::vector< const PSimHit * > &  returnValue,
const T event,
const edm::EventSetup setup 
)
private

Fills the supplied vector with pointers to the SimHits, checking for bad modules if required.

Definition at line 573 of file TrackingTruthAccumulator.cc.

575  {
576  // loop over the collections
577  for (const auto &collectionTag : collectionTags_) {
579  event.getByLabel(collectionTag, hSimHits);
580 
581  // TODO - implement removing the dead modules
582  for (const auto &simHit : *hSimHits) {
583  returnValue.push_back(&simHit);
584  }
585 
586  } // end of loop over InputTags
587 
588  // sort the SimHits according to their time of flight,
589  // necessary for looping over them "in order" in
590  // TrackingParticleFactory::createTrackingParticle()
591  std::sort(returnValue.begin(), returnValue.end(), [](const PSimHit *a, const PSimHit *b) {
592  const auto atof =
593  edm::isFinite(a->timeOfFlight()) ? a->timeOfFlight() : std::numeric_limits<decltype(a->timeOfFlight())>::max();
594  const auto btof =
595  edm::isFinite(b->timeOfFlight()) ? b->timeOfFlight() : std::numeric_limits<decltype(b->timeOfFlight())>::max();
596  return atof < btof;
597  });
598 }

References a, b, collectionTags_, edm::isFinite(), SiStripPI::max, and rpcPointValidation_cfi::simHit.

Referenced by accumulateEvent().

◆ finalizeEvent()

void TrackingTruthAccumulator::finalizeEvent ( edm::Event event,
const edm::EventSetup setup 
)
overrideprivatevirtual

Implements DigiAccumulatorMixMod.

Definition at line 415 of file TrackingTruthAccumulator.cc.

415  {
417  edm::LogInfo("TrackingTruthAccumulator")
418  << "Adding " << unmergedOutput_.pTrackingParticles->size() << " TrackingParticles and "
419  << unmergedOutput_.pTrackingVertices->size() << " TrackingVertexs to the event.";
420 
423  }
424 
426  edm::LogInfo("TrackingTruthAccumulator")
427  << "Adding " << mergedOutput_.pTrackingParticles->size() << " merged TrackingParticles and "
428  << mergedOutput_.pTrackingVertices->size() << " merged TrackingVertexs to the event.";
429 
430  event.put(std::move(mergedOutput_.pTrackingParticles), "MergedTrackTruth");
431  event.put(std::move(mergedOutput_.pTrackingVertices), "MergedTrackTruth");
432  }
433 
435  edm::LogInfo("TrackingTruthAccumulator")
436  << "Adding " << pInitialVertices_->size() << " initial TrackingVertexs to the event.";
437 
438  event.put(std::move(pInitialVertices_), "InitialVertices");
439  }
440 }

References createInitialVertexCollection_, createMergedCollection_, createUnmergedCollection_, mergedOutput_, eostools::move(), pInitialVertices_, TrackingTruthAccumulator::OutputCollections::pTrackingParticles, TrackingTruthAccumulator::OutputCollections::pTrackingVertices, and unmergedOutput_.

◆ initializeEvent()

void TrackingTruthAccumulator::initializeEvent ( const edm::Event event,
const edm::EventSetup setup 
)
overrideprivatevirtual

Implements DigiAccumulatorMixMod.

Definition at line 358 of file TrackingTruthAccumulator.cc.

358  {
360  unmergedOutput_.pTrackingParticles = std::make_unique<TrackingParticleCollection>();
361  unmergedOutput_.pTrackingVertices = std::make_unique<TrackingVertexCollection>();
363  const_cast<edm::Event &>(event).getRefBeforePut<TrackingParticleCollection>();
364  unmergedOutput_.refTrackingVertexes = const_cast<edm::Event &>(event).getRefBeforePut<TrackingVertexCollection>();
365  }
366 
368  mergedOutput_.pTrackingParticles = std::make_unique<TrackingParticleCollection>();
369  mergedOutput_.pTrackingVertices = std::make_unique<TrackingVertexCollection>();
371  const_cast<edm::Event &>(event).getRefBeforePut<TrackingParticleCollection>("MergedTrackTruth");
373  const_cast<edm::Event &>(event).getRefBeforePut<TrackingVertexCollection>("MergedTrackTruth");
374  }
375 
377  pInitialVertices_ = std::make_unique<TrackingVertexCollection>();
378  }
379 }

References createInitialVertexCollection_, createMergedCollection_, createUnmergedCollection_, mergedOutput_, pInitialVertices_, TrackingTruthAccumulator::OutputCollections::pTrackingParticles, TrackingTruthAccumulator::OutputCollections::pTrackingVertices, TrackingTruthAccumulator::OutputCollections::refTrackingParticles, TrackingTruthAccumulator::OutputCollections::refTrackingVertexes, and unmergedOutput_.

Member Data Documentation

◆ addAncestors_

const bool TrackingTruthAccumulator::addAncestors_
private

Whether or not to add the full parentage of any TrackingParticle that is inserted in the collection.

Definition at line 140 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent().

◆ allowDifferentProcessTypeForDifferentDetectors_

bool TrackingTruthAccumulator::allowDifferentProcessTypeForDifferentDetectors_
private

When counting hits, allows hits in different detectors to have a different process type.

Fast sim PSimHits seem to have a peculiarity where the process type (as reported by PSimHit::processType()) is different for the tracker than the muons. When counting how many hits there are, the code usually only counts the number of hits that have the same process type as the first hit. Setting this to true will also count hits that have the same process type as the first hit in the second detector.

Definition at line 170 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent().

◆ chargedOnly_

bool TrackingTruthAccumulator::chargedOnly_
private

Uses the same config as selector_, but can be used to drop out early since selector_ requires the TrackingParticle to be created first.

Definition at line 155 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent(), and TrackingTruthAccumulator().

◆ collectionTags_

std::vector<edm::InputTag> TrackingTruthAccumulator::collectionTags_
private

Definition at line 146 of file TrackingTruthAccumulator.h.

Referenced by fillSimHits(), and TrackingTruthAccumulator().

◆ createInitialVertexCollection_

const bool TrackingTruthAccumulator::createInitialVertexCollection_
private

Whether or not to create a separate collection for just the initial interaction vertices

Definition at line 137 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent(), finalizeEvent(), initializeEvent(), and TrackingTruthAccumulator().

◆ createMergedCollection_

const bool TrackingTruthAccumulator::createMergedCollection_
private

◆ createUnmergedCollection_

const bool TrackingTruthAccumulator::createUnmergedCollection_
private

If bremsstrahlung merging, whether to also add the unmerged collection to the event or not.

Definition at line 133 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent(), finalizeEvent(), initializeEvent(), and TrackingTruthAccumulator().

◆ genParticleLabel_

edm::InputTag TrackingTruthAccumulator::genParticleLabel_
private

Definition at line 147 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent(), and TrackingTruthAccumulator().

◆ hepMCproductLabel_

edm::InputTag TrackingTruthAccumulator::hepMCproductLabel_
private

Needed to add HepMC::GenVertex to SimVertex.

Definition at line 149 of file TrackingTruthAccumulator.h.

Referenced by accumulate(), and TrackingTruthAccumulator().

◆ ignoreTracksOutsideVolume_

const bool TrackingTruthAccumulator::ignoreTracksOutsideVolume_
private

Definition at line 119 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent().

◆ maximumPreviousBunchCrossing_

const unsigned int TrackingTruthAccumulator::maximumPreviousBunchCrossing_
private

The maximum bunch crossing BEFORE the signal crossing to create TrackinParticles for. Use positive values. If set to zero no previous bunches are added and only in-time, signal and after bunches (defined by maximumSubsequentBunchCrossing_) are used.

Definition at line 125 of file TrackingTruthAccumulator.h.

Referenced by accumulate().

◆ maximumSubsequentBunchCrossing_

const unsigned int TrackingTruthAccumulator::maximumSubsequentBunchCrossing_
private

The maximum bunch crossing AFTER the signal crossing to create TrackinParticles for. E.g. if set to zero only uses the signal and in time pileup (and previous bunches defined by the maximumPreviousBunchCrossing_ parameter).

Definition at line 130 of file TrackingTruthAccumulator.h.

Referenced by accumulate().

◆ mergedOutput_

OutputCollections TrackingTruthAccumulator::mergedOutput_
private

Definition at line 184 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent(), finalizeEvent(), and initializeEvent().

◆ messageCategory_

const std::string TrackingTruthAccumulator::messageCategory_
private

The message category used to send messages to MessageLogger

Definition at line 112 of file TrackingTruthAccumulator.h.

Referenced by accumulate(), and TrackingTruthAccumulator().

◆ pInitialVertices_

std::unique_ptr<TrackingVertexCollection> TrackingTruthAccumulator::pInitialVertices_
private

Definition at line 185 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent(), finalizeEvent(), and initializeEvent().

◆ removeDeadModules_

const bool TrackingTruthAccumulator::removeDeadModules_
private

As of 11/Feb/2013 this option hasn't been implemented yet.

Definition at line 143 of file TrackingTruthAccumulator.h.

◆ selector_

TrackingParticleSelector TrackingTruthAccumulator::selector_
private

Definition at line 152 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent(), and TrackingTruthAccumulator().

◆ selectorFlag_

bool TrackingTruthAccumulator::selectorFlag_
private

Definition at line 151 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent(), and TrackingTruthAccumulator().

◆ signalOnly_

bool TrackingTruthAccumulator::signalOnly_
private

Uses the same config as selector_, but can be used to drop out early since selector_ requires the TrackingParticle to be created first.

Definition at line 158 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent(), and TrackingTruthAccumulator().

◆ simTrackLabel_

const edm::InputTag TrackingTruthAccumulator::simTrackLabel_
private

Definition at line 144 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent(), and TrackingTruthAccumulator().

◆ simVertexLabel_

const edm::InputTag TrackingTruthAccumulator::simVertexLabel_
private

Definition at line 145 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent(), and TrackingTruthAccumulator().

◆ unmergedOutput_

OutputCollections TrackingTruthAccumulator::unmergedOutput_
private

Definition at line 183 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent(), finalizeEvent(), and initializeEvent().

◆ vertexDistanceCut_

const double TrackingTruthAccumulator::vertexDistanceCut_
private

maximum distance for HepMC::GenVertex to be added to SimVertex

Definition at line 118 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent().

◆ volumeRadius_

const double TrackingTruthAccumulator::volumeRadius_
private

Definition at line 115 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent().

◆ volumeZ_

const double TrackingTruthAccumulator::volumeZ_
private

Definition at line 116 of file TrackingTruthAccumulator.h.

Referenced by accumulateEvent().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
SimVertex
Definition: SimVertex.h:5
TrackerTopology
Definition: TrackerTopology.h:16
TrackingVertexCollection
std::vector< TrackingVertex > TrackingVertexCollection
Definition: TrackingVertexContainer.h:8
TrackingParticleSelector
Definition: TrackingParticleSelector.h:16
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle< edm::HepMCProduct >
TrackingTruthAccumulator::vertexDistanceCut_
const double vertexDistanceCut_
maximum distance for HepMC::GenVertex to be added to SimVertex
Definition: TrackingTruthAccumulator.h:118
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
TrackingTruthAccumulator::chargedOnly_
bool chargedOnly_
Definition: TrackingTruthAccumulator.h:155
TrackingTruthAccumulator::mergedOutput_
OutputCollections mergedOutput_
Definition: TrackingTruthAccumulator.h:184
TrackingTruthAccumulator::selectorFlag_
bool selectorFlag_
Definition: TrackingTruthAccumulator.h:151
HLTEgPhaseIITestSequence_cff.simVertex
simVertex
Definition: HLTEgPhaseIITestSequence_cff.py:51
config
Definition: config.py:1
TrackingTruthAccumulator::accumulateEvent
void accumulateEvent(const T &event, const edm::EventSetup &setup, const edm::Handle< edm::HepMCProduct > &hepMCproduct)
Both forms of accumulate() delegate to this templated method.
Definition: TrackingTruthAccumulator.cc:443
TrackingTruthAccumulator::signalOnly_
bool signalOnly_
Definition: TrackingTruthAccumulator.h:158
rpcPointValidation_cfi.simHit
simHit
Definition: rpcPointValidation_cfi.py:24
TrackingTruthAccumulator::OutputCollections::refTrackingParticles
TrackingParticleRefProd refTrackingParticles
Definition: TrackingTruthAccumulator.h:178
TrackingTruthAccumulator::createUnmergedCollection_
const bool createUnmergedCollection_
Definition: TrackingTruthAccumulator.h:133
reco::modules::TrackingParticleSelector
SingleObjectSelector< TrackingParticleCollection, ::TrackingParticleSelector > TrackingParticleSelector
Definition: TrackingParticleSelector.cc:17
edm::ESHandle< TrackerTopology >
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
TrackingTruthAccumulator::OutputCollections::pTrackingVertices
std::unique_ptr< TrackingVertexCollection > pTrackingVertices
Definition: TrackingTruthAccumulator.h:177
b
double b
Definition: hdecay.h:118
TrackingTruthAccumulator::simVertexLabel_
const edm::InputTag simVertexLabel_
Definition: TrackingTruthAccumulator.h:145
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
TrackingTruthAccumulator::messageCategory_
const std::string messageCategory_
Definition: TrackingTruthAccumulator.h:112
TrackingTruthAccumulator::pInitialVertices_
std::unique_ptr< TrackingVertexCollection > pInitialVertices_
Definition: TrackingTruthAccumulator.h:185
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
TrackingTruthAccumulator::OutputCollections::refTrackingVertexes
TrackingVertexRefProd refTrackingVertexes
Definition: TrackingTruthAccumulator.h:179
muonSimHitMatcherPSet.simTrack
simTrack
Definition: muonSimHitMatcherPSet.py:4
TrackingTruthAccumulator::collectionTags_
std::vector< edm::InputTag > collectionTags_
Definition: TrackingTruthAccumulator.h:146
TrackingTruthAccumulator::fillSimHits
void fillSimHits(std::vector< const PSimHit * > &returnValue, const T &event, const edm::EventSetup &setup)
Fills the supplied vector with pointers to the SimHits, checking for bad modules if required.
Definition: TrackingTruthAccumulator.cc:573
TrackingTruthAccumulator::maximumPreviousBunchCrossing_
const unsigned int maximumPreviousBunchCrossing_
Definition: TrackingTruthAccumulator.h:125
DecayChain
adjacency_list< listS, vecS, directedS, VertexMotherParticleProperty, EdgeParticleClustersProperty > DecayChain
Definition: CaloTruthAccumulator.cc:124
TrackingTruthAccumulator::maximumSubsequentBunchCrossing_
const unsigned int maximumSubsequentBunchCrossing_
Definition: TrackingTruthAccumulator.h:130
edm::ProducesCollector::produces
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
Definition: ProducesCollector.h:52
TrackingTruthAccumulator::allowDifferentProcessTypeForDifferentDetectors_
bool allowDifferentProcessTypeForDifferentDetectors_
When counting hits, allows hits in different detectors to have a different process type.
Definition: TrackingTruthAccumulator.h:170
TrackingTruthAccumulator::selector_
TrackingParticleSelector selector_
Definition: TrackingTruthAccumulator.h:152
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
TrackingTruthAccumulator::OutputCollections::pTrackingParticles
std::unique_ptr< TrackingParticleCollection > pTrackingParticles
Definition: TrackingTruthAccumulator.h:176
TrackingTruthAccumulator::volumeRadius_
const double volumeRadius_
Definition: TrackingTruthAccumulator.h:115
TrackingTruthAccumulator::simTrackLabel_
const edm::InputTag simTrackLabel_
Definition: TrackingTruthAccumulator.h:144
TrackingTruthAccumulator::genParticleLabel_
edm::InputTag genParticleLabel_
Definition: TrackingTruthAccumulator.h:147
eostools.move
def move(src, dest)
Definition: eostools.py:511
SimTrack
Definition: SimTrack.h:6
TrackingTruthAccumulator::unmergedOutput_
OutputCollections unmergedOutput_
Definition: TrackingTruthAccumulator.h:183
TrackingTruthAccumulator::ignoreTracksOutsideVolume_
const bool ignoreTracksOutsideVolume_
Definition: TrackingTruthAccumulator.h:119
TrackingParticleCollection
std::vector< TrackingParticle > TrackingParticleCollection
Definition: TrackingParticleFwd.h:8
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
triggerMatcherToHLTDebug_cfi.tags
tags
Definition: triggerMatcherToHLTDebug_cfi.py:9
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
cms::Exception
Definition: Exception.h:70
edm::isFinite
constexpr bool isFinite(T x)
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
TrackingTruthAccumulator::volumeZ_
const double volumeZ_
Definition: TrackingTruthAccumulator.h:116
PSimHit
Definition: PSimHit.h:15
event
Definition: event.py:1
edm::InputTag
Definition: InputTag.h:15
TrackingTruthAccumulator::createMergedCollection_
const bool createMergedCollection_
Definition: TrackingTruthAccumulator.h:134
TrackingTruthAccumulator::hepMCproductLabel_
edm::InputTag hepMCproductLabel_
Needed to add HepMC::GenVertex to SimVertex.
Definition: TrackingTruthAccumulator.h:149
TrackingTruthAccumulator::removeDeadModules_
const bool removeDeadModules_
As of 11/Feb/2013 this option hasn't been implemented yet.
Definition: TrackingTruthAccumulator.h:143
TrackingTruthAccumulator::addAncestors_
const bool addAncestors_
Definition: TrackingTruthAccumulator.h:140
TrackingTruthAccumulator::createInitialVertexCollection_
const bool createInitialVertexCollection_
Definition: TrackingTruthAccumulator.h:137