![]() |
AliRoot Core
3dc7879 (3dc7879)
|
This class gives you an interface to different trees of information spread throughout ALICE. More...
#include <AliExternalInfo.h>
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) |
TString | GetMCAnchPerGuess (const char *runlist) |
TTree * | GetLogbookCache () |
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... | |
Bool_t | fLoadMetadata |
flag load metadata 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... | |
TTree * | fMCGuessTree |
tree holding information for Anchor Pass guessing 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... | |
TTree * | fLogCache |
TChain for Logbook. More... | |
Static Public Attributes | |
static const TString | fgkDefaultConfig ="$ALICE_ROOT/STAT/Macros/AliExternalInfo.cfg" |
default config file More... | |
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.
AliExternalInfo::AliExternalInfo | ( | TString | localStorageDirectory = "." , |
TString | configLocation = "" , |
||
Int_t | verbose = 1 |
||
) |
Definition at line 34 of file AliExternalInfo.cxx.
|
virtual |
Definition at line 55 of file AliExternalInfo.cxx.
Bool_t AliExternalInfo::AddChain | ( | TString | type, |
TString | period, | ||
TString | pass | ||
) |
type | Type of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT |
period | Period, e.g. 'LHC15f'. Here you can use wildcards like in 'ls', e.g. 'LHC15*' |
pass | E.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 746 of file AliExternalInfo.cxx.
Referenced by GetChain(), and GetDefaultConfig().
|
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)
tree | - input tree |
chbranchName | - branch name with index |
chindexName | - name if the index branch |
Definition at line 941 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
Definition at line 712 of file AliExternalInfo.cxx.
Referenced by GetChain(), GetDefaultConfig(), and GetTree().
Bool_t AliExternalInfo::Cache | ( | TString | type = "" , |
TString | period = "" , |
||
TString | pass = "" |
||
) |
type | Type of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT |
period | Period, e.g. 'LHC15f' |
pass | E.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 |
Definition at line 271 of file AliExternalInfo.cxx.
Referenced by CacheCPass(), CacheDataQA(), CacheLogbook(), CacheMC(), CacheProdCycle(), CacheProdCycleByID(), CacheProduction(), CacheRCT(), CacheTriggerClasses(), and GetTree().
|
inline |
Definition at line 79 of file AliExternalInfo.h.
|
inline |
Definition at line 75 of file AliExternalInfo.h.
|
inline |
Definition at line 76 of file AliExternalInfo.h.
|
inline |
Definition at line 73 of file AliExternalInfo.h.
|
inline |
Definition at line 78 of file AliExternalInfo.h.
|
inline |
Definition at line 80 of file AliExternalInfo.h.
|
static |
Cache selected production trees. Input production list obtained from MonALISA web interface
select | - selection mask |
reject | - rejection mask |
sourceList | - list of detectors to cache |
Example usage:
Definition at line 395 of file AliExternalInfo.cxx.
Referenced by CacheProdCycleByID().
|
inline |
Definition at line 74 of file AliExternalInfo.h.
|
inline |
Definition at line 77 of file AliExternalInfo.h.
const TString AliExternalInfo::CreatePath | ( | TString | type, |
TString | period, | ||
TString | pass | ||
) |
type | Type of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT |
period | Period, e.g. 'LHC15f'. Here you can use wildcards like in 'ls', e.g. 'LHC15*' |
pass | E.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 781 of file AliExternalInfo.cxx.
Referenced by GetDefaultConfig(), GetProductionTree(), and SetupVariables().
const TString AliExternalInfo::CurlMif | ( | TString & | mifFilePath, |
const TString & | internalLocation, | ||
TString | rootFileName, | ||
const TString & | externalLocation | ||
) |
mifFilePath | Location of the mif-file which is downloaded from Monalisa; Is changed by this function |
internalLocation | Directory where the root file is stored |
rootFileName | Location of the newly created root file |
externalLocation | Location specified in the config file Composes the curl-command in a TString which afterwards then can be executed |
Definition at line 852 of file AliExternalInfo.cxx.
Referenced by Cache(), and GetDefaultConfig().
const TString AliExternalInfo::CurlTree | ( | const TString | internalFilename, |
const TString & | externalLocation | ||
) |
Definition at line 882 of file AliExternalInfo.cxx.
Referenced by Cache(), and GetDefaultConfig().
TChain * AliExternalInfo::GetChain | ( | TString | type, |
TString | period, | ||
TString | pass, | ||
Int_t | buildIndex = 1 |
||
) |
type | Type of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT |
period | Period, e.g. 'LHC15f'. Here you can use wildcards like in 'ls', e.g. 'LHC15*' |
pass | E.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. |
Definition at line 590 of file AliExternalInfo.cxx.
Referenced by GetChain(), GetChainDataQA(), GetChainLogbook(), GetChainMC(), GetChainProdCycle(), GetChainProdCycleByID(), GetChainRCT(), GetChainTriggerClasses(), GetLogbookCache(), GetTreeProdCycleByID(), and loadTree().
TChain * AliExternalInfo::GetChain | ( | TString | type, |
TString | period, | ||
TString | pass, | ||
TString | friendList | ||
) |
type | Type of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT |
period | Period, e.g. 'LHC15f'. Here you can use wildcards like in 'ls', e.g. 'LHC15*' |
pass | E.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. |
Definition at line 661 of file AliExternalInfo.cxx.
|
inline |
Definition at line 107 of file AliExternalInfo.h.
|
inline |
Definition at line 108 of file AliExternalInfo.h.
|
inline |
Definition at line 105 of file AliExternalInfo.h.
|
inline |
Definition at line 110 of file AliExternalInfo.h.
|
inline |
Definition at line 111 of file AliExternalInfo.h.
|
inline |
Definition at line 106 of file AliExternalInfo.h.
|
inline |
Definition at line 109 of file AliExternalInfo.h.
TTree * AliExternalInfo::GetCPassTree | ( | const char * | period, |
const char * | pass | ||
) |
period | LHC period |
pass | calibratio pass |
Definition at line 907 of file AliExternalInfo.cxx.
Referenced by GetTreeProdCycleByID().
|
inlinestatic |
Definition at line 119 of file AliExternalInfo.h.
|
inline |
Definition at line 114 of file AliExternalInfo.h.
|
inline |
Definition at line 113 of file AliExternalInfo.h.
TTree * AliExternalInfo::GetLogbookCache | ( | ) |
Definition at line 1501 of file AliExternalInfo.cxx.
Referenced by GetMCAnchPerGuess(), and GetTreeProdCycleByID().
|
inline |
Definition at line 117 of file AliExternalInfo.h.
TString AliExternalInfo::GetMCAnchPerGuess | ( | const char * | runlist | ) |
Definition at line 1537 of file AliExternalInfo.cxx.
Referenced by GetTreeAliVersMC(), and GetTreeProdCycleByID().
TString AliExternalInfo::GetMCPassGuess | ( | TString | MCprodname | ) |
Definition at line 1599 of file AliExternalInfo.cxx.
Referenced by GetTreeProdCycleByID().
TTree * AliExternalInfo::GetProductionTree | ( | TString | period, |
TString | pass | ||
) |
AliExternalInfo::GetProductionTree(TString period, TString pass)
period | - period ID |
pass | - pass ID |
Example usage:
Definition at line 170 of file AliExternalInfo.cxx.
Referenced by GetTreeProdCycleByID().
TTree * AliExternalInfo::GetTree | ( | TString | type, |
TString | period, | ||
TString | pass, | ||
Int_t | buildIndex = 1 |
||
) |
type | Type of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT |
period | Period, e.g. 'LHC15f' |
pass | E.g. 'pass2' or 'passMC' Returns the tree with the information from the corresponding resource |
Definition at line 429 of file AliExternalInfo.cxx.
Referenced by AliTreePlayerTest(), CacheProdCycleByID(), CacheTestMCProductions(), CacheTrendingProductions(), CheckProductions(), drawLogbook(), drawLogbookMultiCut(), drawLogbookMultiExpr(), GetProductionTree(), GetTree(), GetTreeAliVersMC(), GetTreeAliVersRD(), GetTreeCPass(), GetTreeDataQA(), GetTreeLogbook(), GetTreeMC(), GetTreeProdCycle(), GetTreeProdCycleByID(), GetTreeRCT(), GetTreeTriggerClasses(), makeHTMLPage(), testConvertTree(), testExportBinary(), testExportClass(), TestMCProduction(), TestProductionAccess(), testSelectMetadata(), testselectWhatWhereOrderByForTRD(), and TPCDataVolumeDemo().
TTree * AliExternalInfo::GetTree | ( | TString | type, |
TString | period, | ||
TString | pass, | ||
TString | friendList | ||
) |
type | Type of the resource as described in the config file, e.g. QA.TPC, MonALISA.RCT |
period | Period, e.g. 'LHC15f' |
pass | E.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 |
Definition at line 512 of file AliExternalInfo.cxx.
TTree * AliExternalInfo::GetTreeAliVersMC | ( | ) |
Definition at line 1128 of file AliExternalInfo.cxx.
Referenced by GetTreeMCPassGuess(), and GetTreeProdCycleByID().
TTree * AliExternalInfo::GetTreeAliVersRD | ( | ) |
delete tree together with file
Definition at line 995 of file AliExternalInfo.cxx.
Referenced by GetTreeMCPassGuess(), and GetTreeProdCycleByID().
|
inline |
Definition at line 92 of file AliExternalInfo.h.
Referenced by GetCPassTree().
|
inline |
Definition at line 88 of file AliExternalInfo.h.
|
inline |
Definition at line 89 of file AliExternalInfo.h.
|
inline |
Definition at line 85 of file AliExternalInfo.h.
Referenced by GetTreeAliVersMC().
TTree * AliExternalInfo::GetTreeMCPassGuess | ( | ) |
TODO - is it save ?
Definition at line 1256 of file AliExternalInfo.cxx.
Referenced by CacheMCProductionInfo(), ExportMCAnchorJSON(), GetMCPassGuess(), GetTreeProdCycleByID(), and testExportBinary().
|
inline |
Definition at line 91 of file AliExternalInfo.h.
Referenced by CacheProduction(), and GetTreeAliVersRD().
|
inline |
Definition at line 93 of file AliExternalInfo.h.
Referenced by CacheTrendingProductions(), GetCPassTree(), GetProductionTree(), and GetTreeAliVersRD().
|
inline |
Definition at line 87 of file AliExternalInfo.h.
|
inline |
Definition at line 90 of file AliExternalInfo.h.
const TString AliExternalInfo::GetYearFromPeriod | ( | const TString & | period | ) |
period | Period in the form eg LHC15f Generate from eg LHC15f the year 2015 |
Definition at line 770 of file AliExternalInfo.cxx.
Referenced by CreatePath(), and GetDefaultConfig().
Bool_t AliExternalInfo::IsDownloadNeeded | ( | TString | file, |
TString | type | ||
) |
file | Exact location of the file which should be checked |
type | Type 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 |
Definition at line 820 of file AliExternalInfo.cxx.
Referenced by Cache(), GetDefaultConfig(), GetLogbookCache(), 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 132 of file AliExternalInfo.cxx.
void AliExternalInfo::PrintConfigSelected | ( | const char * | expName = "" , |
const char * | expValue = "" |
||
) |
Definition at line 964 of file AliExternalInfo.cxx.
|
static |
Definition at line 971 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.
configLocation | - semicolon separated configuration list
|
verbose | - verbosity |
Definition at line 65 of file AliExternalInfo.cxx.
|
inline |
Definition at line 116 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 224 of file AliExternalInfo.cxx.
Referenced by AddChain(), Cache(), GetChain(), GetDefaultConfig(), and GetTree().
TChain* AliExternalInfo::fChain |
master chain with friends
Definition at line 141 of file AliExternalInfo.h.
Referenced by AddChain(), and GetFriendsChain().
std::map<TString, TChain*> AliExternalInfo::fChainMap |
map of chains
Definition at line 142 of file AliExternalInfo.h.
TString AliExternalInfo::fConfigLocation |
location of the config file
Definition at line 136 of file AliExternalInfo.h.
Referenced by ReadConfig().
std::map<TString, TString> AliExternalInfo::fConfigMap |
map with tree DB configuration parameters
Definition at line 138 of file AliExternalInfo.h.
Referenced by BuildIndex(), Cache(), GetChain(), GetProductionTree(), GetTree(), IsDownloadNeeded(), PrintConfig(), PrintConfigSelected(), ReadConfig(), and SetupVariables().
|
static |
default config file
Definition at line 145 of file AliExternalInfo.h.
Referenced by GetDefaultConfig(), and ReadConfig().
Bool_t AliExternalInfo::fLoadMetadata |
flag load metadata
Definition at line 134 of file AliExternalInfo.h.
Referenced by CacheTestMCProductions(), CacheTrendingProductions(), GetTree(), and GetTreeMCPassGuess().
TString AliExternalInfo::fLocalStorageDirectory |
location of the local cache directory
Definition at line 137 of file AliExternalInfo.h.
Referenced by AddChain(), Cache(), GetChain(), GetLogbookCache(), GetTree(), GetTreeAliVersMC(), GetTreeAliVersRD(), and GetTreeMCPassGuess().
TTree* AliExternalInfo::fLogCache |
TChain for Logbook.
Definition at line 144 of file AliExternalInfo.h.
Referenced by GetMCAnchPerGuess().
Long64_t AliExternalInfo::fMaxCacheSize |
maximum chache size for trees and chains
Definition at line 143 of file AliExternalInfo.h.
Referenced by GetChain(), GetMaxCacheSize(), GetTree(), and SetMaxCacheSize().
TTree* AliExternalInfo::fMCGuessTree |
tree holding information for Anchor Pass guessing
Definition at line 140 of file AliExternalInfo.h.
Referenced by GetMCPassGuess().
TTree* AliExternalInfo::fTree |
master tree with friends
Definition at line 139 of file AliExternalInfo.h.
Referenced by GetFriendsTree().
Int_t AliExternalInfo::fVerbose |
verbosity flag
Definition at line 133 of file AliExternalInfo.h.
Referenced by BuildIndex(), Cache(), CurlMif(), GetChain(), GetLogbookCache(), GetMCAnchPerGuess(), GetMCPassGuess(), GetProductionTree(), GetTree(), GetTreeAliVersMC(), GetTreeMCPassGuess(), and TPCDataVolumeDemo().