Fix in physics selection OADB
[u/mrichter/AliRoot.git] / ANALYSIS / macros / AODtrain.C
index ec60714..1ff87a7 100644 (file)
@@ -2,12 +2,12 @@
 //==============================================================================
 Int_t       runOnData          = 1;       // Set to 1 if processing real data
 Int_t       iCollision         = 0;       // 0=pp, 1=Pb-Pb
-Int_t       run_flag           = 1100;    // year (2011 = 1100)
+Int_t       run_flag           = 1000;    // year (2010 pp)
 //==============================================================================
 Bool_t      doCDBconnect        =1;
 Bool_t      usePhysicsSelection = kTRUE; // use physics selection
 Bool_t      useTender           = kFALSE; // use tender wagon
-Bool_t      useCentrality       = kTRUE; // centrality
+Bool_t      useCentrality       = kFALSE; // centrality
 Bool_t      useV0tender         = kFALSE;  // use V0 correction in tender
 Bool_t      useDBG              = kTRUE;  // activate debugging
 Bool_t      useMC               = kFALSE;  // use MC info
@@ -15,15 +15,15 @@ Bool_t      useKFILTER          = kFALSE;  // use Kinematics filter
 Bool_t      useTR               = kFALSE;  // use track references
 Bool_t      useCORRFW           = kFALSE; // do not change
 Bool_t      useAODTAGS          = kFALSE; // use AOD tags
-Bool_t      useSysInfo          = kFALSE; // use sys info
+Bool_t      useSysInfo          = kTRUE; // use sys info
 
 // ### Analysis modules to be included. Some may not be yet fully implemented.
 //==============================================================================
 Int_t       iAODhandler        = 1;      // Analysis produces an AOD or dAOD's
 Int_t       iESDfilter         = 1;      // ESD to AOD filter (barrel + muon tracks)
 Int_t       iMUONcopyAOD       = 1;      // Task that copies only muon events in a separate AOD (PWG3)
-Int_t       iJETAN             = 1;      // Jet analysis (PWG4)
-Int_t       iJETANdelta        = 1;      // Jet delta AODs
+Int_t       iJETAN             = 0;      // Jet analysis (PWG4)
+Int_t       iJETANdelta        = 0;      // Jet delta AODs
 Int_t       iPWGHFvertexing     = 1;      // Vertexing HF task (PWG3)
 Int_t       iPWGDQJPSIfilter    = 0;      // JPSI filtering (PWG3)
 Int_t       iPWGHFd2h           = 1;      // D0->2 hadrons (PWG3)
@@ -44,6 +44,8 @@ Bool_t LoadCommonLibraries();
 Bool_t LoadAnalysisLibraries();
 Bool_t LoadLibrary(const char *);
 TChain *CreateChain();
+const char *cdbPath = "raw://";
+Int_t run_number = 0;
 
 //______________________________________________________________________________
 void AODtrain(Int_t merge=0)
@@ -83,7 +85,11 @@ void AODtrain(Int_t merge=0)
     
    // Make the analysis manager and connect event handlers
    AliAnalysisManager *mgr  = new AliAnalysisManager("Analysis Train", "Production train");
