]>
Commit | Line | Data |
---|---|---|
647ea9aa | 1 | void AddTasksFlavourJet(const Int_t iCandType = 1 /*0 = D0, 1=Dstar...*/, |
92d9c9cb | 2 | const TString sCutFile = "cutsHF/D0toKpiCutsppRecVtxNoPileupRejNoEMCAL.root", |
3 | const Double_t dJetPtCut = 1., | |
4 | const Double_t dJetAreaCut = 0., | |
5 | const char *acctype = "TPC", | |
6 | const TString sRunPeriod = "LHC10b", | |
7 | const Int_t uBeamType = 0, | |
8 | const UInt_t uTriggerMask = AliVEvent::kMB, /*for jets; the D mesons trigger is defined in the cut object*/ | |
9 | const Bool_t bIsMC = kFALSE, | |
10 | const Bool_t bIsReco = kFALSE, | |
11 | const Bool_t bIsMap = kFALSE, | |
12 | TString sText=""/*completes the name of the candidate task lists*/ | |
13 | ) | |
f6e094bd | 14 | { |
92d9c9cb | 15 | const TString sInputTrkMC = "MCParticlesSelected"; |
16 | const TString sInputTrkRec = "tracks"; | |
17 | const TString sUsedTrks = "PicoTracks"; | |
18 | const TString sUsedClus = ""; | |
19 | TString sInputTrk = bIsReco ? sInputTrkRec : sInputTrkMC; | |
20 | const Int_t iJetAlgo = 1; | |
21 | const Int_t iJetType = 1; | |
22 | /* | |
23 | const Int_t nRadius = 3; | |
24 | const Double_t aRadius[] = { 0.2, 0.4, 0.6 }; | |
25 | const TString sRadius[] = { "R02", "R04", "R06" }; | |
26 | */ | |
27 | const Int_t nRadius = 1; | |
28 | const Double_t aRadius[] = { 0.4 }; | |
29 | const TString sRadius[] = { "R04" }; | |
30 | ||
31 | //============================================================================= | |
32 | ||
33 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
34 | ||
35 | if (!mgr) { | |
36 | ::Error("AddTasksFlavourJet.C::AddTasksFlavourJet", "No analysis manager to connect to."); | |
37 | return; | |
38 | } | |
39 | ||
40 | TString type = mgr->GetInputEventHandler()->GetDataType(); | |
41 | if (!type.Contains("ESD") && !type.Contains("AOD")) { | |
42 | ::Error("AddTasksFlavourJet.C::AddTasksFlavourJet", "Task manager to have an ESD or AOD input handler."); | |
43 | return; | |
44 | } | |
45 | ||
46 | if (!mgr->GetInputEventHandler()) { | |
47 | ::Error("AddTasksFlavourJet.C::AddTasksFlavourJet", "This task requires an input event handler"); | |
48 | return; | |
49 | } | |
50 | //============================================================================= | |
51 | ||
52 | UInt_t uAnaType = (((iJetType==0) || (iJetType==2)) ? 1 : 0); | |
53 | Int_t iLeading = ((iJetType==0) ? 3 : ((iJetType==1) ? 0 : 1)); | |
54 | Int_t leadHadType=0; /* 0=charged, 1=neutral, 2=both*/ | |
55 | //D mesons -- PID | |
56 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); | |
57 | AliAnalysisTaskSE *taskRespPID = AddTaskPIDResponse(bIsMC); | |
58 | ||
59 | // -- D meson selection | |
60 | ||
d2f609e4 | 61 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/FlavourJetTasks/macros/AddTaskDFilterAndCorrelations.C"); |
62 | ||
bbb94467 | 63 | |
92d9c9cb | 64 | // EMCal framework |
65 | // -- Physics selection task | |
66 | gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalPhysicsSelection.C"); | |
67 | AliPhysicsSelectionTask *physSelTask = AddTaskEmcalPhysicsSelection(kTRUE, kTRUE, uTriggerMask, 5, 5, 10, kTRUE, -1, -1, -1, -1); | |
68 | ||
69 | if (!physSelTask) { | |
70 | cout << "no physSelTask"; | |
71 | return; | |
72 | } | |
73 | ||
74 | // -- | |
75 | gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalSetup.C"); | |
76 | AliEmcalSetupTask *taskSetupEMCal = AddTaskEmcalSetup(); | |
ad6abcae | 77 | //taskSetupEMCal->SetOcdbPath("raw://"); //needed for period LHC12h and i |
92d9c9cb | 78 | taskSetupEMCal->SetGeoPath("$ALICE_ROOT/OADB/EMCAL"); |
79 | taskSetupEMCal->SelectCollisionCandidates(uTriggerMask); | |
80 | ||
81 | // Jet preparation | |
82 | //gROOT->LoadMacro("/data/Work/jets/testEMCalJetFramework/code/v4/AddTaskJetPreparation.C"); | |
83 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskJetPreparation.C"); | |
0d41e2ce | 84 | AddTaskJetPreparation(sRunPeriod,"PicoTracks",bIsMC ? "MCParticlesSelected" : "",/*next 7 emcal default settings*/"","",2.,0.,0.03,0.015,0.15,uTriggerMask, kFALSE /*track cluster*/,kFALSE /*do histos*/,kTRUE /*make pico tracks*/,kFALSE /*make emcal trigger*/,kFALSE /*is emcal train*/); |
92d9c9cb | 85 | |
92d9c9cb | 86 | |
87 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskEmcalJet.C"); | |
88 | //gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskEmcalJetSample.C"); | |
89 | ||
92d9c9cb | 90 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskJetResponseMaker.C"); |
91 | ||
92 | for (Int_t i=0; i<nRadius; i++) { | |
93 | //jet reconstruction for correlation | |
94 | //AliEmcalJetTask *taskFJ = AddTaskEmcalJet(bIsMC&&!bIsReco ? sInputTrkMC.Data() : sUsedTrks.Data(),sUsedClus.Data(),iJetAlgo,aRadius[i],iJetType); | |
95 | //I think like follows it's fine: sUsedTrks contains the picotracks of MC or reco tracks according to IsReco | |
96 | AliEmcalJetTask *taskFJ = AddTaskEmcalJet(sUsedTrks.Data(),sUsedClus.Data(),iJetAlgo,aRadius[i],iJetType); | |
97 | ||
98 | taskFJ->SelectCollisionCandidates(uTriggerMask); | |
99 | ||
100 | ||
101 | // AliAnalysisTaskEmcalJetSample *taskjetsample=AddTaskEmcalJetSample(sUsedTrks.Data(),"",taskFJ->GetName(), | |
102 | // "Rho",aRadius[i],dJetPtCut,dJetAreaCut,AliAnalysisTaskEmcalJet::kTPC,iLeading, | |
103 | // "AliAnalysisTaskEmcalJetSample"); | |
104 | //taskjetsample->SelectCollisionCandidates(uTriggerMask); | |
105 | ||
bbb94467 | 106 | //Filter and correlation with D meson |
92d9c9cb | 107 | |
d2f609e4 | 108 | AddTaskDFilterAndCorrelations( |
bbb94467 | 109 | iCandType, |
92d9c9cb | 110 | sCutFile, |
111 | bIsMC, | |
112 | bIsReco, | |
bbb94467 | 113 | "", |
92d9c9cb | 114 | taskFJ->GetName(), |
bbb94467 | 115 | //Form("JetR%s",sRadius[i].Data()), |
92d9c9cb | 116 | iLeading, |
117 | leadHadType, | |
118 | aRadius[i], | |
119 | dJetPtCut, | |
120 | acctype | |
bbb94467 | 121 | //percjetareacut=1. |
122 | ); | |
92d9c9cb | 123 | |
124 | AliEmcalJetTask *taskMCJ; | |
125 | //jet reconstruction for correction map | |
126 | if(bIsMap){ | |
d2f609e4 | 127 | taskMCJ = AddTaskEmcalJet(sInputTrkMC.Data(),sUsedClus.Data(),iJetAlgo,aRadius[i], iJetType); |
128 | ||
129 | AddTaskDFilterAndCorrelations( | |
130 | iCandType, | |
131 | sCutFile, | |
132 | bIsMC, | |
133 | kFALSE, | |
134 | sText, | |
135 | taskFJ->GetName(), | |
136 | iLeading, | |
137 | leadHadType, | |
138 | aRadius[i], | |
139 | dJetPtCut, | |
140 | acctype | |
141 | //percjetareacut=1. | |
142 | ); | |
143 | ||
bc985fb9 | 144 | |
d2f609e4 | 145 | // definition of correction map |
146 | Int_t tag=0; | |
147 | if(iCandType == 0) tag=AliEmcalJet::kD0; | |
148 | if(iCandType == 1) tag=AliEmcalJet::kDStar; | |
149 | Printf("************** tag = %d", tag&0x1); | |
150 | AliJetResponseMaker* taskResp=AddTaskJetResponseMaker( | |
151 | sUsedTrks.Data(),sUsedClus.Data(),taskFJ->GetName(),"",aRadius[i], | |
152 | sInputTrkMC.Data(),"",taskMCJ->GetName(),"",aRadius[i],dJetPtCut,dJetAreaCut,5,0,AliJetResponseMaker::kGeometrical, 0.25,0.25,"TPC",-999,-999,-999,"AliJetResponseMaker", kFALSE, 0, -10,10, tag ); | |
153 | taskResp->SetMinJetMCPt(0); //added to bypass a return not needed (feature of PrepareJetTask) | |
154 | //taskResp->SetHistoType(1); | |
bc985fb9 | 155 | |
92d9c9cb | 156 | } |
92d9c9cb | 157 | } |
158 | ||
159 | return; | |
f6e094bd | 160 | } |