Adding the possibility not to follow particle mothers during StepManager (default...
[u/mrichter/AliRoot.git] / JETAN / JetAnalysisManagerCAF.C
1 void JetAnalysisManagerCAF()
2 {
3     //
4     if (gApplication) gApplication->InitializeGraphics();
5     //
6     // Connect to proof
7     
8 //    TProof::Reset("proof://morsch@lxb6046.cern.ch"); 
9     TProof::Open("proof://morsch@lxb6046.cern.ch");
10 //    gProof->SetParallel(1);
11 //    gProof->ClearPackage("STEERBase");
12 //    gProof->ClearPackage("ESD");
13 //    gProof->ClearPackage("AOD");
14 //    gProof->ClearPackage("JETAN");
15 //    gProof->ClearPackage("ANALYSIS");
16 //    gProof->ClearPackage("ANALYSISalice");
17     
18     gProof->ShowEnabledPackages();
19
20     // Enable the STEERBase Package
21     gProof->UploadPackage("STEERBase.par");
22     gProof->EnablePackage("STEERBase");
23     // Enable the ESD Package
24     gProof->UploadPackage("ESD.par");
25     gProof->EnablePackage("ESD");
26      // Enable the AOD Package
27     gProof->UploadPackage("AOD.par");
28     gProof->EnablePackage("AOD");
29      // Enable the Analysis Package
30     gProof->UploadPackage("ANALYSIS.par");
31     gProof->EnablePackage("ANALYSIS");
32
33     gProof->UploadPackage("ANALYSISalice.par");
34     gProof->EnablePackage("ANALYSISalice");
35
36     // Enable the JETAN Package
37     gProof->UploadPackage("JETAN.par");
38     gProof->EnablePackage("JETAN");
39
40     //
41     gProof->ShowEnabledPackages();
42     
43     //
44     //
45     // Create the chain
46     //
47     // TChain* chain = CreateESDChain("test.txt", 200);
48  // Input 
49     AliESDInputHandler* inpHandler = new AliESDInputHandler();
50     //
51     // Create the analysis manager
52     //
53     AliAODHandler* aodHandler   = new AliAODHandler();
54     aodHandler->SetOutputFileName("jets.root");
55     
56     AliAnalysisManager *mgr  = new AliAnalysisManager("Jet Manager", "Jet Manager");
57     mgr->SetOutputEventHandler(aodHandler);
58     mgr->SetInputEventHandler(inpHandler);
59     mgr-> SetDebugLevel(10);
60
61
62     //
63     //  ESD Filter Task
64     //
65     //
66     // Set of cuts
67     // 
68     // standard
69     AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Loose");
70     esdTrackCutsL->SetMinNClustersTPC(50);
71     esdTrackCutsL->SetMaxChi2PerClusterTPC(3.5);
72     esdTrackCutsL->SetRequireTPCRefit(kTRUE);
73     esdTrackCutsL->SetMaxDCAToVertexXY(2.4);
74     esdTrackCutsL->SetMaxDCAToVertexZ(3.2);
75     esdTrackCutsL->SetDCAToVertex2D(kTRUE);
76     esdTrackCutsL->SetRequireSigmaToVertex(kFALSE);
77     esdTrackCutsL->SetAcceptKinkDaughters(kFALSE);
78     //
79     //
80     AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
81     trackFilter->AddCuts(esdTrackCutsL);
82     //
83     AliAnalysisTaskESDfilter *esdfilter = new AliAnalysisTaskESDfilter("ESD Filter");
84     esdfilter->SetTrackFilter(trackFilter);
85     esdfilter->SetDebugLevel(10);
86     mgr->AddTask(esdfilter);
87
88 //
89 //   Jet Finder Task
90 //
91
92     AliAnalysisTaskJets *jetana = new AliAnalysisTaskJets("JetAnalysis");
93     jetana->SetDebugLevel(10);
94     jetana->SetConfigFile("ConfigJetAnalysisAOD.C");
95     mgr->AddTask(jetana);
96     //
97     // Create containers for input/output
98     AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
99
100     AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer();
101     coutput1->SetSpecialOutput();
102     
103     AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histos", TList::Class(),
104                                                               AliAnalysisManager::kOutputContainer, "histos.root");
105
106     mgr->ConnectInput  (esdfilter,  0, cinput1 );
107     mgr->ConnectOutput (esdfilter,  0, coutput1);
108
109     mgr->ConnectInput (jetana, 0, cinput1);
110     mgr->ConnectOutput(jetana, 0, coutput1);
111     mgr->ConnectOutput(jetana, 1, coutput2);
112
113
114     //
115     // Run the analysis
116     //    
117     mgr->InitAnalysis();
118     mgr->PrintStatus();
119     mgr->StartAnalysis("proof","/PWG4/arian/jetjetAbove_50_real");
120 }