AliRoot Core  edcc906 (edcc906)
AliExternalInfo Class Reference

This class gives you an interface to different trees of information spread throughout ALICE. More...

#include <AliExternalInfo.h>

Inheritance diagram for AliExternalInfo:

Public Member Functions

 AliExternalInfo (TString localStorageDirectory=".", TString configLocation="", Int_t verbose=1)
 
virtual ~AliExternalInfo ()
 
void ReadConfig (TString configLocation="$ALICE_ROOT/STAT/Macros/AliExternalInfo.cfg", Int_t verbose=0)
 
void PrintConfig ()
 Prints out the config which was read in previously. Useful to check if anything went wrong. More...
 
void PrintConfigSelected (const char *expName="", const char *expValue="")
 
Bool_t Cache (TString type="", TString period="", TString pass="")
 
Bool_t CacheMC ()
 
Bool_t CacheRCT (TString period, TString pass)
 
Bool_t CacheDataQA (TString detector, TString period, TString pass)
 
Bool_t CacheLogbook (TString period)
 
Bool_t CacheTriggerClasses (TString period)
 
Bool_t CacheProdCycle ()
 
Bool_t CacheCPass ()
 
Bool_t CacheProdCycleByID (TString ID)
 
TTree * GetTree (TString type, TString period, TString pass, Int_t buildIndex=1)
 
TTree * GetTree (TString type, TString period, TString pass, TString friendList)
 
TTree * GetTreeMC ()
 
TTree * GetTreeRCT (TString period, TString pass)
 
TTree * GetTreeDataQA (TString detector, TString period, TString pass)
 
TTree * GetTreeLogbook (TString period)
 
TTree * GetTreeTriggerClasses (TString period)
 
TTree * GetTreeProdCycle ()
 
TTree * GetTreeCPass ()
 
TTree * GetTreeProdCycleByID (TString ID)
 
TTree * GetCPassTree (const char *period, const char *pass)
 
TTree * GetProductionTree (TString period, TString pass)
 
TTree * GetTreeAliVersRD ()
 
TTree * GetTreeAliVersMC ()
 
TTree * GetTreeMCPassGuess ()
 
TString GetMCPassGuess (TString MCprodname)
 
TChain * GetChain (TString type, TString period, TString pass, Int_t buildIndex=1)
 
TChain * GetChain (TString type, TString period, TString pass, TString friendList)
 
TChain * GetChainMC ()
 
TChain * GetChainRCT (TString period, TString pass)
 
TChain * GetChainDataQA (TString detector, TString period, TString pass)
 
TChain * GetChainLogbook (TString period)
 
TChain * GetChainTriggerClasses (TString period)
 
TChain * GetChainProdCycle ()
 
TChain * GetChainProdCycleByID (TString ID)
 
TTree * GetFriendsTree () const
 
TChain * GetFriendsChain () const
 
void SetMaxCacheSize (Long64_t size)
 
Long64_t GetMaxCacheSize () const
 
Bool_t BuildIndex (TTree *tree, TString type)
 
Bool_t AddChain (TString type, TString period, TString pass)
 
void SetupVariables (TString &internalFilename, TString &internalLocation, Bool_t &resourceIsTree, TString &pathStructure, TString &detector, TString &rootFileName, TString &treeName, const TString &type, const TString &period, const TString &pass, TString &indexName)
 Sets up all variables according to period, pass and type. Extracts information from the config file. More...
 
const TString GetYearFromPeriod (const TString &period)
 
const TString CurlMif (TString &mifFilePath, const TString &internalLocation, TString rootFileName, const TString &externalLocation)
 
const TString CurlTree (const TString internalFilename, const TString &externalLocation)
 
const TString CreatePath (TString type, TString period, TString pass)
 
Bool_t IsDownloadNeeded (TString file, TString type)
 

Static Public Member Functions

static void CacheProduction (TPRegexp select, TPRegexp reject, TString sourceList)
 
static const TString & GetDefaultConfig ()
 
