CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
RectangularEtaPhiTrackingRegion Class Referencefinal

#include <RectangularEtaPhiTrackingRegion.h>

Inheritance diagram for RectangularEtaPhiTrackingRegion:
TrackingRegion

Public Types

typedef TkTrackingRegionsMargin< float > Margin
 
enum  UseMeasurementTracker { UseMeasurementTracker::kNever = -1, UseMeasurementTracker::kForSiStrips = 0, UseMeasurementTracker::kAlways = 1 }
 
- Public Types inherited from TrackingRegion
typedef SeedingLayerSetsHits::ConstRecHitPointer Hit
 
typedef SeedingLayerSetsHits::Hits Hits
 
typedef PixelRecoRange< float > Range
 

Public Member Functions

std::unique_ptr< HitRZCompatibilitycheckRZ (const DetLayer *layer, const Hit &outerHit, const DetLayer *outerlayer=nullptr, float lr=0, float gz=0, float dr=0, float dz=0) const override
 
void checkTracks (reco::TrackCollection const &tracks, std::vector< bool > &mask) const override
 
std::unique_ptr< TrackingRegionclone () const override
 
const RangeetaRange () const
 allowed eta range [eta_min, eta_max] interval More...
 
TrackingRegion::Hits hits (const SeedingLayerSetsHits::SeedingLayer &layer) const override
 get hits from layer compatible with region constraints More...
 
bool isPrecise () const
 is precise error calculation switched on More...
 
std::string name () const override
 
RectangularEtaPhiTrackingRegionoperator= (RectangularEtaPhiTrackingRegion const &)=delete
 
RectangularEtaPhiTrackingRegionoperator= (RectangularEtaPhiTrackingRegion &&)=delete
 
const MarginphiMargin () const
 
std::string print () const override
 
 RectangularEtaPhiTrackingRegion ()
 
 RectangularEtaPhiTrackingRegion (RectangularEtaPhiTrackingRegion const &rh)
 
 RectangularEtaPhiTrackingRegion (RectangularEtaPhiTrackingRegion &&)=default
 
 RectangularEtaPhiTrackingRegion (const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, float deltaEta, float deltaPhi, const MagneticField &field, const MultipleScatteringParametrisationMaker *msmaker, bool precise=true, UseMeasurementTracker whereToUseMeasurementTracker=UseMeasurementTracker::kNever, const MeasurementTrackerEvent *measurementTracker=nullptr, bool etaPhiRegion=false)
 
 RectangularEtaPhiTrackingRegion (const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, Margin etaMargin, Margin phiMargin, const MagneticField &field, const MultipleScatteringParametrisationMaker *msmaker, bool precise=true, UseMeasurementTracker whereToUseMeasurementTracker=UseMeasurementTracker::kNever, const MeasurementTrackerEvent *measurementTracker=nullptr, bool etaPhiRegion=false)
 
 RectangularEtaPhiTrackingRegion (const GlobalVector &dir, const GlobalPoint &vertexPos, Range invPtRange, float rVertex, float zVertex, Margin etaMargin, Margin phiMargin, const MagneticField &field, const MultipleScatteringParametrisationMaker *msmaker, bool precise=true, UseMeasurementTracker whereToUseMeasurementTracker=UseMeasurementTracker::kNever, const MeasurementTrackerEvent *measurementTracker=nullptr, bool etaPhiRegion=false, bool useMS=true)
 
const RangetanLambdaRange () const
 
- Public Member Functions inherited from TrackingRegion
std::vector< bool > checkTracks (reco::TrackCollection const &tracks) const
 return a boolean mask over the TrackCollection reflecting the compatibility of each track with the region constraints More...
 
GlobalVector const & direction () const
 the direction around which region is constructed More...
 
Range invPtRange () const
 inverse pt range More...
 
GlobalPoint const & origin () const
 
float originRBound () const
 bounds the particle vertex in the transverse plane More...
 
float originZBound () const
 bounds the particle vertex in the longitudinal plane More...
 
float phiDirection () const
 
float ptMin () const
 minimal pt of interest More...
 
std::unique_ptr< TrackingRegionrestrictedRegion (const GlobalPoint &originPos, const float &originRBound, const float &originZBound) const
 clone region with new vertex position More...
 
 TrackingRegion ()
 
 TrackingRegion (const GlobalVector &direction, const GlobalPoint &originPos, const Range &invPtRange, const float &originRBound, const float &originZBound)
 
GlobalVector const & unitDirection () const
 
virtual ~TrackingRegion ()
 

Static Public Member Functions

static UseMeasurementTracker doubleToUseMeasurementTracker (double value)
 
static UseMeasurementTracker intToUseMeasurementTracker (int value)
 
static UseMeasurementTracker stringToUseMeasurementTracker (const std::string &name)
 

Private Types

using cacheHitPointer = mayown_ptr< BaseTrackerRecHit >
 
using cacheHits = std::vector< cacheHitPointer >
 

Private Member Functions

std::unique_ptr< HitRZCompatibilitycheckRZOld (const DetLayer *layer, const Hit &outerHit, const DetLayer *outerlayer) const
 
std::unique_ptr< MeasurementEstimatorestimator (const BarrelDetLayer *layer) const
 
std::unique_ptr< MeasurementEstimatorestimator (const ForwardDetLayer *layer) const
 
void initEtaRange (const GlobalVector &dir, const Margin &margin)
 
OuterHitPhiPrediction phiWindow (const MagneticField &field) const
 
HitRZConstraint rzConstraint () const
 

Private Attributes

cacheHits cache
 
Range theEtaRange
 
const MagneticFieldtheField = nullptr
 
Range theLambdaRange
 
float theMeanLambda
 
