30 FILE *fp = fopen(
Form(
"%scernstaff.dat",dir.
Data()),
"r");
38 if (hfile)
return hfile;
43 if (hfile)
return hfile;
49 printf(
"you must run the script in a directory with write access\n");
54 tree->Branch(
"Category",&Category,
"Category/I");
55 tree->Branch(
"Flag",&Flag,
"Flag/i");
56 tree->Branch(
"Age",&Age,
"Age/I");
57 tree->Branch(
"Service",&Service,
"Service/I");
58 tree->Branch(
"Children",&Children,
"Children/I");
59 tree->Branch(
"Grade",&Grade,
"Grade/I");
60 tree->Branch(
"Step",&Step,
"Step/I");
61 tree->Branch(
"Hrweek",&Hrweek,
"Hrweek/I");
62 tree->Branch(
"Cost",&Cost,
"Cost/I");
63 tree->Branch(
"Division",Division,
"Division/C");
64 tree->Branch(
"Nation",Nation,
"Nation/C");
66 while (fgets(
line,80,fp)) {
67 sscanf(&
line[0],
"%d %d %d %d %d %d %d %d %d %s %s",
68 &Category,&Flag,&Age,&Service,&Children,&Grade,&Step,&Hrweek,&Cost,Division,Nation);
71 if (print)
tree->Print();
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Append(const char *cs)
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
A TTree represents a columnar dataset.
void Step(const gsl_rng *r, void *xp, double step_size)