00001
00002
00003
00004
00005 class StChain;
00006 StChain *chain=0;
00007
00008
00009 class StHbtAnalysis;
00010 StHbtAnalysis* anal;
00011
00012
00013
00014 Int_t usePath = 0;
00015 Int_t nFile = 0;
00016 TString thePath;
00017 TString theFileName;
00018 TString originalPath;
00019
00020
00021
00022 void wait(int n=1) {
00023 for ( int i=0; i<n*1e6; i++) { }
00024 }
00025 void mess(const char* c="alive") {
00026 for ( int i=0; i<10; i++) { cout << c << endl; }
00027 }
00028
00029
00030 void StHbtExampleQQ(const Int_t nevents, const Char_t **fileList, const char*);
00031
00032
00033
00034
00035 void StHbtTagWriterTest(const Int_t nevents=9999, const Char_t *path, const Char_t *file)
00036 {
00037 const char *fileListQQ[]={0,0};
00038 if (path[0]=='-') {
00039 fileListQQ[0]=file;
00040 } else {
00041 fileListQQ[0] = gSystem->ConcatFileName(path,file);
00042 }
00043 StHbtExampleQQ(nevents,fileListQQ);
00044 }
00045
00046
00047 void StHbtExampleQQ(const Int_t nevents, const Char_t **fileList)
00048 {
00049
00050
00051 gSystem->Load("St_base");
00052 gSystem->Load("StChain");
00053 gSystem->Load("St_Tables");
00054 gSystem->Load("StMagF");
00055 gSystem->Load("StUtilities");
00056 gSystem->Load("StTreeMaker");
00057 gSystem->Load("StIOMaker");
00058 gSystem->Load("StarClassLibrary");
00059 gSystem->Load("StEvent");
00060 gSystem->Load("StEventMaker");
00061
00062 gSystem->Load("StHbtMaker");
00063
00064
00065 cout << " loading done " << endl;
00066
00067 chain = new StChain("StChain");
00068 chain->SetDebug();
00069
00070
00071 StFile *setFiles= new StFile();
00072 for (int ifil=0; fileList[ifil]; ifil++)
00073 setFiles->AddFile(fileList[ifil]);
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 StIOMaker* ioMaker = new StIOMaker("IO","r",setFiles,"bfcTree");
00084 ioMaker->SetDebug();
00085 ioMaker->SetIOMode("r");
00086 ioMaker->SetDebug();
00087 ioMaker->SetBranch("*",0,"r");
00088
00089
00090
00091 StEventMaker* eventMaker = new StEventMaker("events","title");
00092 cout << "Just instantiated StEventMaker... lets go StHbtMaker!" << endl;
00093
00094
00095
00096 StHbtMaker* hbtMaker = new StHbtMaker("HBT","title");
00097 cout << "StHbtMaker instantiated"<<endl;
00098 StHbtTagMaker* hbtTagMaker = new StHbtTagMaker("HBTTAG");
00099 hbtTagMaker->SetShowTags(1);
00100 cout << "StHbtTagMaker instantiated"<<endl;
00101
00102
00103 cout << "StHbtMaker::Init - setting up Reader and Analyses..." << endl;
00104 StHbtManager* TheManager = hbtMaker->HbtManager();
00105
00106
00107
00108
00109
00110
00111 StStandardHbtEventReader* Reader = new StStandardHbtEventReader;
00112 Reader->SetTheEventMaker(eventMaker);
00113 TheManager->SetEventReader(Reader);
00114 cout << "READER SET UP.... " << endl;
00115
00116
00117
00118 franksTrackCut* aTrackCut = new franksTrackCut;
00119 aTrackCut->SetNSigmaPion(-3.0,3.0);
00120 aTrackCut->SetNSigmaKaon(-1000.,1000.);
00121 aTrackCut->SetNSigmaProton(-1000.,1000.0);
00122 aTrackCut->SetNHits(10,50);
00123 aTrackCut->SetP(0.,0.8);
00124 aTrackCut->SetPt(0.,2.);
00125 aTrackCut->SetRapidity(-1.5,1.5);
00126 aTrackCut->SetDCA(0.0,2.);
00127 aTrackCut->SetCharge(+1);
00128 aTrackCut->SetMass(0.139);
00129
00130
00131
00132
00133
00134
00135 StHbtAnalysis* piPlusAnal = new StHbtAnalysis;
00136
00137 mikesEventCut* evcut = new mikesEventCut;
00138 evcut->SetEventMult(0,100000);
00139 evcut->SetVertZPos(-35.0,35.0);
00140 piPlusAnal->SetEventCut(evcut);
00141
00142 franksTrackCut* piPlusTrkcut = new franksTrackCut( *aTrackCut );
00143 piPlusAnal->SetFirstParticleCut(piPlusTrkcut);
00144 piPlusAnal->SetSecondParticleCut(piPlusTrkcut);
00145
00146 mikesPairCut* pairCut = new mikesPairCut;
00147 piPlusAnal->SetPairCut(pairCut);
00148
00149 piPlusAnal->SetNumEventsToMix(5);
00150
00151
00152
00153
00154 QinvEbyECorrFctn* QinvEbyECF = new QinvEbyECorrFctn("QinvEbyE",20,0.,.2);
00155 QinvEbyECF->SetTagMeans("positivePionsMeans");
00156 QinvEbyECF->SetTagSigmas("positivePionsSigmas");
00157 piPlusAnal->AddCorrFctn(QinvEbyECF);
00158
00159
00160 TheManager->AddAnalysis(piPlusAnal);
00161
00162
00163
00164
00165
00166 StHbtAnalysis* kaonPlusAnal = new StHbtAnalysis;
00167
00168 mikesEventCut* evcut = new mikesEventCut;
00169 evcut->SetEventMult(0,100000);
00170 evcut->SetVertZPos(-35.0,35.0);
00171 kaonPlusAnal->SetEventCut(evcut);
00172
00173 franksTrackCut* kaonPlusTrkcut = new franksTrackCut( *aTrackCut );
00174 kaonPlusTrkcut->SetNSigmaPion(3.0,1000.0);
00175 kaonPlusTrkcut->SetNSigmaKaon(-3.,3.);
00176 kaonPlusTrkcut->SetNSigmaProton(-1000.0,-3.0);
00177 kaonPlusTrkcut->SetMass(0.494);
00178 kaonPlusAnal->SetFirstParticleCut(kaonPlusTrkcut);
00179 kaonPlusAnal->SetSecondParticleCut(kaonPlusTrkcut);
00180
00181 mikesPairCut* pairCut = new mikesPairCut;
00182 kaonPlusAnal->SetPairCut(pairCut);
00183
00184 kaonPlusAnal->SetNumEventsToMix(5);
00185
00186
00187
00188
00189 QinvEbyECorrFctn* QinvEbyECFKaons = new QinvEbyECorrFctn("QinvEbyEKaons",20,0.,.2);
00190 QinvEbyECFKaons->SetTagMeans("positiveKaonsMeans");
00191 QinvEbyECFKaons->SetTagSigmas("positiveKaonsSigmas");
00192 kaonPlusAnal->AddCorrFctn(QinvEbyECFKaons);
00193
00194
00195 TheManager->AddAnalysis(kaonPlusAnal);
00196
00197
00198
00199
00200
00201 chain->Init();
00202 chain->PrintInfo();
00203
00204
00205 for (Int_t iev=0;iev<nevents; iev++) {
00206 cout << "StHbtExample -- Working on eventNumber " << iev << endl;
00207 chain->Clear();
00208 int iret = chain->Make(iev);
00209 if (iret) {
00210 cout << "Bad return code!" << endl;
00211 break;
00212 }
00213 }
00214 chain->Finish();
00215
00216 }
00217
00218
00219