StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ParityTwistCorrFctn.cxx
1 #include "StHbtMaker/CorrFctn/ParityTwistCorrFctn.h"
2 #include <cstdio>
3 
4 #ifdef __ROOT__
5 ClassImp(ParityTwistCorrFctn)
6 #endif
7 
8 //____________________________
9 ParityTwistCorrFctn::ParityTwistCorrFctn(){
10  mTagWriter = StHbtTagWriter::Instance(); // get the singleton
11 
12  // histograms
13  mSameTzz = new StHbt1DHisto("SameTzz","Parity Same Twist zz",100,-0.0010,0.0010);
14  mMixedTzz = new StHbt1DHisto("MixedTzz","Parity Mixed Twist zz",100,-0.0010,0.0010);
15 
16  // end histograms
17 
18  // this next bit is unfortunately needed so that we can have many histos of same "title"
19  // it is neccessary if we typedef StHbt1DHisto to TH1d (which we do)
20  mSameTzz->SetDirectory(0);
21  mMixedTzz->SetDirectory(0);
22 
23  mSameTzz->Sumw2();
24  mMixedTzz->Sumw2();
25 
26 }
27 
28 //____________________________
29 ParityTwistCorrFctn::~ParityTwistCorrFctn(){
30  // histograms
31  delete mSameTzz;
32  delete mMixedTzz ;
33 
34  // end histograms;
35 }
36 //_________________________
37 void ParityTwistCorrFctn::Finish(){
38  cout << " alive in finish " << endl;
39 
40 }
41 //____________________________
42 StHbtString ParityTwistCorrFctn::Report(){
43  string stemp = "Parity Correlation Function Report:\n";
44  StHbtString returnThis = stemp;
45  return returnThis;
46 }
47 //____________________________
48 inline void ParityTwistCorrFctn::AddRealPair(const StHbtPair* pair){
49  cout << "WARNING ParityTwistCorrFctn::AddRealPair shouldn't be called" << endl;
50 }
51 //_________________________
52 
53 
54 //_________________________
55 inline void ParityTwistCorrFctn::AddMixedPair(const StHbtPair* pair){
56  cout << "WARNING ParityTwistCorrFctn::AddMixedPair shouldn't be called" << endl;
57 }
58 
59 //_________________________
60 inline void ParityTwistCorrFctn::ParityCompute(ParityBuff *Plus, ParityBuff *Minus, int mxd){
61 
62 
63  StHbtLorentzVector PlusTrack;
64  StHbtLorentzVector MinusTrack;
65 
66  double Tzz =0;
67  double sumXpos = 0;
68  double sumYpos = 0;
69  double sumZpos = 0;
70  double sumXXpos = 0;
71  double sumYYpos = 0;
72  double sumZZpos = 0;
73  double sumXYpos = 0;
74  double sumXZpos = 0;
75  double sumYZpos = 0;
76 
77  double sumXneg = 0;
78  double sumYneg = 0;
79  double sumZneg = 0;
80  double sumXXneg = 0;
81  double sumYYneg = 0;
82  double sumZZneg = 0;
83  double sumXYneg = 0;
84  double sumXZneg = 0;
85  double sumYZneg = 0;
86 
87  if (mxd == SAME) {
88  cout << "******** we got to the ParityComputeII for SAME event" << endl;
89  }
90  if (mxd == MIXED) {
91  cout << "******** we got to the ParityComputeII for MIXED event" << endl;
92  }
93 
94  int plusSize = Plus->size();
95  int minusSize = Minus->size();
96 
97  {for (int jjj = 0; jjj < plusSize; jjj++){
98  StHbtThreeVector TempV = (*Plus)[jjj].vect();
99  sumXpos += TempV.x();
100  sumYpos += TempV.y();
101  sumZpos += TempV.z();
102  sumXXpos += TempV.x()*TempV.x();
103  sumYYpos += TempV.y()*TempV.y();
104  sumZZpos += TempV.z()*TempV.z();
105  sumXYpos += TempV.x()*TempV.y();
106  sumXZpos += TempV.x()*TempV.z();
107  sumYZpos += TempV.y()*TempV.z();
108  }}
109 
110  {for (int jjj = 0; jjj < minusSize; jjj++){
111  StHbtThreeVector TempV = (*Minus)[jjj].vect();
112  sumXneg += TempV.x();
113  sumYneg += TempV.y();
114  sumZneg += TempV.z();
115  sumXXneg += TempV.x()*TempV.x();
116  sumYYneg += TempV.y()*TempV.y();
117  sumZZneg += TempV.z()*TempV.z();
118  sumXYneg += TempV.x()*TempV.y();
119  sumXZneg += TempV.x()*TempV.z();
120  sumYZneg += TempV.y()*TempV.z();
121  }}
122 
123  Tzz = ( (sumXZpos * sumYneg ) + (sumYpos * sumXZneg)
124  - (sumXpos * sumYZneg) - (sumYZpos * sumXneg ) ) / (plusSize*minusSize);
125 
126  cout << "Tzz is ..................."<< Tzz <<endl;
127 
128  if (mxd == SAME) {
129  mSameTzz->Fill(Tzz);
130  }
131  if (mxd == MIXED) {
132  mMixedTzz->Fill(Tzz);
133  }
134 
135 }
136 //_________________________