CMS 3D CMS Logo

Public Member Functions | Private Types | Private Member Functions | Private Attributes

SeedFromNuclearInteraction Class Reference

#include <SeedFromNuclearInteraction.h>

List of all members.

Public Member Functions

PropagationDirection direction () const
recHitContainer hits () const
const TSOSinitialTSOS () const
bool isValid () const
ConstRecHitPointer outerHit () const
DetId outerHitDetId () const
GlobalPoint outerHitPosition () const
AlgebraicMatrix33 rotationMatrix (const GlobalVector &perp) const
 SeedFromNuclearInteraction (const Propagator *prop, const TrackerGeometry *geom, const edm::ParameterSet &iConfig)
void setMeasurements (TangentHelix &primHelix, const TSOS &inner_TSOS, ConstRecHitPointer ihit, ConstRecHitPointer ohit)
 Fill all data members from 1 TSOS and 2 rec Hits and using the circle associated to the primary track as constraint.
void setMeasurements (const TSOS &tsosAtInteractionPoint, ConstRecHitPointer ihit, ConstRecHitPointer ohit)
 Fill all data members from 2 TM's where the first one is supposed to be at the interaction point.
FreeTrajectoryStatestateWithError (TangentHelix &helix) const
FreeTrajectoryStatestateWithError () const
PTrajectoryStateOnDet const & trajectoryState () const
TrajectorySeed TrajSeed () const
const TSOSupdatedTSOS () const
virtual ~SeedFromNuclearInteraction ()

Private Types

typedef std::vector
< ConstRecHitPointer
ConstRecHitContainer
typedef
TransientTrackingRecHit::ConstRecHitPointer 
ConstRecHitPointer
typedef edm::OwnVector
< TrackingRecHit
recHitContainer
typedef TrajectoryMeasurement TM
typedef TrajectoryStateOnSurface TSOS

Private Member Functions

bool construct ()

Private Attributes

boost::shared_ptr
< FreeTrajectoryState
freeTS_
boost::shared_ptr< TSOSinitialTSOS_
ConstRecHitPointer innerHit_
bool isValid_
ConstRecHitPointer outerHit_
double ptMin
PTrajectoryStateOnDet pTraj
ConstRecHitContainer theHits
const PropagatorthePropagator
const TrackerGeometrytheTrackerGeom
boost::shared_ptr< TSOSupdatedTSOS_

Detailed Description

Definition at line 21 of file SeedFromNuclearInteraction.h.


Member Typedef Documentation

Definition at line 27 of file SeedFromNuclearInteraction.h.

Definition at line 26 of file SeedFromNuclearInteraction.h.

Definition at line 25 of file SeedFromNuclearInteraction.h.

Definition at line 23 of file SeedFromNuclearInteraction.h.

Definition at line 24 of file SeedFromNuclearInteraction.h.


Constructor & Destructor Documentation

SeedFromNuclearInteraction::SeedFromNuclearInteraction ( const Propagator prop,
const TrackerGeometry geom,
const edm::ParameterSet iConfig 
)

Definition at line 13 of file SeedFromNuclearInteraction.cc.

References freeTS_, initialTSOS_, isValid_, and updatedTSOS_.

                                                                                                                                         :
    ptMin(iConfig.getParameter<double>("ptMin")),
    thePropagator(prop), theTrackerGeom(geom)
    {
         isValid_=true;
         initialTSOS_ = boost::shared_ptr<TrajectoryStateOnSurface>(new TrajectoryStateOnSurface());
         updatedTSOS_ = boost::shared_ptr<TrajectoryStateOnSurface>(new TrajectoryStateOnSurface());
         freeTS_ = boost::shared_ptr<FreeTrajectoryState>(new FreeTrajectoryState());
    }
virtual SeedFromNuclearInteraction::~SeedFromNuclearInteraction ( ) [inline, virtual]

Definition at line 32 of file SeedFromNuclearInteraction.h.

{}

Member Function Documentation

bool SeedFromNuclearInteraction::construct ( ) [private]

Definition at line 124 of file SeedFromNuclearInteraction.cc.

References freeTS_, TrackingRecHit::geographicalId(), TrackerGeometry::idToDet(), TrajectoryStateOnSurface::isValid(), LogDebug, outerHitDetId(), trajectoryStateTransform::persistentState(), Propagator::propagate(), pTraj, theHits, thePropagator, theTrackerGeom, KFUpdator::update(), and updatedTSOS_.

