Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

TrackPtKick Class Reference

#include <TrackTools/TrackPtKick.h>

Inheritance diagram for TrackPtKick:

ITrackPtKick List of all members.

Public Member Functions

 TrackPtKick (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor.
virtual ~TrackPtKick ()
 Destructor.
StatusCode initialize ()
virtual StatusCode calculate (State *State) const

Private Member Functions

void determineFieldPolarity ()

Private Attributes

IBIntegratorm_bIntegrator
int m_FieldPolarity
double m_MomentumError
std::vector< double > m_ParabolicCorrection
 Define the parameters of the Z dependance.
double m_Constant

Detailed Description

Author:
M. Needham
Date:
2000-08-16

Definition at line 19 of file TrackPtKick.h.


Constructor & Destructor Documentation

TrackPtKick::TrackPtKick const std::string &  type,
const std::string &  name,
const IInterface *  parent
 

Standard constructor.

Definition at line 33 of file TrackPtKick.cpp.

References m_Constant, m_MomentumError, and m_ParabolicCorrection.

00036   : GaudiTool ( type, name , parent )
00037   , m_bIntegrator(0)
00038   , m_FieldPolarity(1)
00039 
00040 {
00041   declareInterface<ITrackPtKick>(this);
00042 
00043   declareProperty( "MomentumError",       m_MomentumError = 0.01);
00044   declareProperty( "ParabolicCorrection", m_ParabolicCorrection );
00045   declareProperty( "ConstantCorrection",  m_Constant = 0.*MeV );
00046 
00047   m_ParabolicCorrection.push_back( -0.0092 );
00048   m_ParabolicCorrection.push_back( 0.0 );
00049   m_ParabolicCorrection.push_back( -0.112 );
00050 
00051 }

TrackPtKick::~TrackPtKick  )  [virtual]
 

Destructor.

Definition at line 55 of file TrackPtKick.cpp.

00055 {}; 


Member Function Documentation

StatusCode TrackPtKick::calculate State State  )  const [virtual]
 

Implements ITrackPtKick.

Definition at line 80 of file TrackPtKick.cpp.

References m_bIntegrator, m_Constant, m_FieldPolarity, m_MomentumError, and m_ParabolicCorrection.

00081 {
00082   // calculate intial estimate of track momentum assuming it came from
00083   // the primary vertex
00084 
00085   StatusCode sc = StatusCode::SUCCESS;
00086 
00087   // scan in cm steps  
00088   HepPoint3D  begin( 0., 0., 0. );
00089   HepPoint3D  end( state->x(), state->y(), state->z() );
00090   HepVector3D bdl;
00091   double zCenter;
00092 
00093   m_bIntegrator -> calculateBdlAndCenter( begin, end, state->tx(), 
00094                                           state->ty(), zCenter, bdl );
00095   double q = 0.;
00096   double p = 1e6 * MeV;
00097 
00098   if ( fabs(bdl[0]) > TrackParameters::hiTolerance ) {
00099     //can estimate momentum and charge
00100 
00101     //Rotate to the  0-0-z axis and do the ptkick 
00102     double tX = state -> tx();
00103     double xCenter = state -> x() + tX * ( zCenter - state->z() );
00104 
00105     double zeta_trk = -tX / sqrt( 1.0 + tX*tX );
00106     double tx_vtx   = xCenter / zCenter;
00107     double zeta_vtx = -tx_vtx/ sqrt( 1.0 + tx_vtx*tx_vtx );
00108   
00109     // curvature
00110     double curv = ( zeta_trk - zeta_vtx );
00111 
00112     // charge
00113     int sign = 1;
00114     if(curv< TrackParameters::hiTolerance ) {
00115       sign *= -1;
00116     }
00117     if ( bdl[0] < TrackParameters::hiTolerance ) {
00118       sign *= -1;      
00119     }
00120     q = -1. * m_FieldPolarity*sign;
00121 
00122     // momentum
00123     p = eplus * c_light *fabs(bdl[0]) 
00124         * sqrt((1.0 +tX*tX+pow(state->ty(),2.))
00125                                            /(1.0 +pow(tX,2.)))/fabs(curv);
00126 
00127     //   Addition Correction factor for the angle of the track!
00128     if ( m_ParabolicCorrection.size() == 3 ) {
00129       double tx = (float) state -> tx();
00130       //p*=(1 - (a + b*tx + c*tx*tx ) );
00131       p+= m_Constant;
00132       p*= ( 1 - ( m_ParabolicCorrection[0]
00133                    + m_ParabolicCorrection[1] * fabs(tx)
00134                    + m_ParabolicCorrection[2] * tx * tx ) );
00135     }
00136 
00137   }  
00138   else {
00139     // can't estimate momentum or charge
00140     error() << "B integral is 0!" << endreq;
00141     sc = StatusCode::FAILURE;
00142   }
00143 
00144   // set the state parameters
00145   state -> setQOverP( q / p );
00146   //state -> setEQdivP2(pow(m_MomentumError/p,2.0));
00147   HepSymMatrix& cov = state -> covariance();
00148   double errQOverP = m_MomentumError / p;
00149   cov.fast(5,5) = errQOverP * errQOverP;
00150 
00151   return sc;
00152 }