static void BuildHashIndex (TTree *tree, const char *chbranchName, const char *chindexName)
 
static void PrintMapSelected (std::map< TString, TString > infoMap, const char *expName="", const char *expValue="")
 

Public Attributes

Int_t fVerbose
 verbosity flag More...
 
TString fConfigLocation
 location of the config file More...
 
TString fLocalStorageDirectory
 location of the local cache directory More...
 
std::map< TString, TString > fConfigMap
 map with tree DB configuration parameters More...
 
TTree * fTree
 master tree with friends More...
 
TChain * fChain
 master chain with friends More...
 
std::map< TString, TChain * > fChainMap
 map of chains More...
 
Long64_t fMaxCacheSize
 maximum chache size for trees and chains More...
 

Static Public Attributes

static const TString fgkDefaultConfig ="$ALICE_ROOT/STAT/Macros/AliExternalInfo.cfg"
 default config file More...
 

Detailed Description

This class gives you an interface to different trees of information spread throughout ALICE.

Related task: https://alice.its.cern.ch/jira/browse/ATO-46 With this class you can easily download and use information from different resources in ALICE, like the RCT, logbook, QA...

For the correct usage of this class you need to have a certificate which does not need typing in your password.

Definition at line 65 of file AliExternalInfo.h.

Constructor & Destructor Documentation

AliExternalInfo::AliExternalInfo ( TString  localStorageDirectory = ".",
TString  configLocation = "",
Int_t  verbose = 1 
)

Definition at line 32 of file AliExternalInfo.cxx.

AliExternalInfo::~AliExternalInfo ( )
virtual

Definition at line 51 of file AliExternalInfo.cxx.

Member Function Documentation

Bool_t AliExternalInfo::AddChain ( TString  type,
TString  period,
TString  pass 
)
Parameters
typeType of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT
periodPeriod, e.g. 'LHC15f'. Here you can use wildcards like in 'ls', e.g. 'LHC15*'
passE.g. 'pass2' or 'passMC'. Here you can use wildcards like in 'ls', e.g. 'pass*' Not fully working. Should automatically add every downloaded file to a huge chain.

Definition at line 738 of file AliExternalInfo.cxx.

Referenced by GetChain(), and GetDefaultConfig().

void AliExternalInfo::BuildHashIndex ( TTree *  tree,
const char *  chbranchName,
const char *  chindexName 
)
static

Add branch index branch with name chindexName calculated from input string branch chbranchName and make thi branch as a primary index used in order to qury FreindTrees with string keyname (impossible with standard ROOT)

Parameters
tree- input tree
chbranchName- branch name with index
chindexName- name if the index branch

Definition at line 915 of file AliExternalInfo.cxx.

Referenced by BuildIndex(), and GetDefaultConfig().

Bool_t AliExternalInfo::BuildIndex ( TTree *  tree,
TString  type 
)

Every tree you create is added to a big tree acting as a friend. You can have access to this tree with the GetFriendsTree() function. Add 'return false' when adding to the friends tree was not successful

Returns
kTRUE Comment: function should do only Build index - adding freind tree is not sufficently general

Definition at line 704 of file AliExternalInfo.cxx.

Referenced by GetChain(), GetDefaultConfig(), and GetTree().

Bool_t AliExternalInfo::Cache ( TString  type = "",
TString  period = "",
TString  pass = "" 
)
Parameters
typeType of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT
periodPeriod, e.g. 'LHC15f'
passE.g. 'pass2' or 'passMC' Implements the functionality to download the ressources in the specified storage. If it is not in the form of a tree it creates one. You can use this function or the functions available in the class definition as an abbrevation
Returns
If downloading and creation of tree was successful true, else false

Definition at line 267 of file AliExternalInfo.cxx.

Referenced by CacheCPass(), CacheDataQA(), CacheLogbook(), CacheMC(), CacheProdCycle(), CacheProdCycleByID(), CacheProduction(), CacheRCT(), CacheTriggerClasses(), and GetTree().

