1 #include "StHbtMaker/CorrFctn/ParityDevCorrFctn.h"
2 #include "StHbtMaker/Infrastructure/StHbtAnalysis.h"
3 #include "StHbtMaker/Cut/mikesEventCut.h"
12 ParityDevCorrFctn::ParityDevCorrFctn(){
16 mKMiSamex =
new StHbt1DHisto(
"SameKMinusX",
"Parity Same KMinus x",100,-0.4,0.4);
17 mKMiSamey =
new StHbt1DHisto(
"SameKMinusY",
"Parity Same KMinus y",100,-0.4,0.4);
18 mKMiSamez =
new StHbt1DHisto(
"SameKMinusZ",
"Parity Same KMinus z",100,-0.4,0.4);
19 mJcSamex =
new StHbt1DHisto(
"SameJcX",
"Parity Same Jc X",100,-0.2,0.2);
20 mJcSamey =
new StHbt1DHisto(
"SameJcY",
"Parity Same Jc Y",100,-0.2,0.2);
21 mJcSamez =
new StHbt1DHisto(
"SameJcZ",
"Parity Same Jc Z",100,-0.2,0.2);
22 mJcKtSame =
new StHbt1DHisto(
"SameJcKt",
"Parity Same JcKt",100,-0.005,0.005);
23 mKtwistKtSame =
new StHbt1DHisto(
"SameKtwistKt",
"Parity Same KtwistKt",100,-0.005,0.005);
25 mKMiMixedx =
new StHbt1DHisto(
"MixedKMinusX",
"Parity Mixed KMinus x",100,-0.4,0.4);
26 mKMiMixedy =
new StHbt1DHisto(
"MixedKMinusY",
"Parity Mixed KMinus y",100,-0.4,0.4);
27 mKMiMixedz =
new StHbt1DHisto(
"MixedKMinusZ",
"Parity Mixed KMinus z",100,-0.4,0.4);
28 mJcMixedx =
new StHbt1DHisto(
"MixedJcX",
"Parity Mixed Jc X",100,-0.2,0.2);
29 mJcMixedy =
new StHbt1DHisto(
"MixedJcY",
"Parity Mixed Jc Y",100,-0.2,0.2);
30 mJcMixedz =
new StHbt1DHisto(
"MixedJcZ",
"Parity Mixed Jc Z",100,-0.2,0.2);
31 mJcKtMixed =
new StHbt1DHisto(
"MixedJcKt",
"Parity Mixed JcKt",100,-0.005,0.005);
32 mKtwistKtMixed =
new StHbt1DHisto(
"MixedKtwistKt",
"Parity Mixed KtwistKt",100,-0.005,0.005);
34 mJcKtBinomial =
new StHbt1DHisto(
"JcKtBin",
"Number JcKt positive",100,-0.10,0.10);
35 mNumPairsBin =
new StHbt1DHisto(
"Numpairs",
"Number of Pairs",2000,000.,2000.);
42 mKMiSamex->SetDirectory(0);
43 mKMiSamey->SetDirectory(0);
44 mKMiSamez->SetDirectory(0);
45 mJcSamex->SetDirectory(0);
46 mJcSamey->SetDirectory(0);
47 mJcSamez->SetDirectory(0);
48 mJcKtSame->SetDirectory(0);
49 mKtwistKtSame->SetDirectory(0);
50 mKMiMixedx->SetDirectory(0);
51 mKMiMixedy->SetDirectory(0);
52 mKMiMixedz->SetDirectory(0);
53 mJcMixedx->SetDirectory(0);
54 mJcMixedy->SetDirectory(0);
55 mJcMixedz->SetDirectory(0);
56 mJcKtMixed->SetDirectory(0);
57 mKtwistKtMixed->SetDirectory(0);
58 mJcKtBinomial->SetDirectory(0);
59 mNumPairsBin->SetDirectory(0);
68 mKtwistKtMixed->Sumw2();
76 mKtwistKtSame->Sumw2();
77 mJcKtBinomial->Sumw2();
78 mNumPairsBin->Sumw2();
83 ParityDevCorrFctn::~ParityDevCorrFctn(){
92 delete mKtwistKtSame ;
101 delete mKtwistKtMixed ;
105 void ParityDevCorrFctn::Finish(){
106 cout <<
" alive in finish " << endl;
110 StHbtString ParityDevCorrFctn::Report(){
111 string stemp =
"Parity Correlation Function Report:\n";
112 StHbtString returnThis = stemp;
116 inline void ParityDevCorrFctn::AddRealPair(
const StHbtPair* pair){
117 cout <<
"WARNING ParityDevCorrFctn::AddRealPair shouldn't be called" << endl;
122 inline void ParityDevCorrFctn::AddMixedPair(
const StHbtPair* pair){
123 cout <<
"WARNING ParityDevCorrFctn::AddMixedPair shouldn't be called" << endl;
127 inline void ParityDevCorrFctn::ParityCompute(ParityBuff *Plus, ParityBuff *Minus,
int mxd){
138 double JcKtBinom = 0;
141 int plusSize = Plus->size();
142 int minusSize = Minus->size();
145 cout <<
"******** we got to the ParityCompute for SAME event" << endl;
146 cout <<
" size of same event plus is " << Plus->size() <<
" ";
147 cout <<
" size of same event minus is " << Minus->size() << endl;
150 cout <<
"******** we got to the ParityCompute for MIXED event" << endl;
151 cout <<
" size of mixed event plus is " << Plus->size() <<
" ";
152 cout <<
" size of mixed event minus is " << Minus->size() << endl;
156 {
for (
int jjj = 0; jjj <plusSize; jjj++){
157 KMinusPos += (*Plus)[jjj].vect().unit();
159 {
for (
int jjj = 0; jjj < minusSize; jjj++){
160 KMinusNeg += (*Minus)[jjj].vect().unit();
162 KMinus = (KMinusPos/plusSize) - (KMinusNeg/minusSize);
165 cout <<
"Kt is " << Kt.x() <<
"," << Kt.y() << endl ;
170 {
for (
int jjj = 0; jjj < plusSize; jjj++){
172 double step1 = (TempV.y() * Kt.x()-TempV.x() * Kt.y() );
173 double step2 = step1*TempV.z();
174 double step3 = step2/(TempV.mag2() * Kt.mag());
177 double minusSum = 0.;
178 {
for (
int jjj = 0; jjj < minusSize; jjj++){
180 double step1 = (TempV.y() * Kt.x()-TempV.x() * Kt.y() );
181 double step2 = step1*TempV.z();
182 double step3 = step2/(TempV.mag2() * Kt.mag());
186 double Ktwist = (plusSum/ plusSize) - (minusSum/ minusSize);
187 KtwistKt = Ktwist*Kt.mag();
189 cout <<
"KtwistKt is " << KtwistKt << endl;
194 int smallSize = plusSize;
197 if (minusSize < plusSize) smallSize = minusSize;
199 {
for (
int jjj = 0; jjj < smallSize; jjj++){
200 PlusTrack = (*Plus)[jjj];
201 MinusTrack = (*Minus)[jjj];
205 if ( (vOne.z()*vTwo.z()) < 0.){
206 PairJc.setX(-PairJc.x());
208 if ( (vOne.x()*vTwo.x()) < 0.){
209 PairJc.setY(-PairJc.y());
211 if ( (vOne.y()*vTwo.y()) < 0.){
212 PairJc.setZ(-PairJc.z());
217 PairJcKt = PairJc.dot(Kt);
225 cout <<
"JcKt is " << JcKt << endl;
226 JcKtBinom = ( double(numJcKtPlus)/double(numPairs) ) -1./2. ;
227 cout <<
"JcKt bin = " << numJcKtPlus <<
"/" <<numPairs <<
"-1/2 ="<< JcKtBinom << endl;
231 mKMiSamex->Fill(KMinus.x());
232 mKMiSamey->Fill(KMinus.y());
233 mKMiSamez->Fill(KMinus.z());
234 mJcSamex->Fill(Jc.x());
235 mJcSamey->Fill(Jc.y());
236 mJcSamez->Fill(Jc.z());
237 mJcKtSame->Fill(JcKt);
238 mKtwistKtSame->Fill(KtwistKt);
240 mJcKtBinomial->Fill(JcKtBinom);
241 mNumPairsBin->Fill(numPairs);
245 mKMiMixedx->Fill(KMinus.x());
246 mKMiMixedy->Fill(KMinus.y());
247 mKMiMixedz->Fill(KMinus.z());
248 mJcMixedx->Fill(Jc.x());
249 mJcMixedy->Fill(Jc.y());
250 mJcMixedz->Fill(Jc.z());
251 mJcKtMixed->Fill(JcKt);
252 mKtwistKtMixed->Fill(KtwistKt);