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 float phase2PixelLocalX( const double mpx, const float*, const float* );
71 float phase2PixelLocalY( const double mpy, const float*, const float* );
72 
73 void localSiStrip( short strip, float* localTop, float* localBottom, const float* pars, unsigned int id );
74 
75 void pushPixelHits( std::vector<TVector3> &pixelPoints, const FWEventItem &iItem, const reco::Track &t );
76 void pushNearbyPixelHits( std::vector<TVector3> &pixelPoints, const FWEventItem &iItem, const reco::Track &t );
77 void pushPixelCluster( std::vector<TVector3> &pixelPoints, const FWGeometry &geom, DetId id, const SiPixelCluster &c, const float* pars );
78 
79 void addSiStripClusters( const FWEventItem* iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master );
80 
81 // Helpers for data extraction
83 
84 // Helper functions to get human readable informationa about given DetId
85 // (copied from TrackingTools/TrackAssociator)
86 std::string info( const DetId& );
87 std::string info( const std::set<DetId>& );
88 std::string info( const std::vector<DetId>& );
89 }
90 
91 #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
float phase2PixelLocalY(const double mpy, const float *, const float *)
Definition: TrackUtils.cc:269
void localSiStrip(short strip, float *localTop, float *localBottom, const float *pars, unsigned int id)
Definition: TrackUtils.cc:278
State(const TEveVector &pos, const TEveVector &mom)
Definition: TrackUtils.h:43
float phase2PixelLocalX(const double mpx, const float *, const float *)
Definition: TrackUtils.cc:261
const SiStripCluster * extractClusterFromTrackingRecHit(const TrackingRecHit *rh)
Definition: TrackUtils.cc:345
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:594
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:368
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:535
void pushPixelCluster(std::vector< TVector3 > &pixelPoints, const FWGeometry &geom, DetId id, const SiPixelCluster &c, const float *pars)
Definition: TrackUtils.cc:641