Bool_t AliExternalInfo::CacheCPass ( )
inline

Definition at line 79 of file AliExternalInfo.h.

Bool_t AliExternalInfo::CacheDataQA ( TString  detector,
TString  period,
TString  pass 
)
inline

Definition at line 75 of file AliExternalInfo.h.

Bool_t AliExternalInfo::CacheLogbook ( TString  period)
inline

Definition at line 76 of file AliExternalInfo.h.

Bool_t AliExternalInfo::CacheMC ( )
inline

Definition at line 73 of file AliExternalInfo.h.

Bool_t AliExternalInfo::CacheProdCycle ( )
inline

Definition at line 78 of file AliExternalInfo.h.

Bool_t AliExternalInfo::CacheProdCycleByID ( TString  ID)
inline

Definition at line 80 of file AliExternalInfo.h.

void AliExternalInfo::CacheProduction ( TPRegexp  select,
TPRegexp  reject,
TString  sourceList 
)
static

Cache selected production trees. Input production list obtained from MonALISA web interface

Parameters
select- selection mask
reject- rejection mask
sourceList- list of detectors to cache

Example usage:

AliExternalInfo::CacheProduction(TPRegexp("LHC17.*"),TPRegexp("cpass0"),"QA.TPC;QA.EVS;QA.TRD;QA.rawTPC;QA.ITS;Logbook;QA.TOF;Logbook.detector");

Definition at line 391 of file AliExternalInfo.cxx.

Referenced by CacheProdCycleByID().

Bool_t AliExternalInfo::CacheRCT ( TString  period,
TString  pass 
)
inline

Definition at line 74 of file AliExternalInfo.h.

Bool_t AliExternalInfo::CacheTriggerClasses ( TString  period)
inline

Definition at line 77 of file AliExternalInfo.h.

const TString AliExternalInfo::CreatePath ( TString  type,
TString  period,
TString  pass 
)
Parameters
typeType of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT
periodPeriod, e.g. 'LHC15f'. Here you can use wildcards like in 'ls', e.g. 'LHC15*'
passE.g. 'pass2' or 'passMC'. Here you can use wildcards like in 'ls', e.g. 'pass*' Returns a TString containing the complete directory structure where the root file should be stored/loaded from. eg './data/2015/LHC15f/pass2/'

Definition at line 773 of file AliExternalInfo.cxx.

Referenced by GetDefaultConfig(), GetProductionTree(), and SetupVariables().

const TString AliExternalInfo::CurlMif ( TString &  mifFilePath,
const TString &  internalLocation,
TString  rootFileName,
const TString &  externalLocation 
)
Parameters
mifFilePathLocation of the mif-file which is downloaded from Monalisa; Is changed by this function
internalLocationDirectory where the root file is stored
rootFileNameLocation of the newly created root file
externalLocationLocation specified in the config file Composes the curl-command in a TString which afterwards then can be executed
Returns
curl-command in a TString

Definition at line 842 of file AliExternalInfo.cxx.

Referenced by Cache(), and GetDefaultConfig().

const TString AliExternalInfo::CurlTree ( const TString  internalFilename,
const TString &  externalLocation 
)

Definition at line 864 of file AliExternalInfo.cxx.

Referenced by Cache(), and GetDefaultConfig().

TChain * AliExternalInfo::GetChain ( TString  type,
TString  period,
TString  pass,
Int_t  buildIndex = 1 
)
Parameters
typeType of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT
periodPeriod, e.g. 'LHC15f'. Here you can use wildcards like in 'ls', e.g. 'LHC15*'
passE.g. 'pass2' or 'passMC'. Here you can use wildcards like in 'ls', e.g. 'pass*' Returns a chain with the information from the corresponding resources.
Returns
TChain*

Definition at line 582 of file AliExternalInfo.cxx.

