AliPhysics  8d00e07 (8d00e07)
ChainBuilder Struct Reference

Public Types

enum  {
  kVerbose = 0x1, kRecursive = 0x2, kMC = 0x4, kCheck = 0x8,
  kClean = 0x10, kScan = 0x20, kTrRef = 0x40, kRemote = 0x80
}
 
enum  {
  kInvalid, kDirectory, kXML, kAscii,
  kROOT, kZip
}
 

Static Public Member Functions

static UShort_t CheckSource (TString &src, UShort_t flags)
 
static TChainCreate (const TUrl &url)
 
static TChainCreate (const TString &src, const TString &treeName, const TString &pattern, Bool_t mc, Bool_t recursive, Bool_t verbose=false, Bool_t checkFiles=false, Bool_t removeFiles=false, Bool_t trackRefs=false, Bool_t remote=false)
 
static TChainCreate (UShort_t type, const TString &src, const TString &treeName, const TString &pattern, Bool_t mc, Bool_t recursive, Bool_t verbose=false, Bool_t checkFiles=false, Bool_t removeFiles=false, Bool_t trackRefs=false, Bool_t remote=false)
 
static TChainCreate (UShort_t type, const TString &src, const TString &treeName, const TString &pattern, UShort_t flags)
 
static void CreateCollection (const TString &output, const TUrl &url, const char *remote=0)
 
static void CreateCollection (const TString &output, const TChain *chain, const char *remote=0)
 
static void ExtractAnchor (TString &src, TString &anchor)
 
static Bool_t CreateFromFile (TChain *chain, const TString &src, const TString &anchor, UShort_t flags=0)
 
static Bool_t CreateFromXML (TChain *chain, const TString &src)
 
static Bool_t CreateFromList (TChain *chain, const TString &src, UShort_t flags=0)
 
static Bool_t CreateFromDirectory (TChain *chain, const TString &src, const TString &pattern, const TString &anchor, UShort_t flags)
 
static void RemoveFile (const TString &path)
 
static TFileCollection * Remotify (TFileCollection *fc, const char *remote=0)
 
static Bool_t CheckFile (const TString &path, const TString &anchor, TChain *chain, UShort_t flags=0)
 
static Bool_t ScanDirectory (TChain *chain, TSystemDirectory *dir, const TString &pattern, const TString &anchor, UShort_t flags)
 

Detailed Description

Build a chain

Definition at line 60 of file ChainBuilder.C.

Member Enumeration Documentation

anonymous enum
Enumerator
kVerbose 
kRecursive 
kMC 
kCheck 
kClean 
kScan 
kTrRef 
kRemote 

Definition at line 62 of file ChainBuilder.C.

anonymous enum
Enumerator
kInvalid 
kDirectory 
kXML 
kAscii 
kROOT 
kZip 

Definition at line 72 of file ChainBuilder.C.

Member Function Documentation

static Bool_t ChainBuilder::CheckFile ( const TString path,
const TString anchor,
TChain chain,
UShort_t  flags = 0 
)
inlinestatic

Check if we can add a file to the chain

Parameters
pathFull path to file
anchorAnchor (tree name)
chainChain
flagsSome flags
Returns
true on success, false otherwise

Definition at line 605 of file ChainBuilder.C.

static UShort_t ChainBuilder::CheckSource ( TString src,
UShort_t  flags 
)
inlinestatic

Definition at line 81 of file ChainBuilder.C.

Referenced by CreateFileCollection(), and Railway::LocalChain().

static TChain* ChainBuilder::Create ( const TUrl url)
inlinestatic

Create a TChain from a URL specification.

The URL should have the format

*   PROTOCOL://PATH?OPTIONS#TREENAME
* 

where

  • PROTOCOL is any protocol
  • PATH is a file, top-directory, file containing a TFileCollection, ASCII file with list of files, etc.
  • OPTIONS is a list of options, separate by &
  • TREENAME is the tree name

OPTIONS can be one or more of

  • mc Also check for auxiliary MC files
  • recursive When scanning directories, do so recursively
  • verbose Be verbose
  • check Check files by trying to open them
  • clean Remove invalid files
  • trackref For MC input, insist on TrackRefs.root presence
  • pattern=PATTERN Search pattern when scanning directories
Parameters
urlThe input url
Returns
Pointer to newly allocated TChain object or null

Definition at line 155 of file ChainBuilder.C.

Referenced by CreateFileCollection(), and Railway::LocalChain().

static TChain* ChainBuilder::Create ( const TString src,
const TString treeName,
const TString pattern,
Bool_t  mc,
Bool_t  recursive,
Bool_t  verbose = false,
Bool_t  checkFiles = false,
Bool_t  removeFiles = false,
Bool_t  trackRefs = false,
Bool_t  remote = false 
)
inlinestatic

