Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / ANALYSIS / runAODFilterMC.C
CommitLineData
d2740fba 1void runAODFilterMC()
2{
3 // PROOF example
4
5 gSystem->Load("libTree.so");
6 gSystem->Load("libPhysics.so");
7 gSystem->Load("libGeom.so");
8 gSystem->Load("libVMC.so");
9
10 bool bKineFilter = true;
dce1b636 11 // TProof::Mgr("alicecaf")->SetROOTVersion("v5-21-01-alice_dbg");
d2740fba 12 TProof::Open("alicecaf");
dce1b636 13 // gProof->SetParallel(1);
14
d2740fba 15 char *dataset = "/COMMON/COMMON/LHC08c11_10TeV_0.5T";
16 // char *dataset = "/PWG4/kleinb/LHC08q_jetjet100";
17 // gProof->ClearPackages();
18 gProof->UploadPackage("${ALICE_ROOT}/STEERBase.par");
19 gProof->EnablePackage("STEERBase");
20 gProof->UploadPackage("${ALICE_ROOT}/ESD.par");
21 gProof->EnablePackage("ESD");
22 gProof->UploadPackage("${ALICE_ROOT}/AOD.par");
23 gProof->EnablePackage("AOD");
24 gProof->UploadPackage("${ALICE_ROOT}/ANALYSIS.par");
25 gProof->EnablePackage("ANALYSIS");
26 gProof->UploadPackage("${ALICE_ROOT}/ANALYSISalice.par");
27 gProof->EnablePackage("ANALYSISalice");
28
29 //
30 if (gApplication) gApplication->InitializeGraphics();
31 // Create the chain
32 //
33
34
35 ///////////////////////////////////////////////////////////////////////////////////
36 // Create the analysis manager
37 //
38 // Input
39 AliESDInputHandler* inpHandler = new AliESDInputHandler();
40 // Output
41 AliAODHandler* aodHandler = new AliAODHandler();
42 aodHandler->SetOutputFileName("aod_ckb2.root");
43 // MC Truth
44 AliMCEventHandler* mcHandler = new AliMCEventHandler();
45 AliAnalysisManager *mgr = new AliAnalysisManager("Filter Manager", "Filter Manager");
46 if(bKineFilter){
47 mgr->SetMCtruthEventHandler(mcHandler);
48 }
49
50 mgr->SetInputEventHandler (inpHandler);
51 mgr->SetOutputEventHandler (aodHandler);
52 aodHandler->Dump();
53
54 mgr->SetDebugLevel(10);
55
56 // Filtering of MC particles (decays conversions etc)
57 // this task is also needed to set the MCEventHandler
58 // to the AODHandler, this will not be needed when
59 // AODHandler goes to ANALYSISalice
60 AliAnalysisTaskMCParticleFilter *kinefilter = new AliAnalysisTaskMCParticleFilter("Particle Filter");
61 if(bKineFilter)mgr->AddTask(kinefilter);
62
63
64 //
65 AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Loose");
66 esdTrackCutsL->SetMinNClustersTPC(50);
67 esdTrackCutsL->SetMaxChi2PerClusterTPC(3.5);
68 esdTrackCutsL->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
69 esdTrackCutsL->SetRequireTPCRefit(kTRUE);
70 esdTrackCutsL->SetDCAToVertexZ(3.0);
71 esdTrackCutsL->SetDCAToVertexXY(3.0);
75bcd466 72 esdTrackCutsL->SetDCAToVertex2D(kTRUE);
d2740fba 73 esdTrackCutsL->SetRequireSigmaToVertex(kFALSE);
de9a3417 74 esdTrackCutsL->SetAcceptKinkDaughters(kFALSE);
ba35c6d3 75
76 AliESDtrackCuts* esdTrackCutsITSsa = new AliESDtrackCuts("AliESDtrackCuts", "ITS stand-alone");
77 esdTrackCutsITSsa->SetRequireITSStandAlone(kTRUE);
d2740fba 78
79 AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
80 trackFilter->AddCuts(esdTrackCutsL);
ba35c6d3 81 trackFilter->AddCuts(esdTrackCutsITSsa);
d2740fba 82
83 AliAnalysisTaskESDfilter *esdfilter = new AliAnalysisTaskESDfilter("ESD Filter");
84 esdfilter->SetTrackFilter(trackFilter);
85
86 mgr->AddTask(esdfilter);
87
88
89 //
90 // Create containers for input/output
15e62203 91 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
92 AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer();
d2740fba 93
94 coutput1->SetSpecialOutput();
95
96 if(bKineFilter){
97 mgr->ConnectInput (kinefilter, 0, cinput1 );
98 mgr->ConnectOutput (kinefilter, 0, coutput1 );
a3b51fd2 99 AliAnalysisDataContainer *coutputEx = mgr->CreateContainer("cFilterList", TList::Class(),
100 AliAnalysisManager::kOutputContainer,"pyxsec_hists.root");
101 mgr->ConnectOutput (kinefilter, 1, coutputEx );
d2740fba 102 }
103
104 mgr->ConnectInput (esdfilter, 0, cinput1 );
105 mgr->ConnectOutput (esdfilter, 0, coutput1 );
106
107 //
108 // Run the analysis
109 //
110 mgr->InitAnalysis();
111 mgr->PrintStatus();
112 mgr->StartAnalysis("proof",dataset,10000);
113
114}
ba35c6d3 115