Referenced by GetChain(), GetChainDataQA(), GetChainLogbook(), GetChainMC(), GetChainProdCycle(), GetChainProdCycleByID(), GetChainRCT(), GetChainTriggerClasses(), and GetTreeProdCycleByID().

TChain * AliExternalInfo::GetChain ( TString  type,
TString  period,
TString  pass,
TString  friendList 
)
Parameters
typeType of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT
periodPeriod, e.g. 'LHC15f'. Here you can use wildcards like in 'ls', e.g. 'LHC15*'
passE.g. 'pass2' or 'passMC'. Here you can use wildcards like in 'ls', e.g. 'pass*' Returns a chain with the information from the corresponding resources.
Returns
TChain*

Definition at line 653 of file AliExternalInfo.cxx.

TChain* AliExternalInfo::GetChainDataQA ( TString  detector,
TString  period,
TString  pass 
)
inline

Definition at line 106 of file AliExternalInfo.h.

TChain* AliExternalInfo::GetChainLogbook ( TString  period)
inline

Definition at line 107 of file AliExternalInfo.h.

TChain* AliExternalInfo::GetChainMC ( )
inline

Definition at line 104 of file AliExternalInfo.h.

TChain* AliExternalInfo::GetChainProdCycle ( )
inline

Definition at line 109 of file AliExternalInfo.h.

TChain* AliExternalInfo::GetChainProdCycleByID ( TString  ID)
inline

Definition at line 110 of file AliExternalInfo.h.

TChain* AliExternalInfo::GetChainRCT ( TString  period,
TString  pass 
)
inline

Definition at line 105 of file AliExternalInfo.h.

TChain* AliExternalInfo::GetChainTriggerClasses ( TString  period)
inline

Definition at line 108 of file AliExternalInfo.h.

TTree * AliExternalInfo::GetCPassTree ( const char *  period,
const char *  pass 
)
Parameters
periodLHC period
passcalibratio pass

Definition at line 881 of file AliExternalInfo.cxx.

Referenced by GetTreeProdCycleByID().

static const TString& AliExternalInfo::GetDefaultConfig ( )
inlinestatic

Definition at line 118 of file AliExternalInfo.h.

TChain* AliExternalInfo::GetFriendsChain ( ) const
inline

Definition at line 113 of file AliExternalInfo.h.

TTree* AliExternalInfo::GetFriendsTree ( ) const
inline

Definition at line 112 of file AliExternalInfo.h.

Long64_t AliExternalInfo::GetMaxCacheSize ( ) const
inline

Definition at line 116 of file AliExternalInfo.h.

TString AliExternalInfo::GetMCPassGuess ( TString  MCprodname)

Definition at line 1354 of file AliExternalInfo.cxx.

Referenced by GetTreeProdCycleByID().

TTree * AliExternalInfo::GetProductionTree ( TString  period,
TString  pass 
)

AliExternalInfo::GetProductionTree(TString period, TString pass)

Parameters
period- period ID
pass- pass ID
Returns
production tree ()

Example usage:

TTree * prodTree = info.GetProductionTree("LHC17f","pass1");
prodTree->Scan("RunNo:outputdir:jobs_error:jobs_total","","col=10:50:10:10");
TTree * mcProdTree = info.GetProductionTree("LHC17k2","");
mcProdTree->Scan("RunNo:outputdir:jobs_error:jobs_total","","col=10:50:10:10");

Definition at line 166 of file AliExternalInfo.cxx.

Referenced by GetTreeProdCycleByID().

TTree * AliExternalInfo::GetTree ( TString  type,
TString  period,
TString  pass,
Int_t  buildIndex = 1 
)
Parameters
typeType of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT
periodPeriod, e.g. 'LHC15f'
passE.g. 'pass2' or 'passMC' Returns the tree with the information from the corresponding resource
Returns
TTree* with corresponding resource

Definition at line 424 of file AliExternalInfo.cxx.

