Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:59

0001 #include "Fireworks/Candidates/interface/CandidateUtils.h"
0002 #include "TEveVSDStructs.h"
0003 #include "TEveTrack.h"
0004 #include "TEveVector.h"
0005 #include "TEveStraightLineSet.h"
0006 
0007 namespace fireworks {
0008 
0009   TEveTrack* prepareCandidate(const reco::Candidate& track, TEveTrackPropagator* propagator) {
0010     TEveRecTrack t;
0011     t.fBeta = 1.;
0012     t.fP = TEveVector(track.px(), track.py(), track.pz());
0013     t.fV = TEveVector(track.vertex().x(), track.vertex().y(), track.vertex().z());
0014     t.fSign = track.charge();
0015     TEveTrack* trk = new TEveTrack(&t, propagator);
0016     return trk;
0017   }
0018 
0019   void addStraightLineSegment(TEveStraightLineSet* marker, reco::Candidate const* cand, double scale_factor) {
0020     double phi = cand->phi();
0021     double theta = cand->theta();
0022     double size = cand->pt() * scale_factor;
0023     marker->AddLine(0, 0, 0, size * cos(phi) * sin(theta), size * sin(phi) * sin(theta), size * cos(theta));
0024   }
0025 }  // namespace fireworks