ROOT logo
ROOT » CORE » BASE » TFileCollection

class TFileCollection: public TNamed


TFileCollection

Class that contains a list of TFileInfo's and accumulated meta
data information about its entries. This class is used to describe
file sets as stored by Grid file catalogs, by PROOF or any other
collection of TFile names.


Function Members (Methods)

public:
TFileCollection(const char* name = 0, const char* title = 0, const char* file = 0, Int_t nfiles = -1, Int_t firstfile = 1)
virtual~TFileCollection()
voidTObject::AbstractMethod(const char* method) const
Int_tAdd(TFileInfo* info)
Int_tAdd(TFileCollection* coll)
Int_tAdd(const char* path)
Int_tAddFromFile(const char* file, Int_t nfiles = -1, Int_t firstfile = 1)
Bool_tAddMetaData(TObject* meta)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
TObjString*ExportInfo(const char* name = 0, Int_t popt = 0)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Float_tGetCorruptedPercentage() const
const char*GetDefaultTreeName() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
TFileCollection*GetFilesOnServer(const char* server)
TMap*GetFilesPerServer(const char* exclude = 0, Bool_t curronly = kFALSE)
virtual const char*TObject::GetIconName() const
THashList*GetList()
TFileInfoMeta*GetMetaData(const char* meta = 0) const
virtual const char*TNamed::GetName() const
Long64_tGetNCorruptFiles() const
Long64_tGetNFiles() const
Long64_tGetNStagedFiles() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Float_tGetStagedPercentage() const
TFileCollection*GetStagedSubset()
virtual const char*TNamed::GetTitle() const
Long64_tGetTotalEntries(const char* tree) const
Long64_tGetTotalSize() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
Long64_tMerge(TCollection* list)
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
Int_tRemoveDuplicates()
voidRemoveMetaData(const char* meta = 0)
voidTObject::ResetBit(UInt_t f)
voidResetBitAll(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidSetAnchor(const char* anchor)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetBitAll(UInt_t f)
voidSetDefaultMetaData(const char* meta)
voidSetDefaultTreeName(const char* treeName)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetList(THashList* list)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector&)
virtual Int_tTNamed::Sizeof() const
voidSort(Bool_t useindex = kFALSE)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
Int_tUpdate(Long64_t avgsize = -1)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
TFileCollection(const TFileCollection&)
voidFormatSize(Long64_t bytes, TString& um, Double_t& size) const
TFileCollection&operator=(const TFileCollection&)
voidPrintDetailed(TString& showOnly) const

Data Members

