StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rdEztPanitkin.C
1 TObjArray *HList;
3 MuEzPanitkinMaker *myMk3;
4 //pp200, 2005, EJP1=96294,
5 
6 int rdEztPanitkin( int trigID=0,//96294,
7  int nEve=100,
8  Int_t nFiles =20,
9  char* file="runList/R7101015.lis", //R6121034.lis,
10  char* inDir = "./"
11  ){
12 
13  //inDir="/star/data05/scratch/eemcdb/muDst/2005/048/";
14  // file="st_physics_6048024_raw_2010006.MuDst.root";
15  inDir=" myMuDst/";
16  file="st_physics_7166007_raw_1040002.MuDst.root";
17 
18  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
19  loadSharedLibraries();
20  cout << " loading done " << endl;
21  assert( !gSystem->Load("StEEmcPoolmuEztPanitkin"));
22  assert( !gSystem->Load("StEEmcUtil"));
23 
24  // libraries below are needed for DB interface
25  assert( !gSystem->Load("StDbBroker"));
26  assert( !gSystem->Load("St_db_Maker"));
27  assert( !gSystem->Load("StEEmcDbMaker"));
28 
29  // create chain
30  chain = new StChain("StChain");
31 
32  printf("adding muDst from '%s' ....\n",file);
33 
34  // Now we add Makers to the chain...
35  muMk = new StMuDstMaker(0,0,inDir,file,"MuDst.root",nFiles);
36  TChain* tree=muMk->chain(); assert(tree);
37  int nEntries=(int) tree->GetEntries();
38  printf("total eve in chain =%d\n",nEntries);
39  printf("in=%s%s=\n",inDir,file);
40  //return;
41 
42  St_db_Maker *stDb = new St_db_Maker("StarDb", "MySQL:StarDb");
43  stDb->SetFlavor("onlPed","eemcPMTped");
44 
45  new StEEmcDbMaker("EEmcDbMaker");
46 
47  HList=new TObjArray;
48  myMk3=new MuEzPanitkinMaker("myPanitkin","MuDst");
49  myMk3->SetHList(HList);
50  myMk3->SetTrigIdFilter(trigID);
51  //myMk3->SetTrigIdFilter(66300); //zeroB
52 
53  //if(trigID==66007)
54  // myMk3->SetHistoPixels();
55  // myMk3->SetSpy();
56 
57 
58 
59  {
60  // Endcap specific DSM params
61  int eemcDsmSetup[20]; // see StEemcTriggerSimu::initRun() for definition
62  memset(eemcDsmSetup, 0,sizeof(eemcDsmSetup));// clear all, may be a bad default
63  eemcDsmSetup[0]=3; // HTthr0
64  eemcDsmSetup[1]=12; // HTthr1
65  eemcDsmSetup[2]=22; // HTthr2
66  eemcDsmSetup[3]=1; // TPthr0
67  eemcDsmSetup[4]=17; // TPthr1
68  eemcDsmSetup[5]=31; // TPthr2
69  eemcDsmSetup[10]=2; //HTTPthrSelc, 2=use_thres_#1
70  // myMk3->SetDsmSetup(eemcDsmSetup);
71 }
72 
73 
74  gMessMgr->SwitchOff("D");
75  gMessMgr->SwitchOn("I");
76 
77  muMk->SetStatus("*",0);
78  muMk->SetStatus("EztAll",1);
79  muMk->SetStatus("MuEvent",1);
80  chain->Init();
81  chain->ls(3);
82  // muMk->printArrays();
83 
84  printf("All Ezt-branches set\n");
85  int eventCounter=0;
86  int stat=0;
87  int t1=time(0);
88  StMuTimer timer;
89  timer.start();
90 
91  //---------------------------------------------------
92  while ( 1) {// loop over events
93  if(eventCounter>=nEve) break;
94  eventCounter++;
95  chain->Clear();
96  stat = chain->Make();
97  if(stat) break;
98  if(eventCounter%200!=0)continue;
99 
100  printf("\n\n ====================%d processing ==============\n", eventCounter);
101 
102  }
103  printf("sorting done, nEve=%d of %d\n",nEve, nEntries);
104  int t2=time(0);
105  if(t1==t2) t2++;
106  float rate=1.*eventCounter/(t2-t1);
107  float nMnts=(t2-t1)/60.;
108  printf("sorting done %d of nEve=%d, elapsed rate=%.1f Hz, tot %.1f minutes\n",eventCounter,nEntries,rate,nMnts);
109 
110  if (eventCounter) {
111  cout << "CPU time/event= " << timer.elapsedTime()/eventCounter << " sec "
112  << " rate= " << eventCounter/timer.elapsedTime() << " Hz" << endl;
113  }
114 
115  myMk3->saveHisto("eemcQA");
116  // TString txt="R6035106-"; txt+=trigID; myMk3->saveHisto(txt);
117 
118 }
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
Definition: StMuDstMaker.h:426
void SetStatus(const char *arrType, int status)