-   if (useSysInfo) mgr->SetNSysInfo(100);
+    mgr->SetCacheSize(0);
+   if (useSysInfo) {
+ //     mgr->SetNSysInfo(100);
+      AliSysInfo::SetVerbose(kTRUE);
+   }   
    // Load analysis specific libraries
    if (!LoadAnalysisLibraries()) {
       ::Error("AnalysisTrain", "Could not load analysis libraries");
@@ -110,7 +116,7 @@ void AODtrain(Int_t merge=0)
    // Debugging if needed
    if (useDBG) mgr->SetDebugLevel(3);
 
-   AddAnalysisTasks();
+   AddAnalysisTasks(cdbPath);
    if (merge) {
       AODmerge();
       mgr->InitAnalysis();
@@ -134,7 +140,7 @@ void AODtrain(Int_t merge=0)
 }                                                                                                                                          
                                                                                                                                             
 //______________________________________________________________________________                                                           
-void AddAnalysisTasks(){                                                                                                                                          
+void AddAnalysisTasks(const char *cdb_location){                                                                                                                                          
   // Add all analysis task wagons to the train                                                                                               
    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();                                                                     
 
@@ -148,12 +154,22 @@ void AddAnalysisTasks(){
       AliAnalysisTaskSE *tender = AddTaskTender(useV0tender);
 //      tender->SetDebugLevel(2);
    }
+   
+   // Clean Geometry: Ruben
+  gROOT->LoadMacro("$ALICE_ROOT/PWGPP/CalibMacros/commonMacros/CleanGeom.C++");
+  CleanGeom* clgmTask = new CleanGeom("cleanGeom");
+  mgr->AddTask(clgmTask);
+  AliAnalysisDataContainer *dummyInp = mgr->GetCommonInputContainer();
+  if (dummyInp) mgr->ConnectInput(clgmTask,0,dummyInp);  
+   
    //
   // PIDResponse(JENS)
   //
   if (doPIDResponse) {
     gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); 
     AliAnalysisTaskPIDResponse *PIDResponse = AddTaskPIDResponse();
+     PIDResponse->SetUserDataRecoPass(1);
 //    PIDResponse->SelectCollisionCandidates(AliVEvent::kAny);
   }  
  
@@ -169,10 +185,10 @@ void AddAnalysisTasks(){
   //
   if (doCDBconnect && !useTender) {
     gROOT->LoadMacro("$ALICE_ROOT/PWGPP/PilotTrain/AddTaskCDBconnect.C");
-    AliTaskCDBconnect *taskCDB = AddTaskCDBconnect();
+    AliTaskCDBconnect *taskCDB = AddTaskCDBconnect(cdb_location, run_number);
     if (!taskCDB) return;
     AliCDBManager *cdb = AliCDBManager::Instance();
-    cdb->SetDefaultStorage("raw://");
+    cdb->SetDefaultStorage(cdb_location);
 //    taskCDB->SetRunNumber(run_number);
   }    
  
@@ -218,15 +234,23 @@ void AddAnalysisTasks(){
 
    if (iESDfilter) {
       //  ESD filter task configuration.
-      gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskESDFilter.C");
+      gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/ESDfilter/macros/AddTaskESDFilter.C");
       if (iMUONcopyAOD) {
          printf("Registering delta AOD file\n");
          mgr->RegisterExtraFile("AliAOD.Muons.root");
-         mgr->RegisterExtraFile("AliAOD.Dimuons.root");
-         AliAnalysisTaskESDfilter *taskesdfilter = AddTaskESDFilter(useKFILTER, kTRUE, kFALSE, kFALSE /*usePhysicsSelection*/,kFALSE,kTRUE,kFALSE,kFALSE,run_flag);
-      } else {
-          AliAnalysisTaskESDfilter *taskesdfilter = AddTaskESDFilter(useKFILTER, kFALSE, kFALSE, kFALSE /*usePhysicsSelection*/,kFALSE,kTRUE,kFALSE,kFALSE,run_flag); // others
-      }   
+          mgr->RegisterExtraFile("AliAOD.Dimuons.root");
+      }
+      AliAnalysisTaskESDfilter *taskesdfilter = 
+                 AddTaskESDFilter(useKFILTER, 
+                                  iMUONcopyAOD,         // write Muon AOD
+                                  kFALSE,               // write dimuon AOD 
+                                  kFALSE,               // usePhysicsSelection 
+                                  kFALSE,               // centrality OBSOLETE
+                                  kTRUE,                // enable TPS only tracks
+                                  kFALSE,               // disable cascades
+                                  kFALSE,               // disable kinks
+                                  run_flag);            // run flag (YY00)
+        mgr->RegisterExtraFile("AliAOD.Dimuons.root");
    }   
 
 // ********** PWG3 wagons ******************************************************           
@@ -338,6 +362,7 @@ Bool_t LoadCommonLibraries()
    success &= LoadLibrary("libANALYSIS.so");
    success &= LoadLibrary("libOADB.so");
    success &= LoadLibrary("libANALYSISalice.so");
+     success &= LoadLibrary("libESDfilter.so");
    success &= LoadLibrary("libCORRFW.so");
    gROOT->ProcessLine(".include $ALICE_ROOT/include");
    if (success) {
@@ -381,13 +406,14 @@ Bool_t LoadAnalysisLibraries()
    // PWG2 FORWARD
    if (iPWGLFForward) {
       //if (!LoadLibrary("PWGLFforward", mode, kTRUE)) return kFALSE;
-      if (!LoadLibrary("PWGLFforward2")) return kFALSE;
-   }   
+     if (!LoadLibrary("PWGLFforward2")) return kFALSE;
+  }   
    
    // PWG3 Vertexing HF
    if (iPWGHFvertexing || iPWGHFd2h) {
       if (!LoadLibrary("PWGflowBase") ||
           !LoadLibrary("PWGflowTasks") ||
+          !LoadLibrary("PWGTRD") ||
           !LoadLibrary("PWGHFvertexingHF")) return kFALSE;
    }    
  //    if (iPWGHFvertexing || iPWG3d2h) {