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