Replacement for TrackingTruthProducer in the new pileup mixing setup. More...
#include <TrackingTruthAccumulator.h>
Classes | |
struct | OutputCollections |
Public Member Functions | |
TrackingTruthAccumulator (const edm::ParameterSet &config, edm::ProducerBase &mixMod, edm::ConsumesCollector &iC) | |
Public Member Functions inherited from DigiAccumulatorMixMod | |
virtual void | accumulate (edm::Event const &event, edm::EventSetup const &setup)=0 |
virtual void | accumulate (PileUpEventPrincipal const &event, edm::EventSetup const &setup, edm::StreamID const &)=0 |
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 void | finalizeEvent (edm::Event &event, edm::EventSetup const &setup)=0 |
virtual PileupMixingContent * | getEventPileupInfo () |
virtual void | initializeBunchCrossing (edm::Event const &event, edm::EventSetup const &setup, int bunchCrossing) |
virtual void | initializeEvent (edm::Event const &event, edm::EventSetup const &setup)=0 |
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_ |
Whether or not to add the full parentage of any TrackingParticle that is inserted in the collection. More... | |
bool | allowDifferentProcessTypeForDifferentDetectors_ |
When counting hits, allows hits in different detectors to have a different process type. More... | |
bool | chargedOnly_ |
Uses the same config as selector_, but can be used to drop out early since selector_ requires the TrackingParticle to be created first. More... | |
std::vector< edm::InputTag > | collectionTags_ |
const bool | createInitialVertexCollection_ |
Whether or not to create a separate collection for just the initial interaction vertices. More... | |
const bool | createMergedCollection_ |
const bool | createUnmergedCollection_ |
If bremsstrahlung merging, whether to also add the unmerged collection to the event or not. More... | |
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_ |
The message category used to send messages to MessageLogger. More... | |
std::unique_ptr< TrackingVertexCollection > | pInitialVertices_ |
const bool | removeDeadModules_ |
As of 11/Feb/2013 this option hasn't been implemented yet. More... | |
TrackingParticleSelector | selector_ |
bool | selectorFlag_ |
bool | signalOnly_ |
Uses the same config as selector_, but can be used to drop out early since selector_ requires the TrackingParticle to be created first. More... | |
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_ |
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. |
Definition at line 73 of file TrackingTruthAccumulator.h.
|
explicit |
Definition at line 224 of file TrackingTruthAccumulator.cc.
References chargedOnly_, collectionTags_, edm::ConsumesCollector::consumes(), createInitialVertexCollection_, createMergedCollection_, createUnmergedCollection_, edm::ParameterSet::exists(), genParticleLabel_, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNames(), edm::ParameterSet::getParameterSet(), hepMCproductLabel_, messageCategory_, edm::ProductRegistryHelper::produces(), selector_, selectorFlag_, signalOnly_, simTrackLabel_, and simVertexLabel_.
|
overrideprivate |
Referenced by initializeEvent().
|
overrideprivate |
|
private |
Both forms of accumulate() delegate to this templated method.
Definition at line 409 of file TrackingTruthAccumulator.cc.
References addAncestors_, allowDifferentProcessTypeForDifferentDetectors_, EncodedEventId::bunchCrossing(), CoreSimTrack::charge(), chargedOnly_, createInitialVertexCollection_, createMergedCollection_, createUnmergedCollection_, EncodedEventId::event(), CoreSimTrack::eventId(), cppFunctionSkipper::exception, fillSimHits(), genParticleLabel_, edm::EventSetup::get(), ignoreTracksOutsideVolume_, mergedOutput_, pInitialVertices_, CoreSimVertex::position(), edm::ESHandle< T >::product(), selector_, selectorFlag_, signalOnly_, simTrackMatching_cfi::simTrack, simTrackLabel_, ecalDetailedTimeRecHit_cfi::simVertex, simVertexLabel_, unmergedOutput_, vertexDistanceCut_, SimVertex::vertexId(), volumeRadius_, and volumeZ_.
Referenced by initializeEvent().
|
private |
Fills the supplied vector with pointers to the SimHits, checking for bad modules if required.
Definition at line 522 of file TrackingTruthAccumulator.cc.
References a, funct::abs(), TrackingVertex::addDaughterTrack(), TrackingParticle::addDecayVertex(), TrackingParticle::addG4Track(), TrackingVertex::addG4Vertex(), TrackingParticle::addGenParticle(), TrackingVertex::addParentTrack(), allowDifferentProcessTypeForDifferentDetectors_, b, EncodedEventId::bunchCrossing(), collectionTags_, gather_cfg::cout, DEFINE_DIGI_ACCUMULATOR, DetId::det(), end, EncodedEventId::event(), CoreSimVertex::eventId(), CoreSimTrack::eventId(), spr::find(), TrackingParticle::g4Tracks(), nano_cff::genEvent, TrackingParticle::genParticles(), SimTrack::genpartIndex(), edm::getRef(), edm::isFinite(), TrackerTopology::layer(), mag2(), SiStripPI::max, SimTrack::noVertex(), NULL, nullptr, TrackingParticle::numberOfHits(), TrackingParticle::numberOfTrackerHits(), TrackingParticle::numberOfTrackerLayers(), TrackingParticle::parentVertex(), objects.autophobj::particleType, common_cff::pdgId, TrackingParticle::pdgId(), CoreSimVertex::position(), position, TrackingParticle::setNumberOfHits(), TrackingParticle::setNumberOfTrackerHits(), TrackingParticle::setNumberOfTrackerLayers(), TrackingParticle::setParentVertex(), rpcPointValidation_cfi::simHit, trackerHits::simHits, simTrackMatching_cfi::simTrack, ecalDetailedTimeRecHit_cfi::simVertex, DetId::subdetId(), PSimHit::timeOfFlight(), findElectronsInSiStrips_cfi::trackCollection, DetId::Tracker, CoreSimTrack::trackId(), CoreSimTrack::type(), particleFlowSuperClusterECAL_cfi::vertexCollection, trackingTruthProducer_cfi::vertexDistanceCut, trackingTruthProducer_cfi::volumeRadius, volumeRadius_, trackingTruthProducer_cfi::volumeZ, and volumeZ_.
Referenced by accumulateEvent().
|
overrideprivate |
Definition at line 380 of file TrackingTruthAccumulator.cc.
References createInitialVertexCollection_, createMergedCollection_, createUnmergedCollection_, mergedOutput_, eostools::move(), pInitialVertices_, TrackingTruthAccumulator::OutputCollections::pTrackingParticles, TrackingTruthAccumulator::OutputCollections::pTrackingVertices, and unmergedOutput_.
|
overrideprivate |
Definition at line 327 of file TrackingTruthAccumulator.cc.
References accumulate(), accumulateEvent(), PileUpEventPrincipal::bunchCrossing(), createInitialVertexCollection_, createMergedCollection_, createUnmergedCollection_, event(), hepMCproductLabel_, maximumPreviousBunchCrossing_, maximumSubsequentBunchCrossing_, mergedOutput_, messageCategory_, pInitialVertices_, TrackingTruthAccumulator::OutputCollections::pTrackingParticles, TrackingTruthAccumulator::OutputCollections::pTrackingVertices, TrackingTruthAccumulator::OutputCollections::refTrackingParticles, TrackingTruthAccumulator::OutputCollections::refTrackingVertexes, GeneralSetup::setup(), and unmergedOutput_.
|
private |
Whether or not to add the full parentage of any TrackingParticle that is inserted in the collection.
Definition at line 109 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent().
|
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 134 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), and fillSimHits().
|
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 123 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), and TrackingTruthAccumulator().
|
private |
Definition at line 115 of file TrackingTruthAccumulator.h.
Referenced by fillSimHits(), and TrackingTruthAccumulator().
|
private |
Whether or not to create a separate collection for just the initial interaction vertices.
Definition at line 107 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), finalizeEvent(), initializeEvent(), and TrackingTruthAccumulator().
|
private |
Definition at line 105 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), finalizeEvent(), initializeEvent(), and TrackingTruthAccumulator().
|
private |
If bremsstrahlung merging, whether to also add the unmerged collection to the event or not.
Definition at line 104 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), finalizeEvent(), initializeEvent(), and TrackingTruthAccumulator().
|
private |
Definition at line 116 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), and TrackingTruthAccumulator().
|
private |
Needed to add HepMC::GenVertex to SimVertex.
Definition at line 118 of file TrackingTruthAccumulator.h.
Referenced by initializeEvent(), and TrackingTruthAccumulator().
|
private |
Definition at line 95 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent().
|
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 99 of file TrackingTruthAccumulator.h.
Referenced by initializeEvent().
|
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 102 of file TrackingTruthAccumulator.h.
Referenced by initializeEvent().
|
private |
Definition at line 147 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), finalizeEvent(), and initializeEvent().
|
private |
The message category used to send messages to MessageLogger.
Definition at line 89 of file TrackingTruthAccumulator.h.
Referenced by initializeEvent(), and TrackingTruthAccumulator().
|
private |
Definition at line 148 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), finalizeEvent(), and initializeEvent().
|
private |
As of 11/Feb/2013 this option hasn't been implemented yet.
Definition at line 112 of file TrackingTruthAccumulator.h.
|
private |
Definition at line 121 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), and TrackingTruthAccumulator().
|
private |
Definition at line 120 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), and TrackingTruthAccumulator().
|
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 125 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), and TrackingTruthAccumulator().
|
private |
Definition at line 113 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), and TrackingTruthAccumulator().
|
private |
Definition at line 114 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), and TrackingTruthAccumulator().
|
private |
Definition at line 146 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), finalizeEvent(), and initializeEvent().
|
private |
maximum distance for HepMC::GenVertex to be added to SimVertex
Definition at line 94 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent().
|
private |
Definition at line 91 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), and fillSimHits().
|
private |
Definition at line 92 of file TrackingTruthAccumulator.h.
Referenced by accumulateEvent(), and fillSimHits().