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.)
 
 CosmicTrackingRegion (const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, float deltaEta, float deltaPhi, const edm::ParameterSet &extra)
 
 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_
 

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

Member Typedef Documentation

Definition at line 113 of file CosmicTrackingRegion.h.

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

Definition at line 114 of file CosmicTrackingRegion.h.

Constructor & Destructor Documentation

virtual CosmicTrackingRegion::~CosmicTrackingRegion ( )
inlinevirtual

Definition at line 28 of file CosmicTrackingRegion.h.

28 { }
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 54 of file CosmicTrackingRegion.h.

Referenced by clone().

59  : TrackingRegionBase( dir, vertexPos, Range( -1/ptMin, 1/ptMin),
60  rVertex, zVertex),
62  { }
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 64 of file CosmicTrackingRegion.h.

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

69  : TrackingRegionBase( dir, vertexPos, Range( -1/ptMin, 1/ptMin),
70  rVertex, zVertex)
71  {
72  measurementTrackerName_ = extra.getParameter<std::string>("measurementTrackerName");
73  }
T getParameter(std::string const &) const
PixelRecoRange< float > Range
float ptMin() const
minimal pt of interest
TrackingRegion TrackingRegionBase
CosmicTrackingRegion::CosmicTrackingRegion ( CosmicTrackingRegion const &  rh)
inline

Definition at line 75 of file CosmicTrackingRegion.h.

75  :
77  measurementTrackerName_(rh.measurementTrackerName_){}
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 91 of file CosmicTrackingRegion.h.

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

Implements TrackingRegion.

Definition at line 98 of file CosmicTrackingRegion.h.

References CosmicTrackingRegion().

98 { 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::ctfHits CosmicTrackingRegion::hits ( const edm::Event ev,
const edm::EventSetup es,
const ctfseeding::SeedingLayer layer 
) const
virtual

Definition at line 27 of file CosmicTrackingRegion.cc.

References h, query::result, and tmp.

30 {
33  hits_(ev, es, *layer, tmp);
34  result.reserve(tmp.size());
35  for ( auto h : tmp) result.emplace_back(*h); // not owned
36  return result;
37 }
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 39 of file CosmicTrackingRegion.cc.

References query::result.

42 {
44  hits_(ev, es, layer, result);
45  return result;
46 }
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 49 of file CosmicTrackingRegion.cc.

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

53 {
54 
55  //get and name collections
56  //++++++++++++++++++++++++
57 
58 
59  //detector layer
60  const DetLayer * detLayer = layer.detLayer();
61  LogDebug("CosmicTrackingRegion") << "Looking at hits on subdet/layer " << layer.name();
62  EtaPhiMeasurementEstimator est(0.3,0.3);
63 
64  //magnetic field
66  es.get<IdealMagneticFieldRecord>().get(field);
67  const MagneticField * magField = field.product();
68 
69  //region
70  const GlobalPoint vtx = origin();
72  LogDebug("CosmicTrackingRegion") <<"The initial region characteristics are:" << "\n"
73  <<" Origin = " << origin() << "\n"
74  <<" Direction = " << direction() << "\n"
75  <<" Eta = " << origin().eta() << "\n"
76  <<" Phi = " << origin().phi();
77 
78  //trajectory state on surface
79  float phi = dir.phi();
80  Surface::RotationType rot( sin(phi), -cos(phi), 0,
81  0, 0, -1,
82  cos(phi), sin(phi), 0);
83 
84  Plane::PlanePointer surface = Plane::build(vtx, rot);
85  FreeTrajectoryState fts( GlobalTrajectoryParameters(vtx, dir, 1, magField) );
86  TrajectoryStateOnSurface tsos(fts, *surface);
87  LogDebug("CosmicTrackingRegion")
88  << "The state used to find measurement with the measurement tracker is:\n" << tsos;
89 
90  //propagator
91  AnalyticalPropagator prop( magField, alongMomentum);
92 
93  //propagation verification (debug)
94  //++++++++++++++++++++++++++++++++
95 
96  //creation of the state
97  TrajectoryStateOnSurface stateOnLayer = prop.propagate( *tsos.freeState(),
98  detLayer->surface());
99 
100  //verification of the state
101  if (stateOnLayer.isValid()){
102  LogDebug("CosmicTrackingRegion") << "The initial state propagates to the layer surface: \n" << stateOnLayer
103  << "R = " << stateOnLayer.globalPosition().perp() << "\n"
104  << "Eta = " << stateOnLayer.globalPosition().eta() << "\n"
105  << "Phi = " << stateOnLayer.globalPosition().phi();
106 
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 
118  //get hits
119  //++++++++
120 
121  //measurement tracker (find hits)
122  edm::ESHandle<MeasurementTracker> measurementTrackerESH;
123  es.get<CkfComponentsRecord>().get(measurementTrackerName_,measurementTrackerESH);
124  const MeasurementTracker * measurementTracker = measurementTrackerESH.product();
126  ev.getByLabel(edm::InputTag("MeasurementTrackerEvent"), mte);
127  LayerMeasurements lm(*measurementTracker, *mte);
128  vector<TrajectoryMeasurement> meas = lm.measurements(*detLayer, tsos, prop, est);
129  LogDebug("CosmicTrackingRegion") << "Number of Trajectory measurements = " << meas.size()
130  <<" but the last one is always an invalid hit, by construction.";
131 
132  //trajectory measurement
133 
134  // std::cout <<"CRegion b " << cache.size() << std::endl;
135 
136  // waiting for a migration at LayerMeasurements level and at seed builder level
137  for (auto const & im : meas) {
138  if(!im.recHit()->isValid()) continue;
139  assert(!trackerHitRTTI::isUndef(*im.recHit()->hit()));
140  auto ptrHit = (BaseTrackerRecHit *)(im.recHit()->hit()->clone());
141  cache.emplace_back(ptrHit);
142  result.emplace_back(ptrHit);
143  }
144 
145  // std::cout <<"CRegion a " << cache.size() << std::endl;
146 
147 }
#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
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
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
bool isUndef(TrackingRecHit const &hit)
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 119 of file CosmicTrackingRegion.h.

std::string CosmicTrackingRegion::measurementTrackerName_
private

Definition at line 111 of file CosmicTrackingRegion.h.

Referenced by CosmicTrackingRegion().