CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/Fireworks/Candidates/src/CandidateUtils.cc

Go to the documentation of this file.
00001 #include "Fireworks/Candidates/interface/CandidateUtils.h"
00002 #include "TEveVSDStructs.h"
00003 #include "TEveTrack.h"
00004 #include "TEveVector.h"
00005 #include "TEveStraightLineSet.h"
00006 
00007 namespace fireworks {
00008 
00009 TEveTrack*
00010 prepareCandidate(const reco::Candidate& track,
00011                  TEveTrackPropagator* propagator)
00012 {
00013    TEveRecTrack t;
00014    t.fBeta = 1.;
00015    t.fP = TEveVector( track.px(), track.py(), track.pz() );
00016    t.fV = TEveVector( track.vertex().x(), track.vertex().y(), track.vertex().z() );
00017    t.fSign = track.charge();
00018    TEveTrack* trk = new TEveTrack(&t, propagator);
00019    return trk;
00020 }
00021   
00022 void
00023 addStraightLineSegment( TEveStraightLineSet* marker,
00024                         reco::Candidate const* cand,
00025                         double scale_factor)
00026 {
00027    double phi = cand->phi();
00028    double theta = cand->theta();
00029    double size = cand->pt() * scale_factor;
00030    marker->AddLine( 0, 0, 0, size * cos(phi)*sin(theta), size *sin(phi)*sin(theta), size*cos(theta));
00031 }
00032 }