StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcIUPair.cxx
1 
19 #include "TMath.h"
20 #include "StEEmcIUPair.h"
21 #include <iostream>
22 ClassImp(StEEmcIUPair);
23 
24 // ----------------------------------------------------------------------------
25 
27 {
28  mMass=-1.;
29  mEnergy=-1;
30  mZgg=-1;
31  mPhigg=-1;
32  mMomentum=TVector3(0,0,0);
35 }
36 
37 
39 {
40  StEEmcIUPair(p1,p2,TVector3(0,0,0),TVector3(0,0,0));
41 }
42 
44 {
45  StEEmcIUPair(p1,p2,v, v);
46 }
47 
48 StEEmcIUPair::StEEmcIUPair( StEEmcIUPoint p1, StEEmcIUPoint p2, TVector3 v1, TVector3 v2 )
49 {
50  mPoint[0]=p1;
51  mPoint[1]=p2;
52  mVertex1=v1;
53  mVertex2=v2;
54 
56  mMass=0.;
57  mEnergy=0.;
58  mZgg=0.;
59  mPhigg=0.;
60  mMomentum=TVector3(0,0,0);
61 
63  Kinematics();
64 }
65 
67 {
68 
70 
71  mEnergy=mPoint[0].energy() + mPoint[1].energy();
72  if ( mEnergy <= 0. ) {
73  mMass=-1.0;
74  return;
75  }
76 
77 
79  mZgg=TMath::Abs( mPoint[0].energy()-mPoint[1].energy() ) / mEnergy;
81  TVector3 momentum1=( mPoint[0].position() - mVertex1 ).Unit();
82  momentum1 *= mPoint[0].energy();
83  //printf("kinezvert=%f\n",mVertex1.Z());
84  TVector3 momentum2=( mPoint[1].position() - mVertex2 ).Unit();
85  momentum2 *= mPoint[1].energy();
87  mPhigg=momentum1.Angle(momentum2);
88 
90  mMomentum=momentum1+momentum2;
91 
93  mVertex = ( mPoint[0].energy() * mVertex1 + mPoint[1].energy() * mVertex2 );
94  mVertex *= 1./mEnergy;
95 
97  mMass = mEnergy * TMath::Sin(mPhigg/2.0) * TMath::Sqrt( 1.0 - mZgg*mZgg );
98  //printf("mMass=%f\n",mMass);
99 
100 }
101 
102 // ----------------------------------------------------------------------------
104 {
105  mVertex1=old.mVertex1;
106  mVertex2=old.mVertex2;
107  mPoint[0]=old.mPoint[0];
108  mPoint[1]=old.mPoint[1];
110  mMass=0.;
111  mEnergy=0.;
112  mZgg=0.;
113  mPhigg=0.;
114  mMomentum=TVector3(0,0,0);
116  Kinematics();
117 }
118 
119 // ----------------------------------------------------------------------------
121 {
122  std::cout << "pair mass=" << mass()
123  << " e1=" << mPoint[0].energy()
124  << " e2=" << mPoint[1].energy()
125  << " zgg=" << zgg()
126  << " tow1=" << mPoint[0].tower(0).name()
127  << " tow2=" << mPoint[1].tower(0).name()
128  << " zvert=" << mVertex.Z()
129  << " phigg=" << phigg()
130  << " pz=" << pz()
131  << std::endl;
132 
133  //StEEmcIUSmdCluster tclust1 = mPoint[0].cluster(0);
134 
135  //Int_t nums=tclust1.numberOfStrips();
136  //for ( Int_t is=0;is<nums;is++ )
137  //{
138  // StEEmcStrip sti1=tclust1.strip(is);
139  // float stenergy1=sti1.energy();
140  // printf("clust0stripu.energy=%f index=%d\n",stenergy1,sti1.index());
141  //}
142  //StEEmcIUSmdCluster tclust2 = mPoint[0].cluster(1);
143  //Int_t n2=tclust2.numberOfStrips();
144  //for ( Int_t is=0;is<n2;is++ )
145  //{
146  // StEEmcStrip sti2=tclust2.strip(is);
147  // float stenergy2=sti2.energy();
148  // printf("clust0stripv.energy=%f index=%d\n",stenergy2,sti2.index());
149  //}
150  //StEEmcIUSmdCluster tclust3 = mPoint[1].cluster(0);
151  //Int_t n3=tclust3.numberOfStrips();
152  //for ( Int_t is=0;is<n3;is++ )
153  //{
154  //StEEmcStrip sti3=tclust3.strip(is);
155  // float stenergy3=sti3.energy();
156  //printf("clust1stripu.energy=%f index=%d\n",stenergy3,sti3.index());
157  //}
158  //StEEmcIUSmdCluster tclust4 = mPoint[1].cluster(1);
159  //Int_t n4=tclust4.numberOfStrips();
160  //for ( Int_t is=0;is<n4;is++ )
161  //{
162  //StEEmcStrip sti4=tclust4.strip(is);
163  // float stenergy4=sti4.energy();
164  // printf("clust1stripv.energy=%f index=%d\n",stenergy4,sti4.index());
165  //}
166  }
Float_t phigg()
Returns opening-angle of pair.
Definition: StEEmcIUPair.h:77
TVector3 mVertex
Definition: StEEmcIUPair.h:65
StEEmcIUPoint mPoint[2]
Definition: StEEmcIUPair.h:67
void Kinematics()
Called by constructor to reconstruct two-body kinematics.
void print()
Prints a one-line summary of the pair.
TVector3 mVertex2
Definition: StEEmcIUPair.h:64
Float_t mPhigg
Definition: StEEmcIUPair.h:60
void energy(Float_t e, Int_t layer=0)
Set the energy of this point.
Definition: StEEmcIUPoint.h:25
void position(TVector3 p)
Set the position of this point at the SMD plane.
Definition: StEEmcIUPoint.h:23
StEEmcIUPair()
Default constructor (don&#39;t use except for placeholder)
Float_t mEnergy
Definition: StEEmcIUPair.h:58
Float_t mass()
Returns invariant mass of pair.
Definition: StEEmcIUPair.h:74
Float_t energy()
Returns energy of pair.
Definition: StEEmcIUPair.h:75
Float_t mZgg
Definition: StEEmcIUPair.h:59
TVector3 mMomentum
Definition: StEEmcIUPair.h:61
TVector3 mVertex1
Definition: StEEmcIUPair.h:63
Base class for representing EEMC points.
Definition: StEEmcIUPoint.h:12
void tower(StEEmcTower t, Float_t w=1.)
Add a tower with specified weight to the point.
Definition: StEEmcIUPoint.h:29
Float_t mMass
Definition: StEEmcIUPair.h:57
Float_t zgg()
Returns energy-sharing of pair.
Definition: StEEmcIUPair.h:76