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 Member Functions | Private Attributes
IdealHelixParameters Class Reference

#include <IdealHelixParameters.h>

Public Member Functions

math::XYZVector GetCircleCenter () const
 
math::XYZVector GetMomentumAtTangentPoint () const
 
float GetRotationAngle () const
 
math::XYZVector GetTangentPoint () const
 
float GetTransverseIPAtTangent () const
 
 IdealHelixParameters ()
 
bool isTangentPointDistanceLessThan (float rmax, const reco::Track *track, const math::XYZVector &refPoint)
 
void setData (const reco::Track *track, const math::XYZVector &refPoint=math::XYZVector(0, 0, 0))
 
void setData (const reco::Track *track, const math::XYZPoint &ref)
 
void setMagnField (const MagneticField *magnField)
 
 ~IdealHelixParameters ()
 

Private Member Functions

void calculate ()
 
void evalCircleCenter ()
 
void evalMomentumatTangentPoint ()
 
void evalTangentPoint ()
 

Private Attributes

math::XYZVector _circleCenter
 
const MagneticField_magnField
 
math::XYZVector _MomentumAtTangentPoint
 
float _radius
 
math::XYZVector _refPoint
 
float _rotationAngle
 
math::XYZVector _tangentPoint
 
const reco::Track_track
 
float _transverseIP
 

Detailed Description

Definition at line 21 of file IdealHelixParameters.h.

Constructor & Destructor Documentation

IdealHelixParameters::IdealHelixParameters ( )
inline

Definition at line 25 of file IdealHelixParameters.h.

25  :
26  _magnField(0),_track(0),
27  _refPoint (math::XYZVector(0,0,0)),
const reco::Track * _track
math::XYZVector _MomentumAtTangentPoint
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
const MagneticField * _magnField
math::XYZVector _tangentPoint
IdealHelixParameters::~IdealHelixParameters ( )
inline

Definition at line 30 of file IdealHelixParameters.h.

30 {};

Member Function Documentation

void IdealHelixParameters::calculate ( )
private

Definition at line 25 of file IdealHelixParameters.cc.

References _refPoint, _track, evalCircleCenter(), evalMomentumatTangentPoint(), evalTangentPoint(), reco::Track::innerDetId(), reco::Track::innerMomentum(), reco::Track::innerPosition(), and LogDebug.

Referenced by setData().

25  {
26 
27  LogDebug("IdealHelixParameters")
28  << "[IdealHelixParameters] "
29  << "\n\t "<< "refPoint \t" <<_refPoint
30  << "\n\t "<< "innerDetid \t" << _track->innerDetId()
31  << "\n\t "<< "innerMomentum \t" << _track->innerMomentum()
32  << "\n\t "<< "innerPosition \t" << _track->innerPosition();
33 
35 
37 
39 
40 
41  /* DEBUG
42  math::XYZVector _checkMomentumAtTangentoPoint (
43  cos_angle*innerMomentum.x()+sin_angle*innerMomentum.y(),
44  -1*sin_angle*innerMomentum.x()+cos_angle*innerMomentum.y(),
45  innerMomentum.z()
46  );
47  math::XYZVector cp_xy(_checkMomentumAtTangentoPoint.x(),_checkMomentumAtTangentoPoint.y(),0);
48  float _checktransverseIP = (r_xy.Cross(cp_xy)).z()/cp_xy.rho();
49 
50  ss
51  << "\n\t "<< "_checkMomentumAtTangentoPoint \t" <<_checkMomentumAtTangentoPoint
52  << "\n\t "<< "_checktransverseIP \t" <<_checktransverseIP;
53  */
54 
55 }
#define LogDebug(id)
const reco::Track * _track
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:42
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:45
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
Definition: Track.h:61
void IdealHelixParameters::evalCircleCenter ( )
private

Definition at line 58 of file IdealHelixParameters.cc.

References _circleCenter, _magnField, _radius, _track, reco::TrackBase::charge(), funct::cos(), reco::Track::innerMomentum(), reco::Track::innerPosition(), LogDebug, phi, and funct::sin().

Referenced by calculate().

58  {
61 
62  GlobalTrajectoryParameters globalTrajParam(
63  innerPos,
64  innerMom,
65  _track->charge(),
67  );
68 
69  _radius = 1./fabs(globalTrajParam.transverseCurvature());
70  float phi = innerMom.phi();
71 
72  //eval Center of the Circumference passing in track->innserPosition
73  float Xc = innerPos.x() + _track->charge()* _radius * sin(phi);
74  float Yc = innerPos.y() - _track->charge()* _radius * cos(phi);
75 
76 
77  _circleCenter.SetXYZ(Xc,Yc,innerPos.z()); //NB Z component is useless
78 
79  LogDebug("IdealHelixParameters")
80  << "\n\t "<< "circle center \t" <<_circleCenter
81  << "\n\t "<< "radius " <<_radius;
82 
83 }
#define LogDebug(id)
const reco::Track * _track
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:42
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
math::XYZVector _circleCenter
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:45
const MagneticField * _magnField
int charge() const
track electric charge
Definition: TrackBase.h:111
Definition: DDAxes.h:10
void IdealHelixParameters::evalMomentumatTangentPoint ( )
private

