StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Th3DQCorrFctn.cxx
1 /***************************************************************************
2  *
3  *
4  *
5  * Author: Laurent Conin, Fabrice Retiere, Subatech, France
6  ***************************************************************************
7  *
8  * Description : Calculate the theoretical QInv correlation function
9  *
10  ***************************************************************************
11  *
12  *
13  *
14  ***************************************************************************/
15 
16 #include "StHbtMaker/ThCorrFctn/Th3DQCorrFctn.h"
17 
18 #ifdef __ROOT__
19 ClassImp(Th3DQCorrFctn)
20 #endif
21 
22 Th3DQCorrFctn::Th3DQCorrFctn(char* aTitle, int aNBins,
23  double aHLo, double aHHi)
24  : StHbtThCorrFctn() ,StHbtRoot1DCF(aTitle, aNBins, aHLo, aHHi)
25 {
26  char tit[100] = "";
27 
28  Int_t qnbins = 100;
29  Float_t qmax = 1.0;
30  Float_t qmin = -1.0;
31  Float_t dmin = -0.2;
32  Float_t dmax = 0.2;
33  strcpy(tit,"Outdist");
34  strcat(tit,aTitle);
35  qOutdist = new StHbt1DHisto(tit,aTitle,qnbins,qmin,qmax);
36  strcpy(tit,"OutSdist");
37  strcat(tit,aTitle);
38  qOutSdist = new StHbt1DHisto(tit,aTitle,qnbins,qmin,qmax);
39  strcpy(tit,"DeltaOutdist");
40  strcat(tit,aTitle);
41  DeltaqOutdist = new StHbt1DHisto(tit,aTitle,qnbins,dmin,dmax);
42  strcpy(tit,"Sidedist");
43  strcat(tit,aTitle);
44  qSidedist = new StHbt1DHisto(tit,aTitle,qnbins,qmin,qmax);
45  strcpy(tit,"SideSdist");
46  strcat(tit,aTitle);
47  qSideSdist = new StHbt1DHisto(tit,aTitle,qnbins,qmin,qmax);
48  strcpy(tit,"DeltaSidedist");
49  strcat(tit,aTitle);
50  DeltaqSidedist = new StHbt1DHisto(tit,aTitle,qnbins,dmin,dmax);
51  strcpy(tit,"Longdist");
52  strcat(tit,aTitle);
53  qLongdist = new StHbt1DHisto(tit,aTitle,qnbins,qmin,qmax);
54  strcpy(tit,"LongSdist");
55  strcat(tit,aTitle);
56  qLongSdist = new StHbt1DHisto(tit,aTitle,qnbins,qmin,qmax);
57  strcpy(tit,"DeltaLongdist");
58  strcat(tit,aTitle);
59  DeltaqLongdist = new StHbt1DHisto(tit,aTitle,qnbins,dmin,dmax);
60 
61  qOutdist->Sumw2();
62  qOutSdist->Sumw2();
63  DeltaqOutdist->Sumw2();
64  qSidedist->Sumw2();
65  qSideSdist->Sumw2();
66  DeltaqSidedist->Sumw2();
67  qLongdist->Sumw2();
68  qLongSdist->Sumw2();
69  DeltaqLongdist->Sumw2();
70 };
71 
72 Th3DQCorrFctn::Th3DQCorrFctn(const Th3DQCorrFctn& ThCf)
73  : StHbtThCorrFctn(ThCf),StHbtRoot1DCF( ThCf)
74 { /* no-op */ }
75 
76 Th3DQCorrFctn::~Th3DQCorrFctn()
77 { /* no-op */ };
78 
79 //____________________________
80 void Th3DQCorrFctn::AddNum(StHbtThPair* aThPair){
81 
82  double tQInv=fabs(aThPair->GetMeasPair()->KStar());
83  if(tQInv>=mHLo && tQInv<=mHHi){
84  mNumerator->Fill(tQInv,aThPair->GetWeightNum());
85  }
86 }
87 
88 void Th3DQCorrFctn::AddDen(StHbtThPair* aThPair){
89 
90  double tQInv=2*fabs(aThPair->GetMeasPair()->KStar());
91  if(tQInv>=mHLo && tQInv<=mHHi){
92  mDenominator->Fill(tQInv,aThPair->GetWeightDen());
93 
94  }
95  if (tQInv<0.1) {
96  double qOut = aThPair->GetMeasPair()->qOutCMS();
97  double qSide = aThPair->GetMeasPair()->qSideCMS();
98  double qLong = aThPair->GetMeasPair()->qLongCMS();
99 
100  double RqOut = aThPair->RealqOutCMS();
101  double RqSide = aThPair->RealqSideCMS();
102  double RqLong = aThPair->RealqLongCMS();
103 
104  qOutdist->Fill(qOut);
105  qOutSdist->Fill(RqOut);
106  DeltaqOutdist->Fill(qOut - RqOut);
107  qSidedist->Fill(qSide);
108  qSideSdist->Fill(RqSide);
109  DeltaqSidedist->Fill(qSide - RqSide);
110  qLongdist->Fill(qLong);
111  qLongSdist->Fill(RqLong);
112  DeltaqLongdist->Fill(qLong - RqLong);
113  }
114 }
115 
116 void Th3DQCorrFctn::Finish(){
117  StHbtRoot1DCF::Finish();
118 }
119 
120 inline StHbt1DHisto* Th3DQCorrFctn::Numerator() const { cout << "Return Ratio" << endl; return mNumerator;};
121 inline StHbt1DHisto* Th3DQCorrFctn::Denominator() const {cout << "Return Denimnatior" << endl; return mDenominator;};
122 inline StHbt1DHisto* Th3DQCorrFctn::Ratio() const {cout << "Return Numerator" << endl; return mRatio;};
123 inline void Th3DQCorrFctn::Write() {
124  mNumerator->Write();mDenominator->Write();mRatio->Write();
125  qOutdist->Write(); qOutSdist->Write(); DeltaqOutdist->Write();
126  qSidedist->Write(); qSideSdist->Write(); DeltaqSidedist->Write();
127  qLongdist->Write(); qLongSdist->Write(); DeltaqLongdist->Write();
128 };
129 
130 inline StHbtThCorrFctn* Th3DQCorrFctn::ThClone() const {return new Th3DQCorrFctn(*this);}