CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual HitRZCompatibilitycheckRZ (const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup, const DetLayer *outerlayer=0, float lr=0, float gz=0, float dr=0, float dz=0) const
 
CosmicTrackingRegionclone () const
 
 CosmicTrackingRegion (const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, float deltaEta, float deltaPhi, float dummy=0., const MeasurementTrackerEvent *measurementTracker=0)
 
 CosmicTrackingRegion (const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, float deltaEta, float deltaPhi, const edm::ParameterSet &extra, const MeasurementTrackerEvent *measurementTracker=0)
 
 CosmicTrackingRegion (CosmicTrackingRegion const &rh)
 
virtual TrackingRegion::ctfHits hits (const edm::Event &ev, const edm::EventSetup &es, const ctfseeding::SeedingLayer *layer) const
 
TrackingRegion::Hits hits (const edm::Event &ev, const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const override
 get hits from layer compatible with region constraints More...
 
std::string name () const
 
virtual ~CosmicTrackingRegion ()
 
- Public Member Functions inherited from TrackingRegion
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...
 
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::Event &ev, 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
using ctfHits = ctfseeding::SeedingLayer::Hits
 
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 25 of file CosmicTrackingRegion.h.

Member Typedef Documentation

Definition at line 120 of file CosmicTrackingRegion.h.

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

Definition at line 121 of file CosmicTrackingRegion.h.

Constructor & Destructor Documentation

virtual CosmicTrackingRegion::~CosmicTrackingRegion ( )
inlinevirtual

Definition at line 29 of file CosmicTrackingRegion.h.

29 { }
CosmicTrackingRegion::CosmicTrackingRegion ( const GlobalVector dir,
const GlobalPoint vertexPos,
float  ptMin,
float  rVertex,
float  zVertex,
float  deltaEta,
float  deltaPhi,
float  dummy = 0.,
const MeasurementTrackerEvent measurementTracker = 0 
)
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 55 of file CosmicTrackingRegion.h.

Referenced by clone().

61  : TrackingRegionBase( dir, vertexPos, Range( -1/ptMin, 1/ptMin),
62  rVertex, zVertex),
63  theMeasurementTracker_(measurementTracker),
65  { }
PixelRecoRange< float > Range
float ptMin() const
minimal pt of interest
const MeasurementTrackerEvent * theMeasurementTracker_
TrackingRegion TrackingRegionBase
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 = 0 
)
inline

Definition at line 67 of file CosmicTrackingRegion.h.

References edm::ParameterSet::getParameter(), measurementTrackerName_, and AlCaHLTBitMon_QueryRunRegistry::string.

73  : TrackingRegionBase( dir, vertexPos, Range( -1/ptMin, 1/ptMin),
74  rVertex, zVertex),
75  theMeasurementTracker_(measurementTracker)
76  {
77  measurementTrackerName_ = extra.getParameter<std::string>("measurementTrackerName");
78  }
T getParameter(std::string const &) const
PixelRecoRange< float > Range
float ptMin() const
minimal pt of interest
const MeasurementTrackerEvent * theMeasurementTracker_
TrackingRegion TrackingRegionBase
CosmicTrackingRegion::CosmicTrackingRegion ( CosmicTrackingRegion const &  rh)
inline

Definition at line 80 of file CosmicTrackingRegion.h.

80  :
82  theMeasurementTracker_(rh.theMeasurementTracker_),
83  measurementTrackerName_(rh.measurementTrackerName_){}
const MeasurementTrackerEvent * theMeasurementTracker_
TrackingRegion TrackingRegionBase

Member Function Documentation

virtual HitRZCompatibility* CosmicTrackingRegion::checkRZ ( const DetLayer layer,
const Hit outerHit,
const edm::EventSetup iSetup,
const DetLayer outerlayer = 0,
float  lr = 0,
float  gz = 0,
float  dr = 0,
float  dz = 0 
) const
inlinevirtual

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

Implements TrackingRegion.

Definition at line 97 of file CosmicTrackingRegion.h.

102  {return 0; }
CosmicTrackingRegion* CosmicTrackingRegion::clone ( void  ) const
inlinevirtual

Implements TrackingRegion.

Definition at line 104 of file CosmicTrackingRegion.h.

References CosmicTrackingRegion().

104 { return new CosmicTrackingRegion(*this); }
CosmicTrackingRegion(const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, float deltaEta, float deltaPhi, float dummy=0., const MeasurementTrackerEvent *measurementTracker=0)
TrackingRegion::ctfHits CosmicTrackingRegion::hits ( const edm::Event ev,
const edm::EventSetup es,
const ctfseeding::SeedingLayer layer 
) const
virtual

Definition at line 26 of file CosmicTrackingRegion.cc.

References h, query::result, and tmp.

29 {
32  hits_(ev, es, *layer, tmp);
33  result.reserve(tmp.size());
34  for ( auto h : tmp) result.emplace_back(*h); // not owned
35  return result;
36 }
ctfseeding::SeedingLayer::Hits ctfHits
tuple result
Definition: query.py:137
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void hits_(const edm::Event &ev, const edm::EventSetup &es, const T &layer, TrackingRegion::Hits &result) const
SeedingLayerSetsHits::Hits Hits
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
TrackingRegion::Hits CosmicTrackingRegion::hits ( const edm::Event ev,
const edm::EventSetup es,
const SeedingLayerSetsHits::SeedingLayer layer 
) const
overridevirtual

get hits from layer compatible with region constraints

Implements TrackingRegion.

Definition at line 38 of file CosmicTrackingRegion.cc.