void TrackPtKick::determineFieldPolarity  )  [private]
 

Definition at line 157 of file TrackPtKick.cpp.

References m_bIntegrator, and m_FieldPolarity.

Referenced by initialize().

00158 {
00159  // determine the field polarity by sending out a test particle
00160  HepPoint3D  begin( 0., 0., 0. );
00161  HepPoint3D  end( 0., 0., 100. );
00162  HepVector3D bdl;
00163  double z;
00164 
00165  m_bIntegrator -> calculateBdlAndCenter( begin, end, 0., 0., z, bdl );
00166  
00167  if ( bdl[0] > 0.0 ) {
00168    m_FieldPolarity =  1;
00169  } 
00170  else {
00171    m_FieldPolarity = -1; 
00172  }
00173 
00174 }

StatusCode TrackPtKick::initialize  ) 
 

Definition at line 60 of file TrackPtKick.cpp.

References determineFieldPolarity(), m_bIntegrator, and m_ParabolicCorrection.

00061 {
00062   StatusCode sc = GaudiTool::initialize();
00063   if (sc.isFailure()) return sc;  // error already reported by base class
00064 
00065   m_bIntegrator = tool<IBIntegrator>( "IBIntegrator" );
00066   
00067   info() << " Pt kick parameters(" << m_ParabolicCorrection.size()
00068          << ") ==" <<m_ParabolicCorrection[0] << " + " 
00069          << m_ParabolicCorrection[1]<<" tx + "
00070          << m_ParabolicCorrection[2] <<" tx^2 " <<endreq;
00071 
00072   determineFieldPolarity();
00073 
00074   return StatusCode::SUCCESS;
00075 }


Member Data Documentation

IBIntegrator* TrackPtKick::m_bIntegrator [private]
 

Definition at line 38 of file TrackPtKick.h.

Referenced by calculate(), determineFieldPolarity(), and initialize().

double TrackPtKick::m_Constant [private]
 

Definition at line 45 of file TrackPtKick.h.

Referenced by calculate(), and TrackPtKick().

int TrackPtKick::m_FieldPolarity [private]
 

Definition at line 40 of file TrackPtKick.h.

Referenced by calculate(), and determineFieldPolarity().

double TrackPtKick::m_MomentumError [private]
 

Definition at line 42 of file TrackPtKick.h.

Referenced by calculate(), and TrackPtKick().

std::vector<double> TrackPtKick::m_ParabolicCorrection [private]
 

Define the parameters of the Z dependance.

Definition at line 44 of file TrackPtKick.h.

Referenced by calculate(), initialize(), and TrackPtKick().


The documentation for this class was generated from the following files:
Generated on Fri May 27 13:59:48 2005 for New Track Event Model by doxygen 1.4.1