BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MyUtil.cxx
Go to the documentation of this file.
1#include "MyUtil.h"
2
3void fill( NTuple::Array<double>& nt_p4, const HepLorentzVector& p4 ) {
4 nt_p4[0] = p4.x();
5 nt_p4[1] = p4.y();
6 nt_p4[2] = p4.z();
7 nt_p4[3] = p4.e();
8}
9
10void fill( NTuple::Matrix<double>& nt_p4, const HepLorentzVector& p4, int i ) {
11 nt_p4[i][0] = p4.x();
12 nt_p4[i][1] = p4.y();
13 nt_p4[i][2] = p4.z();
14 nt_p4[i][3] = p4.e();
15}
16HepLorentzVector getP4( RecEmcShower* gtrk ) {
17 double eraw = gtrk->energy();
18 double phi = gtrk->phi();
19 double the = gtrk->theta();
20
21 double pxy = eraw * sin( the );
22
23 HepLorentzVector ptrk( pxy * cos( phi ), pxy * sin( phi ), eraw * cos( the ), eraw );
24
25 return ptrk;
26}
HepLorentzVector getP4(RecEmcShower *gtrk)
Definition MyUtil.cxx:16
void fill(NTuple::Array< double > &nt_p4, const HepLorentzVector &p4)
Definition MyUtil.cxx:3