Definition at line 87 of file IdealHelixParameters.cc.

References _circleCenter, _MomentumAtTangentPoint, _rotationAngle, _tangentPoint, _track, _transverseIP, reco::Track::innerMomentum(), reco::Track::innerPosition(), and LogDebug.

Referenced by calculate().

87  {
88 
89  if(_tangentPoint.r()==0){
91  return;
92  }
93 
94  math::XYZVector innerPosition(_track->innerPosition().X(),_track->innerPosition().Y(),_track->innerPosition().Z());
95  math::XYZVector innerMomentum(_track->innerMomentum());
96 
97 
98  math::XYZVector pCi=innerPosition-_circleCenter;
100 
101  math::XYZVector pCi_xy(pCi.x(),pCi.y(),0);
102  math::XYZVector pCT_xy(pCT.x(),pCT.y(),0);
103 
104  float cos_angle = pCi_xy.Dot(pCT_xy)/pCi_xy.rho()/pCT_xy.rho();
105  float sin_angle = pCi_xy.Cross(pCT_xy).z()/pCi_xy.rho()/pCT_xy.rho();
106 
107 
109  cos_angle*innerMomentum.x()-sin_angle*innerMomentum.y(),
110  sin_angle*innerMomentum.x()+cos_angle*innerMomentum.y(),
111  innerMomentum.z()
112  );
113 
116 
117  _transverseIP = (r_.x()*p_.y()-r_.y()*p_.x())/p_.rho()/r_.rho();
118  _rotationAngle=atan(sin_angle/cos_angle);
119 
120 
121 
122  LogDebug("IdealHelixParameters") << "\n\t "<< "_MomentumAtTangentPoint \t" <<_MomentumAtTangentPoint
123  << "\n\t "<< "sin_angle \t" <<sin_angle << " angle \t" <<asin(sin_angle)
124  << "\n\t "<< "cos_angle \t" <<cos_angle << " angle \t" <<acos(cos_angle)
125  << "\n\t "<< "_rotationAngle \t" <<_rotationAngle
126  << "\n\t "<< "_transverseIP \t" <<_transverseIP
127  << "\n\t "<< " check similitude pz/pt "<< _track->innerMomentum().z()/_track->innerMomentum().rho() << " pZ/pRho " << innerPosition.z()/innerPosition.rho();
128 }
#define LogDebug(id)
const reco::Track * _track
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:42
math::XYZVector _MomentumAtTangentPoint
math::XYZVector _circleCenter
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:45
math::XYZVector _tangentPoint
void IdealHelixParameters::evalTangentPoint ( )
private

Definition at line 132 of file IdealHelixParameters.cc.

References _circleCenter, _radius, _refPoint, _tangentPoint, _track, reco::Track::innerMomentum(), reco::Track::innerPosition(), ConfigFiles::l, LogDebug, rho, and mathSSE::sqrt().

Referenced by calculate().

132  {
133 
134  math::XYZVector innerPosition(_track->innerPosition().X(),_track->innerPosition().Y(),_track->innerPosition().Z());
135 
137  float l = vL.rho();
138 
139  if(l<_radius){
140  //refpoint is inside the circle
141  _tangentPoint.SetXYZ(0.,0.,0.);
142  return;
143  }
144 
145  float sin_alpha = _radius/l;
146 
147  //there are two possible tangents, with Point of tangence T1 and T2, and same distance T from _refPoint
148  float T=sqrt(l*l-_radius*_radius);
149 
150  math::XYZVector vLperp(-vL.y(),vL.x(),0); //NB: z component not correct
151  math::XYZVector tmpT1 = (1-sin_alpha*sin_alpha)*vL + T/l*sin_alpha*vLperp;
152  math::XYZVector tmpT2 = (1-sin_alpha*sin_alpha)*vL - T/l*sin_alpha*vLperp;
153 
154  if( (tmpT1-innerPosition).rho()<(tmpT2-innerPosition).rho())
155  _tangentPoint=tmpT1+_refPoint;
156  else
157  _tangentPoint=tmpT2+_refPoint;
158 
159  //Fix the Z component
160  _tangentPoint.SetZ( (_tangentPoint.rho()-_refPoint.rho()) * (_track->innerMomentum().z()/_track->innerMomentum().rho()) + _refPoint.z() );
161 
162  LogDebug("IdealHelixParameters")<< "\n\t "<< "tangent Point \t" <<_tangentPoint;
163 }
#define LogDebug(id)
const reco::Track * _track
Definition: DDAxes.h:10
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:42
T sqrt(T t)
Definition: SSEVec.h:48
math::XYZVector _circleCenter
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:45
long double T
math::XYZVector _tangentPoint
math::XYZVector IdealHelixParameters::GetCircleCenter ( ) const
inline

