CMS 3D CMS Logo

TrackUtils.h
Go to the documentation of this file.
1 #ifndef Fireworks_Tracks_TrackUtils_h
2 #define Fireworks_Tracks_TrackUtils_h
3 // -*- C++ -*-
4 //
5 // Package: Tracks
6 // Class : TrackUtils
7 //
8 
9 // system include files
10 #include "TEveVSDStructs.h"
11 #include <set>
12 
13 // forward declarations
14 namespace reco
15 {
16  class Track;
17 }
18 class RecSegment;
19 
20 class FWEventItem;
21 class TEveElement;
22 class TEveTrack;
23 class TEveTrackPropagator;
24 class DetId;
25 class FWGeometry;
26 class TEveStraightLineSet;
27 
28 class SiPixelCluster;
29 class SiStripCluster;
30 class TrackingRecHit;
31 
32 namespace fireworks {
33 
34 struct State {
35  TEveVector position;
36  TEveVector momentum;
37  bool valid;
38  State() : valid(false) {
39  }
40  State(const TEveVector& pos) :
41  position(pos), valid(false) {
42  }
43  State(const TEveVector& pos, const TEveVector& mom) :
44  position(pos), momentum(mom), valid(true) {
45  }
46 };
47 
49  TEveVector m_direction;
50 public:
51  StateOrdering( const TEveVector& momentum ) {
52  m_direction = momentum;
53  m_direction.Normalize();
54  }
55  bool operator() ( const State& state1,
56  const State& state2 ) const {
57  double product1 = state1.position.Perp()*(state1.position.fX*m_direction.fX + state1.position.fY*m_direction.fY>0 ? 1 : -1);
58  double product2 = state2.position.Perp()*(state2.position.fX*m_direction.fX + state2.position.fY*m_direction.fY>0 ? 1 : -1);
59  return product1 < product2;
60  }
61 };
62 
63 TEveTrack* prepareTrack( const reco::Track& track,
64  TEveTrackPropagator* propagator,
65  const std::vector<TEveVector>& extraRefPoints = std::vector<TEveVector>() );
66 
67 float pixelLocalX( const double mpx, const float* );
68 float pixelLocalY( const double mpy, const float* );
69 
70 void localSiStrip( short strip, float* localTop, float* localBottom, const float* pars, unsigned int id );
71 
72 void pushPixelHits( std::vector<TVector3> &pixelPoints, const FWEventItem &iItem, const reco::Track &t );
73 void pushNearbyPixelHits( std::vector<TVector3> &pixelPoints, const FWEventItem &iItem, const reco::Track &t );
74 void pushPixelCluster( std::vector<TVector3> &pixelPoints, const FWGeometry &geom, DetId id, const SiPixelCluster &c, const float* pars );
75 
76 void addSiStripClusters( const FWEventItem* iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master );
77 
78 // Helpers for data extraction
80 
81 // Helper functions to get human readable informationa about given DetId
82 // (copied from TrackingTools/TrackAssociator)
83 std::string info( const DetId& );
84 std::string info( const std::set<DetId>& );
85 std::string info( const std::vector<DetId>& );
86 }
87 
88 #endif // Fireworks_Tracks_TrackUtils_h
State(const TEveVector &pos)
Definition: TrackUtils.h:40
TEveVector position
Definition: TrackUtils.h:35
Master< F > master(const F &f)
Definition: FunctClone.h:68
static const TGPicture * info(bool iBackgroundIsBlack)
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:63
void localSiStrip(short strip, float *localTop, float *localBottom, const float *pars, unsigned int id)
Definition: TrackUtils.cc:262
State(const TEveVector &pos, const TEveVector &mom)
Definition: TrackUtils.h:43
const SiStripCluster * extractClusterFromTrackingRecHit(const TrackingRecHit *rh)
Definition: TrackUtils.cc:329
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:576
float pixelLocalX(const double mpx, const float *)
Definition: TrackUtils.cc:160
void addSiStripClusters(const FWEventItem *iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master)
Definition: TrackUtils.cc:352
float pixelLocalY(const double mpy, const float *)
Definition: TrackUtils.cc:216
Definition: DetId.h:18
StateOrdering(const TEveVector &momentum)
Definition: TrackUtils.h:51
TEveVector momentum
Definition: TrackUtils.h:36
Pixel cluster – collection of neighboring pixels above threshold.
fixed size matrix
void pushNearbyPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:518
void pushPixelCluster(std::vector< TVector3 > &pixelPoints, const FWGeometry &geom, DetId id, const SiPixelCluster &c, const float *pars)
Definition: TrackUtils.cc:623