Referenced by AliTreePlayerTest(), CacheProdCycleByID(), drawLogbook(), drawLogbookMultiCut(), drawLogbookMultiExpr(), GetProductionTree(), GetTree(), GetTreeAliVersMC(), GetTreeCPass(), GetTreeDataQA(), GetTreeLogbook(), GetTreeMC(), GetTreeProdCycle(), GetTreeProdCycleByID(), GetTreeRCT(), GetTreeTriggerClasses(), makeHTMLPage(), testConvertTree(), testExportBinary(), testExportClass(), TestMCProduction(), TestProductionAccess(), testSelectMetadata(), and testselectWhatWhereOrderByForTRD().

TTree * AliExternalInfo::GetTree ( TString  type,
TString  period,
TString  pass,
TString  friendList 
)
Parameters
typeType of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT
periodPeriod, e.g. 'LHC15f'
passE.g. 'pass2' or 'passMC'
friendList- semicolomn separated array of "friend" trees attached to the tree Returns the tree with the information from the corresponding resource - trees from the friendList are added as friend trees see example usage
Returns
TTree* with corresponding resource

Definition at line 506 of file AliExternalInfo.cxx.

TTree * AliExternalInfo::GetTreeAliVersMC ( )

Definition at line 1069 of file AliExternalInfo.cxx.

Referenced by GetTreeMCPassGuess(), and GetTreeProdCycleByID().

TTree * AliExternalInfo::GetTreeAliVersRD ( )

Definition at line 969 of file AliExternalInfo.cxx.

Referenced by GetTreeMCPassGuess(), and GetTreeProdCycleByID().

TTree* AliExternalInfo::GetTreeCPass ( )
inline

Definition at line 92 of file AliExternalInfo.h.

Referenced by GetCPassTree().

TTree* AliExternalInfo::GetTreeDataQA ( TString  detector,
TString  period,
TString  pass 
)
inline

Definition at line 88 of file AliExternalInfo.h.

TTree* AliExternalInfo::GetTreeLogbook ( TString  period)
inline

Definition at line 89 of file AliExternalInfo.h.

TTree* AliExternalInfo::GetTreeMC ( )
inline

Definition at line 85 of file AliExternalInfo.h.

Referenced by GetTreeAliVersMC().

TTree * AliExternalInfo::GetTreeMCPassGuess ( )

Definition at line 1180 of file AliExternalInfo.cxx.

Referenced by GetMCPassGuess(), GetTreeProdCycleByID(), and testExportBinary().

TTree* AliExternalInfo::GetTreeProdCycle ( )
inline

Definition at line 91 of file AliExternalInfo.h.

Referenced by CacheProduction(), and GetTreeAliVersRD().

TTree* AliExternalInfo::GetTreeProdCycleByID ( TString  ID)
inline

Definition at line 93 of file AliExternalInfo.h.

Referenced by GetCPassTree(), GetProductionTree(), and GetTreeAliVersRD().

TTree* AliExternalInfo::GetTreeRCT ( TString  period,
TString  pass 
)
inline

Definition at line 87 of file AliExternalInfo.h.

TTree* AliExternalInfo::GetTreeTriggerClasses ( TString  period)
inline

Definition at line 90 of file AliExternalInfo.h.

const TString AliExternalInfo::GetYearFromPeriod ( const TString &  period)
Parameters
periodPeriod in the form eg LHC15f Generate from eg LHC15f the year 2015
Returns
Year in the form "2015"

Definition at line 762 of file AliExternalInfo.cxx.

Referenced by CreatePath(), and GetDefaultConfig().

Bool_t AliExternalInfo::IsDownloadNeeded ( TString  file,
TString  type 
)
Parameters
fileExact location of the file which should be checked
typeType of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT Checks if the file is older than the timeout which is specified in the config file of this specific resource type
Returns
true if download of the resource is needed and false if not

Definition at line 810 of file AliExternalInfo.cxx.

Referenced by Cache(), GetDefaultConfig(), GetMCPassGuess(), GetTree(), GetTreeAliVersMC(), GetTreeAliVersRD(), and GetTreeMCPassGuess().

