Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include "Math/Vector3D.h"
00009 #include "DataFormats/TrackReco/interface/Track.h"
00010 #include "Fireworks/Tracks/interface/estimate_field.h"
00011
00012 double
00013 fw::estimate_field( const reco::Track& track, bool highQuality )
00014 {
00015 if ( !track.extra().isAvailable() ) return -1;
00016
00017
00018
00019
00020
00021 double estimate = -1;
00022 if ( pow(track.outerPosition().x()-track.vx(),2)+pow(track.outerPosition().y()-track.vy(),2) <
00023 pow(track.innerPosition().x()-track.vx(),2)+pow(track.innerPosition().y()-track.vy(),2) )
00024 {
00025 estimate = estimate_field( track.outerPosition().x(),
00026 track.outerPosition().y(),
00027 track.vx(),
00028 track.vy(),
00029 track.px(),
00030 track.py() );
00031 }
00032 else
00033 {
00034 estimate = estimate_field( track.innerPosition().x(),
00035 track.innerPosition().y(),
00036 track.vx(),
00037 track.vy(),
00038 track.px(),
00039 track.py() );
00040 }
00041
00042 if ( highQuality ){
00043 if ( fabs( track.outerMomentum().rho()/track.pt()-1 )<0.1 &&
00044 track.innerPosition().rho()<129 &&
00045 track.outerPosition().rho()<129 ){
00046
00047
00048
00049 return estimate;
00050 } else {
00051 return -1;
00052 }
00053 } else
00054 return estimate;
00055 }
00056
00057 double
00058 fw::estimate_field( double vx1, double vy1, double vx2, double vy2, double px, double py )
00059 {
00060 math::XYZVector displacement(vx2-vx1, vy2-vy1, 0);
00061 math::XYZVector transverseMomentum(px, py, 0);
00062 double cosAlpha = transverseMomentum.Dot(displacement)/transverseMomentum.r()/displacement.r();
00063 return 200*sqrt(1-cosAlpha*cosAlpha)/0.2998*transverseMomentum.r()/displacement.r();
00064 }