CMS 3D CMS Logo

TrackingRegion.h
Go to the documentation of this file.
1 #ifndef TrackingRegion_H
2 #define TrackingRegion_H
3 
11 
18 
20 
23 
24 #include <utility>
25 
26 #include <sstream>
27 #include <memory>
28 #include <vector>
29 #include <string>
30 
31 class DetLayer;
32 class HitRZCompatibility;
33 class BarrelDetLayer;
34 class ForwardDetLayer;
35 
36 namespace edm {
37  class Event;
38 }
39 
41 public:
42 public:
43  virtual ~TrackingRegion() {}
47 
48 public:
50 
52  const GlobalPoint& originPos,
53  const Range& invPtRange,
54  const float& originRBound,
55  const float& originZBound)
58  theVertexPos(originPos),
64 
66  GlobalVector const& direction() const { return theDirection; }
67  GlobalVector const& unitDirection() const { return theUnitDirection; }
68 
69  float phiDirection() const { return thePhi; }
70 
75  GlobalPoint const& origin() const { return theVertexPos; }
76 
78  float originRBound() const { return theVertexRBound; }
79 
81  float originZBound() const { return theVertexZBound; }
82 
84  float ptMin() const { return thePtMin; }
85 
87  Range invPtRange() const { return theInvPtRange; }
88 
91  virtual std::unique_ptr<HitRZCompatibility> checkRZ(const DetLayer* layer,
92  const Hit& outerHit,
93  const DetLayer* outerlayer = nullptr,
94  float lr = 0,
95  float gz = 0,
96  float dr = 0,
97  float dz = 0) const = 0;
98 
100  virtual Hits hits(const SeedingLayerSetsHits::SeedingLayer& layer) const = 0;
101 
104  virtual void checkTracks(reco::TrackCollection const& tracks, std::vector<bool>& mask) const = 0;
105 
107  std::vector<bool> checkTracks(reco::TrackCollection const& tracks) const {
108  std::vector<bool> region_mask(tracks.size(), false);
109  checkTracks(tracks, region_mask);
110  return region_mask;
111  }
113  std::unique_ptr<TrackingRegion> restrictedRegion(const GlobalPoint& originPos,
114  const float& originRBound,
115  const float& originZBound) const {
116  auto restr = clone();
117  restr->theVertexPos = originPos;
118  restr->theVertexRBound = originRBound;
119  restr->theVertexZBound = originZBound;
120  return restr;
121  }
122 
123  virtual std::unique_ptr<TrackingRegion> clone() const = 0;
124 
125  virtual std::string name() const { return "TrackingRegion"; }
126  virtual std::string print() const {
127  std::ostringstream str;
128  str << name() << " dir:" << theDirection << " vtx:" << theVertexPos << " dr:" << theVertexRBound
129  << " dz:" << theVertexZBound << " pt:" << 1. / theInvPtRange.max();
130  return str.str();
131  }
132 
133  // void setDirection(const GlobalVector & dir ) { theDirection = dir; }
134 
135 private:
136  GlobalVector theDirection; // this is not direction is momentum...
137  GlobalVector theUnitDirection; // the real direction
140  float thePhi;
141  float thePtMin;
144 };
145 
147 
148 #endif
virtual std::unique_ptr< HitRZCompatibility > checkRZ(const DetLayer *layer, const Hit &outerHit, const DetLayer *outerlayer=nullptr, float lr=0, float gz=0, float dr=0, float dz=0) const =0
virtual std::unique_ptr< TrackingRegion > clone() const =0
GlobalPoint const & origin() const
GlobalVector theUnitDirection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
virtual Hits hits(const SeedingLayerSetsHits::SeedingLayer &layer) const =0
get hits from layer compatible with region constraints
GlobalVector theDirection
TrackingRegion(const GlobalVector &direction, const GlobalPoint &originPos, const Range &invPtRange, const float &originRBound, const float &originZBound)
float phiDirection() const
constexpr uint32_t mask
Definition: gpuClustering.h:24
constexpr std::array< uint8_t, layerIndexSize > layer
virtual ~TrackingRegion()
GlobalPoint theVertexPos
PixelRecoRange< float > Range
float ptMin() const
minimal pt of interest
virtual std::string name() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual std::string print() const
double f[11][100]
std::unique_ptr< TrackingRegion > restrictedRegion(const GlobalPoint &originPos, const float &originRBound, const float &originZBound) const
clone region with new vertex position
Basic3DVector unit() const
BaseTrackerRecHit const * ConstRecHitPointer
SeedingLayerSetsHits::ConstRecHitPointer Hit
std::vector< ConstRecHitPointer > Hits
float originRBound() const
bounds the particle vertex in the transverse plane
auto const & tracks
cannot be loose
SeedingLayerSetsHits::Hits Hits
Range invPtRange() const
inverse pt range
std::vector< bool > checkTracks(reco::TrackCollection const &tracks) const
return a boolean mask over the TrackCollection reflecting the compatibility of each track with the re...
GlobalVector const & direction() const
the direction around which region is constructed
T barePhi() const
GlobalVector const & unitDirection() const
HLT enums.
virtual void checkTracks(reco::TrackCollection const &tracks, std::vector< bool > &mask) const =0
float originZBound() const
bounds the particle vertex in the longitudinal plane
#define str(s)