CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
CosmicTrackingRegion Class Reference

#include <CosmicTrackingRegion.h>

Inheritance diagram for CosmicTrackingRegion:
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
 
 CosmicTrackingRegion (const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, float deltaEta, float deltaPhi, const edm::ParameterSet &extra, const MeasurementTrackerEvent *measurementTracker=nullptr)
 
 CosmicTrackingRegion (const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, float deltaEta, float deltaPhi, float dummy=0., const MeasurementTrackerEvent *measurementTracker=nullptr)
 
 CosmicTrackingRegion (CosmicTrackingRegion const &rh)
 
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
 
 ~CosmicTrackingRegion () 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
 
virtual std::string print () 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 Types

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

Private Member Functions

template<typename T >
void hits_ (const edm::EventSetup &es, const T &layer, TrackingRegion::Hits &result) const
 

Private Attributes

cacheHits cache
 
std::string measurementTrackerName_
 
const MeasurementTrackerEventtheMeasurementTracker_
 

Additional Inherited Members

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

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 24 of file CosmicTrackingRegion.h.

Member Typedef Documentation

◆ cacheHitPointer

Definition at line 112 of file CosmicTrackingRegion.h.

◆ cacheHits

using CosmicTrackingRegion::cacheHits = std::vector<cacheHitPointer>
private

Definition at line 113 of file CosmicTrackingRegion.h.

Constructor & Destructor Documentation

◆ ~CosmicTrackingRegion()

CosmicTrackingRegion::~CosmicTrackingRegion ( )
inlineoverride

Definition at line 26 of file CosmicTrackingRegion.h.

26 {}

◆ CosmicTrackingRegion() [1/3]

CosmicTrackingRegion::CosmicTrackingRegion ( const GlobalVector dir,
const GlobalPoint vertexPos,
float  ptMin,
float  rVertex,
float  zVertex,
float  deltaEta,
float  deltaPhi,
float  dummy = 0.,
const MeasurementTrackerEvent measurementTracker = nullptr 
)
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

Definition at line 52 of file CosmicTrackingRegion.h.

◆ CosmicTrackingRegion() [2/3]

CosmicTrackingRegion::CosmicTrackingRegion ( const GlobalVector dir,
const GlobalPoint vertexPos,
float  ptMin,
float  rVertex,
float  zVertex,
float  deltaEta,
float  deltaPhi,
const edm::ParameterSet extra,
const MeasurementTrackerEvent measurementTracker = nullptr 
)
inline

◆ CosmicTrackingRegion() [3/3]

CosmicTrackingRegion::CosmicTrackingRegion ( CosmicTrackingRegion const &  rh)
inline

Definition at line 79 of file CosmicTrackingRegion.h.

80  : TrackingRegionBase(rh),
81  theMeasurementTracker_(rh.theMeasurementTracker_),
82  measurementTrackerName_(rh.measurementTrackerName_) {}

Member Function Documentation

◆ checkRZ()

std::unique_ptr<HitRZCompatibility> CosmicTrackingRegion::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
inlineoverridevirtual

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

Implements TrackingRegion.

Definition at line 86 of file CosmicTrackingRegion.h.

93  {
94  return nullptr;
95  }

◆ checkTracks()

void CosmicTrackingRegion::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 27 of file CosmicTrackingRegion.cc.

27  {
28  const math::XYZPoint regOrigin(origin().x(), origin().y(), origin().z());
29 
30  assert(mask.size() == tracks.size());
31  int i = -1;
32  for (auto const& track : tracks) {
33  i++;
34  if (mask[i])
35  continue;
36 
37  if (track.pt() < ptMin()) {
38  continue;
39  }
40  if (std::abs(track.dxy(regOrigin)) > originRBound()) {
41  continue;
42  }
43  if (std::abs(track.dz(regOrigin)) > originZBound()) {
44  continue;
45  }
46 
47  mask[i] = true;
48  }
49 }

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

◆ clone()

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

Implements TrackingRegion.

Definition at line 101 of file CosmicTrackingRegion.h.

101 { return std::make_unique<CosmicTrackingRegion>(*this); }

◆ hits()

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

get hits from layer compatible with region constraints

Implements TrackingRegion.

Definition at line 51 of file CosmicTrackingRegion.cc.

