CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: TrackUtils.h,v 1.25 2010/09/07 15:46:48 yana Exp $
8 //
9 
10 // system include files
11 #include "TEveVSDStructs.h"
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 int m_nrows );
68 float pixelLocalY( const double mpy, const int m_ncols );
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
bool operator()(const State &state1, const State &state2) const
Definition: TrackUtils.h:55
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:70
float pixelLocalY(const double mpy, const int m_ncols)
Definition: TrackUtils.cc:198
void localSiStrip(short strip, float *localTop, float *localBottom, const float *pars, unsigned int id)
Definition: TrackUtils.cc:292
State(const TEveVector &pos, const TEveVector &mom)
Definition: TrackUtils.h:43
const SiStripCluster * extractClusterFromTrackingRecHit(const TrackingRecHit *rh)
Definition: TrackUtils.cc:359
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:622
void addSiStripClusters(const FWEventItem *iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master)
Definition: TrackUtils.cc:404
Definition: DetId.h:20
StateOrdering(const TEveVector &momentum)
Definition: TrackUtils.h:51
TEveVector momentum
Definition: TrackUtils.h:36
Pixel cluster – collection of neighboring pixels above threshold.
std::string info(const DetId &)
Definition: TrackUtils.cc:703
void pushNearbyPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:566
void pushPixelCluster(std::vector< TVector3 > &pixelPoints, const FWGeometry &geom, DetId id, const SiPixelCluster &c, const float *pars)
Definition: TrackUtils.cc:669
float pixelLocalX(const double mpx, const int m_nrows)
Definition: TrackUtils.cc:165