Working on the electron cut
[u/mrichter/AliRoot.git] / prod / LHC09a1 / runAODFilterJets.C
CommitLineData
afea418a 1void runAODFilterJets()
2{
3
4 bool bKineFilter = true;
5 bool bJets = true;
6
7 gSystem->Load("libTree.so");
8 gSystem->Load("libPhysics.so");
9 gSystem->Load("libGeom.so");
10 gSystem->Load("libVMC.so");
11
12 gSystem->Load("libSTEERBase.so");
13 gSystem->Load("libESD.so");
14 gSystem->Load("libAOD.so");
15 gSystem->Load("libANALYSIS.so");
16 gSystem->Load("libANALYSISalice.so");
17 if(bJets)gSystem->Load("libJETAN.so");
18
19 // Create the chain
20 //
21 TChain *chain = new TChain("esdTree");
22 chain->Add("AliESDs.root");
23
24 ////////////////////////////////////////////////////////////////////////
25 // Create the analysis manager
26 //
27 // Input
28 AliESDInputHandler* inpHandler = new AliESDInputHandler();
29 // Output
30 AliAODHandler* aodHandler = new AliAODHandler();
31 aodHandler->SetOutputFileName("AliAOD.root");
32 // MC Truth
33 AliMCEventHandler* mcHandler = new AliMCEventHandler();
34 AliAnalysisManager *mgr = new AliAnalysisManager("Filter Manager", "Filter Manager");
35 if(bKineFilter){
36 mgr->SetMCtruthEventHandler(mcHandler);
37 }
38
39 mgr->SetInputEventHandler (inpHandler);
40 mgr->SetOutputEventHandler (aodHandler);
41
42 mgr->SetDebugLevel(10);
43
44 // Filtering of MC particles (decays conversions etc)
45 // this task is also needed to set the MCEventHandler
46 // to the AODHandler, this will not be needed when
47 // AODHandler goes to ANALYSISalice
48 AliAnalysisTaskMCParticleFilter *kinefilter = new AliAnalysisTaskMCParticleFilter("Particle Filter");
49 if(bKineFilter)mgr->AddTask(kinefilter);
50
51
52 //
53 // soft
54 AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Loose");
55 esdTrackCutsL->SetMinNClustersTPC(50);
56 esdTrackCutsL->SetMaxChi2PerClusterTPC(3.5);
57 esdTrackCutsL->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
58 esdTrackCutsL->SetRequireTPCRefit(kTRUE);
59 esdTrackCutsL->SetMaxDCAToVertexZ(3.0);
60 esdTrackCutsL->SetMaxDCAToVertexXY(3.0);
61 esdTrackCutsL->SetRequireSigmaToVertex(kFALSE);
62 esdTrackCutsL->SetAcceptKingDaughters(kFALSE);
63
64 //
65 // hard
66 AliESDtrackCuts* esdTrackCutsH = new AliESDtrackCuts("AliESDtrackCuts", "Har
67d");
68 esdTrackCutsH->SetMinNClustersTPC(100);
69 esdTrackCutsH->SetMaxChi2PerClusterTPC(2.0);
70 esdTrackCutsH->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
71 esdTrackCutsH->SetRequireTPCRefit(kTRUE);
72 esdTrackCutsL->SetMaxDCAToVertexZ(3.0);
73 esdTrackCutsL->SetMaxDCAToVertexXY(3.0);
74 esdTrackCutsH->SetRequireSigmaToVertex(kFALSE);
75 esdTrackCutsH->SetAcceptKingDaughters(kFALSE);
76 //
77
78 AliAnalysisTaskJets *jetana = 0;
79 AliAnalysisTaskJets *jetanaMC = 0;
80
81 if(bJets){
82 jetana = new AliAnalysisTaskJets("JetAnalysis");
83 jetana->SetConfigFile("../ConfigJetAnalysis.C");
84 jetana->SetDebugLevel(10);
85
86 jetanaMC = new AliAnalysisTaskJets("JetAnalysisMC");
87 jetanaMC->SetDebugLevel(10);
88 jetanaMC->SetConfigFile("../ConfigJetAnalysisMC.C");
89 jetanaMC->SetNonStdBranch("jetsMC");
90 mgr->AddTask(jetanaMC);
91 mgr->AddTask(jetana);
92 }
93
94 AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
95 trackFilter->AddCuts(esdTrackCutsL);
96 trackFilter->AddCuts(esdTrackCutsH);
97
98 AliAnalysisTaskESDfilter *esdfilter = new AliAnalysisTaskESDfilter("ESD Filter");
99 esdfilter->SetTrackFilter(trackFilter);
100
101 mgr->AddTask(esdfilter);
102
103
104 //
105 // Create containers for input/output
106 AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain",TChain::Class(),
107 AliAnalysisManager::kInputContainer);
108
109 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("tree", TTree::Class(),
110 AliAnalysisManager::kOutputContainer, "default");
111
112 coutput1->SetSpecialOutput();
113
114 if(bKineFilter){
115 mgr->ConnectInput (kinefilter, 0, cinput1 );
116 mgr->ConnectOutput (kinefilter, 0, coutput1 );
117 }
118
119 mgr->ConnectInput (esdfilter, 0, cinput1 );
120 mgr->ConnectOutput (esdfilter, 0, coutput1 );
121
122 if(bJets){
123 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histos", TList::Class(),
124 AliAnalysisManager::kOutputContainer, "histosJets.root");
125
126 AliAnalysisDataContainer *coutputMC2 = mgr->CreateContainer("histosMC", TList::Class(), AliAnalysisManager::kOutputContainer, "histosJetsMC.root");
127
128 mgr->ConnectInput (jetana, 0, cinput1 );
129 mgr->ConnectOutput (jetana, 0, coutput1 );
130 mgr->ConnectOutput (jetana, 1, coutput2 );
131 mgr->ConnectInput (jetanaMC, 0, cinput1 );
132 mgr->ConnectOutput (jetanaMC, 0, coutput1 );
133 mgr->ConnectOutput (jetanaMC, 1, coutputMC2 );
134 }
135
136 //
137 // Run the analysis
138 //
139 mgr->InitAnalysis();
140 mgr->PrintStatus();
141 mgr->StartAnalysis("local",chain);
142
143}