const MeasurementTrackerEventtheMeasurementTracker = nullptr
 
const UseMeasurementTracker theMeasurementTrackerUsage = UseMeasurementTracker::kNever
 
const MultipleScatteringParametrisationMakertheMSMaker = nullptr
 
Margin thePhiMargin
 
bool thePrecise = false
 
bool theUseEtaPhi = false
 
bool theUseMS = false
 

Detailed Description

A concrete implementation of TrackingRegion. Apart of vertex constraint from TrackingRegion in this implementation the region of interest is further constrainted in phi and eta around the direction of the region

Definition at line 26 of file RectangularEtaPhiTrackingRegion.h.

Member Typedef Documentation

◆ cacheHitPointer

Definition at line 242 of file RectangularEtaPhiTrackingRegion.h.

◆ cacheHits

Definition at line 243 of file RectangularEtaPhiTrackingRegion.h.

◆ Margin

Definition at line 64 of file RectangularEtaPhiTrackingRegion.h.

Member Enumeration Documentation

◆ UseMeasurementTracker

Enumerator
kNever 
kForSiStrips 
kAlways 

Definition at line 28 of file RectangularEtaPhiTrackingRegion.h.

28 { kNever = -1, kForSiStrips = 0, kAlways = 1 };

Constructor & Destructor Documentation

◆ RectangularEtaPhiTrackingRegion() [1/6]

RectangularEtaPhiTrackingRegion::RectangularEtaPhiTrackingRegion ( )
inline

Definition at line 46 of file RectangularEtaPhiTrackingRegion.h.

46 {}

◆ RectangularEtaPhiTrackingRegion() [2/6]

RectangularEtaPhiTrackingRegion::RectangularEtaPhiTrackingRegion ( RectangularEtaPhiTrackingRegion const &  rh)
inline

Definition at line 48 of file RectangularEtaPhiTrackingRegion.h.

49  : TrackingRegion(rh),
50  theEtaRange(rh.theEtaRange),
51  theLambdaRange(rh.theLambdaRange),
52  thePhiMargin(rh.thePhiMargin),
53  theMeanLambda(rh.theMeanLambda),
54  theMeasurementTrackerUsage(rh.theMeasurementTrackerUsage),
55  thePrecise(rh.thePrecise),
56  theUseEtaPhi(rh.theUseEtaPhi),
57  theMeasurementTracker(rh.theMeasurementTracker),
58  theField(rh.theField),
59  theMSMaker(rh.theMSMaker) {}
const UseMeasurementTracker theMeasurementTrackerUsage
const MultipleScatteringParametrisationMaker * theMSMaker
const MeasurementTrackerEvent * theMeasurementTracker

◆ RectangularEtaPhiTrackingRegion() [3/6]

RectangularEtaPhiTrackingRegion::RectangularEtaPhiTrackingRegion ( RectangularEtaPhiTrackingRegion &&  )
default

◆ RectangularEtaPhiTrackingRegion() [4/6]

RectangularEtaPhiTrackingRegion::RectangularEtaPhiTrackingRegion ( const GlobalVector dir,
const GlobalPoint vertexPos,
float  ptMin,
float  rVertex,
float  zVertex,
float  deltaEta,
float  deltaPhi,
const MagneticField field,
const MultipleScatteringParametrisationMaker msmaker,
bool  precise = true,
UseMeasurementTracker  whereToUseMeasurementTracker = UseMeasurementTracker::kNever,
const MeasurementTrackerEvent measurementTracker = nullptr,
bool  etaPhiRegion = false 
)
inline

constructor (symmetric eta and phi margins).
dir - the direction around which region is constructed
the initial direction of the momentum of the particle should be in the range
phi of dir +- deltaPhi
eta of dir +- deltaEta

vertexPos - the position of the vertex (origin) of the of the region.
It is a centre of cylinder constraind with rVertex, zVertex. The track of the particle should cross the cylinder
WARNING: in the current implementaion the vertexPos is supposed to be placed on the beam line, i.e. to be of the form (0,0,float)

ptMin - minimal pt of interest
rVertex - radius of the cylinder around beam line where the tracks of interest should point to.
zVertex - half height of the cylinder around the beam line where the tracks of interest should point to.
deltaEta - allowed deviation of the initial direction of particle in eta in respect to direction of the region
deltaPhi - allowed deviation of the initial direction of particle in phi in respect to direction of the region whereToUseMeasurementTracker: 1=everywhere, 0=outside pixles, -1=nowhere msmaker - Needed if either precise or useMS is true

Definition at line 92 of file RectangularEtaPhiTrackingRegion.h.

106  vertexPos,
107  Range(-1 / ptMin, 1 / ptMin),
108  rVertex,
109  zVertex,
112  field,
113  msmaker,
114  precise,
117  etaPhiRegion) {}
static const double deltaEta
Definition: CaloConstants.h:8
PixelRecoRange< float > Range
float ptMin() const
minimal pt of interest
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TkTrackingRegionsMargin< float > Margin

◆ RectangularEtaPhiTrackingRegion() [5/6]

RectangularEtaPhiTrackingRegion::RectangularEtaPhiTrackingRegion ( const GlobalVector dir,
const GlobalPoint vertexPos,
float  ptMin,
float  rVertex,
float  zVertex,
Margin  etaMargin,
Margin  phiMargin,
const MagneticField field,
const MultipleScatteringParametrisationMaker msmaker,
bool  precise = true,
UseMeasurementTracker  whereToUseMeasurementTracker = UseMeasurementTracker::kNever,
const MeasurementTrackerEvent measurementTracker = nullptr,
bool  etaPhiRegion = false 
)
inline

