Added script to draw calibrated raw data
[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->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
73     esdTrackCutsL->SetRequireTPCRefit(kTRUE);
74     esdTrackCutsL->SetMinNsigmaToVertex(3);
75     esdTrackCutsL->SetRequireSigmaToVertex(kTRUE);
76     esdTrackCutsL->SetAcceptKingDaughters(kFALSE);
77     //
78     //
79     AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
80     trackFilter->AddCuts(esdTrackCutsL);
81     //
82     AliAnalysisTaskESDfilter *esdfilter = new AliAnalysisTaskESDfilter("ESD Filter");
83     esdfilter->SetTrackFilter(trackFilter);
84     esdfilter->SetDebugLevel(10);
85     mgr->AddTask(esdfilter);
86
87 //
88 //   Jet Finder Task
89 //
90
91     AliAnalysisTaskJets *jetana = new AliAnalysisTaskJets("JetAnalysis");
92     jetana->SetDebugLevel(10);
93     jetana->SetConfigFile("ConfigJetAnalysisAOD.C");
94     mgr->AddTask(jetana);
95     //
96     // Create containers for input/output
97     AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
98
99     AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer();
100     coutput1->SetSpecialOutput();
101     
102     AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histos", TList::Class(),
103                                                               AliAnalysisManager::kOutputContainer, "histos.root");
104
105     mgr->ConnectInput  (esdfilter,  0, cinput1 );
106     mgr->ConnectOutput (esdfilter,  0, coutput1);
107
108     mgr->ConnectInput (jetana, 0, cinput1);
109     mgr->ConnectOutput(jetana, 0, coutput1);
110     mgr->ConnectOutput(jetana, 1, coutput2);
111
112
113     //
114     // Run the analysis
115     //    
116     mgr->InitAnalysis();
117     mgr->PrintStatus();
118     mgr->StartAnalysis("proof","/PWG4/arian/jetjetAbove_50_real");
119 }