17 #include "StHbtMaker/ThCorrFctn/StHbtThPairDoubleGauss.h"
18 #include "StHbtMaker/Infrastructure/StHbtParticle.hh"
19 #include "StHbtMaker/Base/StHbtFsiWeight.hh"
25 StHbtThPairDoubleGauss::StHbtThPairDoubleGauss() :
StHbtThPair(){
33 mSizeX1=mSizeY1=mSizeZ1=1.;
35 mSizeX2=mSizeY2=mSizeZ2=1.;
45 mRand = *(
new TRandom2(31811));
48 Double_t posMin = -10.0;
49 Double_t posMax = 10.0;
53 mPosDist1 =
new StHbt3DHisto(
"PosDist1",
"PosDist1",nbins,posMin,posMax,nbins,posMin,posMax,nbins,posMin,posMax);
54 mPosDist2 =
new StHbt3DHisto(
"PosDist2",
"PosDist2",nbins,posMin,posMax,nbins,posMin,posMax,nbins,posMin,posMax);
55 mTDist1 =
new StHbt1DHisto(
"TDist1",
"PosDist1",nbins,posMin,posMax);
56 mTDist2 =
new StHbt1DHisto(
"TDist2",
"PosDist2",nbins,posMin,posMax);
57 mPosPtDist1 =
new StHbt2DHisto(
"PosPtDist1",
"PosPtDist1",nbins,posMin,posMax,nbins,ptMin,ptMax);
58 mPosPtDist2 =
new StHbt2DHisto(
"PosPtDist2",
"PosPtDist2",nbins,posMin,posMax,nbins,ptMin,ptMax);
61 StHbtThPairDoubleGauss::~StHbtThPairDoubleGauss()
71 void StHbtThPairDoubleGauss::Set(
const StHbtPair* aPair){
72 SetMomentum_PID (aPair);
84 void StHbtThPairDoubleGauss::SetMomentum_PID(
const StHbtPair* aPair ){
93 if (mUseHidMom||mUseHidPid) {
94 if (mHiddenInfoType == SMEAR) {
96 (aPair->track1()->getHiddenInfo());
98 (aPair->track2()->getHiddenInfo());
99 if ((tSmearedHidInf1==0)||(tSmearedHidInf2==0)) {
100 if (tSmearedHidInf1==0) {
102 mMomRes1->setMult(mResMult);
104 temp = GenerateFreezeOut(1);
105 aPair->track1()->SetHiddenInfo(
new StHbtSmearedHiddenInfo(aPair->track1()->FourMomentum(), *temp, mPid1, &mRand, mMomRes1));
110 if (tSmearedHidInf2==0) {
112 mMomRes2->setMult(mResMult);
114 temp = GenerateFreezeOut(2);
115 aPair->track2()->SetHiddenInfo(
new StHbtSmearedHiddenInfo(aPair->track2()->FourMomentum(), *temp, mPid2, &mRand, mMomRes2));
122 else if (mHiddenInfoType == SHIFT) {
124 (aPair->track1()->getHiddenInfo());
126 (aPair->track2()->getHiddenInfo());
127 if ((tShiftedHidInf1==0)||(tShiftedHidInf2==0)) {
128 if (tShiftedHidInf1==0) {
130 mMomRes1->setMult(mResMult);
131 aPair->track1()->SetHiddenInfo(
new StHbtShiftedHiddenInfo(aPair->track1()->FourMomentum(), mPid1, &mRand, mMomRes1, mShift, PHISHIFT));
135 if (tShiftedHidInf2==0) {
137 mMomRes2->setMult(mResMult);
138 aPair->track2()->SetHiddenInfo(
new StHbtShiftedHiddenInfo(aPair->track2()->FourMomentum(), mPid2, &mRand, mMomRes2, mShift, PHISHIFT));
146 (aPair->track1()->HiddenInfo());
148 (aPair->track2()->HiddenInfo());
152 if (mUseHidMom&&tSmearedHidInf2&&tSmearedHidInf1) {
154 mMomentum1=&(tSmearedHidInf1->mSmearedMom);
155 mMomentum2=&(tSmearedHidInf2->mSmearedMom);
157 else if (mUseHidMom&&tShiftedHidInf2&&tShiftedHidInf1) {
158 mMomentum1=&(tShiftedHidInf1->mShiftedMom);
159 mMomentum2=&(tShiftedHidInf2->mShiftedMom);
161 else if (mUseHidMom&&tEvtGenHidInf2&&tEvtGenHidInf1) {
168 mMom1=aPair->track1()->FourMomentum();
169 mMom1.setE(::sqrt(mMassSq1+mMom1.vect().mag2()));
170 mMom2=aPair->track2()->FourMomentum();
171 mMom2.setE(::sqrt(mMassSq2+mMom2.vect().mag2()));
172 if ((!mUseHidMom)&&(mBetaRCMS>0)) {
174 mMom1.setE(mGammaRCMS*(tE-mBetaRCMS*mMom1.pz()));
175 mMom1.setPz(mGammaRCMS*(mMom1.pz()-mBetaRCMS*tE));
177 mMom2.setE(mGammaRCMS*(tE-mBetaRCMS*mMom2.pz()));
178 mMom2.setPz(mGammaRCMS*(mMom2.pz()-mBetaRCMS*tE));
183 void StHbtThPairDoubleGauss::SetPosition(
const StHbtPair* aPair) {
197 if (mHiddenInfoType == SMEAR) {
202 if ((mHiddenInfoType == SMEAR) && (tSmearedHidInf1 != 0) && (tSmearedHidInf2 != 0))
205 mPos1 = tSmearedHidInf1->getFreezeOut();
206 mPos2 = tSmearedHidInf2->getFreezeOut();
214 temp = GenerateFreezeOut(1);
217 temp = GenerateFreezeOut(2);
234 if (mCoreHalo == 1) {
235 if (mRand.Uniform() < mProb1) {
236 mPos->setX(x*mSizeX1);
237 mPos->setY(y*mSizeY1);
238 mPos->setZ(z*mSizeZ1);
239 mPos->setT(t*mTime1);
242 mPos->setX(x*mSizeX2);
243 mPos->setY(y*mSizeY2);
244 mPos->setZ(z*mSizeZ2);
245 mPos->setT(t*mTime2);
248 else if (mCoreHalo ==2)
253 mPos->setX(x*mSizeX1*cos(phi*2*TMath::Pi()));
254 mPos->setY(x*mSizeX1*sin(phi*2*TMath::Pi()));
255 mPos->setZ(z*mSizeZ2);
256 mPos->setT(t*mTime2);
258 else if (mCoreHalo ==3)
269 double tROut = mRand.Gaus(mTime1,mSizeX1);
270 double tRSide = mRand.Gaus(0,mSizeX1);
271 double tRLong = mRand.Gaus(0,mSizeX1);
272 double tDTime = tROut;
274 double tPx = mMomentum1->x()+mMomentum2->x();
275 double tPy = mMomentum1->y()+mMomentum2->y();
276 double tPz = mMomentum1->z()+mMomentum2->z();
277 double tE = mMomentum1->e()+mMomentum2->e();
279 double tPt = tPx*tPx+tPy*tPy;
280 double tMt = tE*tE-tPz*tPz;
281 double tM = ::sqrt(tMt - tPt);
287 double ttDTime = tDTime;
288 tDTime += (tPz/tE*tRLong);
290 tRLong += (tPz/tE*ttDTime);
296 mPos->setX(tROut*tPx-tRSide*tPy);
297 mPos->setY(tROut*tPy+tRSide*tPx);
311 mPos->setX(x*mSizeX1);
312 mPos->setY(y*mSizeY1);
313 mPos->setZ(z*mSizeZ1);
314 mPos->setT(t*mTime1);
319 mPos->setX(mXShift+x*mSizeX2);
320 mPos->setY(mYShift+y*mSizeY2);
321 mPos->setZ(mZShift+z*mSizeZ2);
322 mPos->setT(mTShift+t*mTime2);
328 mTDist1->Fill(mPos->t());
329 mPosDist1->Fill(mPos->x(),mPos->y(),mPos->z());
334 mTDist2->Fill(mPos->t());
335 mPosDist2->Fill(mPos->x(),mPos->y(),mPos->z());
341 void StHbtThPairDoubleGauss::BoostPosition(){
348 tBeta=(mMomentum1->pz()+mMomentum2->pz())/(mMomentum1->e()+mMomentum2->e());
349 tGamma=::sqrt(1/1-tBeta*tBeta);
351 mPos1.setT(tGamma*(tT-tBeta*mPos1.z()));
352 mPos1.setZ(tGamma*(tBeta*mPos1.z()-tBeta*tT));
354 mPos2.setT(tGamma*(tT-tBeta*mPos2.z()));
355 mPos2.setZ(tGamma*(mPos2.z()-tBeta*tT));
359 mPos1=mPos1.boost(tBoost);
360 mPos2=mPos2.boost(tBoost);
365 inline void StHbtThPairDoubleGauss::SetResolutionMult(
const double mult) {
369 inline void StHbtThPairDoubleGauss::SetMomentumShift(
const double shift)
374 inline void StHbtThPairDoubleGauss::UseSmearedHiddenInfo()
376 mHiddenInfoType = SMEAR;
379 inline void StHbtThPairDoubleGauss::UseShiftedHiddenInfo()
381 mHiddenInfoType = SHIFT;
384 inline void StHbtThPairDoubleGauss::UseEvtGenHiddenInfo()
386 mHiddenInfoType = EVTGEN;
389 inline void StHbtThPairDoubleGauss::SetSizes(
double aXYZ1,
double aT1,
double aXYZ2,
double aT2)
390 {mSizeX1=mSizeY1=mSizeZ1=aXYZ1; mTime1=aT1; mSizeX2=mSizeY2=mSizeZ2=aXYZ2; mTime2=aT2; }
391 inline void StHbtThPairDoubleGauss::SetSizes(
double aX1,
double aY1,
double aZ1,
double aT1,
double aX2,
double aY2,
double aZ2,
double aT2)
392 {mSizeX1=aX1; mSizeY1=aY1; mSizeZ1=aZ1; mTime1=aT1; mSizeX2=aX2; mSizeY2=aY2; mSizeZ2=aZ2; mTime2=aT2; }
393 inline void StHbtThPairDoubleGauss::SetSize1(
double aSize,
double aTime) {mSizeX1=aSize;mSizeY1=aSize;mSizeZ1=aSize;mTime1=aTime;};
394 inline void StHbtThPairDoubleGauss::SetSize1(
double aSizeX,
double aSizeY,
double aSizeZ,
double aTime)
395 {mSizeX1=aSizeX;mSizeY1=aSizeY;mSizeZ1=aSizeZ;mTime1=aTime;};
396 inline void StHbtThPairDoubleGauss::SetSize2(
double aSize,
double aTime) {mSizeX2=aSize;mSizeY2=aSize;mSizeZ2=aSize;mTime2=aTime;};
397 inline void StHbtThPairDoubleGauss::SetSize2(
double aSizeX,
double aSizeY,
double aSizeZ,
double aTime)
398 {mSizeX2=aSizeX;mSizeY2=aSizeY;mSizeZ2=aSizeZ;mTime2=aTime;};
400 inline void StHbtThPairDoubleGauss::UseHiddenMomentum(){mUseHidMom=1;};
401 inline void StHbtThPairDoubleGauss::UseParticleMomentum(){
409 inline void StHbtThPairDoubleGauss::UseHiddenPid() {
417 inline void StHbtThPairDoubleGauss::UseFixedPid(
int const tPid1,
double const tMass1,
int const tPid2,
double const tMass2) {
418 mUseHidPid=
false;mPid1=tPid1;mPid2=tPid2;mMassSq1=tMass1*tMass1;mMassSq2=tMass2*tMass2; };
419 inline void StHbtThPairDoubleGauss::UseFixedPid(
int const tPid1,
double const tMass1) {
420 mUseHidPid=
false;mPid1=tPid1;mPid2=tPid1;mMassSq1=tMass1*tMass1;mMassSq2=tMass1*tMass1; };
422 inline void StHbtThPairDoubleGauss::SetRCMS() {mRef=RCMSDG;};
423 inline void StHbtThPairDoubleGauss::SetLCMS(){mRef=LCMSDG;};
424 inline void StHbtThPairDoubleGauss::SetPRF(){mRef=PRFDG;};
426 inline void StHbtThPairDoubleGauss::SetBoostRCMS(
double aPlab,
double aMBeam,
double aMTarget){
427 double tEBeamLab=::sqrt(aPlab*aPlab+aMBeam*aMBeam);
428 mGammaRCMS=(tEBeamLab+aMTarget)/::sqrt(aMBeam*aMBeam+aMTarget*aMTarget+2*tEBeamLab*aMTarget);
429 mBetaRCMS=::sqrt(1.-1/(mGammaRCMS*mGammaRCMS));
432 inline void StHbtThPairDoubleGauss::SetFirstProb(
double aProb1) {
433 if (aProb1<0.0) mProb1 = 0.0;
434 else if (aProb1>1.0) mProb1 = 1.0;
435 else mProb1 = aProb1;
438 inline void StHbtThPairDoubleGauss::SetCoreHalo() { mCoreHalo=1; }
439 inline void StHbtThPairDoubleGauss::SetTwoSources() { mCoreHalo=0; }
440 inline void StHbtThPairDoubleGauss::SetRadialGaus() { mCoreHalo=2; }
441 inline void StHbtThPairDoubleGauss::SetPRFGaus() { mCoreHalo=3; }
442 inline void StHbtThPairDoubleGauss::SetPositionShift(
double aX,
double aY,
double aZ,
double aT)
450 void StHbtThPairDoubleGauss::Write()
456 mPosPtDist1->Write();
457 mPosPtDist2->Write();