8 void RunPythiaReader(
int nevents=10,
9 const char* jetInFile =
"processed/pds1214_23_5000evts.jet.root"
12 cout <<
"read jet file:\t"<<jetInFile<<endl;
14 string basename = firstHalf(jetInFile,
"/processed/",
".jet.root");
15 cout <<
"basename:\t"<<basename<<endl;
16 TString ofn = TString(
"./assoc/") + TString(basename) + TString(
".assoc.root");
17 const char* outfile = ofn.Data();
18 cout <<
"write assoc file:\t"<<outfile<<endl;
20 if (gClassTable->GetID(
"TTable") < 0) {
21 gSystem->Load(
"libStar");
22 gSystem->Load(
"libPhysics");
24 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
25 loadSharedLibraries();
26 gSystem->Load(
"StMagF");
27 gSystem->Load(
"StTpcDb");
28 gSystem->Load(
"StDbUtilities");
29 gSystem->Load(
"StMcEvent");
30 gSystem->Load(
"StMcEventMaker");
31 gSystem->Load(
"StDaqLib");
32 gSystem->Load(
"StEmcRawMaker");
33 gSystem->Load(
"StEmcADCtoEMaker");
34 gSystem->Load(
"StEmcUtil");
35 gSystem->Load(
"StDbLib");
36 gSystem->Load(
"StDbBroker");
37 gSystem->Load(
"St_db_Maker");
38 gSystem->Load(
"StEEmcUtil");
39 gSystem->Load(
"StEEmcDbMaker");
40 gSystem->Load(
"StJetFinder");
41 gSystem->Load(
"StJetMaker");
43 double pi = atan(1.0)*4.0;
44 cout <<
" loading done " << endl;
52 StPythiaAssociator* jetAssoc =
new StPythiaAssociator(
"JetAssoc", outfile, jetReader);
59 int ntotal = jetReader->
tree()->GetEntries();
63 for (Int_t iev=0;iev<nevents && iev<ntotal; iev++) {
64 cout <<
"****************************************** " << endl;
65 cout <<
"Working on eventNumber " << iev << endl;
66 cout <<
"*************************1***************** " << endl;
68 int iret = chain->
Make(iev);
71 cout <<
"Bad return code!" << endl;
77 cout <<
"****************************************** " << endl;
78 cout <<
"total number of events " << total << endl;
79 cout <<
"****************************************** " << endl;
82 string firstHalf(
string infile,
string begin,
string end,
int offset=0)
84 cout <<
"look for:\t"<<begin<<
"\tin:\t"<<infile<<endl;
85 unsigned int where1 = infile.find(begin);
86 cout <<
"look for:\t"<<end<<
"\tin:\t"<<infile<<endl;
87 unsigned int where2 = infile.find(end);
88 if (where2==infile.npos) {
92 int start=where1+begin.size()+offset;
95 cout <<
"error, mismatch.abort()"<<endl; abort();
99 for (
int i=start; i<stop; ++i) {
virtual void InitFile(const char *file)
Recover the TTree from file and prepare for reading.
virtual void Clear(Option_t *option="")
User defined functions.
TTree * tree() const
Access to the StJets tree.