constructor (asymmetrinc eta and phi margins).
non equal left-right eta and phi bounds around direction are possible. The ranges are defined using Margin. the meaning of other arguments is the same as in the case of symmetring bounds to direction of the region.

Definition at line 125 of file RectangularEtaPhiTrackingRegion.h.

139  vertexPos,
140  Range(-1 / ptMin, 1 / ptMin),
141  rVertex,
142  zVertex,
143  etaMargin,
144  phiMargin,
145  field,
146  msmaker,
147  precise,
150  etaPhiRegion) {}
PixelRecoRange< float > Range
float ptMin() const
minimal pt of interest

◆ RectangularEtaPhiTrackingRegion() [6/6]

RectangularEtaPhiTrackingRegion::RectangularEtaPhiTrackingRegion ( const GlobalVector dir,
const GlobalPoint vertexPos,
Range  invPtRange,
float  rVertex,
float  zVertex,
Margin  etaMargin,
Margin  phiMargin,
const MagneticField field,
const MultipleScatteringParametrisationMaker msmaker,
bool  precise = true,
UseMeasurementTracker  whereToUseMeasurementTracker = UseMeasurementTracker::kNever,
const MeasurementTrackerEvent measurementTracker = nullptr,
bool  etaPhiRegion = false,
bool  useMS = true 
)
inline

constructor (explicit pt range, asymmetrinc eta and phi margins).
the meaning of other arguments is the same as in the case of symmetring bounds to direction of the region.

Definition at line 156 of file RectangularEtaPhiTrackingRegion.h.

References DeadROC_duringRun::dir, and initEtaRange().

174  theUseMS(useMS),
175  theUseEtaPhi(etaPhiRegion),
177  theField(&field),
178  theMSMaker(msmaker) {
179  initEtaRange(dir, etaMargin);
180  }
const UseMeasurementTracker theMeasurementTrackerUsage
const MultipleScatteringParametrisationMaker * theMSMaker
const MeasurementTrackerEvent * theMeasurementTracker
void initEtaRange(const GlobalVector &dir, const Margin &margin)
Range invPtRange() const
inverse pt range
TrackingRegion TrackingRegionBase

Member Function Documentation

◆ checkRZ()

std::unique_ptr<HitRZCompatibility> RectangularEtaPhiTrackingRegion::checkRZ ( const DetLayer layer,
const Hit outerHit,
const DetLayer outerlayer = nullptr,
float  lr = 0,
float  gz = 0,
float  dr = 0,
float  dz = 0 
) const
inlineoverridevirtual

utility to check eta/theta hit compatibility with region constraints and outer hit constraint

Implements TrackingRegion.

Definition at line 199 of file RectangularEtaPhiTrackingRegion.h.

References checkRZOld(), and phase1PixelTopology::layer.

205  {
206  return checkRZOld(layer, outerHit, outerlayer);
207  }
std::unique_ptr< HitRZCompatibility > checkRZOld(const DetLayer *layer, const Hit &outerHit, const DetLayer *outerlayer) const
constexpr std::array< uint8_t, layerIndexSize > layer

◆ checkRZOld()

std::unique_ptr< HitRZCompatibility > RectangularEtaPhiTrackingRegion::checkRZOld ( const DetLayer layer,
const Hit outerHit,
const DetLayer outerlayer 
) const
private

Definition at line 100 of file RectangularEtaPhiTrackingRegion.cc.

