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