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() ) ;
15 char processline[1024];
16 sprintf(processline,".! tar xvzf %s.par",pararchivename);
17 gROOT->ProcessLine(processline);
18 gSystem->ChangeDirectory(pararchivename);
20 // check for BUILD.sh and execute
21 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
22 printf("*** Building PAR archive %s ***\n", pararchivename);
24 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
25 AliError(Form("Cannot Build the PAR Archive %s! - Abort!", pararchivename) );
31 // check for SETUP.C and execute
32 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
33 printf("*** Setup PAR archive %s ***\n", pararchivename);
34 gROOT->Macro("PROOF-INF/SETUP.C");
38 if ( strstr(pararchivename, "ESD") ) {
39 gSystem->Load("libVMC.so");
40 gSystem->Load("libESD.so");
41 gSystem->Load("libRAliEn.so") ;
42 gSystem->Load("libProof.so") ;
45 printf("*** %s library loaded *** %s **\n", pararchivename);
47 gSystem->ChangeDirectory(cdir);
49 gIsAnalysisLoaded = kTRUE ;
53 //______________________________________________________________________
56 if (! gIsAnalysisLoaded ) {
58 LoadLib("ANALYSIS_NEW") ;
59 printf("Include path = %s\n", gSystem->GetIncludePath()) ;
60 LoadLib("AnalysisCheck") ;
63 // create the analysis goodies object
64 AliAnalysisGoodies * ag = new AliAnalysisGoodies() ;
66 // definition of analysis tasks
68 const Int_t knumberOfTasks = 8 ;
69 AliAnalysisTask * taskList[knumberOfTasks] ;
70 TClass * taskInputList[knumberOfTasks] ;
71 TClass * taskOutputList[knumberOfTasks] ;
73 taskList[0] = new AliPHOSQATask("PHOS") ;
74 taskInputList[0] = TChain::Class() ;
75 taskOutputList[0] = TObjArray::Class() ;
77 taskList[1] = new AliEMCALQATask("EMCal") ;
78 taskInputList[1] = taskInputList[0] ; // only one top input container allowed
79 taskOutputList[1] = TObjArray::Class() ;
81 taskList[2] = new AliPMDQATask("PMD") ;
82 taskInputList[2] = taskInputList[0] ; // only one top input container allowed
83 taskOutputList[2] = TObjArray::Class() ;
85 taskList[3] = new AliAnalysisTaskPt("Pt") ;
86 taskInputList[3] = taskInputList[0] ; // only one top input container allowed
87 taskOutputList[3] = TObjArray::Class() ;
89 taskList[4] = new AliHMPIDQATask("HMPID") ;
90 taskInputList[4] = taskInputList[0] ; // only one top input container allowed
91 taskOutputList[4] = TObjArray::Class() ;
93 taskList[5] = new AliT0QATask("T0") ;
94 taskInputList[5] = taskInputList[0] ; // only one top input container allowed
95 taskOutputList[5] = TObjArray::Class() ;
97 taskList[6] = new AliMUONQATask("MUON") ;
98 taskInputList[6] = taskInputList[0] ; // only one top input container allowed
99 taskOutputList[6] = TObjArray::Class() ;
101 taskList[7] = new AliFMDQATask("FMD") ;
102 taskInputList[7] = taskInputList[0] ; // only one top input container allowed
103 taskOutputList[7] = TObjArray::Class() ;
105 ag->SetTasks(knumberOfTasks, taskList, taskInputList, taskOutputList) ;
107 // get the data to analyze
109 // definition of Tag cuts
110 const char * runCuts = 0x0 ;
111 const char * evtCuts = "fEventTag.fNPHOSClustersMin == 1 && fEventTag.fNEMCALClustersMin == 1" ;
114 TString input = gSystem->Getenv("ANA_INPUT") ;
116 char argument[1024] ;
117 if ( input.Contains("tag?") ) {
118 //create the ESD collection from the tag collection
119 input.ReplaceAll("tag?", "") ;
120 const char * collESD = "esdCollection.xml" ;
121 ag->MakeEsdCollectionFromTagCollection(runCuts, evtCuts, input.Data(), collESD) ;
122 sprintf(argument, "esd?%s", collESD) ;
123 } else if ( input.Contains("esd?") )
124 argument = input.Data() ;
125 ag->Process(argument) ;
129 TChain* analysisChain = new TChain("esdTree") ;
130 // input = "alien:///alice/cern.ch/user/a/aliprod/prod2006_2/output_pp/105/411/AliESDs.root" ;
131 // analysisChain->AddFile(input);
132 input = "AliESDs.root" ;
133 analysisChain->AddFile(input);
134 ag->Process(analysisChain) ;
138 //______________________________________________________________________
139 void Merge(const char * xml, const char * sub, const char * out)
141 if (! gIsAnalysisLoaded )
144 AliAnalysisGoodies * ag = new AliAnalysisGoodies() ;
145 ag->Merge(xml, sub, out) ;
148 //______________________________________________________________________
149 void test(const char * fcollection1)
151 AliXMLCollection collection1(fcollection1);
152 TChain* analysisChain = new TChain("esdTree");
155 while (collection1.Next()) {
156 cout<<"Adding "<<collection1.GetTURL()<<endl;
157 analysisChain->Add(collection1.GetTURL());