CMS 3D CMS Logo

TrackingRegion.h
Go to the documentation of this file.
1 #ifndef TrackingRegion_H
2 #define TrackingRegion_H
3 
11 
18 
21 
24 
25 #include <utility>
26 
27 #include <sstream>
28 #include <memory>
29 #include <vector>
30 #include <string>
31 
32 class DetLayer;
33 class HitRZCompatibility;
34 class BarrelDetLayer;
35 class ForwardDetLayer;
36 
37 namespace edm {
38  class Event;
39 }
40 
42 public:
43 public:
44  virtual ~TrackingRegion() {}
48 
49 public:
51  const GlobalPoint& originPos,
52  const Range& invPtRange,
53  const float& originRBound,
54  const float& originZBound)
57  theVertexPos(originPos),
63 
65  GlobalVector const& direction() const { return theDirection; }
66  GlobalVector const& unitDirection() const { return theUnitDirection; }
67 
68  float phiDirection() const { return thePhi; }
69 
74  GlobalPoint const& origin() const { return theVertexPos; }
75 
77  float originRBound() const { return theVertexRBound; }
78 
80  float originZBound() const { return theVertexZBound; }
81 
83  float ptMin() const { return thePtMin; }
84 
86  Range invPtRange() const { return theInvPtRange; }
87 
90  virtual std::unique_ptr<HitRZCompatibility> checkRZ(const DetLayer* layer,
91  const Hit& outerHit,
92  const edm::EventSetup& iSetup,
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 edm::EventSetup& es, 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
Vector3DBase
Definition: Vector3DBase.h:8
TrackingRegion::origin
GlobalPoint const & origin() const
Definition: TrackingRegion.h:74
Hit
Definition: HitCollection.h:12
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:107
TrackingRegion::invPtRange
Range invPtRange() const
inverse pt range
Definition: TrackingRegion.h:86
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:50
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:47
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:51
Event
TrackingRegion::phiDirection
float phiDirection() const
Definition: TrackingRegion.h:68
SeedingLayerSetsHits::ConstRecHitPointer
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingLayerSetsHits.h:25
TrackingRegion::ptMin
float ptMin() const
minimal pt of interest
Definition: TrackingRegion.h:83
Point3DBase< float, GlobalTag >
TrackingRegion::originRBound
float originRBound() const
bounds the particle vertex in the transverse plane
Definition: TrackingRegion.h:77
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:80
TrackingRegion::direction
GlobalVector const & direction() const
the direction around which region is constructed
Definition: TrackingRegion.h:65
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:46
TrackingRegion::clone
virtual std::unique_ptr< TrackingRegion > clone() const =0
TrackingRegion::Range
PixelRecoRange< float > Range
Definition: TrackingRegion.h:45
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:66
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:41
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:44