00001
00002
00003
00004
00005
00006
00007 #include "Event/VeloPhiMeasurement.h"
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
00034
00035
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
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
00057
00058
00059
00060
00061 m_errMeasure = 0.8 * ( pitch / sum) * sqrt( sum2 / 12 );
00062
00063
00064 }
00065
00066 m_z = det.zSensor( m_cluster->sensor() );
00067
00068
00069 setLhcbID ( LHCbID( channel ) );
00070 }
00071