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 258 of file TrackingTruthAccumulator.cc.

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

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 386 of file TrackingTruthAccumulator.cc.

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

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 396 of file TrackingTruthAccumulator.cc.

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

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 441 of file TrackingTruthAccumulator.cc.

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

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 571 of file TrackingTruthAccumulator.cc.

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

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 413 of file TrackingTruthAccumulator.cc.

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

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 356 of file TrackingTruthAccumulator.cc.

356  {
361  const_cast<edm::Event &>(event).getRefBeforePut<TrackingParticleCollection>();
362  unmergedOutput_.refTrackingVertexes = const_cast<edm::Event &>(event).getRefBeforePut<TrackingVertexCollection>();
363  }
364 
369  const_cast<edm::Event &>(event).getRefBeforePut<TrackingParticleCollection>("MergedTrackTruth");
371  const_cast<edm::Event &>(event).getRefBeforePut<TrackingVertexCollection>("MergedTrackTruth");
372  }
373 
376  }
377 }

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
edm::LogInfo
Definition: MessageLogger.h:254
TrackingVertexCollection
std::vector< TrackingVertex > TrackingVertexCollection
Definition: TrackingVertexContainer.h:8
TrackingParticleSelector
Definition: TrackingParticleSelector.h:16
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:441
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:49
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:36
edm::LogError
Definition: MessageLogger.h:183
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:571
TrackingTruthAccumulator::maximumPreviousBunchCrossing_
const unsigned int maximumPreviousBunchCrossing_
Definition: TrackingTruthAccumulator.h:125
DecayChain
adjacency_list< listS, vecS, directedS, VertexMotherParticleProperty, EdgeParticleClustersProperty > DecayChain
Definition: CaloTruthAccumulator.cc:122
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
get
#define get
TrackingTruthAccumulator::OutputCollections::pTrackingParticles
std::unique_ptr< TrackingParticleCollection > pTrackingParticles
Definition: TrackingTruthAccumulator.h:176
TrackingTruthAccumulator::volumeRadius_
const double volumeRadius_
Definition: TrackingTruthAccumulator.h:115
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
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
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