52  {
54  hits_(es, layer, result);
55  return result;
56 }

References phase1PixelTopology::layer, and mps_fire::result.

◆ hits_()

template<typename T >
void CosmicTrackingRegion::hits_ ( const edm::EventSetup es,
const T layer,
TrackingRegion::Hits result 
) const
private

Definition at line 59 of file CosmicTrackingRegion.cc.

59  {
60  //get and name collections
61  //++++++++++++++++++++++++
62 
63  //detector layer
64  const DetLayer* detLayer = layer.detLayer();
65  LogDebug("CosmicTrackingRegion") << "Looking at hits on subdet/layer " << layer.name();
66  EtaPhiMeasurementEstimator est(0.3, 0.3);
67 
68  //magnetic field
70  es.get<IdealMagneticFieldRecord>().get(field);
71  const MagneticField* magField = field.product();
72 
73  //region
74  const GlobalPoint vtx = origin();
76  LogDebug("CosmicTrackingRegion") << "The initial region characteristics are:"
77  << "\n"
78  << " Origin = " << origin() << "\n"
79  << " Direction = " << direction() << "\n"
80  << " Eta = " << origin().eta() << "\n"
81  << " Phi = " << origin().phi();
82 
83  //trajectory state on surface
84  float phi = dir.phi();
85  Surface::RotationType rot(sin(phi), -cos(phi), 0, 0, 0, -1, cos(phi), sin(phi), 0);
86 
89  TrajectoryStateOnSurface tsos(fts, *surface);
90  LogDebug("CosmicTrackingRegion") << "The state used to find measurement with the measurement tracker is:\n" << tsos;
91 
92  //propagator
93  AnalyticalPropagator prop(magField, alongMomentum);
94 
95  //propagation verification (debug)
96  //++++++++++++++++++++++++++++++++
97 
98  //creation of the state
99  TrajectoryStateOnSurface stateOnLayer = prop.propagate(*tsos.freeState(), detLayer->surface());
100 
101  //verification of the state
102  if (stateOnLayer.isValid()) {
103  LogDebug("CosmicTrackingRegion") << "The initial state propagates to the layer surface: \n"
104  << stateOnLayer << "R = " << stateOnLayer.globalPosition().perp() << "\n"
105  << "Eta = " << stateOnLayer.globalPosition().eta() << "\n"
106  << "Phi = " << stateOnLayer.globalPosition().phi();
107 
108  } else {
109  LogDebug("CosmicTrackingRegion") << "The initial state does not propagate to the layer surface.";
110  }
111 
112  //number of compatible dets
114  vector<DetWithState> compatDets = detLayer->compatibleDets(tsos, prop, est);
115  LogDebug("CosmicTrackingRegion") << "Compatible dets = " << compatDets.size();
116 
117  //get hits
118  //++++++++
119 
120  //measurement tracker (find hits)
122  vector<TrajectoryMeasurement> meas = lm.measurements(*detLayer, tsos, prop, est);
123  LogDebug("CosmicTrackingRegion") << "Number of Trajectory measurements = " << meas.size()
124  << " but the last one is always an invalid hit, by construction.";
125 
126  //trajectory measurement
127 
128  // std::cout <<"CRegion b " << cache.size() << std::endl;
129 
130  // waiting for a migration at LayerMeasurements level and at seed builder level
131  for (auto const& im : meas) {
132  if (!im.recHit()->isValid())
133  continue;
134  assert(!trackerHitRTTI::isUndef(*im.recHit()->hit()));
135  auto ptrHit = (BaseTrackerRecHit*)(im.recHit()->hit()->clone());
136  cache.emplace_back(ptrHit);
137  result.emplace_back(ptrHit);
138  }
139 
140  // std::cout <<"CRegion a " << cache.size() << std::endl;
141 }

References alongMomentum, AnalyticalPropagator_cfi::AnalyticalPropagator, cms::cuda::assert(), Plane::build(), utilities::cache(), GeometricSearchDet::compatibleDets(), funct::cos(), DeadROC_duringRun::dir, PV3DBase< T, PVType, FrameType >::eta(), TrajectoryStateOnSurface::freeState(), edm::EventSetup::get(), get, TrajectoryStateOnSurface::globalPosition(), trackerHitRTTI::isUndef(), TrajectoryStateOnSurface::isValid(), phase1PixelTopology::layer, LogDebug, LayerMeasurements::measurements(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), edm::ESHandle< T >::product(), mps_fire::result, makeMuonMisalignmentScenario::rot, funct::sin(), GeometricSearchDet::surface(), and extraflags_cff::vtx.