Definition at line 38 of file IdealHelixParameters.h.

References _circleCenter.

38 {return _circleCenter;}
math::XYZVector _circleCenter
math::XYZVector IdealHelixParameters::GetMomentumAtTangentPoint ( ) const
inline
float IdealHelixParameters::GetRotationAngle ( ) const
inline

Definition at line 42 of file IdealHelixParameters.h.

References _rotationAngle.

math::XYZVector IdealHelixParameters::GetTangentPoint ( ) const
inline
float IdealHelixParameters::GetTransverseIPAtTangent ( ) const
inline

Definition at line 41 of file IdealHelixParameters.h.

References _transverseIP.

bool IdealHelixParameters::isTangentPointDistanceLessThan ( float  rmax,
const reco::Track track,
const math::XYZVector refPoint 
)

Definition at line 166 of file IdealHelixParameters.cc.

References GetTangentPoint(), alignCSCRings::r, rho, and setData().

Referenced by ConversionTrackProducer::produce().

166  {
167 
168  setData(track,refPoint);
169  if(GetTangentPoint().r()==0){
170  //this case means a null results on the IdealHelixParameters side
171  return true;
172  }
173 
174  if(GetTangentPoint().rho()<rMax){
175  //this case means a track that has the tangent point nearby the primary vertex
176  // if the track is primary, this number tends to be the primary vertex itself
177  //Rejecting all the potential photon conversions having a "vertex" inside the beampipe
178  //We should not miss too much, seen that the conversions at the beam pipe are the better reconstructed
179  return true;
180  }
181 
182  return false;
183 }
void setData(const reco::Track *track, const math::XYZVector &refPoint=math::XYZVector(0, 0, 0))
Definition: DDAxes.h:10
math::XYZVector GetTangentPoint() const
void IdealHelixParameters::setData ( const reco::Track track,
const math::XYZVector refPoint = math::XYZVector(0,0,0) 
)

Definition at line 9 of file IdealHelixParameters.cc.

References _refPoint, _track, calculate(), and alignCSCRings::r.

Referenced by PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::inspectTrack(), isTangentPointDistanceLessThan(), PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::rejectTrack(), and setData().

9  {
10 
11  if(track!=0 && _track!=track){
12  _track=track;
13  _refPoint=refPoint;
14  calculate();
15  }
16 
17  if((refPoint-_refPoint).r()!=0){
18  _refPoint=refPoint;
19  calculate();
20  }
21 }
const reco::Track * _track
void IdealHelixParameters::setData ( const reco::Track track,
const math::XYZPoint ref 
)

Definition at line 4 of file IdealHelixParameters.cc.

References setData().

4  {
5  setData(track,math::XYZVector(ref.x(),ref.y(),ref.z()));
6 }
void setData(const reco::Track *track, const math::XYZVector &refPoint=math::XYZVector(0, 0, 0))
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
void IdealHelixParameters::setMagnField ( const MagneticField magnField)
inline

Member Data Documentation

math::XYZVector IdealHelixParameters::_circleCenter
private
const MagneticField* IdealHelixParameters::_magnField
private

Definition at line 51 of file IdealHelixParameters.h.

Referenced by evalCircleCenter(), and setMagnField().

math::XYZVector IdealHelixParameters::_MomentumAtTangentPoint
private

Definition at line 57 of file IdealHelixParameters.h.

Referenced by evalMomentumatTangentPoint(), and GetMomentumAtTangentPoint().

float IdealHelixParameters::_radius
private

Definition at line 53 of file IdealHelixParameters.h.

Referenced by evalCircleCenter(), and evalTangentPoint().

math::XYZVector IdealHelixParameters::_refPoint
private

Definition at line 55 of file IdealHelixParameters.h.

Referenced by calculate(), evalTangentPoint(), and setData().

float IdealHelixParameters::_rotationAngle
private

Definition at line 59 of file IdealHelixParameters.h.

Referenced by evalMomentumatTangentPoint(), and GetRotationAngle().

math::XYZVector IdealHelixParameters::_tangentPoint
private
const reco::Track* IdealHelixParameters::_track
private
float IdealHelixParameters::_transverseIP
private

Definition at line 58 of file IdealHelixParameters.h.

Referenced by evalMomentumatTangentPoint(), and GetTransverseIPAtTangent().