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
SeedFromNuclearInteraction Class Reference

#include <SeedFromNuclearInteraction.h>

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 (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. More...
 
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. More...
 
FreeTrajectoryStatestateWithError () const
 
FreeTrajectoryStatestateWithError (TangentHelix &helix) const
 
PTrajectoryStateOnDet 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
 
boost::shared_ptr
< 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_, pTraj, and updatedTSOS_.

13  :
14  ptMin(iConfig.getParameter<double>("ptMin")),
15  thePropagator(prop), theTrackerGeom(geom)
16  {
17  isValid_=true;
18  initialTSOS_ = boost::shared_ptr<TrajectoryStateOnSurface>(new TrajectoryStateOnSurface());
19  updatedTSOS_ = boost::shared_ptr<TrajectoryStateOnSurface>(new TrajectoryStateOnSurface());
20  freeTS_ = boost::shared_ptr<FreeTrajectoryState>(new FreeTrajectoryState());
21  pTraj = boost::shared_ptr<PTrajectoryStateOnDet>(new PTrajectoryStateOnDet());
22  }
const TrackerGeometry * theTrackerGeom
T getParameter(std::string const &) const
boost::shared_ptr< TSOS > updatedTSOS_
boost::shared_ptr< FreeTrajectoryState > freeTS_
boost::shared_ptr< PTrajectoryStateOnDet > pTraj
boost::shared_ptr< TSOS > initialTSOS_
virtual SeedFromNuclearInteraction::~SeedFromNuclearInteraction ( )
inlinevirtual

Definition at line 32 of file SeedFromNuclearInteraction.h.

32 {}

Member Function Documentation

bool SeedFromNuclearInteraction::construct ( )
private

Definition at line 125 of file SeedFromNuclearInteraction.cc.

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

Referenced by setMeasurements().

125  {
126 
127  // loop on all hits in theHits
128  KFUpdator theUpdator;
129 
130  const TrackingRecHit* hit = 0;
131 
132  LogDebug("NuclearSeedGenerator") << "Seed ** initial state " << freeTS_->cartesianError().matrix();
133 
134  for ( unsigned int iHit = 0; iHit < theHits.size(); iHit++) {
135  hit = theHits[iHit]->hit();
136  TrajectoryStateOnSurface state = (iHit==0) ?
139 
140  if (!state.isValid()) return false;
141 
143  updatedTSOS_.reset( new TrajectoryStateOnSurface(theUpdator.update(state, *tth)) );
144 
145  }
146 
147  TrajectoryStateTransform transformer;
148 
149  LogDebug("NuclearSeedGenerator") << "Seed ** updated state " << updatedTSOS_->cartesianError().matrix();
150 
151  pTraj = boost::shared_ptr<PTrajectoryStateOnDet>( transformer.persistentState(*updatedTSOS_, outerHitDetId().rawId()) );
152  return true;
153 }
#define LogDebug(id)
const TrackerGeometry * theTrackerGeom
boost::shared_ptr< TSOS > updatedTSOS_
boost::shared_ptr< FreeTrajectoryState > freeTS_
boost::shared_ptr< PTrajectoryStateOnDet > pTraj
PTrajectoryStateOnDet * persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid) const
virtual const GeomDet * idToDet(DetId) const
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
Definition: Propagator.cc:9
char state
Definition: procUtils.cc:75
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const
Definition: KFUpdator.cc:10
DetId geographicalId() const
PropagationDirection SeedFromNuclearInteraction::direction ( ) const
inline

Definition at line 46 of file SeedFromNuclearInteraction.h.

References alongMomentum.

Referenced by stateWithError(), and TrajSeed().

edm::OwnVector< TrackingRecHit > SeedFromNuclearInteraction::hits ( ) const

Definition at line 156 of file SeedFromNuclearInteraction.cc.

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

Referenced by TrajSeed().

