AliRoot Core  d69033e (d69033e)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliXRDPROOFtoolkit Class Reference

TOOLKIT for chain manipulation: More...

#include <AliXRDPROOFtoolkit.h>

Inheritance diagram for AliXRDPROOFtoolkit:

Public Member Functions

 AliXRDPROOFtoolkit ()
 
TDSet * MakeSet (const char *fileIn, const char *treeName, const char *fName=0, Int_t maxFiles=-1)
 
TDSet * MakeSetRandom (const char *fileIn, const char *treeName, const char *fName=0, Int_t maxFiles=-1)
 
Bool_t XRDCopyDir (const char *idir, const char *files, const char *odir, Bool_t zip)
 

Static Public Member Functions

static TChain * MakeChain (const char *fileIn, const char *treeName, const char *fName=0, Int_t maxFiles=-1, Int_t startFile=0)
 
static TChain * MakeChainRandom (const char *fileIn, const char *treeName, const char *fName=0, Int_t maxFiles=-1, Int_t startFile=0)
 
static Bool_t FilterList (const char *inputList, const char *fileList, Int_t checkLevel)
 
static Bool_t FilterListZip (const char *inputList, const char *fileList, Int_t checkLevel)
 
static Int_t CheckTreeInFile (const char *fileName, const char *treeName, Int_t debugLevel=0, const char *branchName=0)
 
static void JoinTreesIndex (const char *outputFile, const char *outputTree, const char *indexName, const char *inputTrees, Int_t debugLevel)
 
static void MakeTreeFromList (const char *fout, const char *treeOut, const char *treeIn, const char *flist, Bool_t debug)
 
static void CacheFileList (const char *fileIn, const char *cachePrefix)
 

Private Member Functions

 AliXRDPROOFtoolkit (const AliXRDPROOFtoolkit &)
 
AliXRDPROOFtoolkitoperator= (const AliXRDPROOFtoolkit &)
 

Private Attributes

Int_t fVerbose
 verbso mode - print command More...
 
TString fUserName
 user name More...
 
UserGroup_t * fUserGroup
 user group info More...
 

Detailed Description

TOOLKIT for chain manipulation:

Example usage:

  1. Check the list of files
AliXRDPROOFtoolkit::FilterList("pp.txt","AliESDs.root esdTree AliESDfriends.root * Kinematics.root *",0)
AliXRDPROOFtoolkit::FilterList("pp.txt","AliESDs.root esdTree AliESDfriends.root * Kinematics.root *",1)
2. make a chain or random chain form the list of files
TChain * chain = toolkit.MakeChain("esd.txt","esdTree",0,10)
TChain * chainRandom = toolkit.MakeChainrandom("esd.txt","esdTree",0,10)
chain->Draw("fTPCnclsF");
Author
Marian Ivanov

Definition at line 15 of file AliXRDPROOFtoolkit.h.

Constructor & Destructor Documentation

AliXRDPROOFtoolkit::AliXRDPROOFtoolkit ( )

Definition at line 71 of file AliXRDPROOFtoolkit.cxx.

AliXRDPROOFtoolkit::AliXRDPROOFtoolkit ( const AliXRDPROOFtoolkit )
private

Member Function Documentation

void AliXRDPROOFtoolkit::CacheFileList ( const char *  fileIn,
const char *  cachePrefix 
)
static

cache the list of file locally, cache valeus are stored in the location specified by optional argumen prefix 2 new files are created <fileIn>.cache - file with the location of cahe files <fileIn>.cacheLog - log file +list of files which can not be cached

Definition at line 717 of file AliXRDPROOFtoolkit.cxx.

Int_t AliXRDPROOFtoolkit::CheckTreeInFile ( const char *  fileName,
const char *  treeName,
Int_t  debugLevel = 0,
const char *  branchName = 0 
)
static

Check the tree in file fileName - the name of the file with tree treeName - the name of file debugLevel - 0 check the existance of the file - 1 make loop over entries branchName - if debugLevel>0 the branch is chcecked if brnachName =0 the content of full tree is chcecked return value = 0 - Check things OK -1 - file not exist or not accesible -2 - file is zombie -3 - tree not present -4 - branch not present

