CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::stream::EDProducerBase &mixMod, 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

virtual void accumulate (const edm::Event &event, const edm::EventSetup &setup)
 
virtual void accumulate (const PileUpEventPrincipal &event, const edm::EventSetup &setup, edm::StreamID const &)
 
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...
 
virtual void finalizeEvent (edm::Event &event, const edm::EventSetup &setup)
 
virtual void initializeEvent (const edm::Event &event, const edm::EventSetup &setup)
 

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::InputTagcollectionTags_
 
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::auto_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_
 

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 75 of file TrackingTruthAccumulator.h.

Constructor & Destructor Documentation

TrackingTruthAccumulator::TrackingTruthAccumulator ( const edm::ParameterSet config,
edm::stream::EDProducerBase mixMod,
edm::ConsumesCollector iC 
)
explicit

Definition at line 220 of file TrackingTruthAccumulator.cc.

Member Function Documentation

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

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

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

Implements DigiAccumulatorMixMod.

Definition at line 361 of file TrackingTruthAccumulator.cc.

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

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

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

Implements DigiAccumulatorMixMod.

Definition at line 375 of file TrackingTruthAccumulator.cc.

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

Implements DigiAccumulatorMixMod.

Definition at line 322 of file TrackingTruthAccumulator.cc.

Member Data Documentation

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 111 of file TrackingTruthAccumulator.h.

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 136 of file TrackingTruthAccumulator.h.

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 125 of file TrackingTruthAccumulator.h.

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

Definition at line 117 of file TrackingTruthAccumulator.h.

const bool TrackingTruthAccumulator::createInitialVertexCollection_
private

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

Definition at line 109 of file TrackingTruthAccumulator.h.

const bool TrackingTruthAccumulator::createMergedCollection_
private

Definition at line 107 of file TrackingTruthAccumulator.h.

const bool TrackingTruthAccumulator::createUnmergedCollection_
private

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

Definition at line 106 of file TrackingTruthAccumulator.h.

edm::InputTag TrackingTruthAccumulator::genParticleLabel_
private

Definition at line 118 of file TrackingTruthAccumulator.h.

edm::InputTag TrackingTruthAccumulator::hepMCproductLabel_
private

Needed to add HepMC::GenVertex to SimVertex.

Definition at line 120 of file TrackingTruthAccumulator.h.

const bool TrackingTruthAccumulator::ignoreTracksOutsideVolume_
private

Definition at line 97 of file TrackingTruthAccumulator.h.

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 101 of file TrackingTruthAccumulator.h.

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 104 of file TrackingTruthAccumulator.h.

OutputCollections TrackingTruthAccumulator::mergedOutput_
private

Definition at line 149 of file TrackingTruthAccumulator.h.

const std::string TrackingTruthAccumulator::messageCategory_
private

The message category used to send messages to MessageLogger.

Definition at line 91 of file TrackingTruthAccumulator.h.

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

Definition at line 150 of file TrackingTruthAccumulator.h.

const bool TrackingTruthAccumulator::removeDeadModules_
private

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

Definition at line 114 of file TrackingTruthAccumulator.h.

TrackingParticleSelector TrackingTruthAccumulator::selector_
private

Definition at line 123 of file TrackingTruthAccumulator.h.

bool TrackingTruthAccumulator::selectorFlag_
private

Definition at line 122 of file TrackingTruthAccumulator.h.

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 127 of file TrackingTruthAccumulator.h.

const edm::InputTag TrackingTruthAccumulator::simTrackLabel_
private

Definition at line 115 of file TrackingTruthAccumulator.h.

const edm::InputTag TrackingTruthAccumulator::simVertexLabel_
private

Definition at line 116 of file TrackingTruthAccumulator.h.

OutputCollections TrackingTruthAccumulator::unmergedOutput_
private

Definition at line 148 of file TrackingTruthAccumulator.h.

const double TrackingTruthAccumulator::vertexDistanceCut_
private

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

Definition at line 96 of file TrackingTruthAccumulator.h.

const double TrackingTruthAccumulator::volumeRadius_
private

Definition at line 93 of file TrackingTruthAccumulator.h.

const double TrackingTruthAccumulator::volumeZ_
private

Definition at line 94 of file TrackingTruthAccumulator.h.