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
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
fireworks::addStraightLineSegment
void addStraightLineSegment(TEveStraightLineSet *marker, reco::Candidate const *cand, double scale_factor=2)
Definition: CandidateUtils.cc:19
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
cand
Definition: decayParser.h:32
reco::Candidate
Definition: Candidate.h:27
CandidateUtils.h
fireworks::prepareCandidate
TEveTrack * prepareCandidate(const reco::Candidate &track, TEveTrackPropagator *propagator)
Definition: CandidateUtils.cc:9
fireworks
Definition: FWTauProxyBuilderBase.h:35
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443