References funct::abs(), GeomDetEnumerators::barrel, alignCSCRings::corr, SimpleLineRZ::cotLine(), f, PixelPluginsPhase0_cfi::isBarrel, SiStripPI::max, SiStripPI::min, SurfaceOrientation::outer, ptMin, DetLayer::seqNum(), funct::sqr(), mathSSE::sqrt(), vtxMean(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PixelRecoPointRZ::z(), PV3DBase< T, PVType, FrameType >::z(), and PixelRecoLineRZ::zAtR().

Referenced by checkRZ().

102  {
103  bool isBarrel = (layer->location() == GeomDetEnumerators::barrel);
104  GlobalPoint ohit = outerHit->globalPosition();
105  float outerred_r = std::sqrt(sqr(ohit.x() - origin().x()) + sqr(ohit.y() - origin().y()));
106  PixelRecoPointRZ outer(outerred_r, ohit.z());
107 
108  float zMinOrigin = origin().z() - originZBound();
109  float zMaxOrigin = origin().z() + originZBound();
110 
111  if (!thePrecise) {
112  float vcotMin = (outer.z() > zMaxOrigin) ? (outer.z() - zMaxOrigin) / (outer.r() + originRBound())
113  : (outer.z() - zMaxOrigin) / (outer.r() - originRBound());
114  float vcotMax = (outer.z() > zMinOrigin) ? (outer.z() - zMinOrigin) / (outer.r() - originRBound())
115  : (outer.z() - zMinOrigin) / (outer.r() + originRBound());
116  float cotRight = std::max(vcotMin, theLambdaRange.min());
117  float cotLeft = std::min(vcotMax, theLambdaRange.max());
118  return std::make_unique<HitEtaCheck>(isBarrel, outer, cotLeft, cotRight);
119  }
120 
121  float outerZscatt = 0;
122  float innerScatt = 0;
123  //CHECK
124  if (theUseMS) {
126  float cotThetaOuter = theMeanLambda;
127  float sinThetaOuterInv = std::sqrt(1.f + sqr(cotThetaOuter));
128  outerZscatt = 3.f * oSigma(ptMin(), cotThetaOuter) * sinThetaOuterInv;
129  }
130 
133  float zMinLine = boundL.zAtR(0.) - outerZscatt;
134  float zMaxLine = boundR.zAtR(0.) + outerZscatt;
135  PixelRecoPointRZ vtxL(0., max(zMinLine, zMinOrigin));
136  PixelRecoPointRZ vtxR(0., min(zMaxLine, zMaxOrigin));
137  PixelRecoPointRZ vtxMean(0., (vtxL.z() + vtxR.z()) * 0.5f);
138  //CHECK
139 
140  if (theUseMS) {
142 
143  innerScatt =
144  3.f * (outerlayer ? iSigma(ptMin(), vtxMean, outer, outerlayer->seqNum()) : iSigma(ptMin(), vtxMean, outer));
145 
146  // innerScatt = 3.f *iSigma( ptMin(), vtxMean, outer);
147  }
148 
149  SimpleLineRZ leftLine(vtxL, outer);
150  SimpleLineRZ rightLine(vtxR, outer);
151 
152  HitRZConstraint rzConstraint(leftLine, rightLine);
153  auto cotTheta = std::abs(leftLine.cotLine() + rightLine.cotLine()) * 0.5f;
154 
155  // std::cout << "RectangularEtaPhiTrackingRegion " << outer.r()<<','<< outer.z() << " " << innerScatt << " " << cotTheta << " " << hitZErr << std::endl;
156 
157  if (isBarrel) {
158  auto sinThetaInv = std::sqrt(1.f + sqr(cotTheta));
159  auto corr = innerScatt * sinThetaInv;
160  return std::make_unique<HitZCheck>(rzConstraint, HitZCheck::Margin(corr, corr));
161  } else {
162  auto cosThetaInv = std::sqrt(1.f + sqr(1.f / cotTheta));
163  auto corr = innerScatt * cosThetaInv;
164  return std::make_unique<HitRCheck>(rzConstraint, HitRCheck::Margin(corr, corr));
165  }
166 }
TkTrackingRegionsMargin< float > Margin
Definition: HitRCheck.h:14
TkTrackingRegionsMargin< float > Margin
Definition: HitZCheck.h:14
GlobalPoint const & origin() const
T z() const
Definition: PV3DBase.h:61
const MultipleScatteringParametrisationMaker * theMSMaker
constexpr std::array< uint8_t, layerIndexSize > layer
float zAtR(float r) const
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
dictionary corr
MultipleScatteringParametrisation parametrisation(const DetLayer *layer, X0Source x0Source=X0Source::useX0AtEta) const
float ptMin() const
minimal pt of interest
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static GlobalPoint vtxMean(const GlobalPoint &p1, const GlobalError &e1, const GlobalPoint &p2, const GlobalError &e2)
double f[11][100]
int seqNum() const
Definition: DetLayer.h:35
float originRBound() const
bounds the particle vertex in the transverse plane
float originZBound() const
bounds the particle vertex in the longitudinal plane
Square< F >::type sqr(const F &f)
Definition: Square.h:14

◆ checkTracks()

void RectangularEtaPhiTrackingRegion::checkTracks ( reco::TrackCollection const &  tracks,
std::vector< bool > &  mask 
) const
overridevirtual

Set the elements of the mask corresponding to the tracks that are compatable with the region. Does not reset the elements corresponding to the tracks that are not compatible.

Implements TrackingRegion.

Definition at line 48 of file RectangularEtaPhiTrackingRegion.cc.

References funct::abs(), cms::cuda::assert(), generateTowerEtThresholdLUT::etaRange, mps_fire::i, gpuClustering::pixelStatus::mask, proxim(), ptMin, HLT_2022v15_cff::track, tracks, and x.

48  {
49  const math::XYZPoint regOrigin(origin().x(), origin().y(), origin().z());
50  auto phi0 = phiDirection() + 0.5 * (phiMargin().right() - phiMargin().left());
51  auto dphi = 0.5 * (phiMargin().right() + phiMargin().left());
52 
53  assert(mask.size() == tracks.size());
54  int i = -1;
55  for (auto const& track : tracks) {
56  i++;
57  if (mask[i])
58  continue;
59 
60  if (track.pt() < ptMin()) {
61  continue;
62  }
63  if (!etaRange().inside(track.eta())) {
64  continue;
65  }
66  if (std::abs(proxim(track.phi(), phi0) - phi0) > dphi) {
67  continue;
68  }
69  if (std::abs(track.dxy(regOrigin)) > originRBound()) {
70  continue;
71  }
72  if (std::abs(track.dz(regOrigin)) > originZBound()) {
73  continue;
74  }
75  mask[i] = true;
76  }
77 }
bool inside(const T &value) const
const Range & etaRange() const
allowed eta range [eta_min, eta_max] interval
GlobalPoint const & origin() const
assert(be >=bs)
float phiDirection() const
constexpr uint32_t mask
Definition: gpuClustering.h:24
constexpr T proxim(T b, T a)
Definition: normalizedPhi.h:14
float ptMin() const
minimal pt of interest
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float originRBound() const
bounds the particle vertex in the transverse plane
auto const & tracks
cannot be loose
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
float originZBound() const
bounds the particle vertex in the longitudinal plane

◆ clone()

std::unique_ptr<TrackingRegion> RectangularEtaPhiTrackingRegion::clone ( void  ) const
inlineoverridevirtual

Implements TrackingRegion.

Definition at line 209 of file RectangularEtaPhiTrackingRegion.h.

209  {
210  return std::make_unique<RectangularEtaPhiTrackingRegion>(*this);
211  }

◆ doubleToUseMeasurementTracker()

static UseMeasurementTracker RectangularEtaPhiTrackingRegion::doubleToUseMeasurementTracker ( double  value)
inlinestatic

◆ estimator() [1/2]

std::unique_ptr< MeasurementEstimator > RectangularEtaPhiTrackingRegion::estimator ( const BarrelDetLayer layer) const
private

Definition at line 168 of file RectangularEtaPhiTrackingRegion.cc.

References funct::abs(), PixelRecoRange< T >::empty(), f, reco::helper::VirtualJetProducerHelper::intersection(), PixelRecoRange< T >::intersection(), PixelRecoUtilities::longitudinalBendingCorrection(), PixelRecoRange< T >::max(), SiStripPI::max, PixelRecoRange< T >::mean(), PixelRecoRange< T >::min(), SiStripPI::min, trackingPOGFilters_cfi::phiWindow, ptMin, CosmicsPD_Skims::radius, HitZCheck::range(), OuterHitPhiPrediction::setTolerance(), HitZCheck::setTolerance(), funct::sqr(), mathSSE::sqrt(), w1, and w2.

168  {
169  using Algo = HitZCheck;
170 
171  // det dimensions
172  float halfLength = 0.5f * layer->surface().bounds().length();
173  float halfThickness = 0.5f * layer->surface().bounds().thickness();
174  float z0 = layer->position().z();
175  float radius = layer->specificSurface().radius();
176 
177  // det ranges
178  Range detRWindow(radius - halfThickness, radius + halfThickness);
179  Range detZWindow(z0 - halfLength, z0 + halfLength);
180 
181  // z prediction, skip if not intersection
182  HitZCheck zPrediction(rzConstraint());
183  Range hitZWindow = zPrediction.range(detRWindow.min()).intersection(detZWindow);
184  if (hitZWindow.empty())
185  return nullptr;
186 
187  // phi prediction
188  OuterHitPhiPrediction phiPrediction = phiWindow(*theField);
189 
190  //
191  // optional corrections for tolerance (mult.scatt, error, bending)
192  //
194  if (thePrecise) {
195  auto invR = 1.f / radius;
196  auto cotTheta = (hitZWindow.mean() - origin().z()) * invR;
197  auto sinThetaInv = std::sqrt(1.f + sqr(cotTheta));
199  auto scatt = 3.f * msSigma(ptMin(), cotTheta);
201 
202  float hitErrRPhi = 0.;
203  float hitErrZ = 0.;
204  float corrPhi = (scatt + hitErrRPhi) * invR;
205  float corrZ = scatt * sinThetaInv + bendR * std::abs(cotTheta) + hitErrZ;
206 
207  phiPrediction.setTolerance(corrPhi);
208  zPrediction.setTolerance(HitZCheck::Margin(corrZ, corrZ));
209 
210  //
211  // hit ranges in det
212  //
213  OuterHitPhiPrediction::Range phi1 = phiPrediction(detRWindow.min());
214  OuterHitPhiPrediction::Range phi2 = phiPrediction(detRWindow.max());
215  phiRange = Range(std::min(phi1.min(), phi2.min()), std::max(phi1.max(), phi2.max()));
216  Range w1 = zPrediction.range(detRWindow.min());
217  Range w2 = zPrediction.range(detRWindow.max());
218  hitZWindow = Range(std::min(w1.min(), w2.min()), std::max(w1.max(), w2.max())).intersection(detZWindow);
219  } else {
220  phiRange = phiPrediction(detRWindow.mean());
221  }
222 
223  return std::make_unique<OuterEstimator<Algo>>(OuterDetCompatibility(layer, phiRange, detRWindow, hitZWindow),
224  OuterHitCompatibility<Algo>(phiPrediction, zPrediction));
225 }
OuterHitPhiPrediction phiWindow(const MagneticField &field) const
void setTolerance(float tolerance)
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
GlobalPoint const & origin() const
T z() const
Definition: PV3DBase.h:61
const MultipleScatteringParametrisationMaker * theMSMaker
constexpr std::array< uint8_t, layerIndexSize > layer
PixelRecoRange< float > Range
MultipleScatteringParametrisation parametrisation(const DetLayer *layer, X0Source x0Source=X0Source::useX0AtEta) const
float ptMin() const
minimal pt of interest
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
weight_default_t w1[2000]
Definition: w1.h:9
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
Definition: Square.h:14
double longitudinalBendingCorrection(double radius, double pt, const MagneticField &field)
Definition: fakeMenu.h:6

◆ estimator() [2/2]

std::unique_ptr< MeasurementEstimator > RectangularEtaPhiTrackingRegion::estimator ( const ForwardDetLayer layer) const
private

Definition at line 227 of file RectangularEtaPhiTrackingRegion.cc.

References funct::abs(), PixelRecoRange< T >::empty(), reco::helper::VirtualJetProducerHelper::intersection(), PixelRecoRange< T >::intersection(), PixelRecoUtilities::longitudinalBendingCorrection(), PixelRecoRange< T >::max(), PixelRecoRange< T >::mean(), PixelRecoRange< T >::min(), trackingPOGFilters_cfi::phiWindow, ptMin, OuterHitPhiPrediction::setTolerance(), funct::sqr(), mathSSE::sqrt(), w1, and w2.

227  {
228  using Algo = HitRCheck;
229  // det dimensions, ranges
230  float halfThickness = 0.5f * layer->surface().bounds().thickness();
231  float zLayer = layer->position().z();
232  Range detZWindow(zLayer - halfThickness, zLayer + halfThickness);
233  Range detRWindow(layer->specificSurface().innerRadius(), layer->specificSurface().outerRadius());
234 
235  // r prediction, skip if not intersection
236  HitRCheck rPrediction(rzConstraint());
237  Range hitRWindow = rPrediction.range(zLayer).intersection(detRWindow);
238  if (hitRWindow.empty())
239  return nullptr;
240 
241  // phi prediction
242  OuterHitPhiPrediction phiPrediction = phiWindow(*theField);
243  OuterHitPhiPrediction::Range phiRange = phiPrediction(detRWindow.max());
244 
245  //
246  // optional corrections for tolerance (mult.scatt, error, bending)
247  //
248  if (thePrecise) {
249  float cotTheta = (detZWindow.mean() - origin().z()) / hitRWindow.mean();
250  float cosThetaInv = std::sqrt(1 + sqr(cotTheta)) / cotTheta;
252  float scatt = 3.f * msSigma(ptMin(), cotTheta);
253  float bendR = longitudinalBendingCorrection(hitRWindow.max(), ptMin(), *theField);
254  float hitErrRPhi = 0.;
255  float hitErrR = 0.;
256  float corrPhi = (scatt + hitErrRPhi) / detRWindow.min();
257  float corrR = scatt * std::abs(cosThetaInv) + bendR + hitErrR;
258 
259  phiPrediction.setTolerance(corrPhi);
260  rPrediction.setTolerance(HitRCheck::Margin(corrR, corrR));
261 
262  //
263  // hit ranges in det
264  //
265  Range w1, w2;
266  if (zLayer > 0) {
267  w1 = rPrediction.range(detZWindow.min());
268  w2 = rPrediction.range(detZWindow.max());
269  } else {
270  w1 = rPrediction.range(detZWindow.max());
271  w2 = rPrediction.range(detZWindow.min());
272  }
273  hitRWindow = Range(w1.min(), w2.max()).intersection(detRWindow);
274  }
275 
276  return std::make_unique<OuterEstimator<Algo>>(OuterDetCompatibility(layer, phiRange, hitRWindow, detZWindow),
277  OuterHitCompatibility<Algo>(phiPrediction, rPrediction));
278 }
OuterHitPhiPrediction phiWindow(const MagneticField &field) const
void setTolerance(float tolerance)
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
GlobalPoint const & origin() const
T z() const
Definition: PV3DBase.h:61
const MultipleScatteringParametrisationMaker * theMSMaker
constexpr std::array< uint8_t, layerIndexSize > layer
PixelRecoRange< float > Range
MultipleScatteringParametrisation parametrisation(const DetLayer *layer, X0Source x0Source=X0Source::useX0AtEta) const
float ptMin() const
minimal pt of interest
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
weight_default_t w1[2000]
Definition: w1.h:9
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
Definition: Square.h:14
double longitudinalBendingCorrection(double radius, double pt, const MagneticField &field)
Definition: fakeMenu.h:6

◆ etaRange()

const Range& RectangularEtaPhiTrackingRegion::etaRange ( ) const
inline

allowed eta range [eta_min, eta_max] interval

Definition at line 183 of file RectangularEtaPhiTrackingRegion.h.

References theEtaRange.

◆ hits()

TrackingRegion::Hits RectangularEtaPhiTrackingRegion::hits ( const SeedingLayerSetsHits::SeedingLayer layer) const
overridevirtual

get hits from layer compatible with region constraints

Implements TrackingRegion.

Definition at line 307 of file RectangularEtaPhiTrackingRegion.cc.

References alongMomentum, GeomDetEnumerators::barrel, Plane::build(), utilities::cache(), runTheMatrix::const, funct::cos(), DeadROC_duringRun::dir, GeomDetEnumerators::endcap, f, h, hfClusterShapes_cfi::hits, GeomDetEnumerators::isBarrel(), GeomDetEnumerators::isEndcap(), GeomDetEnumerators::isTrackerPixel(), GeomDetEnumerators::isTrackerStrip(), DetLayer::location(), LogDebug, mps_fire::result, makeMuonMisalignmentScenario::rot, funct::sin(), DetLayer::subDetector(), and extraflags_cff::vtx.

307  {
309 
310  //ESTIMATOR
311 
312  const DetLayer* detLayer = layer.detLayer();
313 
314  bool measurementMethod = false;
316  measurementMethod = true;
319  measurementMethod = true;
320 
321  if (measurementMethod) {
322  const GlobalPoint vtx = origin();
324 
325  std::unique_ptr<MeasurementEstimator> est;
328  (!theUseEtaPhi && detLayer->location() == GeomDetEnumerators::barrel)) {
329  const BarrelDetLayer& bl = dynamic_cast<const BarrelDetLayer&>(*detLayer);
330  est = estimator(&bl);
331  } else if ((GeomDetEnumerators::isTrackerPixel(detLayer->subDetector()) &&
333  (!theUseEtaPhi && detLayer->location() == GeomDetEnumerators::endcap)) {
334  const ForwardDetLayer& fl = dynamic_cast<const ForwardDetLayer&>(*detLayer);
335  est = estimator(&fl);
336  }
337 
338  EtaPhiMeasurementEstimator etaPhiEstimator((theEtaRange.second - theEtaRange.first) * 0.5f,
339  (thePhiMargin.left() + thePhiMargin.right()) * 0.5f);
340  MeasurementEstimator* findDetAndHits = &etaPhiEstimator;
341  if (est) {
342  LogDebug("RectangularEtaPhiTrackingRegion") << "use pixel specific estimator.";
343  findDetAndHits = est.get();
344  } else {
345  LogDebug("RectangularEtaPhiTrackingRegion") << "use generic etat phi estimator.";
346  }
347 
348  // TSOS
349  float phi = phiDirection();
350  // std::cout << "dir " << direction().x()/direction().perp() <<','<< direction().y()/direction().perp() << " " << sin(phi) <<','<<cos(phi)<< std::endl;
351  Surface::RotationType rot(sin(phi), -cos(phi), 0, 0, 0, -1, cos(phi), sin(phi), 0);
352 
353  Plane::PlanePointer surface = Plane::build(GlobalPoint(0., 0., 0.), rot);
354  //TrajectoryStateOnSurface tsos(lpar, *surface, theField);
355 
357  TrajectoryStateOnSurface tsos(fts, *surface);
358 
359  // propagator
361 
363 
364  auto hits = lm.recHits(*detLayer, tsos, prop, *findDetAndHits);
365 
366  result.reserve(hits.size());
367  for (auto h : hits) {
368  cache.emplace_back(h);
369  result.emplace_back(h);
370  }
371 
372  LogDebug("RectangularEtaPhiTrackingRegion")
373  << " found " << hits.size() << " minus one measurements on layer: " << detLayer->subDetector();
374  // std::cout << "RectangularEtaPhiTrackingRegion" <<" found "<< meas.size()<<" minus one measurements on layer: "<<detLayer->subDetector() << std::endl;
375 
376  } else {
377  //
378  // temporary solution (actually heavily used for Pixels....)
379  //
380  if (detLayer->location() == GeomDetEnumerators::barrel) {
381  const BarrelDetLayer& bl = dynamic_cast<const BarrelDetLayer&>(*detLayer);
382  auto est = estimator(&bl);
383  if (!est)
384  return result;
385  using Algo = HitZCheck;
386  auto const& hitComp = (reinterpret_cast<OuterEstimator<Algo> const&>(*est)).hitCompatibility();
387  auto layerHits = layer.hits();
388  result.reserve(layerHits.size());
389  for (auto&& ih : layerHits) {
390  if (hitComp(*ih))
391  result.emplace_back(ih);
392  }
393 
394  } else {
395  const ForwardDetLayer& fl = dynamic_cast<const ForwardDetLayer&>(*detLayer);
396  auto est = estimator(&fl);
397  if (!est)
398  return result;
399  using Algo = HitRCheck;
400  auto const& hitComp = (reinterpret_cast<OuterEstimator<Algo> const&>(*est)).hitCompatibility();
401  auto layerHits = layer.hits();
402  result.reserve(layerHits.size());
403  for (auto&& ih : layerHits) {
404  if (hitComp(*ih))
405  result.emplace_back(ih);
406  }
407  }
408  }
409 
410  // std::cout << "RectangularEtaPhiTrackingRegion hits " << result.size() << std::endl;
411 
412  return result;
413 }
std::unique_ptr< MeasurementEstimator > estimator(const BarrelDetLayer *layer) const
virtual Location location() const =0
Which part of the detector (barrel, endcap)
GlobalPoint const & origin() const
bool isBarrel(GeomDetEnumerators::SubDetector m)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
const UseMeasurementTracker theMeasurementTrackerUsage
float phiDirection() const
TrackingRegion::Hits hits(const SeedingLayerSetsHits::SeedingLayer &layer) const override
get hits from layer compatible with region constraints
constexpr std::array< uint8_t, layerIndexSize > layer
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
const MeasurementTrackerEvent * theMeasurementTracker
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double f[11][100]
bool isEndcap(GeomDetEnumerators::SubDetector m)
bool isTrackerStrip(GeomDetEnumerators::SubDetector m)
SeedingLayerSetsHits::Hits Hits
GlobalVector const & direction() const
the direction around which region is constructed
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
Definition: fakeMenu.h:6
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
#define LogDebug(id)

◆ initEtaRange()

void RectangularEtaPhiTrackingRegion::initEtaRange ( const GlobalVector dir,
const Margin margin 
)
private

◆ intToUseMeasurementTracker()

static UseMeasurementTracker RectangularEtaPhiTrackingRegion::intToUseMeasurementTracker ( int  value)
inlinestatic

◆ isPrecise()

bool RectangularEtaPhiTrackingRegion::isPrecise ( ) const
inline

is precise error calculation switched on

Definition at line 191 of file RectangularEtaPhiTrackingRegion.h.

References thePrecise.

◆ name()

std::string RectangularEtaPhiTrackingRegion::name ( void  ) const
inlineoverridevirtual

Reimplemented from TrackingRegion.

Definition at line 213 of file RectangularEtaPhiTrackingRegion.h.

Referenced by config.CFG::__str__(), and validation.Sample::digest().

213 { return "RectangularEtaPhiTrackingRegion"; }

◆ operator=() [1/2]

RectangularEtaPhiTrackingRegion& RectangularEtaPhiTrackingRegion::operator= ( RectangularEtaPhiTrackingRegion const &  )
delete

◆ operator=() [2/2]

RectangularEtaPhiTrackingRegion& RectangularEtaPhiTrackingRegion::operator= ( RectangularEtaPhiTrackingRegion &&  )
delete

◆ phiMargin()

const Margin& RectangularEtaPhiTrackingRegion::phiMargin ( ) const
inline

defined phi range around phi0, margin is [phi_left,phi_right]. region is defined in a range: [phi0-phi_left, phi0+phi_right]

Definition at line 188 of file RectangularEtaPhiTrackingRegion.h.

References thePhiMargin.

Referenced by SeedFromConsecutiveHitsCreator::makeSeed().

◆ phiWindow()

OuterHitPhiPrediction RectangularEtaPhiTrackingRegion::phiWindow ( const MagneticField field) const
private

◆ print()

std::string RectangularEtaPhiTrackingRegion::print ( void  ) const
overridevirtual

Reimplemented from TrackingRegion.

Definition at line 415 of file RectangularEtaPhiTrackingRegion.cc.

References TrackingRegion::print(), and str.

415  {
416  std::ostringstream str;
417  str << TrackingRegionBase::print() << " eta: " << theEtaRange << " phi:" << thePhiMargin << "precise: " << thePrecise;
418  return str.str();
419 }
virtual std::string print() const
#define str(s)

◆ rzConstraint()

HitRZConstraint RectangularEtaPhiTrackingRegion::rzConstraint ( ) const
private

Definition at line 288 of file RectangularEtaPhiTrackingRegion.cc.

References photonAnalyzer_cfi::rMax, photonAnalyzer_cfi::rMin, photonAnalyzer_cfi::zMax, and photonAnalyzer_cfi::zMin.

288  {
289  HitRZConstraint::Point pLeft, pRight;
290  float zMin = origin().z() - originZBound();
291  float zMax = origin().z() + originZBound();
292  float rMin = -originRBound();
293  float rMax = originRBound();
294  if (theEtaRange.max() > 0) {
295  pRight = HitRZConstraint::Point(rMin, zMax);
296  } else {
297  pRight = HitRZConstraint::Point(rMax, zMax);
298  }
299  if (theEtaRange.min() > 0.) {
300  pLeft = HitRZConstraint::Point(rMax, zMin);
301  } else {
302  pLeft = HitRZConstraint::Point(rMin, zMin);
303  }
304  return HitRZConstraint(pLeft, theLambdaRange.min(), pRight, theLambdaRange.max());
305 }
GlobalPoint const & origin() const
T z() const
Definition: PV3DBase.h:61
SimpleLineRZ::Point Point
float originRBound() const
bounds the particle vertex in the transverse plane
float originZBound() const
bounds the particle vertex in the longitudinal plane

◆ stringToUseMeasurementTracker()

RectangularEtaPhiTrackingRegion::UseMeasurementTracker RectangularEtaPhiTrackingRegion::stringToUseMeasurementTracker ( const std::string &  name)
static

Definition at line 79 of file RectangularEtaPhiTrackingRegion.cc.

References Exception, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, createJobs::tmp, and HcalDetIdTransform::transform().

Referenced by AreaSeededTrackingRegionsBuilder::AreaSeededTrackingRegionsBuilder(), CandidatePointSeededTrackingRegionsProducer::CandidatePointSeededTrackingRegionsProducer(), CandidateSeededTrackingRegionsProducer::CandidateSeededTrackingRegionsProducer(), L1MuonSeededTrackingRegionsProducer::L1MuonSeededTrackingRegionsProducer(), L3MumuTrackingRegion::L3MumuTrackingRegion(), PointSeededTrackingRegionsProducer::PointSeededTrackingRegionsProducer(), TauRegionalPixelSeedGenerator::TauRegionalPixelSeedGenerator(), and TrackingRegionsFromBeamSpotAndL2Tau::TrackingRegionsFromBeamSpotAndL2Tau().

80  {
82  std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::tolower);
83  if (tmp == "never")
85  if (tmp == "forsistrips")
87  if (tmp == "always")
89  throw cms::Exception("Configuration") << "Got invalid string '" << name
90  << "', valid values are 'Never', 'ForSiStrips', 'Always' (case insensitive)";
91 }
tmp
align.sh
Definition: createJobs.py:716
unsigned transform(const HcalDetId &id, unsigned transformCode)