Referenced by setMeasurements().

                                           {

   // loop on all hits in theHits
   KFUpdator                 theUpdator;

   const TrackingRecHit* hit = 0;

   LogDebug("NuclearSeedGenerator") << "Seed ** initial state " << freeTS_->cartesianError().matrix();

   for ( unsigned int iHit = 0; iHit < theHits.size(); iHit++) {
     hit = theHits[iHit]->hit();
     TrajectoryStateOnSurface state = (iHit==0) ?
        thePropagator->propagate( *freeTS_, theTrackerGeom->idToDet(hit->geographicalId())->surface())
       : thePropagator->propagate( *updatedTSOS_, theTrackerGeom->idToDet(hit->geographicalId())->surface());

     if (!state.isValid()) return false;

     const TransientTrackingRecHit::ConstRecHitPointer& tth = theHits[iHit];
     updatedTSOS_.reset( new TrajectoryStateOnSurface(theUpdator.update(state, *tth)) );

   }

   

   LogDebug("NuclearSeedGenerator") << "Seed ** updated state " << updatedTSOS_->cartesianError().matrix();

   pTraj = trajectoryStateTransform::persistentState(*updatedTSOS_, outerHitDetId().rawId());
   return true;
}
PropagationDirection SeedFromNuclearInteraction::direction ( ) const [inline]

Definition at line 46 of file SeedFromNuclearInteraction.h.

References alongMomentum.

Referenced by stateWithError(), and TrajSeed().

{ return alongMomentum; }
edm::OwnVector< TrackingRecHit > SeedFromNuclearInteraction::hits ( ) const

Definition at line 155 of file SeedFromNuclearInteraction.cc.

References edm::OwnVector< T, P >::push_back(), and theHits.

Referenced by TrajSeed().

                                                                     {
    recHitContainer      _hits;
    for( ConstRecHitContainer::const_iterator it = theHits.begin(); it!=theHits.end(); it++ ){
           _hits.push_back( it->get()->hit()->clone() );
    }
    return _hits;
}
const TSOS& SeedFromNuclearInteraction::initialTSOS ( ) const [inline]

Definition at line 56 of file SeedFromNuclearInteraction.h.

References initialTSOS_.

{ return *initialTSOS_; }
bool SeedFromNuclearInteraction::isValid ( void  ) const [inline]

Definition at line 52 of file SeedFromNuclearInteraction.h.

References isValid_.

{ return isValid_; }
ConstRecHitPointer SeedFromNuclearInteraction::outerHit ( ) const [inline]

Definition at line 64 of file SeedFromNuclearInteraction.h.

References outerHit_.

{ return outerHit_; }
DetId SeedFromNuclearInteraction::outerHitDetId ( ) const [inline]

Definition at line 62 of file SeedFromNuclearInteraction.h.

References outerHit_.

Referenced by construct(), and outerHitPosition().

{ return outerHit_->geographicalId(); }
GlobalPoint SeedFromNuclearInteraction::outerHitPosition ( ) const [inline]
AlgebraicMatrix33 SeedFromNuclearInteraction::rotationMatrix ( const GlobalVector perp) const

Return the rotation matrix to be applied to get parameters in a framework where the z direction is along perp

Definition at line 163 of file SeedFromNuclearInteraction.cc.

References Vector3DBase< T, FrameTag >::cross(), query::result, csvLumiCalc::unit, Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by stateWithError().

                                                                                           {

   AlgebraicMatrix33 result;

   // z axis coincides with perp
   GlobalVector zAxis = perp.unit();

   // x axis has no global Z component
   GlobalVector xAxis;
   if ( zAxis.x() != 0 || zAxis.y() != 0) {
     // precision is not an issue here, just protect against divizion by zero
     xAxis = GlobalVector( -zAxis.y(), zAxis.x(), 0).unit();
   }
   else { // perp coincides with global Z
     xAxis = GlobalVector( 1, 0, 0);
   }

   // y axis obtained by cross product
   GlobalVector yAxis( zAxis.cross( xAxis));

  result(0,0) = xAxis.x();
  result(0,1) = xAxis.y();
  result(0,2) = xAxis.z();
  result(1,0) = yAxis.x();
  result(1,1) = yAxis.y();
  result(1,2) = yAxis.z();
  result(2,0) = zAxis.x();
  result(2,1) = zAxis.y();
  result(2,2) = zAxis.z();
  return result;
}
void SeedFromNuclearInteraction::setMeasurements ( TangentHelix primHelix,
const TSOS inner_TSOS,
ConstRecHitPointer  ihit,
ConstRecHitPointer  ohit 
)

