.so cleanup: removed from gSystem->Load()
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TestAOD / runAODProof.C
1 void runAODProof(Int_t c=3, const char * proofMode = "full")
2 { //1 data AOD049
3   //2 MC AOD048
4   //3 data AOD086
5   //4 MC AOD090
6   //5 MC_AMPT AOD081
7   
8   //  gEnv->SetValue("XSec.GSI.DelegProxy", "2");
9   
10   // Load common libraries
11   gSystem->Load("libCore");
12   gSystem->Load("libTree");
13   gSystem->Load("libGeom");
14   gSystem->Load("libVMC");
15   gSystem->Load("libPhysics");
16   gSystem->Load("libMinuit");
17   gSystem->Load("libGui");
18   gSystem->Load("libXMLParser");
19   gSystem->Load("libSTEERBase");
20   gSystem->Load("libESD");
21   gSystem->Load("libCDB");
22   gSystem->Load("libAOD");
23   gSystem->Load("libANALYSIS");
24   gSystem->Load("libANALYSISalice");
25   gSystem->Load("libCORRFW");
26   gSystem->Load("libProof");
27   gSystem->Load("libRAWDatabase");
28   gSystem->Load("libSTEER");
29   //__________________________________________________________________________
30   // Use AliRoot includes to compile our task
31   gROOT->ProcessLine(".include $ALICE_ROOT/include");
32   gSystem->Load("libPWGLFspectra");
33   
34   AliAnalysisAlien * handler = new AliAnalysisAlien("test");
35   handler->SetOverwriteMode();
36   handler->SetRunMode(proofMode);
37   handler->SetProofReset(0);
38   handler->SetAliROOTVersion("v5-03-36-AN");
39   
40   //handler->SetNproofWorkers(80);
41   //handler->SetNproofWorkersPerSlave(4);
42   handler->SetProofCluster(Form("%s@alice-caf.cern.ch", gSystem->Getenv("CAFUSER")));
43   //handler->SetProofCluster(Form("%s@skaf.saske.sk",gSystem->Getenv("CAFUSER")));
44   // Set handler for Real DATA:
45   if (c == 1){
46     handler->SetProofDataSet("/default/lmilano/LHC10h_000138653_AOD049_p2#aodTree|/default/lmilano/LHC10h_000138662_AOD049_p2#aodTree|/default/lmilano/LHC10h_000138666_AOD049_p2#aodTree|/default/lmilano/LHC10h_000138730_AOD049_p2#aodTree|/default/lmilano/LHC10h_000138732_AOD049_p2#aodTree|/default/lmilano/LHC10h_000139507_AOD049_p2#aodTree|/default/lmilano/LHC10h_000139465_AOD049_p2#aodTree|/default/lmilano/LHC10h_000139437_AOD049_p2#aodTree|/default/lmilano/LHC10h_000139107_AOD049_p2#aodTree|/default/lmilano/LHC10h_000139510_AOD049_p2#aodTree");
47   }
48   if (c == 2){
49     handler->SetProofDataSet("/default/lmilano/LHC11a10a_138653_AOD048#aodTree|/default/lmilano/LHC11a10a_138662_AOD048#aodTree|/default/lmilano/LHC11a10a_138666_AOD048#aodTree|/default/lmilano/LHC11a10a_138730_AOD048#aodTree|/default/lmilano/LHC11a10a_138732_AOD048#aodTree|/default/lmilano/LHC11a10a_139507_AOD048#aodTree|/default/lmilano/LHC11a10a_139465_AOD048#aodTree|/default/lmilano/LHC11a10a_139437_AOD048#aodTree|/default/lmilano/LHC11a10a_139107_AOD048#aodTree|/default/lmilano/LHC11a10a_139510_AOD048#aodTree");      
50   }
51   if (c == 3){
52     handler->SetProofDataSet("/default/lmilano/LHC10h_000138653_AOD086_p2#aodTree|/default/lmilano/LHC10h_000138666_AOD086_p2#aodTree|/default/lmilano/LHC10h_000139107_AOD086_p2#aodTree|/default/lmilano/LHC10h_000138275_AOD086_p2#aodTree|/default/lmilano/LHC10h_000139465_AOD086_p2#aodTree|/default/lmilano/LHC10h_000139437_AOD086_p2#aodTree|/default/lmilano/LHC10h_000138442_AOD086_p2#aodTree|/default/lmilano/LHC10h_000138396_AOD086_p2#aodTree|/default/lmilano/LHC10h_000138364_AOD086_p2#aodTree");      
53   }
54   if (c == 4){
55     handler->SetProofDataSet("/default/lmilano/LHC11a10a_bis_138653_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_138666_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_139107_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_138275_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_139465_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_139437_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_138442_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_138396_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_138364_AOD090#aodTree");        }
56   if (c == 5){
57     handler->SetProofDataSet("/default/lmilano/LHC12a11e_137686_AOD081#aodTree|/default/lmilano/LHC12a11e_138534_AOD081#aodTree|/default/lmilano/LHC12a11e_138653_AOD081#aodTree|/default/lmilano/LHC12a11e_139038_AOD081#aodTree|/default/lmilano/LHC12a11e_139437_AOD081#aodTree|");        }
58
59   handler->SetAliRootMode("default");
60   handler->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/TOF -I$ALICE_ROOT/PWGLF");
61   handler->SetAdditionalLibs("libPWGLFspectra.so");
62   // gROOT->LoadMacro("AliSpectraAODTrackCuts.cxx+g");
63   // gROOT->LoadMacro("AliSpectraAODEventCuts.cxx+g");
64   // gROOT->LoadMacro("AliSpectraAODHistoManager.cxx+g");
65   // gROOT->LoadMacro("AliSpectraAODPID.cxx+g");
66   // gROOT->LoadMacro("AliAnalysisTaskSpectraAOD.cxx+g");
67   
68   // handler->SetAdditionalLibs("AliSpectraAODHistoManager.cxx AliSpectraAODHistoManager.h AliSpectraAODPID.cxx AliSpectraAODPID.h AliSpectraAODTrackCuts.cxx AliSpectraAODTrackCuts.h AliSpectraAODEventCuts.cxx AliSpectraAODEventCuts.h AliAnalysisTaskSpectraAOD.cxx AliAnalysisTaskSpectraAOD.h");
69   // handler->SetAnalysisSource("Histograms.h HistogramNames.h AliSpectraAODHistoManager.cxx+ AliSpectraAODTrackCuts.cxx+ AliSpectraAODEventCuts.cxx+ AliSpectraAODPID.cxx+ AliAnalysisTaskSpectraAOD.cxx+");
70   handler->SetClearPackages();
71   
72   AliAnalysisManager *mgr = new AliAnalysisManager("testAnalysis");
73   mgr->SetGridHandler(handler);
74   AliAODInputHandler* aodH = new AliAODInputHandler();
75   mgr->SetInputEventHandler(aodH);
76   
77   // Add PID task
78   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
79   Printf("-------------------------------adding in runAOD AddTaskPIDResponse");
80   // Add PID task
81   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
82   AliAnalysisTaskPIDResponse *taskPID=AddTaskPIDResponse();
83   
84   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskVZEROEPSelection.C");
85   AliVZEROEPSelectionTask *selTask = AddTaskVZEROEPSelection();
86   
87   gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/PiKaPr/TestAOD/AddTaskSpectraAOD.C");
88   Bool_t mc=kFALSE;
89   //LOOP OVER SELECTION
90   //                            0    1    2    3    4    5    6    7    8    9
91   Double_t CentCutMin[4]= {     0,  30,  30,  30};
92   Double_t CentCutMax[4]= {     5,  40,  40,  40};
93   // Double_t CentCutMin[4]= {     0,   0,   0,   0};
94   // Double_t CentCutMax[4]= {     5, 100, 100, 100};
95   Double_t QvecCutMin[4]={      0,   0,   0, 1.5};
96   Double_t QvecCutMax[4]={    100, 100, 0.4, 100};
97   Double_t EtaMin[4]={       -0.8,-0.8,-0.8,-0.8};
98   Double_t EtaMax[4]={        0.8, 0.8, 0.8, 0.8};
99   Double_t Nsigmapid=3.;
100   Double_t pt=10.;
101   Double_t p=10.;
102   Double_t y=.5;
103   Double_t ptTofMatch=.6;
104   UInt_t trkbit=1024;
105   UInt_t trkbitQVector=1;
106   Bool_t UseCentPatchAOD049=kFALSE;
107   Double_t DCA=100000;
108   UInt_t minNclsTPC=70;
109   Int_t nrebin=30;
110   TString opt="";
111   
112   if(c==2||c==4||c==5)mc=kTRUE;
113   if(c==1)UseCentPatchAOD049=kTRUE;
114   
115   for(Int_t icut=1;icut<4;icut++){
116     //if(icut!=0)continue;
117     AliAnalysisTaskSpectraAOD *taskAOD =AddTaskSpectraAOD(mc,CentCutMin[icut],CentCutMax[icut],QvecCutMin[icut],QvecCutMax[icut],EtaMin[icut],EtaMax[icut],Nsigmapid,pt,p,y,ptTofMatch,trkbit,trkbitQVector,UseCentPatchAOD049,DCA,minNclsTPC,nrebin,opt);
118     taskAOD->GetOutputSlot(1)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(1)->GetContainer()->GetName(),taskAOD->GetName()));
119     taskAOD->GetOutputSlot(2)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(2)->GetContainer()->GetName(),taskAOD->GetName()));
120     taskAOD->GetOutputSlot(3)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(3)->GetContainer()->GetName(),taskAOD->GetName()));
121     taskAOD->GetOutputSlot(4)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(4)->GetContainer()->GetName(),taskAOD->GetName()));
122   }
123   
124   if (!mgr->InitAnalysis()) return;
125   mgr->PrintStatus();
126   mgr->StartAnalysis("proof");
127 }