StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEztMaker.C
1 // NOTE - chain needs to be declared global so for StHbtEventReader
2 class StChain;
3 StChain *chain=0;
4 
5 
6 //=============================================================================
7 void StEztMaker(const Int_t nevents=100,
8  const Char_t *path="/star/data44/reco/ppMinBias/ReversedFullField/P04ij/2004/112/",
9  const Char_t *file="st_physics_5112018_raw_1020002.event.root",
10  const Char_t* outDir="./",
11  const Char_t* outFile="dummy",
12  const Char_t* appendix="test.microDst")
13 {
14 
15 
16  const char *fileListQQ[]={0,0};
17  if (path[0]=='-') {
18  fileListQQ[0]=file;
19  } else {
20  fileListQQ[0] = gSystem->ConcatFileName(path,file);
21  }
22  StEztMaker(nevents,fileListQQ,outDir,outFile);
23 }
24 
25 //=============================================================================
26 void StEztMaker(const Int_t nevents, const Char_t **fileList, const Char_t* dirName, const Char_t* fileName)
27 {
28  gROOT->Macro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
29 
30  chain = new StChain("StChain");
31  chain->SetDebug();
32 
33 
34  StFile *setFiles= new StFile();
35  for (int ifil=0; fileList[ifil]; ifil++)
36  setFiles->AddFile(fileList[ifil]);
37 
38 
39  // ********************************
40  // Now we add Makers to the chain...
41  // ********************************
42 
43  // *************
44  // file handling
45  // *************
46  StIOMaker* ioMaker = new StIOMaker("IOMaker","r",setFiles,"bfcTree");
47  ioMaker->SetDebug();
48 
49  ioMaker->SetIOMode("r");
50  ioMaker->SetDebug();
51  ioMaker->SetBranch("*",0,"0"); //deactivate all branches
52  ioMaker->SetBranch("eventBranch",0,"r"); //activate evt.root Branch
53  ioMaker->SetBranch("emcBranch",0,"r"); //activate evt.root Branch
54  ioMaker->SetBranch("runcoBranch",0,"r"); //activate evt.root Branch
55 
56  // need strange mudstmaker for mudst to work
57  StStrangeMuDstMaker* v0dst = new StStrangeMuDstMaker("strangeMuDst");
58  v0dst->DoV0(); //Set v0MiniDstMaker to find only v0s
59  v0dst->DoXi(); //Set v0MiniDstMaker to find only v0s
60  v0dst->DoKink(); //Set v0MiniDstMaker to find only v0s
61  v0dst->SetNoKeep();
62 
63  StMuDstMaker* maker = new StMuDstMaker(1,1,dirName);
64 
65  // To use a different PID file than the default, uncomment and
66  // modify the above
67  // maker->setProbabilityPidFile("Path/PIDTable.root");
68  maker->setProbabilityPidFile();
69 
70  maker->SetStatus("*",0);
71  maker->SetStatus("EztAll",1);
73 
74  chain->Init(); // This should call the Init() method in ALL makers
75  chain->PrintInfo();
76  for (Int_t iev=0;iev<nevents; iev++) {
77  cout << "StEztMaker -- Working on eventNumber " << iev << endl;
78  chain->Clear();
79  int iret = chain->Make(iev); // This should call the Make() method in ALL makers
80  if (iret) {
81  cout << "Bad return code!" << endl;
82  break;
83  }
84  } // Event Loop
85  chain->Finish(); // This should call the Finish() method in ALL makers
86 
87  cout << " End of Analysis " << endl;
88 }
89 
90 
91 
Definition: StTree.h:125
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
Definition: StIOInterFace.h:35
void setProbabilityPidFile(const char *file=NULL)
Set the file from where the PID probability tables should be read.
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 SetStatus(const char *arrType, int status)