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 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.)
 
 CosmicTrackingRegion (const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, float deltaEta, float deltaPhi, const edm::ParameterSet &extra)
 
virtual TrackingRegion::Hits hits (const edm::Event &ev, const edm::EventSetup &es, const ctfseeding::SeedingLayer *layer) const
 get hits from layer compatible with region constraints More...
 
TrackingRegion::Hits hits (const edm::Event &ev, const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const override
 
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 Member Functions

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

Private Attributes

std::string measurementTrackerName_
 

Additional Inherited Members

- Public Types inherited from TrackingRegion
typedef
TransientTrackingRecHit::ConstRecHitPointer 
Hit
 
typedef std::vector< HitHits
 
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 21 of file CosmicTrackingRegion.h.

Constructor & Destructor Documentation

virtual CosmicTrackingRegion::~CosmicTrackingRegion ( )
inlinevirtual

Definition at line 25 of file CosmicTrackingRegion.h.

25 { }
CosmicTrackingRegion::CosmicTrackingRegion ( const GlobalVector dir,
const GlobalPoint vertexPos,
float  ptMin,
float  rVertex,
float  zVertex,
float  deltaEta,
float  deltaPhi,
float  dummy = 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 51 of file CosmicTrackingRegion.h.

Referenced by clone().

56  : TrackingRegionBase( dir, vertexPos, Range( -1/ptMin, 1/ptMin),
57  rVertex, zVertex),
59  { }
PixelRecoRange< float > Range
float ptMin() const
minimal pt of interest
TrackingRegion TrackingRegionBase
CosmicTrackingRegion::CosmicTrackingRegion ( const GlobalVector dir,
const GlobalPoint vertexPos,
float  ptMin,
float  rVertex,
float  zVertex,
float  deltaEta,
float  deltaPhi,
const edm::ParameterSet extra 
)
inline

Definition at line 61 of file CosmicTrackingRegion.h.

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

66  : TrackingRegionBase( dir, vertexPos, Range( -1/ptMin, 1/ptMin),
67  rVertex, zVertex)
68  {
69  measurementTrackerName_ = extra.getParameter<std::string>("measurementTrackerName");
70  }
T getParameter(std::string const &) const
PixelRecoRange< float > Range
float ptMin() const
minimal pt of interest
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 84 of file CosmicTrackingRegion.h.

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

Implements TrackingRegion.

Definition at line 91 of file CosmicTrackingRegion.h.

References CosmicTrackingRegion().

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

get hits from layer compatible with region constraints

Implements TrackingRegion.

Definition at line 27 of file CosmicTrackingRegion.cc.

30 {
31  return hits_(ev, es, *layer);
32 }
TrackingRegion::Hits hits_(const edm::Event &ev, const edm::EventSetup &es, const T &layer) const
TrackingRegion::Hits CosmicTrackingRegion::hits ( const edm::Event ev,
const edm::EventSetup es,
const SeedingLayerSetsHits::SeedingLayer layer 
) const
overridevirtual

Implements TrackingRegion.

Definition at line 34 of file CosmicTrackingRegion.cc.

37 {
38  return hits_(ev, es, layer);
39 }
TrackingRegion::Hits hits_(const edm::Event &ev, const edm::EventSetup &es, const T &layer) const
template<typename T >
TrackingRegion::Hits CosmicTrackingRegion::hits_ ( const edm::Event ev,
const edm::EventSetup es,
const T layer 
) const
private

Definition at line 42 of file CosmicTrackingRegion.cc.

References alongMomentum, AnalyticalPropagator_cfi::AnalyticalPropagator, Plane::build(), GeometricSearchDet::compatibleDets(), funct::cos(), dir, PV3DBase< T, PVType, FrameType >::eta(), statics::field, TrajectoryStateOnSurface::freeState(), edm::EventSetup::get(), edm::Event::getByLabel(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), LogDebug, LayerMeasurements::measurements(), MeasurementTrackerESProducer_cfi::MeasurementTracker, PV3DBase< T, PVType, FrameType >::perp(), phi, PV3DBase< T, PVType, FrameType >::phi(), edm::ESHandle< class >::product(), query::result, makeMuonMisalignmentScenario::rot, funct::sin(), and GeometricSearchDet::surface().

45 {
46 
47  //get and name collections
48  //++++++++++++++++++++++++
49 
50  //tracking region
52 
53  //detector layer
54  const DetLayer * detLayer = layer.detLayer();
55  LogDebug("CosmicTrackingRegion") << "Looking at hits on subdet/layer " << layer.name();
56  EtaPhiMeasurementEstimator est(0.3,0.3);
57 
58  //magnetic field
60  es.get<IdealMagneticFieldRecord>().get(field);
61  const MagneticField * magField = field.product();
62 
63  //region
64  const GlobalPoint vtx = origin();
66  LogDebug("CosmicTrackingRegion") <<"The initial region characteristics are:" << "\n"
67  <<" Origin = " << origin() << "\n"
68  <<" Direction = " << direction() << "\n"
69  <<" Eta = " << origin().eta() << "\n"
70  <<" Phi = " << origin().phi();
71 
72  //trajectory state on surface
73  float phi = dir.phi();
74  Surface::RotationType rot( sin(phi), -cos(phi), 0,
75  0, 0, -1,
76  cos(phi), sin(phi), 0);
77 
78  Plane::PlanePointer surface = Plane::build(vtx, rot);
79  FreeTrajectoryState fts( GlobalTrajectoryParameters(vtx, dir, 1, magField) );
80  TrajectoryStateOnSurface tsos(fts, *surface);
81  LogDebug("CosmicTrackingRegion")
82  << "The state used to find measurement with the measurement tracker is:\n" << tsos;
83 
84  //propagator
85  AnalyticalPropagator prop( magField, alongMomentum);
86 
87  //propagation verification (debug)
88  //++++++++++++++++++++++++++++++++
89 
90  //creation of the state
91  TrajectoryStateOnSurface stateOnLayer = prop.propagate( *tsos.freeState(),
92  detLayer->surface());
93 
94  //verification of the state
95  if (stateOnLayer.isValid()){
96  LogDebug("CosmicTrackingRegion") << "The initial state propagates to the layer surface: \n" << stateOnLayer
97  << "R = " << stateOnLayer.globalPosition().perp() << "\n"
98  << "Eta = " << stateOnLayer.globalPosition().eta() << "\n"
99  << "Phi = " << stateOnLayer.globalPosition().phi();
100 
101  }
102  else{
103  LogDebug("CosmicTrackingRegion") << "The initial state does not propagate to the layer surface.";
104  }
105 
106  //number of compatible dets
108  vector<DetWithState> compatDets = detLayer->compatibleDets(tsos, prop, est);
109  LogDebug("CosmicTrackingRegion") << "Compatible dets = " << compatDets.size();
110 
111 
112  //get hits
113  //++++++++
114 
115  //measurement tracker (find hits)
116  edm::ESHandle<MeasurementTracker> measurementTrackerESH;
117  es.get<CkfComponentsRecord>().get(measurementTrackerName_,measurementTrackerESH);
118  const MeasurementTracker * measurementTracker = measurementTrackerESH.product();
120  ev.getByLabel(edm::InputTag("MeasurementTrackerEvent"), mte);
121  LayerMeasurements lm(*measurementTracker, *mte);
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  typedef vector<TrajectoryMeasurement>::const_iterator IM;
128 
129  for (IM im = meas.begin(); im != meas.end(); im++) {//loop on measurement tracker
130  TrajectoryMeasurement::ConstRecHitPointer ptrHit = im->recHit();
131 
132  if (ptrHit->isValid()) {
133  LogDebug("CosmicTrackingRegion") << "Hit found in the region at position: "<<ptrHit->globalPosition();
134  result.push_back( ptrHit );
135  }//end if isValid()
136 
137  else LogDebug("CosmicTrackingRegion") << "No valid hit";
138  }//end loop on measurement tracker
139 
140 
141  //result
142  //++++++
143 
144  return result;
145 }
#define LogDebug(id)
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
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
tuple field
Definition: statics.py:62
GlobalVector const & direction() const
the direction around which region is constructed
static PlanePointer build(Args &&...args)
Definition: Plane.h:36
tuple result
Definition: query.py:137
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
std::vector< Hit > Hits
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
T eta() const
Definition: PV3DBase.h:76
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
dbl *** dir
Definition: mlp_gen.cc:35
Definition: DDAxes.h:10
std::string CosmicTrackingRegion::name ( void  ) const
inlinevirtual

Member Data Documentation

std::string CosmicTrackingRegion::measurementTrackerName_
private

Definition at line 102 of file CosmicTrackingRegion.h.

Referenced by CosmicTrackingRegion().