Fix in physics selection OADB
[u/mrichter/AliRoot.git] / ANALYSIS / macros / AODtrain.C
index e79753d..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,16 +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       iESDfilterReVtx    = -1;     // Request revertexing in ESD filtering
 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)
@@ -70,10 +69,7 @@ void AODtrain(Int_t merge=0)
    printf("=  Configuring analysis train for:                               =\n");
    if (usePhysicsSelection)   printf("=  Physics selection                                                =\n");
    if (useTender)    printf("=  TENDER                                                        =\n");
-   if (iESDfilter)   {
-     printf("=  ESD filter                                                    =\n");
-     if (iESDfilterReVtx>=0)  printf("=  ESD event revertexed before filterering, algo %2d              =\n",iESDfilterReVtx);
-   }
+   if (iESDfilter)   printf("=  ESD filter                                                    =\n");
    if (iMUONcopyAOD) printf("=  MUON copy AOD                                                 =\n");
    if (iJETAN)       printf("=  Jet analysis                                                  =\n");
    if (iJETANdelta)  printf("=     Jet delta AODs                                             =\n");
@@ -89,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");
@@ -154,12 +154,22 @@ void AddAnalysisTasks(const char *cdb_location){
       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);
   }  
  
@@ -225,16 +235,22 @@ void AddAnalysisTasks(const char *cdb_location){
    if (iESDfilter) {
       //  ESD filter task configuration.
       gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/ESDfilter/macros/AddTaskESDFilter.C");
-      AliAnalysisTaskESDfilter *taskesdfilter = 0;
       if (iMUONcopyAOD) {
          printf("Registering delta AOD file\n");
          mgr->RegisterExtraFile("AliAOD.Muons.root");
-         mgr->RegisterExtraFile("AliAOD.Dimuons.root");
-         taskesdfilter = AddTaskESDFilter(useKFILTER, kTRUE, kFALSE, kFALSE /*usePhysicsSelection*/,kFALSE,kTRUE,kFALSE,kFALSE,run_flag);
-      } else {
-       taskesdfilter = AddTaskESDFilter(useKFILTER, kFALSE, kFALSE, kFALSE /*usePhysicsSelection*/,kFALSE,kTRUE,kFALSE,kFALSE,run_flag); // others
-      }   
-      if (iESDfilterReVtx>=0 && taskesdfilter) taskesdfilter->SetRefitVertexTracks(iESDfilterReVtx);
+          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 ******************************************************           
@@ -346,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) {
@@ -389,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) {