00001 /*************************************************************************** 00002 * 00003 * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu 00004 *************************************************************************** 00005 * 00006 * Description: part of STAR HBT Framework: StHbtMaker package 00007 * a simple opening-angle correlation function used for studying 2-track cuts 00008 * 00009 *************************************************************************** 00010 * 00011 **************************************************************************/ 00012 00013 #include "StHbtMaker/CorrFctn/ExitSepCorrFctn.h" 00014 #include <cstdio> 00015 00016 #ifdef __ROOT__ 00017 ClassImp(ExitSepCorrFctn) 00018 #endif 00019 00020 // following function (found at bottom of this file) is obsolete - MALisa July2000 00021 // StHbtThreeVector FindExitPoint(const StPhysicalHelixD& pHelix); 00022 00023 //____________________________ 00024 ExitSepCorrFctn::ExitSepCorrFctn(char* title, const int& nbinsQ, const float& QLo, const float& QHi, 00025 const int& nbinsExSep, const float& ExSepLo, const float& ExSepHi){ 00026 // set up numeratorS 00027 char Tit[100]; 00028 sprintf(Tit,"2D Num"); 00029 strcat(Tit,title); 00030 mNumerator2D = new StHbt2DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsExSep,ExSepLo,ExSepHi); 00031 00032 // set up denominatorS 00033 sprintf(Tit,"2D Den"); 00034 strcat(Tit,title); 00035 mDenominator2D = new StHbt2DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsExSep,ExSepLo,ExSepHi); 00036 00037 // set up ratioS 00038 sprintf(Tit,"2D Rat"); 00039 strcat(Tit,title); 00040 mRatio2D = new StHbt2DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsExSep,ExSepLo,ExSepHi); 00041 00042 // these histograms should have errors associated with them... 00043 mNumerator2D->Sumw2(); 00044 mDenominator2D->Sumw2(); 00045 mRatio2D->Sumw2(); 00046 00047 } 00048 00049 //____________________________ 00050 ExitSepCorrFctn::~ExitSepCorrFctn(){ 00051 delete mNumerator2D; 00052 delete mDenominator2D; 00053 delete mRatio2D; 00054 } 00055 //_________________________ 00056 void ExitSepCorrFctn::Finish(){ 00057 mRatio2D->Divide(mNumerator2D,mDenominator2D,1.0,1.0); 00058 } 00059 00060 //____________________________ 00061 StHbtString ExitSepCorrFctn::Report(){ 00062 string stemp = "Exit Seperation Correlation Function Report:\n"; 00063 char ctemp[100]; 00064 sprintf(ctemp,"Number of entries in numerator:\t%E\n", 00065 mNumerator2D->GetEntries()); 00066 stemp += ctemp; 00067 sprintf(ctemp,"Number of entries in denominator:\t%E\n", 00068 mDenominator2D->GetEntries()); 00069 stemp += ctemp; 00070 StHbtString returnThis = stemp; 00071 return returnThis; 00072 } 00073 //____________________________ 00074 void ExitSepCorrFctn::AddRealPair(const StHbtPair* pair){ 00075 00076 // MALisa July2000 - take explicit calculation of exit points and exit separation out of this 00077 // class and put it into StHbtParticle and StHbtPair where they belong 00078 // StHbtThreeVector exitPt1 = FindExitPoint(pair->track1()->Helix()); 00079 // StHbtThreeVector exitPt2 = FindExitPoint(pair->track2()->Helix()); 00080 // StHbtThreeVector diff = exitPt1 - exitPt2; 00081 // double exitSep = diff.mag(); 00082 00083 double exitSep = pair->NominalTpcExitSeparation(); 00084 double Qinv = fabs(pair->qInv()); // note - qInv() will be negative for identical pairs... 00085 00086 mNumerator2D->Fill(Qinv,exitSep,1.0); 00087 } 00088 //____________________________ 00089 void ExitSepCorrFctn::AddMixedPair(const StHbtPair* pair){ 00090 00091 double exitSep = pair->NominalTpcExitSeparation(); 00092 double Qinv = fabs(pair->qInv()); // note - qInv() will be negative for identical pairs... 00093 00094 mDenominator2D->Fill(Qinv,exitSep,1.0); 00095 } 00096 00097 00098 // The following functionality has been moved to StHbtParticle (for exit point) 00099 // and StHbtPair (for exit separation). It is kept here (commented out) for reference 00100 //_______________ seperate function for calculating the exit point... 00101 // StHbtThreeVector FindExitPoint(const StPhysicalHelixD& pHelix){ 00102 // static StHbtThreeVector ZeroVec(0.,0.,0.); 00103 // double dip, curv, phase; 00104 // int h; 00105 // curv = pHelix.curvature(); 00106 // dip = pHelix.dipAngle(); 00107 // phase= pHelix.phase(); 00108 // h = pHelix.h(); 00109 // StHelixD hel(curv,dip,phase,ZeroVec,h); 00110 00111 // pairD candidates; 00112 // double sideLength; // this is how much length to go to leave through sides of TPC 00113 // double endLength; // this is how much length to go to leave through endcap of TPC 00114 // // figure out how far to go to leave through side... 00115 // candidates = hel.pathLength(200.0); // bugfix MAL jul00 - 200cm NOT 2cm 00116 // sideLength = (candidates.first > 0) ? candidates.first : candidates.second; 00117 00118 // static StHbtThreeVector WestEnd(0.,0.,200.); // bugfix MAL jul00 - 200cm NOT 2cm 00119 // static StHbtThreeVector EastEnd(0.,0.,-200.); // bugfix MAL jul00 - 200cm NOT 2cm 00120 // static StHbtThreeVector EndCapNormal(0.,0.,1.0); 00121 00122 // endLength = hel.pathLength(WestEnd,EndCapNormal); 00123 // if (endLength < 0.0) endLength = hel.pathLength(EastEnd,EndCapNormal); 00124 00125 // if (endLength < 0.0) cout << "FindExitPoint: Hey-- I cannot find an exit point out endcaps" << endl; 00126 00127 // // OK, firstExitLength will be the shortest way out of the detector... 00128 // double firstExitLength = (endLength < sideLength) ? endLength : sideLength; 00129 00130 // // now then, let's return the POSITION at which particle leaves TPC... 00131 // return hel.at(firstExitLength); 00132 // }
1.5.9