30 FILE *fp = fopen(
Form(
"%scernstaff.dat", dir.
Data()),
"r");
51 printf(
"you must run the script in a directory with write access\n");
55 auto tree =
new TTree(
"T",
"CERN 1988 staff data");
56 tree->Branch(
"Category", &Category,
"Category/I");
57 tree->Branch(
"Flag", &Flag,
"Flag/i");
58 tree->Branch(
"Age", &Age,
"Age/I");
59 tree->Branch(
"Service", &Service,
"Service/I");
60 tree->Branch(
"Children", &Children,
"Children/I");
61 tree->Branch(
"Grade", &Grade,
"Grade/I");
62 tree->Branch(
"Step", &Step,
"Step/I");
63 tree->Branch(
"Hrweek", &Hrweek,
"Hrweek/I");
64 tree->Branch(
"Cost", &Cost,
"Cost/I");
65 tree->Branch(
"Division", Division,
"Division/C");
66 tree->Branch(
"Nation", Nation,
"Nation/C");
68 while (fgets(
line, 80, fp)) {
69 sscanf(&
line[0],
"%d %d %d %d %d %d %d %d %d %s %s",
70 &Category, &Flag, &Age, &Service, &Children, &Grade, &Step, &Hrweek, &Cost, Division, Nation);
int Int_t
Signed integer 4 bytes (int).
char Char_t
Character 1 byte (char).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
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.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Append(const char *cs)
A TTree represents a columnar dataset.
void Step(const gsl_rng *r, void *xp, double step_size)