TrackingParticles and TrackingVertexes

Complete: 2

Purpose & Status

The classes TrackingParticle and TrackingVertex provide an easier to use interface to both the HepMC (generator) information and GEANT (simulation) information, especially when studying particles in the Tracker. These objects can then be associated with reconstructed tracks and vertices. They are only available on FEVTDEBUG datasets, not RECO or AOD.

Previously, GEANT will have been run on all generator-level particles for which it makes sense to do so (i.e. those satisfying certain cuts on their Pt and the distance of their decay vertex from the beam-line, as described here). The resulting tracks, plus any additional ones produced by GEANT (due to material interactions or K0 decay etc.) are stored as SimTracks. Each SimTrack is then converted to a TrackingParticle. However, when doing this, electrons are treated as a special case. Individual electrons often Bremstrahlung, and so can be split into several SimTracks. If this happens, the latter are grouped together in a single TrackingParticle, which keeps a list of all the SimTracks of which it is composed.

The tracking truth code works as explained here with the MixingModule as of the 1_3_0 series.

Generating MC Truth tracks and vertices

These are stored on the FEVTDEBUG only, not in RECO. Do perform a reconstruction run which include the TrackingParticles you can use this cmsDriver command line as a template

cmsDriver.py RECO_TrackingPart -s DIGI,L1,DIGI2RAW,RAW2DIGI,L1Reco,RECO --conditions auto:startup -n 1 --eventcontent FEVTDEBUG --filein file:<your GENSIM root file>

NB: The above command works for CMSS 5.X. To run the TrackingTruthAccumulator in CMSSW 7X, one needs to replace the DIGI in "DIGI,L1,DIGI2RAW,RAW2DIGI,L1Reco,RECO" with DIGI:pdigi_valid.

They are made by including the file SimGeneral/TrackingAnalysis/data/trackingtruth.cfi, but as this is part of the standard MC production sequence, a normal user will not need to do this. The contents of this file are

module trackingParticles = TrackingTruthProducer {
   double vertexDistanceCut = 0.003
   vstring HepMCDataLabels = {"VtxSmeared","PythiaSource","source"} 
   vstring TrackerHitLabels = {"TrackerHitsPixelBarrelLowTof",
                               "TrackerHitsPixelBarrelHighTof",  
                               "TrackerHitsPixelEndcapLowTof",   
                               "TrackerHitsPixelEndcapHighTof",  
                               "TrackerHitsTIBLowTof",
                               "TrackerHitsTIBHighTof",
                               "TrackerHitsTIDLowTof",
                               "TrackerHitsTIDHighTof",
                               "TrackerHitsTOBLowTof",
                               "TrackerHitsTOBHighTof",
                               "TrackerHitsTECLowTof",
                               "TrackerHitsTECHighTof"} 
   string simHitLabel = "g4SimHits" 
   double volumeRadius = 1200   
   double volumeZ      = 3000
   bool discardOutVolume = false 
   bool DiscardHitsFromDeltas = true
}

Most of this you will want to leave alone. You might want to change the vertexDistanceCut (the producer combines vertices within that many mm of each other). You can also change variables to discard vertices out of the tracker volume and to discard hits from delta rays (they are attached to the track which generated the delta ray).

You can add trackingParticles to your path just after mix (MixingModule). In the existing examples it is placed after the digi stage which is also fine.

Explanation of Producer

The (producer) creates the collections of TrackingParticle and TrackingVertex and places them in the event. In order to do the linkages between tracks and vertices in both directions, we use the getRefBeforePut method and to speed up the execution, we make extensive use of maps and multimaps to cache these linkages.

TrackingParticle

The collection of TrackingParticle (.cc file) objects is obtained by code like this:

In the header

typedef std::vector<TrackingParticle> TrackingParticleCollection;
edm::EDGetTokenT<TrackingParticleCollection> vec_TrackingParticle_Token_;
In the constructor initialization
vec_TrackingParticle_Token_( consumes<TrackingParticleCollection>( conf.getParameter<edm::InputTag>( "src" ) ) )
and in the implementation
edm::Handle<TrackingParticleCollection>  TruthTrackContainer ;
event.getByToken( vec_TrackingParticle_Token_, TruthTrackContainer );
const TrackingParticleCollection *tPC   = TruthTrackContainer.product();

From CMSSW_7_X TrackingParticles are not saved in the persistent collections. They can be reconstituted with lines in the configuration file like the following:

