StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
StMuChainMaker Class Reference

#include <StMuChainMaker.h>

Public Member Functions

 StMuChainMaker (const char *name="MuDst")
virtual ~StMuChainMaker ()
TChain * make (string dir, string file, string filter, int maxFiles=10)
void fromFileCatalog (string file)
void fromList (string file)
void fromFile (string file)
void fromDir (string dir)
void subFilter (string filter)
string basename (string)
string dirname (string)
string buildFileName (string dir, string fileName, string extention)

Static Public Member Functions

static void setUseFileCatalog (const char *connection="mysql://")

Protected Member Functions

bool pass (string file, string *filters)
void add (StMuStringLongPairVector)
void add (StMuStringLongPair)
 This method contains a hidden assumption for STAR Scheduler purposes.

Protected Attributes

TChain * mChain
string mSubFilters [100]
string mTreeName
int mFileCounter
int mMaxFiles
StMuStringLongPairVector mFileList

Static Protected Attributes

static string mSQLConnection =""

Detailed Description

Helper class to create a TChain of Root files

Definition at line 29 of file StMuChainMaker.h.

Constructor & Destructor Documentation

StMuChainMaker::StMuChainMaker ( const char *  name = "MuDst")

Constructor: The argument 'name' is the name of the TTrees be chained

Definition at line 35 of file StMuChainMaker.cxx.

StMuChainMaker::~StMuChainMaker ( )

Destructor: The TChain will not be deleted since it is passed to the outside.

Definition at line 50 of file StMuChainMaker.cxx.

Member Function Documentation

string StMuChainMaker::basename ( string  s)

Return the input string's basename by stripping of all characters from the first '.' to the end and all characters after the last '/'.

Definition at line 73 of file StMuChainMaker.cxx.

Referenced by dirname().

string StMuChainMaker::buildFileName ( string  dir,
string  fileName,
string  extention 

Returns a full filename, simply concats the three arguments 'dir', 'fileName' and extention

Definition at line 61 of file StMuChainMaker.cxx.

string StMuChainMaker::dirname ( string  s)

Return a inputs string's directory name by erasing the basename() and all charcters after the last '/'. If the only remaining character is '/' and empty string "" will be returned.

Definition at line 91 of file StMuChainMaker.cxx.

References basename().

void StMuChainMaker::fromFileCatalog ( string  file)

get machine name

read list of files

Definition at line 266 of file StMuChainMaker.cxx.

TChain * StMuChainMaker::make ( string  dir,
string  file,
string  filter,
int  maxFiles = 10 

Parses the input strings. Multiple sub-filters will be built our of 'filter'. Here, ":" separates the individual filter strings (e.g. "MuDst:st_physics_2:raw_0001" will accept only files which have all of the sub-strings "MuDst", "st_physics_2" and "raw_0001" in them.

  • If 'file' is empty, the directory 'dir' will be scanned for files.
  • If 'file' has a substring "MuDst.root" a single file will be opened.
  • If 'file' has a substring ".lis" the file will be expected to be a list.
  • In the case 'file' is not empty, 'dir' will be ignored, hence the filenames provided have to be full filenames (including path)

A TChain will be built for files matching the sub filters (in all cases). The chain will be returned.

There are a few caveats

  • Directories 'dir' MUST be slash terminated !!!
  • You should NOT pass wildcard in any of the syntax but rather use 'dir' name, empty 'file' and a valid 'filter' as explained above.

Definition at line 126 of file StMuChainMaker.cxx.

The documentation for this class was generated from the following files: