1 Bool_t gIsAnalysisLoaded = kFALSE ;
3 //______________________________________________________________________
4 Bool_t LoadLib( const char* pararchivename)
6 // Loads the AliRoot required libraries from a tar file
11 sprintf(cdir, "%s", gSystem->WorkingDirectory() ) ;
14 char processline[1024];
15 sprintf(processline,".! tar xvzf %s.par",pararchivename);
16 gROOT->ProcessLine(processline);
17 gSystem->ChangeDirectory(pararchivename);
19 // check for BUILD.sh and execute
20 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
21 printf("*** Building PAR archive %s ***\n", pararchivename);
23 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
24 AliError(Form("Cannot Build the PAR Archive %s! - Abort!", pararchivename) );
30 // check for SETUP.C and execute
31 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
32 printf("*** Setup PAR archive %s ***\n", pararchivename);
33 gROOT->Macro("PROOF-INF/SETUP.C");
37 if ( strstr(pararchivename, "ESD") ) {
38 gSystem->Load("libVMC.so");
39 gSystem->Load("libESD.so");
40 gSystem->Load("libRAliEn.so") ;
41 gSystem->Load("libProof.so") ;
44 printf("*** %s library loaded *** %s **\n", pararchivename);
46 gSystem->ChangeDirectory(cdir);
48 gIsAnalysisLoaded = kTRUE ;
52 //______________________________________________________________________
56 if (! gIsAnalysisLoaded ) {
57 cout<<"Load ESD"<<endl;
59 cout<<"Load ANALYSIS"<<endl;
61 printf("Include path = %s\n", gSystem->GetIncludePath()) ;
62 LoadLib("PWG4Gamma") ;
64 //AliLog::SetGlobalDebugLevel(3);
66 // create the analysis goodies object
67 AliAnalysisGoodies * ag = new AliAnalysisGoodies() ;
69 // definition of analysis tasks
70 const Int_t knumberOfTasks = 4 ;
71 AliAnalysisTask * taskList[knumberOfTasks] ;
72 TClass * taskInputList[knumberOfTasks] ;
73 TClass * taskOutputList[knumberOfTasks] ;
75 // taskList[0] = new AliAnaGammaHadron("GammaTest") ;
76 // taskInputList[0] = TChain::Class() ;
77 // taskOutputList[0] = TObjArray::Class() ;
79 // AliAnaGammaDirect * gd = new AliAnaGammaDirect("GammaDirect") ;
80 // gd->SetMinGammaPt(1.);
82 taskList[0] = new AliAnaGammaDirect("GammaDirect") ;
83 taskInputList[0] = TChain::Class() ;
84 taskOutputList[0] = TObjArray::Class() ;
86 taskList[1] = new AliAnaGammaIsolCut("GammaIC") ;
87 taskInputList[1] = TChain::Class() ;
88 taskOutputList[1] = TObjArray::Class() ;
90 taskList[2] = new AliAnaGammaHadron("GammaHadron") ;
91 taskInputList[2] = TChain::Class() ;
92 taskOutputList[2] = TObjArray::Class() ;
94 taskList[3] = new AliAnaGammaJet("GammaJet") ;
95 taskInputList[3] = TChain::Class() ;
96 taskOutputList[3] = TObjArray::Class() ;
98 ag->SetTasks(knumberOfTasks, taskList, taskInputList, taskOutputList) ;
100 // get the data to analyze
102 // definition of Tag cuts
103 const char * runCuts = 0x0 ;
104 const char * evtCuts = "fEventTag.fNPHOSClustersMin == 1 && fEventTag.fNEMCALClustersMin == 1" ;
107 TString input = gSystem->Getenv("ANA_INPUT") ;
108 cout<<"INPUT 0"<<input<<endl;
110 char argument[1024] ;
111 if ( input.Contains("tag?") ) {
112 //create the ESD collection from the tag collection
113 input.ReplaceAll("tag?", "") ;
114 const char * collESD = "esdCollection.xml" ;
115 ag->MakeEsdCollectionFromTagCollection(runCuts, evtCuts, input.Data(), collESD) ;
116 sprintf(argument, "esd?%s", collESD) ;
117 } else if ( input.Contains("esd?") )
118 //argument = input.Data() ;
119 sprintf(argument, "%s", input.Data()) ;
120 printf("................ %s", input.Data()) ;
121 ag->Process(argument) ;
125 TChain* analysisChain = new TChain("esdTree") ;
126 input = "AliESDs.root" ;
127 analysisChain->AddFile(input);
128 ag->Process(analysisChain) ;
132 //______________________________________________________________________
133 void Merge(const char * xml, const char * sub, const char * out)
135 if (! gIsAnalysisLoaded )
138 AliAnalysisGoodies * ag = new AliAnalysisGoodies() ;
139 ag->Merge(xml, sub, out) ;
142 //______________________________________________________________________
143 void test(const char * fcollection1)
145 AliXMLCollection collection1(fcollection1);
146 TChain* analysisChain = new TChain("esdTree");
149 while (collection1.Next()) {
150 cout<<"Adding "<<collection1.GetTURL()<<endl;
151 analysisChain->Add(collection1.GetTURL());