StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
processMuDst.C
1 void processMuDst( //Char_t *jobId= "7121003.",
2  Char_t *jobId= "7129031.",
3  Char_t *dir="",
4  //Char_t *file="/star/data35/reco/productionPP/ReversedFullField/DEV/2004/117/st_physics_5117072_raw_*.MuDst.root",
5  //Char_t *file="/star/data54/reco/ppProductionTrans/FullField/P06ie/2006/129/7129031/st_physics_7129031_raw_1030003.MuDst.root",
6  Char_t *file="/star/data52/reco/ppProductionTrans/FullField/P06ie/2006/129/7129027/st_physics_adc_7129027_raw_1060001.MuDst.root",
7  Char_t *scratchDir ="/star/u/staszak/working/bemc/") {
8 
9  Int_t numberOfFilesInt = 1;
10 
11 
12  cout << "RUNNING job " << jobId << ": reading " << numberOfFilesInt << " and writing output to "
13  << scratchDir << " - dir: " << dir << " - file: " << file << endl;
14 
15  // load shared libraries
16  // first MuDst libs.
17  if (gClassTable->GetID("TTable") < 0) {
18  gSystem->Load("libStar");
19  gSystem->Load("libPhysics");
20  }
21  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
22  loadSharedLibraries();
23  // load db libraries
24  gSystem->Load("StarMagField");
25  gSystem->Load("StMagF");
26  gSystem->Load("StTpcDb");
27  gSystem->Load("StDbUtilities");
28  gSystem->Load("StDaqLib");
29  gSystem->Load("StDbLib");
30  gSystem->Load("StDbBroker");
31  gSystem->Load("St_db_Maker");
32  gSystem->Load("StEEmcDbMaker");
33  // load EMC libraries
34  gSystem->Load("StDaqLib");
35  gSystem->Load("StEmcRawMaker");
36  gSystem->Load("StEmcADCtoEMaker");
37  gSystem->Load("StPreEclMaker");
38  gSystem->Load("StEpcMaker");
39  // mc stuff since i use it in the library
40  gSystem->Load("StMcEvent");
41  gSystem->Load("StMcEventMaker");
42  gSystem->Load("StAssociationMaker");
43 
44  // load my analysis library
45  //gSystem->Load("StElectronInvMassAna");
46  gSystem->Load("StEmcPoolCSMStatusUtils");
47 
48  StChain *myChain = new StChain("myChain");
49  myChain->SetDebug(0);
51  StMuDstMaker *muDstMaker = new StMuDstMaker(0,0,dir,file,"",numberOfFilesInt,"MuDst");
52 
53  St_db_Maker *dbMaker = new St_db_Maker("StarDb","MySQL:StarDb");
54  StEmcADCtoEMaker *adc2EMaker = new StEmcADCtoEMaker();
55  adc2EMaker->setPrint(kFALSE);
56  adc2EMaker->saveAllStEvent(kTRUE);
57 
58  StEEmcDbMaker *eemcDbMaker = new StEEmcDbMaker("eemcDbMaker");
59 
60  StBemcStatusMaker* myBemcStatusMaker = new StBemcStatusMaker(muDstMaker);
61  myBemcStatusMaker->setOutputDirectory(scratchDir);
62  myBemcStatusMaker->setOutputFilePrefix(jobId);
63 
64  myChain->PrintInfo();
65 
66  if(myChain->Init() != 0) {
67  cerr << "Failure during Init()!" << endl;
68  }
69  Int_t iRet = 0;
70  Int_t runNumber = -1;
71  Int_t nEventsAna = 0;
72  while (iRet == 0) {
73  myChain->Clear();
74  // we can't use the chain->Make function here since we need to take
75  // care of StMuDstMaker
76  iRet = myChain->Make(nEventsAna);
77  if (iRet != 0) {
78  cout << "rteutrn valuer snons ZEROOOOOOOOOOOOOOOOOOOOOOOOOOOOO" << endl;
79 
80  break;
81  }
82  if (nEventsAna % 100 == 0) {
83  cout << "Analyzing event " << nEventsAna << endl;
84  }
85  nEventsAna++;
86  if (nEventsAna==20000) break;
87  }
88  cout << "Analysed " << nEventsAna << " events" << endl;
89  myChain->Finish();
90  delete myChain;
91 }
void setPrint(Bool_t)
Obsolete function; users can control messages with logger config file.
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
static void setLevel(unsigned int level)
sets the debug level
Definition: StMuDebug.h:74
virtual Int_t Finish()
Definition: StChain.cxx:85
virtual Int_t Make()
Definition: StChain.cxx:110
void saveAllStEvent(Bool_t a)
Set to kTRUE if all hits are to be saved on StEvent.