156  {
157  recHitContainer _hits;
158  for( ConstRecHitContainer::const_iterator it = theHits.begin(); it!=theHits.end(); it++ ){
159  _hits.push_back( it->get()->hit()->clone() );
160  }
161  return _hits;
162 }
void push_back(D *&d)
Definition: OwnVector.h:290
edm::OwnVector< TrackingRecHit > recHitContainer
const TSOS& SeedFromNuclearInteraction::initialTSOS ( ) const
inline

Definition at line 56 of file SeedFromNuclearInteraction.h.

References initialTSOS_.

56 { return *initialTSOS_; }
boost::shared_ptr< TSOS > initialTSOS_
bool SeedFromNuclearInteraction::isValid ( void  ) const
inline

Definition at line 52 of file SeedFromNuclearInteraction.h.

References isValid_.

ConstRecHitPointer SeedFromNuclearInteraction::outerHit ( ) const
inline

Definition at line 64 of file SeedFromNuclearInteraction.h.

References outerHit_.

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

Definition at line 62 of file SeedFromNuclearInteraction.h.

References outerHit_.

Referenced by construct(), and outerHitPosition().

62 { return outerHit_->geographicalId(); }
GlobalPoint SeedFromNuclearInteraction::outerHitPosition ( ) const
inline

Definition at line 58 of file SeedFromNuclearInteraction.h.

References TrackerGeometry::idToDet(), outerHit_, outerHitDetId(), GeomDet::surface(), theTrackerGeom, and Surface::toGlobal().

Referenced by stateWithError().

58  {
59  return theTrackerGeom->idToDet(outerHitDetId())->surface().toGlobal(outerHit_->localPosition());
60  }
const TrackerGeometry * theTrackerGeom
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
virtual const GeomDet * idToDet(DetId) const
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
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 164 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().

164  {
165 
167 
168  // z axis coincides with perp
169  GlobalVector zAxis = perp.unit();
170 
171  // x axis has no global Z component
172  GlobalVector xAxis;
173  if ( zAxis.x() != 0 || zAxis.y() != 0) {
174  // precision is not an issue here, just protect against divizion by zero
175  xAxis = GlobalVector( -zAxis.y(), zAxis.x(), 0).unit();
176  }
177  else { // perp coincides with global Z
178  xAxis = GlobalVector( 1, 0, 0);
179  }
180 
181  // y axis obtained by cross product
182  GlobalVector yAxis( zAxis.cross( xAxis));
183 
184  result(0,0) = xAxis.x();
185  result(0,1) = xAxis.y();
186  result(0,2) = xAxis.z();
187  result(1,0) = yAxis.x();
188  result(1,1) = yAxis.y();
189  result(1,2) = yAxis.z();
190  result(2,0) = zAxis.x();
191  result(2,1) = zAxis.y();
192  result(2,2) = zAxis.z();
193  return result;
194 }
T y() const
Definition: PV3DBase.h:57
string unit
Definition: csvLumiCalc.py:46
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:119
T z() const
Definition: PV3DBase.h:58
tuple result
Definition: query.py:137
Vector3DBase unit() const
Definition: Vector3DBase.h:57
T x() const
Definition: PV3DBase.h:56
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33
Global3DVector GlobalVector
Definition: GlobalVector.h:10
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 25 of file SeedFromNuclearInteraction.cc.

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

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

25  {
26 
27  // delete pointer to TrackingRecHits
28  theHits.clear();
29 
30  // get the inner and outer transient TrackingRecHits
31  innerHit_ = ihit;
32  outerHit_ = ohit;
33 
34  //theHits.push_back( inner_TM.recHit() ); // put temporarily - TODO: remove this line
35  theHits.push_back( outerHit_ );
36 
37  initialTSOS_.reset( new TrajectoryStateOnSurface(inner_TSOS) );
38 
39  // calculate the initial FreeTrajectoryState.
40  freeTS_.reset(stateWithError());
41 
42  // check transverse momentum
43  if(freeTS_->momentum().perp() < ptMin) { isValid_ = false; }
44  else {
45  // convert freeTS_ into a persistent TSOS on the outer surface
46  isValid_ = construct(); }
47 }
boost::shared_ptr< FreeTrajectoryState > freeTS_
boost::shared_ptr< TSOS > initialTSOS_
FreeTrajectoryState * stateWithError() const
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 49 of file SeedFromNuclearInteraction.cc.

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

