CMS 3D CMS Logo

TrackingRegion.h
Go to the documentation of this file.
1 #ifndef TrackingRegion_H
2 #define TrackingRegion_H
3 
11 
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  const GlobalPoint& originPos,
51  const Range& invPtRange,
52  const float& originRBound,
53  const float& originZBound)
56  theVertexPos(originPos),
62 
64  GlobalVector const& direction() const { return theDirection; }
65  GlobalVector const& unitDirection() const { return theUnitDirection; }
66 
67  float phiDirection() const { return thePhi; }
68 
73  GlobalPoint const& origin() const { return theVertexPos; }
74 
76  float originRBound() const { return theVertexRBound; }
77 
79  float originZBound() const { return theVertexZBound; }
80 
82  float ptMin() const { return thePtMin; }
83 
85  Range invPtRange() const { return theInvPtRange; }
86 
89  virtual std::unique_ptr<HitRZCompatibility> checkRZ(const DetLayer* layer,
90  const Hit& outerHit,
91  const edm::EventSetup& iSetup,
92  const DetLayer* outerlayer = nullptr,
93  float lr = 0,
94  float gz = 0,
95  float dr = 0,
96  float dz = 0) const = 0;
97 
99  virtual Hits hits(const edm::EventSetup& es, const SeedingLayerSetsHits::SeedingLayer& layer) const = 0;
100 
103  virtual void checkTracks(reco::TrackCollection const& tracks, std::vector<bool>& mask) const = 0;
104 
106  std::vector<bool> checkTracks(reco::TrackCollection const& tracks) const {
107  std::vector<bool> region_mask(tracks.size(), false);
108  checkTracks(tracks, region_mask);
109  return region_mask;
110  }
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
Vector3DBase
Definition: Vector3DBase.h:8
TrackingRegion::origin
GlobalPoint const & origin() const
Definition: TrackingRegion.h:73
Hit
Definition: SiPixelLorentzAngle.h:57
TrackingRegion::checkTracks
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...
Definition: TrackingRegion.h:106
TrackingRegion::invPtRange
Range invPtRange() const
inverse pt range
Definition: TrackingRegion.h:85
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
DetLayer
Definition: DetLayer.h:21
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
TrackingRegion::theInvPtRange
Range theInvPtRange
Definition: TrackingRegion.h:139
min
T min(T a, T b)
Definition: MathUtil.h:58
TrackingRegion::TrackingRegion
TrackingRegion(const GlobalVector &direction, const GlobalPoint &originPos, const Range &invPtRange, const float &originRBound, const float &originZBound)
Definition: TrackingRegion.h:49
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackingRegion::theVertexZBound
float theVertexZBound
Definition: TrackingRegion.h:143
TrackingRegion::restrictedRegion
std::unique_ptr< TrackingRegion > restrictedRegion(const GlobalPoint &originPos, const float &originRBound, const float &originZBound) const
clone region with new vertex position
Definition: TrackingRegion.h:113
TrackingRegion::theDirection
GlobalVector theDirection
Definition: TrackingRegion.h:136
TrackingRegion::hits
virtual Hits hits(const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const =0
get hits from layer compatible with region constraints
TrackingRegion::checkTracks
virtual void checkTracks(reco::TrackCollection const &tracks, std::vector< bool > &mask) const =0
TrackingRegion::thePtMin
float thePtMin
Definition: TrackingRegion.h:141
TrackingRegion::print
virtual std::string print() const
Definition: TrackingRegion.h:126
Track.h
TrackingRegion::thePhi
float thePhi
Definition: TrackingRegion.h:140
TrackFwd.h
SeedingLayerSetsHits.h
TrackingRegion::Hits
SeedingLayerSetsHits::Hits Hits
Definition: TrackingRegion.h:46
TrackingRegion::theUnitDirection
GlobalVector theUnitDirection
Definition: TrackingRegion.h:137
HitRZCompatibility.h
PixelRecoRange::max
T max() const
Definition: PixelRecoRange.h:26
str
#define str(s)
Definition: TestProcessor.cc:48
Event
TrackingRegion::phiDirection
float phiDirection() const
Definition: TrackingRegion.h:67
SeedingLayerSetsHits::ConstRecHitPointer
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingLayerSetsHits.h:25
TrackingRegion::ptMin
float ptMin() const
minimal pt of interest
Definition: TrackingRegion.h:82
Point3DBase< float, GlobalTag >
TrackingRegion::originRBound
float originRBound() const
bounds the particle vertex in the transverse plane
Definition: TrackingRegion.h:76
barePhi
T barePhi() const
Definition: Basic3DVectorLD.h:142
HitRZCompatibility
Definition: HitRZCompatibility.h:8
TrackingRegion::theVertexRBound
float theVertexRBound
Definition: TrackingRegion.h:142
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PixelRecoRange< float >
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
TrackingRegion::originZBound
float originZBound() const
bounds the particle vertex in the longitudinal plane
Definition: TrackingRegion.h:79
TrackingRegion::direction
GlobalVector const & direction() const
the direction around which region is constructed
Definition: TrackingRegion.h:64
TrackingRegion::checkRZ
virtual std::unique_ptr< HitRZCompatibility > checkRZ(const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup, const DetLayer *outerlayer=nullptr, float lr=0, float gz=0, float dr=0, float dz=0) const =0
TrackingRegion::theVertexPos
GlobalPoint theVertexPos
Definition: TrackingRegion.h:138
TrackingRegion::Hit
SeedingLayerSetsHits::ConstRecHitPointer Hit
Definition: TrackingRegion.h:45
TrackingRegion::clone
virtual std::unique_ptr< TrackingRegion > clone() const =0
TrackingRegion::Range
PixelRecoRange< float > Range
Definition: TrackingRegion.h:44
edm::EventSetup
Definition: EventSetup.h:57
HitRCheck.h
HitZCheck.h
BarrelDetLayer
Definition: BarrelDetLayer.h:22
SeedingLayerSetsHits::SeedingLayer
Definition: SeedingLayerSetsHits.h:37
unit
Basic3DVector unit() const
Definition: Basic3DVectorLD.h:162
HitEtaCheck.h
TrackingRegion::unitDirection
GlobalVector const & unitDirection() const
Definition: TrackingRegion.h:65
std
Definition: JetResolutionObject.h:76
ForwardDetLayer
Definition: ForwardDetLayer.h:22
PVValHelper::dz
Definition: PVValidationHelpers.h:50
SeedingLayerSetsHits::Hits
std::vector< ConstRecHitPointer > Hits
Definition: SeedingLayerSetsHits.h:26
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
DetLayer.h
GlobalVector.h
EventSetup.h
TrackingRegion
Definition: TrackingRegion.h:40
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GlobalPoint.h
TrackingRegion::name
virtual std::string name() const
Definition: TrackingRegion.h:125
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
PixelRecoRange.h
TrackingRegion::~TrackingRegion
virtual ~TrackingRegion()
Definition: TrackingRegion.h:43