26 void runGammaTreeReader(
int nevents=-1,
27 const Char_t *fname =
"/auto/pdsfdv34/starspin/jwebb/2008/02-29-2008-gammas-with-preshower/7864/7136073/",
28 const Char_t *oname =
"testgammas.root" )
31 gROOT->LoadMacro(
"StRoot/StGammaMaker/macros/loadGammaLibs.C");
39 chainFiles(
"/auto/pdsfdv34/starspin/jwebb/2008/02-29-2008-gammas-with-preshower/7864/7136073/");
40 chainFiles(
"/auto/pdsfdv34/starspin/jwebb/2008/02-29-2008-gammas-with-preshower/7864/7136080/");
68 Int_t tryRuns[] = { 7136073, 7136073, 7136073, 7136080, 7136080, 7136080 };
69 Int_t tryEvents[] = { 2721, 3548, 25769, 81133, 81155, 81198 };
71 for ( Int_t ii=0;ii<
sizeof(tryRuns)/
sizeof(Int_t);ii++ )
74 if ( !reader->
getEvent( tryRuns[ii], tryEvents[ii] ) )
76 std::cout << Form(
"run %i event %i does not seem to exist",tryRuns[ii], tryEvents[ii]) << std::endl;
80 std::cout << Form(
"run %i event %i exists and is ready to be used ",tryRuns[ii], tryEvents[ii]) << std::endl;
96 void chainFiles(
const Char_t *path,
const Char_t *filt=
".root")
98 std::cout << std::endl;
99 std::cout <<
"*************************************************************************" << std::endl;
100 std::cout << std::endl;
101 std::cout <<
"Chaining: " << path << std::endl;
102 std::cout << std::endl;
103 std::cout <<
"*************************************************************************" << std::endl;
104 std::cout << std::endl;
105 TString pwd = gSystem->pwd();
106 TSystemDirectory dir(
"dir",path);
107 TIter next( dir.GetListOfFiles() );
110 while ( file = (TObject*)next() )
112 TString name=path;name+=file->GetName();
113 if ( name.Contains(filt) ) {
119 gSystem->cd(pwd.Data());
void chainFile(const Char_t *name, const Char_t *matches=".root")
Add a file to the list of files in the chain being processed.
Int_t getEvent(Long64_t entry)
Loads the specified entry in the chain. Access using event() defined above.