Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:27:33

0001 #ifndef Fireworks_Tracks_TrackUtils_h
0002 #define Fireworks_Tracks_TrackUtils_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Tracks
0006 // Class  :     TrackUtils
0007 //
0008 
0009 // system include files
0010 #include "TEveVSDStructs.h"
0011 #include <set>
0012 
0013 // forward declarations
0014 namespace reco {
0015   class Track;
0016 }
0017 class RecSegment;
0018 
0019 class FWEventItem;
0020 class TEveElement;
0021 class TEveTrack;
0022 class TEveTrackPropagator;
0023 class DetId;
0024 class FWGeometry;
0025 class TEveStraightLineSet;
0026 
0027 class SiPixelCluster;
0028 class SiStripCluster;
0029 class TrackingRecHit;
0030 
0031 namespace fireworks {
0032 
0033   struct State {
0034     TEveVector position;
0035     TEveVector momentum;
0036     bool valid;
0037     State() : valid(false) {}
0038     State(const TEveVector& pos) : position(pos), valid(false) {}
0039     State(const TEveVector& pos, const TEveVector& mom) : position(pos), momentum(mom), valid(true) {}
0040   };
0041 
0042   class StateOrdering {
0043     TEveVector m_direction;
0044 
0045   public:
0046     StateOrdering(const TEveVector& momentum) {
0047       m_direction = momentum;
0048       m_direction.Normalize();
0049     }
0050     bool operator()(const State& state1, const State& state2) const {
0051       double product1 = state1.position.Perp() *
0052                         (state1.position.fX * m_direction.fX + state1.position.fY * m_direction.fY > 0 ? 1 : -1);
0053       double product2 = state2.position.Perp() *
0054                         (state2.position.fX * m_direction.fX + state2.position.fY * m_direction.fY > 0 ? 1 : -1);
0055       return product1 < product2;
0056     }
0057   };
0058 
0059   TEveTrack* prepareTrack(const reco::Track& track,
0060                           TEveTrackPropagator* propagator,
0061                           const std::vector<TEveVector>& extraRefPoints = std::vector<TEveVector>());
0062 
0063   float pixelLocalX(const double mpx, const float*);
0064   float pixelLocalY(const double mpy, const float*);
0065 
0066   float phase2PixelLocalX(const double mpx, const float*, const float*);
0067   float phase2PixelLocalY(const double mpy, const float*, const float*);
0068 
0069   void localSiStrip(short strip, float* localTop, float* localBottom, const float* pars, unsigned int id);
0070 
0071   void pushPixelHits(std::vector<TVector3>& pixelPoints, const FWEventItem& iItem, const reco::Track& t);
0072   void pushNearbyPixelHits(std::vector<TVector3>& pixelPoints, const FWEventItem& iItem, const reco::Track& t);
0073   void pushPixelCluster(
0074       std::vector<TVector3>& pixelPoints, const FWGeometry& geom, DetId id, const SiPixelCluster& c, const float* pars);
0075 
0076   void addSiStripClusters(
0077       const FWEventItem* iItem, const reco::Track& t, class TEveElement* tList, bool addNearbyClusters, bool master);
0078 
0079   // Helpers for data extraction
0080   const SiStripCluster* extractClusterFromTrackingRecHit(const TrackingRecHit* rh);
0081 
0082   // Helper functions to get human readable informationa about given DetId
0083   // (copied from TrackingTools/TrackAssociator)
0084   std::string info(const DetId&);
0085   std::string info(const std::set<DetId>&);
0086   std::string info(const std::vector<DetId>&);
0087 }  // namespace fireworks
0088 
0089 #endif  // Fireworks_Tracks_TrackUtils_h