◆ name()

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

Reimplemented from TrackingRegion.

Definition at line 103 of file CosmicTrackingRegion.h.

103 { return "CosmicTrackingRegion"; }

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

Member Data Documentation

◆ cache

cacheHits CosmicTrackingRegion::cache
mutableprivate

Definition at line 118 of file CosmicTrackingRegion.h.

◆ measurementTrackerName_

std::string CosmicTrackingRegion::measurementTrackerName_
private

Definition at line 110 of file CosmicTrackingRegion.h.

Referenced by CosmicTrackingRegion().

◆ theMeasurementTracker_

const MeasurementTrackerEvent* CosmicTrackingRegion::theMeasurementTracker_
private

Definition at line 109 of file CosmicTrackingRegion.h.

Vector3DBase
Definition: Vector3DBase.h:8
TrackingRegion::origin
GlobalPoint const & origin() const
Definition: TrackingRegion.h:74
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
TkRotation< float >
DDAxes::y
LayerMeasurements::measurements
std::vector< TrajectoryMeasurement > measurements(const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
Definition: LayerMeasurements.cc:122
mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
CosmicTrackingRegion::measurementTrackerName_
std::string measurementTrackerName_
Definition: CosmicTrackingRegion.h:110
HLTSiStripMonitoring_cff.measurementTracker
measurementTracker
Definition: HLTSiStripMonitoring_cff.py:178
DetLayer
Definition: DetLayer.h:21
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
HLT_FULL_cff.rVertex
rVertex
Definition: HLT_FULL_cff.py:113770
cms::cuda::assert
assert(be >=bs)
trackerHitRTTI::isUndef
bool isUndef(TrackingRecHit const &hit)
Definition: trackerHitRTTI.h:24
CosmicTrackingRegion::hits_
void hits_(const edm::EventSetup &es, const T &layer, TrackingRegion::Hits &result) const
Definition: CosmicTrackingRegion.cc:59
GeometricSearchDet::compatibleDets
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
Definition: GeometricSearchDet.cc:35
ReferenceCountingPointer< Plane >
DDAxes::x
HLT_FULL_cff.zVertex
zVertex
Definition: HLT_FULL_cff.py:113768
CosmicTrackingRegion::theMeasurementTracker_
const MeasurementTrackerEvent * theMeasurementTracker_
Definition: CosmicTrackingRegion.h:109
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
LayerMeasurements
Definition: LayerMeasurements.h:18
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
TrackingRegion::Hits
SeedingLayerSetsHits::Hits Hits
Definition: TrackingRegion.h:47
BaseTrackerRecHit
Definition: BaseTrackerRecHit.h:15
DDAxes::z
edm::ESHandle< MagneticField >
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
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
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
AnalyticalPropagator_cfi.AnalyticalPropagator
AnalyticalPropagator
Definition: AnalyticalPropagator_cfi.py:3
Plane::build
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
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:159
TrackingRegion::originZBound
float originZBound() const
bounds the particle vertex in the longitudinal plane
Definition: TrackingRegion.h:80
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
TrackingRegion::direction
GlobalVector const & direction() const
the direction around which region is constructed
Definition: TrackingRegion.h:65
EtaPhiMeasurementEstimator
Definition: EtaPhiMeasurementEstimator.h:15
TrackingRegion::Range
PixelRecoRange< float > Range
Definition: TrackingRegion.h:45
DetWithState
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
Definition: RPCRecHitFilter.h:58
GeometricSearchDet::DetWithState
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
Definition: GeometricSearchDet.h:19
get
#define get
DDAxes::phi
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
GeometricSearchDet::surface
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CosmicTrackingRegion::cache
cacheHits cache
Definition: CosmicTrackingRegion.h:118
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MagneticField
Definition: MagneticField.h:19
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
alongMomentum
Definition: PropagationDirection.h:4
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
TrackingRegionBase
TrackingRegion TrackingRegionBase
Definition: TrackingRegion.h:146
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23