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 Attributes
CosmicTrackingRegion Class Reference

#include <CosmicTrackingRegion.h>

Inheritance diagram for CosmicTrackingRegion:
TrackingRegionBase TrackingRegion

Public Member Functions

virtual HitRZCompatibilitycheckRZ (const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup) const
 
CosmicTrackingRegionclone () const
 clone region More...
 
 CosmicTrackingRegion ()
 dummy constructor More...
 
 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
 allowed eta range [eta_min, eta_max] interval More...
 
std::string name () const
 
virtual ~CosmicTrackingRegion ()
 
- Public Member Functions inherited from TrackingRegionBase
virtual GlobalVector direction () const
 the direction around which region is constructed More...
 
virtual Range invPtRange () const
 inverse pt range More...
 
virtual GlobalPoint origin () const
 
virtual float originRBound () const
 bounds the particle vertex in the transverse plane More...
 
virtual float originZBound () const
 bounds the particle vertex in the longitudinal plane More...
 
virtual std::string print () const
 
virtual float ptMin () const
 minimal pt of interest More...
 
virtual TrackingRegionBaserestrictedRegion (const GlobalPoint &originPos, const float &originRBound, const float &originZBound) const
 clone region with new vertex position More...
 
virtual void setDirection (const GlobalVector &dir)
 
 TrackingRegionBase (const GlobalVector &direction, const GlobalPoint &originPos, const Range &invPtRange, const float &originRBound, const float &originZBound)
 
 TrackingRegionBase ()
 
virtual ~TrackingRegionBase ()
 
- Public Member Functions inherited from TrackingRegion
virtual ~TrackingRegion ()
 

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

Constructor & Destructor Documentation

CosmicTrackingRegion::CosmicTrackingRegion ( )
inline

dummy constructor

Definition at line 32 of file CosmicTrackingRegion.h.

Referenced by clone().

32 { }
virtual CosmicTrackingRegion::~CosmicTrackingRegion ( )
inlinevirtual

Definition at line 33 of file CosmicTrackingRegion.h.

33 { }
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 58 of file CosmicTrackingRegion.h.

63  : TrackingRegionBase( dir, vertexPos, Range( -1/ptMin, 1/ptMin),
64  rVertex, zVertex),
66  { }
PixelRecoRange< float > Range
virtual float ptMin() const
minimal pt of interest
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 68 of file CosmicTrackingRegion.h.

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

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

Member Function Documentation

virtual HitRZCompatibility* CosmicTrackingRegion::checkRZ ( const DetLayer layer,
const Hit outerHit,
const edm::EventSetup iSetup 
) const
inlinevirtual

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

Implements TrackingRegionBase.

Definition at line 96 of file CosmicTrackingRegion.h.

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

clone region

Implements TrackingRegionBase.

Definition at line 101 of file CosmicTrackingRegion.h.

References CosmicTrackingRegion().

101 { return new CosmicTrackingRegion(*this); }
CosmicTrackingRegion()
dummy constructor
TrackingRegion::Hits CosmicTrackingRegion::hits ( const edm::Event ev,
const edm::EventSetup es,
const ctfseeding::SeedingLayer layer 
) const
virtual

allowed eta range [eta_min, eta_max] interval

defined phi range around phi0, margin is [phi_left,phi_right]. region is defined in a range: [phi0-phi_left, phi0+phi_right] is precise error calculation switched on

Implements TrackingRegion.

Definition at line 26 of file CosmicTrackingRegion.cc.

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

