building analysis train to be run from reco loop (Ruben)
[u/mrichter/AliRoot.git] / PWG1 / macros / RecoQAtrain.C
CommitLineData
604d6f7e 1// RS: This is macro to build an analysis train which will run from the reco loop
2// Uses special AliRecoInputHandler
3// Should be attached in rec.C as
4// AliReconstruction rec; rec.SetAnalysisMacro(thisMacroPath);
5
6void LoadLibraries();
7void AddAnalysisTasks();
8
9
10void RecoQAtrain()
11{
12 //
13 TGrid::Connect("alien://");
14 if (!gGrid || !gGrid->IsConnected()) {
15 ::Error("QAtrain", "No grid connection");
16 return;
17 }
18 // Set temporary merging directory to current one
19 gSystem->Setenv("TMPDIR", gSystem->pwd());
20 // Set temporary compilation directory to current one
21 gSystem->SetBuildDir(gSystem->pwd(), kTRUE);
22 // Load libraries
23 LoadLibraries();
24 printf("Include path: %s\n", gSystem->GetIncludePath());
25 // Create manager
26 AliAnalysisManager *mgr = new AliAnalysisManager("Analysis", "Reco QA train");
27 // Input handler
28 AliRecoInputHandler *esdHandler = new AliRecoInputHandler();
29 esdHandler->SetReadFriends(kTRUE);
30 esdHandler->SetActiveBranches("ESDfriend");
31 mgr->SetInputEventHandler(esdHandler);
32 //
33 // AnalysisTasks
34 AddAnalysisTasks();
35 //
36 if (!mgr->InitAnalysis()) printf("Failed to initialize Reco Analysis");
37}
38
39void LoadLibraries()
40{
41 gSystem->SetIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT -I$ALICE_ROOT/ITS -I$ALICE_ROOT/TRD -I$ALICE_ROOT/PWG1 -I$ALICE_ROOT/PWG1/TRD");
42 gSystem->Load("libANALYSIS");
43 gSystem->Load("libANALYSISalice");
44 gSystem->Load("libCORRFW");
45 gSystem->Load("libTENDER");
46 gSystem->Load("libPWG0base.so");
47 gSystem->Load("libPWG0dep.so");
48 gSystem->Load("libPWG0selectors.so");
49 gSystem->Load("libPWG1.so");
50}
51
52void AddAnalysisTasks()
53{
54 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
55 mgr->SetCommonFileName("RecoQAresults.root");
56 //
57 // Event Statistics (Jan Fiete)
58 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
59 AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(kFALSE /*MC*/);
60 //
61 // add standard ITSAlignQA task with only SDD calibration histos activated
62 gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskITSAlign.C");
63 AliAnalysisTaskITSAlignQA *itsAlign = AddTaskITSAlign(0,2011,kTRUE);
64 itsAlign->SetLoadGeometryFromOCDB(kFALSE);
65 itsAlign->SetDoSPDResiduals(kFALSE);
66 itsAlign->SetDoSDDResiduals(kFALSE);
67 itsAlign->SetDoSSDResiduals(kFALSE);
68 itsAlign->SetDoSDDDriftTime(kFALSE);
69 itsAlign->SetMinMaxMult(20.,1070.);
70 //
71}