]>
Commit | Line | Data |
---|---|---|
900e06e4 | 1 | #ifndef __CINT__ |
43d3541a | 2 | #include <PWGLF/RESONANCES/AliRsnCutSet.h> |
3 | #include <PWGLF/RESONANCES/AliRsnInputHandler.h> | |
4 | #include <PWGLF/RESONANCES/AliRsnCutKaonForPhi2010.h> | |
5 | #include <PWGLF/RESONANCES/AliRsnMiniAnalysisTask.h> | |
6 | #include <PWGLF/RESONANCES/AliRsnAnalysisTask.h> | |
7 | #include <PWGLF/RESONANCES/AliRsnValueDaughter.h> | |
8 | #include <RESONANCES/AliRsnCutPID.h> | |
9 | #include <RESONANCES/AliRsnCutKaonForPhi2010PP.h> | |
10 | #include <RESONANCES/AliRsnCutValue.h> | |
900e06e4 | 11 | #endif |
12 | Int_t AddRsnDaughterCutsPhi2010(AliPID::EParticleType type1,AliPID::EParticleType type2,TString opt,Bool_t isRsnMini=kFALSE,AliRsnInputHandler *rsnIH=0,AliAnalysisTaskSE *task=0) | |
13 | { | |
14 | ||
15 | if (!rsnIH) return 0; | |
16 | ||
43d3541a | 17 | Bool_t valid = kTRUE; |
18 | Int_t isPP = AliAnalysisManager::GetGlobalInt("rsnIsPP",valid); | |
19 | ||
20 | Bool_t usePPCut = kFALSE; | |
21 | ||
22 | if (isPP && (opt.Contains("usePP"))) usePPCut = kTRUE; | |
23 | ||
975568d5 | 24 | |
900e06e4 | 25 | // === USER HAS TO SET CORRECT NUMBER OF CUTS SETS ===== |
26 | Int_t numberOfCuts = 1; | |
27 | ||
28 | //--------------------------------------------- | |
29 | // Define single cuts | |
30 | //--------------------------------------------- | |
31 | ||
32 | Printf("AddRsnDaughterCutsPhi2010 Option : %s",opt.Data()); | |
33 | ||
43d3541a | 34 | Bool_t useTrackPtCut = kFALSE; |
35 | Double_t trackPtMin = 0.0; | |
36 | Double_t trackPtMax = 100000.0; | |
37 | Double_t nSigmaTPC=3.0; | |
38 | Double_t nSigmaTOF=3.0; | |
39 | Double_t ptTPCMax=0.6; | |
3da8cef7 | 40 | Double_t etaRange=0.5; |
43d3541a | 41 | // etaRange=0.1; |
42 | ||
43 | if (opt.Contains("trackPt")) { | |
44 | useTrackPtCut = kTRUE; | |
45 | if (opt.Contains("trackPtMax18")) trackPtMax = 1.8; | |
46 | if (opt.Contains("trackPtMax20")) trackPtMax = 2.0; | |
47 | if (opt.Contains("trackPtMax25")) trackPtMax = 2.5; | |
48 | } | |
49 | ||
50 | if (opt.Contains("TPCsigma1")) nSigmaTPC = 1.0; | |
51 | if (opt.Contains("TPCsigma2")) nSigmaTPC = 2.0; | |
52 | if (opt.Contains("TPCsigma3")) nSigmaTPC = 3.0; | |
3da8cef7 | 53 | if (opt.Contains("TPCsigma1.5")) nSigmaTPC = 1.5; |
54 | if (opt.Contains("TPCsigma2.5")) nSigmaTPC = 2.5; | |
43d3541a | 55 | |
56 | if (opt.Contains("TOFsigma1")) nSigmaTOF = 1.0; | |
57 | if (opt.Contains("TOFsigma2")) nSigmaTOF = 2.0; | |
58 | if (opt.Contains("TOFsigma3")) nSigmaTOF = 3.0; | |
59 | ||
60 | ||
61 | ||
62 | if (opt.Contains("tpcptMax")) { | |
63 | if (opt.Contains("tpcptMax04")) ptTPCMax=0.4; | |
64 | if (opt.Contains("tpcptMax05")) ptTPCMax=0.5; | |
65 | if (opt.Contains("tpcptMax06")) ptTPCMax=0.6; | |
66 | if (opt.Contains("tpcptMax07")) ptTPCMax=0.7; | |
67 | if (opt.Contains("tpcptMax08")) ptTPCMax=0.8; | |
68 | if (opt.Contains("tpcptMax09")) ptTPCMax=0.9; | |
69 | if (opt.Contains("tpcptMax10")) ptTPCMax=1.0; | |
70 | } | |
71 | ||
72 | AliRsnCutKaonForPhi2010PP *cutPP=0; | |
73 | AliRsnCutKaonForPhi2010 *cutPbPb=0; | |
74 | AliRsnCut *cut; | |
75 | if (usePPCut) { | |
76 | Printf("Using AliRsnCutKaonForPhi2010PP ..."); | |
77 | AliRsnCutKaonForPhi2010PP *cutPP = new AliRsnCutKaonForPhi2010PP("cutKaonPhi2010PP"); | |
78 | cutPP->SetTPCNSigmaLow(nSigmaTPC); | |
79 | cutPP->SetTPCNSigmaHigh(5.0); | |
80 | cutPP->SetTPCLimit(ptTPCMax); | |
81 | cutPP->SetTOFNSigma(nSigmaTOF); | |
82 | cut = cutPP; | |
83 | } | |
84 | else { | |
85 | Printf("Using AliRsnCutKaonForPhi2010 ..."); | |
86 | AliRsnCutKaonForPhi2010 *cutPbPb = new AliRsnCutKaonForPhi2010("cutKaonPhi2010",nSigmaTPC,nSigmaTOF,ptTPCMax); | |
87 | if (opt.Contains("qualityonly")) cutPbPb->SetMode(AliRsnCutKaonForPhi2010::kQuality); | |
88 | if (opt.Contains("tofonly")) cutPbPb->SetMode(AliRsnCutKaonForPhi2010::kOnlyTOF); | |
89 | if (opt.Contains("tpconly")) cutPbPb->SetMode(AliRsnCutKaonForPhi2010::kOnlyTPC); | |
90 | ||
91 | cut = cutPbPb; | |
92 | } | |
900e06e4 | 93 | |
43d3541a | 94 | Bool_t usePDG=kFALSE; |
95 | if (opt.Contains("pdg")) { | |
96 | Printf("Using PDG"); | |
97 | usePDG = kTRUE; | |
975568d5 | 98 | if (opt.Contains("pdgPI")) type1 = AliPID::kPion; |
99 | // type1 = AliPID::kPion; | |
100 | ||
900e06e4 | 101 | } |
102 | ||
43d3541a | 103 | |
104 | Bool_t useEta = kFALSE; | |
105 | if (opt.Contains("eta")) { | |
106 | Printf("Using ETA range (%.2f,%.2f)",-etaRange,etaRange); | |
107 | useEta = kTRUE; | |
900e06e4 | 108 | } |
109 | ||
110 | //--------------------------------------------- | |
111 | // Combine cuts | |
112 | //--------------------------------------------- | |
113 | TString cutname = "kaonPhi2010"; | |
114 | if (!opt.IsNull()) cutname += Form("_%s",opt.Data()); | |
115 | AliRsnCutSet *cuts = new AliRsnCutSet(cutname.Data(), AliRsnTarget::kDaughter); | |
116 | cuts->AddCut(cut); | |
43d3541a | 117 | |
118 | TString scheme=""; | |
119 | if (useTrackPtCut) { | |
120 | Printf("Adding Pt min=%.3f max=%.3f ...",trackPtMin,trackPtMax); | |
121 | AliRsnValueDaughter *valTrackPt = new AliRsnValueDaughter(Form("val%sTrackPt%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kPt); | |
122 | ||
123 | AliRsnCutValue *cutTrackPt = new AliRsnCutValue(Form("cut%sTrackPt%s",AliPID::ParticleName(type1),opt.Data()),trackPtMin,trackPtMax); | |
124 | cutTrackPt->SetTargetType(AliRsnTarget::kDaughter); | |
125 | cutTrackPt->SetValueObj(valTrackPt); | |
126 | cuts->AddCut(cutTrackPt); | |
127 | if (!scheme.IsNull()) scheme += "&"; | |
128 | scheme += cutTrackPt->GetName(); | |
129 | } | |
130 | ||
131 | ||
132 | if (useEta) { | |
133 | Printf("Adding ETA ..."); | |
134 | AliRsnValueDaughter *valEta = new AliRsnValueDaughter(Form("val%sETA%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kEta); | |
135 | AliRsnCutValue *cutEta = new AliRsnCutValue(Form("cut%sETA%s",AliPID::ParticleName(type1),opt.Data()),-etaRange,etaRange); | |
136 | cutEta->SetTargetType(AliRsnTarget::kDaughter); | |
137 | cutEta->SetValueObj(valEta); | |
138 | cuts->AddCut(cutEta); | |
139 | if (!scheme.IsNull()) scheme += "&"; | |
140 | scheme += cutEta->GetName(); | |
43d3541a | 141 | } |
142 | if (usePDG) { | |
143 | Printf("Adding PDG ..."); | |
144 | AliRsnCutPID *cutPDG = new AliRsnCutPID(Form("cut%sPDG%s",AliPID::ParticleName(type1),opt.Data()),type1,0.0,kTRUE); | |
145 | cuts->AddCut(cutPDG); | |
146 | if (!scheme.IsNull()) scheme += "&"; | |
147 | scheme += cutPDG->GetName(); | |
148 | } | |
149 | ||
150 | if (!scheme.IsNull()) scheme += "&"; | |
151 | scheme += cut->GetName(); | |
152 | ||
153 | Printf ("------ scheme '%s'",scheme.Data()); | |
154 | cuts->SetCutScheme(scheme.Data()); | |
900e06e4 | 155 | |
156 | if (opt.Contains("mon")) { | |
43d3541a | 157 | AddMonitorOutput(cuts->GetMonitorOutput(),opt); |
900e06e4 | 158 | } |
159 | if (isRsnMini) { | |
160 | AliRsnMiniAnalysisTask *taskRsnMini = dynamic_cast<AliRsnMiniAnalysisTask *>(task); | |
161 | if (taskRsnMini) { | |
162 | taskRsnMini->AddTrackCuts(cuts); | |
163 | } | |
164 | } else { | |
165 | AliRsnDaughterSelector *sel = rsnIH->GetSelector(); | |
975568d5 | 166 | // sel->SetLabelCheck(kFALSE); |
900e06e4 | 167 | sel->Add(cuts, kTRUE); |
168 | } | |
169 | return numberOfCuts; | |
170 | ||
171 | } | |
43d3541a | 172 |