]>
Commit | Line | Data |
---|---|---|
59a5935a | 1 | //---------------------------------------------------------------------// |
2 | // Macro to add the task for jet spectrum and jet shape stduies in pp. // | |
3 | //---------------------------------------------------------------------// | |
4 | ||
5 | AliAnalysisTaskJetProperties *AddTaskJetProperties(Char_t* bJet="clustersAOD", | |
6 | Char_t* jetFinder="ANTIKT", | |
7 | Float_t radius=0.4, | |
8 | UInt_t filterMask=256, | |
9 | Float_t ptTrackCut = 0.15){ | |
10 | ||
11 | //*********************************************************************************************// | |
12 | //bJet can take the following name (make sure the same branch is ON for JetCluster task) // | |
13 | // "clustersAOD" // | |
14 | // "clustersAODMC2" // | |
15 | // "clustersAODMC" // | |
16 | // "clustersMCKINE2" // | |
17 | // "clustersMCKINE" // | |
18 | // // | |
19 | // "jetsAOD" // | |
20 | // "jetsAODMC2" // | |
21 | // "jetsAODMC" // | |
22 | // "jetsMCKINE2" // | |
23 | // "jetsMCKINE" // | |
24 | //---------------------------------------------------------------------------------------------// | |
25 | // Example to add this task in AnalysisTrainPWG4Jets.C: // | |
26 | //---------------------------------------------------------------------------------------------// | |
27 | // AliAnalysisTaskJetProperties *taskJetProp = 0; // | |
28 | // taskJetProp = AddTaskJetPropertiesPP("clustersAOD","ANTIKT", 0.4, kHighPtFilterMask, 0.15); // | |
29 | //*********************************************************************************************// | |
30 | ||
31 | ||
32 | Int_t debug = -1; // debug level, -1: not set here | |
33 | // Get the pointer to the existing analysis manager via the static access method. | |
34 | //============================================================================== | |
35 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
36 | if (!mgr) { | |
37 | ::Error("AddTaskJetPropertiesPP", "No analysis manager to connect to."); | |
38 | return NULL; | |
39 | } | |
40 | // Check the analysis type using the event handlers connected to the analysis manager. | |
41 | //============================================================================== | |
42 | if (!mgr->GetInputEventHandler()) { | |
43 | ::Error("AddTaskJetPropertiesPP", "This task requires an input event handler"); | |
44 | return NULL; | |
45 | } | |
46 | ||
47 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
48 | Printf("########## AddTaskJetProerties: Data Type: %s", type.Data()); | |
49 | ||
50 | TString JetBranch(bJet); | |
51 | TString Method(jetFinder); | |
52 | Method.ToUpper(); | |
53 | // Create the task and configure it. | |
54 | //=========================================================================== | |
55 | AliAnalysisTaskJetProperties *task = new | |
56 | AliAnalysisTaskJetProperties(Form("JetProperties_%s_%s",JetBranch.Data(), Method.Data())); | |
57 | ||
58 | ||
59 | if(debug>=0) task->SetDebugLevel(debug); | |
60 | ||
61 | // attach the filter mask and options | |
62 | Float_t PtTrackMin = ptTrackCut; | |
63 | TString cAdd = ""; | |
64 | cAdd += Form("_%s",Method.Data()); | |
65 | cAdd += Form("%02d",(int)((radius+0.01)*10.)); | |
66 | cAdd += Form("_B0"); | |
67 | cAdd += Form("_Filter%05d",filterMask); | |
68 | cAdd += Form("_Cut%05d",(int)((1000.*PtTrackMin))); | |
69 | cAdd += Form("_Skip00"); | |
70 | if(JetBranch.Length())JetBranch += cAdd; | |
71 | Printf("########## AddTaskJetProperties: JetBranch '%s'", JetBranch.Data()); | |
72 | Printf("########## AddTaskJetProperties: JetFinder '%s'", Method.Data()); | |
73 | ||
74 | if(JetBranch.Length()) task->SetJetBranch(JetBranch); | |
75 | //seting the track type by looking jet branch | |
76 | //three type of tracks imlmented: kTrackAOD, kTrackKine, and kTrackAODMC | |
77 | //otherwise undifined track type kTrackUndef | |
78 | ||
79 | if(JetBranch.Contains("AODMC")) task->SetTrackType(AliAnalysisTaskJetProperties::kTrackAODMC); | |
80 | else if(JetBranch.Contains("MCKINE"))task->SetTrackType(AliAnalysisTaskJetProperties::kTrackKine); | |
81 | else if(JetBranch.Contains("AOD")) task->SetTrackType(AliAnalysisTaskJetProperties::kTrackAOD); | |
82 | else task->SetTrackType(AliAnalysisTaskJetProperties::kTrackUndef);//undefined track type | |
83 | ||
e84e0b8d | 84 | //setting pileup rejection |
85 | Bool_t IsPileupReject = kTRUE;//=kTRUE if you want to reject pileup, =kFALSE for no pileup rejection | |
86 | task->SetPileupRejection(IsPileupReject); | |
87 | ||
59a5935a | 88 | //setting the jet rejection |
89 | //two types implemented:kNoReject and kReject1Trk | |
90 | TString contName=""; | |
91 | Bool_t Is1TrackJetReject = kFALSE;//=kTRUE if you want to reject single track jet | |
92 | if(Is1TrackJetReject){//by default no rejection | |
93 | task->SetJetRejectType(AliAnalysisTaskJetProperties::kReject1Track); | |
94 | contName="_No1TrackJet"; | |
95 | } | |
0c7853b1 | 96 | task->SetJetRadius(radius); |
97 | task->SetEventCuts(10.0,2);//VtxZ=+-8cm, nContributors>2 | |
59a5935a | 98 | task->SetFilterMask(filterMask); |
99 | task->SetTrackCuts();// default : pt > 0.150 GeV, |eta|<0.9, full phi acc | |
100 | Float_t minJetPt = 10.0; | |
101 | Float_t minJetEta = -0.5; | |
d391281b | 102 | Float_t maxJetEta = 0.5; |
103 | Int_t tmpR = (Int_t)10*radius; | |
104 | if(tmpR==2){minJetEta=-0.7;maxJetEta=0.7;} | |
105 | if(tmpR==6){minJetEta=-0.3;maxJetEta=0.3;} | |
59a5935a | 106 | task->SetJetCuts(minJetPt,minJetEta,maxJetEta); |
107 | ||
108 | mgr->AddTask(task); | |
109 | ||
110 | // Create ONLY the output containers for the data produced by the task. | |
111 | // Get and connect other common input/output containers via the manager as below | |
112 | //============================================================================== | |
113 | ||
114 | AliAnalysisDataContainer *coutput_JetProperties = | |
115 | mgr->CreateContainer(Form("jetprop%s_%s", contName.Data(),JetBranch.Data()), | |
116 | TList::Class(), | |
117 | AliAnalysisManager::kOutputContainer, | |
118 | Form("%s:PWG4_JetProp%s_%s", | |
119 | AliAnalysisManager::GetCommonFileName(), contName.Data(),JetBranch.Data())); | |
120 | ||
121 | mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer()); | |
122 | mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer()); | |
123 | mgr->ConnectOutput (task, 1, coutput_JetProperties); | |
124 | ||
125 | return task; | |
126 | } |