5 /// @author Matthias.Richter@cern.ch
7 /// @brief Setup the environment specifically for running DxHFE analysis
9 /// Helper macro to initialize the environment for DxHFE. The macro can just
10 /// prepend other macros like run-single-task in the command line.
12 /// aliroot -b -q -l setupDxHFE.C'("localAodDir")' run-single-task.C'(...)'
15 /// aliroot -b -q -l setupDxHFE.C run-single-task.C'(...)'
17 /// The macro has the following tasks:
18 /// - load the necessary libraries, in order to have those library names also
19 /// available for the alien handler initialization, a specific configuration
21 /// - setting a default analysis name via a configuration object
22 /// - the optional parameter 'localAodDir' allows to create an input chain from
23 /// local AODs; either a single AliAOD.root, or a folder containing directories
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 // environment specific for DxHFE
30 const char* includePath="-I$ALICE_ROOT/PWGHF/correlationHF -I$ALICE_ROOT/PWGHF/vertexingHF -I$ALICE_ROOT/PWGHF/hfe";
31 const char* libraryDependencies=
40 "libPWGHFvertexingHF.so "
42 "libPWGHFcorrelationHF.so "
45 void setupDxHFE(const char* aodDirectory=NULL)
47 gSystem->AddIncludePath(includePath);
48 TString libraries=libraryDependencies;
49 TObjArray* pTokens=libraries.Tokenize(" ");
51 for (int i=0; i<pTokens->GetEntriesFast(); i++) {
52 if (gSystem->Load(pTokens->At(i)->GetName())==0) {
53 cout << "loading " << pTokens->At(i)->GetName() << endl;
60 // allow run-single-task to fetch the analysis name and library names
61 if (gDirectory) gDirectory->Add(new TNamed("analysis_name", "DxHFECorrelation"));
62 if (gDirectory) gDirectory->Add(new TNamed("analysis_libraries", libraryDependencies));
65 // create AOD tree from local files
66 // the created object is added automatically to gDirectory and can be fetched
68 gROOT->LoadMacro("$ALICE_ROOT/PWGHF/vertexingHF/MakeAODInputChain.C");
69 TString aodPathName(aodDirectory);
70 if (!aodPathName.EndsWith("/")) aodPathName+="/";
71 aodPathName+="AliAOD.root";
72 if (gSystem->AccessPathName(aodPathName)==0) {
73 // Create a chain with one set of AliAOD.root and AliAOD.VertexingHF.root. The set needs
74 // to be located in the same folder as you run from (physically or linked)
75 ::Info("setupDxHFE.C", Form("make chain from single chunk %s", aodPathName));
76 TChain* chain = MakeAODInputChain(aodDirectory ,1, -1);
78 // Assume several folders containing different AODs.
79 // The AODs need to be in folders named 1, 2,...
80 ::Info("setupDxHFE.C", Form("make chain from directory %s", aodDirectory));
81 chain=MakeAODInputChain(aodDirectory, 1, 10);
83 ::Info("setupDxHFE.C", Form("local AOD chain: %d entries", chain->GetEntries()));