StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcPair.cxx
1 #include "StEEmcPair.h"
2 #include "TMath.h"
3 ClassImp(StEEmcPair);
4 
5 // ----------------------------------------------------------------------------
6 
8 {
9  mMass=-1.;
10  mEnergy=-1;
11  mZgg=-1;
12  mPhigg=-1;
13  mMomentum=TVector3(0,0,0);
16 }
17 
18 
20 {
21  StEEmcPair(p1,p2,TVector3(0,0,0),TVector3(0,0,0));
22 }
23 
25 {
26  StEEmcPair(p1,p2,v, v);
27 }
28 
29 StEEmcPair::StEEmcPair( StEEmcPoint p1, StEEmcPoint p2, TVector3 v1, TVector3 v2 )
30 {
31  mPoint[0]=p1;
32  mPoint[1]=p2;
33  mVertex1=v1;
34  mVertex2=v2;
35 
37  mMass=0.;
38  mEnergy=0.;
39  mZgg=0.;
40  mPhigg=0.;
41  mMomentum=TVector3(0,0,0);
42 
44  Kinematics();
45 }
46 
48 {
49 
51  mEnergy=mPoint[0].energy() + mPoint[1].energy();
52  if ( mEnergy <= 0. ) {
53  mMass=-1.0;
54  return;
55  }
57  mZgg=TMath::Abs( mPoint[0].energy()-mPoint[1].energy() ) / mEnergy;
59  TVector3 momentum1=( mPoint[0].position() - mVertex1 ).Unit();
60  momentum1 *= mPoint[0].energy();
61  TVector3 momentum2=( mPoint[1].position() - mVertex2 ).Unit();
62  momentum2 *= mPoint[1].energy();
64  mPhigg=momentum1.Angle(momentum2);
66  mMomentum=momentum1+momentum2;
67 
69  mVertex = ( mPoint[0].energy() * mVertex1 + mPoint[1].energy() * mVertex2 );
70  mVertex *= 1./mEnergy;
71 
73  mMass = mEnergy * TMath::Sin(mPhigg/2.0) * TMath::Sqrt( 1.0 - mZgg*mZgg );
74 
75 
76 }
77 
78 // ----------------------------------------------------------------------------
80 {
81  mVertex1=old.mVertex1;
82  mVertex2=old.mVertex2;
83  mPoint[0]=old.mPoint[0];
84  mPoint[1]=old.mPoint[1];
86  mMass=0.;
87  mEnergy=0.;
88  mZgg=0.;
89  mPhigg=0.;
90  mMomentum=TVector3(0,0,0);
92  Kinematics();
93 }
Base class for representing EEMC points.
Definition: StEEmcPoint.h:24
TVector3 mVertex
Definition: StEEmcPair.h:64
StEEmcPoint mPoint[2]
Definition: StEEmcPair.h:66
void energy(Float_t e, Int_t layer=0)
Set the energy of this point.
Definition: StEEmcPoint.h:34
void Kinematics()
Called by constructor to reconstruct two-body kinematics.
Definition: StEEmcPair.cxx:71
Float_t mMass
Definition: StEEmcPair.h:56
Float_t mPhigg
Definition: StEEmcPair.h:59
TVector3 mVertex2
Definition: StEEmcPair.h:63
TVector3 mVertex1
Definition: StEEmcPair.h:62
Float_t energy() const
Returns energy of pair.
Definition: StEEmcPair.h:74
void position(const TVector3 &p)
Set the position of this point at the SMD plane.
Definition: StEEmcPoint.h:32
StEEmcPair()
Default constructor (don&#39;t use except for placeholder)
Definition: StEEmcPair.cxx:29
TVector3 mMomentum
Definition: StEEmcPair.h:60
A class to represent pairs of points.
Definition: StEEmcPair.h:9
Float_t mZgg
Definition: StEEmcPair.h:58
Float_t mEnergy
Definition: StEEmcPair.h:57