49  {
50 
51  // delete pointer to TrackingRecHits
52  theHits.clear();
53 
54  // get the inner and outer transient TrackingRecHits
55  innerHit_ = ihit;
56  outerHit_ = ohit;
57 
58  GlobalPoint innerPos = theTrackerGeom->idToDet(innerHit_->geographicalId())->surface().toGlobal(innerHit_->localPosition());
59  GlobalPoint outerPos = theTrackerGeom->idToDet(outerHit_->geographicalId())->surface().toGlobal(outerHit_->localPosition());
60 
61  TangentHelix helix(thePrimaryHelix, outerPos, innerPos);
62 
63  theHits.push_back( innerHit_ );
64  theHits.push_back( outerHit_ );
65 
66  initialTSOS_.reset( new TrajectoryStateOnSurface(inner_TSOS) );
67 
68  // calculate the initial FreeTrajectoryState from the inner and outer TM assuming that the helix equation is already known.
69  freeTS_.reset(stateWithError(helix));
70 
71  if(freeTS_->momentum().perp() < ptMin) { isValid_ = false; }
72  else {
73  // convert freeTS_ into a persistent TSOS on the outer surface
74  isValid_ = construct(); }
75 }
const TrackerGeometry * theTrackerGeom
boost::shared_ptr< FreeTrajectoryState > freeTS_
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
virtual const GeomDet * idToDet(DetId) const
boost::shared_ptr< TSOS > initialTSOS_
FreeTrajectoryState * stateWithError() const
FreeTrajectoryState * SeedFromNuclearInteraction::stateWithError ( ) const

Definition at line 77 of file SeedFromNuclearInteraction.cc.

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

Referenced by setMeasurements().

77  {
78 
79  // Calculation of the helix assuming that the secondary track has the same direction
80  // than the primary track and pass through the inner and outer hits.
81  GlobalVector direction = initialTSOS_->globalDirection();
82  GlobalPoint inner = initialTSOS_->globalPosition();
83  TangentHelix helix(direction, inner, outerHitPosition());
84 
85  return stateWithError(helix);
86 }
PropagationDirection direction() const
boost::shared_ptr< TSOS > initialTSOS_
FreeTrajectoryState * stateWithError() const
FreeTrajectoryState * SeedFromNuclearInteraction::stateWithError ( TangentHelix helix) const

Definition at line 88 of file SeedFromNuclearInteraction.cc.

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