◆ tanLambdaRange()

const Range& RectangularEtaPhiTrackingRegion::tanLambdaRange ( ) const
inline

Member Data Documentation

◆ cache

cacheHits RectangularEtaPhiTrackingRegion::cache
mutableprivate

Definition at line 249 of file RectangularEtaPhiTrackingRegion.h.

◆ theEtaRange

Range RectangularEtaPhiTrackingRegion::theEtaRange
private

Definition at line 230 of file RectangularEtaPhiTrackingRegion.h.

Referenced by etaRange().

◆ theField

const MagneticField* RectangularEtaPhiTrackingRegion::theField = nullptr
private

Definition at line 239 of file RectangularEtaPhiTrackingRegion.h.

◆ theLambdaRange

Range RectangularEtaPhiTrackingRegion::theLambdaRange
private

Definition at line 231 of file RectangularEtaPhiTrackingRegion.h.

Referenced by tanLambdaRange().

◆ theMeanLambda

float RectangularEtaPhiTrackingRegion::theMeanLambda
private

Definition at line 233 of file RectangularEtaPhiTrackingRegion.h.

◆ theMeasurementTracker

const MeasurementTrackerEvent* RectangularEtaPhiTrackingRegion::theMeasurementTracker = nullptr
private

Definition at line 238 of file RectangularEtaPhiTrackingRegion.h.

