00001 class StChain *chain;
00002 int total=0;
00003
00004 void RunMCAsym(
00005 const char *dir ="",
00006 const char* file="/star/data13/reco/pp200/pythia6_205/55_65gev/cdf_a/y2004y/gheisha_on/p05ih/rcf1271_10_4000evts.MuDst.root",
00007 const char *fname="/star/data13/reco/pp200/pythia6_205/55_65gev/cdf_a/y2004y/gheisha_on/p05ih/rcf1271_10_4000evts.geant.root",
00008 const char *filter = "",
00009 )
00010 {
00011 int nevents =100;
00012
00013 gROOT->Macro("loadMuDst.C");
00014 gSystem->Load("StMcEvent");
00015 gSystem->Load("StMcEventMaker");
00016 gSystem->Load("StEEmcUtil");
00017 gSystem->Load("StJetSkimEvent");
00018 gSystem->Load("StMCAsymMaker");
00019
00020 chain= new StChain("StChain");
00021 chain->SetDebug(1);
00022 gMessMgr->SwitchOff("D");
00023 gMessMgr->SwitchOff("I");
00024
00025 StIOMaker* ioMaker = new StIOMaker();
00026 ioMaker->SetFile(fname);
00027 ioMaker->SetIOMode("r");
00028 ioMaker->SetBranch("*",0,"0");
00029 ioMaker->SetBranch("geantBranch",0,"r");
00030
00031 StMuDebug::setLevel(1);
00032 StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,dir,file,filter,1e6,"MuDst");
00033 StMcEventMaker *mcEventMaker = new StMcEventMaker();
00034 StMCAsymMaker *weight = new StMCAsymMaker("MCAsym");
00035
00036 TChain* fileChain = muDstMaker->chain();
00037 int ntotal = fileChain->GetEntries();
00038
00039 for (Int_t iev=0;iev<nevents; iev++) {
00040 cout << "****************************************** " << endl;
00041 cout << "Working on eventNumber:\t" << iev <<"\tof:\t"<<ntotal<<endl;
00042 cout << "*************************1***************** " << endl;
00043 chain->Clear();
00044 int iret = chain->Make(iev);
00045
00046 StPythiaEvent *ev = weight->pythiaEvent();
00047 cout << "runId = " << ev->runId() << ", eventId = " << ev->eventId() << ", pid = " << ev->processId() << endl;
00048 cout << "vertexPos = (" << ev->vertex().X() << ", " << ev->vertex().Y() << ", " << ev->vertex().Z() << ")" << endl;
00049 cout << "GRSV STD A_LL = " << ev->ALL(StPythiaEvent::STD) << endl;
00050 cout << "incoming parton1 ID = " << ev->particle(0)->GetPdgCode() << endl;
00051 cout << "incoming parton2 status = " << ev->particle(1)->GetStatusCode() << endl;
00052 cout << "outgoing parton1 daughter1 = " << ev->particle(2)->GetDaughter(0) << endl;
00053
00054 total++;
00055 if (iret) {
00056 cout << "Bad return code!" << endl;
00057 break;
00058 }
00059 }
00060
00061 chain->Finish();
00062 cout << "****************************************** " << endl;
00063 cout << "total number of events " << total << endl;
00064 cout << "****************************************** " << endl;
00065 }
00066
00067
00068