Add possbility to read also the RecPoints
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Nov 2009 23:23:34 +0000 (23:23 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Nov 2009 23:23:34 +0000 (23:23 +0000)
PWG1/macros/RunAnalysisITS.C

index b5b0895..c47c960 100644 (file)
@@ -34,7 +34,7 @@ void RunAnalysisITS() {
   // Load analysis libraries
   gSystem->Load("libANALYSIS.so");
   gSystem->Load("libANALYSISalice.so");
-  if(uselibPWG1) {gSystem->Load("libTENDER.so"); gSystem->Load("libPWG1.so");}
+  if(uselibPWG1) {gSystem->Load("libTENDER.so");gSystem->Load("libPWG1.so");}
 
   // Create Alien plugin, if requested
   if(useAlienPlugin) {  
@@ -45,10 +45,10 @@ void RunAnalysisITS() {
   TChain *chainESD = 0;
   if(!useAlienPlugin) {
     // Prepare input chain
-    //    chainESD = CreateESDChain("/home/dainesea/alignData/RAWdata_CosmicsSum09/RecoSPD/chunk.",13,13);
-    chainESD=new TChain("esdTree");
+    chainESD = CreateESDChain("/home/dainesea/alignEvents2/boxTRUNK280909_zero/event.",1,48);
+    //chainESD=new TChain("esdTree");
     //chainESD->Add("alien:///alice/cern.ch/user/s/sitta/output/000088361/ESDs/pass1/09000088361017.10/AliESDs.root");
-    chainESD->Add("AliESDs.root");
+    //chainESD->Add("./AliESDs.root");
   }
 
   // Create the analysis manager
@@ -58,19 +58,24 @@ void RunAnalysisITS() {
   // Connect plug-in to the analysis manager
   if(useAlienPlugin) mgr->SetGridHandler(alienHandler);
 
+  //-------------------------------------------------------------------
+
   // Add ESD handler
-  AliESDInputHandler *esdH = new AliESDInputHandler();
+  Bool_t readRP=kTRUE;
+  AliESDInputHandler *esdH = 0;
+  if(readRP) {
+    esdH = new AliESDInputHandlerRP();
+  } else {
+    esdH = new AliESDInputHandler();
+  }
   if(readHLT) esdH->SetReadHLT();
   mgr->SetInputEventHandler(esdH);
-
-  //-------------------------------------------------------------------
-
   
   //-------------------------------------------------------------------
   // Analysis tasks (wagons of the train)   
   //
   TString taskName;
-  
+  /*
   if(!uselibPWG1) gROOT->LoadMacro("AliAlignmentDataFilterITS.cxx++g");
   taskName="AddTaskAlignmentDataFilterITS.C"; 
   taskName.Prepend(loadMacroPath.Data());
@@ -83,26 +88,25 @@ void RunAnalysisITS() {
   gROOT->LoadMacro(taskName.Data());
   AliTrackMatchingTPCITSCosmics *tpcitsTask = AddTaskTrackMatchingTPCITS();
   if(readHLT) tpcitsTask->SetReadHLTESD(kTRUE);  
-  /*
+  */
   Bool_t readMC=kTRUE;
-
   if(!uselibPWG1) gROOT->LoadMacro("AliAnalysisTaskVertexESD.cxx++g");
   taskName="AddTaskVertexESD.C"; 
   taskName.Prepend(loadMacroPath.Data());
   gROOT->LoadMacro(taskName.Data());
-  AliAnalysisTaskVertexESD *vtxTask = AddTaskVertexESD(readMC);
+  //AliAnalysisTaskVertexESD *vtxTask = AddTaskVertexESD(readMC);
     
   if(!uselibPWG1) gROOT->LoadMacro("AliAnalysisTaskITSTrackingCheck.cxx++g");
   taskName="AddTaskPerformanceITS.C"; 
   taskName.Prepend(loadMacroPath.Data());
   gROOT->LoadMacro(taskName.Data());
-  AliAnalysisTaskITSTrackingCheck *itsTask = AddTaskPerformanceITS(readMC);
+  AliAnalysisTaskITSTrackingCheck *itsTask = AddTaskPerformanceITS(readMC,readRP);
 
   if(readMC) {
     AliMCEventHandler  *mcH = new AliMCEventHandler();
     mgr->SetMCtruthEventHandler(mcH); 
   }
-  */
+  
   //
   // Run the analysis
   //    
@@ -212,6 +216,16 @@ TChain *CreateESDChain(TString esdpath=".",Int_t ifirst=-1,Int_t ilast=-1) {
     chainESD->Add("AliESDs.root");
   } else {
     for(Int_t i=ifirst; i<=ilast; i++) {
+      TString command=".! ln -s ";
+      command+=esdpath.Data();
+      command+=i;
+      command+= "/AliESDs_def.root ";
+      command+=esdpath.Data();
+      command+=i;
+      command+= "/AliESDs.root ";
+      gROOT->ProcessLine(command.Data());
+      command.ReplaceAll("AliESDs","AliESDfriends");
+      gROOT->ProcessLine(command.Data());
       TString esdfile=esdpath; esdfile+=i; esdfile.Append("/AliESDs.root");
       chainESD->Add(esdfile.Data());
     }