00001
00002 #define USE_MICRODST
00003
00004
00005 void CorrectResolution(Int_t nevents=100)
00006 {
00007
00008
00009 gSystem->Load("St_base");
00010 gSystem->Load("StChain");
00011 gSystem->Load("St_Tables");
00012 gSystem->Load("StUtilities");
00013 gSystem->Load("StAnalysisUtilities");
00014 gSystem->Load("StMagF");
00015 gSystem->Load("StIOMaker");
00016 gSystem->Load("StarClassLibrary");
00017 gSystem->Load("StEvent");
00018 gSystem->Load("StEventMaker");
00019 gSystem->Load("StHbtMaker");
00020
00021 cout << "Dynamic loading done" << endl;
00022
00023 chain = new StChain("StChain");
00024 chain->SetDebug();
00025
00026
00027 #ifndef USE_MICRODST
00028
00029 StIOMaker* ioMaker = new StIOMaker("IO","r","/star/rcf/data07/reco/P00hg/2000/07/st_physics_*dst.root","bfcTree");
00030 ioMaker->SetDebug();
00031
00032 ioMaker->SetIOMode("r");
00033 ioMaker->SetDebug();
00034 ioMaker->SetBranch("*",0,"0");
00035 ioMaker->SetBranch("dstBranch",0,"r");
00036
00037
00038 StEventMaker* eventMaker = new StEventMaker("events","title");
00039 cout << "Just instantiated StEventMaker... lets go StHbtMaker!" << endl;
00040 #endif
00041
00042
00043
00044
00045
00046 StHbtMaker* hbtMaker = new StHbtMaker("HBT","title");
00047 cout << "StHbtMaker instantiated"<<endl;
00048
00049
00050
00051 cout << "StHbtMaker::Init - setting up Reader and Analyses..." << endl;
00052
00053 StHbtManager* TheManager = hbtMaker->HbtManager();
00054
00055
00056
00057
00058
00059
00060 #ifdef USE_MICRODST
00061 StHbtBinaryReader* Reader = new StHbtBinaryReader("-","microDst.lis");
00062 #else
00063 StStandardHbtEventReader* Reader = new StStandardHbtEventReader;
00064 Reader->SetTheEventMaker(eventMaker);
00065 #endif
00066
00067
00068
00069 TheManager->SetEventReader(Reader);
00070
00071
00072 StHbtVertexAnalysis* anal;
00073 mikesEventCut* FrontLoadedEvcut;
00074 mikesStarStandardEventCut* evcut;
00075 mikesTrackCut* trkcut;
00076 qualityPairCut* qpc;
00077 ManyPairCuts* MPC;
00078 EntranceSepPairCut* espc;
00079 StHbtCoulomb* cc;
00080
00081 QinvCorrFctn* QinvCF;
00082 BPLCMSFrame3DCorrFctn* BpLcmsCF;
00083 char* QinvCF_name;
00084 char* BP_name;
00085 int MultLo,MultHi;
00086 float pTLo,pTHi;
00087 int charge;
00088
00089
00090
00091 FrontLoadedEvcut = new mikesEventCut;
00092 FrontLoadedEvcut->SetEventMult(30,100000);
00093 FrontLoadedEvcut->SetVertZPos(-75.0,75.0);
00094 Reader->SetEventCut(FrontLoadedEvcut);
00095
00096
00097
00098 cout << "READER SET UP.... " << endl;
00099
00100
00101
00102
00103
00104
00105 QinvCF_name = "Qinvmm3hi";
00106 BP_name = "BPLCMSmm3hi";
00107 MultLo = 174;
00108 MultHi = 500;
00109 pTLo = 0.325;
00110 pTHi = 0.45;
00111 charge = -1;
00112
00113 anal = new StHbtVertexAnalysis(10,-75.0,75.0);
00114
00115 evcut = new mikesStarStandardEventCut;
00116 evcut->SetEventMult(MultLo,MultHi);
00117 evcut->SetVertZPos(-75.0,75.0);
00118 anal->SetEventCut(evcut);
00119
00120 trkcut = new mikesTrackCut;
00121 trkcut->SetNSigmaPion(-3.0,3.0);
00122 trkcut->SetNSigmaKaon(-1000.0,1000.0);
00123 trkcut->SetNSigmaProton(-1000.0,1000.0);
00124 trkcut->SetNHits(5,50);
00125 trkcut->SetPt(pTLo,pTHi);
00126 trkcut->SetRapidity(-0.5,0.5);
00127 trkcut->SetDCA(0.0,3.0);
00128 trkcut->SetCharge(charge);
00129 trkcut->SetMass(0.139);
00130 anal->SetFirstParticleCut(trkcut);
00131 anal->SetSecondParticleCut(trkcut);
00132
00133 MPC = new ManyPairCuts;
00134 qpc = new qualityPairCut;
00135 qpc->SetQualityCut(-0.5,0.6);
00136 MPC->AddPairCut(qpc);
00137 espc = new EntranceSepPairCut;
00138 espc->SetEntranceSepRange(2.5,2000.0);
00139 MPC->AddPairCut(espc);
00140 anal->SetPairCut(MPC);
00141
00142 anal->SetNumEventsToMix(10);
00143
00144
00145
00146 BpLcmsCF = new BPLCMSFrame3DCorrFctn(BP_name,40,0.0,0.2);
00147 cc = new StHbtCoulomb;
00148 cc->SetRadius(5.0);
00149 BpLcmsCF->SetCoulombCorrection(cc);
00150
00151
00152
00153 StHbtSmearPair* smear = new StHbtSmearPair;
00154 smear->SetFractionalPtRes(0.02);
00155 smear->SetPhiRes_a(0.00112);
00156 smear->SetPhiRes_b(0.000563);
00157 smear->SetPhiRes_alpha(-1.51);
00158 smear->SetThetaRes_a(0.00136);
00159 smear->SetThetaRes_b(0.000776);
00160 smear->SetThetaRes_alpha(-1.53);
00161 BpLcmsCF->SetSmearPair(smear);
00162
00163 BpLcmsCF->SetLambda(0.65);
00164 BpLcmsCF->SetRout(4.52);
00165 BpLcmsCF->SetRside(5.00);
00166 BpLcmsCF->SetRlong(5.43);
00167
00168
00169 anal->AddCorrFctn(BpLcmsCF);
00170
00171 TheManager->AddAnalysis(anal);
00172
00173
00174
00175
00176
00177
00178
00179
00180 if (chain->Init()){
00181 cout << "Initialization failed \n";
00182 goto TheEnd;
00183 }
00184 chain->PrintInfo();
00185
00186
00187
00188 int istat=0,iev=1;
00189 EventLoop: if (iev <= nevents && !istat) {
00190 cout << "StHbtExample -- Working on eventNumber " << iev << " of " << nevents << endl;
00191 chain->Clear();
00192 istat = chain->Make(iev);
00193 if (istat) {cout << "Last event processed. Status = " << istat << endl;}
00194 iev++; goto EventLoop;
00195 }
00196
00197
00198 cout << "StHbtExample -- Done with event loop" << endl;
00199
00200 chain->Finish();
00201
00202 TheEnd:
00203
00204 TFile histoOutput("ThreeDHBT.root","recreate");
00205
00206 for (int ia=0; ia<1; ia++){
00207 StHbtVertexAnalysis* Vanal = (StHbtVertexAnalysis*)(hbtMaker->HbtManager()->Analysis(ia));
00208
00209
00210
00211
00212 BPLCMSFrame3DCorrFctn* bpcf = (BPLCMSFrame3DCorrFctn*)(Vanal->CorrFctn(0));
00213 bpcf->Numerator()->Write();
00214 bpcf->Denominator()->Write();
00215 bpcf->Ratio()->Write();
00216
00217 bpcf->mIDNumHisto->Write();
00218 bpcf->mIDDenHisto->Write();
00219 bpcf->mIDRatHisto->Write();
00220 bpcf->mSMNumHisto->Write();
00221 bpcf->mSMDenHisto->Write();
00222 bpcf->mSMRatHisto->Write();
00223 bpcf->mCorrectionHisto->Write();
00224 bpcf->mCorrCFHisto->Write();
00225 }
00226
00227 histoOutput.Close();
00228
00229
00230 }
00231
00232
00233