CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GlobalTrackingRegion Class Referencefinal

#include <GlobalTrackingRegion.h>

Inheritance diagram for GlobalTrackingRegion:
TrackingRegion

Public Member Functions

std::unique_ptr< HitRZCompatibilitycheckRZ (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 override
 
void checkTracks (reco::TrackCollection const &tracks, std::vector< bool > &mask) const override
 
std::unique_ptr< TrackingRegionclone () const override
 
 GlobalTrackingRegion (float ptMin, const GlobalPoint &origin, float originRadius, float originHalfLength, bool precise=false, bool useMS=false)
 
 GlobalTrackingRegion (float ptMin=1., float originRadius=0.2, float originHalfLength=22.7, float originZPos=0., bool precise=false)
 
TrackingRegion::Hits hits (const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const override
 get hits from layer compatible with region constraints More...
 
std::string name () const override
 
std::string print () const override
 
- 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 (const GlobalVector &direction, const GlobalPoint &originPos, const Range &invPtRange, const float &originRBound, const float &originZBound)
 
GlobalVector const & unitDirection () const
 
virtual ~TrackingRegion ()
 

Private Attributes

bool thePrecise = false
 
bool theUseMS = false
 

Additional Inherited Members

- Public Types inherited from TrackingRegion
typedef SeedingLayerSetsHits::ConstRecHitPointer Hit
 
typedef SeedingLayerSetsHits::Hits Hits
 
typedef PixelRecoRange< float > Range
 

Detailed Description

An implementation of the TrackingRegion where the region of interest is global, ie there are no constraints on the allowed direction of particles of interest

Definition at line 13 of file GlobalTrackingRegion.h.

Constructor & Destructor Documentation

◆ GlobalTrackingRegion() [1/2]

GlobalTrackingRegion::GlobalTrackingRegion ( float  ptMin,
const GlobalPoint origin,
float  originRadius,
float  originHalfLength,
bool  precise = false,
bool  useMS = false 
)
inline

Construct from minimal track P_t, and origin size and position. The origin region is a cylinder of radius originRadius, half length originHalfLength, positioned at "origin". This class DOES provide the possibility to displace the origin in the transverse plane.

Definition at line 21 of file GlobalTrackingRegion.h.

◆ GlobalTrackingRegion() [2/2]

GlobalTrackingRegion::GlobalTrackingRegion ( float  ptMin = 1.,
float  originRadius = 0.2,
float  originHalfLength = 22.7,
float  originZPos = 0.,
bool  precise = false 
)
inline

Definition at line 32 of file GlobalTrackingRegion.h.

38  GlobalPoint(0, 0, originZPos),
39  Range(-1 / ptMin, 1 / ptMin),

Member Function Documentation

◆ checkRZ()

std::unique_ptr< HitRZCompatibility > GlobalTrackingRegion::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
overridevirtual

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

Implements TrackingRegion.

Definition at line 34 of file GlobalTrackingRegion.cc.

41  {
42  bool isBarrel = layer->isBarrel();
43  bool isPixel = (layer->subDetector() == PixelBarrel || layer->subDetector() == PixelEndcap);
44 
45  if UNLIKELY (!outerlayer) {
46  GlobalPoint ohit = outerHit->globalPosition();
47  lr = std::sqrt(sqr(ohit.x() - origin().x()) + sqr(ohit.y() - origin().y()));
48  gz = ohit.z();
49  dr = outerHit->errorGlobalR();
50  dz = outerHit->errorGlobalZ();
51  }
52 
53  PixelRecoPointRZ outerred(lr, gz);
54 
55  PixelRecoPointRZ vtxR = (gz > origin().z() + originZBound())
58  PixelRecoPointRZ vtxL = (gz < origin().z() - originZBound())
61 
62  if UNLIKELY ((!thePrecise) && (isPixel)) {
63  auto VcotMin = PixelRecoLineRZ(vtxR, outerred).cotLine();
64  auto VcotMax = PixelRecoLineRZ(vtxL, outerred).cotLine();
65  return std::make_unique<HitEtaCheck>(isBarrel, outerred, VcotMax, VcotMin);
66  }
67 
68  constexpr float nSigmaPhi = 3.;
69 
70  dr *= nSigmaPhi;
71  dz *= nSigmaPhi;
72 
73  PixelRecoPointRZ outerL, outerR;
74  if (isBarrel) {
75  outerL = PixelRecoPointRZ(lr, gz - dz);
76  outerR = PixelRecoPointRZ(lr, gz + dz);
77  } else if (gz > 0) {
78  outerL = PixelRecoPointRZ(lr + dr, gz);
79  outerR = PixelRecoPointRZ(lr - dr, gz);
80  } else {
81  outerL = PixelRecoPointRZ(lr - dr, gz);
82  outerR = PixelRecoPointRZ(lr + dr, gz);
83  }
84 
85  auto corr = isBarrel ? dz : dr;
86 
87  SimpleLineRZ leftLine(vtxL, outerL);
88  SimpleLineRZ rightLine(vtxR, outerR);
89  HitRZConstraint rzConstraint(leftLine, rightLine);
90 
91  if UNLIKELY (theUseMS) {
94 
95  float innerScatt = 3.f * (outerlayer ? iSigma(ptMin(), vtxMean, outerred, outerlayer->seqNum())
96  : iSigma(ptMin(), vtxMean, outerred));
97 
98  float cotTheta = SimpleLineRZ(vtxMean, outerred).cotLine();
99 
100  if (isBarrel) {
101  float sinTheta = 1 / std::sqrt(1 + sqr(cotTheta));
102  corr = innerScatt / sinTheta + dz;
103  } else {
104  float cosTheta = 1 / std::sqrt(1 + sqr(1 / cotTheta));
105  corr = innerScatt / cosTheta + dr;
106  }
107  }
108 
109  if (isBarrel) {
110  return std::make_unique<HitZCheck>(rzConstraint, HitZCheck::Margin(corr, corr));
111  } else {
112  return std::make_unique<HitRCheck>(rzConstraint, HitRCheck::Margin(corr, corr));
113  }
114 }

References alignCSCRings::corr, PixelRecoLineRZ::cotLine(), SimpleLineRZ::cotLine(), flavorHistoryFilter_cfi::dr, PVValHelper::dz, GeomDetEnumerators::isBarrel(), fastTrackerRecHitType::isPixel(), phase1PixelTopology::layer, nSigmaPhi, GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, ptMin, DetLayer::seqNum(), sqr(), mathSSE::sqrt(), UNLIKELY, vtxMean(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ checkTracks()

void GlobalTrackingRegion::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 116 of file GlobalTrackingRegion.cc.

116  {
117  const math::XYZPoint regOrigin(origin().x(), origin().y(), origin().z());
118 
119  assert(mask.size() == tracks.size());
120  int i = -1;
121  for (auto const& track : tracks) {
122  i++;
123  if (mask[i])
124  continue;
125 
126  if (track.pt() < ptMin()) {
127  continue;
128  }
129  if (std::abs(track.dxy(regOrigin)) > originRBound()) {
130  continue;
131  }
132  if (std::abs(track.dz(regOrigin)) > originZBound()) {
133  continue;
134  }
135 
136  mask[i] = true;
137  }
138 }

References funct::abs(), cms::cuda::assert(), mps_fire::i, ptMin, HLT_FULL_cff::track, and tracks.

◆ clone()

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

Implements TrackingRegion.

Definition at line 59 of file GlobalTrackingRegion.h.

59 { return std::make_unique<GlobalTrackingRegion>(*this); }

◆ hits()

TrackingRegion::Hits GlobalTrackingRegion::hits ( const edm::EventSetup es,
const SeedingLayerSetsHits::SeedingLayer layer 
) const
overridevirtual

get hits from layer compatible with region constraints

Implements TrackingRegion.

Definition at line 29 of file GlobalTrackingRegion.cc.

30  {
31  return layer.hits();
32 }

References phase1PixelTopology::layer.

Referenced by SimpleCosmicBONSeeder::triplets().

◆ name()

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

Reimplemented from TrackingRegion.

Definition at line 61 of file GlobalTrackingRegion.h.

61 { return "GlobalTrackingRegion"; }

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

◆ print()

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

Reimplemented from TrackingRegion.

Definition at line 23 of file GlobalTrackingRegion.cc.

23  {
24  std::ostringstream str;
25  str << TrackingRegionBase::print() << "precise: " << thePrecise;
26  return str.str();
27 }

References TrackingRegion::print(), and str.

Member Data Documentation

◆ thePrecise

bool GlobalTrackingRegion::thePrecise = false
private

Definition at line 65 of file GlobalTrackingRegion.h.

◆ theUseMS

bool GlobalTrackingRegion::theUseMS = false
private

Definition at line 66 of file GlobalTrackingRegion.h.

TrackingRegion::origin
GlobalPoint const & origin() const
Definition: TrackingRegion.h:74
reco_skim_cfg_mod.originRadius
originRadius
Definition: reco_skim_cfg_mod.py:188
DDAxes::y
nSigmaPhi
constexpr float nSigmaPhi
Definition: PixelTripletLargeTipGenerator.cc:44
mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
hltPixelTracks_cff.precise
precise
Definition: hltPixelTracks_cff.py:32
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
SimpleLineRZ::cotLine
float cotLine() const
Definition: PixelRecoLineRZ.h:74
cms::cuda::assert
assert(be >=bs)
DDAxes::x
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
TrackingRegion::print
virtual std::string print() const
Definition: TrackingRegion.h:126
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
GeomDetEnumerators::PixelBarrel
Definition: GeomDetEnumerators.h:11
alignCSCRings.corr
dictionary corr
Definition: alignCSCRings.py:124
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco_skim_cfg_mod.originHalfLength
originHalfLength
Definition: reco_skim_cfg_mod.py:187
DDAxes::z
str
#define str(s)
Definition: TestProcessor.cc:53
HitRZConstraint
Definition: HitRZConstraint.h:8
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
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
DetLayer::seqNum
int seqNum() const
Definition: DetLayer.h:35
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:176
fastTrackerRecHitType::isPixel
bool isPixel(HitType hitType)
Definition: FastTrackerRecHit.h:37
beam_dqm_sourceclient-live_cfg.originZPos
originZPos
Definition: beam_dqm_sourceclient-live_cfg.py:328
TrackingRegion::originZBound
float originZBound() const
bounds the particle vertex in the longitudinal plane
Definition: TrackingRegion.h:80
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
PixelRecoLineRZ
Definition: PixelRecoLineRZ.h:12
TrackingRegion::Range
PixelRecoRange< float > Range
Definition: TrackingRegion.h:45
TkTrackingRegionsMargin< float >
GlobalTrackingRegion::theUseMS
bool theUseMS
Definition: GlobalTrackingRegion.h:66
PixelRecoPointRZ
Definition: PixelRecoPointRZ.h:6
sqr
T sqr(T t)
Definition: GlobalTrackingRegion.cc:17
SimpleLineRZ
Definition: PixelRecoLineRZ.h:63
PVValHelper::dz
Definition: PVValidationHelpers.h:51
PixelRecoLineRZ::cotLine
float cotLine() const
Definition: PixelRecoLineRZ.h:31
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
GeomDetEnumerators::PixelEndcap
Definition: GeomDetEnumerators.h:12
MultipleScatteringParametrisation
Definition: MultipleScatteringParametrisation.h:16
GlobalTrackingRegion::thePrecise
bool thePrecise
Definition: GlobalTrackingRegion.h:65
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
vtxMean
static GlobalPoint vtxMean(const GlobalPoint &p1, const GlobalError &e1, const GlobalPoint &p2, const GlobalError &e2)
Definition: GhostTrackVertexFinder.cc:123
TrackingRegionBase
TrackingRegion TrackingRegionBase
Definition: TrackingRegion.h:146