CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< HitRZCompatibility
checkRZ (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
 
 GlobalTrackingRegion (float ptMin, const GlobalPoint &origin, float originRadius, float originHalfLength, bool precise=false, bool useMS=false, const MultipleScatteringParametrisationMaker *msmaker=nullptr)
 
 GlobalTrackingRegion (float ptMin=1., float originRadius=0.2, float originHalfLength=22.7, float originZPos=0., bool precise=false)
 
TrackingRegion::Hits hits (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 ()
 
 TrackingRegion (const GlobalVector &direction, const GlobalPoint &originPos, const Range &invPtRange, const float &originRBound, const float &originZBound)
 
GlobalVector const & unitDirection () const
 
virtual ~TrackingRegion ()
 

Private Attributes

const
MultipleScatteringParametrisationMaker
theMSMaker = nullptr
 
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 14 of file GlobalTrackingRegion.h.

Constructor & Destructor Documentation

GlobalTrackingRegion::GlobalTrackingRegion ( float  ptMin,
const GlobalPoint origin,
float  originRadius,
float  originHalfLength,
bool  precise = false,
bool  useMS = false,
const MultipleScatteringParametrisationMaker msmaker = nullptr 
)
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.

if useMS == true, msmaker needs to be given

Definition at line 24 of file GlobalTrackingRegion.h.

32  theMSMaker(msmaker),
34  theUseMS(useMS) {}
PixelRecoRange< float > Range
float ptMin() const
minimal pt of interest
const MultipleScatteringParametrisationMaker * theMSMaker
tuple originHalfLength
Global3DVector GlobalVector
Definition: GlobalVector.h:10
TrackingRegion TrackingRegionBase
GlobalTrackingRegion::GlobalTrackingRegion ( float  ptMin = 1.,
float  originRadius = 0.2,
float  originHalfLength = 22.7,
float  originZPos = 0.,
bool  precise = false 
)
inline

Definition at line 37 of file GlobalTrackingRegion.h.

43  GlobalPoint(0, 0, originZPos),
44  Range(-1 / ptMin, 1 / ptMin),
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
PixelRecoRange< float > Range
float ptMin() const
minimal pt of interest
tuple originHalfLength
Global3DVector GlobalVector
Definition: GlobalVector.h:10
TrackingRegion TrackingRegionBase

Member Function Documentation

std::unique_ptr< HitRZCompatibility > GlobalTrackingRegion::checkRZ ( const DetLayer layer,
const Hit outerHit,
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 31 of file GlobalTrackingRegion.cc.

References alignCSCRings::corr, PixelRecoLineRZ::cotLine(), SimpleLineRZ::cotLine(), runTauDisplay::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().

37  {
38  bool isBarrel = layer->isBarrel();
39  bool isPixel = (layer->subDetector() == PixelBarrel || layer->subDetector() == PixelEndcap);
40 
41  if UNLIKELY (!outerlayer) {
42  GlobalPoint ohit = outerHit->globalPosition();
43  lr = std::sqrt(sqr(ohit.x() - origin().x()) + sqr(ohit.y() - origin().y()));
44  gz = ohit.z();
45  dr = outerHit->errorGlobalR();
46  dz = outerHit->errorGlobalZ();
47  }
48 
49  PixelRecoPointRZ outerred(lr, gz);
50 
51  PixelRecoPointRZ vtxR = (gz > origin().z() + originZBound())
54  PixelRecoPointRZ vtxL = (gz < origin().z() - originZBound())
57 
58  if UNLIKELY ((!thePrecise) && (isPixel)) {
59  auto VcotMin = PixelRecoLineRZ(vtxR, outerred).cotLine();
60  auto VcotMax = PixelRecoLineRZ(vtxL, outerred).cotLine();
61  return std::make_unique<HitEtaCheck>(isBarrel, outerred, VcotMax, VcotMin);
62  }
63 
64  constexpr float nSigmaPhi = 3.;
65 
66  dr *= nSigmaPhi;
67  dz *= nSigmaPhi;
68 
69  PixelRecoPointRZ outerL, outerR;
70  if (isBarrel) {
71  outerL = PixelRecoPointRZ(lr, gz - dz);
72  outerR = PixelRecoPointRZ(lr, gz + dz);
73  } else if (gz > 0) {
74  outerL = PixelRecoPointRZ(lr + dr, gz);
75  outerR = PixelRecoPointRZ(lr - dr, gz);
76  } else {
77  outerL = PixelRecoPointRZ(lr - dr, gz);
78  outerR = PixelRecoPointRZ(lr + dr, gz);
79  }
80 
81  auto corr = isBarrel ? dz : dr;
82 
83  SimpleLineRZ leftLine(vtxL, outerL);
84  SimpleLineRZ rightLine(vtxR, outerR);
85  HitRZConstraint rzConstraint(leftLine, rightLine);
86 
87  if UNLIKELY (theUseMS) {
90 
91  float innerScatt = 3.f * (outerlayer ? iSigma(ptMin(), vtxMean, outerred, outerlayer->seqNum())
92  : iSigma(ptMin(), vtxMean, outerred));
93 
94  float cotTheta = SimpleLineRZ(vtxMean, outerred).cotLine();
95 
96  if (isBarrel) {
97  float sinTheta = 1 / std::sqrt(1 + sqr(cotTheta));
98  corr = innerScatt / sinTheta + dz;
99  } else {
100  float cosTheta = 1 / std::sqrt(1 + sqr(1 / cotTheta));
101  corr = innerScatt / cosTheta + dr;
102  }
103  }
104 
105  if (isBarrel) {
106  return std::make_unique<HitZCheck>(rzConstraint, HitZCheck::Margin(corr, corr));
107  } else {
108  return std::make_unique<HitRCheck>(rzConstraint, HitRCheck::Margin(corr, corr));
109  }
110 }
float originRBound() const
bounds the particle vertex in the transverse plane
float cotLine() const
GlobalPoint const & origin() const
TkTrackingRegionsMargin< float > Margin
Definition: HitRCheck.h:14
TkTrackingRegionsMargin< float > Margin
Definition: HitZCheck.h:14
T y() const
Definition: PV3DBase.h:60
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
int sqr(const T &t)
int seqNum() const
Definition: DetLayer.h:35
float cotLine() const
T sqrt(T t)
Definition: SSEVec.h:19
T z() const
Definition: PV3DBase.h:61
MultipleScatteringParametrisation parametrisation(const DetLayer *layer, X0Source x0Source=X0Source::useX0AtEta) const
static GlobalPoint vtxMean(const GlobalPoint &p1, const GlobalError &e1, const GlobalPoint &p2, const GlobalError &e2)
constexpr float nSigmaPhi
float originZBound() const
bounds the particle vertex in the longitudinal plane
bool isBarrel() const
Definition: DetLayer.h:31
float ptMin() const
minimal pt of interest
bool isPixel(HitType hitType)
#define UNLIKELY(x)
Definition: Likely.h:21
T x() const
Definition: PV3DBase.h:59
const MultipleScatteringParametrisationMaker * theMSMaker
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 112 of file GlobalTrackingRegion.cc.

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

112  {
113  const math::XYZPoint regOrigin(origin().x(), origin().y(), origin().z());
114 
115  assert(mask.size() == tracks.size());
116  int i = -1;
117  for (auto const& track : tracks) {
118  i++;
119  if (mask[i])
120  continue;
121 
122  if (track.pt() < ptMin()) {
123  continue;
124  }
125  if (std::abs(track.dxy(regOrigin)) > originRBound()) {
126  continue;
127  }
128  if (std::abs(track.dz(regOrigin)) > originZBound()) {
129  continue;
130  }
131 
132  mask[i] = true;
133  }
134 }
float originRBound() const
bounds the particle vertex in the transverse plane
GlobalPoint const & origin() const
auto const & tracks
cannot be loose
assert(be >=bs)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float originZBound() const
bounds the particle vertex in the longitudinal plane
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
float ptMin() const
minimal pt of interest
std::unique_ptr<TrackingRegion> GlobalTrackingRegion::clone ( void  ) const
inlineoverridevirtual

Implements TrackingRegion.

Definition at line 63 of file GlobalTrackingRegion.h.

63 { return std::make_unique<GlobalTrackingRegion>(*this); }
TrackingRegion::Hits GlobalTrackingRegion::hits ( const SeedingLayerSetsHits::SeedingLayer layer) const
overridevirtual

get hits from layer compatible with region constraints

Implements TrackingRegion.

Definition at line 27 of file GlobalTrackingRegion.cc.

References SeedingLayerSetsHits::SeedingLayer::hits().

Referenced by SimpleCosmicBONSeeder::triplets().

27  {
28  return layer.hits();
29 }
std::string GlobalTrackingRegion::name ( void  ) const
inlineoverridevirtual
std::string GlobalTrackingRegion::print ( void  ) const
overridevirtual

Reimplemented from TrackingRegion.

Definition at line 21 of file GlobalTrackingRegion.cc.

References TrackingRegion::print(), and str.

21  {
22  std::ostringstream str;
23  str << TrackingRegionBase::print() << "precise: " << thePrecise;
24  return str.str();
25 }
virtual std::string print() const
#define str(s)

Member Data Documentation

const MultipleScatteringParametrisationMaker* GlobalTrackingRegion::theMSMaker = nullptr
private

Definition at line 69 of file GlobalTrackingRegion.h.

bool GlobalTrackingRegion::thePrecise = false
private

Definition at line 70 of file GlobalTrackingRegion.h.

bool GlobalTrackingRegion::theUseMS = false
private

Definition at line 71 of file GlobalTrackingRegion.h.