Removing the separate misalignments at inner and outer SSD barrel + minor improvememn...
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskJets.C
CommitLineData
672f1183 1AliAnalysisTaskJets *AddTaskJets(Char_t *jr, Char_t *jf)\r
2{\r
3// Creates a jet fider task, configures it and adds it to the analysis manager.\r
4\r
5 // Get the pointer to the existing analysis manager via the static access method.\r
6 //==============================================================================\r
7 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
8 if (!mgr) {\r
9 ::Error("AddTaskJets", "No analysis manager to connect to.");\r
10 return NULL;\r
11 } \r
12 \r
13 // Check the analysis type using the event handlers connected to the analysis manager.\r
14 //==============================================================================\r
15 if (!mgr->GetInputEventHandler()) {\r
16 ::Error("AddTaskJets", "This task requires an input event handler");\r
17 return NULL;\r
18 }\r
19\r
20 // Create the task and configure it.\r
21 //===========================================================================\r
22 AliAnalysisTaskJets *jetana;\r
23 AliJetReader *er = 0;\r
24\r
25 switch (jr) {\r
26 case "MC":\r
27 AliJetKineReaderHeader *jrh = new AliJetKineReaderHeader();\r
28 jrh->SetComment("MC full Kinematics");\r
29 jrh->SetFastSimTPC(kFALSE);\r
30 jrh->SetFastSimEMCAL(kFALSE);\r
31 jrh->SetPtCut(0.);\r
32 jrh->SetFiducialEta(-2.1,2.1); // to take all MC particles default is 0.9\r
33 // Define reader and set its header\r
34 er = new AliJetKineReader();\r
35 er->SetReaderHeader(jrh);\r
36 break;\r
37\r
38 case "ESD":\r
39 AliJetESDReaderHeader *jrh = new AliJetESDReaderHeader();\r
40 jrh->SetComment("Testing");\r
41 jrh->SetFirstEvent(0);\r
42 jrh->SetLastEvent(1000);\r
43 jrh->SetPtCut(0.);\r
44 jrh->SetReadSignalOnly(kFALSE);\r
45 // Define reader and set its header\r
46 er = new AliJetESDReader();\r
47 er->SetReaderHeader(jrh);\r
48 break;\r
49\r
50 case "AOD":\r
51 AliJetAODReaderHeader *jrh = new AliJetAODReaderHeader();\r
52 jrh->SetComment("AOD Reader");\r
53 jrh->SetPtCut(0.);\r
54 jrh->SetTestFilterMask(1<<0);\r
55 // Define reader and set its header\r
56 er = new AliJetAODReader();\r
57 er->SetReaderHeader(jrh);\r
58 break;\r
59\r
60 default:\r
61 ::Error("AddTaskJets", "Wrong jet reader selected\n");\r
62 return 0;\r
63 }\r
64\r
65 // Define jet header and jet finder\r
66 AliJetFinder *jetFinder = 0;\r
67 switch (jf) {\r
68 case "CDF":\r
69 AliCdfJetHeader *jh = new AliCdfJetHeader();\r
70 jh->SetRadius(0.7);\r
71 \r
72 jetFinder = new AliCdfJetFinder();\r
73 jetFinder->SetOutputFile("jets.root");\r
74 break;\r
75\r
76 case "DA":\r
77 AliDAJetHeader *jh=new AliDAJetHeader();\r
78 jh->SetComment("DA jet code with default parameters");\r
79 jh->SelectJets(kTRUE);\r
80 jh->SetNclust(10);\r
81\r
82 jetFinder = new AliDAJetFinder();\r
83 break;\r
84\r
85 case "Fastjet":\r
86 AliFastJetHeader *jh = new AliFastJetHeader();\r
87 jh->SetRparam(0.7); // setup parameters\r
88\r
89 jetFinder = new AliFastJetFinder();\r
90 jetFinder->SetOutputFile("jets.root");\r
91 break;\r
92\r
93 case "UA1":\r
94 AliUA1JetHeaderV1 *jh=new AliUA1JetHeaderV1();\r
95 jh->SetComment("UA1 jet code with default parameters");\r
96 jh->BackgMode(2);\r
97 jh->SetRadius(1.0);\r
98 jh->SetEtSeed(4.);\r
99 jh->SetLegoNbinPhi(432);\r
100 jh->SetLegoNbinEta(274);\r
101 jh->SetLegoEtaMin(-2);\r
102 jh->SetLegoEtaMax(+2);\r
103 jh->SetJetEtaMax(0.5);\r
104 jh->SetJetEtaMin(-0.5);\r
105 jh->SetMinJetEt(10.);\r
106\r
107 jetFinder = new AliUA1JetFinderV1();\r
108 break;\r
109\r
110 case default:\r
111 ::Error("AddTaskJets", "Wrong jet finder selected\n");\r
112 return 0;\r
113 }\r
114 if (jetFinder){\r
115 if (jh) jetFinder->SetJetHeader(jh);\r
116 if (er) jetFinder->SetJetReader(er);\r
117 }\r
118\r
119 jetana = new AliAnalysisTaskJets(Form("JetAnalysis%s%s",jr,jf));\r
120 AliAnalysisDataContainer *cout_jet = mgr->CreateContainer(Form("jethist%s%s",jr,jf), TList::Class(),\r
121 AliAnalysisManager::kOutputContainer, Form("jethist%s_%s.root",jr,jf));\r
122 // Connect jet finder to task.\r
123 jetana->SetJetFinder(jetFinder);\r
124 jetana->SetConfigFile("");\r
125 jetana->SetDebugLevel(10);\r
126 mgr->AddTask(jetana);\r
127\r
128 // Create ONLY the output containers for the data produced by the task.\r
129 // Get and connect other common input/output containers via the manager as below\r
130 //==============================================================================\r
131 mgr->ConnectInput (jetana, 0, mgr->GetCommonInputContainer());\r
132// AOD output slot will be used in a different way in future\r
133 mgr->ConnectOutput (jetana, 0, mgr->GetCommonOutputContainer());\r
134 mgr->ConnectOutput (jetana, 1, cout_jet);\r
135 \r
136 return jetana;\r
137}\r