16 void exampleMuDstFilter(
const char* in=
"/star/u/laue/afsWork/dAu200.lis",
const char* out=
"test.MuDst.root") {
17 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
18 loadSharedLibraries();
28 dbReader->
addDb(
"dAu200.db");
30 maker =
new StMuDstMaker(0,0,
"",in,
"st_physics:MuDst.root",10000);
31 cout <<
"time to load chain: " << timer.elapsedTime() <<endl;
34 filter->setMuDstMaker(maker);
35 filter->setOutputFileName(out);
40 cout << maker->
chain()->GetEntries() <<
" events in chain" << endl;
41 TMemStat memStat(
"exampleMuDstFilter");
42 int iret = maker->
Make();
45 cout <<
" #" << counter;
46 cout <<
" used= "<< memStat.Used();
47 cout <<
" size= "<< memStat.ProgSize();
53 if (counter) cout <<
"time/event " << timer.elapsedTime()/counter <<endl;
54 cout <<
" # of events:" << counter << endl;
int addDb(const char *dbFile)
add entries in dbFile to internal data base ( mDb ), will call sortDb(), returns number of entries in...
static void setLevel(unsigned int level)
sets the debug level
int Make()
Filters the muDst and writes the filtered version.
StMuDstFilterMaker(const char *name="muDstFilter")
Default constructor; get pointer to StMuDstMaker.
int Finish()
Writes and closes the output file.
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
bool filter(T *t)
specialize this function to apply filters to the individual branches