00001
00002 class StChain;
00003 StChain *chain=0;
00004
00005
00006 class Q3invCorrFctn;
00007 Q3invCorrFctn* Q3invCF;
00008
00009 void StHbtThreeParticleExample(Int_t nevents=1,
00010 const char *MainFile="/star/rcf/pwg/hbt/July2000/HalfFieldData_new2.microDst")
00011 {
00012
00013
00014 gSystem->Load("St_base");
00015 gSystem->Load("StChain");
00016 gSystem->Load("St_Tables");
00017 gSystem->Load("StUtilities");
00018 gSystem->Load("StAnalysisUtilities");
00019 gSystem->Load("StMagF");
00020 gSystem->Load("StIOMaker");
00021 gSystem->Load("StarClassLibrary");
00022 gSystem->Load("StEvent");
00023 gSystem->Load("StEventMaker");
00024 gSystem->Load("StHbtMaker");
00025
00026 cout << "Dynamic loading done" << endl;
00027
00028 chain = new StChain("StChain");
00029 chain->SetDebug();
00030
00031
00032
00033
00034 StHbtMaker* hbtMaker = new StHbtMaker("HBT","title");
00035 cout << "StHbtMaker instantiated"<<endl;
00036
00037
00038
00039
00040 cout << "StHbtMaker::Init - setting up Reader and Analyses..." << endl;
00041
00042 StHbtManager* TheManager = hbtMaker->HbtManager();
00043
00044
00045 StHbtBinaryReader* Reader = new StHbtBinaryReader;
00046 Reader->SetFileName(MainFile);
00047
00048
00049 TheManager->SetEventReader(Reader);
00050
00051 cout << "READER SET UP.... " << endl;
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 StHbtThreeParticleAnalysis* anal = new StHbtThreeParticleAnalysis;
00064
00065 mikesEventCut* evcut = new mikesEventCut;
00066 evcut->SetEventMult(0,10000);
00067 evcut->SetVertZPos(-35.0,35.0);
00068 anal->SetEventCut(evcut);
00069
00070 mikesTrackCut* trkcut = new mikesTrackCut;
00071 trkcut->SetNSigmaPion(-1.5,1.5);
00072 trkcut->SetNSigmaKaon(-1000.0,1000.0);
00073 trkcut->SetNSigmaProton(-1000.0,1000.0);
00074 trkcut->SetNHits(5,50);
00075 trkcut->SetPt(0.1,1.0);
00076 trkcut->SetRapidity(-10.0,10.0);
00077 trkcut->SetDCA(0.0,0.5);
00078 trkcut->SetCharge(-1);
00079 trkcut->SetMass(0.139);
00080 anal->SetFirstParticleCut(trkcut);
00081 anal->SetSecondParticleCut(trkcut);
00082 anal->SetThirdParticleCut(trkcut);
00083
00084 GenericTripletCut* tripletcut = new GenericTripletCut;
00085 anal->SetTripletCut(tripletcut);
00086
00087 anal->SetNumEventsToMix(2);
00088
00089
00090 Q3invCF = new Q3invCorrFctn("Q3invCF",100,0.0,1.0);
00091 anal->AddCorrFctn(Q3invCF);
00092
00093
00094
00095
00096 TheManager->AddAnalysis(anal);
00097
00098
00099
00100
00101
00102
00103
00104 if (chain->Init()){
00105 cout << "Initialization failed \n";
00106 goto TheEnd;
00107 }
00108 chain->PrintInfo();
00109
00110
00111
00112 int istat=0,iev=1;
00113 EventLoop: if (iev <= nevents && !istat) {
00114 cout << "StHbtExample -- Working on eventNumber " << iev << " of " << nevents << endl;
00115 chain->Clear();
00116 istat = chain->Make(iev);
00117 if (istat) {cout << "Last event processed. Status = " << istat << endl;}
00118 iev++; goto EventLoop;
00119 }
00120
00121
00122 cout << "StHbtExample -- Done with event loop" << endl;
00123
00124 chain->Finish();
00125 TheEnd:
00126 }