References query::result.

41 {
43  hits_(ev, es, layer, result);
44  return result;
45 }
tuple result
Definition: query.py:137
void hits_(const edm::Event &ev, const edm::EventSetup &es, const T &layer, TrackingRegion::Hits &result) const
SeedingLayerSetsHits::Hits Hits
template<typename T >
void CosmicTrackingRegion::hits_ ( const edm::Event ev,
const edm::EventSetup es,
const T layer,
TrackingRegion::Hits result 
) const
private

Definition at line 48 of file CosmicTrackingRegion.cc.

References alongMomentum, AnalyticalPropagator_cfi::AnalyticalPropagator, assert(), newFWLiteAna::build, GeometricSearchDet::compatibleDets(), funct::cos(), dir, PV3DBase< T, PVType, FrameType >::eta(), TrajectoryStateOnSurface::freeState(), edm::EventSetup::get(), TrajectoryStateOnSurface::globalPosition(), trackerHitRTTI::isUndef(), TrajectoryStateOnSurface::isValid(), LogDebug, LayerMeasurements::measurements(), PV3DBase< T, PVType, FrameType >::perp(), phi, PV3DBase< T, PVType, FrameType >::phi(), edm::ESHandle< class >::product(), makeMuonMisalignmentScenario::rot, funct::sin(), and GeometricSearchDet::surface().

52 {
53 
54  //get and name collections
55  //++++++++++++++++++++++++
56 
57 
58  //detector layer
59  const DetLayer * detLayer = layer.detLayer();
60  LogDebug("CosmicTrackingRegion") << "Looking at hits on subdet/layer " << layer.name();
61  EtaPhiMeasurementEstimator est(0.3,0.3);
62 
63  //magnetic field
65  es.get<IdealMagneticFieldRecord>().get(field);
66  const MagneticField * magField = field.product();
67 
68  //region
69  const GlobalPoint vtx = origin();
71  LogDebug("CosmicTrackingRegion") <<"The initial region characteristics are:" << "\n"
72  <<" Origin = " << origin() << "\n"
73  <<" Direction = " << direction() << "\n"
74  <<" Eta = " << origin().eta() << "\n"
75  <<" Phi = " << origin().phi();
76 
77  //trajectory state on surface
78  float phi = dir.phi();
79  Surface::RotationType rot( sin(phi), -cos(phi), 0,
80  0, 0, -1,
81  cos(phi), sin(phi), 0);
82 
83  Plane::PlanePointer surface = Plane::build(vtx, rot);
84  FreeTrajectoryState fts( GlobalTrajectoryParameters(vtx, dir, 1, magField) );
85  TrajectoryStateOnSurface tsos(fts, *surface);
86  LogDebug("CosmicTrackingRegion")
87  << "The state used to find measurement with the measurement tracker is:\n" << tsos;
88 
89  //propagator
90  AnalyticalPropagator prop( magField, alongMomentum);
91 
92  //propagation verification (debug)
93  //++++++++++++++++++++++++++++++++
94 
95  //creation of the state
96  TrajectoryStateOnSurface stateOnLayer = prop.propagate( *tsos.freeState(),
97  detLayer->surface());
98 
99  //verification of the state
100  if (stateOnLayer.isValid()){
101  LogDebug("CosmicTrackingRegion") << "The initial state propagates to the layer surface: \n" << stateOnLayer
102  << "R = " << stateOnLayer.globalPosition().perp() << "\n"
103  << "Eta = " << stateOnLayer.globalPosition().eta() << "\n"
104  << "Phi = " << stateOnLayer.globalPosition().phi();
105 
106  }
107  else{
108  LogDebug("CosmicTrackingRegion") << "The initial state does not propagate to the layer surface.";
109  }
110 
111  //number of compatible dets
113  vector<DetWithState> compatDets = detLayer->compatibleDets(tsos, prop, est);
114  LogDebug("CosmicTrackingRegion") << "Compatible dets = " << compatDets.size();
115 
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()) continue;
133  assert(!trackerHitRTTI::isUndef(*im.recHit()->hit()));
134  auto ptrHit = (BaseTrackerRecHit *)(im.recHit()->hit()->clone());
135  cache.emplace_back(ptrHit);
136  result.emplace_back(ptrHit);
137  }
138 
139  // std::cout <<"CRegion a " << cache.size() << std::endl;
140 
141 }
#define LogDebug(id)
std::vector< TrajectoryMeasurement > measurements(const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
T perp() const
Definition: PV3DBase.h:72
GlobalPoint const & origin() const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
assert(m_qm.get())
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalPoint globalPosition() const
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
GlobalVector const & direction() const
the direction around which region is constructed
tuple result
Definition: query.py:137
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
T eta() const
Definition: PV3DBase.h:76
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
bool isUndef(TrackingRecHit const &hit)
const MeasurementTrackerEvent * theMeasurementTracker_
dbl *** dir
Definition: mlp_gen.cc:35
Definition: DDAxes.h:10
std::string CosmicTrackingRegion::name ( void  ) const
inlinevirtual

Member Data Documentation

cacheHits CosmicTrackingRegion::cache
mutableprivate

Definition at line 126 of file CosmicTrackingRegion.h.

std::string CosmicTrackingRegion::measurementTrackerName_
private

Definition at line 118 of file CosmicTrackingRegion.h.

Referenced by CosmicTrackingRegion().

const MeasurementTrackerEvent* CosmicTrackingRegion::theMeasurementTracker_
private

Definition at line 117 of file CosmicTrackingRegion.h.