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

TrackVeloRProjector.cpp

Go to the documentation of this file.
00001 // Include files 
00002 // -------------
00003 // from Gaudi
00004 #include "GaudiKernel/ToolFactory.h" 
00005 
00006 // local
00007 #include "TrackProjectors/TrackVeloRProjector.h"
00008 #include "Event/VeloRMeasurement.h"
00009 
00010 //-----------------------------------------------------------------------------
00011 // Implementation file for class : TrackVeloRProjector
00012 //
00013 // 2005-04-13 : Jose Hernando, Eduardo Rodrigues
00014 //-----------------------------------------------------------------------------
00015 
00016 // Declaration of the Tool Factory
00017 static const  ToolFactory<TrackVeloRProjector>          s_factory ;
00018 const        IToolFactory& TrackVeloRProjectorFactory = s_factory ; 
00019 
00020 //=============================================================================
00021 //  Project a state onto a measurement.
00022 // It returns the chi squared of the projection
00023 //=============================================================================
00024 StatusCode TrackVeloRProjector::project( const State& state,
00025                                          Measurement& meas )
00026 {
00027   double h = 0;
00028 
00029   double x  = state.x();
00030   double y  = state.y();
00031 
00032   VeloRMeasurement& veloRMeas = *( dynamic_cast<VeloRMeasurement*>(&meas) );
00033 
00034   double phi = veloRMeas.phi();
00035 
00036   unsigned int n = state.nParameters();
00037   m_H = HepVector(n,0);
00038   
00039   // calculate h (predicted R)
00040   if ( phi > 990.0 ) {
00041     h      = sqrt( x*x + y*y );
00042     m_H[0] = x / h;
00043     m_H[1] = y / h;
00044   }
00045   else {
00046     h = x * cos( phi ) + y * sin( phi );
00047     m_H[0] = cos( phi );
00048     m_H[1] = sin( phi );
00049   }
00050   m_H[2] = 0.;
00051   m_H[3] = 0.;
00052 
00053   m_residual = meas.measure() - h;
00054 
00055   computeErrorResidual( state, meas );
00056 
00057   return StatusCode::SUCCESS; 
00058 }
00059 
00060 //=============================================================================
00061 // Initialize
00062 //=============================================================================
00063 StatusCode TrackVeloRProjector::initialize()
00064 {
00065   StatusCode sc = GaudiTool::initialize();
00066   if ( sc.isFailure() )
00067     return Error( "Failed to initialize!", sc );
00068 
00069   m_det = getDet<DeVelo>( m_veloPath );
00070 
00071   return StatusCode::SUCCESS;
00072 }
00073 
00074 //=============================================================================
00075 // Standard constructor, initializes variables
00076 //=============================================================================
00077 TrackVeloRProjector::TrackVeloRProjector( const std::string& type,
00078                                           const std::string& name,
00079                                           const IInterface* parent )
00080   : TrackProjector ( type, name , parent )
00081 {
00082   declareInterface<ITrackProjector>(this);
00083 
00084   declareProperty( "VeloGeometryPath",
00085                    m_veloPath = "/dd/Structure/LHCb/Velo" );
00086 }
00087 //=============================================================================
00088 // Destructor
00089 //=============================================================================
00090 TrackVeloRProjector::~TrackVeloRProjector() {}; 
00091 
00092 //=============================================================================

Generated on Wed May 4 11:52:35 2005 for New Track Event Model by doxygen 1.4.1