Geant4 Cross Reference |
1 // Copyright (C) 2010, Guy Barrand. All rights reserved. 2 // See the file tools.license for terms. 3 4 #ifndef tools_wroot_infos 5 #define tools_wroot_infos 6 7 #include "info" 8 9 namespace tools { 10 namespace wroot { 11 12 inline void scs(unsigned int& a_cs,const std::string& a_s) { 13 size_t l = a_s.size(); 14 for(size_t i=0;i<l;i++) a_cs = a_cs*3+a_s[i]; 15 } 16 17 inline void acs(unsigned int& a_cs,int a_n,int* a_dims) { 18 for(int i=0;i<a_n;i++) a_cs = a_cs*3+(unsigned int)a_dims[i]; 19 } 20 21 inline void fill_vec(obj_list<streamer_info>& a_infos,const std::string& a_type,streamer__info::Type a_si_type) { 22 unsigned int check = 196608; 23 streamer_info* info = new streamer_info(std::string("vector<")+a_type+">",4,check); 24 a_infos.push_back(info); 25 info->add(new streamer_STL("This","Used to call the proper TStreamerInfo case",0,a_si_type,std::string("vector<")+a_type+">")); 26 } 27 28 inline int size_VIRTUAL() {return 4;} 29 30 inline int size_TObject() {return 12;} 31 inline int size_TNamed() {return 28;} 32 33 inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out) { 34 35 // sizeof(TString) = 8 (4 (virtual ~) + 1 + 3 (align)) 36 // sizeof(TObject) = 12 37 // sizeof(TNamed) = 28 38 // sizeof(TObjArray) = 40 39 // sizeof(TArray) = 8 40 // sizeof(TArrayI) = 12 41 // sizeof(TArrayD) = 12 42 // sizeof(TArrayF) = 12 43 44 const int size_POINTER = 4; 45 //const int size_OBJECT_POINTER = 4; 46 //const int size_COUNTER = 4; 47 48 const int size_TArray = 8; 49 50 short TArray_version = 1; 51 52 short TObject_version = 1; 53 {unsigned int check = 0; 54 //this : 55 scs(check,"TObject"); 56 //members : 57 scs(check,"fUniqueID"); 58 scs(check,"UInt_t"); 59 60 scs(check,"fBits"); 61 scs(check,"UInt_t"); 62 63 streamer_info* info = new streamer_info("TObject",1,check); 64 a_infos.push_back(info); 65 // Elements : 66 int ofs = size_VIRTUAL(); 67 info->add(new streamer_uint(ofs,"fUniqueID","object unique identifier")); 68 info->add(new streamer_uint(ofs,"fBits","bit field status word")); 69 if(ofs!=size_TObject()) { 70 a_out << "tools::wroot::fill_infos :" 71 << " TObject " << ofs << " (" << size_TObject() << " expected.)" 72 << std::endl; 73 }} 74 75 short TNamed_version = 1; 76 {unsigned int check = 0; 77 //this : 78 scs(check,"TNamed"); 79 //base : 80 scs(check,"TObject"); 81 //members : 82 scs(check,"fName"); 83 scs(check,"TString"); 84 85 scs(check,"fTitle"); 86 scs(check,"TString"); 87 88 streamer_info* info = new streamer_info("TNamed",1,check); 89 a_infos.push_back(info); 90 // Elements : 91 int ofs = 0; 92 info->add(new streamer_base("TObject","Basic ROOT object",ofs,TObject_version));ofs += size_TObject(); 93 info->add(new streamer_string(ofs,"fName","object identifier")); 94 info->add(new streamer_string(ofs,"fTitle","object title")); 95 if(ofs!=size_TNamed()){ 96 a_out << "tools::wroot::fill_infos :" 97 << " TNamed " << ofs << " (" << size_TNamed() << " expected.)" 98 << std::endl; 99 }} 100 101 {unsigned int check = 0; 102 //this : 103 scs(check,"TStreamerInfo"); 104 //bases : 105 scs(check,"TNamed"); 106 //members : 107 scs(check,"fCheckSum"); 108 scs(check,"UInt_t"); 109 110 scs(check,"fClassVersion"); 111 scs(check,"Int_t"); 112 113 scs(check,"fElements"); 114 scs(check,"TObjArray*"); 115 116 streamer_info* info = new streamer_info("TStreamerInfo",2,check); 117 a_infos.push_back(info); 118 // Elements : 119 info->add(new streamer_base("TNamed","The basis for a named object (name, title)",0,TNamed_version));//28 120 info->add(new streamer_uint("fCheckSum","checksum of original class",28));//4 121 info->add(new streamer_int("fClassVersion","Class version identifier",32));//4 122 //40 = 2*int+4*int_p+2*ulong_p+bool+p (bool=4 !) 123 info->add(new streamer_object_pointer("fElements","Array of TStreamerElements",76,"TObjArray*"));//4 124 125 //80 126 } 127 128 short TStreamerElement_version = 2; 129 {unsigned int check = 0; 130 //this : 131 scs(check,"TStreamerElement"); 132 //bases : 133 scs(check,"TNamed"); 134 //members : 135 scs(check,"fType"); 136 scs(check,"Int_t"); 137 138 scs(check,"fSize"); 139 scs(check,"Int_t"); 140 141 scs(check,"fArrayLength"); 142 scs(check,"Int_t"); 143 144 scs(check,"fArrayDim"); 145 scs(check,"Int_t"); 146 147 scs(check,"fMaxIndex"); 148 scs(check,"Int_t"); 149 int dim = 5; 150 acs(check,1,&dim); 151 152 scs(check,"fTypeName"); 153 scs(check,"TString"); 154 //Should be : 2369818458U 155 156 streamer_info* info = new streamer_info("TStreamerElement",2,check); 157 a_infos.push_back(info); 158 // Elements : 159 info->add(new streamer_base("TNamed","The basis for a named object (name, title)",0,TNamed_version)); 160 info->add(new streamer_int("fType","element type",28)); 161 info->add(new streamer_int("fSize","sizeof element",32)); 162 info->add(new streamer_int("fArrayLength","cumulative size of all array dims",36)); 163 info->add(new streamer_int("fArrayDim","number of array dimensions",40)); 164 165 {streamer_element* elem = new streamer_int("fMaxIndex","Maximum array index for array dimension \"dim\"",44); 166 info->add(elem); 167 elem->setArrayDimension(1); 168 elem->setMaxIndex(0,5);} 169 170 info->add(new streamer_string("fTypeName","Data type name of data member",72));} 171 172 {unsigned int check = 0; 173 //this : 174 scs(check,"TStreamerBase"); 175 //bases : 176 scs(check,"TStreamerElement"); 177 //members : 178 scs(check,"fBaseVersion"); 179 scs(check,"Int_t"); 180 //Should be : 2671078514U 181 182 streamer_info* info = new streamer_info("TStreamerBase",3,check); 183 a_infos.push_back(info); 184 // Elements : 185 info->add(new streamer_base("TStreamerElement","base class for one element (data member) to be Streamed",0,TStreamerElement_version)); 186 info->add(new streamer_int("fBaseVersion","version number of the base class",88));} 187 188 {unsigned int check = 0; 189 //this : 190 scs(check,"TStreamerString"); 191 //bases : 192 scs(check,"TStreamerElement"); 193 //Should be : 2525579865U 194 195 streamer_info* info = new streamer_info("TStreamerString",2,check); 196 a_infos.push_back(info); 197 // Elements : 198 info->add(new streamer_base("TStreamerElement","base class for one element (data member) to be Streamed",0,TStreamerElement_version));} 199 200 {unsigned int check = 0; 201 //this : 202 scs(check,"TStreamerBasicType"); 203 //bases : 204 scs(check,"TStreamerElement"); 205 //Should be : 3001875966U; 206 207 streamer_info* info = new streamer_info("TStreamerBasicType",2,check); 208 a_infos.push_back(info); 209 // Elements : 210 info->add(new streamer_base("TStreamerElement","base class for one element (data member) to be Streamed",0,TStreamerElement_version));} 211 212 {unsigned int check = 0; 213 //this : 214 scs(check,"TStreamerBasicPointer"); 215 //bases : 216 scs(check,"TStreamerElement"); 217 //members : 218 scs(check,"fCountVersion"); 219 scs(check,"Int_t"); 220 221 scs(check,"fCountName"); 222 scs(check,"TString"); 223 224 scs(check,"fCountClass"); 225 scs(check,"TString"); 226 //Should be : 1587298059U 227 228 streamer_info* info = new streamer_info("TStreamerBasicPointer",2,check); 229 a_infos.push_back(info); 230 // Elements : 231 info->add(new streamer_base("TStreamerElement","base class for one element (data member) to be Streamed",0,TStreamerElement_version)); 232 info->add(new streamer_int("fCountVersion","version number of the class with the counter",88)); 233 info->add(new streamer_string("fCountName","name of data member holding the array count",92)); 234 info->add(new streamer_string("fCountClass","name of the class with the counter",100));} 235 236 {unsigned int check = 0; 237 //this : 238 scs(check,"TStreamerObject"); 239 //bases : 240 scs(check,"TStreamerElement"); 241 //Should be : 2177456715U 242 243 streamer_info* info = new streamer_info("TStreamerObject",2,check); 244 a_infos.push_back(info); 245 // Elements : 246 info->add(new streamer_base("TStreamerElement","base class for one element (data member) to be Streamed",0,TStreamerElement_version));} 247 248 {unsigned int check = 0; 249 //this : 250 scs(check,"TStreamerObjectPointer"); 251 //bases : 252 scs(check,"TStreamerElement"); 253 //Should be : 720556968U 254 255 streamer_info* info = new streamer_info("TStreamerObjectPointer",2,check); 256 a_infos.push_back(info); 257 // Elements : 258 info->add(new streamer_base("TStreamerElement","base class for one element (data member) to be Streamed",0,TStreamerElement_version));} 259 260 {unsigned int check = 0; 261 //this : 262 scs(check,"TStreamerObjectAny"); 263 //bases : 264 scs(check,"TStreamerElement"); 265 //Should be : 3108880127U 266 267 streamer_info* info = new streamer_info("TStreamerObjectAny",2,check); 268 a_infos.push_back(info); 269 // Elements : 270 info->add(new streamer_base("TStreamerElement","base class for one element (data member) to be Streamed",0,TStreamerElement_version));} 271 272 {unsigned int check = 0; 273 //this : 274 scs(check,"TArray"); 275 //members : 276 scs(check,"fN"); 277 scs(check,"Int_t"); 278 279 streamer_info* info = new streamer_info("TArray",1,check); 280 a_infos.push_back(info); 281 282 // Elements : 283 int ofs = 0; 284 ofs += size_VIRTUAL(); 285 info->add(new streamer_int(ofs,"fN","Number of array elements")); 286 //size_TArray = ofs; //8 287 } 288 289 {unsigned int check = 0; 290 //this : 291 scs(check,"TArrayI"); 292 //base : 293 scs(check,"TArray"); 294 //members : 295 scs(check,"fArray"); 296 scs(check,"Int_t*"); 297 298 streamer_info* info = new streamer_info("TArrayI",1,check); 299 a_infos.push_back(info); 300 301 // Elements : 302 int offset = 0; 303 info->add(new streamer_base("TArray","Abstract array base class",offset,TArray_version));offset += size_TArray; 304 info->add(new streamer_basic_pointer("fArray","[fN] Array of fN integers",offset,streamer__info::INT,"fN","TArray",1,"Int_t*"));offset += size_POINTER; 305 306 //12 307 } 308 309 {unsigned int check = 0; 310 //this : 311 scs(check,"TArrayD"); 312 //base : 313 scs(check,"TArray"); 314 //members : 315 scs(check,"fArray"); 316 scs(check,"Double_t*"); 317 318 streamer_info* info = new streamer_info("TArrayD",1,check); 319 a_infos.push_back(info); 320 321 // Elements : 322 int offset = 0; 323 info->add(new streamer_base("TArray","Abstract array base class",offset,TArray_version));offset += size_TArray; //8 324 info->add(new streamer_basic_pointer("fArray","[fN] Array of fN integers",offset,streamer__info::DOUBLE,"fN","TArray",1,"Double_t*"));offset += size_POINTER; 325 326 //12 327 } 328 329 {unsigned int check = 0; 330 //this : 331 scs(check,"TArrayF"); 332 //base : 333 scs(check,"TArray"); 334 //members : 335 scs(check,"fArray"); 336 scs(check,"Float_t*"); 337 338 streamer_info* info = new streamer_info("TArrayF",1,check); 339 a_infos.push_back(info); 340 341 // Elements : 342 int offset = 0; 343 info->add(new streamer_base("TArray","Abstract array base class",offset,TArray_version));offset += size_TArray; 344 info->add(new streamer_basic_pointer("fArray","[fN] Array of fN integers",offset,streamer__info::FLOAT,"fN","TArray",1,"Float_t*"));offset += size_POINTER; 345 346 //12 347 } 348 349 fill_vec(a_infos,"char",streamer__info::CHAR); 350 fill_vec(a_infos,"short",streamer__info::SHORT); 351 fill_vec(a_infos,"int",streamer__info::INT); 352 fill_vec(a_infos,"unsigned char",streamer__info::UNSIGNED_CHAR); 353 fill_vec(a_infos,"unsigned short",streamer__info::UNSIGNED_SHORT); 354 fill_vec(a_infos,"unsigned int",streamer__info::UNSIGNED_INT); 355 fill_vec(a_infos,"float",streamer__info::FLOAT); 356 fill_vec(a_infos,"double",streamer__info::DOUBLE); 357 fill_vec(a_infos,"bool",streamer__info::BOOL); 358 359 } 360 361 inline void fill_infos_cont(obj_list<streamer_info>& a_infos,std::ostream&) { 362 363 // sizeof(TString) = 8 (4 (virtual ~) + 1 + 3 (align)) 364 // sizeof(TObject) = 12 365 366 short TObject_version = 1; 367 368 const int size_POINTER = 4; 369 const int size_BOOL = 4; 370 371 int size_TCollection = 0; 372 short TCollection_version = 3; 373 {unsigned int check = 0; 374 //this : 375 scs(check,"TCollection"); 376 //base : 377 scs(check,"TObject"); 378 //members : 379 scs(check,"fName"); 380 scs(check,"TString"); 381 382 scs(check,"fSize"); 383 scs(check,"Int_t"); 384 385 streamer_info* info = new streamer_info("TCollection",TCollection_version,check); 386 a_infos.push_back(info); 387 // Elements : 388 int ofs = 0; 389 info->add(new streamer_base("TObject","Basic ROOT object",ofs,TObject_version));ofs += size_TObject(); 390 info->add(new streamer_string(ofs,"fName","name of the collection")); 391 info->add(new streamer_int(ofs,"fSize","number of elements in collection")); 392 size_TCollection = ofs; 393 } 394 395 int size_TSeqCollection = 0; 396 short TSeqCollection_version = 0; 397 {unsigned int check = 0; 398 //this : 399 scs(check,"TSeqCollection"); 400 //base : 401 scs(check,"TCollection"); 402 //members : 403 scs(check,"fSorted"); 404 scs(check,"Bool_t"); 405 406 streamer_info* info = new streamer_info("TSeqCollection",TSeqCollection_version,check); 407 a_infos.push_back(info); 408 // Elements : 409 int ofs = 0; 410 info->add(new streamer_base("TCollection","Collection abstract base class",ofs,TCollection_version));ofs += size_TCollection; 411 info->add(new streamer_bool(ofs,"fSorted"," true if collection has been sorted")); 412 size_TSeqCollection = ofs; 413 } 414 415 //int size_TList = 0; 416 short TList_version = 4; 417 {unsigned int check = 0; 418 //this : 419 scs(check,"TList"); 420 //base : 421 scs(check,"TSeqCollection"); 422 //members : 423 424 streamer_info* info = new streamer_info("TList",TList_version,check); 425 a_infos.push_back(info); 426 // Elements : 427 int ofs = 0; 428 info->add(new streamer_base("TSeqCollection","Sequenceable collection abstract base class",ofs,TSeqCollection_version));ofs += size_TSeqCollection; 429 ofs += size_POINTER; //!*fFirst 430 ofs += size_POINTER; //!*fLast 431 ofs += size_POINTER; //!*fCache 432 ofs += size_BOOL; //!fAscending 433 //size_TList = ofs; 434 } 435 } 436 437 inline int size_TAttLine() {return 10;} //12? 438 inline int size_TAttFill() {return 8;} 439 inline int size_TAttMarker() {return 12;} 440 441 inline void fill_infos_graf(obj_list<streamer_info>& a_infos,std::ostream& a_out) { 442 443 //sizeof(Font_t) = 2 444 //sizeof(Style_t) = 2 445 //sizeof(Marker_t) = 2 446 //sizeof(Width_t) = 2 447 //sizeof(Size_t) = 4 448 449 const int size_SHORT = 2; 450 const int size_FLOAT = 4; 451 452 {unsigned int check = 0; 453 //this : 454 scs(check,"TAttLine"); 455 //members : 456 scs(check,"fLineColor"); 457 scs(check,"Color_t"); 458 459 scs(check,"fLineStyle"); 460 scs(check,"Style_t"); 461 462 scs(check,"fLineWidth"); 463 scs(check,"Width_t"); 464 465 //Should be : 1369587346U 466 467 // Beurk ; but the ROOT TTree compells indirectly the below. 468 streamer_info* info = new streamer_info("TAttLine",1,check); 469 a_infos.push_back(info); 470 // Elements : 471 int ofs = size_VIRTUAL(); 472 info->add(new streamer_basic_type("fLineColor","line color",ofs,streamer__info::SHORT,"Color_t"));ofs += size_SHORT; 473 info->add(new streamer_basic_type("fLineStyle","line style",ofs,streamer__info::SHORT,"Style_t"));ofs += size_SHORT; 474 info->add(new streamer_basic_type("fLineWidth","line width",ofs,streamer__info::SHORT,"Width_t"));ofs += size_SHORT; 475 //2 (alignement ???) 476 if(ofs!=size_TAttLine()) { 477 a_out << "tools::wroot::fill_infos :" 478 << " TAttLine " << ofs << " (" << size_TAttLine() << " expected.)" 479 << std::endl; 480 }} 481 482 {unsigned int check = 0; 483 //this : 484 scs(check,"TAttFill"); 485 //members : 486 scs(check,"fFillColor"); 487 scs(check,"Color_t"); 488 489 scs(check,"fFillStyle"); 490 scs(check,"Style_t"); 491 492 //Should be : 1204118360U 493 streamer_info* info = new streamer_info("TAttFill",1,check); 494 a_infos.push_back(info); 495 // Elements : 496 int ofs = size_VIRTUAL(); 497 info->add(new streamer_basic_type("fFillColor","fill area color",ofs,streamer__info::SHORT,"Color_t"));ofs += size_SHORT; 498 info->add(new streamer_basic_type("fFillStyle","fill area style",ofs,streamer__info::SHORT,"Style_t"));ofs += size_SHORT; 499 if(ofs!=size_TAttFill()) { 500 a_out << "tools::wroot::fill_infos :" 501 << " TAttFill " << ofs << " (" << size_TAttFill() << " expected.)" 502 << std::endl; 503 }} 504 505 {unsigned int check = 0; 506 //this : 507 scs(check,"TAttMarker"); 508 //members : 509 scs(check,"fMarkerColor"); 510 scs(check,"Color_t"); 511 512 scs(check,"fMarkerStyle"); 513 scs(check,"Style_t"); 514 515 scs(check,"fMarkerSize"); 516 scs(check,"Size_t"); 517 518 //Should be 4207747460U 519 520 streamer_info* info = new streamer_info("TAttMarker",1,check); 521 a_infos.push_back(info); 522 // Elements : 523 int ofs = size_VIRTUAL(); 524 info->add(new streamer_basic_type("fMarkerColor","Marker color index",ofs,streamer__info::SHORT,"Color_t"));ofs += size_SHORT; 525 info->add(new streamer_basic_type("fMarkerStyle","Marker style",ofs,streamer__info::SHORT,"Style_t"));ofs += size_SHORT; 526 info->add(new streamer_basic_type("fMarkerSize","Marker size",ofs,streamer__info::FLOAT,"Size_t"));ofs += size_FLOAT; 527 if(ofs!=size_TAttMarker()) { 528 a_out << "tools::wroot::fill_infos :" 529 << " TAttMarker " << ofs << " (" << size_TAttMarker() << " expected.)" 530 << std::endl; 531 }} 532 533 } 534 535 inline int size_TBranch() {return 264;} //256? 536 inline int size_TLeaf() {return 60;} //52? 537 inline int size_TTree() {return 254;} //240? 538 539 inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out) { 540 541 const int size_CHAR = 1; 542 const int size_INT = 4; 543 const int size_POINTER = 4; 544 const int size_COUNTER = 4; 545 546 const int size_TObjArray = 40; 547 const int size_TArrayD = 12; 548 const int size_TArrayI = 12; 549 550 short TNamed_version = 1; 551 552 short TAttLine_version = 1; 553 short TAttFill_version = 1; 554 short TAttMarker_version = 1; 555 short TBranch_version = 8; 556 short TLeaf_version = 2; 557 558 {unsigned int check = 0; 559 //this : 560 scs(check,"TTree"); 561 //bases : 562 scs(check,"TNamed"); 563 scs(check,"TAttLine"); 564 scs(check,"TAttFill"); 565 scs(check,"TAttMarker"); 566 //members : 567 scs(check,"fEntries"); 568 scs(check,"Stat_t"); 569 570 scs(check,"fTotBytes"); 571 scs(check,"Stat_t"); 572 573 scs(check,"fZipBytes"); 574 scs(check,"Stat_t"); 575 576 scs(check,"fSavedBytes"); 577 scs(check,"Stat_t"); 578 579 scs(check,"fTimerInterval"); 580 scs(check,"Int_t"); 581 582 scs(check,"fScanField"); 583 scs(check,"Int_t"); 584 585 scs(check,"fUpdate"); 586 scs(check,"Int_t"); 587 588 scs(check,"fMaxEntryLoop"); 589 scs(check,"Int_t"); 590 591 scs(check,"fMaxVirtualSize"); 592 scs(check,"Int_t"); 593 594 scs(check,"fAutoSave"); 595 scs(check,"Int_t"); 596 597 scs(check,"fEstimate"); 598 scs(check,"Int_t"); 599 600 scs(check,"fBranches"); 601 scs(check,"TObjArray"); 602 603 scs(check,"fLeaves"); 604 scs(check,"TObjArray"); 605 606 //scs(check,"fAliases"); 607 //scs(check,"TList*"); 608 609 scs(check,"fIndexValues"); 610 scs(check,"TArrayD"); 611 612 scs(check,"fIndex"); 613 scs(check,"TArrayI"); 614 615 //scs(check,"fFriends"); 616 //scs(check,"TList*"); 617 //Should be : 3245044844U //3.00.06 618 //Should be : FIXME //3.10.02 619 620 streamer_info* info = new streamer_info("TTree",5,check); 621 a_infos.push_back(info); 622 623 // Elements : 624 int ofs = 0; 625 info->add(new streamer_base("TNamed","The basis for a named object (name, title)",ofs,TNamed_version));ofs += size_TNamed(); 626 info->add(new streamer_base("TAttLine","Line attributes",ofs,TAttLine_version));ofs += size_TAttLine(); 627 info->add(new streamer_base("TAttFill","Fill area attributes",ofs,TAttFill_version));ofs += size_TAttFill(); 628 info->add(new streamer_base("TAttMarker","Marker attributes",ofs,TAttMarker_version));ofs += size_TAttMarker(); 629 630 info->add(new streamer_stat_t(ofs,"fEntries","Number of entries")); 631 info->add(new streamer_stat_t(ofs,"fTotBytes","Total number of bytes in all branches before compression")); 632 info->add(new streamer_stat_t(ofs,"fZipBytes","Total number of bytes in all branches after compression")); 633 info->add(new streamer_stat_t(ofs,"fSavedBytes","Number of autosaved bytes")); 634 635 info->add(new streamer_int(ofs,"fTimerInterval","Timer interval in milliseconds")); 636 info->add(new streamer_int(ofs,"fScanField","Number of runs before prompting in Scan")); 637 info->add(new streamer_int(ofs,"fUpdate","Update frequency for EntryLoop")); 638 info->add(new streamer_int(ofs,"fMaxEntryLoop","Maximum number of entries to process")); 639 info->add(new streamer_int(ofs,"fMaxVirtualSize","Maximum total size of buffers kept in memory")); 640 info->add(new streamer_int(ofs,"fAutoSave","Autosave tree when fAutoSave bytes produced")); 641 info->add(new streamer_int(ofs,"fEstimate","Number of entries to estimate histogram limits")); 642 ofs += size_INT; //!fChainOffset 643 ofs += size_INT; //!fReadEntry 644 ofs += size_INT; //!fTotalBuffers 645 ofs += size_INT; //!fPacketSize 646 ofs += size_INT; //!fNfill 647 ofs += size_POINTER; //!*fDirectory 648 info->add(new streamer_object("fBranches","List of Branches",ofs,"TObjArray"));ofs += size_TObjArray; 649 info->add(new streamer_object("fLeaves","Direct pointers to individual branch leaves",ofs,"TObjArray"));ofs += size_TObjArray; 650 ofs += size_POINTER; //!*fEventList 651 info->add(new streamer_object_any("fIndexValues","Sorted index values",ofs,"TArrayD"));ofs += size_TArrayD; 652 info->add(new streamer_object_any("fIndex","Index of sorted values",ofs,"TArrayI"));ofs += size_TArrayI; 653 ofs += size_POINTER; //!*fPlayer 654 655 if(ofs!=size_TTree()) { 656 a_out << "tools::wroot::fill_infos :" 657 << " TTree " << ofs << " (" << size_TTree() << " expected.)" 658 << std::endl; 659 } 660 661 //info->add(new streamer_object_pointer("fAliases","List of aliases for expressions based on the tree branches.",offset,"TList*"));offset += size_OBJECT_POINTER; 662 //info->add(new streamer_object_pointer("fFriends","pointer to list of friend elements",offset,"TList*"));offset += size_OBJECT_POINTER; 663 } 664 665 //--------------------------------------------------------------------- 666 {unsigned int check = 0; 667 //this : 668 scs(check,"TBranch"); 669 //bases : 670 scs(check,"TNamed"); 671 scs(check,"TAttFill"); 672 //members : 673 scs(check,"fCompress"); 674 scs(check,"Int_t"); 675 676 scs(check,"fBasketSize"); 677 scs(check,"Int_t"); 678 679 scs(check,"fEntryOffsetLen"); 680 scs(check,"Int_t"); 681 682 scs(check,"fWriteBasket"); 683 scs(check,"Int_t"); 684 685 scs(check,"fEntryNumber"); 686 scs(check,"Int_t"); 687 688 scs(check,"fOffset"); 689 scs(check,"Int_t"); 690 691 scs(check,"fMaxBaskets"); 692 scs(check,"Int_t"); 693 694 scs(check,"fSplitLevel"); 695 scs(check,"Int_t"); 696 697 scs(check,"fEntries"); 698 scs(check,"Stat_t"); 699 700 scs(check,"fTotBytes"); 701 scs(check,"Stat_t"); 702 703 scs(check,"fZipBytes"); 704 scs(check,"Stat_t"); 705 706 scs(check,"fBranches"); 707 scs(check,"TObjArray"); 708 709 scs(check,"fLeaves"); 710 scs(check,"TObjArray"); 711 712 scs(check,"fBaskets"); 713 scs(check,"TObjArray"); 714 715 scs(check,"fBasketBytes"); 716 scs(check,"Int_t*"); 717 718 scs(check,"fBasketEntry"); 719 scs(check,"Int_t*"); 720 721 scs(check,"fBasketSeek"); 722 scs(check,"Seek_t*"); 723 724 scs(check,"fFileName"); 725 scs(check,"TString"); 726 //Should be : 2056727376U (6 3.00.06) 727 //Should be : FIXME (7 3.03.01) 728 729 streamer_info* info = new streamer_info("TBranch",8,check); 730 a_infos.push_back(info); 731 // Elements : 732 int ofs = 0; 733 info->add(new streamer_base("TNamed","The basis for a named object (name, title)",ofs,TNamed_version));ofs += size_TNamed(); 734 info->add(new streamer_base("TAttFill","Fill area attributes",ofs,TAttFill_version));ofs += size_TAttFill(); 735 info->add(new streamer_int(ofs,"fCompress","(=1 branch is compressed, 0 otherwise)")); 736 info->add(new streamer_int(ofs,"fBasketSize","Initial Size of Basket Buffer")); 737 info->add(new streamer_int(ofs,"fEntryOffsetLen","Initial Length of fEntryOffset table in the basket buffers")); 738 info->add(new streamer_int(ofs,"fWriteBasket","Last basket number written")); 739 info->add(new streamer_int(ofs,"fEntryNumber","Current entry number (last one filled in this branch)")); 740 info->add(new streamer_int(ofs,"fOffset","Offset of this branch")); 741 info->add(new streamer_basic_type("fMaxBaskets","Maximum number of Baskets so far",ofs,streamer__info::COUNTER,"Int_t"));ofs += size_COUNTER; 742 info->add(new streamer_int(ofs,"fSplitLevel","Branch split level")); //3.03.01 743 ofs += size_INT; //!fNLeaves 744 ofs += size_INT; //!fReadBasket 745 ofs += size_INT; //!fReadEntry 746 info->add(new streamer_stat_t(ofs,"fEntries","Number of entries")); 747 info->add(new streamer_stat_t(ofs,"fTotBytes","Total number of bytes in all leaves before compression")); 748 info->add(new streamer_stat_t(ofs,"fZipBytes","Total number of bytes in all leaves after compression")); 749 info->add(new streamer_object("fBranches","-> List of Branches of this branch",ofs,"TObjArray"));ofs += size_TObjArray; 750 info->add(new streamer_object("fLeaves","-> List of leaves of this branch",ofs,"TObjArray"));ofs += size_TObjArray; 751 info->add(new streamer_object("fBaskets","-> List of baskets of this branch",ofs,"TObjArray"));ofs += size_TObjArray; 752 ofs += size_INT; //!fNBasketRAM 753 ofs += size_POINTER; //!*fBasketRAM 754 info->add(new streamer_basic_pointer("fBasketBytes","[fMaxBaskets] Length of baskets on file",ofs,streamer__info::INT,"fMaxBaskets","TBranch",6,"Int_t*"));ofs += size_POINTER; 755 info->add(new streamer_basic_pointer("fBasketEntry","[fMaxBaskets] Table of first entry in eack basket",ofs,streamer__info::INT,"fMaxBaskets","TBranch",6,"Int_t*"));ofs += size_POINTER; 756 info->add(new streamer_basic_pointer("fBasketSeek","[fMaxBaskets] Addresses of baskets on file",ofs,streamer__info::INT,"fMaxBaskets","TBranch",6,"Seek_t*"));ofs += size_POINTER; 757 ofs += size_POINTER; //!*fTree 758 ofs += size_POINTER; //!*fAddress 759 ofs += size_POINTER; //!*fDirectory 760 info->add(new streamer_string(ofs,"fFileName","Name of file where buffers are stored (\"\" if in same file as Tree header)")); 761 if(ofs!=size_TBranch()) { 762 a_out << "tools::wroot::fill_infos :" 763 << " TBranch " << ofs << " (" << size_TBranch() << " expected.)" 764 << std::endl; 765 }} 766 767 {unsigned int check = 0; 768 //this : 769 scs(check,"TBranchObject"); 770 //bases : 771 scs(check,"TBranch"); 772 //members : 773 scs(check,"fClassName"); 774 scs(check,"TString"); 775 776 //Should be : 2857878535U 777 778 streamer_info* info = new streamer_info("TBranchObject",1,check); 779 a_infos.push_back(info); 780 // Elements : 781 int ofs = 0; 782 info->add(new streamer_base("TBranch","Branch descriptor",ofs,TBranch_version));ofs += size_TBranch(); 783 info->add(new streamer_string(ofs,"fClassName","Class name of referenced object")); 784 } 785 786 //--------------------------------------------------------------------- 787 {unsigned int check = 0; 788 //this : 789 scs(check,"TBranchElement"); 790 //bases : 791 scs(check,"TBranch"); 792 //members : 793 scs(check,"fClassName"); 794 scs(check,"TString"); 795 796 scs(check,"fClassVersion"); 797 scs(check,"Int_t"); 798 799 scs(check,"fID"); 800 scs(check,"Int_t"); 801 802 scs(check,"fType"); 803 scs(check,"Int_t"); 804 805 scs(check,"fStreamerType"); 806 scs(check,"Int_t"); 807 808 streamer_info* info = new streamer_info("TBranchElement",1,check); 809 a_infos.push_back(info); 810 // Elements : 811 int offset = 0; 812 info->add(new streamer_base("TBranch","Branch descriptor",offset,TBranch_version));offset += size_TBranch(); 813 info->add(new streamer_string(offset,"fClassName","Class name of referenced object")); 814 info->add(new streamer_int(offset,"fClassVersion","Version number of class")); 815 info->add(new streamer_int(offset,"fID","element serial number in fInfo")); 816 info->add(new streamer_int(offset,"fType","branch type")); 817 info->add(new streamer_int(offset,"fStreamerType","branch streamer type")); 818 819 } 820 821 {unsigned int check = 0; 822 //this : 823 scs(check,"TLeaf"); 824 //bases : 825 scs(check,"TNamed"); 826 //members : 827 scs(check,"fLen"); 828 scs(check,"Int_t"); 829 830 scs(check,"fLenType"); 831 scs(check,"Int_t"); 832 833 scs(check,"fOffset"); 834 scs(check,"Int_t"); 835 836 scs(check,"fIsRange"); 837 scs(check,"Bool_t"); 838 839 scs(check,"fIsUnsigned"); 840 scs(check,"Bool_t"); 841 842 scs(check,"fLeafCount"); 843 scs(check,"TLeaf*"); 844 845 //Should be : 727988519U 846 847 streamer_info* info = new streamer_info("TLeaf",2,check); 848 a_infos.push_back(info); 849 850 // Elements : 851 int ofs = 0; 852 info->add(new streamer_base("TNamed","The basis for a named object (name, title)",ofs,TNamed_version));ofs += size_TNamed(); 853 ofs += size_INT; //!fNdata 854 info->add(new streamer_int(ofs,"fLen","Number of fixed length elements")); 855 info->add(new streamer_int(ofs,"fLenType","Number of bytes for this data type")); 856 info->add(new streamer_int(ofs,"fOffset","Offset in ClonesArray object (if one)")); 857 info->add(new streamer_bool(ofs,"fIsRange","(=kTRUE if leaf has a range, kFALSE otherwise)")); 858 info->add(new streamer_bool(ofs,"fIsUnsigned","(=kTRUE if unsigned, kFALSE otherwise)")); 859 info->add(new streamer_object_pointer("fLeafCount","Pointer to Leaf count if variable length",ofs,"TLeaf*"));ofs += size_POINTER; 860 ofs += size_POINTER; //!*fBranch 861 if(ofs!=size_TLeaf()) { 862 a_out << "tools::wroot::fill_infos :" 863 << " TLeaf " << ofs << " (" << size_TLeaf() << " expected.)" 864 << std::endl; 865 }} 866 867 {unsigned int check = 0; 868 //this : 869 scs(check,"TLeafS"); 870 //bases : 871 scs(check,"TLeaf"); 872 //members : 873 scs(check,"fMinimum"); 874 scs(check,"Short_t"); 875 876 scs(check,"fMaximum"); 877 scs(check,"Short_t"); 878 879 //Should be : FIXME 880 881 streamer_info* info = new streamer_info("TLeafS",1,check); 882 a_infos.push_back(info); 883 // Elements : 884 int ofs = 0; 885 info->add(new streamer_base("TLeaf","Leaf: description of a Branch data type",ofs,TLeaf_version));ofs += size_TLeaf(); 886 info->add(new streamer_short(ofs,"fMinimum","Minimum value if leaf range is specified")); 887 info->add(new streamer_short(ofs,"fMaximum","Maximum value if leaf range is specified")); 888 889 } 890 891 {unsigned int check = 0; 892 //this : 893 scs(check,"TLeafI"); 894 //bases : 895 scs(check,"TLeaf"); 896 //members : 897 scs(check,"fMinimum"); 898 scs(check,"Int_t"); 899 900 scs(check,"fMaximum"); 901 scs(check,"Int_t"); 902 903 //Should be : 3495201397U 904 905 streamer_info* info = new streamer_info("TLeafI",1,check); 906 a_infos.push_back(info); 907 908 // Elements : 909 int ofs = 0; 910 info->add(new streamer_base("TLeaf","Leaf: description of a Branch data type",ofs,TLeaf_version));ofs += size_TLeaf(); 911 info->add(new streamer_int(ofs,"fMinimum","Minimum value if leaf range is specified")); 912 info->add(new streamer_int(ofs,"fMaximum","Maximum value if leaf range is specified")); 913 //size_TLeafI = ofs; 914 } 915 916 {unsigned int check = 0; 917 //name : 918 scs(check,"TLeafF"); 919 //bases : 920 scs(check,"TLeaf"); 921 //members : 922 scs(check,"fMinimum"); 923 scs(check,"Float_t"); 924 925 scs(check,"fMaximum"); 926 scs(check,"Float_t"); 927 928 //Should be 1366318032U 929 930 streamer_info* info = new streamer_info("TLeafF",1,check); 931 a_infos.push_back(info); 932 933 // Elements : 934 int ofs = 0; 935 info->add(new streamer_base("TLeaf","Leaf: description of a Branch data type",ofs,TLeaf_version));ofs += size_TLeaf(); 936 info->add(new streamer_float(ofs,"fMinimum","Minimum value if leaf range is specified")); 937 info->add(new streamer_float(ofs,"fMaximum","Maximum value if leaf range is specified")); 938 //size_TLeafF = ofs; 939 } 940 941 {unsigned int check = 0; 942 //this : 943 scs(check,"TLeafD"); 944 //bases : 945 scs(check,"TLeaf"); 946 //members : 947 scs(check,"fMinimum"); 948 scs(check,"Double_t"); 949 950 scs(check,"fMaximum"); 951 scs(check,"Double_t"); 952 953 //Should be 954 955 streamer_info* info = new streamer_info("TLeafD",1,check); 956 a_infos.push_back(info); 957 958 // Elements : 959 int ofs = 0; 960 info->add(new streamer_base("TLeaf","Leaf: description of a Branch data type",ofs,TLeaf_version));ofs += size_TLeaf(); 961 info->add(new streamer_double(ofs,"fMinimum","Minimum value if leaf range is specified")); 962 info->add(new streamer_double(ofs,"fMaximum","Maximum value if leaf range is specified")); 963 964 } 965 966 {unsigned int check = 0; 967 //this : 968 scs(check,"TLeafB"); 969 //bases : 970 scs(check,"TLeaf"); 971 //members : 972 scs(check,"fMinimum"); 973 scs(check,"Char_t"); 974 975 scs(check,"fMaximum"); 976 scs(check,"Char_t"); 977 978 //Should be : FIXME 979 980 streamer_info* info = new streamer_info("TLeafB",1,check); 981 a_infos.push_back(info); 982 // Elements : 983 int ofs = 0; 984 info->add(new streamer_base("TLeaf","Leaf: description of a Branch data type",ofs,TLeaf_version));ofs += size_TLeaf(); 985 info->add(new streamer_basic_type("fMinimum","Minimum value if leaf range is specified",ofs,streamer__info::CHAR,"Char_t"));ofs += size_CHAR; 986 info->add(new streamer_basic_type("fMaximum","Maximum value if leaf range is specified",ofs,streamer__info::CHAR,"Char_t"));ofs += size_CHAR; 987 988 } 989 990 {unsigned int check = 0; 991 //this : 992 scs(check,"TLeafC"); 993 //bases : 994 scs(check,"TLeaf"); 995 //members : 996 scs(check,"fMinimum"); 997 scs(check,"Int_t"); 998 999 scs(check,"fMaximum"); 1000 scs(check,"Int_t"); 1001 1002 //Should be : FIXME 1003 1004 streamer_info* info = new streamer_info("TLeafC",1,check); 1005 a_infos.push_back(info); 1006 1007 // Elements : 1008 int ofs = 0; 1009 info->add(new streamer_base("TLeaf","Leaf: description of a Branch data type",ofs,TLeaf_version));ofs += size_TLeaf(); 1010 info->add(new streamer_int(ofs,"fMinimum","Minimum value if leaf range is specified")); 1011 info->add(new streamer_int(ofs,"fMaximum","Maximum value if leaf range is specified"));} 1012 1013 {unsigned int check = 0; 1014 //this : 1015 scs(check,"TLeafObject"); 1016 //bases : 1017 scs(check,"TLeaf"); 1018 //members : 1019 scs(check,"fVirtual"); 1020 scs(check,"Bool_t"); 1021 1022 //Should be 2312661809U 1023 1024 streamer_info* info = new streamer_info("TLeafObject",4,check); 1025 a_infos.push_back(info); 1026 1027 // Elements : 1028 int ofs = 0; 1029 info->add(new streamer_base("TLeaf","Leaf: description of a Branch data type",ofs,TLeaf_version));ofs += size_TLeaf(); 1030 info->add(new streamer_bool(ofs,"fVirtual","Support for Virtuality"));} 1031 1032 {unsigned int check = 0; 1033 //this : 1034 scs(check,"TLeafElement"); 1035 //bases : 1036 scs(check,"TLeaf"); 1037 //members : 1038 scs(check,"fID"); 1039 scs(check,"Int_t"); 1040 1041 scs(check,"fType"); 1042 scs(check,"Int_t"); 1043 1044 streamer_info* info = new streamer_info("TLeafElement",1,check); 1045 a_infos.push_back(info); 1046 1047 // Elements : 1048 int ofs = 0; 1049 info->add(new streamer_base("TLeaf","Leaf: description of a Branch data type",ofs,TLeaf_version));ofs += size_TLeaf(); 1050 ofs += size_POINTER; //!*fAbsAddress 1051 info->add(new streamer_int(ofs,"fID","element serial number in fInfo")); 1052 info->add(new streamer_int(ofs,"fType","leaf type")); 1053 //size_TLeafElement = ofs; 1054 } 1055 1056 } 1057 1058 inline int size_TAttAxis() {return 38;} //40? 1059 inline int size_TAxis() {return 126;} //128? 1060 inline int size_TH1() {return 560;} //568? 1061 inline int size_TH2() {return 592;} //600? 1062 inline int size_TH2D() {return 604;} //612? 1063 1064 inline void fill_infos_histo(obj_list<streamer_info>& a_infos,std::ostream& a_out) { 1065 1066 typedef streamer_basic_type sbt; 1067 1068 const int size_POINTER = 4; 1069 1070 const int size_DOUBLE = 8; 1071 const int size_SHORT = 2; 1072 const int size_INT = 4; 1073 1074 //const int size_TObjArray = 40; 1075 const int size_TArrayD = 12; 1076 const int size_TArrayF = 12; 1077 1078 short TNamed_version = 1; 1079 short TArrayF_version = 1; 1080 short TArrayD_version = 1; 1081 1082 short TAttLine_version = 1; 1083 short TAttFill_version = 1; 1084 short TAttMarker_version = 1; 1085 1086 short TAttAxis_version = 4; 1087 1088 1089 {unsigned int check = 0; 1090 //this : 1091 scs(check,"TAttAxis"); 1092 //members : 1093 scs(check,"fNdivisions"); 1094 scs(check,"Int_t"); 1095 1096 scs(check,"fAxisColor"); 1097 scs(check,"Color_t"); 1098 1099 scs(check,"fLabelColor"); 1100 scs(check,"Color_t"); 1101 1102 scs(check,"fLabelFont"); 1103 scs(check,"Style_t"); 1104 1105 scs(check,"fLabelOffset"); 1106 scs(check,"Float_t"); 1107 1108 scs(check,"fLabelSize"); 1109 scs(check,"Float_t"); 1110 1111 scs(check,"fTickLength"); 1112 scs(check,"Float_t"); 1113 1114 scs(check,"fTitleOffset"); 1115 scs(check,"Float_t"); 1116 1117 scs(check,"fTitleSize"); 1118 scs(check,"Float_t"); 1119 1120 scs(check,"fTitleColor"); 1121 scs(check,"Color_t"); 1122 1123 scs(check,"fTitleFont"); 1124 scs(check,"Style_t"); 1125 1126 streamer_info* info = new streamer_info("TAttAxis",4,check); 1127 a_infos.push_back(info); 1128 // Elements : 1129 int ofs = size_VIRTUAL(); 1130 info->add(new streamer_int(ofs,"fNdivisions","Number of divisions(10000*n3 + 100*n2 + n1)")); 1131 info->add(new sbt("fAxisColor","color of the line axis",ofs,streamer__info::SHORT,"Color_t"));ofs += size_SHORT; 1132 info->add(new sbt("fLabelColor","color of labels",ofs,streamer__info::SHORT,"Color_t"));ofs += size_SHORT; 1133 info->add(new sbt("fLabelFont","font for labels",ofs,streamer__info::SHORT,"Style_t"));ofs += size_SHORT; 1134 info->add(new streamer_float(ofs,"fLabelOffset","offset of labels")); 1135 info->add(new streamer_float(ofs,"fLabelSize","size of labels")); 1136 info->add(new streamer_float(ofs,"fTickLength","length of tick marks")); 1137 info->add(new streamer_float(ofs,"fTitleOffset","offset of axis title")); 1138 info->add(new streamer_float(ofs,"fTitleSize","size of axis title")); 1139 info->add(new sbt("fTitleColor","color of axis title",ofs,streamer__info::SHORT,"Color_t"));ofs += size_SHORT; 1140 info->add(new sbt("fTitleFont","font for axis title",ofs,streamer__info::SHORT,"Style_t"));ofs += size_SHORT; 1141 //uuuu ofs += 2; //alignement ??? 1142 if(ofs!=size_TAttAxis()) { 1143 a_out << "tools::wroot::fill_infos :" 1144 << " TAttAxis " << ofs << " (" << size_TAttAxis() << " expected.)" 1145 << std::endl; 1146 }} 1147 1148 {unsigned int check = 0; 1149 //this : 1150 scs(check,"TAxis"); 1151 //bases : 1152 scs(check,"TNamed"); 1153 scs(check,"TAttAxis"); 1154 //members : 1155 scs(check,"fNbins"); 1156 scs(check,"Int_t"); 1157 1158 scs(check,"fXmin"); 1159 scs(check,"Axis_t"); 1160 1161 scs(check,"fXmax"); 1162 scs(check,"Axis_t"); 1163 1164 scs(check,"fXbins"); 1165 scs(check,"TArrayD"); 1166 1167 scs(check,"fFirst"); 1168 scs(check,"Int_t"); 1169 1170 scs(check,"fLast"); 1171 scs(check,"Int_t"); 1172 1173 scs(check,"fTimeDisplay"); 1174 scs(check,"Bool_t"); 1175 1176 scs(check,"fTimeFormat"); 1177 scs(check,"TString"); 1178 1179 streamer_info* info = new streamer_info("TAxis",6,check); 1180 a_infos.push_back(info); 1181 1182 // Elements : 1183 int ofs = 0; 1184 info->add(new streamer_base("TNamed","The basis for a named object (name, title)",ofs,TNamed_version));ofs += size_TNamed(); 1185 info->add(new streamer_base("TAttAxis","Axis attributes",ofs,TAttAxis_version));ofs += size_TAttAxis(); 1186 info->add(new streamer_int(ofs,"fNbins","Number of bins")); 1187 info->add(new sbt("fXmin","low edge of first bin",ofs,streamer__info::DOUBLE,"Axis_t"));ofs += size_DOUBLE; 1188 info->add(new sbt("fXmax","upper edge of last bin",ofs,streamer__info::DOUBLE,"Axis_t"));ofs += size_DOUBLE; 1189 info->add(new streamer_object_any("fXbins","Bin edges array in X",ofs,"TArrayD"));ofs += size_TArrayD; 1190 ofs += size_POINTER; //!*fXlabels 1191 info->add(new streamer_int(ofs,"fFirst","first bin to display")); 1192 info->add(new streamer_int(ofs,"fLast","last bin to display")); 1193 info->add(new streamer_bool(ofs,"fTimeDisplay","on/off displaying time values instead of numerics")); 1194 info->add(new streamer_string(ofs,"fTimeFormat","Date&time format, ex: 09/12/99 12:34:00")); 1195 ofs += size_POINTER; //!*fParent 1196 //v3-05-07 : 124 (stored) + 4 = 128 1197 if(ofs!=size_TAxis()) { 1198 a_out << "tools::wroot::fill_infos :" 1199 << " TAxis " << ofs << " (" << size_TAxis() << " expected.)" 1200 << std::endl; 1201 }} 1202 1203 short TH1_version = 3; 1204 {unsigned int check = 0; 1205 //this : 1206 scs(check,"TH1"); 1207 //bases : 1208 scs(check,"TNamed"); 1209 scs(check,"TAttLine"); 1210 scs(check,"TAttFill"); 1211 scs(check,"TAttMarker"); 1212 //members : 1213 scs(check,"fNcells"); 1214 scs(check,"Int_t"); 1215 1216 scs(check,"fXaxis"); 1217 scs(check,"TAxis"); 1218 1219 scs(check,"fBarOffset"); 1220 scs(check,"Short_t"); 1221 1222 scs(check,"fBarWidth"); 1223 scs(check,"Short_t"); 1224 1225 scs(check,"fEntries"); 1226 scs(check,"Stat_t"); 1227 1228 scs(check,"fTsumw"); 1229 scs(check,"Stat_t"); 1230 1231 scs(check,"fTsumw2"); 1232 scs(check,"Stat_t"); 1233 1234 scs(check,"fTsumwx"); 1235 scs(check,"Stat_t"); 1236 1237 scs(check,"fTsumwx2"); 1238 scs(check,"Stat_t"); 1239 1240 scs(check,"fMaximum"); 1241 scs(check,"Double_t"); 1242 1243 scs(check,"fMinimum"); 1244 scs(check,"Double_t"); 1245 1246 scs(check,"fNormFactor"); 1247 scs(check,"Double_t"); 1248 1249 scs(check,"fContour"); 1250 scs(check,"TArrayD"); 1251 1252 scs(check,"fSumw2"); 1253 scs(check,"TArrayD"); 1254 1255 scs(check,"fOption"); 1256 scs(check,"TString"); 1257 1258 scs(check,"fFunctions"); 1259 scs(check,"TList*"); 1260 1261 streamer_info* info = new streamer_info("TH1",TH1_version,check); 1262 a_infos.push_back(info); 1263 1264 int ofs = 0; 1265 info->add(new streamer_base("TNamed","The basis for a named object (name, title)",ofs,TNamed_version));ofs += size_TNamed(); 1266 info->add(new streamer_base("TAttLine","Line attributes",ofs,TAttLine_version));ofs += size_TAttLine(); 1267 info->add(new streamer_base("TAttFill","Fill area attributes",ofs,TAttFill_version));ofs += size_TAttFill(); 1268 info->add(new streamer_base("TAttMarker","Marker attributes",ofs,TAttMarker_version));ofs += size_TAttMarker(); 1269 info->add(new streamer_int(ofs,"fNcells","number of bins(1D), cells (2D) +U/Overflows")); 1270 info->add(new streamer_object("fXaxis","X axis descriptor",ofs,"TAxis"));ofs += size_TAxis(); 1271 info->add(new streamer_object("fYaxis","Y axis descriptor",ofs,"TAxis"));ofs += size_TAxis(); 1272 info->add(new streamer_object("fZaxis","Z axis descriptor",ofs,"TAxis"));ofs += size_TAxis(); 1273 info->add(new streamer_short(ofs,"fBarOffset","(1000*offset) for bar charts or legos")); 1274 info->add(new streamer_short(ofs,"fBarWidth","(1000*width) for bar charts or legos")); 1275 info->add(new streamer_stat_t(ofs,"fEntries","Number of entries")); 1276 info->add(new streamer_stat_t(ofs,"fTsumw","Total Sum of weights")); 1277 info->add(new streamer_stat_t(ofs,"fTsumw2","Total Sum of squares of weights")); 1278 info->add(new streamer_stat_t(ofs,"fTsumwx","Total Sum of weight*X")); 1279 info->add(new streamer_stat_t(ofs,"fTsumwx2","Total Sum of weight*X*X")); 1280 info->add(new streamer_double(ofs,"fMaximum","Maximum value for plotting")); 1281 info->add(new streamer_double(ofs,"fMinimum","Minimum value for plotting")); 1282 info->add(new streamer_double(ofs,"fNormFactor","Normalization factor")); 1283 info->add(new streamer_object_any("fContour","Array to display contour levels",ofs,"TArrayD"));ofs += size_TArrayD; 1284 info->add(new streamer_object_any("fSumw2","Array of sum of squares of weights",ofs,"TArrayD"));ofs += size_TArrayD; 1285 info->add(new streamer_string(ofs,"fOption","histogram options")); 1286 info->add(new streamer_object_pointer("fFunctions","->Pointer to list of functions (fits and user)",ofs,"TList*"));ofs += size_POINTER; 1287 ofs += size_POINTER; //!*fDirectory 1288 ofs += size_INT; //!fDimension 1289 ofs += size_POINTER; //!*fIntegral 1290 ofs += size_POINTER; //!*fPainter 1291 //v3-05-07 : 576 = 568 + 2 * 4 = ok 1292 if(ofs!=size_TH1()) { 1293 a_out << "tools::wroot::fill_infos :" 1294 << " TH1 " << ofs << " (" << size_TH1() << " expected.)" 1295 << std::endl; 1296 }} 1297 1298 {unsigned int check = 0; 1299 //this : 1300 scs(check,"TH1F"); 1301 //base : 1302 scs(check,"TH1"); 1303 scs(check,"TArrayF"); 1304 1305 streamer_info* info = new streamer_info("TH1F",1,check); 1306 a_infos.push_back(info); 1307 int ofs = 0; 1308 info->add(new streamer_base("TH1","1-Dim histogram base class",ofs,TH1_version));ofs += size_TH1(); 1309 info->add(new streamer_base("TArrayF","Array of floats",ofs,TArrayF_version));ofs += size_TArrayF; 1310 } 1311 1312 int size_TH1D = 0; 1313 short TH1D_version = 1; 1314 {unsigned int check = 0; 1315 //this : 1316 scs(check,"TH1D"); 1317 //base : 1318 scs(check,"TH1"); 1319 scs(check,"TArrayD"); 1320 1321 streamer_info* info = new streamer_info("TH1D",TH1D_version,check); 1322 a_infos.push_back(info); 1323 int ofs = 0; 1324 info->add(new streamer_base("TH1","1-Dim histogram base class",ofs,TH1_version));ofs += size_TH1(); 1325 info->add(new streamer_base("TArrayD","Array of doubles",ofs,TArrayD_version));ofs += size_TArrayD; 1326 size_TH1D = ofs; //580 1327 1328 //v3-05-07 : 588 = 576 + 12 = ok 1329 } 1330 1331 {unsigned int check = 0; 1332 //this : 1333 scs(check,"TProfile"); 1334 //base : 1335 scs(check,"TH1D"); 1336 //members : 1337 scs(check,"fBinEntries"); 1338 scs(check,"TArrayD"); 1339 1340 scs(check,"fErrorMode"); 1341 scs(check,"EErrorType");//FIXME : ok ? 1342 1343 scs(check,"fYmin"); 1344 scs(check,"Double_t"); 1345 1346 scs(check,"fYmax"); 1347 scs(check,"Double_t"); 1348 1349 scs(check,"fTsumwy"); 1350 scs(check,"Double_t"); 1351 1352 scs(check,"fTsumwy2"); 1353 scs(check,"Double_t"); 1354 1355 streamer_info* info = new streamer_info("TProfile",4,check); 1356 a_infos.push_back(info); 1357 1358 int ofs = 0; 1359 info->add(new streamer_base("TH1D","1-Dim histograms (one double per channel)",ofs,TH1D_version));ofs += size_TH1D; 1360 info->add(new streamer_object_any("fBinEntries","number of entries per bin",ofs,"TArrayD"));ofs += size_TArrayD; 1361 info->add(new streamer_basic_type("fErrorMode","Option to compute errors",ofs,streamer__info::INT,"EErrorType"));ofs += size_INT; 1362 info->add(new streamer_double(ofs,"fYmin","Lower limit in Y (if set)")); 1363 info->add(new streamer_double(ofs,"fYmax","Upper limit in Y (if set)")); 1364 info->add(new streamer_double(ofs,"fTsumwy","Total Sum of weight*Y")); 1365 info->add(new streamer_double(ofs,"fTsumwy2","Total Sum of weight*Y*Y")); 1366 //628 1367 1368 //v3-05-07 : 624 = 612 + 4 + 8 (diff TH1D) = ok 1369 } 1370 1371 short TH2_version = 3; 1372 {unsigned int check = 0; 1373 //this : 1374 scs(check,"TH2"); 1375 //bases : 1376 scs(check,"TH1"); 1377 //members : 1378 scs(check,"fScalefactor"); 1379 scs(check,"Stat_t"); 1380 1381 scs(check,"fTsumwy"); 1382 scs(check,"Stat_t"); 1383 1384 scs(check,"fTsumwy2"); 1385 scs(check,"Stat_t"); 1386 1387 scs(check,"fTsumwxy"); 1388 scs(check,"Stat_t"); 1389 1390 streamer_info* info = new streamer_info("TH2",TH2_version,check); 1391 a_infos.push_back(info); 1392 1393 int ofs = 0; 1394 info->add(new streamer_base("TH1","1-Dim histogram base class",ofs,TH1_version));ofs += size_TH1(); 1395 info->add(new streamer_stat_t(ofs,"fScalefactor","Scale factor")); 1396 info->add(new streamer_stat_t(ofs,"fTsumwy","Total Sum of weight*Y")); 1397 info->add(new streamer_stat_t(ofs,"fTsumwy2","Total Sum of weight*Y*Y")); 1398 info->add(new streamer_stat_t(ofs,"fTsumwxy","Total Sum of weight*X*Y")); 1399 //v3-05-07 : <to be checked> 1400 if(ofs!=size_TH2()) { 1401 a_out << "tools::wroot::fill_infos :" 1402 << " TH2 " << ofs << " (" << size_TH2() << " expected.)" 1403 << std::endl; 1404 }} 1405 1406 {unsigned int check = 0; 1407 //this : 1408 scs(check,"TH2F"); 1409 //base : 1410 scs(check,"TH2"); 1411 scs(check,"TArrayF"); 1412 1413 streamer_info* info = new streamer_info("TH2F",3,check); 1414 a_infos.push_back(info); 1415 1416 int ofs = 0; 1417 info->add(new streamer_base("TH2","2-Dim histogram base class",ofs,TH2_version));ofs += size_TH2(); 1418 info->add(new streamer_base("TArrayF","Array of floats",ofs,TArrayF_version));ofs += size_TArrayF; 1419 //612 1420 1421 } 1422 1423 short TH2D_version = 3; 1424 {unsigned int check = 0; 1425 //this : 1426 scs(check,"TH2D"); 1427 //base : 1428 scs(check,"TH2"); 1429 scs(check,"TArrayD"); 1430 1431 streamer_info* info = new streamer_info("TH2D",TH2D_version,check); 1432 a_infos.push_back(info); 1433 1434 int ofs = 0; 1435 info->add(new streamer_base("TH2","2-Dim histogram base class",ofs,TH2_version));ofs += size_TH2(); 1436 info->add(new streamer_base("TArrayD","Array of doubles",ofs,TArrayD_version));ofs += size_TArrayD; 1437 if(ofs!=size_TH2D()) { 1438 a_out << "tools::wroot::fill_infos :" 1439 << " TH2D " << ofs << " (" << size_TH2D() << " expected.)" 1440 << std::endl; 1441 }} 1442 1443 {unsigned int check = 0; 1444 //this : 1445 scs(check,"TProfile2D"); 1446 //base : 1447 scs(check,"TH2D"); 1448 //members : 1449 scs(check,"fBinEntries"); 1450 scs(check,"TArrayD"); 1451 1452 scs(check,"fErrorMode"); 1453 scs(check,"EErrorType");//FIXME : ok ? 1454 1455 scs(check,"fZmin"); 1456 scs(check,"Double_t"); 1457 1458 scs(check,"fZmax"); 1459 scs(check,"Double_t"); 1460 1461 scs(check,"fTsumwz"); 1462 scs(check,"Double_t"); 1463 1464 scs(check,"fTsumwz2"); 1465 scs(check,"Double_t"); 1466 1467 streamer_info* info = new streamer_info("TProfile2D",5,check); 1468 a_infos.push_back(info); 1469 1470 int ofs = 0; 1471 info->add(new streamer_base("TH2D","2-Dim histograms (one double per channel)",ofs,TH2D_version));ofs += size_TH2D(); 1472 info->add(new streamer_object_any("fBinEntries","number of entries per bin",ofs,"TArrayD"));ofs += size_TArrayD; 1473 info->add(new sbt("fErrorMode","Option to compute errors",ofs,streamer__info::INT,"EErrorType"));ofs += size_INT; 1474 info->add(new streamer_double(ofs,"fZmin","Lower limit in Z (if set)")); 1475 info->add(new streamer_double(ofs,"fZmax","Upper limit in Z (if set)")); 1476 info->add(new streamer_double(ofs,"fTsumwz","Total Sum of weight*Z")); 1477 info->add(new streamer_double(ofs,"fTsumwz2","Total Sum of weight*Z*Z")); 1478 //660 1479 1480 } 1481 1482 int size_TH3 = 0; 1483 short TH3_version = 4; 1484 short TAtt3D_version = 1; 1485 {unsigned int check = 0; 1486 //this : 1487 scs(check,"TH3"); 1488 //bases : 1489 scs(check,"TH1"); 1490 scs(check,"TAtt3D"); 1491 //members : 1492 scs(check,"fTsumwy"); 1493 scs(check,"Double_t"); 1494 scs(check,"fTsumwy2"); 1495 scs(check,"Double_t"); 1496 scs(check,"fTsumwxy"); 1497 scs(check,"Double_t"); 1498 1499 scs(check,"fTsumwz"); 1500 scs(check,"Double_t"); 1501 scs(check,"fTsumwz2"); 1502 scs(check,"Double_t"); 1503 scs(check,"fTsumwxz"); 1504 scs(check,"Double_t"); 1505 scs(check,"fTsumwyz"); 1506 scs(check,"Double_t"); 1507 1508 streamer_info* info = new streamer_info("TH3",TH3_version,check); 1509 a_infos.push_back(info); 1510 1511 int ofs = 0; 1512 info->add(new streamer_base("TH1","1-Dim histogram base class",ofs,TH1_version));ofs += size_TH1(); 1513 info->add(new streamer_base("TAtt3D","3D attributes",ofs,TAtt3D_version));ofs += 0; 1514 info->add(new streamer_double(ofs,"fTsumwy","Total Sum of weight*Y")); 1515 info->add(new streamer_double(ofs,"fTsumwy2","Total Sum of weight*Y*Y")); 1516 info->add(new streamer_double(ofs,"fTsumwxy","Total Sum of weight*X*Y")); 1517 1518 info->add(new streamer_double(ofs,"fTsumwz","Total Sum of weight*Z")); 1519 info->add(new streamer_double(ofs,"fTsumwz2","Total Sum of weight*Z*Z")); 1520 info->add(new streamer_double(ofs,"fTsumwxz","Total Sum of weight*X*Z")); 1521 info->add(new streamer_double(ofs,"fTsumwyz","Total Sum of weight*Y*Z")); 1522 size_TH3 = ofs; //624 1523 1524 //v4-00-02 : <to be checked> 1525 } 1526 1527 {unsigned int check = 0; 1528 //this : 1529 scs(check,"TH3F"); 1530 //base : 1531 scs(check,"TH3"); 1532 scs(check,"TArrayF"); 1533 1534 streamer_info* info = new streamer_info("TH3F",3,check); 1535 a_infos.push_back(info); 1536 1537 int ofs = 0; 1538 info->add(new streamer_base("TH3","3-Dim histogram base class",ofs,TH3_version));ofs += size_TH3; 1539 info->add(new streamer_base("TArrayF","Array of floats",ofs,TArrayF_version));ofs += size_TArrayF; 1540 //636 1541 1542 } 1543 1544 {unsigned int check = 0; 1545 //this : 1546 scs(check,"TH3D"); 1547 //base : 1548 scs(check,"TH3"); 1549 scs(check,"TArrayD"); 1550 1551 streamer_info* info = new streamer_info("TH3D",3,check); 1552 a_infos.push_back(info); 1553 1554 int ofs = 0; 1555 info->add(new streamer_base("TH3","3-Dim histogram base class",ofs,TH3_version));ofs += size_TH3; 1556 info->add(new streamer_base("TArrayD","Array of doubles",ofs,TArrayD_version));ofs += size_TArrayD; 1557 //636 1558 1559 } 1560 1561 1562 } 1563 1564 inline void fill_infos(obj_list<streamer_info>& a_infos,std::ostream& a_out) { 1565 1566 fill_infos_core(a_infos,a_out); 1567 fill_infos_cont(a_infos,a_out); 1568 fill_infos_graf(a_infos,a_out); 1569 fill_infos_tree(a_infos,a_out); 1570 fill_infos_histo(a_infos,a_out); 1571 1572 } 1573 1574 }} 1575 1576 #endif