29 {
30 
31  //get and name collections
32  //++++++++++++++++++++++++
33 
34  //tracking region
36 
37  //detector layer
38  const DetLayer * detLayer = layer->detLayer();
39  LogDebug("CosmicTrackingRegion") << "Looking at hits on subdet/layer " << layer->name();
40  EtaPhiMeasurementEstimator est(0.3,0.3);
41 
42  //magnetic field
44  es.get<IdealMagneticFieldRecord>().get(field);
45  const MagneticField * magField = field.product();
46 
47  //region
48  const GlobalPoint vtx = origin();
50  LogDebug("CosmicTrackingRegion") <<"The initial region characteristics are:" << "\n"
51  <<" Origin = " << origin() << "\n"
52  <<" Direction = " << direction() << "\n"
53  <<" Eta = " << origin().eta() << "\n"
54  <<" Phi = " << origin().phi();
55 
56  //trajectory state on surface
57  float phi = dir.phi();
58  Surface::RotationType rot( sin(phi), -cos(phi), 0,
59  0, 0, -1,
60  cos(phi), sin(phi), 0);
61 
62  Plane::PlanePointer surface = Plane::build(vtx, rot);
63  FreeTrajectoryState fts( GlobalTrajectoryParameters(vtx, dir, 1, magField) );
64  TrajectoryStateOnSurface tsos(fts, *surface);
65  LogDebug("CosmicTrackingRegion")
66  << "The state used to find measurement with the measurement tracker is:\n" << tsos;
67 
68  //propagator
69  AnalyticalPropagator prop( magField, alongMomentum);
70 
71  //propagation verification (debug)
72  //++++++++++++++++++++++++++++++++
73 
74  //creation of the state
75  TrajectoryStateOnSurface stateOnLayer = prop.propagate( *tsos.freeState(),
76  detLayer->surface());
77 
78  //verification of the state
79  if (stateOnLayer.isValid()){
80  LogDebug("CosmicTrackingRegion") << "The initial state propagates to the layer surface: \n" << stateOnLayer
81  << "R = " << stateOnLayer.globalPosition().perp() << "\n"
82  << "Eta = " << stateOnLayer.globalPosition().eta() << "\n"
83  << "Phi = " << stateOnLayer.globalPosition().phi();
84 
85  }
86  else{
87  LogDebug("CosmicTrackingRegion") << "The initial state does not propagate to the layer surface.";
88  }
89 
90  //number of compatible dets
92  vector<DetWithState> compatDets = detLayer->compatibleDets(tsos, prop, est);
93  LogDebug("CosmicTrackingRegion") << "Compatible dets = " << compatDets.size();
94 
95 
96  //get hits
97  //++++++++
98 
99  //measurement tracker (find hits)
100  edm::ESHandle<MeasurementTracker> measurementTrackerESH;
101  es.get<CkfComponentsRecord>().get(measurementTrackerName_,measurementTrackerESH);
102  const MeasurementTracker * measurementTracker = measurementTrackerESH.product();
103  measurementTracker->update(ev);
104  LayerMeasurements lm(measurementTracker);
105  vector<TrajectoryMeasurement> meas = lm.measurements(*detLayer, tsos, prop, est);
106  LogDebug("CosmicTrackingRegion") << "Number of Trajectory measurements = " << meas.size()
107  <<" but the last one is always an invalid hit, by construction.";
108 
109  //trajectory measurement
110  typedef vector<TrajectoryMeasurement>::const_iterator IM;
111 
112  for (IM im = meas.begin(); im != meas.end(); im++) {//loop on measurement tracker
113  TrajectoryMeasurement::ConstRecHitPointer ptrHit = im->recHit();
114 
115  if (ptrHit->isValid()) {
116  LogDebug("CosmicTrackingRegion") << "Hit found in the region at position: "<<ptrHit->globalPosition();
117  result.push_back( ptrHit );
118  }//end if isValid()
119 
120  else LogDebug("CosmicTrackingRegion") << "No valid hit";
121  }//end loop on measurement tracker
122 
123 
124  //result
125  //++++++
126 
127  return result;
128 }
#define LogDebug(id)
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
T perp() const
Definition: PV3DBase.h:71
const DetLayer * detLayer() const
Definition: SeedingLayer.cc:80
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
virtual GlobalPoint origin() const
GlobalPoint globalPosition() const
virtual GlobalVector direction() const
the direction around which region is constructed
static PlanePointer build(const PositionType &pos, const RotationType &rot, MediumProperties *mp=0)
Definition: Plane.h:25
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
tuple result
Definition: query.py:137
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
std::vector< Hit > Hits
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
std::string name() const
Definition: SeedingLayer.cc:75
T eta() const
Definition: PV3DBase.h:75
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
dbl *** dir
Definition: mlp_gen.cc:35
Definition: DDAxes.h:10
std::string CosmicTrackingRegion::name ( void  ) const
inlinevirtual

Reimplemented from TrackingRegion.

Definition at line 103 of file CosmicTrackingRegion.h.

103 { return "CosmicTrackingRegion"; }

Member Data Documentation

std::string CosmicTrackingRegion::measurementTrackerName_
private

Definition at line 108 of file CosmicTrackingRegion.h.

Referenced by CosmicTrackingRegion().