00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "StHbtMaker/ThCorrFctn/StHbtFsiLednickyPurity.h"
00018 #include "StarCallf77.h"
00019 #include <Stsstream.h>
00020
00021
00022 #ifdef SOLARIS
00023 # ifndef false
00024 typedef int bool;
00025 #define false 0
00026 #define true 1
00027 # endif
00028 #endif
00029
00030
00031
00032 #define fsiin F77_NAME(fsiin,FSIIN)
00033 extern "C" {void type_of_call F77_NAME(fsiin,FSIIN)(const int &itest,const int &ich, const int &iqs, const int &isi,const int &i3c);}
00034 #define llini F77_NAME(llini,LLINI)
00035 extern "C" {void type_of_call F77_NAME(llini,LLINI)(const int &lll,const int &ns, const int &itest);}
00036
00037 #define fsinucl F77_NAME(fsinucl,FSINUCL)
00038 extern "C" {void type_of_call F77_NAME(fsinucl,FSINUCL)(const double &mn,const double &cn);}
00039 #define fsimomentum F77_NAME(fsimomentum,FSIMOMENTUM)
00040 extern "C" {void type_of_call F77_NAME(fsimomentum,FSIMOMENTUM)(double &p1,double &p2);}
00041 #define fsiposition F77_NAME(fsiposition,FSIPOSITION)
00042 extern "C" {void type_of_call F77_NAME(fsiposition,FSIPOSITION)(double &x1,double &x2);}
00043 #define fsiw F77_NAME(fsiw,FSIW)
00044 extern "C" {void type_of_call F77_NAME(fsiw,FSIW)(const int &i,double &weif,
00045 double &wei,double &wein);}
00046 #define ltran12 F77_NAME(ltran12,LTRAN12)
00047 extern "C" {void type_of_call ltran12_();}
00048
00049
00050 typedef float REAL;
00051 typedef struct { REAL re; REAL im; } COMPLEX;
00052 #define cgamma F77_NAME(cgamma,CGAMMA)
00053 extern "C" {COMPLEX type_of_call cgamma_(COMPLEX*);}
00054
00055 #ifdef __ROOT__
00056 ClassImp(StHbtFsiLednickyPurity)
00057 #endif
00058
00059 StHbtFsiLednickyPurity::StHbtFsiLednickyPurity() : StHbtFsiLednicky(),
00060 mPurity1(1.0), mPurity2(1.0)
00061 {
00062
00063 };
00064
00065
00066 double StHbtFsiLednickyPurity::GetWeight(const StHbtThPair* aThPair){
00067
00068 if (!SetPid(aThPair->GetPid1(),aThPair->GetPid2())) {
00069 mWeightDen=1.;
00070 return 1;
00071 } else {
00072
00073 if (aThPair->GetPid1() == aThPair->GetPid2()) {
00074 if (mRandom.Rndm() > mPurity1) {
00075 mWeightDen=1.;
00076 return 1;
00077 }
00078 }
00079 else if ((mRandom.Rndm() > mPurity1) || (mRandom.Rndm() > mPurity1)) {
00080 mWeightDen=1.;
00081 return 1;
00082 }
00083 const StHbtLorentzVector* p;
00084 p=(aThPair->GetRealMomentum1());
00085 double p1[]={p->px(),p->py(),p->pz()};
00086 p=(aThPair->GetRealMomentum2());
00087 double p2[]={p->px(),p->py(),p->pz()};
00088 if ((p1[0]==p2[0])&&(p1[1]==p2[1])&&(p1[2]==p2[2])) {
00089 mWeightDen=0.;
00090 return 0;
00091 }
00092 if (mSwap) {
00093 fsimomentum(*p2,*p1);
00094 } else {
00095 fsimomentum(*p1,*p2);
00096 }
00097 p=(aThPair->GetEmPoint1());
00098 double x1[]={p->x(),p->y(),p->z(),p->t()};
00099 p=(aThPair->GetEmPoint2());
00100 double x2[]={p->x(),p->y(),p->z(),p->t()};
00101 if ((x1[0]==x2[0])&&(x1[1]==x2[1])&&(x1[2]==x2[2])&&(x1[3]==x2[3])) {
00102 mWeightDen=0.;
00103 return 0;
00104 }
00105 if (mSwap) {
00106 fsiposition(*x1,*x2);
00107 } else {
00108 fsiposition(*x2,*x1);
00109 }
00110 FsiSetLL();
00111 ltran12();
00112 fsiw(1,mWeif,mWei,mWein);
00113 if (mI3c==0) return mWein;
00114 mWeightDen=mWeif;
00115 return mWei;
00116 };
00117 };
00118
00119 StHbtString StHbtFsiLednickyPurity::Report() {
00120 ostrstream tStr;
00121 tStr << "Lednicky afterburner calculation for Correlation - Report" << endl;
00122 tStr << " Setting : Quantum : " << ((mIqs) ? "On" : "Off");
00123 tStr << " - Coulbomb : " << ((mIch) ? "On" : "Off") ;
00124 tStr << " - Strong : " << ((mIsi) ? "On" : "Off");
00125 tStr << endl;
00126 tStr << " 3-Body : " << ((mI3c) ? "On" : "Off") ;
00127 if (mI3c) tStr << " Mass=" << mNuclMass << " - Charge= " << mNuclCharge ;
00128 tStr << endl;
00129 tStr << "First particle purity : " << mPurity1 << " second : " << mPurity2 << endl;
00130 tStr << " " << mNumProcessPair[0] << " Pairs have been Processed :" << endl;
00131 int i;
00132 for(i=1;i<=mLLMax;i++) {
00133 if (mNumProcessPair[i])
00134 tStr << " "<< setw(8) << mNumProcessPair[i] << " " << mLLName[i] << endl;
00135 }
00136 if (mNumbNonId)
00137 tStr << " "<< setw(8) << mNumbNonId << " Non Identified" << endl;
00138 StHbtString returnThis = tStr.str();
00139 return returnThis;
00140 }
00141
00142 StHbtFsiLednickyPurity::~StHbtFsiLednickyPurity()
00143 { };
00144
00145
00146 inline void StHbtFsiLednickyPurity::SetPurity(const double aPurity) { mPurity1=aPurity; mPurity2 = aPurity; }
00147 inline void StHbtFsiLednickyPurity::SetPurity(const double aPurity1, const double aPurity2) { mPurity1 = aPurity1; mPurity2 = aPurity2; }
00148
00149
00150
00151