Updating ITS macros (Ruben)
[u/mrichter/AliRoot.git] / PWGPP / macros / RecoQAtrain.C
index a2cbd9504554dabcd83d969c5e796295299181fb..89e94bddbc51d03a5f018559ddc8e579f004509e 100644 (file)
@@ -4,10 +4,10 @@
 // AliReconstruction rec; rec.SetAnalysisMacro(thisMacroPath);
 
 void LoadLibraries();
 // AliReconstruction rec; rec.SetAnalysisMacro(thisMacroPath);
 
 void LoadLibraries();
-void AddAnalysisTasks(); 
+void AddAnalysisTasks(Bool_t writeITSTP=kFALSE, Bool_t useTPCcrv=kFALSE); 
 
 
 
 
-void RecoQAtrain()
+void RecoQAtrain(Bool_t writeITSTP=kFALSE, Bool_t useTPCcrv=kFALSE)
 {
   //
   TGrid::Connect("alien://");
 {
   //
   TGrid::Connect("alien://");
@@ -31,7 +31,7 @@ void RecoQAtrain()
   mgr->SetInputEventHandler(esdHandler);
   //  
   // AnalysisTasks
   mgr->SetInputEventHandler(esdHandler);
   //  
   // AnalysisTasks
-  AddAnalysisTasks();
+  AddAnalysisTasks(writeITSTP,useTPCcrv);
   //
   if (!mgr->InitAnalysis()) printf("Failed to initialize Reco Analysis");
 }
   //
   if (!mgr->InitAnalysis()) printf("Failed to initialize Reco Analysis");
 }
@@ -43,17 +43,24 @@ void LoadLibraries()
   gSystem->Load("libANALYSISalice");
   gSystem->Load("libCORRFW");
   gSystem->Load("libTENDER");
   gSystem->Load("libANALYSISalice");
   gSystem->Load("libCORRFW");
   gSystem->Load("libTENDER");
-  gSystem->Load("libPWG0base.so");
-  gSystem->Load("libPWG0dep.so");
-  gSystem->Load("libPWG0selectors.so");
+  //  gSystem->Load("libPWG0base.so");
+  //  gSystem->Load("libPWG0dep.so");
+  //  gSystem->Load("libPWG0selectors.so");
   gSystem->Load("libPWGPP.so");
 }
 
   gSystem->Load("libPWGPP.so");
 }
 
-void AddAnalysisTasks()
+void AddAnalysisTasks(Bool_t writeITSTP, Bool_t useTPCcrv)
 {
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   mgr->SetCommonFileName("RecoQAresults.root");
   //
 {
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   mgr->SetCommonFileName("RecoQAresults.root");
   //
+  if (writeITSTP) {
+    AliAODHandler* aodHandler = new AliAODHandler();
+    aodHandler->SetOutputFileName( "AODtpITS.root" );
+    aodHandler->SetCreateNonStandardAOD();
+    mgr->SetOutputEventHandler(aodHandler);
+  }
+  //
   // Event Statistics (Jan Fiete)
   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
   AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(kFALSE /*MC*/);
   // Event Statistics (Jan Fiete)
   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
   AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(kFALSE /*MC*/);
@@ -67,5 +74,7 @@ void AddAnalysisTasks()
   itsAlign->SetDoSSDResiduals(kFALSE);
   itsAlign->SetDoSDDDriftTime(kFALSE);
   itsAlign->SetMinMaxMult(20.,1070.);
   itsAlign->SetDoSSDResiduals(kFALSE);
   itsAlign->SetDoSDDDriftTime(kFALSE);
   itsAlign->SetMinMaxMult(20.,1070.);
+  itsAlign->SetUseTPCMomentum(useTPCcrv);
   //
   //
+  itsAlign->SetDoFillTPTree(writeITSTP);
 }
 }