8 void TestFilter(
const char* indir,
const char* infile,
const char* outfile)
10 if (gClassTable->GetID(
"TTable") < 0) gSystem->Load(
"libTable");
11 gSystem->Load(
"St_base");
12 gSystem->Load(
"StChain");
13 gSystem->Load(
"St_Tables");
14 gSystem->Load(
"StMagF");
15 gSystem->Load(
"StUtilities");
16 gSystem->Load(
"StTreeMaker");
17 gSystem->Load(
"StIOMaker");
18 gSystem->Load(
"StarClassLibrary");
19 gSystem->Load(
"StTpcDb");
20 gSystem->Load(
"StDbUtilities");
21 gSystem->Load(
"StEvent");
22 gSystem->Load(
"StEventUtilities");
23 gSystem->Load(
"StMcEvent");
24 gSystem->Load(
"StMcEventMaker");
25 gSystem->Load(
"StAssociationMaker");
26 gSystem->Load(
"StMcAnalysisMaker");
27 gSystem->Load(
"StStrangeMuDstMaker");
28 gSystem->Load(
"StMuDSTMaker");
29 gSystem->Load(
"JetFinder");
31 cout <<
" loading done " << endl;
36 cout <<
" --- Create StMuDstMaker --- "<<endl;
39 cout <<
" --- Set Cuts ---"<<endl;
43 cuts.pseudoRapidityCutOff = 1.5;
44 cuts.minNumberOfFitPoints = 22;
45 cuts.minNumberOfPoints = 25;
48 cout <<
" --- Create Filter ---"<<endl;
50 enum ioType {kWrite=0, kRead=1};
53 myFilter.setCuts(cuts);
55 cout <<
" --- Loop on events ---"<<endl;
63 for (
int iev=0; iev<nEvents && iret!=4; ++iev) {
65 cout <<
"iret:\t"<<iret<<endl;
67 myFilter->fill(maker);
70 TClonesArray* tracks = myFilter->event()->tracks();
71 cout <<
"------------ From Macro -------"<<endl;
72 int nTracks = tracks->GetLast()+1;
73 for (
int i=0; i<nTracks; ++i) {
75 cout <<
"momentum:\t"<<track->
p()<<endl;
81 int nEntries = myFilter->nEvents();
82 cout <<
"\n\n Wrote file:\t"<<outfile<<
"\twith number of entries:\t"<<nEntries<<endl;
90 cout <<
"tack int onto filename"<<endl;
91 char* newfile =
new char[1000];
92 sprintf(newfile,
"%s_has_%i_events",outfile,nEntries);
94 cout <<
"concat the unix command"<<endl;
95 char* command =
new char[2000];
96 sprintf(command,
"mv %s %s",outfile, newfile);
98 cout <<
"Get TUnixSystem"<<endl;
99 TUnixSystem* sys =
static_cast<TUnixSystem*
>(gSystem);
101 cout <<
"copy a file from:\t"<<outfile<<
"\t to:\t"<<newfile<<endl;
102 cout <<
"command is:\t"<<command<<endl;
static void setLevel(unsigned int level)
sets the debug level
const StThreeVectorF & p() const
Returns 3-momentum at dca to primary vertex.