process.load("SimGeneral.MixingModule.mixNoPU_cfi")
process.load("SimGeneral.MixingModule.trackingTruthProducerSelection_cfi")
process.trackingParticles.simHitCollections = cms.PSet( )
process.mix.playback = cms.untracked.bool(True)
process.mix.digitizers = cms.PSet(
     mergedtruth = cms.PSet(process.trackingParticles)
)
for a in process.aliases: delattr(process, a)
and then add process.mix to the path.

TrackingParticle has the following methods (see the header file for type definitions)

pdgId()
Return the PDG particle code for the track.
eventId()
Return the EncodedEventId of the track. The EncodedEventId provides methods to determine which bunch crossing and which event within the bunch crossing the track came from.
genParticle_begin() and genParticle_end()
Provide iterators to references to the list of HepMC particles which make up this track. In principle there can be more than one.
g4Track_begin() and g4Track_end()
Provide iterators to the vector of GEANT particles which make up this track. In principle there can be more than one.
pSimHit_begin() and pSimHit_end()
Provide iterators to the vector of PSimHit objects associated with (created by) the track. Removed in CMSSW 7X.
genParticle()
Return the vector of references to the list of HepMC particles which make up this track.
g4Tracks()
Return the vector of GEANT particles which make up this track.
trackPSimHit()
Return the vector of PSimHit objects associated with (created by) the track.
parentVertex()
Return a reference to the TrackingVertex which is the parent of this vertex
decayVertices_begin() & decayVertices_end()
Provide iterators to the vector of TrackingVertex objects where the TrackingParticle decays. There can be many of these for delta rays and radiation.
matchedHit()
The number of Tracker layers containing hits for this TrackingParticle. This differs from trackPSimHit().size() because if the particle produced several hits in one layer, the latter will count them all. In addition, in the case of electrons matchedHit() does not count those hits after the first Bremstrahlung, if this changed the track trajectory sufficiently to produce a new SimTrack.

Tracking particle is derived from reco::Particle and inherits all its methods. There are also a number of setter methods that are probably only useful for developers. See the header file for more information.

TrackingVertex

edm::Handle<TrackingVertexCollection>    TruthVertexContainer;
event.getByType(TruthVertexContainer);
const TrackingVertexCollection   *tVC   = TruthVertexContainer.product();

genVertices_begin() and genVertices_end()
Provide iterators to the vector of HepMC vertices at the same position as this TrackingVertex
g4Vertices_begin() and g4Vertices_end()
Provide iterators to the vector of GEANT vertices at the same position as this TrackingVertex
daughterTracks_begin() and daughterTracks_end()
Provide iterators to the vector of TrackingParticles emanating from this vertex.
sourceTracks_begin() and sourceTracks_end()
Provide iterators to the vector of TrackingParticles leading into this vertex. There can be multiple entries since vertices can be combined. In this case, a track may often appear in the source and daughter track lists.
g4Vertices()
Returns the vector of GEANT vertices at the same position as this TrackingVertex
genVertices()
Returns the vector of HepMC vertices at the same position as this TrackingVertex
sourceTracks()
Returns the vector of TrackingParticles leading into this vertex.
daughterTracks()
Returns the vector of TrackingParticles emanating from this vertex.
position()
Returns the position (x,y,z,t) of the vertex
eventId()
Returns the EncodedEventId of the vertex. The EncodedEventId provides methods to determine which bunch crossing and which event within the bunch crossing the track came from.
inVolume()
Is the vertex inside the tracker volume

Usage Examples

The test code for the tracking truth information (TrackingTruthTest.cc) shows a number of examples of how to use the information in TrackingVertex and TrackingParticle, including how to use the EDM references that link tracks and vertices together.

Association of Truth Tracks to Reconstructed Tracks

The track associator uses TrackingParticle objects and associates them with reconstructed tracks.

Similarly, a vertex associator is under construction.

Review status

Reviewer/Editor and Date (copy from screen) Comments
Main.PhilippPigard - 2015-03-16 Added note on adding the TrackingParticle module via cmsDriver and PSimHits in CMSSW7
Main.ThomasHauth - 2013-04-11 Updated the event content to FEVTDEBUG and added cmsDriver example
Main.IanTomalin - 2009-10-16 Made clear these dont exist on RECO
Main.VictorBazterra - 2009-08-27 Starting page update
Main.JennyWilliams - 13 Feb 2007 edited for swguide inclusion
Main.ewv - 29 Dec 2006 page content last edited

Responsible: Main.VictorBazterra

Edit | Attach | Watch | Print version | History: r17 < r16 < r15 < r14 < r13 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r17 - 2015-09-28 - WilliamFord



 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback