Logo ROOT  
Reference Guide
THbookFile.cxx
Go to the documentation of this file.
1 // @(#)root/hbook:$Id$
2 // Author: Rene Brun 18/02/2002
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 /** \class THbookFile
13  \ingroup Hist
14  This class is an interface to the Hbook objects in Hbook files.
15  Any Hbook object (1-D, 2-D, Profile, RWN or CWN can be read
16 
17  NB: a THbookFile can only be used in READ mode
18  Use the utility in $ROOTSYS/bin/h2root to convert Hbook to Root
19 
20  Example of use:
21 
22  gSystem->Load("libHbook");
23  THbookFile f("myfile.hbook");
24  f.ls();
25  TH1F *h1 = (TH1F*)f.Get(1); //import histogram ID=1 in h1
26  h1->Fit("gaus");
27  THbookTree *T = (THbookTree*)f.Get(111); //import ntuple header
28  T->Print(); //show the Hbook ntuple variables
29  T->Draw("x","y<0"); // as in normal TTree::Draw
30 
31  THbookFile can be browsed via TBrowser.
32 */
33 
34 #include <cstdlib>
35 #include <cstring>
36 #include <cctype>
37 
38 #include "TROOT.h"
39 #include "THbookFile.h"
40 #include "TH2.h"
41 #include "THbookTree.h"
42 #include "THbookBranch.h"
43 #include "THbookKey.h"
44 #include "TGraph.h"
45 #include "TProfile.h"
46 #include "TTreeFormula.h"
47 #include "TLeafI.h"
48 #include "TBrowser.h"
49 #include "TSystem.h"
50 #include "TMath.h"
51 #include "strlcpy.h"
52 #include "snprintf.h"
53 
54 // NOTE: THe following comments and declarations are a duplicate
55 // of those in main/src/h2root.cxx
56 
57 // Note that with gcc3.4 or above the size of PAWC_SIZE must be the same
58 // as in the Fortran definition in hbook.f and zebra
59 // Also, the arrays must be declared extern like on Windows
60 #define PAWC_SIZE 4000000
61 
62 // Define the names of the Fortran common blocks for the different OSs
63 
64 #ifndef WIN32
65 # define pawc pawc_
66 # define quest quest_
67 # define hcbits hcbits_
68 # define hcbook hcbook_
69 # define rzcl rzcl_
70 extern "C" int pawc[PAWC_SIZE];
71 extern "C" int quest[100];
72 extern "C" int hcbits[37];
73 extern "C" int hcbook[51];
74 extern "C" int rzcl[11];
75 #else
76 # define pawc PAWC
77 # define quest QUEST
78 # define hcbits HCBITS
79 # define hcbook HCBOOK
80 # define rzcl RZCL
81 extern "C" int pawc[PAWC_SIZE];
82 extern "C" int quest[100];
83 extern "C" int hcbits[37];
84 extern "C" int hcbook[51];
85 extern "C" int rzcl[11];
86 #endif
87 
88 int *iq, *lq;
89 float *q;
90 char idname[128];
92 char chtitl[128];
93 int ncx,ncy,nwt,idb;
96 const Int_t kNRH = 6;
97 const Int_t kMIN1 = 7;
98 const Int_t kMAX1 = 8;
99 
100 static Int_t gLastEntry = -1;
101 
102 // Define the names of the Fortran subroutine and functions for the different OSs
103 
104 #ifndef WIN32
105 # define hlimit hlimit_
106 # define hldir hldir_
107 # define hropen hropen_
108 # define hrend hrend_
109 # define hrin hrin_
110 # define hnoent hnoent_
111 # define hgive hgive_
112 # define hgiven hgiven_
113 # define hgnpar hgnpar_
114 # define hgnf hgnf_
115 # define hgnt hgnt_
116 # define hgntf hgntf_
117 # define hgnt1 hgnt1_
118 # define rzink rzink_
119 # define hdcofl hdcofl_
120 # define hmaxim hmaxim_
121 # define hminim hminim_
122 # define hdelet hdelet_
123 # define hntvar2 hntvar2_
124 # define hntvar3 hntvar3_
125 # define hbname hbname_
126 # define hbnamc hbnamc_
127 # define hbnam hbnam_
128 # define hi hi_
129 # define hie hie_
130 # define hif hif_
131 # define hij hij_
132 # define hix hix_
133 # define hijxy hijxy_
134 # define hije hije_
135 # define hcdir hcdir_
136 
137 # define type_of_call
138 # define DEFCHAR const char*
139 # define PASSCHAR(string) string
140 #else
141 # define hlimit HLIMIT
142 # define hldir HLDIR
143 # define hropen HROPEN
144 # define hrend HREND
145 # define hrin HRIN
146 # define hnoent HNOENT
147 # define hgive HGIVE
148 # define hgiven HGIVEN
149 # define hgnpar HGNPAR
150 # define hgnf HGNF
151 # define hgnt HGNT
152 # define hgntf HGNTF
153 # define hgnt1 HGNT1
154 # define rzink RZINK
155 # define hdcofl HDCOFL
156 # define hmaxim HMAXIM
157 # define hminim HMINIM
158 # define hdelet HDELET
159 # define hntvar2 HNTVAR2
160 # define hntvar3 HNTVAR3
161 # define hbname HBNAME
162 # define hbnamc HBNAMC
163 # define hbnam HBNAM
164 # define hi HI
165 # define hie HIE
166 # define hif HIF
167 # define hij HIJ
168 # define hix HIX
169 # define hijxy HIJXY
170 # define hije HIJE
171 # define hcdir HCDIR
172 # define type_of_call _stdcall
173 # define DEFCHAR const char*, const int
174 # define PASSCHAR(string) string, strlen(string)
175 #endif
176 
177 extern "C" void type_of_call hlimit(const int&);
178 #ifndef WIN32
179 extern "C" void type_of_call hropen(const int&,DEFCHAR,DEFCHAR,DEFCHAR,
180  const int&,const int&,const int,const int,const int);
181 extern "C" void type_of_call hrend(DEFCHAR,const int);
182 #else
183 extern "C" void type_of_call hropen(const int&,DEFCHAR,DEFCHAR,DEFCHAR,
184  const int&,const int&);
185 extern "C" void type_of_call hrend(DEFCHAR);
186 #endif
187 
188 extern "C" void type_of_call hrin(const int&,const int&,const int&);
189 extern "C" void type_of_call hnoent(const int&,const int&);
190 #ifndef WIN32
191 extern "C" void type_of_call hgive(const int&,DEFCHAR,const int&,const float&,const float&,
192  const int&,const float&,const float&,const int&,const int&,const int);
193 #else
194 extern "C" void type_of_call hgive(const int&,DEFCHAR,const int&,const float&,const float&,
195  const int&,const float&,const float&,const int&,const int&);
196 #endif
197 
198  //SUBROUTINE HGNT1(IDD,BLKNA1,VAR,IOFFST,NVAR,IDNEVT,IERROR)
199 #ifndef WIN32
200 extern "C" void type_of_call hgiven(const int&,DEFCHAR,const int&,DEFCHAR,
201  const float&,const float&,const int,const int);
202 extern "C" void type_of_call hgnt1(const int&,DEFCHAR,DEFCHAR,const int&,const int&,const int&,const int&,const int,const int);
203 #else
204 extern "C" void type_of_call hgiven(const int&,DEFCHAR,const int&,DEFCHAR,
205  const float&,const float&);
206 extern "C" void type_of_call hgnt1(const int&,DEFCHAR,DEFCHAR,const int&,const int&,const int&,const int&);
207 #endif
208 
209 #ifndef WIN32
210 extern "C" void type_of_call hntvar2(const int&,const int&,DEFCHAR,DEFCHAR,DEFCHAR,int&,int&,int&,int&,int&,const int,const int, const int);
211 extern "C" void type_of_call hntvar3(const int&,const int&,DEFCHAR, const int);
212 #else
213 extern "C" void type_of_call hntvar2(const int&,const int&,DEFCHAR,DEFCHAR,DEFCHAR,int&,int&,int&,int&,int&);
214 extern "C" void type_of_call hntvar3(const int&,const int&,DEFCHAR);
215 #endif
216 
217 #ifndef WIN32
218 extern "C" void type_of_call hbnam(const int&,DEFCHAR,const int&,DEFCHAR,const int&,const int, const int);
219 #else
220 extern "C" void type_of_call hbnam(const int&,DEFCHAR,const int&,DEFCHAR,const int&);
221 #endif
222 
223 extern "C" void type_of_call hgnpar(const int&,const char *,const int);
224 extern "C" void type_of_call hgnf(const int&,const int&,const float&,const int&);
225 extern "C" void type_of_call hgnt(const int&,const int&,const int&);
226 extern "C" void type_of_call hgntf(const int&,const int&,const int&);
227 extern "C" void type_of_call rzink(const int&,const int&,const char *,const int);
228 extern "C" void type_of_call hdcofl();
229 extern "C" void type_of_call hmaxim(const int&,const float&);
230 extern "C" void type_of_call hminim(const int&,const float&);
231 extern "C" void type_of_call hdelet(const int&);
232 extern "C" float type_of_call hi(const int&,const int&);
233 extern "C" float type_of_call hie(const int&,const int&);
234 extern "C" float type_of_call hif(const int&,const int&);
235 extern "C" float type_of_call hij(const int&,const int&,const int&);
236 extern "C" void type_of_call hix(const int&,const int&,const float&);
237 extern "C" void type_of_call hijxy(const int&,const int&,const int&,const float&,const float&);
238 extern "C" float type_of_call hije(const int&,const int&,const int&);
239 #ifndef WIN32
240 extern "C" void type_of_call hcdir(DEFCHAR,DEFCHAR ,const int,const int);
241 extern "C" void type_of_call hldir(DEFCHAR,DEFCHAR ,const int,const int);
242 #else
243 extern "C" void type_of_call hcdir(DEFCHAR,DEFCHAR);
244 extern "C" void type_of_call hldir(DEFCHAR,DEFCHAR);
245 #endif
246 
249 
251 
252 ////////////////////////////////////////////////////////////////////////////////
253 ///the constructor
254 
255 THbookFile::THbookFile() : TNamed(),fLun(0),fLrecl(0)
256 {
257  fList = new TList();
258  fKeys = new TList();
259 }
260 
261 ////////////////////////////////////////////////////////////////////////////////
262 /// Constructor for an HBook file object
263 
264 THbookFile::THbookFile(const char *fname, Int_t lrecl)
265  :TNamed(fname,"")
266 {
267  // Initialize the Hbook/Zebra store
268  Int_t i;
269  if (!fgPawInit) {
270  fgPawInit = kTRUE;
271  lq = &pawc[9];
272  iq = &pawc[17];
273  void *qq = iq;
274  q = (float*)qq;
275  int pawc_size = PAWC_SIZE;
276  hlimit(pawc_size);
277  fgLuns = new Int_t[10];
278  for (i=0;i<10;i++) fgLuns[i] = 0;
279  }
280 
281  //find a free logical unit (max 10)
282  fLun = 0;
283  for (i=0;i<10;i++) {
284  if (fgLuns[i] == 0) {
285  fLun = 10+i;
286  fgLuns[i] = 1;
287  break;
288  }
289  }
290  if (fLun == 0) {
291  Error("THbookFile","Too many HbookFiles\n");
292  return;
293  }
294  char topdir[20];
295  snprintf(topdir,19,"lun%d",fLun);
296 
297  Int_t ier = 0;
298 #ifndef WIN32
299  hropen(fLun,PASSCHAR(topdir),PASSCHAR(fname),PASSCHAR("p"),lrecl,ier,strlen(topdir),strlen(fname),1);
300 #else
301  hropen(fLun,PASSCHAR(topdir),PASSCHAR(fname),PASSCHAR("p"),lrecl,ier);
302 #endif
303  fLrecl = lrecl;
304  SetTitle(topdir);
305  snprintf(topdir,19,"//lun%d",fLun);
306  fCurDir = topdir;
307 
308  if (ier) printf (" Error on hropen was %d \n", ier);
309  if (quest[0]) {
310  printf("Error cannot open input file: %s\n",fname);
311  }
312  if (ier || quest[0]) {
313  fgLuns[fLun-10]=0;
314  fLun = 0;
315  fList = 0;
316  fKeys = 0;
317  MakeZombie();
318  return;
319  }
320 
321  gROOT->GetListOfBrowsables()->Add(this,fname);
322 
323  fList = new TList();
324  fKeys = new TList();
325  for (Int_t key=1;key<1000000;key++) {
326  int z0 = 0;
327  rzink(key,z0,"S",1);
328  if (quest[0]) break;
329  if (quest[13] & 8) continue;
330  Int_t id = quest[20];
331  THbookKey *akey = new THbookKey(id,this);
332  fKeys->Add(akey);
333  }
334 }
335 
336 ////////////////////////////////////////////////////////////////////////////////
337 ///destructor
338 
340 {
341  if (!fList) return;
342  Close();
343  delete fList;
344  delete fKeys;
345 }
346 
347 ////////////////////////////////////////////////////////////////////////////////
348 /// to be implemented
349 
351 {
352  if( b ) {
353  b->Add(fList, "memory");
354  b->Add(fKeys, "IDs on disk");
355  }
356  cd();
357 }
358 
359 ////////////////////////////////////////////////////////////////////////////////
360 /// change directory to dirname
361 
362 Bool_t THbookFile::cd(const char *dirname)
363 {
364  Int_t nch = strlen(dirname);
365  if (nch == 0) {
366 #ifndef WIN32
368 #else
370 #endif
371  return kTRUE;
372  }
373 
374  char cdir[512];
375  Int_t i;
376  for (i=0;i<512;i++) cdir[i] = ' ';
377  cdir[511] = 0;
378 #ifndef WIN32
379  hcdir(PASSCHAR(dirname),PASSCHAR(" "),nch,1);
380  hcdir(PASSCHAR(cdir),PASSCHAR("R"),511,1);
381 #else
382  hcdir(PASSCHAR(dirname),PASSCHAR(" "));
383  hcdir(PASSCHAR(cdir),PASSCHAR("R"));
384 #endif
385  for (i=510;i>=0;i--) {
386  if (cdir[i] != ' ') break;
387  cdir[i] = 0;
388  }
389  fCurDir = cdir;
390  printf("fCurdir=%s\n",fCurDir.Data());
391 
392  return kTRUE;
393 }
394 
395 ////////////////////////////////////////////////////////////////////////////////
396 /// Close the Hbook file
397 
399 {
400  if(!IsOpen()) return;
401  if (!fList) return;
402 
403  gROOT->GetListOfBrowsables()->Remove(this);
404 
405  cd();
406 
407  fList->Delete();
408  fKeys->Delete();
409  if (fgLuns) fgLuns[fLun-10] = 0;
410  hdelet(0);
411 #ifndef WIN32
412  hrend(PASSCHAR(GetTitle()),strlen(GetTitle()));
413 #else
414  hrend(PASSCHAR(GetTitle()));
415 #endif
416 }
417 
418 ////////////////////////////////////////////////////////////////////////////////
419 ///remove id from file and memory
420 
422 {
423  hdelet(id);
424 }
425 
426 ////////////////////////////////////////////////////////////////////////////////
427 /// return object with name in fList in memory
428 
430 {
431  return fList->FindObject(name);
432 }
433 
434 ////////////////////////////////////////////////////////////////////////////////
435 /// return object with pointer obj in fList in memory
436 
438 {
439  return fList->FindObject(obj);
440 }
441 
442 ////////////////////////////////////////////////////////////////////////////////
443 /// import Hbook object with identifier idd in memory
444 
446 {
447  Int_t id = 0;
448  for (Int_t key=1;key<1000000;key++) {
449  int z0 = 0;
450  rzink(key,z0,"S",1);
451  if (quest[0]) break;
452  if (quest[13] & 8) continue;
453  id = quest[20];
454  if (id == idd) break;
455  }
456  if (id == 0) return 0;
457  if (id != idd) {
458  printf("Error cannot find ID = %d\n",idd);
459  return 0;
460  }
461 
462  int i999 = 999;
463  // must delete any previous object with the same ID !!
464  lcdir = hcbook[6];
465  ltab = hcbook[9];
466  for (Int_t i=1;i<=iq[lcdir+kNRH];i++) {
467  if (iq[ltab+i] == id) {
468  printf("WARNING, previous ID=%d is replaced\n",id);
469  hdelet(id);
470  break;
471  }
472  }
473  hrin(id,i999,0);
474  if (quest[0]) {
475  printf("Error cannot read ID = %d\n",id);
476  return 0;
477  }
478  hdcofl();
479  lcid = hcbook[10];
480  lcont = lq[lcid-1];
481  TObject *obj = 0;
482  if (hcbits[3]) {
483  if (iq[lcid-2] == 2) obj = ConvertRWN(id);
484  else obj = ConvertCWN(id);
485  //hdelet(id); //cannot be deleted here since used in GetEntry
486  if (obj) {
487  fList->Add(obj);
488  ((THbookTree *)obj)->SetTitle(GetName());
489  }
490  return obj;
491  }
492  if (hcbits[0] && hcbits[7]) {
493  obj = ConvertProfile(id);
494  hdelet(id);
495  if (obj) fList->Add(obj);
496  return obj;
497  }
498  if (hcbits[0]) {
499  obj = Convert1D(id);
500  hdelet(id);
501  if (obj) fList->Add(obj);
502  return obj;
503  }
504  if (hcbits[1] || hcbits[2]) {
505  obj = Convert2D(id);
506  hdelet(id);
507  if (obj) fList->Add(obj);
508  return obj;
509  }
510  return obj;
511 }
512 
513 
514 ////////////////////////////////////////////////////////////////////////////////
515 /// Read in memory all columns of entry number of ntuple id from the Hbook file
516 
518 {
519  Int_t ier = 0;
520  if (atype == 0) {
521  hgnf(id,entry+1,x[0],ier);
522  } else {
523  hgnt(id,entry+1,ier);
524  }
525  return 0;
526 }
527 
528 ////////////////////////////////////////////////////////////////////////////////
529 /// Read in memory only the branch bname
530 
532 {
533  if (entry == gLastEntry) return 0;
534  gLastEntry = entry;
535  Int_t ier = 0;
536  //uses the fast read method using the Hbook tables computed in InitLeaves
537  hgntf(id,entry+1,ier);
538  //old alternative slow method
539 //#ifndef WIN32
540 // hgnt1(id,PASSCHAR(blockname),PASSCHAR(branchname),0,-1,entry+1,ier,strlen(blockname),strlen(branchname));
541 //#else
542 // hgnt1(id,PASSCHAR(blockname),PASSCHAR(branchname),0,-1,entry+1,ier);
543 //#endif
544  return 0;
545 }
546 
547 
548 ////////////////////////////////////////////////////////////////////////////////
549 /// This function is called from the first entry in TTreePlayer::InitLoop
550 /// It analyzes the list of variables involved in the current query
551 /// and pre-process the internal Hbook tables to speed-up the search
552 /// at the next entries.
553 
555 {
556  if (!formula) return;
557  Int_t ncodes = formula->GetNcodes();
558  for (Int_t i=1;i<=ncodes;i++) {
559  TLeaf *leaf = formula->GetLeaf(i-1);
560  if (!leaf) continue;
561  if (var == 5) {
562  //leafcount may be null in case of a fix size array
563  if (leaf->GetLeafCount()) leaf = leaf->GetLeafCount();
564  }
565  Int_t last = 0;
566  if (var == 1 && i == ncodes) last = 1;
567 #ifndef WIN32
568  hntvar3(id,last,PASSCHAR(leaf->GetName()),strlen(leaf->GetName()));
569 #else
570  hntvar3(id,last,PASSCHAR(leaf->GetName()));
571 #endif
572  }
573 }
574 
575 ////////////////////////////////////////////////////////////////////////////////
576 /// Returns kTRUE in case file is open and kFALSE if file is not open.
577 
579 {
580  return fLun == 0 ? kFALSE : kTRUE;
581 }
582 
583 
584 ////////////////////////////////////////////////////////////////////////////////
585 ///Set branch address
586 
587 void THbookFile::SetBranchAddress(Int_t id, const char *bname, void *add)
588 {
589  Int_t *iadd = (Int_t*)add;
590  Int_t &aadd = *iadd;
591 #ifndef WIN32
592  hbnam(id,PASSCHAR(bname),aadd,PASSCHAR("$SET"),0,strlen(bname),4);
593 #else
594  hbnam(id,PASSCHAR(bname),aadd,PASSCHAR("$SET"),0);
595 #endif
596 }
597 
598 ////////////////////////////////////////////////////////////////////////////////
599 /// Convert this Hbook file to a Root file with name rootname.
600 /// if rootname="', rootname = hbook file name with .root instead of .hbook
601 /// By default, the Root file is connected and returned
602 /// option:
603 /// - "NO" do not connect the Root file
604 /// - "C" do not compress file (default is to compress)
605 /// - "L" do not convert names to lower case (default is to convert)
606 
607 TFile *THbookFile::Convert2root(const char *rootname, Int_t /*lrecl*/,
608  Option_t *option)
609 {
610  TString opt = option;
611  opt.ToLower();
612 
613  Int_t nch = strlen(rootname);
614  char *rfile=0;
615  if (nch) {
616  rfile = new char[nch+1];
617  strlcpy(rfile,rootname,nch+1);
618  } else {
619  nch = strlen(GetName());
620  rfile = new char[nch+1];
621  strlcpy(rfile,GetName(),nch+1);
622  char *dot = strrchr(rfile,'.');
623  if (dot) strcpy(dot+1,"root");
624  else strlcat(rfile,".root",nch+1);
625  }
626 
627  nch = 2*nch+50;
628  char *cmd = new char[nch+1];
629  snprintf(cmd,nch,"h2root %s %s",GetName(),rfile);
630  if (opt.Contains("c")) strlcat (cmd," 0",nch+1);
631  if (opt.Contains("l")) strlcat (cmd," 0",nch+1);
632 
633  gSystem->Exec(cmd);
634 
635  delete [] cmd;
636  if (opt.Contains("no")) {delete [] rfile; return 0;}
637  TFile *f = new TFile(rfile);
638  delete [] rfile;
639  if (f->IsZombie()) {delete f; f = 0;}
640  return f;
641 }
642 
643 
644 ////////////////////////////////////////////////////////////////////////////////
645 /// Convert the Column-Wise-Ntuple id to a Root Tree
646 
648 {
649  const int nchar=9;
650  int nvar;
651  int i,j;
652  int nsub,itype,isize,ielem;
653  char *chtag_out;
654  float rmin[1000], rmax[1000];
655 
656  if (id > 0) snprintf(idname,127,"h%d",id);
657  else snprintf(idname,127,"h_%d",-id);
658  hnoent(id,nentries);
659  //printf(" Converting CWN with ID= %d, nentries = %d\n",id,nentries);
660  nvar=0;
661 #ifndef WIN32
662  hgiven(id,chtitl,nvar,PASSCHAR(""),rmin[0],rmax[0],80,0);
663 #else
664  hgiven(id,chtitl,80,nvar,PASSCHAR(""),rmin[0],rmax[0]);
665 #endif
666  chtag_out = new char[nvar*nchar+1];
667  Int_t *charflag = new Int_t[nvar];
668  Int_t *lenchar = new Int_t[nvar];
669  Int_t *boolflag = new Int_t[nvar];
670  Int_t *lenbool = new Int_t[nvar];
671  UChar_t *boolarr = new UChar_t[10000];
672 
673  chtag_out[nvar*nchar]=0;
674  for (i=0;i<80;i++)chtitl[i]=0;
675 #ifndef WIN32
676  hgiven(id,chtitl,nvar,chtag_out,rmin[0],rmax[0],80,nchar);
677 #else
678  hgiven(id,chtitl,80,nvar,chtag_out,nchar,rmin[0],rmax[0]);
679 #endif
680 
681  Int_t bufpos = 0;
682  Int_t isachar = 0;
683  Int_t isabool = 0;
684  char fullname[64];
685  char name[32];
686  char block[32];
687  char oldblock[32];
688  strlcpy(oldblock,"OLDBLOCK",32);
689  Int_t oldischar = -1;
690  for (i=80;i>0;i--) {if (chtitl[i] == ' ') chtitl[i] = 0; }
691  THbookTree *tree = new THbookTree(idname,id);
692  tree->SetHbookFile(this);
693  tree->SetType(1);
694 
695  char *bigbuf = tree->MakeX(500000);
696 
697 #ifndef WIN32
698  hbnam(id,PASSCHAR(" "),bigbuf[0],PASSCHAR("$CLEAR"),0,1,6);
699 #else
700  hbnam(id,PASSCHAR(" "),bigbuf[0],PASSCHAR("$CLEAR"),0);
701 #endif
702 
703  UInt_t varNumber = 0;
704  Int_t golower = 1;
705  Int_t nbits = 0;
706  for(i=0; i<nvar;i++) {
707  memset(name,' ',sizeof(name));
708  name[sizeof(name)-1] = 0;
709  memset(block,' ',sizeof(block));
710  block[sizeof(block)-1] = 0;
711  memset(fullname,' ',sizeof(fullname));
712  fullname[sizeof(fullname)-1]=0;
713 #ifndef WIN32
714  hntvar2(id,i+1,PASSCHAR(name),PASSCHAR(fullname),PASSCHAR(block),nsub,itype,isize,nbits,ielem,32,64,32);
715 #else
716  hntvar2(id,i+1,PASSCHAR(name),PASSCHAR(fullname),PASSCHAR(block),nsub,itype,isize,nbits,ielem);
717 #endif
718  TString hbookName = name;
719 
720  for (j=30;j>0;j--) {
721  if(golower) name[j] = tolower(name[j]);
722  if (name[j] == ' ') name[j] = 0;
723  }
724  if (golower == 2) name[0] = tolower(name[0]);
725 
726  for (j=62;j>0;j--) {
727  if(golower && fullname[j-1] != '[') fullname[j] = tolower(fullname[j]);
728  // convert also character after [, if golower == 2
729  if (golower == 2) fullname[j] = tolower(fullname[j]);
730  if (fullname[j] == ' ') fullname[j] = 0;
731  }
732  // convert also first character, if golower == 2
733  if (golower == 2) fullname[0] = tolower(fullname[0]);
734  for (j=30;j>0;j--) {
735  if (block[j] == ' ') block[j] = 0;
736  else break;
737  }
738  if (itype == 1 && isize == 4) strlcat(fullname,"/F",64);
739  if (itype == 1 && isize == 8) strlcat(fullname,"/D",64);
740  if (itype == 2) strlcat(fullname,"/I",64);
741  if (itype == 3) strlcat(fullname,"/i",64);
742 // if (itype == 4) strlcat(fullname,"/i",64);
743  if (itype == 4) strlcat(fullname,"/b",64);
744  if (itype == 5) strlcat(fullname,"/C",64);
745 //printf("Creating branch:%s, block:%s, fullname:%s, nsub=%d, itype=%d, isize=%d, ielem=%d, bufpos=%d\n",name,block,fullname,nsub,itype,isize,ielem,bufpos);
746  Int_t ischar;
747  if (itype == 5) ischar = 1;
748  else ischar = 0;
749 
750  if (ischar != oldischar || strcmp(oldblock,block) != 0) {
751  varNumber = 0;
752  strlcpy(oldblock,block,32);
753  oldischar = ischar;
754  Long_t add= (Long_t)&bigbuf[bufpos];
755  Int_t lblock = strlen(block);
756 #ifndef WIN32
757  hbnam(id,PASSCHAR(block),add,PASSCHAR("$SET"),ischar,lblock,4);
758 #else
759  hbnam(id,PASSCHAR(block),add,PASSCHAR("$SET"),ischar);
760 #endif
761 
762  }
763 
764  Int_t bufsize = 8000;
765  THbookBranch *branch = new THbookBranch(tree,name,(void*)&bigbuf[bufpos],fullname,bufsize);
766  tree->GetListOfBranches()->Add(branch);
767  branch->SetBlockName(block);
768  branch->SetUniqueID(varNumber);
769  varNumber++;
770 
771  //NB: the information about isachar should be saved in the branch
772  // to be done
773  boolflag[i] = -10;
774  charflag[i] = 0;
775  if (itype == 4) {isabool++; boolflag[i] = bufpos; lenbool[i] = ielem;}
776  bufpos += isize*ielem;
777  if (ischar) {isachar++; charflag[i] = bufpos-1; lenchar[i] = isize*ielem;}
778  TObjArray *ll= branch->GetListOfLeaves();
779  TLeaf *leaf = (TLeaf*)ll->UncheckedAt(0);
780  if (!leaf) continue;
781  TLeafI *leafcount = (TLeafI*)leaf->GetLeafCount();
782  if (leafcount) {
783  if (leafcount->GetMaximum() <= 0) leafcount->SetMaximum(ielem);
784  }
785  }
786  tree->SetEntries(nentries);
787  delete [] charflag;
788  delete [] lenchar;
789  delete [] boolflag;
790  delete [] lenbool;
791  delete [] boolarr;
792  delete [] chtag_out;
793 
794  return tree;
795 }
796 
797 ////////////////////////////////////////////////////////////////////////////////
798 /// Convert the Row-Wise-Ntuple id to a Root Tree
799 
801 {
802  const int nchar=9;
803  int nvar;
804  int i,j;
805  char *chtag_out;
806  float rmin[1000], rmax[1000];
807 
808  if (id > 0) snprintf(idname,127,"h%d",id);
809  else snprintf(idname,127,"h_%d",-id);
810  hnoent(id,nentries);
811  //printf(" Converting RWN with ID= %d, nentries = %d\n",id,nentries);
812  nvar=0;
813 #ifndef WIN32
814  hgiven(id,chtitl,nvar,PASSCHAR(""),rmin[0],rmax[0],80,0);
815 #else
816  hgiven(id,chtitl,80,nvar,PASSCHAR(""),rmin[0],rmax[0]);
817 #endif
818 
819  chtag_out = new char[nvar*nchar+1];
820 
821  Int_t golower = 1;
822  chtag_out[nvar*nchar]=0;
823  for (i=0;i<80;i++)chtitl[i]=0;
824 #ifndef WIN32
825  hgiven(id,chtitl,nvar,chtag_out,rmin[0],rmax[0],80,nchar);
826 #else
827  hgiven(id,chtitl,80,nvar,chtag_out,nchar,rmin[0],rmax[0]);
828 #endif
829  hgnpar(id,"?",1);
830  char *name = chtag_out;
831  for (i=80;i>0;i--) {if (chtitl[i] == ' ') chtitl[i] = 0; }
832  THbookTree *tree = new THbookTree(idname,id);
833  tree->SetHbookFile(this);
834  tree->SetType(0);
835  Float_t *x = (Float_t*)tree->MakeX(nvar*4);
836 
837  Int_t first,last;
838  for(i=0; i<nvar;i++) {
839  name[nchar-1] = 0;
840  first = last = 0;
841  TString hbookName = name;
842  // suppress trailing blanks
843  for (j=nchar-2;j>0;j--) {
844  if(golower) name[j] = tolower(name[j]);
845  if (name[j] == ' ' && last == 0) name[j] = 0;
846  else last = j;
847  }
848  if (golower == 2) name[0] = tolower(name[0]);
849 
850  // suppress heading blanks
851  for (j=0;j<nchar;j++) {
852  if (name[j] != ' ') break;
853  first = j+1;
854  }
855  Int_t bufsize = 8000;
856  //tree->Branch(&name[first],&x[i],&name[first],bufsize);
857  THbookBranch *branch = new THbookBranch(tree,&name[first],&x[4*i],&name[first],bufsize);
858  branch->SetAddress(&x[i]);
859  branch->SetBlockName(hbookName.Data());
860  tree->GetListOfBranches()->Add(branch);
861  name += nchar;
862  }
863  tree->SetEntries(nentries);
864  delete [] chtag_out;
865 
866  return tree;
867 }
868 
869 ////////////////////////////////////////////////////////////////////////////////
870 /// Convert an Hbook profile histogram into a Root TProfile
871 ///
872 /// the following structure is used in Hbook
873 /// lcid points to the profile in array iq
874 /// lcont = lq(lcid-1)
875 /// lw = lq(lcont)
876 /// ln = lq(lw)
877 /// if option S jbyt(iq(lw),1,2) = 1
878 /// if option I jbyt(iq(lw),1,2) = 2
879 
881 {
882  if (id > 0) snprintf(idname,127,"h%d",id);
883  else snprintf(idname,127,"h_%d",-id);
884  hnoent(id,nentries);
885  Int_t lw = lq[lcont];
886  Int_t ln = lq[lw];
887 #ifndef WIN32
889 #else
891 #endif
892  Float_t offsetx = 0.5*(xmax-xmin)/ncx;
893  chtitl[4*nwt] = 0;
894  const char *option= " ";
895  if (iq[lw] == 1) option = "S";
896  if (iq[lw] == 2) option = "I";
897  TProfile *p = new TProfile(idname,chtitl,ncx,xmin,xmax,ymin,ymax,option);
898 
899  const Int_t kCON1 = 9;
900  Int_t i;
901  Float_t x = 0.0;
902  Float_t y = 0.5*(ymin+ymax);
903  for (i=1;i<=ncx;i++) {
904  Int_t n = Int_t(q[ln+i]);
905  hix(id,i,x);
906  for (Int_t j=0;j<n;j++) {
907  p->Fill(x+offsetx,y);
908  }
909  Float_t content = q[lcont+kCON1+i];
910  Float_t error = TMath::Sqrt(q[lw+i]);
911  p->SetBinContent(i,content);
912  p->SetBinError(i,error);
913  }
914  p->SetEntries(nentries);
915  return p;
916 }
917 
918 ////////////////////////////////////////////////////////////////////////////////
919 /// Convert an Hbook 1-d histogram into a Root TH1F
920 
922 {
923  if (id > 0) snprintf(idname,127,"h%d",id);
924  else snprintf(idname,127,"h_%d",-id);
925  hnoent(id,nentries);
926 #ifndef WIN32
928 #else
930 #endif
931  chtitl[4*nwt] = 0;
932  TH1F *h1;
933  Int_t i;
934  if (hcbits[5]) {
935  Int_t lbins = lq[lcid-2];
936  Double_t *xbins = new Double_t[ncx+1];
937  for (i=0;i<=ncx;i++) xbins[i] = q[lbins+i+1];
938  h1 = new TH1F(idname,chtitl,ncx,xbins);
939  delete [] xbins;
940  } else {
941  h1 = new TH1F(idname,chtitl,ncx,xmin,xmax);
942  }
943  if (hcbits[8]) h1->Sumw2();
944  TGraph *gr = 0;
945  if (hcbits[11]) {
946  gr = new TGraph(ncx);
948  }
949 
950  Float_t x;
951  for (i=0;i<=ncx+1;i++) {
952  x = h1->GetBinCenter(i);
953  h1->Fill(x,hi(id,i));
954  if (hcbits[8]) h1->SetBinError(i,hie(id,i));
955  if (gr && i>0 && i<=ncx) gr->SetPoint(i,x,hif(id,i));
956  }
957  Float_t yymin, yymax;
958  if (hcbits[19]) {
959  yymax = q[lcid+kMAX1];
960  h1->SetMaximum(yymax);
961  }
962  if (hcbits[20]) {
963  yymin = q[lcid+kMIN1];
964  h1->SetMinimum(yymin);
965  }
967  return h1;
968 }
969 
970 ////////////////////////////////////////////////////////////////////////////////
971 /// Convert an Hbook 2-d histogram into a Root TH2F
972 
974 {
975  if (id > 0) snprintf(idname,127,"h%d",id);
976  else snprintf(idname,127,"h_%d",-id);
977  hnoent(id,nentries);
978 #ifndef WIN32
980 #else
982 #endif
983  chtitl[4*nwt] = 0;
984  TH2F *h2 = new TH2F(idname,chtitl,ncx,xmin,xmax,ncy,ymin,ymax);
985  Float_t offsetx = 0.5*(xmax-xmin)/ncx;
986  Float_t offsety = 0.5*(ymax-ymin)/ncy;
987  Int_t lw = lq[lcont];
988  if (lw) h2->Sumw2();
989 
990  Float_t x = 0.0, y = 0.0;
991  for (Int_t j=0;j<=ncy+1;j++) {
992  for (Int_t i=0;i<=ncx+1;i++) {
993  hijxy(id,i,j,x,y);
994  h2->Fill(x+offsetx,y+offsety,hij(id,i,j));
995  if (lw) {
996  Double_t err2 = hije(id,i,j);
997  h2->SetBinError(i,j,err2);
998  }
999  }
1000  }
1001  h2->SetEntries(nentries);
1002  return h2;
1003 }
1004 
1005 ////////////////////////////////////////////////////////////////////////////////
1006 /// List contents of Hbook directory
1007 
1008 void THbookFile::ls(const char *path) const
1009 {
1010  Int_t nch = strlen(path);
1011  if (nch == 0) {
1012 #ifndef WIN32
1014 #else
1015  hldir(PASSCHAR(fCurDir.Data()),PASSCHAR("T"));
1016 #endif
1017  return;
1018  }
1019 
1020 #ifndef WIN32
1021  hldir(PASSCHAR(path),PASSCHAR("T"),strlen(path),1);
1022 #else
1023  hldir(PASSCHAR(path),PASSCHAR("T"));
1024 #endif
1025 }
n
const Int_t n
Definition: legend1.C:16
THbookFile::fgPawInit
static Bool_t fgPawInit
Definition: THbookFile.h:38
THbookBranch.h
first
Definition: first.py:1
THbookFile::DeleteID
void DeleteID(Int_t id)
remove id from file and memory
Definition: THbookFile.cxx:421
TBrowser
Definition: TBrowser.h:37
ymax
float ymax
Definition: THbookFile.cxx:95
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
hlimit
#define hlimit
Definition: THbookFile.cxx:105
hmaxim
#define hmaxim
Definition: THbookFile.cxx:120
THbookFile::FindObject
virtual TObject * FindObject(const char *name) const
return object with name in fList in memory
Definition: THbookFile.cxx:429
THbookFile::THbookFile
THbookFile()
the constructor
Definition: THbookFile.cxx:255
snprintf
#define snprintf
Definition: civetweb.c:1540
TObjArray
Definition: TObjArray.h:37
f
#define f(i)
Definition: RSha256.hxx:122
hie
#define hie
Definition: THbookFile.cxx:129
TH1::SetMinimum
virtual void SetMinimum(Double_t minimum=-1111)
Definition: TH1.h:396
THbookFile::GetEntryBranch
Int_t GetEntryBranch(Int_t entry, Int_t id)
Read in memory only the branch bname.
Definition: THbookFile.cxx:531
hntvar2
#define hntvar2
Definition: THbookFile.cxx:123
hgnpar
#define hgnpar
Definition: THbookFile.cxx:113
TH2F
2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:251
TList::FindObject
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:577
hminim
#define hminim
Definition: THbookFile.cxx:121
TList::Delete
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition: TList.cxx:469
TString::Data
const char * Data() const
Definition: TString.h:369
tree
Definition: tree.py:1
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
chtitl
char chtitl[128]
Definition: THbookFile.cxx:92
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:54
hgntf
#define hgntf
Definition: THbookFile.cxx:116
TGraph.h
xmax
float xmax
Definition: THbookFile.cxx:95
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
TLeafI::SetMaximum
virtual void SetMaximum(Int_t max)
Definition: TLeafI.h:63
hijxy
#define hijxy
Definition: THbookFile.cxx:133
TMath::Sqrt
Double_t Sqrt(Double_t x)
Definition: TMath.h:680
THbookFile::InitLeaves
void InitLeaves(Int_t id, Int_t var, TTreeFormula *formula)
This function is called from the first entry in TTreePlayer::InitLoop It analyzes the list of variabl...
Definition: THbookFile.cxx:554
TTreeFormula.h
Float_t
float Float_t
Definition: RtypesCore.h:57
THbookFile::SetBranchAddress
virtual void SetBranchAddress(Int_t id, const char *bname, void *add)
Set branch address.
Definition: THbookFile.cxx:587
Int_t
int Int_t
Definition: RtypesCore.h:45
THbookFile::fKeys
TList * fKeys
Definition: THbookFile.h:35
TBrowser.h
hif
#define hif
Definition: THbookFile.cxx:130
hcdir
#define hcdir
Definition: THbookFile.cxx:135
TString::Contains
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
TH1::SetBinContent
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
Definition: TH1.cxx:8677
x
Double_t x[n]
Definition: legend1.C:17
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
THbookTree
Definition: THbookTree.h:30
THbookFile::cd
virtual Bool_t cd(const char *dirname="")
change directory to dirname
Definition: THbookFile.cxx:362
nentries
int nentries
Definition: THbookFile.cxx:91
hgnt
#define hgnt
Definition: THbookFile.cxx:115
TH1::GetListOfFunctions
TList * GetListOfFunctions() const
Definition: TH1.h:240
THbookFile::ls
virtual void ls(const char *path="") const
List contents of Hbook directory.
Definition: THbookFile.cxx:1008
THbookBranch::SetAddress
virtual void SetAddress(void *addobj)
Set address of this branch See important remark in the header of THbookTree.
Definition: THbookBranch.cxx:75
hdelet
#define hdelet
Definition: THbookFile.cxx:122
TLeafI
Definition: TLeafI.h:27
TObjArray::UncheckedAt
TObject * UncheckedAt(Int_t i) const
Definition: TObjArray.h:90
TProfile.h
BatchHelpers::block
constexpr size_t block
Definition: BatchHelpers.h:29
TString
Definition: TString.h:136
THbookTree.h
type_of_call
#define type_of_call
Definition: THbookFile.cxx:137
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
ltab
int ltab
Definition: THbookFile.cxx:94
THbookFile::fgLuns
static Int_t * fgLuns
Definition: THbookFile.h:39
iq
int * iq
Definition: THbookFile.cxx:88
THbookFile::Convert1D
virtual TObject * Convert1D(Int_t id)
Convert an Hbook 1-d histogram into a Root TH1F.
Definition: THbookFile.cxx:921
b
#define b(i)
Definition: RSha256.hxx:118
hgive
#define hgive
Definition: THbookFile.cxx:111
THbookFile
Definition: THbookFile.h:29
h1
TH1F * h1
Definition: legend1.C:5
THbookFile::fCurDir
TString fCurDir
Definition: THbookFile.h:36
ncx
int ncx
Definition: THbookFile.cxx:93
bool
THbookFile.h
THbookKey
HBOOK Key.
Definition: THbookKey.h:26
q
float * q
Definition: THbookFile.cxx:89
hcbook
#define hcbook
Definition: THbookFile.cxx:68
THbookKey.h
TROOT.h
hrin
#define hrin
Definition: THbookFile.cxx:109
hldir
#define hldir
Definition: THbookFile.cxx:106
hropen
#define hropen
Definition: THbookFile.cxx:107
THbookFile::Convert2D
virtual TObject * Convert2D(Int_t id)
Convert an Hbook 2-d histogram into a Root TH2F.
Definition: THbookFile.cxx:973
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
kNRH
const Int_t kNRH
Definition: THbookFile.cxx:96
ncy
int ncy
Definition: THbookFile.cxx:93
TSystem.h
TTreeFormula::GetLeaf
virtual TLeaf * GetLeaf(Int_t n) const
Return leaf corresponding to serial number n.
Definition: TTreeFormula.cxx:4418
hgnf
#define hgnf
Definition: THbookFile.cxx:114
xmin
float xmin
Definition: THbookFile.cxx:95
hix
#define hix
Definition: THbookFile.cxx:132
TLeafI.h
TLeaf
Definition: TLeaf.h:57
gr
TGraphErrors * gr
Definition: legend1.C:25
TH1::SetEntries
virtual void SetEntries(Double_t n)
Definition: TH1.h:382
TLeaf::GetLeafCount
virtual TLeaf * GetLeafCount() const
If this leaf stores a variable-sized array or a multi-dimensional array whose last dimension has vari...
Definition: TLeaf.h:120
TNamed
Definition: TNamed.h:29
idb
int idb
Definition: THbookFile.cxx:93
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TProfile::Fill
Int_t Fill(const Double_t *v)
Definition: TProfile.h:54
TSystem::Exec
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:654
PASSCHAR
#define PASSCHAR(string)
Definition: THbookFile.cxx:139
pawc
#define pawc
Definition: THbookFile.cxx:65
TH1::GetBinCenter
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
Definition: TH1.cxx:8596
Long_t
long Long_t
Definition: RtypesCore.h:54
hnoent
#define hnoent
Definition: THbookFile.cxx:110
TH1::SetMaximum
virtual void SetMaximum(Double_t maximum=-1111)
Definition: TH1.h:395
hdcofl
#define hdcofl
Definition: THbookFile.cxx:119
THbookBranch
HBOOK Branch.
Definition: THbookBranch.h:26
TH1::Fill
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition: TH1.cxx:3274
TTreeFormula
Definition: TTreeFormula.h:58
TTreeFormula::GetNcodes
virtual Int_t GetNcodes() const
Definition: TTreeFormula.h:193
quest
#define quest
Definition: THbookFile.cxx:66
DEFCHAR
#define DEFCHAR
Definition: THbookFile.cxx:138
y
Double_t y[n]
Definition: legend1.C:17
THbookFile::fLun
Int_t fLun
Definition: THbookFile.h:32
TObject::MakeZombie
void MakeZombie()
Definition: TObject.h:49
TLeafI::GetMaximum
virtual Int_t GetMaximum() const
Definition: TLeafI.h:50
hgnt1
#define hgnt1
Definition: THbookFile.cxx:117
rzcl
#define rzcl
Definition: THbookFile.cxx:69
nwt
int nwt
Definition: THbookFile.cxx:93
TNamed::SetTitle
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
TH2.h
TFile
Definition: TFile.h:54
idname
char idname[128]
Definition: THbookFile.cxx:90
TGraph::SetPoint
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
Definition: TGraph.cxx:2269
TH2::Fill
Int_t Fill(Double_t)
Invalid Fill method.
Definition: TH2.cxx:294
unsigned int
THbookFile::IsOpen
virtual Bool_t IsOpen() const
Returns kTRUE in case file is open and kFALSE if file is not open.
Definition: THbookFile.cxx:578
ymin
float ymin
Definition: THbookFile.cxx:95
THbookFile::ConvertCWN
virtual TObject * ConvertCWN(Int_t id)
Convert the Column-Wise-Ntuple id to a Root Tree.
Definition: THbookFile.cxx:647
TProfile
Definition: TProfile.h:32
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
lq
int * lq
Definition: THbookFile.cxx:88
lcid
int lcid
Definition: THbookFile.cxx:94
THbookFile::ConvertProfile
virtual TObject * ConvertProfile(Int_t id)
Convert an Hbook profile histogram into a Root TProfile.
Definition: THbookFile.cxx:880
Double_t
double Double_t
Definition: RtypesCore.h:59
gLastEntry
static Int_t gLastEntry
Definition: THbookFile.cxx:100
TGraph
Definition: TGraph.h:41
THbookFile::ConvertRWN
virtual TObject * ConvertRWN(Int_t id)
Convert the Row-Wise-Ntuple id to a Root Tree.
Definition: THbookFile.cxx:800
TH1::SetBinError
virtual void SetBinError(Int_t bin, Double_t error)
Set the bin Error Note that this resets the bin eror option to be of Normal Type and for the non-empt...
Definition: TH1.cxx:8661
THbookFile::Convert2root
virtual TFile * Convert2root(const char *rootname="", Int_t lrecl=0, Option_t *option="")
Convert this Hbook file to a Root file with name rootname.
Definition: THbookFile.cxx:607
TH1F
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:572
hgiven
#define hgiven
Definition: THbookFile.cxx:112
UChar_t
unsigned char UChar_t
Definition: RtypesCore.h:38
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
THbookFile::Browse
virtual void Browse(TBrowser *b)
to be implemented
Definition: THbookFile.cxx:350
TH1::Sumw2
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
Definition: TH1.cxx:8475
TObject
Definition: TObject.h:37
hij
#define hij
Definition: THbookFile.cxx:131
lcdir
int lcdir
Definition: THbookFile.cxx:94
name
char name[80]
Definition: TGX11.cxx:110
hrend
#define hrend
Definition: THbookFile.cxx:108
THbookBranch::SetBlockName
void SetBlockName(const char *name)
Definition: THbookBranch.h:46
THbookFile::Get
TObject * Get(Int_t id)
import Hbook object with identifier idd in memory
Definition: THbookFile.cxx:445
hntvar3
#define hntvar3
Definition: THbookFile.cxx:124
THbookFile::Close
virtual void Close(Option_t *option="")
Close the Hbook file.
Definition: THbookFile.cxx:398
THbookFile::GetEntry
Int_t GetEntry(Int_t entry, Int_t id, Int_t atype, Float_t *x)
Read in memory all columns of entry number of ntuple id from the Hbook file.
Definition: THbookFile.cxx:517
THbookFile::~THbookFile
virtual ~THbookFile()
destructor
Definition: THbookFile.cxx:339
rzink
#define rzink
Definition: THbookFile.cxx:118
PAWC_SIZE
#define PAWC_SIZE
Definition: THbookFile.cxx:60
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:53
hi
#define hi
Definition: THbookFile.cxx:128
TString::ToLower
void ToLower()
Change string to lower-case.
Definition: TString.cxx:1125
TBranch::GetListOfLeaves
TObjArray * GetListOfLeaves()
Definition: TBranch.h:243
hije
#define hije
Definition: THbookFile.cxx:134
kMIN1
const Int_t kMIN1
Definition: THbookFile.cxx:97
hbnam
#define hbnam
Definition: THbookFile.cxx:127
THbookFile::fList
TList * fList
Definition: THbookFile.h:34
THbookFile::fLrecl
Int_t fLrecl
Definition: THbookFile.h:33
lcont
int lcont
Definition: THbookFile.cxx:94
TList
Definition: TList.h:44
hcbits
#define hcbits
Definition: THbookFile.cxx:67
kMAX1
const Int_t kMAX1
Definition: THbookFile.cxx:98
TMath.h
TObject::SetUniqueID
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
Definition: TObject.cxx:707
gROOT
#define gROOT
Definition: TROOT.h:406
int