00001
00002
00003
00004 #include "GaudiKernel/ToolFactory.h"
00005
00006
00007 #include "TrackITProjector.h"
00008
00009 #include "STDet/STDetectionLayer.h"
00010
00011
00012
00013
00014
00015
00016
00017
00018 static const ToolFactory<TrackITProjector> s_factory ;
00019 const IToolFactory& TrackITProjectorFactory = s_factory ;
00020
00021
00022
00023
00024
00025 StatusCode TrackITProjector::project( const State& state,
00026 Measurement& meas )
00027 {
00028
00029 debug()
00030 << " Project state:"<< endreq
00031 << " - position = " << state.position() << " mm" << endreq
00032 << " - momentum = " << state.momentum() << " MeV" << endreq
00033 << " - P = " << state.p() << " MeV" << endreq
00034 << " and measurement:"<< endreq
00035 << " - z = " << meas.z() << " mm" << endreq
00036 << " - measure = " << meas.measure() << endreq
00037 << " - type = " << meas.type() << endreq
00038 << " - LHCbID = " << meas.lhcbID() << endreq
00039 << " - ch. ID = " << meas.lhcbID().stID().channelID() << endreq;
00040
00041 ITChannelID ITChan = meas.lhcbID().stID();
00042 debug() << " - ITChan = " << ITChan << endreq
00043 << " station = " << ITChan.station() << endreq
00044 << " layer = " << ITChan.layer() << endreq
00045 << " wafer = " << ITChan.wafer() << endreq
00046 << " strip = " << ITChan.strip() << endreq;
00047
00048 const STDetectionLayer* ITLay = m_det -> layer( ITChan );
00049
00050 double stereoAngle = ITLay->stereoAngle();
00051
00052 debug() << "stereoAngle = " << stereoAngle << endreq;
00053
00054 unsigned int n = state.nParameters();
00055 m_H = HepVector(n,0);
00056 m_H[0] = cos( stereoAngle );
00057 m_H[1] = sin( stereoAngle );
00058
00059 debug() << "H = " << m_H << endreq;
00060
00061
00062 m_residual = meas.measure()
00063 - state.x() * cos( stereoAngle )
00064 - state.y() * sin( stereoAngle );
00065
00066 debug() << "residual = " << m_residual << endreq;
00067
00068 computeErrorResidual( state, meas );
00069
00070 debug() << "error residual = " << m_errResidual << endreq;
00071
00072 return StatusCode::SUCCESS;
00073
00074 }
00075
00076
00077
00078
00079 StatusCode TrackITProjector::initialize()
00080 {
00081 StatusCode sc = GaudiTool::initialize();
00082 if ( sc.isFailure() )
00083 return Error( "Failed to initialize!", sc );
00084
00085 m_det = getDet<DeSTDetector>( m_itTrackerPath );
00086
00087 return StatusCode::SUCCESS;
00088 }
00089
00090
00091
00092
00093 TrackITProjector::TrackITProjector( const std::string& type,
00094 const std::string& name,
00095 const IInterface* parent )
00096 : TrackProjector ( type, name , parent )
00097 {
00098 declareInterface<ITrackProjector>(this);
00099
00100 declareProperty( "ITGeometryPath",
00101 m_itTrackerPath = DeSTDetectorLocation::Default );
00102 }
00103
00104
00105
00106
00107 TrackITProjector::~TrackITProjector() {};
00108
00109