StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rdTrg2Panitkin.C
1 int rdTrg2Panitkin(int nEve=1000000,
2  char* file="R7072002",
3  char *pathIn="//star/data05/scratch/balewski/2006-L2algo-events/2006-data/072/",
4  char *pathOut="./wrk/hist/"
5  ){
6 
7  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
8  loadSharedLibraries();
9  cout << " loading done " << endl;
10  // assert( !gSystem->Load("StEEmcPoolmuEztPanitkin")); // DEV version
11  assert( !gSystem->Load(".sl305_gcc323/obj/StRoot/StEEmcPool/muEztPanitkin/StEEmcPoolmuEztPanitkin.so")); // local version
12  assert( !gSystem->Load("StEEmcUtil"));
13  assert( !gSystem->Load("StEEmcPoolHanksTriggerDataReader"));
14 
15  // create chain
16  chain = new StChain("StChain");
17 
18  TString iFile=file; iFile+=".dat";
19  iFile=pathIn+iFile;
20 
21  trgRd = new StTriggerDataReader("TRGRD");
22  if (trgRd->OpenFile(iFile.Data())==kStErr){
23  printf("Error opening data file %s\n",file);
24  return(kStErr);
25  }else{
26  printf("Opening data file %s\n",iFile.Data());
27  }
28 
29  HList=new TObjArray;
30  myMk3=new StTrigOnlyPanitkinMaker("trig2Panitkin","MuDst");
31  myMk3->SetHList(HList);
32 
33  chain->Init();
34  chain->ls(3);
35 
36  int eventCounter=0;
37  int stat=0;
38  int t1=time(0);
39  StMuTimer timer;
40  timer.start();
41 
42  while ( 1) {// loop over events
43  if(eventCounter>=nEve) break;
44  eventCounter++;
45  chain->Clear();
46  stat = chain->Make();
47  if(stat) break;
48  if(eventCounter%2000!=0)continue;
49 
50  printf("\n\n ====================%d processing ==============\n", eventCounter);
51 
52  }
53 
54  printf("sorting done, nEve=%d \n",nEve);
55  int t2=time(0);
56  if(t1==t2) t2++;
57  float rate=1.*eventCounter/(t2-t1);
58  float nMnts=(t2-t1)/60.;
59  printf("sorting done nEve=%d , elapsed rate=%.1f Hz, tot %.1f minutes\n",eventCounter,rate,nMnts);
60 
61  if (eventCounter) {
62  cout << "CPU time/event= " << timer.elapsedTime()/eventCounter << " sec "
63  << " rate= " << eventCounter/timer.elapsedTime() << " Hz" << endl;
64  }
65 
66  TString hFile=file;
67  hFile=pathOut+hFile;
68  myMk3->saveHisto(hFile);
69  trgRd->CloseFile();
70  }
Definition: Stypes.h:44