CMS 3D CMS Logo

Public Member Functions | Private Attributes

CosmicTrackingRegion Class Reference

#include <CosmicTrackingRegion.h>

Inheritance diagram for CosmicTrackingRegion:
TrackingRegionBase TrackingRegion

List of all members.

Public Member Functions

virtual HitRZCompatibilitycheckRZ (const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup) const
CosmicTrackingRegionclone () const
 clone region
 CosmicTrackingRegion ()
 dummy constructor
 CosmicTrackingRegion (const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, float deltaEta, float deltaPhi, const edm::ParameterSet &extra)
 CosmicTrackingRegion (const GlobalVector &dir, const GlobalPoint &vertexPos, float ptMin, float rVertex, float zVertex, float deltaEta, float deltaPhi, float dummy=0.)
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
std::string name () const
virtual ~CosmicTrackingRegion ()

Private Attributes

std::string measurementTrackerName_

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().

{ }
virtual CosmicTrackingRegion::~CosmicTrackingRegion ( ) [inline, virtual]

Definition at line 33 of file CosmicTrackingRegion.h.

{ }
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.

    : TrackingRegionBase( dir, vertexPos, Range( -1/ptMin, 1/ptMin), 
                          rVertex, zVertex),
    measurementTrackerName_("")
    { }
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_.

      : TrackingRegionBase( dir, vertexPos, Range( -1/ptMin, 1/ptMin),
                            rVertex, zVertex)
      {
        measurementTrackerName_ = extra.getParameter<std::string>("measurementTrackerName");
      }

Member Function Documentation

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

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

Implements TrackingRegionBase.

Definition at line 96 of file CosmicTrackingRegion.h.

                                         {return 0; }
CosmicTrackingRegion* CosmicTrackingRegion::clone ( ) const [inline, virtual]

clone region

Implements TrackingRegionBase.

Definition at line 101 of file CosmicTrackingRegion.h.

References CosmicTrackingRegion().

{     return new CosmicTrackingRegion(*this);  }
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, newFWLiteAna::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(), PV3DBase< T, PVType, FrameType >::phi(), phi, edm::ESHandle< T >::product(), AnalyticalPropagator::propagate(), query::result, makeMuonMisalignmentScenario::rot, funct::sin(), and GeometricSearchDet::surface().

{

  //get and name collections
  //++++++++++++++++++++++++

  //tracking region
  TrackingRegion::Hits result;

  //detector layer
  const DetLayer * detLayer = layer->detLayer();
  LogDebug("CosmicTrackingRegion") << "Looking at hits on subdet/layer " << layer->name();
  EtaPhiMeasurementEstimator est(0.3,0.3);

  //magnetic field
  edm::ESHandle<MagneticField> field;
  es.get<IdealMagneticFieldRecord>().get(field);
  const MagneticField * magField = field.product();

  //region
  const GlobalPoint vtx = origin();
  GlobalVector dir = direction();
  LogDebug("CosmicTrackingRegion") <<"The initial region characteristics are:" << "\n"
                                   <<" Origin    = " << origin() << "\n"
                                   <<" Direction = " << direction() << "\n" 
                                   <<" Eta = " << origin().eta()  << "\n" 
                                   <<" Phi = " << origin().phi();
     
  //trajectory state on surface
  float phi = dir.phi();
  Surface::RotationType rot( sin(phi), -cos(phi),           0,
                             0,                0,          -1,
                             cos(phi),  sin(phi),           0);

  Plane::PlanePointer surface = Plane::build(vtx, rot);
  FreeTrajectoryState fts( GlobalTrajectoryParameters(vtx, dir, 1, magField) );
  TrajectoryStateOnSurface tsos(fts, *surface);
  LogDebug("CosmicTrackingRegion") 
    << "The state used to find measurement with the measurement tracker is:\n" << tsos;

  //propagator
  AnalyticalPropagator prop( magField, alongMomentum);

  //propagation verification (debug)
  //++++++++++++++++++++++++++++++++

  //creation of the state
  TrajectoryStateOnSurface stateOnLayer = prop.propagate( *tsos.freeState(),
                                                          detLayer->surface());
  
  //verification of the state
  if (stateOnLayer.isValid()){
    LogDebug("CosmicTrackingRegion") << "The initial state propagates to the layer surface: \n" << stateOnLayer
                                     << "R   = " << stateOnLayer.globalPosition().perp() << "\n"
                                     << "Eta = " << stateOnLayer.globalPosition().eta() << "\n"
                                     << "Phi = " << stateOnLayer.globalPosition().phi();

  }
  else{
    LogDebug("CosmicTrackingRegion") << "The initial state does not propagate to the layer surface.";
  }

  //number of compatible dets
  typedef DetLayer::DetWithState DetWithState;
  vector<DetWithState> compatDets = detLayer->compatibleDets(tsos, prop, est);
  LogDebug("CosmicTrackingRegion") << "Compatible dets = " << compatDets.size();
  

  //get hits
  //++++++++

  //measurement tracker (find hits)
  edm::ESHandle<MeasurementTracker> measurementTrackerESH;
  es.get<CkfComponentsRecord>().get(measurementTrackerName_,measurementTrackerESH);
  const MeasurementTracker * measurementTracker = measurementTrackerESH.product(); 
  measurementTracker->update(ev);
  LayerMeasurements lm(measurementTracker);
  vector<TrajectoryMeasurement> meas = lm.measurements(*detLayer, tsos, prop, est);
  LogDebug("CosmicTrackingRegion") << "Number of Trajectory measurements = " << meas.size()
                                   <<" but the last one is always an invalid hit, by construction.";

  //trajectory measurement
  typedef vector<TrajectoryMeasurement>::const_iterator IM;

  for (IM im = meas.begin(); im != meas.end(); im++) {//loop on measurement tracker
    TrajectoryMeasurement::ConstRecHitPointer ptrHit = im->recHit();

    if (ptrHit->isValid()) { 
      LogDebug("CosmicTrackingRegion") << "Hit found in the region at position: "<<ptrHit->globalPosition();
      result.push_back(  ptrHit );
    }//end if isValid()

    else LogDebug("CosmicTrackingRegion") << "No valid hit";
  }//end loop on measurement tracker

  
  //result
  //++++++

  return result;
}
std::string CosmicTrackingRegion::name ( void  ) const [inline, virtual]

Reimplemented from TrackingRegion.

Definition at line 103 of file CosmicTrackingRegion.h.

{ return "CosmicTrackingRegion"; }

Member Data Documentation

Definition at line 108 of file CosmicTrackingRegion.h.

Referenced by CosmicTrackingRegion().