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
FWGeometry
Definition: FWGeometry.h:27
fireworks::State
Definition: TrackUtils.h:33
funct::false
false
Definition: Factorize.h:34
fireworks::pixelLocalX
float pixelLocalX(const double mpx, const float *)
Definition: TrackUtils.cc:159
fireworks::State::momentum
TEveVector momentum
Definition: TrackUtils.h:35
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
fireworks::StateOrdering::m_direction
TEveVector m_direction
Definition: TrackUtils.h:43
fireworks::pushPixelHits
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:533
pos
Definition: PixelAliasList.h:18
RecSegment
Definition: RecSegment.h:27
SiPixelCluster
Pixel cluster – collection of neighboring pixels above threshold.
Definition: SiPixelCluster.h:27
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
fireworks::info
std::string info(const DetId &)
Definition: TrackUtils.cc:599
DetId
Definition: DetId.h:17
fireworks::State::valid
bool valid
Definition: TrackUtils.h:36
fireworks::addSiStripClusters
void addSiStripClusters(const FWEventItem *iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master)
Definition: TrackUtils.cc:336
fireworks::State::State
State(const TEveVector &pos)
Definition: TrackUtils.h:38
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
fireworks::State::State
State(const TEveVector &pos, const TEveVector &mom)
Definition: TrackUtils.h:39
reco::Track
Definition: Track.h:27
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
OrderedSet.t
t
Definition: OrderedSet.py:90
fireworks::State::position
TEveVector position
Definition: TrackUtils.h:34
fireworks::pixelLocalY
float pixelLocalY(const double mpy, const float *)
Definition: TrackUtils.cc:209
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
funct::true
true
Definition: Factorize.h:173
fireworks::prepareTrack
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:62
fireworks::State::State
State()
Definition: TrackUtils.h:37
fireworks::extractClusterFromTrackingRecHit
const SiStripCluster * extractClusterFromTrackingRecHit(const TrackingRecHit *rh)
Definition: TrackUtils.cc:318
fireworks::StateOrdering::StateOrdering
StateOrdering(const TEveVector &momentum)
Definition: TrackUtils.h:46
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
TrackingRecHit
Definition: TrackingRecHit.h:21
fireworks::pushNearbyPixelHits
void pushNearbyPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:480
fireworks::pushPixelCluster
void pushPixelCluster(std::vector< TVector3 > &pixelPoints, const FWGeometry &geom, DetId id, const SiPixelCluster &c, const float *pars)
Definition: TrackUtils.cc:570
FWEventItem
Definition: FWEventItem.h:56
fireworks::phase2PixelLocalY
float phase2PixelLocalY(const double mpy, const float *, const float *)
Definition: TrackUtils.cc:255
fireworks::localSiStrip
void localSiStrip(short strip, float *localTop, float *localBottom, const float *pars, unsigned int id)
Definition: TrackUtils.cc:263
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
fireworks::StateOrdering::operator()
bool operator()(const State &state1, const State &state2) const
Definition: TrackUtils.h:50
fireworks::StateOrdering
Definition: TrackUtils.h:42
fireworks
Definition: FWTauProxyBuilderBase.h:35
volumeBasedMagneticField_160812_cfi.master
master
Definition: volumeBasedMagneticField_160812_cfi.py:60
SiStripCluster
Definition: SiStripCluster.h:9
fireworks::phase2PixelLocalX
float phase2PixelLocalX(const double mpx, const float *, const float *)
Definition: TrackUtils.cc:249