StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPeCParticle.cxx
1 //
3 // Revision 1.0 2000/12/15 Pablo Yepes: yepes@rice.edu
4 //
6 #include <Stiostream.h>
7 #include <math.h>
8 #include "StPeCParticle.h"
9 #include "tables/St_g2t_track_Table.h"
10 
11 
12 ClassImp(StPeCParticle)
13 
15 }
16 
17 StPeCParticle::~StPeCParticle() {
18 }
19 
20 #ifndef __CINT__
21 StPeCParticle::StPeCParticle ( g2t_track_st* trk) {
22  set ( trk ) ;
23 }
24 void StPeCParticle::set ( g2t_track_st* trk) {
25 
26  pid = trk->ge_pid ;
27  key = trk->id ;
28  pt = trk->pt ;
29  eta = trk->eta ;
30  e = trk->e ;
31  psi = atan2(trk->p[1],trk->p[0]);
32  if ( psi < 0 ) psi += 2. * M_PI ;
33  vertexId = trk->start_vertex_p ;
34 
35  nTpcHits = trk->n_tpc_hit ;
36  nFtpHits = trk->n_ftp_hit ;
37  nSvtHits = trk->n_svt_hit ;
38 
39  charge = (Short_t)trk->charge ;
40 }
41 
42 StPeCParticle::StPeCParticle ( StMuMcTrack* trk) {
43  set ( trk ) ;
44 }
45 void StPeCParticle::set ( StMuMcTrack* trk) {
46 
47  pid = trk->GePid() ;
48  key = trk->Id() ;
49  pt = trk->pT() ;
50  eta = trk->Eta() ;
51  e = trk->E() ;
52  psi = atan2(trk->Pxyz().x(),trk->Pxyz().y());
53  if ( psi < 0 ) psi += 2. * M_PI ;
54  vertexId = trk->IdVx() ;
55 
56  nTpcHits = trk->No_tpc_hit() ;
57  nFtpHits = trk->No_ftp_hit() ;
58  nSvtHits = trk->No_svt_hit() ;
59 
60  charge = (Short_t)trk->Charge() ;
61 }
62 #endif /*__CINT__*/
63 
64 
65 
66