00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include "StHbtMaker/CorrFctn/BPLCMSFrame3DCorrFctn_SIM.h"
00040 #include "StHbtMaker/Infrastructure/StHbtSmearPair.h"
00041
00042 #include <cstdio>
00043
00044 #ifdef __ROOT__
00045 ClassImp(BPLCMSFrame3DCorrFctn_SIM)
00046 #endif
00047
00048
00049 BPLCMSFrame3DCorrFctn_SIM::BPLCMSFrame3DCorrFctn_SIM(char* title, const int& nbins, const float& QLo, const float& QHi){
00050
00051
00052 mQinvNormLo = 0.15;
00053 mQinvNormHi = 0.18;
00054 mNumRealsNorm = 0;
00055 mNumMixedNorm = 0;
00056 mCorrection = 0;
00057
00058 mPairCut = 0;
00059
00060 mToggleNumDen = 0;
00061
00062 mLambda=0.;
00063 mRside2=25.0;
00064 mRout2=25.0;
00065 mRlong2=25.0;
00066
00067 mRout_alpha = mRside_alpha = mRlong_alpha = 0;
00068
00069
00070 char TitNum[100] = "Num";
00071 strcat(TitNum,title);
00072 mNumerator = new StHbt3DHisto(TitNum,title,nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
00073
00074 char TitDen[100] = "Den";
00075 strcat(TitDen,title);
00076 mDenominator = new StHbt3DHisto(TitDen,title,nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
00077
00078 char TitRat[100] = "Rat";
00079 strcat(TitRat,title);
00080 mRatio = new StHbt3DHisto(TitRat,title,nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
00081
00082
00083 mNumerator->Sumw2();
00084 mDenominator->Sumw2();
00085 mRatio->Sumw2();
00086
00087
00088
00089
00090 char titInv[100] = "QinvRes";
00091 strcat(titInv,title);
00092 mResolutionHistos[0] = new StHbt2DHisto(titInv,title,10,0.0,0.1,50,-0.025,0.025);
00093
00094 char titOut[100] = "QoutRes";
00095 strcat(titOut,title);
00096 mResolutionHistos[1] = new StHbt2DHisto(titOut,title,10,0.0,0.1,50,-0.025,0.025);
00097
00098 char titSid[100] = "QsidRes";
00099 strcat(titSid,title);
00100 mResolutionHistos[2] = new StHbt2DHisto(titSid,title,10,0.0,0.1,50,-0.025,0.025);
00101
00102 char titLon[100] = "QlonRes";
00103 strcat(titLon,title);
00104 mResolutionHistos[3] = new StHbt2DHisto(titLon,title,10,0.0,0.1,50,-0.025,0.025);
00105
00106 }
00107
00108
00109 BPLCMSFrame3DCorrFctn_SIM::~BPLCMSFrame3DCorrFctn_SIM(){
00110 delete mNumerator;
00111 delete mDenominator;
00112 delete mRatio;
00113 }
00114
00115 void BPLCMSFrame3DCorrFctn_SIM::Finish(){
00116
00117 mRatio->Divide(mNumerator,mDenominator);
00118 }
00119
00120
00121 StHbtString BPLCMSFrame3DCorrFctn_SIM::Report(){
00122 string stemp = "LCMS Frame Bertsch-Pratt 3D Correlation Function Report:\n";
00123 char ctemp[100];
00124 sprintf(ctemp," THIS IS A SIMULATION CORRELATION FUNCTION CLASS!!!\n");
00125 stemp += ctemp;
00126 sprintf(ctemp,"Number of entries in numerator:\t%E\n",mNumerator->GetEntries());
00127 stemp += ctemp;
00128 sprintf(ctemp,"Number of entries in denominator:\t%E\n",mDenominator->GetEntries());
00129 stemp += ctemp;
00130 sprintf(ctemp,"Number of entries in ratio:\t%E\n",mRatio->GetEntries());
00131 stemp += ctemp;
00132 sprintf(ctemp,"Normalization region in Qinv was:\t%E\t%E\n",mQinvNormLo,mQinvNormHi);
00133 stemp += ctemp;
00134 sprintf(ctemp,"Number of pairs in Normalization region was:\n");
00135 stemp += ctemp;
00136 sprintf(ctemp,"In numerator:\t%lu\t In denominator:\t%lu\n",mNumRealsNorm,mNumMixedNorm);
00137 stemp += ctemp;
00138 if (mCorrection)
00139 {
00140 float radius = mCorrection->GetRadius();
00141 sprintf(ctemp,"Coulomb correction used radius of\t%E\n",radius);
00142 }
00143 else
00144 {
00145 sprintf(ctemp,"No Coulomb Correction applied to this CorrFctn\n");
00146 }
00147 stemp += ctemp;
00148
00149 if (mPairCut){
00150 sprintf(ctemp,"Here is the PairCut specific to this CorrFctn\n");
00151 stemp += ctemp;
00152 stemp += mPairCut->Report();
00153 }
00154 else{
00155 sprintf(ctemp,"No PairCut specific to this CorrFctn\n");
00156 stemp += ctemp;
00157 }
00158
00159
00160 StHbtString returnThis = stemp;
00161 return returnThis;
00162 }
00163
00164 void BPLCMSFrame3DCorrFctn_SIM::AddRealPair(const StHbtPair* pair){
00165
00166
00167
00168
00169
00170 return;
00171
00172 }
00173
00174
00175
00176
00177
00178 void BPLCMSFrame3DCorrFctn_SIM::AddMixedPair(const StHbtPair* pair){
00179
00180 mToggleNumDen = !mToggleNumDen;
00181
00182
00183
00184 if (mPairCut){
00185 if (!(mPairCut->Pass(pair))){
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201 return;
00202 }
00203 }
00204
00205 double weight=1.0;
00206
00207
00208 double qOut = fabs(pair->qOutCMS());
00209 double qSide = fabs(pair->qSideCMS());
00210 double qLong = fabs(pair->qLongCMS());
00211
00212
00213 double qOut_bin,qSide_bin,qLong_bin;
00214 if (mSmearPair){
00215 mSmearPair->SetUnsmearedPair(pair);
00216 qOut_bin = fabs(mSmearPair->SmearedPair().qOutCMS());
00217 qSide_bin = fabs(mSmearPair->SmearedPair().qSideCMS());
00218 qLong_bin = fabs(mSmearPair->SmearedPair().qLongCMS());
00219
00220 double Qinv = fabs(pair->qInv());
00221 if (Qinv < 0.1){
00222 double Qinv_smear = fabs(mSmearPair->SmearedPair().qInv());
00223 mResolutionHistos[0]->Fill(Qinv,Qinv_smear-Qinv);
00224 mResolutionHistos[1]->Fill(qOut,qOut_bin-qOut);
00225 mResolutionHistos[2]->Fill(qSide,qSide_bin-qSide);
00226 mResolutionHistos[3]->Fill(qLong,qLong_bin-qLong);
00227 }
00228 }
00229 else{
00230 qOut_bin = qOut;
00231 qSide_bin = qSide;
00232 qLong_bin = qLong;
00233 }
00234
00235
00236
00237
00238
00239
00240 if (mToggleNumDen){
00241 if (mCorrection){
00242 if (mSmearPair){
00243 weight = mCorrection->CoulombCorrect(&(mSmearPair->SmearedPair()));
00244 }
00245 else{
00246 weight = mCorrection->CoulombCorrect(pair);
00247 }
00248 }
00249 mDenominator->Fill(qOut_bin,qSide_bin,qLong_bin,weight);
00250 }
00251 else{
00252
00253 if (mCorrection) weight = mCorrection->CoulombCorrect(pair);
00254
00255
00256
00257 float mT2 = (pair->fourMomentumSum().mt2())/4.0;
00258
00259
00260 float Rout2,Rside2,Rlong2;
00261
00262 if (mRout_alpha!=0){Rout2 = mRout2*::pow(mT2,mRout_alpha);}
00263 else{Rout2 = mRout2;}
00264
00265 if (mRside_alpha!=0){Rside2 = mRside2*::pow(mT2,mRside_alpha);}
00266 else{Rside2 = mRside2;}
00267
00268 if (mRlong_alpha!=0){Rlong2 = mRlong2*::pow(mT2,mRlong_alpha);}
00269 else{Rlong2 = mRlong2;}
00270
00271 double CorrWeight = 1.0 +
00272 mLambda*exp((-qOut*qOut*Rout2 -qSide*qSide*Rside2 -qLong*qLong*Rlong2)/0.038936366329);
00273 CorrWeight *= weight;
00274 mNumerator->Fill(qOut_bin,qSide_bin,qLong_bin,CorrWeight);
00275 }
00276
00277 }
00278
00279
00280