TWiki
>
CMSPublic Web
>
SWGuide
>
SWGuideVertexReco
>
SWGuideTransientTracks
(2013-08-19,
IanTomalin
)
(raw view)
E
dit
A
ttach
P
DF
---+!! Transient Tracks %COMPLETE3% %TOC{title="Contents:"}% ---++ Usage of !TransientTracks objects For most high-level algorithms, the ==reco::Track== is unsuitable, since it does not have access to the magnetic field, which prevents one estimating the track parameters at arbitrary points along its trajectory. A ==TransientTracks== has thus to be used. It has a pointer to the magnetic field, and can be given a pointer to the geometry as well. To easiest and safest way is to build the ==TransientTracks== using the ==TransientTrackBuilder==. Link to Reference Manual (doxygen): [[https://cmssdt.cern.ch/SDT/doxygen/CMSSW_5_3_5/doc/html/d9/d6e/classreco_1_1TrackTransientTrack.html][TransientTracks]] , [[https://cmssdt.cern.ch/SDT/doxygen/CMSSW_5_3_5/doc/html/d0/db2/classTransientTrackBuilder.html][TransientTrackBuilder]] . To use the !TransientTrackBuilder, you have to add the following into your cfg: <verbatim> process.load("TrackingTools/TransientTrack/TransientTrackBuilder_cfi") process.load("Configuration.Geometry.GeometryIdeal_cff") process.load("Configuration.StandardSequences.MagneticField_cff") process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.GlobalTag.globaltag = 'GR_P_V42_AN3::All' # or some other global tag depending on your CMSSW release and sample. </verbatim> You may need to include header files into your analyzer, look for example here: [[http://cmslxr.fnal.gov/lxr/source/TrackingTools/TransientTrack/test/TransientTrackBuilderTest.cc][TransientTrackBuilderTest.cc]]. To get the !TransientTrackBuilder from the !EventSetup: <verbatim> edm::ESHandle<TransientTrackBuilder> theB; setup.get<TransientTrackRecord>().get("TransientTrackBuilder",theB); </verbatim> You can now build your !TransientTracks from =Track=, =TrackRef=, or directly from the =edm::handle= to a =TrackCollection=: <verbatim> reco::TransientTrack * build ( const reco::Track * p) const; reco::TransientTrack * build ( const reco::TrackRef * p) const; std::vector<reco::TransientTrack> build ( const edm::Handle<reco::TrackCollection> & trkColl) const; </verbatim> You also have to include these packages into your =BuildFile.xml=: ==TrackingTools/TransientTrack== and ==TrackingTools/Records==. ---++ Examples (including calculation of track impact parameters) <verbatim> // get RECO tracks from the event edm::Handle<reco::TrackCollection> tks; iEvent.getByLabel(trackLabel(), tks); //get the builder: edm::ESHandle<TransientTrackBuilder> theB; iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",theB); //do the conversion: vector<TransientTrack> t_tks = (*theB).build(tks); </verbatim> One can use !TransientTracks to estimate *track impact parameters* with respect to the beam line or primary vertex, taking into account the curvature of the track. <verbatim> // with respect to beam-line TransientTrack tk = ...; TrajectoryStateClosestToBeamLine traj = tk.stateAtBeamLine(); Measurement1D meas = traj.transverseImpactParameter(); double d0 = meas.value(); double d0_error = meas.error(); </verbatim> <verbatim> // with respect to any specified vertex, such as primary vertex GlobalPoint vert(pv.x(), pv.y(), pv.z()); TrajectoryStateClosestToPoint traj = tk.trajectoryStateClosestToPoint(vert ); double d0 = traj.perigeeParameters().transverseImpactParameter(); double d0_error = traj.perigeeError().transverseImpactParameterError(); double z0 = traj.perigeeParameters().longitudinalImpactParameter() double z0_error = traj.perigeeParameters().longitudinalImpactParameterError() </verbatim> You can get more sophisticated impact parameters (e.g., 3D, signed ...) using the IPTools software, although it won't tell you z0. For example: <pre> #include "TrackingTools/IPTools/interface/IPTools.h" double d03D = IPTools::absoluteImpactParameter3D(tk, pv).second; </pre> where tk is a TransientTrack and pv is the PrimaryVertex. ---++ A few more details * The ==TransientTrack== is reference counted. * Different concrete implementation of the basic !TransientTrack exist. This allows their use with different types of basic track objest (==reco::GsfTrack==, ==reco::Track==, ==FreeTrajectoryState== without persistent track, e.g. for refitted tracks). For a correct usage, the ==TransientTrack== should be built using the !TransientTrackBuilder, or, if you have a !FreeTrajectoryState, using the !TransientTrackFromFTSFactory. * In case the ==TransientTrack== has been created from a persistent track, the method ==track()== allows to access the ==reco::Track==. If not, a new ==reco::Track== is created. This track can also be saved in the event. * In addition, several ==reco::Track== methods (e.g. the hit pattern) are implemented, and forward the call to the persistent track. An exception is thrown in case no persistent track is available. * Since the TT is reference counted, if you request the builder a single TT, you do not get a pointer, and you do not need to delete at the and of your block. So use it like that: <verbatim> const reco::TransientTrack transientTrack = theBuilder->build(&lepton); </verbatim> #ReviewStatus ---++!! Review Status | *Editor/Reviewer and date* | *Comments* | | Main.speer - 17 Jul 2006 | Page Author | | Main.JennyWilliams - 28 Mar 2007 | moved page into !SWGuide | | Main.ThomasSpeer - 27 Feb 2009|Review and update| %RESPONSIBLE% Main.speer (Thomas Speer) %BR%
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r20
<
r19
<
r18
<
r17
<
r16
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r20 - 2013-08-19
-
IanTomalin
Log In
CMSPublic
CMSPublic Web
CMSPrivate Web
Create New Topic
Index
Search
Changes
Notifications
Statistics
Preferences
Offline SW Guide
Summary of Changes
Site Map
Preface
Contributors Guide
Developers Guide
Offline Workbook
Glossary/Index
User Support
Reference Manual
Main Areas
Framework and EDM
Detector Description
Event Generation
Full Simulation
Fast Simulation
Calibration and Alignment
Conditions Database
High Level Trigger
L1 Trigger
Online Selection
Reconstruction
Detector Reco Objects
Tracks
Ecal Reco
Hcal Reco
Muon System Reco
Vertex Reco
Physics Reco Objects
Muons
Electrons/Photons
Jets, missing ET
b Tagging
Particle flow
Tau-ID
Analysis/Software Tools
Physics Tools
MC Truth Tools
Visualization
Trouble Shooting
Code Performance
Port to New Release
CRAB
Analysis Examples
Higgs
SUSY/BSM
Electroweak
Top
Heavy Ions
Public webs
Public webs
ABATBEA
ACPP
ADCgroup
AEGIS
AfricaMap
AgileInfrastructure
ALICE
AliceEbyE
AliceSPD
AliceSSD
AliceTOF
AliFemto
ALPHA
Altair
ArdaGrid
ASACUSA
AthenaFCalTBAna
Atlas
AtlasLBNL
AXIALPET
CAE
CALICE
CDS
CENF
CERNSearch
CLIC
Cloud
CloudServices
CMS
Controls
CTA
CvmFS
DB
DefaultWeb
DESgroup
DPHEP
DM-LHC
DSSGroup
EGEE
EgeePtf
ELFms
EMI
ETICS
FIOgroup
FlukaTeam
Frontier
Gaudi
GeneratorServices
GuidesInfo
HardwareLabs
HCC
HEPIX
ILCBDSColl
ILCTPC
IMWG
Inspire
IPv6
IT
ItCommTeam
ITCoord
ITdeptTechForum
ITDRP
ITGT
ITSDC
LAr
LCG
LCGAAWorkbook
Leade
LHCAccess
LHCAtHome
LHCb
LHCgas
LHCONE
LHCOPN
LinuxSupport
Main
Medipix
Messaging
MPGD
NA49
NA61
NA62
NTOF
Openlab
PDBService
Persistency
PESgroup
Plugins
PSAccess
PSBUpgrade
R2Eproject
RCTF
RD42
RFCond12
RFLowLevel
ROXIE
Sandbox
SocialActivities
SPI
SRMDev
SSM
Student
SuperComputing
Support
SwfCatalogue
TMVA
TOTEM
TWiki
UNOSAT
Virtualization
VOBox
WITCH
XTCA
Cern Search
TWiki Search
Google Search
CMSPublic
All webs
Copyright &© 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use
Discourse
or
Send feedback