Create a chain

Parameters
srcSource
treeNameTree name
patternPattern for scans
mcIf true, check for MC files
recursiveIf true, scan recursively
verboseIf true, be verbose
checkFilesIf true, check that files can be opened
removeFilesIf true, remove bad files
trackRefsIf true, look for track references too
remoteFor remote access
Returns
Pointer to newly allocated TChain or null

Definition at line 209 of file ChainBuilder.C.

static TChain* ChainBuilder::Create ( UShort_t  type,
const TString src,
const TString treeName,
const TString pattern,
Bool_t  mc,
Bool_t  recursive,
Bool_t  verbose = false,
Bool_t  checkFiles = false,
Bool_t  removeFiles = false,
Bool_t  trackRefs = false,
Bool_t  remote = false 
)
inlinestatic

Create a chain

Parameters
typeType of input
srcSource
treeNameTree name
patternPattern for scans
mcIf true, check for MC files
recursiveIf true, scan recursively
verboseIf true, be verbose
checkFilesIf true, check that files can be opened
removeFilesIf true, remove bad files
trackRefsIf true, look for track references too
remoteFor remote access
Returns
Pointer to newly allocated TChain or null

Definition at line 252 of file ChainBuilder.C.

static TChain* ChainBuilder::Create ( UShort_t  type,
const TString src,
const TString treeName,
const TString pattern,
UShort_t  flags 
)
inlinestatic

Create a chain from the inputs

Parameters
typeType of input
srcSource
treeNameTree name
patternPattern for scans
flagsFlags
Returns
Pointer to newly allocated TChain object or null

Definition at line 293 of file ChainBuilder.C.

static void ChainBuilder::CreateCollection ( const TString output,
const TUrl url,
const char *  remote = 0 
)
inlinestatic

Create a collection

Parameters
outputOutput file
urlInput url
remoteFor remote access

Definition at line 364 of file ChainBuilder.C.

Referenced by CreateIndex().

static void ChainBuilder::CreateCollection ( const TString output,
const TChain chain,
const char *  remote = 0 
)
inlinestatic

Create a collection

Parameters
outputInput url
chainChain to make collection from
remoteFor remote access

Definition at line 381 of file ChainBuilder.C.

static Bool_t ChainBuilder::CreateFromDirectory ( TChain chain,
const TString src,
const TString pattern,
const TString anchor,
UShort_t  flags 
)
inlinestatic

Make a chain from a base directory, pattern, and treename - possibly recursively

Returns
true on success

Definition at line 538 of file ChainBuilder.C.

static Bool_t ChainBuilder::CreateFromFile ( TChain chain,
const TString src,
const TString anchor,
UShort_t  flags = 0 
)
inlinestatic

Create a chain consiting of a single file

Parameters
chainThe chain
anchorAnchor (tree name)
srcFile name.
flagsFlags
Returns
Chain or null

Definition at line 458 of file ChainBuilder.C.

static Bool_t ChainBuilder::CreateFromList ( TChain chain,
const TString src,
UShort_t  flags = 0 
)
inlinestatic

Create a chain from a file containing a list of files

Returns
Newly allocated chain or null

Definition at line 505 of file ChainBuilder.C.

static Bool_t ChainBuilder::CreateFromXML ( TChain chain,
const TString src 
)
inlinestatic

Create a chain from an XML containing an collection

Returns
Newly allocated chain or null

Definition at line 474 of file ChainBuilder.C.

static void ChainBuilder::ExtractAnchor ( TString src,
TString anchor 
)
inlinestatic

Exrtact the anchor

Parameters
srcSource url
anchorOn return, contains the anchor

Definition at line 435 of file ChainBuilder.C.

static TFileCollection* ChainBuilder::Remotify ( TFileCollection *  fc,
const char *  remote = 0 
)
inlinestatic

Definition at line 565 of file ChainBuilder.C.

static void ChainBuilder::RemoveFile ( const TString path)
inlinestatic

Definition at line 557 of file ChainBuilder.C.

static Bool_t ChainBuilder::ScanDirectory ( TChain chain,
TSystemDirectory *  dir,
const TString pattern,
const TString anchor,
UShort_t  flags 
)
inlinestatic

Scan directory dir (possibly recursive) for tree files to add to the chain. This does not follow sym-links

Parameters
dirDirectory to scan
chainChain to add to
patternFile name pattern
anchorAnchor (tree name)
flagsFlags
Returns
true if any files where added

Definition at line 707 of file ChainBuilder.C.


The documentation for this struct was generated from the following file: