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