Logo ROOT  
Reference Guide
TEventIter.cxx
Go to the documentation of this file.
1// @(#)root/proofplayer:$Id$
2// Author: Maarten Ballintijn 07/01/02
3// Modified: Long Tran-Thanh 04/09/07 (Addition of TEventIterUnit)
4
5/*************************************************************************
6 * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers. *
7 * All rights reserved. *
8 * *
9 * For the licensing terms see $ROOTSYS/LICENSE. *
10 * For the list of contributors see $ROOTSYS/README/CREDITS. *
11 *************************************************************************/
12
13/** \class TEventIter
14\ingroup proofkernel
15
16Special iterator class used in TProofPlayer to iterate over events
17or objects in the packets.
18
19*/
20
21#include "TEnv.h"
22#include "TEventIter.h"
23#include "TFriendElement.h"
24#include "TCollection.h"
25#include "TDSet.h"
26#include "TFile.h"
27#include "TKey.h"
28#include "TProofDebug.h"
29#include "TSelector.h"
30#include "TTimeStamp.h"
31#include "TTree.h"
32#include "TTreeCache.h"
33#include "TTreeCacheUnzip.h"
34#include "TVirtualPerfStats.h"
35#include "TEventList.h"
36#include "TEntryList.h"
37#include "TList.h"
38#include "TMap.h"
39#include "TObjString.h"
40#include "TRegexp.h"
41#include "TProofServ.h"
42#include "TSystem.h"
43
44#include "TError.h"
45
46#if defined(R__MACOSX)
47#include "fcntl.h"
48#endif
49
51
52////////////////////////////////////////////////////////////////////////////////
53/// Default constructor
54
56{
57 fDSet = 0;
58 fElem = 0;
59 fFile = 0;
60 fDir = 0;
61 fSel = 0;
62 fFirst = 0;
63 fCur = -1;
64 fNum = 0;
65 fStop = kFALSE;
66 fOldBytesRead = 0;
67 fEventList = 0;
68 fEventListPos = 0;
69 fEntryList = 0;
70 fEntryListPos = 0;
71 fElemFirst = 0;
72 fElemNum = 0;
73 fElemCur = -1;
75
76 if ((fPackets = new TList)) {
77 TString n("ProcessedPackets_");
80 Info("TEventIter", "fPackets list '%s' created", n.Data());
81 } else {
82 Warning("TEventIter", "fPackets list could not be created");
83 }
84}
85
86////////////////////////////////////////////////////////////////////////////////
87/// Constructor
88
90 : fDSet(dset), fSel(sel)
91{
92 fElem = 0;
93 fFile = 0;
94 fDir = 0;
95 fFirst = first;
96 fCur = -1;
97 fNum = num;
98 fStop = kFALSE;
99 fEventList = 0;
100 fEventListPos = 0;
101 fEntryList = 0;
102 fEntryListPos = 0;
103 fOldBytesRead = 0;
104 fElemFirst = 0;
105 fElemNum = 0;
106 fElemCur = -1;
108
109 if ((fPackets = new TList)) {
110 TString n("ProcessedPackets_");
113 Info("TEventIter", "fPackets list '%s' created", n.Data());
114 } else {
115 Warning("TEventIter", "fPackets list could not be created");
116 }
117}
118
119////////////////////////////////////////////////////////////////////////////////
120/// Destructor
121
123{
124 if (fPackets) {
127 }
128 delete fFile;
129}
130
131////////////////////////////////////////////////////////////////////////////////
132/// Invalidated the current packet (if any) by setting the TDSetElement::kCorrupted bit
133
135{
137}
138
139////////////////////////////////////////////////////////////////////////////////
140/// Set flag to stop the process
141
143{
144 fStop = kTRUE;
145}
146
147////////////////////////////////////////////////////////////////////////////////
148/// Create and instance of the appropriate iterator
149
151{
152 if (dset->TestBit(TDSet::kEmpty)) {
153 return new TEventIterUnit(dset, sel, num);
154 } else if (dset->IsTree()) {
155 return new TEventIterTree(dset, sel, first, num);
156 } else {
157 return new TEventIterObj(dset, sel, first, num);
158 }
159}
160
161////////////////////////////////////////////////////////////////////////////////
162/// Load directory
163
165{
166 Int_t ret = 0;
167
168 // Check Filename
169 if ( fFile == 0 || fFilename != fElem->GetFileName() ) {
170 fDir = 0;
171 delete fFile; fFile = 0;
172
174
175 TDirectory *dirsave = gDirectory;
176
177 Double_t start = 0;
178 if (gPerfStats) start = TTimeStamp();
179
180 // Take into acoount possible prefixes
182 TString fname = gEnv->GetValue("Path.Localroot","");
183 if (!fname.IsNull())
184 typ = TFile::GetType(fFilename, "", &fname);
185 if (typ != TFile::kLocal)
186 fname = fFilename;
187 fFile = TFile::Open(fname);
188
189 if (gPerfStats) {
190 gPerfStats->FileOpenEvent(fFile, fFilename, start);
191 fOldBytesRead = 0;
192 }
193
194 if (dirsave) dirsave->cd();
195
196 if (!fFile || fFile->IsZombie() ) {
197 if (fFile)
198 Error("Process","Cannot open file: %s (%s)",
199 fFilename.Data(), strerror(fFile->GetErrno()) );
200 else
201 Error("Process","Cannot open file: %s (errno unavailable)",
202 fFilename.Data());
203 // cleanup ?
204 return -1;
205 }
206 PDB(kLoop,2) Info("LoadDir","Opening file: %s", fFilename.Data() );
207 ret = 1;
208 }
209
210 // Check Directory
211 if ( fDir == 0 || fPath != fElem->GetDirectory() ) {
212 TDirectory *dirsave = gDirectory;
213
215 if ( !fFile->cd(fPath) ) {
216 Error("Process","Cannot cd to: %s",
217 fPath.Data() );
218 return -1;
219 }
220 PDB(kLoop,2) Info("Process","Cd to: %s", fPath.Data() );
222 if (dirsave) dirsave->cd();
223 ret = 1;
224 }
225
226 return ret;
227}
228
229//______________________________________________________________________________
231{
232 // Get the entry number, taking into account event/entry lists
233
234 Long64_t entry = next;
235 // Set entry number; if data iteration we may need to test the entry or event lists
237 if (fEntryList){
238 entry = fEntryList->GetEntry(next);
239 } else if (fEventList) {
240 entry = fEventList->GetEntry(next);
241 }
242 }
243 // Pre-event processing
244 PreProcessEvent(entry);
245 // Done
246 return entry;
247}
248
249//------------------------------------------------------------------------
250
251
253
254////////////////////////////////////////////////////////////////////////////////
255/// Default constructor
256
258{
259 fDSet = 0;
260 fElem = 0;
261 fSel = 0;
262 fNum = 0;
263 fCurrent = 0;
264 fStop = kFALSE;
265 fOldBytesRead = 0; // Measures the bytes written
266}
267
268////////////////////////////////////////////////////////////////////////////////
269/// Main constructor
270
272{
273 fDSet = dset;
274 fElem = 0;
275 fSel = sel;
276 fNum = num;
277 fCurrent = 0;
278 fStop = kFALSE;
279 fOldBytesRead = 0; // Measures the bytes written
280}
281
282////////////////////////////////////////////////////////////////////////////////
283/// Get loop range
284
286{
287 if (gPerfStats) {
288 Long64_t totBytesWritten = TFile::GetFileBytesWritten();
289 Long64_t bytesWritten = totBytesWritten - fOldBytesRead;
290 PDB(kLoop, 2) Info("GetNextPacket", "bytes written: %lld", bytesWritten);
291 gPerfStats->SetBytesRead(bytesWritten);
292 fOldBytesRead = totBytesWritten;
293 }
294
296 if (fElem) {
297 if (fPackets) {
299 PDB(kLoop, 2)
300 Info("GetNextEvent", "packet added to list (sz: %d)", fPackets->GetSize());
301 fElem = 0;
302 } else {
304 }
305 return -1;
306 } else {
307 fElem = new TDSetElement("", "", "", 0, fNum);
309 }
310 } else {
311 if (fPackets && fElem) {
313 PDB(kLoop, 2)
314 Info("GetNextEvent", "packet added to list (sz: %d)", fPackets->GetSize());
315 fElem = 0;
316 } else {
318 }
319 if (!(fElem = fDSet->Next()))
320 return -1;
321 }
323
325 Error("GetNextPacket", "data element must be set to kEmtpy");
326 return -1;
327 }
328
329 // Set output
330 num = fElem->GetNum();
331 if (num == 0) return -1;
332 fst = fElem->GetFirst();
333
334 // Done
335 return 0;
336}
337
338////////////////////////////////////////////////////////////////////////////////
339/// Get next event
340
342{
343 if (fStop || fNum == 0)
344 return -1;
345
347
348 while (fElem == 0 || fCurrent == 0) {
349
350 if (gPerfStats) {
351 Long64_t totBytesWritten = TFile::GetFileBytesWritten();
352 Long64_t bytesWritten = totBytesWritten - fOldBytesRead;
353 PDB(kLoop, 2) Info("GetNextEvent", "bytes written: %lld", bytesWritten);
354 gPerfStats->SetBytesRead(bytesWritten);
355 fOldBytesRead = totBytesWritten;
356 }
357
359 if (fElem) {
360 if (fPackets) {
362 PDB(kLoop, 2)
363 Info("GetNextEvent", "packet added to list (sz: %d)", fPackets->GetSize());
364 fElem = 0;
365 } else {
367 }
368 return -1;
369 } else {
370 fElem = new TDSetElement("", "", "", 0, fNum);
372 }
373 } else {
374 if (fPackets && fElem) {
376 PDB(kLoop, 2)
377 Info("GetNextEvent", "packet added to list (sz: %d)", fPackets->GetSize());
378 fElem = 0;
379 } else {
381 }
382 if (!(fElem = fDSet->Next()))
383 return -1;
384 }
386
388 Error("GetNextEvent", "data element must be set to kEmtpy");
389 return -1;
390 }
391
392 fNum = fElem->GetNum();
393 if (!(fCurrent = fNum)) {
394 fNum = 0;
395 return -1;
396 }
397 fFirst = fElem->GetFirst();
398 }
399 Long64_t event = fNum - fCurrent + fFirst ;
400 --fCurrent;
401 return event;
402}
403
404//------------------------------------------------------------------------
405
406
408
409////////////////////////////////////////////////////////////////////////////////
410/// Default ctor.
411
413{
414 fKeys = 0;
415 fNextKey = 0;
416 fObj = 0;
417}
418
419////////////////////////////////////////////////////////////////////////////////
420/// Constructor
421
423 : TEventIter(dset,sel,first,num)
424{
425 fClassName = dset->GetType();
426 fKeys = 0;
427 fNextKey = 0;
428 fObj = 0;
429}
430
431
432////////////////////////////////////////////////////////////////////////////////
433/// Destructor
434
436{
437 // delete fKeys ?
438 delete fNextKey;
439 delete fObj;
440}
441
442////////////////////////////////////////////////////////////////////////////////
443/// Get loop range
444
446{
448
449 if (fStop || fNum == 0) return -1;
450
451 while (fElem == 0 || fCur < fFirst-1) {
452
453 if (gPerfStats && fFile) {
454 Long64_t bytesRead = fFile->GetBytesRead();
455 gPerfStats->SetBytesRead(bytesRead - fOldBytesRead);
456 fOldBytesRead = bytesRead;
457 }
458
459 if (fElem) {
460 // Save it to the list of processed packets
461 if (fPackets) {
463 fElem = 0;
464 } else {
466 }
467 }
469 if (fElem && fElem->GetEntryList()) {
470 Error("GetNextPacket", "entry- or event-list not available");
471 return -1;
472 }
473
474 if ( fElem == 0 ) {
475 fNum = 0;
476 return -1;
477 }
479
480 Int_t r = LoadDir();
481
482 if ( r == -1 ) {
483
484 // Error has been reported
485 fNum = 0;
486 return -1;
487
488 } else if ( r == 1 ) {
489
490 // New file and/or directory
492 fNextKey = new TIter(fKeys);
493 }
494
495 // Validate values for this element
497 fElemNum = fElem->GetNum();
498 if (fElem->GetEntryList()) {
499 if (!(fEntryList = dynamic_cast<TEntryList *>(fElem->GetEntryList())))
500 fEventList = dynamic_cast<TEventList *>(fElem->GetEntryList());
501 }
502 fEventListPos = 0;
503 if (fEntryList)
505 else if (fEventList)
507
508 Long64_t tnum = fKeys->GetSize();
509
510 if ( fElemFirst > tnum ) {
511 Error("GetNextPacket","First (%lld) higher then number of keys (%lld) in %s",
512 fElemFirst, tnum, fElem->GetName());
513 fNum = 0;
514 return -1;
515 }
516
517 if ( fElemNum == -1 ) {
518 fElemNum = tnum - fElemFirst;
519 } else if ( fElemFirst+fElemNum > tnum ) {
520 Error("GetNextPacket","Num (%lld) + First (%lld) larger then number of keys (%lld) in %s",
522 fElemNum = tnum - fElemFirst;
523 }
524
525 // Skip this element completely?
526 if ( fCur + fElemNum < fFirst ) {
527 fCur += fElemNum;
528 continue;
529 }
530
531 // Position within this element
532 fNextKey->Reset();
533 for(fElemCur = -1; fElemCur < fElemFirst-1 ; fElemCur++, fNextKey->Next()) { }
534 }
535
536 first = ++fElemCur;
537 num = fElemNum;
538
539 // Done
540 return 0;
541}
542////////////////////////////////////////////////////////////////////////////////
543/// To be executed before by TProofPlayer calling TSelector::Process
544
546{
547 --fNum;
548 ++fCur;
549 TKey *key = (TKey*) fNextKey->Next();
550 TDirectory *dirsave = gDirectory;
551 fDir->cd();
552 fObj = key->ReadObj();
553 if (dirsave) dirsave->cd();
555}
556
557////////////////////////////////////////////////////////////////////////////////
558/// Get next event
559
561{
562 if (fStop || fNum == 0) return -1;
563
565
566 while ( fElem == 0 || fElemNum == 0 || fCur < fFirst-1 ) {
567
568 if (gPerfStats && fFile) {
569 Long64_t bytesRead = fFile->GetBytesRead();
570 gPerfStats->SetBytesRead(bytesRead - fOldBytesRead);
571 fOldBytesRead = bytesRead;
572 }
573
574 if (fElem) {
575 // Save it to the list of processed packets
576 if (fPackets) {
578 fElem = 0;
579 } else {
581 }
582 }
584 if (fElem && fElem->GetEntryList()) {
585 Error("GetNextEvent", "Entry- or event-list not available");
586 return -1;
587 }
588
589 if ( fElem == 0 ) {
590 fNum = 0;
591 return -1;
592 }
594
595 Int_t r = LoadDir();
596
597 if ( r == -1 ) {
598
599 // Error has been reported
600 fNum = 0;
601 return -1;
602
603 } else if ( r == 1 ) {
604
605 // New file and/or directory
607 fNextKey = new TIter(fKeys);
608 }
609
610 // Validate values for this element
612 fElemNum = fElem->GetNum();
613 if (fElem->GetEntryList()) {
614 if (!(fEntryList = dynamic_cast<TEntryList *>(fElem->GetEntryList())))
615 fEventList = dynamic_cast<TEventList *>(fElem->GetEntryList());
616 }
617 fEventListPos = 0;
618 if (fEntryList)
620 else if (fEventList)
622
623 Long64_t num = fKeys->GetSize();
624
625 if ( fElemFirst > num ) {
626 Error("GetNextEvent","First (%lld) higher then number of keys (%lld) in %s",
627 fElemFirst, num, fElem->GetName());
628 fNum = 0;
629 return -1;
630 }
631
632 if ( fElemNum == -1 ) {
633 fElemNum = num - fElemFirst;
634 } else if ( fElemFirst+fElemNum > num ) {
635 Error("GetNextEvent","Num (%lld) + First (%lld) larger then number of keys (%lld) in %s",
637 fElemNum = num - fElemFirst;
638 }
639
640 // Skip this element completely?
641 if ( fCur + fElemNum < fFirst ) {
642 fCur += fElemNum;
643 continue;
644 }
645
646 // Position within this element. TODO: more efficient?
647 fNextKey->Reset();
648 for(fElemCur = -1; fElemCur < fElemFirst-1 ; fElemCur++, fNextKey->Next()) { }
649 }
650
651 --fElemNum;
652 ++fElemCur;
653
654 // Pre-event processing
656
657 return fElemCur;
658}
659
660//------------------------------------------------------------------------
661
662////////////////////////////////////////////////////////////////////////////////
663/// Default ctor.
664
666 : TNamed(name, ""), fUsed(kFALSE), fIsLocal(islocal), fFile(f)
667{
668 fTrees = new TList;
669 fTrees->SetOwner();
670}
671////////////////////////////////////////////////////////////////////////////////
672/// Default dtor.
673
675{
676 // Avoid destroying the cache; must be placed before deleting the trees
677 TTree *tree = (TTree *)fTrees->First();
678 while (tree) {
680 tree = (TTree *)fTrees->After(tree);
681 }
682 SafeDelete(fTrees);
684}
685
687
688////////////////////////////////////////////////////////////////////////////////
689/// Default ctor.
690
692{
693 fTree = 0;
694 fTreeCache = 0;
695 fUseTreeCache = 1;
696 fCacheSize = -1;
698 fFileTrees = 0;
702}
703
704////////////////////////////////////////////////////////////////////////////////
705/// Constructor
706
708 : TEventIter(dset,sel,first,num)
709{
710 fTreeName = dset->GetObjName();
711 fTree = 0;
712 fTreeCache = 0;
714 fFileTrees = new TList;
716 fUseTreeCache = gEnv->GetValue("ProofPlayer.UseTreeCache", 1);
717 fCacheSize = gEnv->GetValue("ProofPlayer.CacheSize", -1);
718 fUseParallelUnzip = gEnv->GetValue("ProofPlayer.UseParallelUnzip", 0);
719 if (fUseParallelUnzip) {
721 } else {
723 }
724 fDontCacheFiles = gEnv->GetValue("ProofPlayer.DontCacheFiles", 0);
726}
727
728////////////////////////////////////////////////////////////////////////////////
729/// Destructor
730
732{
733 // Delete the tree cache ...
735 // ... and the remaining open files
737}
738
739////////////////////////////////////////////////////////////////////////////////
740/// Return the size in bytes of the cache, if any
741/// Return -1 if not used
742
744{
745 if (fUseTreeCache) return fCacheSize;
746 return -1;
747}
748
749////////////////////////////////////////////////////////////////////////////////
750/// Return the number of entries in the learning phase
751
753{
755}
756
757////////////////////////////////////////////////////////////////////////////////
758/// Create a Tree for the main TDSetElement and for all the friends.
759/// Returns the main tree or 0 in case of an error.
760
762{
763 // Reset used flags
764 TIter nxft(fFileTrees);
765 TFileTree *ft = 0;
766 while ((ft = (TFileTree *)nxft()))
767 ft->fUsed = kFALSE;
768
769 Bool_t localfile = kFALSE;
770 TTree* main = Load(elem, localfile);
771
772 if (main && main != fTree) {
773 // Set the file cache
774 if (fUseTreeCache) {
775 TFile *curfile = main->GetCurrentFile();
776 if (curfile) {
777 if (!fTreeCache) {
778 main->SetCacheSize(fCacheSize);
779 fTreeCache = (TTreeCache *)curfile->GetCacheRead(main);
780 if (fCacheSize < 0) fCacheSize = main->GetCacheSize();
781 } else {
783 curfile->SetCacheRead(fTreeCache, main);
785 }
786 if (fTreeCache) {
789 Info("GetTrees","the tree cache is in learning phase");
790 }
791 } else {
792 Warning("GetTrees", "default tree does nto have a file attached: corruption? Tree cache untouched");
793 }
794 } else {
795 // Disable the cache
796 main->SetCacheSize(0);
797 }
798 }
799 Bool_t loc = kFALSE;
800 // Also the friends
801 TList *friends = elem->GetListOfFriends();
802 if (friends) {
803 TIter nxf(friends);
804 TDSetElement *dse = 0;
805 while ((dse = (TDSetElement *) nxf())) {
806 // The alias, if any, is in the element name options ('friend_alias=<alias>|')
807 TUrl uf(dse->GetName());
808 TString uo(uf.GetOptions()), alias;
809 Int_t from = kNPOS;
810 if ((from = uo.Index("friend_alias=")) != kNPOS) {
811 from += strlen("friend_alias=");
812 if (!uo.Tokenize(alias, from, "|"))
813 Warning("GetTrees", "empty 'friend_alias' found for tree friend");
814 // The options may be used for other things, so remove the internal strings once decoded
815 uo.ReplaceAll(TString::Format("friend_alias=%s|", alias.Data()), "");
816 uf.SetOptions(uo);
817 dse->SetName(uf.GetUrl());
818 }
819 TTree *friendTree = Load(dse, loc, dse->GetObjName());
820 if (friendTree && main) {
821 // Make sure it has not yet been added
822 Bool_t addfriend = kTRUE;
823 TList *frnds = main->GetListOfFriends();
824 if (frnds) {
825 TIter xnxf(frnds);
826 TFriendElement *fe = 0;
827 while ((fe = (TFriendElement *) xnxf())) {
828 if (fe->GetTree() == friendTree) {
829 addfriend = kFALSE;
830 break;
831 }
832 }
833 }
834 if (addfriend) {
835 if (alias.IsNull())
836 main->AddFriend(friendTree);
837 else
838 main->AddFriend(friendTree, alias);
839 }
840 } else {
841 return 0;
842 }
843 }
844 }
845
846 // Remove instances not used
847 nxft.Reset();
848 while ((ft = (TFileTree *)nxft())) {
849 if (!(ft->fUsed)) {
850 fFileTrees->Remove(ft);
851 delete ft;
852 }
853 }
854
855 // Done, successfully or not
856 return main;
857}
858
859////////////////////////////////////////////////////////////////////////////////
860/// Load a tree from s TDSetElement
861
862TTree* TEventIterTree::Load(TDSetElement *e, Bool_t &localfile, const char *objname)
863{
864 if (!e) {
865 Error("Load", "undefined element");
866 return (TTree *)0;
867 }
868
869 const char *fn = e->GetFileName();
870 const char *dn = e->GetDirectory();
871 const char *tn = 0;
872 if (objname && strlen(objname) > 0) {
873 tn = objname;
874 } else {
875 tn = (fDSet->GetObjName() && strlen(fDSet->GetObjName()) > 0)
876 ? fDSet->GetObjName() : e->GetObjName();
877 if (!tn || (tn && strlen(tn) <= 0)) tn = "*";
878 }
879 PDB(kLoop,2)
880 Info("Load","loading: fn:'%s' dn:'%s' tn:'%s'", fn, dn, tn);
881
882 TFile *f = 0;
883
884 // Check if the file is already open
885 TString names(fn);
887 Ssiz_t from = 0;
888 TFileTree *ft = 0;
889 while (names.Tokenize(name,from,"|")) {
890 TString key(TUrl(name).GetFileAndOptions());
891 if ((ft = (TFileTree *) fFileTrees->FindObject(key.Data()))) {
892 f = ft->fFile;
893 break;
894 }
895 }
896
897 // Open the file, if needed
898 if (!f) {
900 TString fname = gEnv->GetValue("Path.Localroot","");
901 if (!fname.IsNull())
902 typ = TFile::GetType(fn, "", &fname);
903 if (typ != TFile::kLocal) {
904 fname = fn;
905 } else {
906 localfile = kTRUE;
907 }
908
909 // Open the file
910 f = TFile::Open(fname);
911 if (!f) {
912 Error("Load","file '%s' ('%s') could not be open", fn, fname.Data());
913 return (TTree *)0;
914 }
915
916#if defined(R__MACOSX)
917 // If requested set the no cache mode
918 if (fDontCacheFiles && localfile) {
919 fcntl(f->GetFd(), F_NOCACHE, 1);
920 }
921#endif
922
923 // Create TFileTree instance in the list
924 ft = new TFileTree(TUrl(f->GetName()).GetFileAndOptions(), f, localfile);
925 fFileTrees->Add(ft);
926 } else {
927 // Fill locality boolean
928 localfile = ft->fIsLocal;
929 PDB(kLoop,2)
930 Info("Load","file '%s' already open (local:%d)", fn, localfile);
931 }
932
933 // Check if the tree is already loaded
934 if (ft && ft->fTrees->GetSize() > 0) {
935 TTree *t = 0;
936 if (!strcmp(tn, "*"))
937 t = (TTree *) ft->fTrees->First();
938 else
939 t = (TTree *) ft->fTrees->FindObject(tn);
940 if (t) {
941 ft->fUsed = kTRUE;
942 return t;
943 }
944 }
945
946 TDirectory *dd = f;
947 // Change dir, if required
948 if (dn && !(dd = f->GetDirectory(dn))) {
949 Error("Load","Cannot get to: %s", dn);
950 return (TTree *)0;
951 }
952 PDB(kLoop,2)
953 Info("Load","got directory: %s", dn);
954
955 // If a wild card we will use the first object of the type
956 // requested compatible with the reg expression we got
957 TString on(tn);
958 TString sreg(tn);
959 if (sreg.Length() <= 0 || sreg == "" || sreg.Contains("*")) {
960 if (sreg.Contains("*"))
961 sreg.ReplaceAll("*", ".*");
962 else
963 sreg = ".*";
964 TRegexp re(sreg);
965 if (dd->GetListOfKeys()) {
966 TIter nxk(dd->GetListOfKeys());
967 TKey *k = 0;
968 while ((k = (TKey *) nxk())) {
969 if (!strcmp(k->GetClassName(), "TTree")) {
970 TString kn(k->GetName());
971 if (kn.Index(re) != kNPOS) {
972 on = kn;
973 break;
974 }
975 }
976 }
977 }
978 }
979
980 // Point to the key
981 TKey *key = dd->GetKey(gSystem->BaseName(on));
982 if (key == 0) {
983 Error("Load", "Cannot find tree \"%s\" in %s", tn, fn);
984 return (TTree*)0;
985 }
986
987 PDB(kLoop,2) Info("Load", "Reading: %s", tn);
988
989 TTree *tree = dynamic_cast<TTree*> (key->ReadObj());
990 dd->cd();
991
992 if (tree == 0) {
993 Error("Load", "Cannot <dynamic_cast> obj to tree \"%s\"", tn);
994 return (TTree*)0;
995 }
996
997 // Add track in the cache
998 ft->fTrees->Add(tree);
999 ft->fUsed = kTRUE;
1000 PDB(kLoop,2)
1001 Info("Load","TFileTree for '%s' flagged as 'in-use' ...", ft->GetName());
1002
1003 // Done
1004 return tree;
1005}
1006
1007////////////////////////////////////////////////////////////////////////////////
1008/// Get loop range
1009
1011{
1012 if (first > -1) fEntryListPos = first;
1013
1014 if (fStop || fNum == 0) return -1;
1015
1016 Bool_t attach = kFALSE;
1017
1018 // When files are aborted during processing (via TSelector::kAbortFile) the player
1019 // invalidates the element by settign this bit. We need to ask for a new packet
1020 Bool_t corrupted = kFALSE;
1021 Long64_t rest = -1;
1022 if (fElem) {
1024 rest = fElem->GetNum();
1025 if (fElemCur >= 0) rest -= (fElemCur + 1 - fElemFirst);
1026 }
1027
1029
1030 while (fElem == 0 || fElemNum == 0 || fCur < fFirst-1) {
1031
1032 if (gPerfStats && fTree) {
1033 Long64_t totBytesRead = fTree->GetCurrentFile()->GetBytesRead();
1034 Long64_t bytesRead = totBytesRead - fOldBytesRead;
1035 gPerfStats->SetBytesRead(bytesRead);
1036 fOldBytesRead = totBytesRead;
1037 }
1038
1039 if (fElem) {
1040 // Save it to the list of processed packets
1041 if (fPackets) {
1042 fPackets->Add(fElem);
1043 fElem = 0;
1044 } else {
1046 }
1047 }
1048 while (!fElem) {
1049 // For a corrupted/invalid file the request for a new packet is with totalEntries = -1
1050 // (the default) so that the packetizer invalidates the element
1051 if (corrupted) {
1052 fElem = fDSet->Next(rest);
1053 } else if (fTree) {
1055 } else {
1056 fElem = fDSet->Next();
1057 }
1058
1059 if (!fElem) {
1060 // End of processing
1061 fNum = 0;
1062 return -1;
1063 }
1064 corrupted = kFALSE;
1067
1068 TTree *newTree = GetTrees(fElem);
1069 if (newTree) {
1070 if (newTree != fTree) {
1071 // The old tree is owned by TFileTree and will be deleted there
1072 fTree = newTree;
1073 attach = kTRUE;
1075 }
1076 // Set range to be analysed
1077 if (fTreeCache)
1079 fElem->GetFirst() + fElem->GetNum() - 1);
1080 } else {
1081 // Could not open this element: ask for another one
1083 // The current tree, if any, is not valid anymore
1084 fTree = 0;
1085 }
1086 }
1087
1088 // Validate values for this element
1090 fElemNum = fElem->GetNum();
1091 fEntryList = 0;
1092 fEventList = 0;
1093 if (fElem->GetEntryList()) {
1094 if (!(fEntryList = dynamic_cast<TEntryList *>(fElem->GetEntryList())))
1095 fEventList = dynamic_cast<TEventList *>(fElem->GetEntryList());
1096 }
1098 fEventListPos = 0;
1099 if (fEntryList)
1101 else if (fEventList)
1103
1104 Long64_t tnum = (Long64_t) fTree->GetEntries();
1105
1106 if (!fEntryList && !fEventList) {
1107 if ( fElemFirst > tnum ) {
1108 Error("GetNextPacket", "first (%lld) higher then number of entries (%lld) in %s",
1109 fElemFirst, tnum, fElem->GetObjName());
1110 fNum = 0;
1111 return -1;
1112 }
1113 if ( fElemNum == -1 ) {
1114 fElemNum = tnum - fElemFirst;
1115 } else if ( fElemFirst+fElemNum > tnum ) {
1116 Error("GetNextPacket", "num (%lld) + first (%lld) larger then number of entries (%lld) in %s",
1117 fElemNum, fElemFirst, tnum, fElem->GetName());
1118 fElemNum = tnum - fElemFirst;
1119 }
1120
1121 // Skip this element completely?
1122 if ( fCur + fElemNum < fFirst ) {
1123 fCur += fElemNum;
1124 continue;
1125 }
1126 // Position within this element
1127 fElemCur = fElemFirst-1;
1128 }
1129 }
1130
1131 if (attach) {
1132 PDB(kLoop,1) Info("GetNextPacket", "call Init(%p) and Notify()",fTree);
1133 fSel->Init(fTree);
1134 fSel->Notify();
1135 TIter next(fSel->GetOutputList());
1136 TEntryList *elist=0;
1137 while ((elist=(TEntryList*)next())){
1138 if (elist->InheritsFrom(TEntryList::Class()))
1139 elist->SetTree(fTree->GetName(), fElem->GetFileName());
1140 }
1142 // the error has been reported
1143 return -1;
1144 }
1145 attach = kFALSE;
1146 }
1147
1148 // Fill the output now
1149 num = fElemNum;
1150 if (fEntryList) {
1152 } else if (fEventList){
1154 } else {
1155 first = fElemFirst;
1156 }
1157
1158 // Done
1159 return 0;
1160}
1161
1162////////////////////////////////////////////////////////////////////////////////
1163/// Actions to be done just before processing entry 'entry'.
1164/// Called by TProofPlayer.
1165
1167{
1168 if (!(fEntryList || fEventList)) {
1169 --fNum;
1170 ++fCur;
1171 }
1172
1173 // Signal ending of learning phase
1175 if (!(fTreeCache->IsLearning())) {
1178 }
1179 }
1180
1181 // For prefetching
1182 if (fTree->LoadTree(entry) < 0) {
1183 Warning("PreEventProcess", "problems setting entry in TTree");
1184 }
1185}
1186
1187////////////////////////////////////////////////////////////////////////////////
1188/// Get next event
1189
1191{
1192 if (fStop || fNum == 0) return -1;
1193
1194 Bool_t attach = kFALSE;
1195
1196 // When files are aborted during processing (via TSelector::kAbortFile) the player
1197 // invalidates the element by settign this bit. We need to ask for a new packet
1199
1201
1202 while ( fElem == 0 || fElemNum == 0 || fCur < fFirst-1 || corrupted) {
1203
1204 if (gPerfStats && fTree) {
1205 Long64_t totBytesRead = fTree->GetCurrentFile()->GetBytesRead();
1206 Long64_t bytesRead = totBytesRead - fOldBytesRead;
1207 gPerfStats->SetBytesRead(bytesRead);
1208 fOldBytesRead = totBytesRead;
1209 }
1210
1211 Long64_t rest = -1;
1212 if (fElem) {
1213 rest = fElem->GetNum();
1214 if (fElemCur >= 0) rest -= (fElemCur + 1 - fElemFirst);
1215 // Save it to the list of processed packets
1216 if (fPackets) {
1217 fPackets->Add(fElem);
1218 fElem = 0;
1219 } else {
1221 }
1222 }
1223
1224 while (!fElem) {
1225 // For a corrupted/invalid file the request for a new packet is with totalEntries = -1
1226 // (the default) so that the packetizer invalidates the element
1227 if (corrupted) {
1228 fElem = fDSet->Next(rest);
1229 } else if (fTree) {
1231 } else {
1232 fElem = fDSet->Next();
1233 }
1234
1235 if (!fElem) {
1236 // End of processing
1237 fNum = 0;
1238 return -1;
1239 }
1240 corrupted = kFALSE;
1243
1244 TTree *newTree = GetTrees(fElem);
1245 if (newTree) {
1246 if (newTree != fTree) {
1247 // The old tree is owned by TFileTree and will be deleted there
1248 fTree = newTree;
1249 attach = kTRUE;
1251 }
1252 // Set range to be analysed
1253 if (fTreeCache)
1255 fElem->GetFirst() + fElem->GetNum() - 1);
1256 } else {
1257 // Could not open this element: ask for another one
1259 // The current tree, if any, is not valid anymore
1260 fTree = 0;
1261 }
1262 }
1263
1264 // Validate values for this element
1266 fElemNum = fElem->GetNum();
1267 fEntryList = dynamic_cast<TEntryList *>(fElem->GetEntryList());
1269 : dynamic_cast<TEventList *>(fElem->GetEntryList());
1271 fEventListPos = 0;
1272 if (fEntryList)
1274 else if (fEventList)
1276
1277 Long64_t num = (Long64_t) fTree->GetEntries();
1278
1279 if (!fEntryList && !fEventList) {
1280 if ( fElemFirst > num ) {
1281 Error("GetNextEvent", "first (%lld) higher then number of entries (%lld) in %s",
1282 fElemFirst, num, fElem->GetObjName());
1283 fNum = 0;
1284 return -1;
1285 }
1286 if ( fElemNum == -1 ) {
1287 fElemNum = num - fElemFirst;
1288 } else if ( fElemFirst+fElemNum > num ) {
1289 Error("GetNextEvent", "num (%lld) + first (%lld) larger then number of entries (%lld) in %s",
1290 fElemNum, fElemFirst, num, fElem->GetName());
1291 fElemNum = num - fElemFirst;
1292 }
1293
1294 // Skip this element completely?
1295 if ( fCur + fElemNum < fFirst ) {
1296 fCur += fElemNum;
1297 continue;
1298 }
1299 // Position within this element. TODO: more efficient?
1300 fElemCur = fElemFirst-1;
1301 }
1302 }
1303
1304 if ( attach ) {
1305 PDB(kLoop,1) Info("GetNextEvent", "call Init(%p) and Notify()",fTree);
1306 fSel->Init(fTree);
1307 fSel->Notify();
1308 TIter next(fSel->GetOutputList());
1309 TEntryList *elist=0;
1310 while ((elist=(TEntryList*)next())){
1311 if (elist->InheritsFrom(TEntryList::Class()))
1312 elist->SetTree(fTree->GetName(), fElem->GetFileName());
1313 }
1315 // the error has been reported
1316 return -1;
1317 }
1318 attach = kFALSE;
1319 }
1320 Long64_t rv;
1321
1322 if (fEntryList){
1323 --fElemNum;
1325 fEntryListPos++;
1326 } else if (fEventList) {
1327 --fElemNum;
1329 fEventListPos++;
1330 } else {
1331 --fElemNum;
1332 ++fElemCur;
1333 rv = fElemCur;
1334 }
1335
1336 // Pre-event processing
1337 PreProcessEvent(rv);
1338
1339 return rv;
1340}
void Class()
Definition: Class.C:29
ROOT::R::TRInterface & r
Definition: Object.C:4
#define SafeDelete(p)
Definition: RConfig.hxx:550
#define f(i)
Definition: RSha256.hxx:104
#define e(i)
Definition: RSha256.hxx:103
const Ssiz_t kNPOS
Definition: RtypesCore.h:111
int Int_t
Definition: RtypesCore.h:41
int Ssiz_t
Definition: RtypesCore.h:63
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
long long Long64_t
Definition: RtypesCore.h:69
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassImp(name)
Definition: Rtypes.h:365
#define gDirectory
Definition: TDirectory.h:223
R__EXTERN TEnv * gEnv
Definition: TEnv.h:171
char name[80]
Definition: TGX11.cxx:109
#define PDB(mask, level)
Definition: TProofDebug.h:56
R__EXTERN TProofServ * gProofServ
Definition: TProofServ.h:347
R__EXTERN TSystem * gSystem
Definition: TSystem.h:560
#define gPerfStats
void SetName(const char *name)
Definition: TCollection.h:204
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
Manages an element of a TDSet.
Definition: TDSet.h:66
const char * GetObjName() const
Definition: TDSet.h:120
Long64_t GetNum() const
Definition: TDSet.h:114
@ kEmpty
Definition: TDSet.h:73
@ kCorrupted
Definition: TDSet.h:74
@ kNewPacket
Definition: TDSet.h:76
TObject * GetEntryList() const
Definition: TDSet.h:131
virtual TList * GetListOfFriends() const
Definition: TDSet.h:108
const char * GetDirectory() const
Return directory where to look for object.
Definition: TDSet.cxx:253
const char * GetFileName() const
Definition: TDSet.h:111
Long64_t GetFirst() const
Definition: TDSet.h:112
This class implements a data set to be used for PROOF processing.
Definition: TDSet.h:153
virtual TDSetElement * Next(Long64_t totalEntries=-1)
Returns next TDSetElement.
Definition: TDSet.cxx:413
Bool_t IsTree() const
Definition: TDSet.h:225
const char * GetType() const
Definition: TDSet.h:228
const char * GetObjName() const
Definition: TDSet.h:229
@ kEmpty
Definition: TDSet.h:159
@ kIsLocal
Definition: TDSet.h:163
Bool_t cd(const char *path=nullptr) override
Change current directory to "this" directory.
Describe directory structure in memory.
Definition: TDirectory.h:34
virtual TKey * GetKey(const char *, Short_t=9999) const
Definition: TDirectory.h:158
virtual TList * GetListOfKeys() const
Definition: TDirectory.h:160
virtual Bool_t cd(const char *path=nullptr)
Change current directory to "this" directory.
Definition: TDirectory.cxx:497
A List of entry numbers in a TTree or TChain.
Definition: TEntryList.h:26
virtual void SetTree(const TTree *tree)
If a list for a tree with such name and filename exists, sets it as the current sublist If not,...
virtual Long64_t GetEntriesToProcess() const
Definition: TEntryList.h:72
virtual Long64_t GetEntry(Int_t index)
Return the number of the entry #index of this TEntryList in the TTree or TChain See also Next().
Definition: TEntryList.cxx:655
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition: TEnv.cxx:491
Int_t GetNextPacket(Long64_t &first, Long64_t &num)
Get loop range.
Definition: TEventIter.cxx:445
TEventIterObj()
Default ctor.
Definition: TEventIter.cxx:412
Long64_t GetNextEvent()
Get next event.
Definition: TEventIter.cxx:560
TList * fKeys
Definition: TEventIter.h:126
~TEventIterObj()
Destructor.
Definition: TEventIter.cxx:435
TIter * fNextKey
Definition: TEventIter.h:127
void PreProcessEvent(Long64_t)
To be executed before by TProofPlayer calling TSelector::Process.
Definition: TEventIter.cxx:545
TObject * fObj
Definition: TEventIter.h:128
TString fClassName
Definition: TEventIter.h:125
TFileTree(const char *name, TFile *f, Bool_t islocal)
Default ctor.
Definition: TEventIter.cxx:665
virtual ~TFileTree()
Default dtor.
Definition: TEventIter.cxx:674
Int_t GetNextPacket(Long64_t &first, Long64_t &num)
Get loop range.
Int_t GetLearnEntries()
Return the number of entries in the learning phase.
Definition: TEventIter.cxx:752
Bool_t fUseTreeCache
Definition: TEventIter.h:155
TString fTreeName
Definition: TEventIter.h:151
Long64_t GetCacheSize()
Return the size in bytes of the cache, if any Return -1 if not used.
Definition: TEventIter.cxx:743
Bool_t fDontCacheFiles
Definition: TEventIter.h:158
Long64_t GetNextEvent()
Get next event.
TTreeCache * fTreeCache
Definition: TEventIter.h:153
Long64_t fCacheSize
Definition: TEventIter.h:156
void PreProcessEvent(Long64_t ent)
Actions to be done just before processing entry 'entry'.
TList * fFileTrees
Definition: TEventIter.h:159
TEventIterTree()
Default ctor.
Definition: TEventIter.cxx:691
TTree * Load(TDSetElement *elem, Bool_t &localfile, const char *objname=0)
Load a tree from s TDSetElement.
Definition: TEventIter.cxx:862
Bool_t fTreeCacheIsLearning
Definition: TEventIter.h:154
~TEventIterTree()
Destructor.
Definition: TEventIter.cxx:731
TTree * fTree
Definition: TEventIter.h:152
Bool_t fUseParallelUnzip
Definition: TEventIter.h:157
TTree * GetTrees(TDSetElement *elem)
Create a Tree for the main TDSetElement and for all the friends.
Definition: TEventIter.cxx:761
Long64_t fCurrent
Definition: TEventIter.h:103
Long64_t fNum
Definition: TEventIter.h:102
Int_t GetNextPacket(Long64_t &first, Long64_t &num)
Get loop range.
Definition: TEventIter.cxx:285
Long64_t GetNextEvent()
Get next event.
Definition: TEventIter.cxx:341
TEventIterUnit()
Default constructor.
Definition: TEventIter.cxx:257
Special iterator class used in TProofPlayer to iterate over events or objects in the packets.
Definition: TEventIter.h:42
Long64_t fEntryListPos
entry list for processing
Definition: TEventIter.h:69
virtual ~TEventIter()
Destructor.
Definition: TEventIter.cxx:122
virtual Long64_t GetEntryNumber(Long64_t)
Definition: TEventIter.cxx:230
Long64_t fCur
Definition: TEventIter.h:64
TDSetElement * fElem
Definition: TEventIter.h:50
Long64_t fNum
Definition: TEventIter.h:63
TList * fPackets
current position in the entrylist
Definition: TEventIter.h:71
TEventList * fEventList
Definition: TEventIter.h:66
Long64_t fElemCur
Definition: TEventIter.h:59
Long64_t fElemFirst
Definition: TEventIter.h:57
TFile * fFile
Definition: TEventIter.h:53
virtual void StopProcess(Bool_t abort)
Set flag to stop the process.
Definition: TEventIter.cxx:142
Long64_t fFirst
Definition: TEventIter.h:62
Long64_t fOldBytesRead
Definition: TEventIter.h:54
Int_t fEventListPos
eventList for processing
Definition: TEventIter.h:67
static TEventIter * Create(TDSet *dset, TSelector *sel, Long64_t first, Long64_t num)
Create and instance of the appropriate iterator.
Definition: TEventIter.cxx:150
Bool_t fStop
Definition: TEventIter.h:65
Int_t LoadDir()
Load directory.
Definition: TEventIter.cxx:164
TString fPath
Definition: TEventIter.h:55
virtual void InvalidatePacket()
Invalidated the current packet (if any) by setting the TDSetElement::kCorrupted bit.
Definition: TEventIter.cxx:134
TString fFilename
Definition: TEventIter.h:52
TDirectory * fDir
Definition: TEventIter.h:56
TEntryList * fEntryList
current position in the eventList
Definition: TEventIter.h:68
virtual void PreProcessEvent(Long64_t)
Definition: TEventIter.h:74
TDSet * fDSet
Definition: TEventIter.h:48
TEventIter()
Default constructor.
Definition: TEventIter.cxx:55
TSelector * fSel
Definition: TEventIter.h:61
Long64_t fElemNum
Definition: TEventIter.h:58
A TEventList object is a list of selected events (entries) in a TTree.
Definition: TEventList.h:31
virtual Long64_t GetEntry(Int_t index) const
Return value of entry at index in the list.
Definition: TEventList.cxx:222
virtual Int_t GetN() const
Definition: TEventList.h:56
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:48
static Long64_t GetFileBytesWritten()
Static function returning the total number of bytes written to all files.
Definition: TFile.cxx:4399
virtual Long64_t GetBytesRead() const
Definition: TFile.h:228
virtual Int_t GetErrno() const
Method returning errno.
Definition: TFile.cxx:1143
static EFileType GetType(const char *name, Option_t *option="", TString *prefix=nullptr)
Resolve the file type as a function of the protocol field in 'name'.
Definition: TFile.cxx:4637
EFileType
File type.
Definition: TFile.h:189
@ kDefault
Definition: TFile.h:189
@ kLocal
Definition: TFile.h:189
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Definition: TFile.cxx:3923
virtual void SetCacheRead(TFileCacheRead *cache, TObject *tree=0, ECacheAction action=kDisconnect)
Set a pointer to the read cache.
Definition: TFile.cxx:2206
TFileCacheRead * GetCacheRead(const TObject *tree=nullptr) const
Return a pointer to the current read cache.
Definition: TFile.cxx:1159
A TFriendElement TF describes a TTree object TF in a file.
virtual TTree * GetTree()
Return pointer to friend TTree.
TObject * Next()
Definition: TCollection.h:249
void Reset()
Definition: TCollection.h:252
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Definition: TKey.h:24
virtual const char * GetClassName() const
Definition: TKey.h:72
virtual TObject * ReadObj()
To read a TObject* from the file.
Definition: TKey.cxx:729
A doubly linked list.
Definition: TList.h:44
virtual void Add(TObject *obj)
Definition: TList.h:87
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:819
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:575
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:656
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:866
R__ALWAYS_INLINE Bool_t IsZombie() const
Definition: TObject.h:134
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:694
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:443
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
void ResetBit(UInt_t f)
Definition: TObject.h:171
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:854
const char * GetOrdinal() const
Definition: TProofServ.h:253
void RestartComputeTime()
Reset the compute time.
Regular expression class.
Definition: TRegexp.h:31
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Definition: TSelector.h:33
virtual void SetObject(TObject *obj)
Definition: TSelector.h:67
virtual EAbort GetAbort() const
Definition: TSelector.h:75
@ kAbortProcess
Definition: TSelector.h:36
virtual void Init(TTree *)
Definition: TSelector.h:55
virtual TList * GetOutputList() const
Definition: TSelector.h:71
virtual Bool_t Notify()
This method must be overridden to handle object notification.
Definition: TSelector.h:58
Basic string class.
Definition: TString.h:131
Ssiz_t Length() const
Definition: TString.h:405
const char * Data() const
Definition: TString.h:364
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:687
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition: TString.cxx:2197
Bool_t IsNull() const
Definition: TString.h:402
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition: TString.cxx:2311
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:619
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:634
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:942
The TTimeStamp encapsulates seconds and ns since EPOCH.
Definition: TTimeStamp.h:71
static Int_t SetParallelUnzip(TTreeCacheUnzip::EParUnzipMode option=TTreeCacheUnzip::kEnable)
Static function that (de)activates multithreading unzipping.
A cache to speed-up the reading of ROOT datasets.
Definition: TTreeCache.h:35
virtual void UpdateBranches(TTree *tree)
Update pointer to current Tree and recompute pointers to the branches in the cache.
virtual void SetEntryRange(Long64_t emin, Long64_t emax)
Set the minimum and maximum entry number to be processed this information helps to optimize the numbe...
virtual Bool_t IsLearning() const
Definition: TTreeCache.h:155
virtual void ResetCache()
This will simply clear the cache.
static Int_t GetLearnEntries()
Static function returning the number of entries used to train the cache see SetLearnEntries.
A TTree represents a columnar dataset.
Definition: TTree.h:72
TFile * GetCurrentFile() const
Return pointer to the current file.
Definition: TTree.cxx:5338
virtual Long64_t GetEntries() const
Definition: TTree.h:450
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.
Definition: TTree.cxx:6329
This class represents a WWW compatible URL.
Definition: TUrl.h:35
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition: TUrl.cxx:385
const char * GetFileAndOptions() const
Return the file and its options (the string specified behind the ?).
Definition: TUrl.cxx:499
void SetOptions(const char *opt)
Definition: TUrl.h:89
const char * GetOptions() const
Definition: TUrl.h:73
int main(int argc, char **argv)
const Int_t n
Definition: legend1.C:16
Definition: first.py:1
Definition: tree.py:1