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  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  State(const TEveVector& pos) : position(pos), valid(false) {}
39  State(const TEveVector& pos, const TEveVector& mom) : position(pos), momentum(mom), valid(true) {}
40  };
41 
42  class StateOrdering {
43  TEveVector m_direction;
44 
45  public:
46  StateOrdering(const TEveVector& momentum) {
47  m_direction = momentum;
48  m_direction.Normalize();
49  }
50  bool operator()(const State& state1, const State& state2) const {
51  double product1 = state1.position.Perp() *
52  (state1.position.fX * m_direction.fX + state1.position.fY * m_direction.fY > 0 ? 1 : -1);
53  double product2 = state2.position.Perp() *
54  (state2.position.fX * m_direction.fX + state2.position.fY * m_direction.fY > 0 ? 1 : -1);
55  return product1 < product2;
56  }
57  };
58 
59  TEveTrack* prepareTrack(const reco::Track& track,
60  TEveTrackPropagator* propagator,
61  const std::vector<TEveVector>& extraRefPoints = std::vector<TEveVector>());
62 
63  float pixelLocalX(const double mpx, const float*);
64  float pixelLocalY(const double mpy, const float*);
65 
66  float phase2PixelLocalX(const double mpx, const float*, const float*);
67  float phase2PixelLocalY(const double mpy, const float*, 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(
74  std::vector<TVector3>& pixelPoints, const FWGeometry& geom, DetId id, const SiPixelCluster& c, const float* pars);
75 
76  void addSiStripClusters(
77  const FWEventItem* iItem, const reco::Track& t, class TEveElement* tList, bool addNearbyClusters, bool master);
78 
79  // Helpers for data extraction
81 
82  // Helper functions to get human readable informationa about given DetId
83  // (copied from TrackingTools/TrackAssociator)
84  std::string info(const DetId&);
85  std::string info(const std::set<DetId>&);
86  std::string info(const std::vector<DetId>&);
87 } // namespace fireworks
88 
89 #endif // Fireworks_Tracks_TrackUtils_h
State(const TEveVector &pos)
Definition: TrackUtils.h:38
TEveVector position
Definition: TrackUtils.h:34
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:62
float phase2PixelLocalY(const double mpy, const float *, const float *)
Definition: TrackUtils.cc:255
void localSiStrip(short strip, float *localTop, float *localBottom, const float *pars, unsigned int id)
Definition: TrackUtils.cc:263
State(const TEveVector &pos, const TEveVector &mom)
Definition: TrackUtils.h:39
float phase2PixelLocalX(const double mpx, const float *, const float *)
Definition: TrackUtils.cc:249
const SiStripCluster * extractClusterFromTrackingRecHit(const TrackingRecHit *rh)
Definition: TrackUtils.cc:318
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:533
float pixelLocalX(const double mpx, const float *)
Definition: TrackUtils.cc:159
void addSiStripClusters(const FWEventItem *iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master)
Definition: TrackUtils.cc:336
float pixelLocalY(const double mpy, const float *)
Definition: TrackUtils.cc:209
Definition: DetId.h:17
StateOrdering(const TEveVector &momentum)
Definition: TrackUtils.h:46
TEveVector momentum
Definition: TrackUtils.h:35
Pixel cluster – collection of neighboring pixels above threshold.
fixed size matrix
std::string info(const DetId &)
Definition: TrackUtils.cc:599
void pushNearbyPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:480
bool operator()(const State &state1, const State &state2) const
Definition: TrackUtils.h:50
void pushPixelCluster(std::vector< TVector3 > &pixelPoints, const FWGeometry &geom, DetId id, const SiPixelCluster &c, const float *pars)
Definition: TrackUtils.cc:570