00001 /*************************************************************************** 00002 * 00003 * $Id: QinvCorrFctnC.cxx,v 1.3 2000/03/20 16:42:48 laue Exp $ 00004 * 00005 * Author: Randy Wells, Ohio State, rcwells@mps.ohio-state.edu 00006 *************************************************************************** 00007 * 00008 * Description: part of STAR HBT Framework: StHbtMaker package 00009 * a simple Q-invariant correlation function with Coulomb correction 00010 * does HBT for pi- pi- 00011 * Can be changed -> double charge = -1.0 to do pi+ pi- HBT 00012 * 00013 *************************************************************************** 00014 * 00015 * $Log: QinvCorrFctnC.cxx,v $ 00016 * Revision 1.3 2000/03/20 16:42:48 laue 00017 * Bug fix by Randy 00018 * 00019 * Revision 1.2 2000/01/25 17:34:45 laue 00020 * I. In order to run the stand alone version of the StHbtMaker the following 00021 * changes have been done: 00022 * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements 00023 * b) unnecessary includes of StMaker.h have been removed 00024 * c) the subdirectory StHbtMaker/doc/Make has been created including everything 00025 * needed for the stand alone version 00026 * 00027 * II. To reduce the amount of compiler warning 00028 * a) some variables have been type casted 00029 * b) some destructors have been declared as virtual 00030 * 00031 * Revision 1.1 1999/09/23 23:28:01 lisa 00032 * add helensV0Cut AND rename mikes and franks ParticleCuts to TrackCuts AND update documentation 00033 * 00034 * Revision 1.3 1999/07/29 02:47:09 lisa 00035 * 1) add OpeningAngle correlation function 2) add StHbtMcEventReader 3) make histos in CorrFctns do errors correctly 00036 * 00037 * Revision 1.2 1999/07/06 22:33:20 lisa 00038 * Adjusted all to work in pro and new - dev itself is broken 00039 * 00040 * Revision 1.1.1.1 1999/06/29 16:02:57 lisa 00041 * Installation of StHbtMaker 00042 * 00043 **************************************************************************/ 00044 00045 #include "StHbtMaker/CorrFctn/QinvCorrFctnC.h" 00046 //#include "StHbtMaker/Infrastructure/StHbtHisto.hh" 00047 #include <cstdio> 00048 00049 #ifdef __ROOT__ 00050 ClassImp(QinvCorrFctnC) 00051 #endif 00052 00053 //____________________________ 00054 QinvCorrFctnC::QinvCorrFctnC(char* title, const int& nbins, const float& QinvLo, const float& QinvHi){ 00055 // set up numerator 00056 // title = "Num Qinv (MeV/c)"; 00057 char TitNum[100] = "Num"; 00058 strcat(TitNum,title); 00059 mNumerator = new StHbt1DHisto(TitNum,title,nbins,QinvLo,QinvHi); 00060 // set up denominator 00061 //title = "Den Qinv (MeV/c)"; 00062 char TitDen[100] = "Den"; 00063 strcat(TitDen,title); 00064 mDenominator = new StHbt1DHisto(TitDen,title,nbins,QinvLo,QinvHi); 00065 // set up ratio 00066 //title = "Ratio Qinv (MeV/c)"; 00067 char TitRat[100] = "Rat"; 00068 strcat(TitRat,title); 00069 mRatio = new StHbt1DHisto(TitRat,title,nbins,QinvLo,QinvHi); 00070 // this next bit is unfortunately needed so that we can have many histos of same "title" 00071 // it is neccessary if we typedef StHbt1DHisto to TH1d (which we do) 00072 //mNumerator->SetDirectory(0); 00073 //mDenominator->SetDirectory(0); 00074 //mRatio->SetDirectory(0); 00075 00076 // to enable error bar calculation... 00077 mNumerator->Sumw2(); 00078 mDenominator->Sumw2(); 00079 mRatio->Sumw2(); 00080 00081 } 00082 00083 //____________________________ 00084 QinvCorrFctnC::~QinvCorrFctnC(){ 00085 delete mNumerator; 00086 delete mDenominator; 00087 delete mRatio; 00088 } 00089 //_________________________ 00090 void QinvCorrFctnC::Finish(){ 00091 // here is where we should normalize, fit, etc... 00092 // we should NOT Draw() the histos (as I had done it below), 00093 // since we want to insulate ourselves from root at this level 00094 // of the code. Do it instead at root command line with browser. 00095 // mNumerator->Draw(); 00096 //mDenominator->Draw(); 00097 //mRatio->Draw(); 00098 double qInvTop = mNumerator->GetBinContent(50); 00099 double qInvBottom = mDenominator->GetBinContent(50); 00100 mRatio->Divide(mNumerator,mDenominator,qInvBottom,qInvTop); 00101 } 00102 00103 //____________________________ 00104 StHbtString QinvCorrFctnC::Report(){ 00105 string stemp = "Qinv Coulomb corrected Correlation Function Report:\n"; 00106 char ctemp[100]; 00107 sprintf(ctemp,"Number of entries in numerator:\t%E\n",mNumerator->GetEntries()); 00108 stemp += ctemp; 00109 sprintf(ctemp,"Number of entries in denominator:\t%E\n",mDenominator->GetEntries()); 00110 stemp += ctemp; 00111 sprintf(ctemp,"Number of entries in ratio:\t%E\n",mRatio->GetEntries()); 00112 stemp += ctemp; 00113 // stemp += mCoulombWeight->Report(); 00114 StHbtString returnThis = stemp; 00115 return returnThis; 00116 } 00117 //____________________________ 00118 void QinvCorrFctnC::AddRealPair(const StHbtPair* pair){ 00119 double Qinv = fabs(pair->qInv()); // note - qInv() will be negative for identical pairs... 00120 mNumerator->Fill(Qinv); 00121 // cout << "QinvCorrFctnC::AddRealPair : " << pair->qInv() << " " << Qinv << 00122 //" " << pair->track1().FourMomentum() << " " << pair->track2().FourMomentum() << endl; 00123 } 00124 //____________________________ 00125 void QinvCorrFctnC::AddMixedPair(const StHbtPair* pair){ 00126 double Qinv = fabs(pair->qInv()); // note - qInv() will be negative for identical pairs... 00127 // I call SetRadius(7.0) in my macro so don't need to use it here. 00128 // double weight = mCorrection.CoulombCorrect(pair,radius); 00129 double weight = mCorrection.CoulombCorrect(pair); 00130 mDenominator->Fill(Qinv,weight); 00131 } 00132 00133 void QinvCorrFctnC::AddCorrection(const StHbtCoulomb* coulomb) { 00134 mCorrection = *coulomb; 00135 } 00136 00137
1.5.9