Definition at line 277 of file AliXRDPROOFtoolkit.cxx.

Bool_t AliXRDPROOFtoolkit::FilterList ( const char *  inputList,
const char *  fileList,
Int_t  checkLevel 
)
static

Filter the list inputList - list of original file names fileList - list of file to be checked

  • 0 - fileName
  • 1 - treeName (if * not checked)
  • 2 - fileName .... checkLevel - 0 - check only existance of the files and tree's + simple file corruption

    1 - check the content of the tree -

    (can crash as there do not exest exception handling in ROOT) Output - two streams are created - file with good entries "s.Good a,d file with bad entries s.Bad EXAMPLE: AliXRDPROOFtoolkit::FilterList("ppgrid2.txt","AliESDs.root esdTree AliESDfriends.root * Kinematics.root *",1)

Definition at line 331 of file AliXRDPROOFtoolkit.cxx.

Referenced by filterESD(), and MakeChain().

Bool_t AliXRDPROOFtoolkit::FilterListZip ( const char *  inputList,
const char *  fileList,
Int_t  checkLevel 
)
static

Filter the list inputList - list of original file names fileList - list of file to be checked

  • 0 - fileName
  • 1 - treeName (if * not checked)
  • 2 - fileName .... checkLevel - 0 - check only existance of the files and tree's + simple file corruption

    1 - check the content of the tree -

    (can crash as there do not exest exception handling in ROOT) Output - two streams are created - file with good entries "s.Good a,d file with bad entries s.Bad EXAMPLE: AliXRDPROOFtoolkit::FilterList("ppgrid2.txt","AliESDs.root esdTree AliESDfriends.root * Kinematics.root *",1)

Definition at line 416 of file AliXRDPROOFtoolkit.cxx.

void AliXRDPROOFtoolkit::JoinTreesIndex ( const char *  outputFile,
const char *  outputTree,
const char *  indexName,
const char *  inputTrees,
Int_t  debugLevel 
)
static

Join together several tree according to the index

Parameters:

Output:

  • outputFile : name of the output file
  • outputTree : name of the output Tree
  • indexName : name of the branch to be used as an index

Input:

  • inputTrees : decription of the input trees setup

Example usage:

AliXRDPROOFtoolkit::JoinTreesIndex("outAll.root","joinAll","run","1#CPass1#run#tpcQA#TPCCPass1.root+1#VPass1#run#tpcQA#TPCVPass1.root+1#Pass1#run#tpcQA#TPCPass1.root+0#DAQ#run#joinTree#fproductionJoin.root+0#C#run#dcs#OCDBscan.root+0#CE#run#Fits#CEtrend.root");

Combine information form the Cpass1,VPass, and Pass1QA, calibration tree, DAQ information, trigger information Make a File "outAll.root", with tree "joinAll", index of tree with name "run"

//
// Input tree configuration string:
//
const char *inputTrees="1#CPass1#run#tpcQA#TPCCPass1.root+1#VPass1#run#tpcQA#TPCVPass1.root+1#Pass1#run#tpcQA#TPCPass1.root+0#DAQ#run#joinTree#/home/miranov/test/dbQueries/fproductionJoin.root+0#C#run#dcs#OCDBscan.root+0#CE#run#Fits#CEtrend.root"
// Describe 6 trees to be merged (string separated be +):
TObjArray *arrayInput = TString(inputTrees).Tokenize("+");
TObjString = 1#CPass1#run#tpcQA#TPCCPass1.root
TObjString = 1#VPass1#run#tpcQA#TPCVPass1.root
TObjString = 1#Pass1#run#tpcQA#TPCPass1.root
TObjString = 0#DAQ#run#joinTree#/home/miranov/test/dbQueries/fproductionJoin.root
TObjString = 0#C#run#dcs#OCDBscan.root
TObjString = 0#CE#run#Fits#CEtrend.root
// Each tree is characterize by 5 parameters - separate by #
description="1#CPass1#run#tpcQA#TPCCPass1.root"
TString(description)->Tokenize("#").Print()
Collection name='TObjArray', class='TObjArray', size=16
TObjString = 1 ==> (0/1) index is used
TObjString = CPass1 ==> name of output branch in output tree
TObjString = run ==> name of the index
TObjString = tpcQA ==> name of the input tree in the input file
TObjString = TPCCPass1.root ==> name of the input file