void AliExternalInfo::PrintConfig ( )

Prints out the config which was read in previously. Useful to check if anything went wrong.

Definition at line 128 of file AliExternalInfo.cxx.

void AliExternalInfo::PrintConfigSelected ( const char *  expName = "",
const char *  expValue = "" 
)

Definition at line 938 of file AliExternalInfo.cxx.

void AliExternalInfo::PrintMapSelected ( std::map< TString, TString >  infoMap,
const char *  expName = "",
const char *  expValue = "" 
)
static

Definition at line 945 of file AliExternalInfo.cxx.

Referenced by GetDefaultConfig(), and PrintConfigSelected().

void AliExternalInfo::ReadConfig ( TString  configLocation = "$ALICE_ROOT/STAT/Macros/AliExternalInfo.cfg",
Int_t  verbose = 0 
)

Reads the configuration files. Lines beginning with an '#' are ignored.

Use the format which is in the config.cfg by default. Adding ressources like the ones already there should work without problems.

Parameters
configLocation- semicolon separated configuration list
  • applied as in CSS
verbose- verbosity

Definition at line 61 of file AliExternalInfo.cxx.

void AliExternalInfo::SetMaxCacheSize ( Long64_t  size)
inline

Definition at line 115 of file AliExternalInfo.h.

void AliExternalInfo::SetupVariables ( TString &  internalFilename,
TString &  internalLocation,
Bool_t &  resourceIsTree,
TString &  pathStructure,
TString &  detector,
TString &  rootFileName,
TString &  treeName,
const TString &  type,
const TString &  period,
const TString &  pass,
TString &  indexName 
)

Sets up all variables according to period, pass and type. Extracts information from the config file.

Definition at line 220 of file AliExternalInfo.cxx.

Referenced by AddChain(), Cache(), GetChain(), GetDefaultConfig(), and GetTree().

Member Data Documentation

TChain* AliExternalInfo::fChain

master chain with friends

Definition at line 138 of file AliExternalInfo.h.

Referenced by AddChain(), and GetFriendsChain().

std::map<TString, TChain*> AliExternalInfo::fChainMap

map of chains

Definition at line 139 of file AliExternalInfo.h.

TString AliExternalInfo::fConfigLocation

location of the config file

Definition at line 134 of file AliExternalInfo.h.

Referenced by ReadConfig().

std::map<TString, TString> AliExternalInfo::fConfigMap

map with tree DB configuration parameters

Definition at line 136 of file AliExternalInfo.h.

Referenced by BuildIndex(), Cache(), GetChain(), GetProductionTree(), GetTree(), IsDownloadNeeded(), PrintConfig(), PrintConfigSelected(), ReadConfig(), and SetupVariables().

const TString AliExternalInfo::fgkDefaultConfig ="$ALICE_ROOT/STAT/Macros/AliExternalInfo.cfg"
static

default config file

Definition at line 142 of file AliExternalInfo.h.

Referenced by GetDefaultConfig(), and ReadConfig().

TString AliExternalInfo::fLocalStorageDirectory

location of the local cache directory

Definition at line 135 of file AliExternalInfo.h.

Referenced by AddChain(), Cache(), GetChain(), GetMCPassGuess(), GetTree(), GetTreeAliVersMC(), GetTreeAliVersRD(), and GetTreeMCPassGuess().

Long64_t AliExternalInfo::fMaxCacheSize

maximum chache size for trees and chains

Definition at line 140 of file AliExternalInfo.h.

Referenced by GetChain(), GetMaxCacheSize(), GetTree(), and SetMaxCacheSize().

TTree* AliExternalInfo::fTree

master tree with friends

Definition at line 137 of file AliExternalInfo.h.

Referenced by GetFriendsTree().

Int_t AliExternalInfo::fVerbose

verbosity flag

Definition at line 132 of file AliExternalInfo.h.

Referenced by BuildIndex(), Cache(), CurlMif(), GetChain(), GetProductionTree(), and GetTree().


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