15 TH1D globalPt(
"globalPt",
"globalPt",100,0.,3.);
16 TH1D primaryPt(
"primaryPt",
"primaryPt",100,0.,3.);
17 TH1D l3Pt(
"l3Pt",
"l3Pt",100,0.,3.);
19 TH2D etaLength(
"etaLength",
"etaLength",20,-1,+1,200,0.,200.);
22 void examplePt(
const char* dir=
"",
const char* file=
"/star/u/laue/afsWork/test.list",
const char* filter=
"st:MuDst.root",
const
23 char* outFile=
"test.root") {
24 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
25 loadSharedLibraries();
37 cout <<
"time to load chain: " << timer.elapsedTime() <<endl;
40 cout << maker->
chain()->GetEntries() <<
" events in chain" << endl;
41 TMemStat memStat(
"examplePt");
42 while ( !(iret=maker->
Make()) ) {
47 for (
int l=0; l<n; l++) globalPt.Fill( mu->
globalTracks(l)->pt() );
49 for (
int l=0; l<n; l++) primaryPt.Fill( mu->
primaryTracks(l)->pt() );
51 for (
int l=0; l<n; l++) l3Pt.Fill( mu->
l3Tracks(l)->pt() );
52 if (maker->
chain()->GetEntries()) cout <<
"event# " << counter <<
" " << counter++/maker->
chain()->GetEntries() <<
"%";
53 cout <<
" used= "<< memStat.Used();
54 cout <<
" size= "<< memStat.ProgSize();
59 if (counter) cout <<
"time/event " << timer.elapsedTime()/counter <<endl;
60 cout <<
" # of events:" << counter << endl;
63 primaryPt.Draw(
"same");
66 TFile f(outFile,
"RECREATE");
static TObjArray * globalTracks()
returns pointer to the global tracks list
StMuDstMaker(const char *name="MuDst")
Default constructor.
static void setLevel(unsigned int level)
sets the debug level
static TClonesArray * l3Tracks()
returns pointer to the l3Tracks list
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.