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.1.1.1 2005/04/07 20:24:28 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_cluster = &cluster;
00024   
00025   int sensor = m_cluster -> sensor();
00026   double sum   = 0.;
00027   double sum2  = 0.;
00028   double sums  = 0.;
00029   double phi   = -999.;
00030 
00031   // Compute the average phi direction, and the total width in phi unit
00032   // Store also the 'position', which is the signed distance from strip to
00033   // the origin.
00034 
00035   std::vector< std::pair<long,double> > sign = m_cluster->stripSignals();
00036   std::vector< std::pair<long,double> >::const_iterator strIt;
00037   int strip    = (*sign.begin()).first;
00038   VeloChannelID channel(sensor,strip);
00039   double pitch  = det.phiPitch( channel );
00040   for ( strIt = sign.begin() ; sign.end() != strIt ; strIt++ ) {
00041     strip      = (*strIt).first;
00042     m_measure = det.distToOrigin( channel );
00043     // fix sign convention of d0 of strip
00044     if( ! det.isDownstreamSensor(sensor)   ) {
00045       m_measure = -m_measure;
00046     }
00047     phi        =  det.trgPhiDirectionOfStrip( channel );
00048     sum       += (*strIt).second;
00049     sum2      += pow((*strIt).second,2) ;
00050     sums      += (*strIt).second * phi ;
00051   }
00052 
00053   if ( 0 < sum ) {
00054     // double phi = sums / sum;
00055     // m_cosPhi = cos( phi );
00056     // m_sinPhi = sin( phi );
00057     // MM+
00058     // m_errMeasure  = ( pitch / sum) * sqrt( sum2 / 12 );
00059     m_errMeasure  = 0.8 * ( pitch / sum) * sqrt( sum2 / 12 );
00060     // m_errMeasure = 0.254*pitch - 0.0049*mm;
00061     // MM-
00062   }
00063 
00064   m_z = det.zSensor( m_cluster->sensor() );
00065 
00066 }
00067 //=============================================================================

Generated on Thu Apr 7 22:43:27 2005 for New Track Event Model by doxygen 1.4.1