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

VeloPhiMeasurement.cpp

Go to the documentation of this file.
00001 // $Id: VeloPhiMeasurement.cpp,v 1.3 2005/06/15 15:24:10 erodrigu Exp $
00002 // Include files 
00003 
00004 
00005 
00006 // local
00007 #include "Event/VeloPhiMeasurement.h"
00008 
00009 //-----------------------------------------------------------------------------
00010 // Implementation file for class : VeloPhiMeasurement
00011 //
00012 // 2005-04-07 : Jose Hernando, Eduardo Rodrigues
00013 // Author: Rutger van der Eijk
00014 // Created: 13-07-2000
00015 //-----------------------------------------------------------------------------
00016 
00017 //=============================================================================
00018 // Standard constructor, initializes variables
00019 //=============================================================================
00020 VeloPhiMeasurement::VeloPhiMeasurement( VeloCluster& cluster,
00021                                         DeVelo& det )
00022 {
00023   m_mtype = Measurement::VeloPhi;
00024 
00025   m_cluster = &cluster;
00026   
00027   int sensor = m_cluster -> sensor();
00028   double sum   = 0.;
00029   double sum2  = 0.;
00030   double sums  = 0.;
00031   double phi   = -999.;
00032 
00033   // Compute the average phi direction, and the total width in phi unit
00034   // Store also the 'position', which is the signed distance from strip to
00035   // the origin.
00036 
00037   std::vector< std::pair<long,double> > sign = m_cluster->stripSignals();
00038   std::vector< std::pair<long,double> >::const_iterator strIt;
00039   int strip    = (*sign.begin()).first;
00040   VeloChannelID channel(sensor,strip);
00041   double pitch  = det.phiPitch( channel );
00042   for ( strIt = sign.begin() ; sign.end() != strIt ; strIt++ ) {
00043     strip      = (*strIt).first;
00044     m_measure = det.distToOrigin( channel );
00045     // fix sign convention of d0 of strip
00046     if( ! det.isDownstreamSensor(sensor)   ) {
00047       m_measure = -m_measure;
00048     }
00049     phi        =  det.trgPhiDirectionOfStrip( channel );
00050     sum       += (*strIt).second;
00051     sum2      += pow((*strIt).second,2) ;
00052     sums      += (*strIt).second * phi ;
00053   }
00054 
00055   if ( 0 < sum ) {
00056     // double phi = sums / sum;
00057     // m_cosPhi = cos( phi );
00058     // m_sinPhi = sin( phi );
00059     // MM+
00060     // m_errMeasure  = ( pitch / sum) * sqrt( sum2 / 12 );
00061     m_errMeasure  = 0.8 * ( pitch / sum) * sqrt( sum2 / 12 );
00062     // m_errMeasure = 0.254*pitch - 0.0049*mm;
00063     // MM-
00064   }
00065 
00066   m_z = det.zSensor( m_cluster->sensor() );
00067 
00068   // set the LHCbID
00069   setLhcbID ( LHCbID( channel ) );
00070 }
00071 //=============================================================================

Generated on Mon Jul 4 13:54:31 2005 for New Track Event Model by doxygen 1.4.1