CMS 3D CMS Logo

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* prepareCandidate(const reco::Candidate& track, TEveTrackPropagator* propagator) {
10  TEveRecTrack t;
11  t.fBeta = 1.;
12  t.fP = TEveVector(track.px(), track.py(), track.pz());
13  t.fV = TEveVector(track.vertex().x(), track.vertex().y(), track.vertex().z());
14  t.fSign = track.charge();
15  TEveTrack* trk = new TEveTrack(&t, propagator);
16  return trk;
17  }
18 
19  void addStraightLineSegment(TEveStraightLineSet* marker, reco::Candidate const* cand, double scale_factor) {
20  double phi = cand->phi();
21  double theta = cand->theta();
22  double size = cand->pt() * scale_factor;
23  marker->AddLine(0, 0, 0, size * cos(phi) * sin(theta), size * sin(phi) * sin(theta), size * cos(theta));
24  }
25 } // namespace fireworks
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Trktree trk
Definition: Trktree.cc:2
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void addStraightLineSegment(TEveStraightLineSet *marker, reco::Candidate const *cand, double scale_factor=2)
TEveTrack * prepareCandidate(const reco::Candidate &track, TEveTrackPropagator *propagator)