◆ theMeasurementTrackerUsage

const UseMeasurementTracker RectangularEtaPhiTrackingRegion::theMeasurementTrackerUsage = UseMeasurementTracker::kNever
private

Definition at line 234 of file RectangularEtaPhiTrackingRegion.h.

◆ theMSMaker

const MultipleScatteringParametrisationMaker* RectangularEtaPhiTrackingRegion::theMSMaker = nullptr
private

Definition at line 240 of file RectangularEtaPhiTrackingRegion.h.

◆ thePhiMargin

Margin RectangularEtaPhiTrackingRegion::thePhiMargin
private

Definition at line 232 of file RectangularEtaPhiTrackingRegion.h.

Referenced by phiMargin().

◆ thePrecise

bool RectangularEtaPhiTrackingRegion::thePrecise = false
private

Definition at line 235 of file RectangularEtaPhiTrackingRegion.h.

Referenced by isPrecise().

◆ theUseEtaPhi

bool RectangularEtaPhiTrackingRegion::theUseEtaPhi = false
private

Definition at line 237 of file RectangularEtaPhiTrackingRegion.h.

◆ theUseMS

bool RectangularEtaPhiTrackingRegion::theUseMS = false
private

Definition at line 236 of file RectangularEtaPhiTrackingRegion.h.