CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CandidateUtils.cc
Go to the documentation of this file.
2 #include "TEveVSDStructs.h"
3 #include "TEveTrack.h"
4 #include "TEveVector.h"
5 #include "TEveStraightLineSet.h"
6 
7 namespace fireworks {
8 
9 TEveTrack*
11  TEveTrackPropagator* propagator)
12 {
13  TEveRecTrack t;
14  t.fBeta = 1.;
15  t.fP = TEveVector( track.px(), track.py(), track.pz() );
16  t.fV = TEveVector( track.vertex().x(), track.vertex().y(), track.vertex().z() );
17  t.fSign = track.charge();
18  TEveTrack* trk = new TEveTrack(&t, propagator);
19  return trk;
20 }
21 
22 void
23 addStraightLineSegment( TEveStraightLineSet* marker,
24  reco::Candidate const* cand,
25  double scale_factor)
26 {
27  double phi = cand->phi();
28  double theta = cand->theta();
29  double size = cand->pt() * scale_factor;
30  marker->AddLine( 0, 0, 0, size * cos(phi)*sin(theta), size *sin(phi)*sin(theta), size*cos(theta));
31 }
32 }
tuple t
Definition: tree.py:139
virtual double pt() const =0
transverse momentum
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
virtual double pz() const =0
z coordinate of momentum vector
Geom::Theta< T > theta() const
virtual double theta() const =0
momentum polar angle
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void addStraightLineSegment(TEveStraightLineSet *marker, reco::Candidate const *cand, double scale_factor=2)
virtual const Point & vertex() const =0
vertex position
virtual int charge() const =0
electric charge
virtual double py() const =0
y coordinate of momentum vector
virtual double px() const =0
x coordinate of momentum vector
Geom::Phi< T > phi() const
TEveTrack * prepareCandidate(const reco::Candidate &track, TEveTrackPropagator *propagator)
tuple size
Write out results.
virtual double phi() const =0
momentum azimuthal angle