CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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)
56  : theDirection(direction),
57  theUnitDirection(direction.unit()),
58  theVertexPos(originPos),
59  theInvPtRange(invPtRange),
60  thePhi(direction.barePhi()),
61  thePtMin(1.f / std::max(std::abs(invPtRange.max()), std::abs(invPtRange.min()))),
62  theVertexRBound(originRBound),
63  theVertexZBound(originZBound) {}
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
float originRBound() const
bounds the particle vertex in the transverse plane
T barePhi() const
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
T max() 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)
auto const & tracks
cannot be loose
constexpr std::array< uint8_t, layerIndexSize > layer
virtual ~TrackingRegion()
GlobalVector const & direction() const
the direction around which region is constructed
GlobalPoint theVertexPos
PixelRecoRange< float > Range
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual std::string name() const
float phiDirection() const
float originZBound() const
bounds the particle vertex in the longitudinal plane
BaseTrackerRecHit const * ConstRecHitPointer
SeedingLayerSetsHits::ConstRecHitPointer Hit
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 & unitDirection() const
std::vector< ConstRecHitPointer > Hits
SeedingLayerSetsHits::Hits Hits
float ptMin() const
minimal pt of interest
virtual std::string print() const
virtual void checkTracks(reco::TrackCollection const &tracks, std::vector< bool > &mask) const =0
Range invPtRange() const
inverse pt range
std::unique_ptr< TrackingRegion > restrictedRegion(const GlobalPoint &originPos, const float &originRBound, const float &originZBound) const
clone region with new vertex position
#define str(s)
Basic3DVector unit() const