StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcPair.cxx
1 
20 #include "StEEmcPair.h"
21 #include <iostream>
22 
23 #include "StMessMgr.h"
24 
25 ClassImp(StEEmcPair);
26 
27 // ----------------------------------------------------------------------------
28 
30 : TObject()
31 {
32  mMass=-1.;
33  mEnergy=-1;
34  mZgg=-1;
35  mPhigg=-1;
36  mMomentum=TVector3(0,0,0);
39 }
40 
41 
43 {
44  StEEmcPair(p1,p2,TVector3(0,0,0),TVector3(0,0,0));
45 }
46 
47 StEEmcPair::StEEmcPair(const StEEmcPoint &p1, const StEEmcPoint &p2, const TVector3 &v)
48 {
49  StEEmcPair(p1,p2,v, v);
50 }
51 
52 StEEmcPair::StEEmcPair(const StEEmcPoint &p1, const StEEmcPoint &p2, const TVector3 &v1, const TVector3 &v2)
53 : TObject()
54 {
55  mPoint[0]=p1;
56  mPoint[1]=p2;
57  mVertex1=v1;
58  mVertex2=v2;
59 
61  mMass=0.;
62  mEnergy=0.;
63  mZgg=0.;
64  mPhigg=0.;
65  mMomentum=TVector3(0,0,0);
66 
68  Kinematics();
69 }
70 
72 {
73 
75  mEnergy=mPoint[0].energy() + mPoint[1].energy();
76 
77  gMessMgr->Debug()<<"StEEmcPair -I- energy=" << mEnergy << endm;
78 
79  if ( mEnergy <= 0. ) {
80  mMass=-1.0;
81  return;
82  }
83 
85  mZgg=TMath::Abs( mPoint[0].energy()-mPoint[1].energy() ) / mEnergy;
86 
87  gMessMgr->Debug()<<"StEEmcPair -I- zgg=" << mZgg << endm;
88 
90  TVector3 momentum1=( mPoint[0].position() - mVertex1 ).Unit();
91  momentum1 *= mPoint[0].energy();
92  TVector3 momentum2=( mPoint[1].position() - mVertex2 ).Unit();
93  momentum2 *= mPoint[1].energy();
95  mPhigg=momentum1.Angle(momentum2);
97  mMomentum=momentum1+momentum2;
98 
100  mVertex = ( mPoint[0].energy() * mVertex1 + mPoint[1].energy() * mVertex2 );
101  mVertex *= 1./mEnergy;
102 
104  mMass = mEnergy * TMath::Sin(mPhigg/2.0) * TMath::Sqrt( 1.0 - mZgg*mZgg );
105 
106  gMessMgr->Debug()<<"StEEmcPair -I- mass=" << mMass << endm;
107 
108 }
109 
110 // ----------------------------------------------------------------------------
112 : TObject(old)
113 {
114  mVertex1=old.mVertex1;
115  mVertex2=old.mVertex2;
116  mVertex=old.mVertex;
117  mPoint[0]=old.mPoint[0];
118  mPoint[1]=old.mPoint[1];
120  mMass=old.mMass;
121  mEnergy=old.mEnergy;
122  mZgg=old.mZgg;
123  mPhigg=old.mPhigg;
124  mMomentum=old.mMomentum;
125 }
126 
127 // ----------------------------------------------------------------------------
128 void StEEmcPair::print() const
129 {
130  std::cout << "pair mass=" << mass()
131  << " e1=" << mPoint[0].energy()
132  << " e2=" << mPoint[1].energy()
133  << " zgg=" << zgg()
134  << " tow1=" << mPoint[0].tower(0).name()
135  << " zvert=" << mVertex.Z()
136  << std::endl;
137 }
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 print() const
Prints a one-line summary of the pair.
Definition: StEEmcPair.cxx:128
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
Float_t zgg() const
Returns energy-sharing of pair.
Definition: StEEmcPair.h:75
TVector3 mVertex1
Definition: StEEmcPair.h:62
Float_t energy() const
Returns energy of pair.
Definition: StEEmcPair.h:74
void tower(const StEEmcTower &t, Float_t w=1.)
Add a tower with specified weight to the point.
Definition: StEEmcPoint.h:38
void position(const TVector3 &p)
Set the position of this point at the SMD plane.
Definition: StEEmcPoint.h:32
Float_t mass() const
Returns invariant mass of pair.
Definition: StEEmcPair.h:73
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