88  {
89 
90 // typedef TkRotation<float> Rotation;
91 
92  GlobalVector dirAtVtx = helix.directionAtVertex();
93  const MagneticField& mag = initialTSOS_->globalParameters().magneticField();
94 
95  // Get the global parameters of the trajectory
96  // we assume that the magnetic field at the vertex is equal to the magnetic field at the inner TM.
97  GlobalTrajectoryParameters gtp(helix.vertexPoint(), dirAtVtx , helix.charge(mag.inTesla(helix.vertexPoint()).z())/helix.rho(), 0, &mag);
98 
99  // Error matrix in a frame where z is in the direction of the track at the vertex
100  AlgebraicSymMatrix66 primaryError( initialTSOS_->cartesianError().matrix() );
101  double p_max = initialTSOS_->globalParameters().momentum().mag();
102  AlgebraicMatrix33 rot = this->rotationMatrix( dirAtVtx );
103 
104  AlgebraicMatrix66 globalRotation;
105  globalRotation.Place_at(rot,0,0);
106  globalRotation.Place_at(rot,3,3);
107  AlgebraicSymMatrix66 primaryErrorInNewFrame = ROOT::Math::Similarity(globalRotation, primaryError);
108 
109  AlgebraicSymMatrix66 secondaryErrorInNewFrame = AlgebraicMatrixID();
110  double p_perp_max = 2; // energy max of a secondary track emited perpendicularly to the
111  // primary track is +/- 2 GeV
112  secondaryErrorInNewFrame(0,0) = primaryErrorInNewFrame(0,0)+helix.vertexError()*p_perp_max/p_max;
113  secondaryErrorInNewFrame(1,1) = primaryErrorInNewFrame(1,1)+helix.vertexError()*p_perp_max/p_max;
114  secondaryErrorInNewFrame(2,2) = helix.vertexError() * helix.vertexError();
115  secondaryErrorInNewFrame(3,3) = p_perp_max*p_perp_max;
116  secondaryErrorInNewFrame(4,4) = p_perp_max*p_perp_max;
117  secondaryErrorInNewFrame(5,5) = p_max*p_max;
118 
119  AlgebraicSymMatrix66 secondaryError = ROOT::Math::SimilarityT(globalRotation, secondaryErrorInNewFrame);
120 
121  return new FreeTrajectoryState( gtp, CartesianTrajectoryError(secondaryError) );
122 }
GlobalVector directionAtVertex()
Definition: TangentHelix.cc:18
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepStd< double, 6, 6 > > AlgebraicMatrix66
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
double double double z
double vertexError()
Definition: TangentHelix.h:42
AlgebraicMatrix33 rotationMatrix(const GlobalVector &perp) const
int charge(float magz)
Definition: TangentHelix.h:36
boost::shared_ptr< TSOS > initialTSOS_
GlobalPoint vertexPoint() const
Definition: TangentHelix.h:30
double rho() const
Definition: TangentHelix.h:38
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33
PTrajectoryStateOnDet SeedFromNuclearInteraction::trajectoryState ( ) const
inline

Definition at line 40 of file SeedFromNuclearInteraction.h.

References pTraj.

Referenced by TrajSeed().

40 { return *pTraj; }
boost::shared_ptr< PTrajectoryStateOnDet > pTraj
TrajectorySeed SeedFromNuclearInteraction::TrajSeed ( ) const
inline

Definition at line 50 of file SeedFromNuclearInteraction.h.

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

PropagationDirection direction() const
PTrajectoryStateOnDet trajectoryState() const
const TSOS& SeedFromNuclearInteraction::updatedTSOS ( ) const
inline

Definition at line 54 of file SeedFromNuclearInteraction.h.

References updatedTSOS_.

54 { return *updatedTSOS_; }
boost::shared_ptr< TSOS > updatedTSOS_

Member Data Documentation

boost::shared_ptr<FreeTrajectoryState> SeedFromNuclearInteraction::freeTS_
private
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().

ConstRecHitPointer SeedFromNuclearInteraction::innerHit_
private

Pointer to the hit of the inner TM

Definition at line 76 of file SeedFromNuclearInteraction.h.

Referenced by setMeasurements().

bool SeedFromNuclearInteraction::isValid_
private

check if the seed is valid

Definition at line 71 of file SeedFromNuclearInteraction.h.

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

ConstRecHitPointer SeedFromNuclearInteraction::outerHit_
private

Pointer to the outer hit

Definition at line 77 of file SeedFromNuclearInteraction.h.

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

double SeedFromNuclearInteraction::ptMin
private

Minimum transverse momentum of the seed

Definition at line 90 of file SeedFromNuclearInteraction.h.

Referenced by setMeasurements().

boost::shared_ptr<PTrajectoryStateOnDet> SeedFromNuclearInteraction::pTraj
private

the final persistent TSOS

Definition at line 85 of file SeedFromNuclearInteraction.h.

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

ConstRecHitContainer SeedFromNuclearInteraction::theHits
private

all the hits to be used to update the

Definition at line 73 of file SeedFromNuclearInteraction.h.

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

const Propagator* SeedFromNuclearInteraction::thePropagator
private

Definition at line 92 of file SeedFromNuclearInteraction.h.

Referenced by construct().

const TrackerGeometry* SeedFromNuclearInteraction::theTrackerGeom
private

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