public:
enum EStatusBits { kRemoteCollection
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title
private:
TStringfDefaultTreename of default tree
THashList*fList-> list of TFileInfos
TList*fMetaDataList-> generic list of file meta data object(s)
Long64_tfNCorruptFilesnumber of corrupt files
Long64_tfNFilesnumber of files ( == fList->GetEntries(), needed
Long64_tfNStagedFilesnumber of staged files
Long64_tfTotalSizetotal size of files in the list

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TFileCollection(const char* name = 0, const char* title = 0, const char* file = 0, Int_t nfiles = -1, Int_t firstfile = 1)
 TFileCollection constructor. Specify a name and title describing
 the list. If textfile is specified the file is opened and a
 TFileCollection is created containing the files in the textfile.
~TFileCollection()
 Cleanup.
Int_t Add(TFileInfo* info)
 Add TFileInfo to the collection.
Int_t Add(TFileCollection* coll)
 Add content of the TFileCollection to this collection.
Int_t AddFromFile(const char* file, Int_t nfiles = -1, Int_t firstfile = 1)
 Add file names contained in the specified text file.
 The file should contain one url per line; empty lines or lines starting with '#'
 (commented lines) are ignored.
 If nfiles > 0 only nfiles files are added, starting from file 'firstfile' (>= 1).
 The method returns the number of added files.
Int_t Add(const char* path)
 Add all files matching the specified pattern to the collection.
 'dir' can include wildcards after the last slash, which causes all
 matching files in that directory to be added.
 If dir is the full path of a file, only one element is added.
 Return value is the number of added files.
Int_t RemoveDuplicates()
 Remove duplicates based on the UUID, typically after a verification.
 Return the number of entries removed.
TFileCollection * GetStagedSubset()
 Creates a subset of the files that have the kStaged & !kCorrupted bit set.
Long64_t Merge(TCollection* list)
 Merge all TFileCollection objects in li into this TFileCollection object.
 Updates counters at the end.
 Returns the number of merged collections or -1 in case of error.
Int_t Update(Long64_t avgsize = -1)
 Update accumulated information about the elements of the collection
 (e.g. fTotalSize). If 'avgsize' > 0, use an average file size of 'avgsize'
 bytes when the size info is not available.
 Also updates the meta data information by summarizing
 the meta data of the contained objects.
 Return -1 in case of any failure, 0 if the total size is exact, 1 if
 incomplete, 2 if complete but (at least partially) estimated.
void Print(Option_t* option = "") const
 Prints the contents of the TFileCollection.
 If option contains:
      'M'             print global meta information
      'F'             print all the files in the collection in compact form
                      (current url, default tree name|class|entries, md5)
      'L'             together with 'F', print all the files in the collection
                      in long form (uuid, md5, all URLs, all meta objects; on
                      many lines)
      "filter:[SsCc]" invokes PrintDetailed() which prints out dataset
                      content in a formatted fashion by filtering on files
                      which are (S)taged or not (s), (C)orrupted or not (c)
void PrintDetailed(TString& showOnly) const
void FormatSize(Long64_t bytes, TString& um, Double_t& size) const
void SetAnchor(const char* anchor)
 Calls TUrl::SetAnchor() for all URLs contained in all TFileInfos.
void SetBitAll(UInt_t f)
 Set the bit for all TFileInfos
void ResetBitAll(UInt_t f)
 Reset the bit for all TFileInfos
const char * GetDefaultTreeName() const
 Returns the tree set with SetDefaultTreeName if set
 Returns the name of the first tree in the meta data list.
 Returns 0 in case no trees are found in the meta data list.
Long64_t GetTotalEntries(const char* tree) const
 Returns the number of entries for the specified tree (retrieved from meta data).
 If tree is not specified, use the default tree name.
 Returns -1 in case the specified tree is not found.
TFileInfoMeta * GetMetaData(const char* meta = 0) const
 Returns the meta data object with the soecified meta name.
 Returns 0 in case specified meta data is not found.
void SetDefaultMetaData(const char* meta)
 Moves the indicated meta data in the first position, so that
 it becomes efectively the default.
void RemoveMetaData(const char* meta = 0)
 Removes the indicated meta data object in all TFileInfos and this object
 If no name is given all metadata is removed
void Sort(Bool_t useindex = kFALSE)
 Sort the collection.
TObjString * ExportInfo(const char* name = 0, Int_t popt = 0)
 Export the relevant info as a string; use 'name' as collection name,
 if defined, else use GetName().
 The output object must be destroyed by the caller
TFileCollection * GetFilesOnServer(const char* server)
 Return the subset of files served by 'server'. The sysntax for 'server' is
 the standard URI one, i.e. [<scheme>://]<host>[:port]
TMap * GetFilesPerServer(const char* exclude = 0, Bool_t curronly = kFALSE)
 Return a map of TFileCollections with the files on each data server,
 excluding servers in the comma-separated list 'exclude'.
 If curronly is kTRUE, only the URL flagged as current in the TFileInfo
 are considered.
Bool_t AddMetaData(TObject* meta)
 Add's a meta data object to the file collection object. The object will be
 adopted by the TFileCollection and should not be deleted by the user.
 Typically objects of class TFileInfoMeta or derivatives should be added,
 but any class is accepted.
 NB : a call to TFileCollection::Update will remove these objects unless the
      bit TFileInfoMeta::kExternal is set.
 Returns kTRUE if successful, kFALSE otherwise.
TFileCollection(const TFileCollection& )
TFileCollection& operator=(const TFileCollection& )
THashList * GetList()
{ return fList; }
void SetList(THashList* list)
{ fList = list; }
Long64_t GetTotalSize() const
{ return fTotalSize; }
Long64_t GetNFiles() const
{ return fNFiles; }
Long64_t GetNStagedFiles() const
{ return fNStagedFiles; }
Long64_t GetNCorruptFiles() const
{ return fNCorruptFiles; }
Float_t GetStagedPercentage() const
{ return (fNFiles > 0) ? 100. * fNStagedFiles / fNFiles : 0; }
Float_t GetCorruptedPercentage() const
{ return (fNFiles > 0) ? 100. * fNCorruptFiles / fNFiles : 0; }
void SetDefaultTreeName(const char* treeName)
{ fDefaultTree = treeName; }