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

References alignCSCRings::corr, PixelRecoLineRZ::cotLine(), SimpleLineRZ::cotLine(), flavorHistoryFilter_cfi::dr, PVValHelper::dz, DetLayer::isBarrel(), GeomDetEnumerators::isBarrel(), fastTrackerRecHitType::isPixel(), nSigmaPhi, GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, ptMin, DetLayer::seqNum(), sqr(), mathSSE::sqrt(), DetLayer::subDetector(), 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 119 of file GlobalTrackingRegion.cc.

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

References funct::abs(), cms::cuda::assert(), mps_fire::i, ptMin, HLT_2018_cff::track, and PDWG_EXOHSCP_cff::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 SeedingLayerSetsHits::SeedingLayer::hits().

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:73
DDAxes::y
nSigmaPhi
constexpr float nSigmaPhi
Definition: PixelTripletLargeTipGenerator.cc:44
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
mps_fire.i
i
Definition: mps_fire.py:355
hltPixelTracks_cff.precise
precise
Definition: hltPixelTracks_cff.py:32
DetLayer::subDetector
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel,...
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
DDAxes::z
str
#define str(s)
Definition: TestProcessor.cc:48
HitRZConstraint
Definition: HitRZConstraint.h:8
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
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
DetLayer::seqNum
int seqNum() const
Definition: DetLayer.h:35
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
fastTrackerRecHitType::isPixel
bool isPixel(HitType hitType)
Definition: FastTrackerRecHit.h:37
beam_dqm_sourceclient-live_cfg.originZPos
originZPos
Definition: beam_dqm_sourceclient-live_cfg.py:316
TrackingRegion::originZBound
float originZBound() const
bounds the particle vertex in the longitudinal plane
Definition: TrackingRegion.h:79
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
PixelRecoLineRZ
Definition: PixelRecoLineRZ.h:12
TrackingRegion::Range
PixelRecoRange< float > Range
Definition: TrackingRegion.h:44
TkTrackingRegionsMargin< float >
GlobalTrackingRegion::theUseMS
bool theUseMS
Definition: GlobalTrackingRegion.h:66
PixelRecoPointRZ
Definition: PixelRecoPointRZ.h:6
SeedingLayerSetsHits::SeedingLayer::hits
Hits hits() const
Definition: SeedingLayerSetsHits.h:51
sqr
T sqr(T t)
Definition: GlobalTrackingRegion.cc:17
SimpleLineRZ
Definition: PixelRecoLineRZ.h:63
LaserSeedGenerator_cfi.originHalfLength
originHalfLength
Definition: LaserSeedGenerator_cfi.py:4
PVValHelper::dz
Definition: PVValidationHelpers.h:50
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
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
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:121
DetLayer::isBarrel
bool isBarrel() const
Definition: DetLayer.h:31
TrackingRegionBase
TrackingRegion TrackingRegionBase
Definition: TrackingRegion.h:146
LaserSeedGenerator_cfi.originRadius
originRadius
Definition: LaserSeedGenerator_cfi.py:10