Fill all data members from 1 TSOS and 2 rec Hits and using the circle associated to the primary track as constraint.

Definition at line 48 of file SeedFromNuclearInteraction.cc.

References construct(), freeTS_, TrackerGeometry::idToDet(), initialTSOS_, innerHit_, isValid_, outerHit_, ptMin, stateWithError(), theHits, theTrackerGeom, and GeomDet::toGlobal().

                                                                                                                                                        {

       // delete pointer to TrackingRecHits
       theHits.clear();

       // get the inner and outer transient TrackingRecHits
       innerHit_ = ihit;
       outerHit_ = ohit;

       GlobalPoint innerPos = theTrackerGeom->idToDet(innerHit_->geographicalId())->surface().toGlobal(innerHit_->localPosition());
       GlobalPoint outerPos = theTrackerGeom->idToDet(outerHit_->geographicalId())->surface().toGlobal(outerHit_->localPosition());

       TangentHelix helix(thePrimaryHelix, outerPos, innerPos);

       theHits.push_back( innerHit_ );
       theHits.push_back( outerHit_ );

       initialTSOS_.reset( new TrajectoryStateOnSurface(inner_TSOS) );

       // calculate the initial FreeTrajectoryState from the inner and outer TM assuming that the helix equation is already known.
       freeTS_.reset(stateWithError(helix));

       if(freeTS_->momentum().perp() < ptMin) { isValid_ = false; }
       else {
          // convert freeTS_ into a persistent TSOS on the outer surface
          isValid_ = construct(); }
}
void SeedFromNuclearInteraction::setMeasurements ( const TSOS tsosAtInteractionPoint,
ConstRecHitPointer  ihit,
ConstRecHitPointer  ohit 
)

Fill all data members from 2 TM's where the first one is supposed to be at the interaction point.

Definition at line 24 of file SeedFromNuclearInteraction.cc.

References construct(), freeTS_, initialTSOS_, innerHit_, isValid_, outerHit_, ptMin, stateWithError(), and theHits.

Referenced by NuclearInteractionFinder::fillSeeds(), and NuclearInteractionFinder::improveSeeds().

                                                                                                                         {

       // delete pointer to TrackingRecHits
       theHits.clear();

       // get the inner and outer transient TrackingRecHits
       innerHit_ = ihit;
       outerHit_ = ohit;

       //theHits.push_back(  inner_TM.recHit() ); // put temporarily - TODO: remove this line
       theHits.push_back(  outerHit_  );

       initialTSOS_.reset( new TrajectoryStateOnSurface(inner_TSOS) );

       // calculate the initial FreeTrajectoryState.
       freeTS_.reset(stateWithError());

       // check transverse momentum
       if(freeTS_->momentum().perp() < ptMin) { isValid_ = false; }
       else {
          // convert freeTS_ into a persistent TSOS on the outer surface
          isValid_ = construct(); }
}
FreeTrajectoryState * SeedFromNuclearInteraction::stateWithError ( ) const

Definition at line 76 of file SeedFromNuclearInteraction.cc.

References direction(), initialTSOS_, SurfaceOrientation::inner, and outerHitPosition().

Referenced by setMeasurements().

                                                                      {

   // Calculation of the helix assuming that the secondary track has the same direction
   // than the primary track and pass through the inner and outer hits.
   GlobalVector direction = initialTSOS_->globalDirection();
   GlobalPoint inner = initialTSOS_->globalPosition();
   TangentHelix helix(direction, inner, outerHitPosition());

   return stateWithError(helix);
}
FreeTrajectoryState * SeedFromNuclearInteraction::stateWithError ( TangentHelix helix) const

Definition at line 87 of file SeedFromNuclearInteraction.cc.

