]>
Commit | Line | Data |
---|---|---|
609c7a0d | 1 | AliAnalysisTaskEmcalJetTriggerQA* AddTaskEmcalJetTriggerQA(TString kTracksName = "PicoTracks", |
2 | TString kClusName = "caloClusterCorr", | |
3 | Double_t R = 0.4, | |
4 | Double_t ptminTrack = 0.15, | |
5 | Double_t etminClus = 0.3, | |
6 | Int_t rhoType = 0, | |
609c7a0d | 7 | TString trigClass = "", |
8 | TString kEmcalCellsName = "", | |
9 | const char *CentEst = "V0A", | |
e50460de | 10 | Int_t pSel = AliVEvent::kINT7, |
0714a353 | 11 | Float_t nefCut = 10. |
609c7a0d | 12 | ) { |
13 | ||
14 | enum AlgoType {kKT, kANTIKT}; | |
15 | enum JetType {kFULLJETS, kCHARGEDJETS, kNEUTRALJETS}; | |
16 | ||
0531c107 | 17 | |
18 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
19 | if (!mgr) | |
20 | { | |
21 | Error("AddTaskEmcalJetTriggerQA","No analysis manager found."); | |
22 | return 0; | |
23 | } | |
24 | Bool_t ismc=kFALSE; | |
25 | ismc = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE; | |
26 | ||
27 | // Check the analysis type using the event handlers connected to the analysis manager. | |
28 | //============================================================================== | |
29 | if (!mgr->GetInputEventHandler()) | |
30 | { | |
31 | ::Error("AddTaskEmcalJetTriggerQA", "This task requires an input event handler"); | |
32 | return NULL; | |
33 | } | |
34 | ||
609c7a0d | 35 | // #### Add necessary jet finder tasks |
36 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskEmcalJet.C"); | |
37 | ||
38 | AliEmcalJetTask* jetFinderTask1; | |
39 | AliEmcalJetTask* jetFinderTask2; | |
40 | if(kClusName.IsNull()) { //particle level jets | |
41 | jetFinderTask1 = AddTaskEmcalJet(kTracksName, "", kANTIKT, R, kFULLJETS, ptminTrack, etminClus); | |
42 | jetFinderTask2 = AddTaskEmcalJet(kTracksName, "", kANTIKT, R, kCHARGEDJETS, ptminTrack, etminClus); | |
43 | } | |
44 | else if(kTracksName.IsNull()) { //neutral/calo jets | |
45 | jetFinderTask1 = AddTaskEmcalJet(kTracksName, kClusName, kANTIKT, R, kNEUTRALJETS, ptminTrack, etminClus); | |
46 | jetFinderTask2 = AddTaskEmcalJet(kTracksName, kClusName, kANTIKT, R, kFULLJETS, ptminTrack, etminClus); | |
47 | } | |
48 | else { //full jets | |
49 | jetFinderTask1 = AddTaskEmcalJet(kTracksName, kClusName, kANTIKT, R, kFULLJETS, ptminTrack, etminClus); | |
50 | jetFinderTask2 = AddTaskEmcalJet(kTracksName, kClusName, kANTIKT, R, kCHARGEDJETS, ptminTrack, etminClus); | |
51 | } | |
52 | ||
53 | TString strJets1 = jetFinderTask1->GetName(); | |
54 | TString strJets2 = jetFinderTask2->GetName(); | |
0531c107 | 55 | |
609c7a0d | 56 | // Add kt jet finder and rho task in case we want background subtraction |
57 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskRhoSparse.C"); | |
58 | AliEmcalJetTask *jetFinderKt; | |
59 | AliEmcalJetTask *jetFinderAKt; | |
60 | AliAnalysisTaskRhoSparse *rhoTask; | |
61 | if(rhoType==1) { | |
62 | jetFinderKt = AddTaskEmcalJet(kTracksName, kClusName, kKT, R, kCHARGEDJETS, ptminTrack, etminClus); | |
63 | jetFinderKt->SetMinJetPt(0.); | |
64 | jetFinderAKt = AddTaskEmcalJet(kTracksName, kClusName, kANTIKT, R, kCHARGEDJETS, ptminTrack, etminClus); | |
65 | TF1 *fScale = new TF1("fScale","1.42",0.,100.); | |
66 | rhoTask = AddTaskRhoSparse( | |
67 | jetFinderKt->GetName(), | |
68 | jetFinderAKt->GetName(), | |
69 | kTracksName, | |
70 | kClusName, | |
71 | Form("RhoSparseR%03d",(int)(100*R)), | |
72 | R, | |
9e5eee5d | 73 | "TPC", |
609c7a0d | 74 | 0.01, |
75 | 0.15, | |
76 | 0, | |
77 | fScale, | |
78 | 0, | |
79 | kTRUE, | |
80 | Form("RhoSparseR%03d",(int)(100*R)), | |
81 | kTRUE | |
82 | ); | |
83 | rhoTask->SetCentralityEstimator(CentEst); | |
0714a353 | 84 | rhoTask->SetUseAliAnaUtils(kTRUE); |
85 | rhoTask->SetMinPtTrackInEmcal(0.15); //only use events which have a track pointing to EMCAL | |
609c7a0d | 86 | } |
87 | ||
88 | TString wagonName = Form("TriggerQA_%s_%s_TC%s",strJets1.Data(),strJets2.Data(),trigClass.Data()); | |
0531c107 | 89 | |
609c7a0d | 90 | //Configure TriggerQA task |
0531c107 | 91 | AliAnalysisTaskEmcalJetTriggerQA *task = new AliAnalysisTaskEmcalJetTriggerQA(wagonName); |
9e5eee5d | 92 | AliParticleContainer *trackCont = task->AddParticleContainer(kTracksName.Data()); |
93 | AliClusterContainer *clusterCont = task->AddClusterContainer(kClusName.Data()); | |
94 | ||
95 | task->SetContainerFull(0); | |
96 | task->SetContainerCharged(1); | |
97 | AliJetContainer *jetCont0 = task->AddJetContainer(strJets1.Data(),"EMCAL",R); | |
98 | AliJetContainer *jetCont1 = NULL; | |
99 | if(strJets2.Contains("Charged")) jetCont1 = task->AddJetContainer(strJets2.Data(),"TPC",R); | |
100 | else { | |
101 | jetCont1 = task->AddJetContainer(strJets2.Data(),"EMCAL",R); | |
102 | task->SetZLeadingCut(0.98,0.98,1); | |
e50460de | 103 | task->SetNEFCut(0.,nefCut,1); |
609c7a0d | 104 | } |
105 | ||
9e5eee5d | 106 | task->SetZLeadingCut(0.98,0.98,0); |
e50460de | 107 | task->SetNEFCut(0.,nefCut,0); |
9e5eee5d | 108 | |
109 | for(Int_t i=0; i<2; i++) { | |
110 | task->SetPercAreaCut(0.6, i); | |
0531c107 | 111 | } |
9e5eee5d | 112 | |
113 | task->SetTriggerClass(trigClass.Data()); | |
114 | task->SetCaloCellsName(kEmcalCellsName.Data()); | |
584095b1 | 115 | task->SetCaloTriggerPatchInfoName("EmcalTriggers"); |
9e5eee5d | 116 | |
609c7a0d | 117 | task->SetCentralityEstimator(CentEst); |
0531c107 | 118 | |
609c7a0d | 119 | task->SelectCollisionCandidates(pSel); |
0531c107 | 120 | |
0714a353 | 121 | task->SetUseAliAnaUtils(kTRUE); |
122 | task->SetMinPtTrackInEmcal(0.15); //only use events which have a track pointing to EMCAL | |
123 | ||
0531c107 | 124 | mgr->AddTask(task); |
125 | ||
126 | //Connnect input | |
127 | mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer() ); | |
128 | ||
129 | //Connect output | |
130 | AliAnalysisDataContainer *coutput1 = 0x0; | |
131 | ||
132 | TString containerName1 = Form("%s",wagonName.Data()); | |
133 | ||
134 | TString outputfile = Form("%s:%s",AliAnalysisManager::GetCommonFileName(),wagonName.Data()); | |
135 | ||
136 | coutput1 = mgr->CreateContainer(containerName1, TList::Class(),AliAnalysisManager::kOutputContainer,outputfile); | |
137 | mgr->ConnectOutput(task,1,coutput1); | |
138 | ||
139 | return task; | |
140 | ||
141 | } |