00001 class StChain; 00002 StChain *chain=0; 00003 00004 // keep pointers to Correlation Functions global, so you can have access to them... 00005 class QinvCorrFctn; 00006 QinvCorrFctn* QinvCF; 00007 class QvecCorrFctn; 00008 QvecCorrFctn* QvecCF; 00009 class MinvCorrFctn; 00010 MinvCorrFctn* MinvCF; 00011 00012 void StHbtExample(Int_t nevents=1, 00013 const char *MainFile="/star/rcf/test/dev/tfs_Linux/Wed/year_1b/set0352_01_35evts.dst.xdf") 00014 // this is an OLD xdf file const char *MainFile="/disk00001/star/auau200/venus412/default/b0_3/year_1b/hadronic_on/tfs_4/set0353_01_35evts.dst.root") 00015 { 00016 00017 // Dynamically link needed shared libs 00018 gSystem->Load("StarRoot"); 00019 gSystem->Load("St_base"); 00020 gSystem->Load("St_base"); 00021 gSystem->Load("StChain"); 00022 gSystem->Load("St_Tables"); 00023 gSystem->Load("StMagF"); 00024 gSystem->Load("StUtilities"); // new addition 22jul99 00025 gSystem->Load("StTreeMaker"); 00026 gSystem->Load("StIOMaker"); 00027 gSystem->Load("StarClassLibrary"); 00028 gSystem->Load("xdf2root"); 00029 gSystem->Load("St_xdfin_Maker"); 00030 gSystem->Load("StEvent"); 00031 gSystem->Load("StEventMaker"); 00032 gSystem->Load("StMcEvent"); 00033 gSystem->Load("StMcEventMaker"); 00034 gSystem->Load("StAssociationMaker"); 00035 gSystem->Load("StMcAnalysisMaker"); 00036 gSystem->Load("StHbtMaker"); 00037 gSystem->Load("StStrangeMuDstMaker"); 00038 00039 00040 cout << "Dynamic loading done" << endl; 00041 00042 chain = new StChain("StChain"); 00043 chain->SetDebug(); 00044 00045 00046 StEventMaker* eventMaker = new StEventMaker("events","title"); 00047 cout << "Just instantiated StEventMaker... lets go StHbtMaker!" << endl; 00048 00049 // UNCOMMENT THIS NEXT PART OUT IF YOU WANT V0's 00050 //StV0MiniDstMaker* v0dst = new StV0MiniDstMaker("v0dst"); 00051 //cout << "Just instantiated StV0MiniDstMaker... lets go StHbt!" << endl; 00052 //v0dst.SetV0VertexType(); //Set v0MiniDstMaker to find v0s not Xis 00053 //v0dst.SetOutputFile("muv0dst.root"); // Set V0MiniDStMaker output file 00054 00055 00056 00057 StHbtMaker* hbtMaker = new StHbtMaker("HBT","title"); 00058 cout << "StHbtMaker instantiated"<<endl; 00059 00060 00061 00062 /* -------------- set up of hbt stuff ----- */ 00063 cout << "StHbtMaker::Init - setting up Reader and Analyses..." << endl; 00064 00065 StHbtManager* TheManager = hbtMaker->HbtManager(); 00066 00067 // here, we instantiate the appropriate StHbtEventReader 00068 // for STAR analyses in root4star, we instantiate StStandardHbtEventReader 00069 StHbtTTreeReader* Reader = new StHbtTTreeReader(0); 00070 00071 // UNCOMMENT THIS NEXT LINE OUT IF YOU WANT V0's 00072 // Reader->SetTheV0Maker(v0dst); //Gotta tell the reader where to read the v0 stuff from 00073 00074 // here would be the palce to plug in any "front-loaded" Event or Particle Cuts... 00075 TheManager->SetEventReader(Reader); 00076 00077 cout << "READER SET UP.... " << endl; 00078 00079 // Hey kids! Let's make a microDST! 00080 // in StHbt we do this by instantiating and plugging in a StHbtEventReader as a writer! 00081 // the particular StHbtEventReader that we will use will write (and read) ASCII files 00082 // 00083 // StHbtAsciiReader* Writer = new StHbtAsciiReader; 00084 // Writer->SetFileName("FirstMicroDst.asc"); 00085 // TheManager->SetEventWriter(Writer); 00086 // cout << "WRITER SET UP.... " << endl; 00087 00088 // 0) now define an analysis... 00089 StHbtAnalysis* anal = new StHbtAnalysis; 00090 // 1) set the Event cuts for the analysis 00091 mikesEventCut* evcut = new mikesEventCut; // use "mike's" event cut object 00092 evcut->SetEventMult(0,10000); // selected multiplicity range 00093 evcut->SetVertZPos(-35.0,35.0); // selected range of vertex z-position 00094 anal->SetEventCut(evcut); // this is the event cut object for this analsys 00095 // 2) set the Track (particle) cuts for the analysis 00096 mikesTrackCut* trkcut = new mikesTrackCut; // use "mike's" particle cut object 00097 trkcut->SetNSigmaPion(-1.5,1.5); // number of Sigma in TPC dEdx away from nominal pion dEdx 00098 trkcut->SetNSigmaKaon(-1000.0,1000.0); // number of Sigma in TPC dEdx away from nominal kaon dEdx 00099 trkcut->SetNSigmaProton(-1000.0,1000.0); // number of Sigma in TPC dEdx away from nominal proton dEdx 00100 trkcut->SetNHits(5,50); // range on number of TPC hits on the track 00101 trkcut->SetPt(0.1,1.0); // range in Pt 00102 trkcut->SetRapidity(-1.0,1.0); // range in rapidity 00103 trkcut->SetDCA(0.0,0.5); // range in Distance of Closest Approach to primary vertex 00104 trkcut->SetCharge(-1); // want negative pions 00105 trkcut->SetMass(0.139); // pion mass 00106 anal->SetFirstParticleCut(trkcut); // this is the track cut for the "first" particle 00107 anal->SetSecondParticleCut(trkcut); // NOTE - it is also for the "second" particle -- i.e. identical particle HBT 00108 // 3) set the Pair cuts for the analysis 00109 mikesPairCut* paircut = new mikesPairCut; // use "mike's" pair cut object 00110 anal->SetPairCut(paircut); // this is the pair cut for this analysis 00111 // 4) set the number of events to mix (per event) 00112 anal->SetNumEventsToMix(5); 00113 // 5) now set up the correlation functions that this analysis will make 00114 // this particular analysis will have two: the first is a Q-invariant correlation function 00115 QinvCF = new QinvCorrFctn("mikesQinvCF",50,0.0,0.2); // defines a Qinv correlation function 00116 anal->AddCorrFctn(QinvCF); // adds the just-defined correlation function to the analysis 00117 // for this analysis, we will also (simultaneously) build a Q-vector correlation function 00118 QvecCF = new QvecCorrFctn("randysQvecCF",50,0.0,0.2); 00119 anal->AddCorrFctn(QvecCF); // adds the just-defined correlation function to the analysis 00120 00121 // now add as many more correlation functions to the Analysis as you like.. 00122 00123 // 6) add the Analysis to the AnalysisCollection 00124 TheManager->AddAnalysis(anal); 00125 00126 // now, we define another analysis that runs simultaneously with the previous one. 00127 // this one looks at K+K- correlations (so NONidentical particles) in invariant mass 00128 00129 /* ****************************************** */ 00130 /* * franks phi analysis - by Frank Laue, OSU */ 00131 /* ****************************************** */ 00132 // 0) now define an analysis... 00133 StHbtAnalysis* phiAnal = new StHbtAnalysis; 00134 // 1) set the Event cuts for the analysis 00135 mikesEventCut* phiEvcut = new mikesEventCut; // use "mike's" event cut object 00136 phiEvcut->SetEventMult(0,10000); // selected multiplicity range 00137 phiEvcut->SetVertZPos(-35.0,35.0); // selected range of vertex z-position 00138 phiAnal->SetEventCut(phiEvcut); // this is the event cut object for this analsys 00139 // 2) set the Track (particle) cuts for the analysis 00140 mikesTrackCut* kaonTrkcut = new mikesTrackCut; // use "mike's" particle cut object 00141 kaonTrkcut->SetNSigmaPion(3,1000.0); // number of Sigma in TPC dEdx away from nominal pion dEdx 00142 kaonTrkcut->SetNSigmaKaon(-3.0,3.0); // number of Sigma in TPC dEdx away from nominal kaon dEdx 00143 kaonTrkcut->SetNSigmaProton(-1000.,-1.0); // number of Sigma in TPC dEdx away from nominal proton dEdx 00144 kaonTrkcut->SetNHits(0,50); // range on number of TPC hits on the track 00145 kaonTrkcut->SetPt(0.1,2.0); // range in Pt 00146 kaonTrkcut->SetRapidity(-2.0,2.0); // range in rapidity 00147 kaonTrkcut->SetDCA(0.0,0.5); // range in Distance of Closest Approach to primary vertex 00148 kaonTrkcut->SetCharge(+1); // want positive kaons 00149 kaonTrkcut->SetMass(0.494); // kaon mass 00150 phiAnal->SetFirstParticleCut(kaonTrkcut); // this is the track cut for the "first" particle 00151 mikesTrackCut* antikaonTrkcut = new mikesTrackCut; // use "mike's" particle cut object 00152 antikaonTrkcut->SetNSigmaPion(3.0,1000.0); // number of Sigma in TPC dEdx away from nominal pion dEdx 00153 antikaonTrkcut->SetNSigmaKaon(-3.0,3.0); // number of Sigma in TPC dEdx away from nominal kaon dEdx 00154 antikaonTrkcut->SetNSigmaProton(-1000.0,-1.0); // number of Sigma in TPC dEdx away from nominal proton dEdx 00155 antikaonTrkcut->SetNHits(0,50); // range on number of TPC hits on the track 00156 antikaonTrkcut->SetPt(0.1,2.0); // range in Pt 00157 antikaonTrkcut->SetRapidity(-2.0,2.0); // range in rapidity 00158 antikaonTrkcut->SetDCA(0.0,0.5); // range in Distance of Closest Approach to primary vertex 00159 antikaonTrkcut->SetCharge(-1); // want negative kaons 00160 antikaonTrkcut->SetMass(0.494); // kaon mass 00161 phiAnal->SetSecondParticleCut(antikaonTrkcut); // this is the track cut for the "second" particle 00162 // 3) set the Pair cuts for the analysis 00163 mikesPairCut* phiPaircut = new mikesPairCut; // use "mike's" pair cut object 00164 phiAnal->SetPairCut(phiPaircut); // this is the pair cut for this analysis 00165 // 4) set the number of events to mix (per event) 00166 phiAnal->SetNumEventsToMix(5); 00167 // 5) now set up the correlation functions that this analysis will make 00168 MinvCF = new MinvCorrFctn("franksMinvCF",100,0.98,1.18); // defines a Minv correlation function 00169 phiAnal->AddCorrFctn(MinvCF); // adds the just-defined correlation function to the analysis 00170 // now add as many more correlation functions to the Analysis as you like.. 00171 // 6) add the Analysis to the AnalysisCollection 00172 TheManager->AddAnalysis(phiAnal); 00173 00174 00175 00176 /* ------------------ end of setting up hbt stuff ------------------ */ 00177 00178 00179 // now execute the chain member functions 00180 00181 if (chain->Init()){ // This should call the Init() method in ALL makers 00182 cout << "Initialization failed \n"; 00183 goto TheEnd; 00184 } 00185 chain->PrintInfo(); 00186 00187 00188 // Event loop 00189 int istat=0,iev=1; 00190 EventLoop: if (iev <= nevents && !istat) { 00191 cout << "StHbtExample -- Working on eventNumber " << iev << " of " << nevents << endl; 00192 chain->Clear(); 00193 istat = chain->Make(iev); 00194 if (istat) {cout << "Last event processed. Status = " << istat << endl;} 00195 iev++; goto EventLoop; 00196 } 00197 00198 // good old Cint can't even handle a for-loop 00199 // for (Int_t iev=1;iev<=nevents; iev++) { 00200 // chain->Clear(); 00201 // int iret = chain->Make(iev); // This should call the Make() method in ALL makers 00202 // if (iret) { 00203 // cout << "StHbtExample.C -- chain returned nonzero value " << iret 00204 // << " on event " << iev << endl; 00205 // break; 00206 // } 00207 // } // Event Loop 00208 00209 00210 00211 cout << "StHbtExample -- Done with event loop" << endl; 00212 00213 chain->Finish(); // This should call the Finish() method in ALL makers 00214 TheEnd: 00215 }
1.5.9