References TangentHelix::charge(), TangentHelix::directionAtVertex(), initialTSOS_, MagneticField::inTesla(), mag(), TangentHelix::rho(), makeMuonMisalignmentScenario::rot, rotationMatrix(), TangentHelix::vertexError(), TangentHelix::vertexPoint(), and z.

                                                                                         {

//   typedef TkRotation<float> Rotation;

   GlobalVector dirAtVtx = helix.directionAtVertex();
   const MagneticField& mag = initialTSOS_->globalParameters().magneticField();

   // Get the global parameters of the trajectory
   // we assume that the magnetic field at the vertex is equal to the magnetic field at the inner TM.
   GlobalTrajectoryParameters gtp(helix.vertexPoint(), dirAtVtx , helix.charge(mag.inTesla(helix.vertexPoint()).z())/helix.rho(), 0, &mag);

   // Error matrix in a frame where z is in the direction of the track at the vertex
   AlgebraicSymMatrix66 primaryError( initialTSOS_->cartesianError().matrix() );
   double p_max = initialTSOS_->globalParameters().momentum().mag();
   AlgebraicMatrix33 rot = this->rotationMatrix( dirAtVtx );

   AlgebraicMatrix66 globalRotation;
   globalRotation.Place_at(rot,0,0);
   globalRotation.Place_at(rot,3,3);
   AlgebraicSymMatrix66 primaryErrorInNewFrame = ROOT::Math::Similarity(globalRotation, primaryError);

   AlgebraicSymMatrix66 secondaryErrorInNewFrame = AlgebraicMatrixID();
   double p_perp_max = 2; // energy max of a secondary track emited perpendicularly to the 
                          // primary track is +/- 2 GeV
   secondaryErrorInNewFrame(0,0) = primaryErrorInNewFrame(0,0)+helix.vertexError()*p_perp_max/p_max;
   secondaryErrorInNewFrame(1,1) = primaryErrorInNewFrame(1,1)+helix.vertexError()*p_perp_max/p_max;
   secondaryErrorInNewFrame(2,2) = helix.vertexError() * helix.vertexError();
   secondaryErrorInNewFrame(3,3) = p_perp_max*p_perp_max;  
   secondaryErrorInNewFrame(4,4) = p_perp_max*p_perp_max; 
   secondaryErrorInNewFrame(5,5) = p_max*p_max;

   AlgebraicSymMatrix66 secondaryError = ROOT::Math::SimilarityT(globalRotation, secondaryErrorInNewFrame);

   return new FreeTrajectoryState( gtp, CartesianTrajectoryError(secondaryError) );
}
PTrajectoryStateOnDet const& SeedFromNuclearInteraction::trajectoryState ( ) const [inline]

Definition at line 40 of file SeedFromNuclearInteraction.h.

References pTraj.

Referenced by TrajSeed().

{ return pTraj; }
TrajectorySeed SeedFromNuclearInteraction::TrajSeed ( ) const [inline]

Definition at line 50 of file SeedFromNuclearInteraction.h.

References direction(), hits(), and trajectoryState().

const TSOS& SeedFromNuclearInteraction::updatedTSOS ( ) const [inline]

Definition at line 54 of file SeedFromNuclearInteraction.h.

References updatedTSOS_.

{ return *updatedTSOS_; }

Member Data Documentation

boost::shared_ptr<TSOS> SeedFromNuclearInteraction::initialTSOS_ [private]

Initial TSOS used as input

Definition at line 81 of file SeedFromNuclearInteraction.h.

Referenced by initialTSOS(), SeedFromNuclearInteraction(), setMeasurements(), and stateWithError().

Pointer to the hit of the inner TM

Definition at line 76 of file SeedFromNuclearInteraction.h.

Referenced by setMeasurements().

check if the seed is valid

Definition at line 71 of file SeedFromNuclearInteraction.h.

Referenced by isValid(), SeedFromNuclearInteraction(), and setMeasurements().

Pointer to the outer hit

Definition at line 77 of file SeedFromNuclearInteraction.h.

Referenced by outerHit(), outerHitDetId(), outerHitPosition(), and setMeasurements().

Minimum transverse momentum of the seed

Definition at line 90 of file SeedFromNuclearInteraction.h.

Referenced by setMeasurements().

the final persistent TSOS

Definition at line 85 of file SeedFromNuclearInteraction.h.

Referenced by construct(), and trajectoryState().

all the hits to be used to update the

Definition at line 73 of file SeedFromNuclearInteraction.h.

Referenced by construct(), hits(), and setMeasurements().

Definition at line 92 of file SeedFromNuclearInteraction.h.

Referenced by construct().

Definition at line 93 of file SeedFromNuclearInteraction.h.

Referenced by construct(), outerHitPosition(), and setMeasurements().

boost::shared_ptr<TSOS> SeedFromNuclearInteraction::updatedTSOS_ [private]

Final TSOS

Definition at line 79 of file SeedFromNuclearInteraction.h.

Referenced by construct(), SeedFromNuclearInteraction(), and updatedTSOS().