Definition at line 522 of file AliXRDPROOFtoolkit.cxx.

TChain * AliXRDPROOFtoolkit::MakeChain ( const char *  fileIn,
const char *  treeName,
const char *  fName = 0,
Int_t  maxFiles = -1,
Int_t  startFile = 0 
)
static

Create a chain of files using the file 'fileIn' as input list where one line per root file is expected

treeName : Name of the tree fName : file name inside of a zip file, will add '#fName' to the file name maxFiles : maximum number of files in the chain -1 (default) add all possible files starting from 'startFile' startFile: position of the first file, starting with 0

Definition at line 89 of file AliXRDPROOFtoolkit.cxx.

Referenced by DrawdEdxResolExample(), Init(), InitChains(), MakeChain(), MakeFits(), MakeGlobalFit(), MakeGlobalFitRelative(), MakeTreeFromList(), PseudoCode(), RunAliTPCCalibKrTask(), and TestChainCosmicDedx().

TChain * AliXRDPROOFtoolkit::MakeChainRandom ( const char *  fileIn,
const char *  treeName,
const char *  fName = 0,
Int_t  maxFiles = -1,
Int_t  startFile = 0 
)
static

Create a TDSet - files are in random order

filein - input list text file treename - containg tree maxFiles - maximum number of files included

Definition at line 134 of file AliXRDPROOFtoolkit.cxx.

Referenced by CalibAlignKalman(), and Init().

TDSet * AliXRDPROOFtoolkit::MakeSet ( const char *  fileIn,
const char *  treeName,
const char *  fName = 0,
Int_t  maxFiles = -1 
)

Create the TDSet out of list filein - input list text file treename - containg tree maxFiles - maximum number of files included

Definition at line 188 of file AliXRDPROOFtoolkit.cxx.

TDSet * AliXRDPROOFtoolkit::MakeSetRandom ( const char *  fileIn,
const char *  treeName,
const char *  fName = 0,
Int_t  maxFiles = -1 
)

Create a TDSet - files are in random order

filein - input list text file treename - containg tree maxFiles - maximum number of files included

Definition at line 222 of file AliXRDPROOFtoolkit.cxx.

void AliXRDPROOFtoolkit::MakeTreeFromList ( const char *  fout,
const char *  treeOut,
const char *  treeIn,
const char *  flist,
Bool_t  debug 
)
static

join trees from the list and make a common tree - stored in the file

Example:

const char * fout="TPCCpass1.root";
const char *treeOut="tpcQA"
const char *treeIn="tpcQA"
const char * flist="TPCCPass1.list"

Definition at line 764 of file AliXRDPROOFtoolkit.cxx.

AliXRDPROOFtoolkit& AliXRDPROOFtoolkit::operator= ( const AliXRDPROOFtoolkit )
private
Bool_t AliXRDPROOFtoolkit::XRDCopyDir ( const char *  idir,
const char *  files,
const char *  odir,
Bool_t  zip 
)

idir - input directory odir - output directory files - the list of files to be coppied zip - not supported yet

Example :

idir ="root://gsiaf.gsi.de:1094//sma/sim/v4-05-Rev-03/pp/0000"; odir ="root://lxgrid2.gsi.de:1094//miranov/test/pp/0000"; char *files="AliESDs.root AliESDfriend.root Kinematics.root";

Definition at line 491 of file AliXRDPROOFtoolkit.cxx.

Member Data Documentation

UserGroup_t* AliXRDPROOFtoolkit::fUserGroup
private

user group info

Definition at line 33 of file AliXRDPROOFtoolkit.h.

TString AliXRDPROOFtoolkit::fUserName
private

user name

Definition at line 32 of file AliXRDPROOFtoolkit.h.

Int_t AliXRDPROOFtoolkit::fVerbose
private

verbso mode - print command

Definition at line 31 of file AliXRDPROOFtoolkit.h.


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