Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "GN_Data.h"
00017
00018
00019
00020 #include "CLHEP/Units/PhysicalConstants.h"
00021
00022
00023
00024 #include <vector>
00025
00026
00027
00028 #include <cmath>
00029
00030
00031
00032 using namespace std;
00033
00034
00035
00036 ClassImp( GN_Data )
00037
00038
00039
00040 GN_Data::GN_Data() {}
00041
00042
00043
00044 GN_Data::~GN_Data() {}
00045
00046
00047
00048
00049
00050 void GN_Data::Reset() {
00051
00052 nGN = 0;
00053
00054 id.clear();
00055 q.clear();
00056 tr.clear();
00057
00058 x.clear();
00059 y.clear();
00060 z.clear();
00061
00062 px.clear();
00063 py.clear();
00064 pz.clear();
00065
00066 }
00067
00068
00069
00070 double GN_Data::P( int i ) {
00071 return sqrt( px[i] * px[i] + py[i] * py[i] + pz[i] * pz[i] );
00072 }
00073
00074
00075
00076 double GN_Data::Theta( int i ) {
00077 return acos( pz[i] / P(i) );
00078 }
00079
00080
00081
00082 double GN_Data::Phi( int i ) {
00083 double ph = atan2( py[i], px[i] );
00084 return ( ph > -CLHEP::halfpi ) ? ph : ph + CLHEP::twopi;
00085 }
00086