00001 #include "DQADtagAlg/util/MyUtil.h" 00002 00003 void fill(NTuple::Array<double>& nt_p4, const HepLorentzVector& p4) { 00004 nt_p4[0] = p4.x(); 00005 nt_p4[1] = p4.y(); 00006 nt_p4[2] = p4.z(); 00007 nt_p4[3] = p4.e(); 00008 } 00009 00010 void fill(NTuple::Matrix<double>& nt_p4, const HepLorentzVector& p4, int i) { 00011 nt_p4[i][0] = p4.x(); 00012 nt_p4[i][1] = p4.y(); 00013 nt_p4[i][2] = p4.z(); 00014 nt_p4[i][3] = p4.e(); 00015 } 00016 HepLorentzVector getP4(RecEmcShower* gtrk) { 00017 double eraw = gtrk->energy(); 00018 double phi = gtrk->phi(); 00019 double the = gtrk->theta(); 00020 00021 double pxy = eraw * sin(the); 00022 00023 HepLorentzVector ptrk( pxy * cos(phi), 00024 pxy * sin(phi), 00025 eraw * cos(the), 00026 eraw ); 00027 00028 return ptrk; 00029 }