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() ) ;
16 sprintf(parpar, "%s.par", pararchivename) ;
17 if ( gSystem->AccessPathName(parpar) ) {
18 gSystem->ChangeDirectory(gSystem->Getenv("ALICE_ROOT")) ;
19 char processline[1024];
20 sprintf(processline, ".! make %s", parpar) ;
21 cout << processline << endl ;
22 gROOT->ProcessLine(processline) ;
23 gSystem->ChangeDirectory(cdir) ;
24 sprintf(processline, ".! mv %s/%s .", gSystem->Getenv("ALICE_ROOT"), parpar) ;
25 gROOT->ProcessLine(processline) ;
26 sprintf(processline,".! tar xvzf %s",parpar);
27 gROOT->ProcessLine(processline);
29 gSystem->ChangeDirectory(pararchivename);
31 // check for BUILD.sh and execute
32 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
33 printf("*** Building PAR archive %s ***\n", pararchivename);
35 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
36 AliError(Form("Cannot Build the PAR Archive %s! - Abort!", pararchivename) );
42 // check for SETUP.C and execute
43 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
44 printf("*** Setup PAR archive %s ***\n", pararchivename);
45 gROOT->Macro("PROOF-INF/SETUP.C");
49 if ( strstr(pararchivename, "ESD") ) {
50 //gSystem->Load("libVMC.so");
51 //gSystem->Load("libRAliEn.so");
52 gSystem->Load("libESD.so") ;
53 //gSystem->Load("libProof.so") ;
56 if ( strstr(pararchivename, "AnalysisCheck") ) {
57 gSystem->Load("libSpectrum.so");
60 printf("lib%s done\n", pararchivename);
62 gSystem->ChangeDirectory(cdir);
64 gIsAnalysisLoaded = kTRUE ;
68 //______________________________________________________________________
69 void ana(const Int_t kEvent=100)
71 if (! gIsAnalysisLoaded ) {
74 LoadLib("AnalysisCheck") ;
77 // create the analysis goodies object
78 AliAnalysisGoodies * ag = new AliAnalysisGoodies() ;
80 // definition of analysis tasks
82 const Int_t knumberOfTasks = 10 ;
83 AliAnalysisTask * taskList[knumberOfTasks] ;
84 TClass * taskInputList[knumberOfTasks] ;
85 TClass * taskOutputList[knumberOfTasks] ;
87 taskList[0] = new AliPHOSQATask("PHOS") ;
88 taskInputList[0] = TChain::Class() ;
89 taskOutputList[0] = TObjArray::Class() ;
91 taskList[1] = new AliEMCALQATask("EMCal") ;
92 taskInputList[1] = taskInputList[0] ; // only one top input container allowed
93 taskOutputList[1] = TObjArray::Class() ;
95 taskList[2] = new AliPMDQATask("PMD") ;
96 taskInputList[2] = taskInputList[0] ; // only one top input container allowed
97 taskOutputList[2] = TObjArray::Class() ;
99 taskList[3] = new AliAnalysisTaskPt("Pt") ;
100 taskInputList[3] = taskInputList[0] ; // only one top input container allowed
101 taskOutputList[3] = TObjArray::Class() ;
103 taskList[4] = new AliHMPIDQATask("HMPID") ;
104 taskInputList[4] = taskInputList[0] ; // only one top input container allowed
105 taskOutputList[4] = TObjArray::Class() ;
107 taskList[5] = new AliT0QATask("T0") ;
108 taskInputList[5] = taskInputList[0] ; // only one top input container allowed
109 taskOutputList[5] = TObjArray::Class() ;
111 taskList[6] = new AliMUONQATask("MUON") ;
112 taskInputList[6] = taskInputList[0] ; // only one top input container allowed
113 taskOutputList[6] = TObjArray::Class() ;
115 taskList[7] = new AliTRDQATask("TRD") ;
116 taskInputList[7] = taskInputList[0] ; // only one top input container allowed
117 taskOutputList[7] = TObjArray::Class() ;
119 taskList[8] = new AliTOFQATask("TOF") ;
120 taskInputList[8] = taskInputList[0] ; // only one top input container allowed
121 taskOutputList[8] = TObjArray::Class() ;
123 taskList[9] = new AliVZEROQATask("VZERO") ;
124 taskInputList[9] = taskInputList[0] ; // only one top input container allowed
125 taskOutputList[9] = TObjArray::Class() ;
127 // taskList[8] = new AliFMDQATask("FMD") ;
128 // taskInputList[8] = taskInputList[0] ; // only one top input container allowed
129 // taskOutputList[8] = TObjArray::Class() ;
131 ag->SetTasks(knumberOfTasks, taskList, taskInputList, taskOutputList) ;
133 // get the data to analyze
135 // definition of Tag cuts
136 const char * runCuts = 0x0 ;
137 const char * evtCuts = 0x0 ;
138 const char * lhcCuts = 0x0 ;
139 const char * detCuts = 0x0 ;
141 //"fEventTag.fNPHOSClustersMin == 1 && fEventTag.fNEMCALClustersMin == 1" ;
144 TString input = gSystem->Getenv("ANA_INPUT") ;
146 char argument[1024] ;
147 if ( input.Contains("tag?") ) {
148 //create the ESD collection from the tag collection
149 input.ReplaceAll("tag?", "") ;
150 const char * collESD = "esdCollection.xml" ;
151 ag->MakeEsdCollectionFromTagCollection(runCuts, lhcCuts, detCuts, evtCuts, input.Data(), collESD) ;
152 sprintf(argument, "esd?%s", collESD) ;
153 } else if ( input.Contains("esd?") )
154 sprintf(argument, "%s", input.Data()) ;
155 ag->Process(argument) ;
159 TChain* analysisChain = new TChain("esdTree") ;
160 // input = "alien:///alice/cern.ch/user/a/aliprod/prod2006_2/output_pp/105/411/AliESDs.root" ;
161 // analysisChain->AddFile(input);
162 input = "AliESDs.root" ;
163 const char * kInDir = gSystem->Getenv("OUTDIR") ;
165 if ( ! gSystem->cd(kInDir) ) {
166 printf("%s does not exist\n", kInDir) ;
169 Int_t event, skipped=0 ;
171 for (event = 0 ; event < kEvent ; event++) {
172 sprintf(file, "%s/%d/AliESDs.root", kInDir,event) ;
174 if ( fESD = TFile::Open(file))
175 if ( fESD->Get("esdTree") ) {
176 printf("++++ Adding %s\n", file) ;
177 analysisChain->AddFile(file);
180 printf("---- Skipping %s\n", file) ;
184 printf("number of entries # %lld, skipped %d\n", analysisChain->GetEntries(), skipped*100) ;
187 analysisChain->AddFile(input);
189 ag->Process(analysisChain) ;
194 //______________________________________________________________________
195 void Merge(const char * xml, const char * sub, const char * out)
197 if (! gIsAnalysisLoaded )
200 AliAnalysisGoodies * ag = new AliAnalysisGoodies() ;
201 ag->Merge(xml, sub, out) ;