StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuDstMaker.C
1 // NOTE - chain needs to be declared global so for StHbtEventReader
2 class StChain;
3 StChain *chain=0;
4 
5 void StHbtExampleQQ(const Int_t nevents, const Char_t **fileList, const Char_t*, const Char_t* );
6 
7 
8 //==========================================================================================
9 //==========================================================================================
10 void StMuDstMaker(const Int_t nevents=1000,
11  const Char_t *path="-",
12  // const Char_t *file="/star/data20/reco/productionCentral/ReversedFullField/P01gl/2001/303/st_physics_2303036_raw_0535.event.root",
13  const Char_t *file="/star/data48/reco/ppProduction2008/ReversedFullField/P08ic/2008/054/9054010/st_toftpx_9054010_raw_2400010.event.root",
14  const Char_t* outDir="./",
15  const Char_t* outFile="dummy",
16  const Char_t* appendix="test.microDst")
17 {
18 
19 
20  const char *fileListQQ[]={0,0};
21  if (path[0]=='-') {
22  fileListQQ[0]=file;
23  } else {
24  fileListQQ[0] = gSystem->ConcatFileName(path,file);
25  }
26  StHbtExampleQQ(nevents,fileListQQ,outDir,outFile);
27 }
28 
29 //==========================================================================================
30 //==========================================================================================
31 void StHbtExampleQQ(const Int_t nevents, const Char_t **fileList, const Char_t* dirName, const Char_t* fileName)
32 {
33  gROOT->Macro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
34 
35  // gSystem->Setenv("JPROF_FLAGS", "JP_START JP_PERIOD=0.001");
36  // gSystem->Load("/afs/rhic.bnl.gov/star/packages/DEV/.i386_redhat61/lib/libJprof");
37 
38  cout << " loading done " << endl;
39  chain = new StChain("StChain");
40  chain->SetDebug();
41 
42 
43  StFile *setFiles= new StFile();
44  for (int ifil=0; fileList[ifil]; ifil++)
45  setFiles->AddFile(fileList[ifil]);
46 
47 
48  // ********************************
49  // Now we add Makers to the chain...
50  // ********************************
51 
52  // *************
53  // file handling
54  // *************
55  StIOMaker* ioMaker = new StIOMaker("IOMaker","r",setFiles,"bfcTree");
56  ioMaker->SetDebug();
57 
58  ioMaker->SetIOMode("r");
59  ioMaker->SetDebug();
60  ioMaker->SetBranch("*",0,"0"); //deactivate all branches
61  ioMaker->SetBranch("eventBranch",0,"r"); //activate evt.root Branch
62  ioMaker->SetBranch("emcBranch",0,"r"); //activate evt.root Branch
63  ioMaker->SetBranch("runcoBranch",0,"r"); //activate evt.root Branch
64 
65  // ***********************
66  // the StStrangeMuDstMaker
67  // ***********************
68 
69  StStrangeMuDstMaker* v0dst = new StStrangeMuDstMaker("strangeMuDst");
70  v0dst->DoV0(); //Set v0MiniDstMaker to find only v0s
71  v0dst->DoXi(); //Set v0MiniDstMaker to find only v0s
72  v0dst->DoKink(); //Set v0MiniDstMaker to find only v0s
73  v0dst->SetNoKeep();
74  //v0dst->SetWrite("depp.root"); // Set V0muDStMaker output file and Event output file
75  // v0dst->SetWrite("StrangemuEventHBTPeriphdst.root","Strangemuv0HBTPeriphdst.root"); // Set V0muDStMaker output file and Event output file
76 
77 
78  // *********
79  // Hbt Maker
80  // *********
81 
82  StMuDstMaker* maker = new StMuDstMaker(1,1,dirName);
83  // maker->setSplit(500);
84  // maker->setBufferSize(4000);
85  // To use a different PID file than the default, uncomment and
86  // modify the above
87  // maker->setProbabilityPidFile("Path/PIDTable.root");
88  maker->setProbabilityPidFile();
89 
90  StMuL3Filter* l3Filter = new StMuL3Filter(); maker->setL3TrackFilter(l3Filter);
91  StMuFilter* filter = new StMuFilter(); maker->setTrackFilter(filter);
92  // filter->addEncodedMethod(32770);
93  // filter->addEncodedMethod(8,7);
95 
96  chain->Init(); // This should call the Init() method in ALL makers
97  chain->PrintInfo();
98  for (Int_t iev=0;iev<nevents; iev++) {
99  cout << "StExample -- Working on eventNumber " << iev << endl;
100  chain->Clear();
101  int iret = chain->Make(iev); // This should call the Make() method in ALL makers
102  if (iret) {
103  cout << "Bad return code!" << endl;
104  break;
105  }
106  } // Event Loop
107  chain->Finish(); // This should call the Finish() method in ALL makers
108 
109  cout << " End of Analysis " << endl;
110 }
111 
112 
113 
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
void setL3TrackFilter(StMuCut *c)
Set the track filter used for L3 tracks when creating muDsts from StEvent and writing to disk...
Definition: StMuDstMaker.h:429
virtual Int_t Finish()
Definition: StChain.cxx:85
void setTrackFilter(StMuCut *c)
Set the track filter used for all tracks (except the L3 tracks) when creating muDsts from StEvent and...
Definition: StMuDstMaker.h:428
virtual Int_t Make()
Definition: StChain.cxx:110