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 
12 // forward declarations
13 namespace reco
14 {
15  class Track;
16 }
17 class RecSegment;
18 
19 class FWEventItem;
20 class TEveElement;
21 class TEveTrack;
22 class TEveTrackPropagator;
23 class DetId;
24 class FWGeometry;
25 class TEveStraightLineSet;
26 
27 class SiPixelCluster;
28 class SiStripCluster;
29 class TrackingRecHit;
30 
31 namespace fireworks {
32 
33 struct State {
34  TEveVector position;
35  TEveVector momentum;
36  bool valid;
37  State() : valid(false) {
38  }
39  State(const TEveVector& pos) :
40  position(pos), valid(false) {
41  }
42  State(const TEveVector& pos, const TEveVector& mom) :
43  position(pos), momentum(mom), valid(true) {
44  }
45 };
46 
48  TEveVector m_direction;
49 public:
50  StateOrdering( const TEveVector& momentum ) {
51  m_direction = momentum;
52  m_direction.Normalize();
53  }
54  bool operator() ( const State& state1,
55  const State& state2 ) const {
56  double product1 = state1.position.Perp()*(state1.position.fX*m_direction.fX + state1.position.fY*m_direction.fY>0 ? 1 : -1);
57  double product2 = state2.position.Perp()*(state2.position.fX*m_direction.fX + state2.position.fY*m_direction.fY>0 ? 1 : -1);
58  return product1 < product2;
59  }
60 };
61 
62 TEveTrack* prepareTrack( const reco::Track& track,
63  TEveTrackPropagator* propagator,
64  const std::vector<TEveVector>& extraRefPoints = std::vector<TEveVector>() );
65 
66 float pixelLocalX( const double mpx, const float* );
67 float pixelLocalY( const double mpy, const float* );
68 
69 void localSiStrip( short strip, float* localTop, float* localBottom, const float* pars, unsigned int id );
70 
71 void pushPixelHits( std::vector<TVector3> &pixelPoints, const FWEventItem &iItem, const reco::Track &t );
72 void pushNearbyPixelHits( std::vector<TVector3> &pixelPoints, const FWEventItem &iItem, const reco::Track &t );
73 void pushPixelCluster( std::vector<TVector3> &pixelPoints, const FWGeometry &geom, DetId id, const SiPixelCluster &c, const float* pars );
74 
75 void addSiStripClusters( const FWEventItem* iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master );
76 
77 // Helpers for data extraction
79 
80 // Helper functions to get human readable informationa about given DetId
81 // (copied from TrackingTools/TrackAssociator)
82 std::string info( const DetId& );
83 std::string info( const std::set<DetId>& );
84 std::string info( const std::vector<DetId>& );
85 }
86 
87 #endif // Fireworks_Tracks_TrackUtils_h
State(const TEveVector &pos)
Definition: TrackUtils.h:39
TEveVector position
Definition: TrackUtils.h:34
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:69
void localSiStrip(short strip, float *localTop, float *localBottom, const float *pars, unsigned int id)
Definition: TrackUtils.cc:268
State(const TEveVector &pos, const TEveVector &mom)
Definition: TrackUtils.h:42
const SiStripCluster * extractClusterFromTrackingRecHit(const TrackingRecHit *rh)
Definition: TrackUtils.cc:335
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:582
float pixelLocalX(const double mpx, const float *)
Definition: TrackUtils.cc:166
void addSiStripClusters(const FWEventItem *iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master)
Definition: TrackUtils.cc:358
float pixelLocalY(const double mpy, const float *)
Definition: TrackUtils.cc:222
Definition: DetId.h:18
StateOrdering(const TEveVector &momentum)
Definition: TrackUtils.h:50
TEveVector momentum
Definition: TrackUtils.h:35
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:524
void pushPixelCluster(std::vector< TVector3 > &pixelPoints, const FWGeometry &geom, DetId id, const SiPixelCluster &c, const float *pars)
Definition: TrackUtils.cc:629