fix info in debug stream
[u/mrichter/AliRoot.git] / STEER / CreateAODfromESD.C
CommitLineData
e985a35a 1#if !defined(__CINT__) || defined(__MAKECINT__)
e95e4176 2#include <TChain.h>
3#include <TSystem.h>
4#include "AliAnalysisManager.h"
5#include "AliESDInputHandler.h"
6#include "AliAODHandler.h"
7#include "AliAnalysisTaskESDfilter.h"
8#include "AliAnalysisDataContainer.h"
e985a35a 9#endif
10
cf22b3fc 11void CreateAODfromESD(const char *inFileName = "AliESDs.root",
eebdd52e 12 const char *outFileName = "AliAODs.root") {
3dd9f9e3 13
17d9550f 14 gSystem->Load("libTree");
15 gSystem->Load("libGeom");
16 gSystem->Load("libPhysics");
17 gSystem->Load("libVMC");
18 gSystem->Load("libSTEERBase");
19 gSystem->Load("libESD");
20 gSystem->Load("libAOD");
e95e4176 21
17d9550f 22 gSystem->Load("libANALYSIS");
23 gSystem->Load("libANALYSISalice");
35d4b769 24 gSystem->Load("libPWG3muon");
e95e4176 25
35d4b769 26 TChain *chain = new TChain("esdTree");
e95e4176 27 // Steering input chain
28 chain->Add(inFileName);
29 AliAnalysisManager *mgr = new AliAnalysisManager("ESD to AOD", "Analysis Manager");
30
31 // Input
32 AliESDInputHandler* inpHandler = new AliESDInputHandler();
fdce1c9b 33 inpHandler->SetReadTags();
e95e4176 34 mgr->SetInputEventHandler (inpHandler);
35
36 // Output
37 AliAODHandler* aodHandler = new AliAODHandler();
38 aodHandler->SetOutputFileName(outFileName);
39 mgr->SetOutputEventHandler(aodHandler);
40
41 // Task
35d4b769 42 // Barrel Tracks
e95e4176 43 AliAnalysisTaskESDfilter *filter = new AliAnalysisTaskESDfilter("Filter");
44 mgr->AddTask(filter);
35d4b769 45 // Muons
46 AliAnalysisTaskESDMuonFilter *esdmuonfilter = new AliAnalysisTaskESDMuonFilter("ESD Muon Filter");
47 mgr->AddTask(esdmuonfilter);
e95e4176 48
fdce1c9b 49 // Cuts on primary tracks
215fb466 50 AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Standard");
51 esdTrackCutsL->SetMinNClustersTPC(50);
52 esdTrackCutsL->SetMaxChi2PerClusterTPC(3.5);
fdce1c9b 53 esdTrackCutsL->SetMaxCovDiagonalElements(2, 2, 0.5, 0.5, 2);
215fb466 54 esdTrackCutsL->SetRequireTPCRefit(kTRUE);
20da34af 55 esdTrackCutsL->SetMaxDCAToVertexXY(3.0);
75bcd466 56 esdTrackCutsL->SetMaxDCAToVertexZ(3.0);
57 esdTrackCutsL->SetDCAToVertex2D(kTRUE);
fdce1c9b 58 esdTrackCutsL->SetRequireSigmaToVertex(kFALSE);
215fb466 59 esdTrackCutsL->SetAcceptKingDaughters(kFALSE);
b6594780 60 // ITS stand-alone tracks
61 AliESDtrackCuts* esdTrackCutsITSsa = new AliESDtrackCuts("AliESDtrackCuts", "ITS stand-alone");
62 esdTrackCutsITSsa->SetRequireITSStandAlone(kTRUE);
215fb466 63
64 AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
65 trackFilter->AddCuts(esdTrackCutsL);
b6594780 66 trackFilter->AddCuts(esdTrackCutsITSsa);
215fb466 67
fdce1c9b 68 // Cuts on V0s
69 AliESDv0Cuts* esdV0Cuts = new AliESDv0Cuts("AliESDv0Cuts", "Standard pp");
70 esdV0Cuts->SetMinRadius(0.2);
71 esdV0Cuts->SetMaxRadius(100);
72 esdV0Cuts->SetMinDcaPosToVertex(0.05);
73 esdV0Cuts->SetMinDcaNegToVertex(0.05);
74 esdV0Cuts->SetMaxDcaV0Daughters(0.5);
75 esdV0Cuts->SetMinCosinePointingAngle(0.99);
76 AliAnalysisFilter* v0Filter = new AliAnalysisFilter("v0Filter");
77 v0Filter->AddCuts(esdV0Cuts);
78
79
80//
215fb466 81 filter->SetTrackFilter(trackFilter);
fdce1c9b 82 filter->SetV0Filter(v0Filter);
83
84
85// Create AOD Tags
86 AliAnalysisTaskTagCreator* tagTask = new AliAnalysisTaskTagCreator("AOD Tag Creator");
87 mgr->AddTask(tagTask);
215fb466 88
e95e4176 89 // Pipelining
f5fa84ac 90 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
91 AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer();
fdce1c9b 92 AliAnalysisDataContainer *coutputT
93 = mgr->CreateContainer("cTag", TTree::Class(), AliAnalysisManager::kOutputContainer, "AOD.tag.root");
94
e95e4176 95 mgr->ConnectInput (filter, 0, cinput1 );
96 mgr->ConnectOutput(filter, 0, coutput1);
97
35d4b769 98 mgr->ConnectInput (esdmuonfilter, 0, cinput1 );
f5fa84ac 99// mgr->ConnectOutput(esdmuonfilter, 0, coutput1);
35d4b769 100
fdce1c9b 101 mgr->ConnectInput (tagTask, 0, cinput1);
102 mgr->ConnectOutput(tagTask, 1, coutputT);
103
e95e4176 104 //
105 // Run the analysis
106 //
107 mgr->InitAnalysis();
108 mgr->PrintStatus();
109 mgr->StartAnalysis("local", chain);
df9db588 110}
b6594780 111