update
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / macrosJPSI / ConfigJpsi_jb_PbPb.C
CommitLineData
8c06b662 1void InitHistograms(AliDielectron *die, Int_t cutDefinition);
2d109362
JB
2void AddQAHistsPID(AliDielectron *die);
3void AddQAHistsEP(AliDielectron *die);
6720a01a 4void AddQAHistsEff(AliDielectron *die);
2d109362
JB
5void AddHistsEleEff(AliDielectron *die);
6
8c06b662 7void InitCF(AliDielectron* die, Int_t cutDefinition);
443a091c 8void InitHF(AliDielectron* die, Int_t cutDefinition);
8c06b662 9
2ed1b6ff 10void SetupEventCuts(AliDielectron *die, ULong64_t triggers, Int_t cutDefinition);
8c06b662 11void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition);
2ed1b6ff 12void SetupV0Cuts( AliDielectron *die, Int_t cutDefinition);
13void SetupPairCuts( AliDielectron *die, Int_t cutDefinition);
14
15void ConfigEvtPlane(AliDielectron *die, Int_t cutDefinition);
16void ConfigBgrd( AliDielectron *die, Int_t cutDefinition);
8c06b662 17
79284309 18void AddMCSignals(AliDielectron *die, Int_t cutDefinition);
6720a01a 19void SetEtaCorrection(AliDielectron *die);
79284309 20TVectorD *GetRunNumbers2011();
2d109362 21TVectorD *GetPDGcodes();
2ed1b6ff 22TVectorD *GetDeltaPhiBins();
8c06b662 23
6720a01a 24TString names=("Event;NoCut;PIDqa;LegEff;Std;SysMC;Flow;avgPt;Rec;TPC;TOF;TRD;TPC-TOF-TRD;NOPID;SysPt;SysEta;SysEle;SysPro;SysSPD;SysMCele");
25enum { kEvent, // event quantities (mult, ep, trigger, ...)
26 kNoCut, // pure event quantities (mult, ep, trigger, ...)
27 kPIDqa, // post calibration and validation of TPC PID
28 kLegEff, // single electron efficiency calculation
29 kStd, // standard Raa analysis
30 kSysMC,
31 kFlow, // flow calculation
32 kAvgPt, // mean pt and pt^2 analysis
33 kRec, // to calculate partial efficiencies, in particular the geom. acceptance
34 kTPC,
35 kTOF,
36 kTRD,
37 kTPCTOFTRD,
38 kNoPID,
39 kSysPt,
40 kSysEta,
41 kSysEle,
42 kSysPro,
43 kSysSPD,
44 kSysMCele,
45 kPIDQA
46 };
8c06b662 47
48TObjArray *arrNames=names.Tokenize(";");
49const Int_t nDie=arrNames->GetEntries();
50
256b2ae5 51Bool_t isESD = kTRUE;
2d7910f3 52TString list = gSystem->Getenv("LIST");
6938ad55 53
ab5dc7f9 54AliDielectron* ConfigJpsi_jb_PbPb(Int_t cutDefinition, Bool_t hasMC=kFALSE, ULong64_t triggers=AliVEvent::kCentral | AliVEvent::kSemiCentral | AliVEvent::kMB)
8c06b662 55{
56 //
57 // Setup the instance of AliDielectron
58 //
187de573 59
2ed1b6ff 60 // gsi train?
61 TString trainRoot = gSystem->Getenv("TRAIN_ROOT");
62 Bool_t isGSItrain = (trainRoot.IsNull()?kFALSE:kTRUE);
ab5dc7f9 63 if(isGSItrain) {
64 // find mc or not?
65 if( list.IsNull()) list=prod;
66 if( list.Contains("LHC10h") || list.Contains("LHC11h") ) hasMC=kFALSE;
2d109362 67 if( list.Contains("LHC11a10") || list.Contains("LHC12a17") || list.Contains("LHC13c7")) hasMC=kTRUE;
ab5dc7f9 68 }
8c06b662 69
70 //ESD handler?
256b2ae5 71 isESD=(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()->IsA()==AliESDInputHandler::Class());
187de573 72
2ed1b6ff 73 // task name
8c06b662 74 TString name=Form("%02d",cutDefinition);
2ed1b6ff 75 if (cutDefinition<arrNames->GetEntriesFast()) name=arrNames->At(cutDefinition)->GetName();
76 printf(" Adding %s%s config %s for %s \n",(isESD?"ESD":"AOD"),(hasMC?" MC":""),name.Data(),list.Data());
77
78 // init AliDielectron
ab5dc7f9 79 AliDielectron *die = new AliDielectron(Form("%s",name.Data()), Form("%s",name.Data()));
0094dcc0 80 die->SetHasMC(hasMC);
81
79284309 82 /* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv CUTS vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */
2ed1b6ff 83 SetupEventCuts(die,triggers,cutDefinition);
359a5e52 84 SetupTrackCuts(die,cutDefinition);
6720a01a 85 SetupV0Cuts(die,cutDefinition);
ab5dc7f9 86 SetupPairCuts(die,cutDefinition);
256b2ae5 87
79284309 88 /* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv MISC vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */
2ed1b6ff 89 // Monte Carlo Signals
6720a01a 90 AddMCSignals(die, cutDefinition);
2d109362 91 // PID post calibartion
6720a01a 92 // if(cutDefinition!=kEvent && cutDefinition!=kLegEff) SetEtaCorrection(die);
8c06b662 93 // bgrd estimators
6720a01a 94 //ConfigBgrd(die,cutDefinition);
2ed1b6ff 95 // tpc event plane configuration
6720a01a 96 //ConfigEvtPlane(die,cutDefinition);
97 // prefilter settings NEW
98 // if(cutDefinition==kNoCut ||cutDefinition==kEvent || cutDefinition==kNoPID || cutDefinition==kPIDqa || cutDefinition==kLegEff)
79284309 99 die->SetNoPairing();
6720a01a 100 // else
101 // die->SetPreFilterAllSigns();
79284309 102 //die->SetPreFilterUnlikeOnly();
103 // load single electron effieciency map ATTENTION
6720a01a 104 if(cutDefinition==kAvgPt) die->InitLegEffMap("alien:///alice/cern.ch/user/j/jbook/PWGDQ/dielectron/files/effMap.root");
105
187de573 106
79284309 107 /* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv OUTPUT vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */
108 // histogram setup
109 InitHistograms(die,cutDefinition);
110 // histogram grid setup
2d109362 111 InitHF(die,cutDefinition);
79284309 112 // CF container setup
2d109362 113 InitCF(die,cutDefinition);
187de573 114
79284309 115 // cut QA
116 die->SetCutQA();
187de573 117
8c06b662 118 return die;
119}
120
423cc7ef 121//______________________________________________________________________________________
2ed1b6ff 122void SetupEventCuts(AliDielectron *die, ULong64_t triggers, Int_t cutDefinition)
423cc7ef 123{
124 //
125 // Setup the event cuts
126 //
127
90c1ae2d 128 // trigger specific centrality cuts (reject trigger inefficiencies)
129 Double_t minCent=0.0, maxCent=100.;
ab5dc7f9 130 if(!die->GetHasMC()) {
90c1ae2d 131 switch(triggers) {
79284309 132 // case AliVEvent::kCentral: minCent= 0.; maxCent=10.; break; //0-9
133 // case AliVEvent::kSemiCentral: minCent=10.; maxCent=50.; break; //12-53
134 // case AliVEvent::kMB: minCent=10.; maxCent=90.; break;
135 default: minCent= 0.; maxCent=90.; break;
90c1ae2d 136 }
137 }
2ed1b6ff 138 // if(cutDefinition >= kEtaGap01) {minCent=20.; maxCent=50.;} // v2 analysis
2d109362
JB
139 if(cutDefinition == kSysMC) {minCent=0.; maxCent=50.;}
140 if(cutDefinition == kSysMCele) {minCent=0.; maxCent=50.;}
2ed1b6ff 141
142 // VZERO multiplicity vs. number ob global tracks cut
143 TF1 *fMean = new TF1("fMean", "pol1", 0,25e+3);
144 fMean->SetParameters(691.633, 1.4892);
145 TF1 *fSigma = new TF1("fSigma","[0]+sqrt([1]*x+[2])",0,25e+3);
146 fSigma->SetParameters(-83.6599, 36.7677, 69530.7);
90c1ae2d 147
2d109362 148 AliDielectronEventCuts *eventCuts=new AliDielectronEventCuts("vertex","vertex");
423cc7ef 149 if(!isESD) eventCuts->SetVertexType(AliDielectronEventCuts::kVtxAny);
150 eventCuts->SetRequireVertex();
151 eventCuts->SetMinVtxContributors(1);
6720a01a 152 if(cutDefinition!=kNoCut) eventCuts->SetVertexZ(-10.,+10.);
90c1ae2d 153 eventCuts->SetCentralityRange(minCent,maxCent);
1c96a71e 154 // eventCuts->SetCutOnV0MultipicityNTrks(fMean, fSigma, 4.0);
2d109362 155 // eventCuts->SetRunRejection(AliDielectronHelper::MakeArbitraryBinning("170592,170593,170594"));
423cc7ef 156 eventCuts->Print();
157 die->GetEventFilter().AddCuts(eventCuts);
158
159}
160
8c06b662 161//______________________________________________________________________________________
162void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition)
163{
164 //
165 // Setup the track cuts
166 //
79284309 167 Bool_t hasMC=die->GetHasMC();
9dcb603f 168
8c06b662 169 // Quality cuts
79284309 170 // die->GetTrackFilter().AddCuts(cuts);
187de573 171
ab5dc7f9 172 /* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv FILTER CUTS vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */
bffbeda1 173 // AOD track filter (needs to be first cut to speed up)
6720a01a 174 AliDielectronTrackCuts *trkFilter = new AliDielectronTrackCuts("filter","filter");
175 // config specific cuts
176 switch(cutDefinition) {
177 case kPIDqa: trkFilter->SetAODFilterBit(AliDielectronTrackCuts::kTPCqual); break;
178 default: trkFilter->SetAODFilterBit(AliDielectronTrackCuts::kTPCqualSPDany);
179 }
bffbeda1 180 // trkFilter->SetMinNCrossedRowsOverFindable(0.6);
4a1bef93 181
ab5dc7f9 182 /* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv TRACK CUTS vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */
79284309 183 AliDielectronVarCuts *varAccCuts = new AliDielectronVarCuts("acc","acc");
184 AliDielectronCutGroup *grpRecCuts = new AliDielectronCutGroup("rec","rec",AliDielectronCutGroup::kCompAND);
185 AliDielectronVarCuts *varRecCuts = new AliDielectronVarCuts("VarRecCuts","VarRecCuts");
186 AliDielectronTrackCuts *trkRecCuts = new AliDielectronTrackCuts("TrkRecCuts","TrkRecCuts");
187
ab5dc7f9 188 // config specific cuts
189 switch(cutDefinition) {
2d109362 190 case kPIDqa:
6720a01a 191 varAccCuts->AddCut(AliDielectronVarManager::kPt, 0.5, 1e30); // 0.85 ATTENTION
2d109362
JB
192 varRecCuts->AddCut(AliDielectronVarManager::kTPCclsSegments,7., 8.0);
193 break;
79284309 194 case kEvent:
6720a01a 195 case kNoCut:
2d109362 196 case kFlow:
79284309 197 case kRec:
6720a01a 198 case kStd:
79284309 199 case kTRD:
200 case kTPCTOFTRD:
201 case kAvgPt:
ab5dc7f9 202 case kNoPID:
2d109362 203 case kSysMCele:
6720a01a 204 varAccCuts->AddCut(AliDielectronVarManager::kPt, 0.85, 1e30);
205 varAccCuts->AddCut(AliDielectronVarManager::kEta, -0.8, 0.8);
79284309 206 case kLegEff:
207 varRecCuts->AddCut(AliDielectronVarManager::kTPCclsSegments,7., 8.0);
208 trkRecCuts->SetITSclusterCut(AliDielectronTrackCuts::kOneOf, 3); // SPD any
209 //if(hasMC) varAccCuts->AddCut(AliDielectronVarManager::kEta, -0.9, 0.9);
210 //else
6720a01a 211 ///
ab5dc7f9 212 break;
213 case kTOF:
ab5dc7f9 214 case kTPC:
79284309 215 varAccCuts->AddCut(AliDielectronVarManager::kPt, 0.95, 1e30); //0.8
216 varAccCuts->AddCut(AliDielectronVarManager::kEta, -0.9, 0.9);
217 varRecCuts->AddCut(AliDielectronVarManager::kNclsTPC, 70.0, 160.0);
218 trkRecCuts->SetITSclusterCut(AliDielectronTrackCuts::kOneOf, 7); // ITS-3 = 1+2+4
ab5dc7f9 219 break;
2d109362
JB
220 ///////////////////////////////////////////////////////////////////////////////////////////// systematics
221 case kSysPt:
222 varAccCuts->AddCut(AliDielectronVarManager::kPt, 1.1, 20./*1e30*/); ///ATTENTION
6720a01a 223 varAccCuts->AddCut(AliDielectronVarManager::kEta, -0.8, 0.8);
2d109362
JB
224 varRecCuts->AddCut(AliDielectronVarManager::kTPCclsSegments,7., 8.0);
225 trkRecCuts->SetITSclusterCut(AliDielectronTrackCuts::kOneOf, 3); // SPD any
226 break;
227 case kSysEta:
6720a01a 228 varAccCuts->AddCut(AliDielectronVarManager::kPt, 0.85, 20./*1e30*/);
2d109362
JB
229 varAccCuts->AddCut(AliDielectronVarManager::kEta, -0.9, 0.9); ////ATTENTION
230 varRecCuts->AddCut(AliDielectronVarManager::kTPCclsSegments,7., 8.0);
231 trkRecCuts->SetITSclusterCut(AliDielectronTrackCuts::kOneOf, 3); // SPD any
232 break;
233 case kSysEle:
234 case kSysPro:
6720a01a 235 varAccCuts->AddCut(AliDielectronVarManager::kPt, 0.85, 20./*1e30*/);
236 varAccCuts->AddCut(AliDielectronVarManager::kEta, -0.8, 0.8);
2d109362
JB
237 varRecCuts->AddCut(AliDielectronVarManager::kTPCclsSegments,7., 8.0);
238 trkRecCuts->SetITSclusterCut(AliDielectronTrackCuts::kOneOf, 3); // SPD any
239 break;
240 case kSysSPD:
6720a01a 241 varAccCuts->AddCut(AliDielectronVarManager::kPt, 0.85, 20./*1e30*/);
242 varAccCuts->AddCut(AliDielectronVarManager::kEta, -0.8, 0.8);
2d109362
JB
243 varRecCuts->AddCut(AliDielectronVarManager::kTPCclsSegments,7., 8.0);
244 trkRecCuts->SetITSclusterCut(AliDielectronTrackCuts::kOneOf, 1); // SPD any
245 break;
246 case kSysMC:
6720a01a 247 varAccCuts->AddCut(AliDielectronVarManager::kPt, 0.85, 1e30);
2d109362
JB
248 varAccCuts->AddCut(AliDielectronVarManager::kEta, -0.9, 0.9); ////ATTENTION
249 varRecCuts->AddCut(AliDielectronVarManager::kTPCclsSegments,7., 8.0);
250 trkRecCuts->SetITSclusterCut(AliDielectronTrackCuts::kOneOf, 3); // SPD any
251 break;
ab5dc7f9 252 }
79284309 253
254 // standrad reconstruction cuts
255 varRecCuts->AddCut(AliDielectronVarManager::kImpactParXY, -1.0, 1.0);
256 varRecCuts->AddCut(AliDielectronVarManager::kImpactParZ, -3.0, 3.0);
257 varRecCuts->AddCut(AliDielectronVarManager::kTPCchi2Cl, 0.0, 4.0);
258 varRecCuts->AddCut(AliDielectronVarManager::kKinkIndex0, 0.0);
259 // varRecCuts->AddCut(AliDielectronVarManager::kV0Index0, 0.0);
359a5e52 260 if(cutDefinition!=kPIDqa) trkRecCuts->SetRequireITSRefit(kTRUE);
79284309 261 trkRecCuts->SetRequireTPCRefit(kTRUE);
187de573 262
8c06b662 263 /* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv PID CUTS vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */
79284309 264 AliDielectronCutGroup *grpPIDCuts = new AliDielectronCutGroup("PID","PID",AliDielectronCutGroup::kCompAND);
265 AliDielectronVarCuts *pidSelCuts = new AliDielectronVarCuts("selPIDCuts","selPIDCuts");
266 pidSelCuts->AddCut(AliDielectronVarManager::kTRDpidQuality, 4.0, 6.0);
267 pidSelCuts->AddCut(AliDielectronVarManager::kTRDchi2, 0.0, 2.0);
ab5dc7f9 268 AliDielectronVarCuts *pidVarCuts = new AliDielectronVarCuts("varPIDCuts","varPIDCuts");
79284309 269 AliDielectronVarCuts *pidMCCuts = new AliDielectronVarCuts("mcPIDCuts","mcPIDCuts");
ab5dc7f9 270 AliDielectronPID *pidCuts = new AliDielectronPID("PIDCuts","PIDCuts");
79284309 271
ab5dc7f9 272 switch(cutDefinition) {
2d109362 273 case kPIDqa:
79284309 274 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-10.,10.);
6720a01a 275 pidCuts->AddCut(AliDielectronPID::kTRDeleEff,AliPID::kElectron,.95,1.,pidSelCuts,
276 kFALSE, AliDielectronPID::kIfAvailable);
79284309 277 break;
ab5dc7f9 278 case kTOF:
279 pidVarCuts->AddCut(AliDielectronVarManager::kTOFbeta, 0.2, 0.9, kTRUE);
280 pidCuts->AddCut(AliDielectronPID::kTOF,AliPID::kElectron,-3,3.,0.,0.,kFALSE,
281 AliDielectronPID::kIfAvailable);
282 case kTPC:
283 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-3.,4.);
284 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kPion,-100.,4.0,0.,0.,kTRUE);
285 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kProton,-100.,3.5,0.,0.,kTRUE);
286 break;
79284309 287 case kTRD:
288 pidCuts->AddCut(AliDielectronPID::kTRDeleEff,AliPID::kElectron,.95,1.,pidSelCuts,
289 kFALSE, AliDielectronPID::kIfAvailable);
290 case kEvent:
6720a01a 291 case kNoCut:
2d109362 292 case kFlow:
6720a01a 293 case kStd:
79284309 294 case kLegEff:
295 case kAvgPt:
ab5dc7f9 296 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-1.5.,3.);
297 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-0.9,3.0,-0.5,+0.5,kFALSE,
79284309 298 AliDielectronPID::kRequire,AliDielectronVarManager::kEta);
299 // pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-0.65,3.0,-0.3,+0.3,kFALSE,
300 // AliDielectronPID::kRequire,AliDielectronVarManager::kEta);
301 // pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-0.4,3.0,-0.1,+0.1,kFALSE,
302 // AliDielectronPID::kRequire,AliDielectronVarManager::kEta);
303 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kProton,-100.,4.0,0.,0.,kTRUE);
304 // tof heavy particle exclusion
305 // pidVarCuts->AddCut(AliDielectronVarManager::kTOFbeta, 0.3, 0.7, kTRUE);
306 //pidCuts->AddCut(AliDielectronPID::kTOF,AliPID::kElectron,-3,3.,0.,0.,kFALSE,
307 // AliDielectronPID::kIfAvailable);
308 break;
309 case kTPCTOFTRD:
310 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-1.3.,3.);
311 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-0.9,3.0,-0.5,+0.5,kFALSE,
312 AliDielectronPID::kRequire,AliDielectronVarManager::kEta);
ab5dc7f9 313 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-0.65,3.0,-0.3,+0.3,kFALSE,
79284309 314 AliDielectronPID::kRequire,AliDielectronVarManager::kEta);
ab5dc7f9 315 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-0.4,3.0,-0.1,+0.1,kFALSE,
79284309 316 AliDielectronPID::kRequire,AliDielectronVarManager::kEta);
ab5dc7f9 317 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kProton,-100.,4.0,0.,0.,kTRUE);
79284309 318 pidVarCuts->AddCut(AliDielectronVarManager::kTOFbeta, 0.2, 0.9, kTRUE);
319 pidCuts->AddCut(AliDielectronPID::kTOF,AliPID::kElectron,-3,3.,0.,0.,kFALSE,
320 AliDielectronPID::kIfAvailable);
321 pidCuts->AddCut(AliDielectronPID::kTRDeleEff,AliPID::kElectron,.95,1.,pidSelCuts,
322 kFALSE, AliDielectronPID::kIfAvailable);
ab5dc7f9 323 break;
2d109362
JB
324 ///////////////////////////////////////////////////////////////////////////////////////////// systematics
325 case kSysPt:
326 case kSysEta:
327 case kSysSPD:
328 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-1.5.,3.);
329 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-0.9,3.0,-0.5,+0.5,kFALSE,
330 AliDielectronPID::kRequire,AliDielectronVarManager::kEta);
331 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kProton,-100.,4.0,0.,0.,kTRUE);
332 break;
333 case kSysEle:
334 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,+0.7.,3.);
335 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kProton,-100.,4.0,0.,0.,kTRUE);
336 break;
337 case kSysPro:
338 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-1.5.,3.);
339 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-0.9,3.0,-0.5,+0.5,kFALSE,
340 AliDielectronPID::kRequire,AliDielectronVarManager::kEta);
341 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kProton,-100.,3.5,0.,0.,kTRUE);
342 break;
343 case kSysMC:
344 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-1.5.,3.);
345 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-0.9,3.0,-0.5,+0.5,kFALSE,
346 AliDielectronPID::kRequire,AliDielectronVarManager::kEta);
347 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kProton,-100.,3.5,0.,0.,kTRUE);
348 break;
349 case kSysMCele:
350 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-1.5.,3.);
351 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-0.9,3.0,-0.5,+0.5,kFALSE,
352 AliDielectronPID::kRequire,AliDielectronVarManager::kEta);
353 pidCuts->AddCut(AliDielectronPID::kTPC,AliPID::kProton,-100.,4.0,0.,0.,kTRUE);
354 break;
8c06b662 355 }
187de573 356
79284309 357 // mc identification
6720a01a 358 if(cutDefinition==kPIDqa && hasMC) {
79284309 359 pidMCCuts->SetCutType(AliDielectronVarCuts::kAny);//only apply any of the two cuts
360 pidMCCuts->AddCut(AliDielectronVarManager::kPdgCode,-11.5,-10.5 );
361 pidMCCuts->AddCut(AliDielectronVarManager::kPdgCode,10.5,11.5 );
362 }
363
359a5e52
JB
364 /* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv PID POST CORRECTION vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */
365 // if(cutDefinition!=kEvent) SetEtaCorrection(pidCuts,hasMC);
366
79284309 367
ab5dc7f9 368 /* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv TENDER CUTS vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */
8c06b662 369 // exclude conversion electrons selected by the tender
370 AliDielectronTrackCuts *noconv=new AliDielectronTrackCuts("noConv","noConv");
371 noconv->SetV0DaughterCut(AliPID::kElectron,kTRUE);
ab5dc7f9 372
373 // activate the cut sets (order might be CPU timewise important)
79284309 374 switch(cutDefinition) {
375 case kNoPID:
2d109362 376 case kPIDqa:
6720a01a 377 if(!isESD) die->GetTrackFilter().AddCuts(trkFilter);
378 die-> GetTrackFilter().AddCuts(varAccCuts);
2d109362
JB
379 grpRecCuts->AddCut(trkRecCuts);
380 grpRecCuts->AddCut(varRecCuts);
6720a01a 381 die-> GetTrackFilter().AddCuts(grpRecCuts);
382 if(hasMC) grpPIDCuts->AddCut(pidMCCuts);
383 else grpPIDCuts->AddCut(pidCuts);
384 die-> GetTrackFilter().AddCuts(grpPIDCuts);
2d109362 385 break;
79284309 386 case kRec:
387 die->GetTrackFilter().AddCuts(varAccCuts);
388 grpRecCuts->AddCut(trkRecCuts);
389 grpRecCuts->AddCut(varRecCuts);
390 die->GetTrackFilter().AddCuts(grpRecCuts);
391 break;
392 case kEvent:
6720a01a 393 case kNoCut:
2d109362 394 case kFlow:
6720a01a 395 case kStd:
79284309 396 case kLegEff:
397 case kTRD:
398 case kTPCTOFTRD:
399 case kAvgPt:
400 case kTOF:
401 case kTPC:
2d109362
JB
402 case kSysPt:
403 case kSysEta:
404 case kSysEle:
405 case kSysPro:
406 case kSysSPD:
407 case kSysMC:
408 case kSysMCele:
6720a01a 409 if(!isESD) die->GetTrackFilter().AddCuts(trkFilter);
410 die-> GetTrackFilter().AddCuts(varAccCuts);
79284309 411 grpRecCuts->AddCut(trkRecCuts);
412 grpRecCuts->AddCut(varRecCuts);
6720a01a 413 die-> GetTrackFilter().AddCuts(grpRecCuts);
79284309 414 grpPIDCuts->AddCut(pidCuts);
6720a01a 415 // grpPIDCuts->AddCut(pidVarCuts);
416 die-> GetTrackFilter().AddCuts(grpPIDCuts);
79284309 417 //cuts->AddCut(noconv);
6720a01a 418 // debug
419 trkFilter->Print();
420 varAccCuts->Print();
421 grpRecCuts->Print();
422 grpPIDCuts->Print();
79284309 423 }
187de573 424
8c06b662 425}
426
2ed1b6ff 427//______________________________________________________________________________________
428void SetupV0Cuts(AliDielectron *die, Int_t cutDefinition)
429{
430 //
431 // Setup the V0 cuts
432 //
433
2d109362
JB
434 switch(cutDefinition) {
435 case kEvent: return;
6720a01a 436 case kNoCut: return;
437 // case kLegEff: return;
2d109362
JB
438 }
439
440 Bool_t bRej = kTRUE;
441 Int_t defPID = 16;
442 if(cutDefinition==kPIDqa) {
443 bRej = kFALSE;
6720a01a 444 defPID = 13;//13
2d109362 445 }
2ed1b6ff 446
79284309 447 AliDielectronV0Cuts *gammaV0Cuts = new AliDielectronV0Cuts("V0","V0");
2d109362 448 gammaV0Cuts->SetV0finder(AliDielectronV0Cuts::kOnTheFly);
f6a71c64 449 gammaV0Cuts->SetPdgCodes(22,11,11);
2d109362
JB
450 gammaV0Cuts->SetDefaultPID(defPID);
451 gammaV0Cuts->AddCut(AliDielectronVarManager::kCosPointingAngle, TMath::Cos(0.05), 1.0, kFALSE); //0.02 -- 0.05
f6a71c64 452 gammaV0Cuts->AddCut(AliDielectronVarManager::kArmPt, 0.0, 0.05, kFALSE);
2d109362
JB
453 gammaV0Cuts->AddCut(AliDielectronVarManager::kArmAlpha, -0.35, 0.35, kFALSE);
454 gammaV0Cuts->AddCut(AliDielectronVarManager::kM, 0.0, 0.1, kFALSE); //0.05 -- 0.1
455 gammaV0Cuts->AddCut(AliDielectronVarManager::kChi2NDF, 0.0, 10.0, kFALSE);
456 gammaV0Cuts->AddCut(AliDielectronVarManager::kLegDist, 0.0, 0.25, kFALSE);
457 gammaV0Cuts->AddCut(AliDielectronVarManager::kR, 3.0, 90.0, kFALSE);
458 gammaV0Cuts->AddCut(AliDielectronVarManager::kPsiPair, 0.0, 0.2, kFALSE); //0.05 -- 0.2
359a5e52
JB
459 if(cutDefinition==kPIDqa && 0) {
460 gammaV0Cuts->AddCut(AliDielectronVarManager::kImpactParXY, 0.0, 1.0, kFALSE);
461 gammaV0Cuts->AddCut(AliDielectronVarManager::kImpactParZ, 0.0, 1.0, kFALSE);
462 }
2d109362
JB
463 // gammaV0Cuts->AddCut(AliDielectronVarManager::kOpeningAngle, 0.0, 0.1, kFALSE);
464 gammaV0Cuts->SetExcludeTracks(bRej);
2ed1b6ff 465 gammaV0Cuts->Print();
466
ab5dc7f9 467 // const Double_t |cutAlphaG| < 0.35; && const Double_t cutQTG < 0.05;
468 // const Double_t |cutAlphaG2|[2] = {0.6, 0.8}; && const Double_t cutQTG2 < 0.04;
2ed1b6ff 469
79284309 470 // if(cuts)
471 // ((AliDielectronCutGroup*)cuts)->AddCut(gammaV0Cuts);
472 // else
473 die->GetTrackFilter().AddCuts(gammaV0Cuts);
2ed1b6ff 474}
475
8c06b662 476//______________________________________________________________________________________
477void SetupPairCuts(AliDielectron *die, Int_t cutDefinition)
478{
479 //
480 // Setup the pair cuts
481 //
79284309 482 Bool_t hasMC=die->GetHasMC();
187de573 483
79284309 484 // rap and mass rejection
2d109362 485 Double_t gCut=0.05, yCut=0.9, eCut=0.01;
8c06b662 486 switch(cutDefinition) {
6720a01a 487 case kNoCut:
79284309 488 case kEvent: yCut=0.0; break;
2d109362
JB
489 case kPIDqa: return;
490 case kFlow: yCut=0.8; break;
79284309 491 case kRec: yCut=0.9; break;
492 case kNoPID: return;
79284309 493 case kTPC: yCut=0.9; break;
494 case kTOF: yCut=0.9; break;
495 case kTRD: yCut=0.8; break;
6720a01a 496 case kStd: yCut=0.8; break;
79284309 497 case kLegEff: return;
498 case kTPCTOFTRD: yCut=0.8; break;
499 case kAvgPt: yCut=0.8; break;
2d109362
JB
500 case kSysMC: yCut=0.9; break;
501 case kSysMCele: yCut=0.8; break;
502 case kSysEta: yCut=0.9; break;
503 case kSysPt:
504 case kSysEle:
505 case kSysPro:
506 case kSysSPD:
507 yCut=0.8; break;
79284309 508 // default: gCut=0.05; // default
8c06b662 509 }
187de573 510
79284309 511 // MC
512 //if(hasMC) yCut=0.9;
513
514 // rapidity selection
515 AliDielectronVarCuts *rapCut=new AliDielectronVarCuts(Form("|Y|<%.1f",yCut),Form("|Y|<%.1f",yCut));
516 rapCut->AddCut(AliDielectronVarManager::kY,-1.*yCut,yCut);
517 die->GetPairFilter().AddCuts(rapCut);
518
519 // gamma rejection
d28542ba 520 AliDielectronVarCuts *gammaCuts = new AliDielectronVarCuts("GammaCuts","GammaCuts");
d28542ba 521 gammaCuts->AddCut(AliDielectronVarManager::kM, 0.0, gCut);
522 die->GetPairPreFilter().AddCuts(gammaCuts);
187de573 523
2d109362 524 // pair efficiency cut
359a5e52
JB
525 // if(cutDefinition==kAvgPt && !hasMC) {
526 // AliDielectronVarCuts *effCut=new AliDielectronVarCuts(Form("(Axe)>%.2f",eCut),Form("(Axe)>%.2f",eCut));
527 // effCut->AddCut(AliDielectronVarManager::kPairEff,0.0,eCut,kTRUE);
528 // die->GetPairFilter().AddCuts(effCut);
529 // }
2d109362
JB
530
531 // random signal rejection
532 AliDielectronCutGroup *grpRNDMCuts = new AliDielectronCutGroup("RNDM","RNDM",AliDielectronCutGroup::kCompOR);
533 AliDielectronVarCuts *exclCutCEN=new AliDielectronVarCuts("exclCEN","exclCEN");
534 exclCutCEN->SetCutType(AliDielectronVarCuts::kAll); // all criteria need to be fullfilled
535 exclCutCEN->AddCut(AliDielectronVarManager::kRndmPair,0.0,1./40);
536 exclCutCEN->AddCut(AliDielectronVarManager::kPdgCode,443);
537 exclCutCEN->AddCut(AliDielectronVarManager::kCentrality,0.,10.);
538 AliDielectronVarCuts *exclCutSEMI=new AliDielectronVarCuts("exclSEMI","exclSEMI");
539 exclCutSEMI->SetCutType(AliDielectronVarCuts::kAll); // all criteria need to be fullfilled
540 exclCutSEMI->AddCut(AliDielectronVarManager::kRndmPair,0.0,1./20);
541 exclCutSEMI->AddCut(AliDielectronVarManager::kPdgCode,443);
542 exclCutSEMI->AddCut(AliDielectronVarManager::kCentrality,10.,90.);
543 AliDielectronVarCuts *inclCut=new AliDielectronVarCuts("incl","incl");
544 inclCut->AddCut(AliDielectronVarManager::kPdgCode,443,443,kTRUE);
545 grpRNDMCuts->AddCut(exclCutCEN);
546 grpRNDMCuts->AddCut(exclCutSEMI);
547 grpRNDMCuts->AddCut(inclCut);
6720a01a 548 if(hasMC && cutDefinition==kStd && 0) die->GetPairFilter().AddCuts(grpRNDMCuts); //ATTENTION
2d109362 549
8c06b662 550}
551
2ed1b6ff 552//______________________________________________________________________________________
553void ConfigBgrd(AliDielectron *die, Int_t cutDefinition)
554{
555 //
556 // Configurate the background estimators
557 //
558
6720a01a 559 // default no processing of LS
560 // die->SetProcessLS(kFALSE);
561
562 // skip config
79284309 563 switch(cutDefinition) {
564 case kEvent:
6720a01a 565 case kNoCut:
79284309 566 case kNoPID:
2d109362 567 case kPIDqa:
79284309 568 case kRec:
2d109362 569 case kLegEff:
79284309 570 return;
571 }
572
6720a01a 573 Bool_t hasMC=die->GetHasMC();
574 if(hasMC && cutDefinition!=kAvgPt) return;
575
2ed1b6ff 576 // add track rotations
577 AliDielectronTrackRotator *rot=new AliDielectronTrackRotator;
578 rot->SetIterations(10);
579 rot->SetConeAnglePhi(TMath::Pi());
580 rot->SetStartAnglePhi(TMath::Pi());
581 // die->SetTrackRotator(rot);
582
583 // add mixed events
584 AliDielectronMixingHandler *mix=new AliDielectronMixingHandler;
79284309 585 switch(cutDefinition) {
6720a01a 586 // case kStd:
79284309 587 // mix->AddVariable(AliDielectronVarManager::kZvPrim, 20, -10., 10.);
588 // mix->AddVariable(AliDielectronVarManager::kCentrality, 36, 0., 90.);
589 // mix->AddVariable(AliDielectronVarManager::kv0ACrpH2, 10, 0., TMath::Pi());
590 // break;
591 default:
592 mix->AddVariable(AliDielectronVarManager::kZvPrim, "-10.,-5.,-4.,-3.,-2.,-1.,0.,1.,2.,3.,4.,5.,10.");
593 mix->AddVariable(AliDielectronVarManager::kCentrality, 9, 0.,90.);
594 mix->AddVariable(AliDielectronVarManager::kTPCrpH2, 10, TMath::Pi()/-2, TMath::Pi()/2); // max res: 10%->10bins // 8bins
595 // mix->AddVariable(AliDielectronVarManager::kTPCmagH2, "0.,20.,50.,80.,110.,150.,500.");
596 break;
597 }
598 mix->SetSkipFirstEvent(kTRUE); // needed for flow analysis
2ed1b6ff 599 mix->SetMixType(AliDielectronMixingHandler::kAll);
600 mix->SetDepth(150);
601 die->SetMixingHandler(mix);
602
603}
604
605//______________________________________________________________________________________
606void ConfigEvtPlane(AliDielectron *die, Int_t cutDefinition)
607{
608 //
609 // Configurate the TPC event plane
610 //
611
79284309 612 switch(cutDefinition) {
2d109362 613 // case kEvent:
79284309 614 case kNoPID:
2d109362
JB
615 case kPIDqa:
616 // case kRec: // TOTHINK: might be needed when checking efficiencies versus dPhi
617 case kLegEff:
79284309 618 return;
619 }
620
6720a01a 621 Bool_t hasMC=die->GetHasMC();
622 if(hasMC && cutDefinition!=kAvgPt) return;
623
ab5dc7f9 624 // Double_t gGap;
625 // switch(cutDefinition) {
626 // case kEtaGap01: gGap=0.1; break;
627 // case kEtaGap02: gGap=0.2; break;
628 // case kEtaGap03: gGap=0.3; break;
629 // case kEtaGap04: gGap=0.4; break;
630 // case kEtaGap05: gGap=0.5; break;
631 // default: gGap=0.0;
632 // }
633 // eta gap in tpc event plane
634 // AliDielectronVarCuts *etaGap = new AliDielectronVarCuts(AliDielectronVarManager::GetValueName(AliDielectronVarManager::kEta),"etaGap");
635 // etaGap->AddCut(AliDielectronVarManager::kEta,-1*gGap,gGap,kTRUE);
636 // die->GetEventPlanePreFilter().AddCuts(etaGap);
2ed1b6ff 637
638 AliDielectronVarCuts *poi = new AliDielectronVarCuts("PoI","PoI");
639 poi->AddCut(AliDielectronVarManager::kM,2.92,3.20); // particles of interest, jpsi mass window
640 die->GetEventPlanePOIPreFilter().AddCuts(poi);
641
ab5dc7f9 642 // die->SetLikeSignSubEvents();
2ed1b6ff 643 die->SetPreFilterEventPlane();
644}
645
8c06b662 646//______________________________________________________________________________________
647void InitHistograms(AliDielectron *die, Int_t cutDefinition)
648{
649 //
650 // Initialise the histograms
651 //
ab5dc7f9 652 Bool_t hasMC=die->GetHasMC();
187de573 653
ef0426e6 654 // booleans for histo selection
2d109362 655 Bool_t bHistTrackQA=kFALSE, bHistEvts=kFALSE, bHistPair=kFALSE, bHistTrk=kFALSE, bHistPairME=kFALSE, bHistFlow=kFALSE, bHistFlowQA=kFALSE, bHistPID=kFALSE;
ef0426e6 656 switch (cutDefinition) {
6720a01a 657 case kNoCut:
79284309 658 case kEvent: bHistEvts=kTRUE; break;
2d109362
JB
659 case kPIDqa: bHistTrk=kTRUE; break;
660 case kNoPID: bHistTrk=kTRUE; break;
661 case kRec: /* */ break;
79284309 662 case kTPC:
663 case kTOF: //bHistEvts=kTRUE; //bHistFlow=kTRUE;
664 case kTRD: ///bHistEvts=kTRUE; //bHistFlow=kTRUE;
2d109362 665 case kAvgPt:
6720a01a 666 case kSysMC:
667 case kStd: ///*bHistEvts=kTRUE;*/ bHistPair=kTRUE; break; //bHistPairME=kTRUE;
2d109362
JB
668 case kTPCTOFTRD: bHistPair=kTRUE; bHistTrk=kTRUE; bHistPID=kTRUE; break; //bHistPairME=kTRUE;
669 case kSysMCele: bHistPair=kTRUE; bHistPID=kFALSE; break; //bHistPairME=kTRUE;
6720a01a 670 case kLegEff: bHistTrk=kTRUE; break;
79284309 671 }
672 if(hasMC) {
673 bHistPID=kFALSE;
ef0426e6 674 }
ef0426e6 675
8c06b662 676 //Setup histogram Manager
677 AliDielectronHistos *histos=new AliDielectronHistos(die->GetName(),die->GetTitle());
2d109362
JB
678 die->SetHistogramManager(histos);
679
680 //Initialise histogram classes
681 histos->SetReservedWords("Track;Pair");
187de573 682
8c06b662 683 //add histograms to event class
684 histos->AddClass("Event");
79284309 685 Int_t maxMixBins = (die->GetMixingHandler() ? die->GetMixingHandler()->GetNumberOfBins() : 0);
2ed1b6ff 686 histos->UserHistogram("Event","","", 100, 0.0, 100.0, AliDielectronVarManager::kCentrality);
6720a01a 687 if(die->GetMixingHandler() && maxMixBins)
79284309 688 histos->UserHistogram("Event","","", maxMixBins, 0, maxMixBins, AliDielectronVarManager::kMixingBin);
2d109362
JB
689 // candidates monitoring
690 histos->UserProfile("Event","","", AliDielectronVarManager::kTracks, GetRunNumbers2011(), AliDielectronVarManager::kRunNumber);
691 histos->UserProfile("Event","","", AliDielectronVarManager::kPairs, GetRunNumbers2011(), AliDielectronVarManager::kRunNumber);
692
693
694 //event plane histograms
695 if(cutDefinition==kFlow) {
696 if(!hasMC) AddQAHistsEP(die);
697 histos->UserHistogram("Pair","","", 100,-1*TMath::Pi(),+1*TMath::Pi(), AliDielectronVarManager::kDeltaPhiv0ArpH2);
698 histos->UserHistogram("Pair","","", 100,-1*TMath::Pi(),+1*TMath::Pi(), AliDielectronVarManager::kDeltaPhiv0CrpH2);
699 histos->UserHistogram("Pair","","", 100,-1*TMath::Pi(),+1*TMath::Pi(), AliDielectronVarManager::kDeltaPhiTPCrpH2);
700 }
ef0426e6 701
702 ////// EVENT HISTOS /////
703 if(bHistEvts) {
79284309 704 histos->UserHistogram("Event","","", GetRunNumbers2011(), AliDielectronVarManager::kRunNumber);
2ed1b6ff 705 histos->UserHistogram("Event","","", 300,-15.,15., AliDielectronVarManager::kZvPrim);
2d109362
JB
706 // histos->UserHistogram("Event","","", 300,0.,15000., AliDielectronVarManager::kRefMult);
707 histos->UserHistogram("Event","","", 300,0.,3000., AliDielectronVarManager::kRefMultTPConly);
708
709 // histos->UserHistogram("Event","","", 100,0.,100., AliDielectronVarManager::kRefMultTPConly);
79284309 710 histos->UserHistogram("Event","","", GetRunNumbers2011(), AliDielectronHelper::MakeLinBinning(3000, 0., 3000.),
2d109362 711 AliDielectronVarManager::kRunNumber, AliDielectronVarManager::kRefMultTPConly);
79284309 712 histos->UserHistogram("Event","","", AliDielectronHelper::MakeLinBinning(90, 0., 90.), AliDielectronHelper::MakeLinBinning(3000, 0., 3000.),
2d109362
JB
713 AliDielectronVarManager::kCentrality, AliDielectronVarManager::kRefMultTPConly);
714 histos->UserProfile( "Event","","", AliDielectronVarManager::kRefMultTPConly, 90, 0., 90., AliDielectronVarManager::kCentrality);
359a5e52
JB
715 histos->UserProfile( "Event","","", AliDielectronVarManager::kMultV0A, 90, 0., 90., AliDielectronVarManager::kCentrality);
716 histos->UserProfile( "Event","","", AliDielectronVarManager::kMultV0C, 90, 0., 90., AliDielectronVarManager::kCentrality);
717 // histos->UserProfile( "Event","","", AliDielectronVarManager::kEqMultV0A, 90, 0., 90., AliDielectronVarManager::kCentrality);
718 // histos->UserProfile( "Event","","", AliDielectronVarManager::kEqMultV0C, 90, 0., 90., AliDielectronVarManager::kCentrality);
79284309 719 histos->UserProfile( "Event","","", AliDielectronVarManager::kNVtxContrib, 90, 0., 90., AliDielectronVarManager::kCentrality);
359a5e52 720 histos->UserHistogram("Event","","", 100, 0., 4000., AliDielectronVarManager::kNVtxContribTPC);
79284309 721
2d109362
JB
722 // event plane histograms
723 if(!hasMC) AddQAHistsEP(die);
724 // trigger histograms
79284309 725 if(!hasMC) {
2d109362
JB
726 histos->UserHistogram("Event","","", 29,0.,29., AliDielectronVarManager::kTriggerInclONL);
727 histos->UserHistogram("Event","","", 29,0.,29., AliDielectronVarManager::kTriggerInclOFF);
728 histos->UserHistogram("Event","","", 29,0.,29., AliDielectronVarManager::kTriggerExclOFF);
729 histos->UserHistogram("Event","","", 100,0.,100.,29,0.,29.,
730 AliDielectronVarManager::kCentrality,AliDielectronVarManager::kTriggerInclONL);
731 histos->UserHistogram("Event","","", 100,0.,100.,29,0.,29.,
732 AliDielectronVarManager::kCentrality,AliDielectronVarManager::kTriggerExclOFF);
733 histos->UserHistogram("Event","","", 300,0.,3000.,29,0.,29.,
734 AliDielectronVarManager::kRefMultTPConly,AliDielectronVarManager::kTriggerExclOFF);
735 histos->UserHistogram("Event","","", 300,0.,3000.,29,0.,29.,
736 AliDielectronVarManager::kRefMultTPConly,AliDielectronVarManager::kTriggerInclOFF);
737 }
ef0426e6 738
79284309 739 } //hist: event
187de573 740
79284309 741 ///// PAIR HISTOS /////
ef0426e6 742 if(bHistPair) {
187de573 743
ef0426e6 744 //Pair classes
745 // to fill also mixed event histograms loop until 7 or 10
6720a01a 746 for (Int_t i=1; i<(bHistPairME ? 8 : 2); ++i){
ef0426e6 747 histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(i)));
187de573 748 }
6720a01a 749
79284309 750 //add MC signal histograms to pair class
ab5dc7f9 751 if(die->GetMCSignals()) {
2d109362 752 for (Int_t i=0; i<die->GetMCSignals()->GetEntriesFast(); ++i) {
ab5dc7f9 753 histos->AddClass(Form("Pair_%s",die->GetMCSignals()->At(i)->GetName()));
359a5e52 754 histos->AddClass(Form("Pair_%s_MCtruth",die->GetMCSignals()->At(i)->GetName()));
2d109362 755 }
ab5dc7f9 756 }
757
2d109362 758 ///// Pair classes /////
6720a01a 759 histos->UserHistogram("Pair","","", 375,.0,375*0.04, AliDielectronVarManager::kM); // 40MeV bins, 12GeV/c2
2d109362
JB
760 histos->UserHistogram("Pair","","", 100,-1.,1., AliDielectronVarManager::kY);
761 histos->UserHistogram("Pair","","", 400,0,20., AliDielectronVarManager::kPt);
6720a01a 762 histos->UserHistogram("Pair","","", 125,.0,125*0.04, 400,0,20., AliDielectronVarManager::kM,AliDielectronVarManager::kPt);
2d109362
JB
763 histos->UserHistogram("Pair","","", 100,0.,3.15, AliDielectronVarManager::kOpeningAngle);
764 histos->UserHistogram("Pair","","", 100,0.,20, AliDielectronVarManager::kChi2NDF);
765 histos->UserHistogram("Pair","","", 100,0.,3.15, AliDielectronVarManager::kPsiPair);
766 histos->UserHistogram("Pair","","", 200,0.,100., AliDielectronVarManager::kR);
767 histos->UserHistogram("Pair","","", 50,0.,5., AliDielectronVarManager::kLegDist);
768 histos->UserHistogram("Pair","","", 50,0.,5., AliDielectronVarManager::kLegDistXY);
359a5e52
JB
769 // histos->UserHistogram("Pair","","", 210,-1.05,1.05, 100,0.,2.5,
770 // AliDielectronVarManager::kArmAlpha,AliDielectronVarManager::kArmPt);
771 histos->UserHistogram("Pair","","", 500,-2.5,2.5, AliDielectronVarManager::kImpactParXY);
772 histos->UserHistogram("Pair","","", 600,-3.,3., AliDielectronVarManager::kImpactParZ);
773
6720a01a 774 if(!hasMC && die->GetMixingHandler() && maxMisBins)
2d109362
JB
775 histos->UserHistogram("Pair","","", maxMixBins, 0, maxMixBins, AliDielectronVarManager::kMixingBin);
776
777 histos->UserHistogram("Pair","","", 100,.0,1., AliDielectronVarManager::kRndmPair);
778 // histos->UserHistogram("Pair","","", GetPDGcodes(), AliDielectronVarManager::kPdgCode);
779 // histos->UserHistogram("Pair","","", GetPDGcodes(), AliDielectronVarManager::kPdgCodeMother);
780 // histos->UserHistogram("Pair","","", GetPDGcodes(), AliDielectronVarManager::kPdgCodeGrandMother);
781
782 } //hist: pairs
783
784
785 ///// TRACK HISTOS /////
786 if(bHistTrk) {
ab5dc7f9 787 //Track classes
ef0426e6 788 //legs from pair (fill SE)
79284309 789 for (Int_t i=1; i<2; ++i){
2d109362 790 if(bHistPair) histos->AddClass(Form("Track_Legs_%s",AliDielectron::PairClassName(i)));
8c06b662 791 }
8c06b662 792 //to fill also track info from 2nd event loop until 2
ab5dc7f9 793 // for (Int_t i=0; i<2; ++i) histos->AddClass(Form("Track_%s",AliDielectron::TrackClassName(i)));
6720a01a 794 if(cutDefinition!=kLegEff)
ab5dc7f9 795 histos->AddClass(Form("Track_%s", AliDielectron::PairClassName(AliDielectron::kEv1PM)));
187de573 796
2d109362
JB
797 // PID post calibration
798 if(cutDefinition==kPIDqa) AddQAHistsPID(die);
79284309 799
187de573 800 // Vertex
79284309 801 // histos->UserHistogram("Track","","", 500,-1.,1., AliDielectronVarManager::kImpactParXY);
802 // histos->UserHistogram("Track","","", 600,-3.,3., AliDielectronVarManager::kImpactParZ);
187de573 803 // Kinematics
2ed1b6ff 804 histos->UserHistogram("Track","","", 400,0,20., AliDielectronVarManager::kPt);
805 histos->UserHistogram("Track","","", 200,-1,1, 200,0,6.285, AliDielectronVarManager::kEta,AliDielectronVarManager::kPhi);
187de573 806 // TPC
79284309 807 // histos->UserHistogram("Track","","", 160,-0.5,159.5, AliDielectronVarManager::kNclsTPC);
808 // histos->UserHistogram("Track","","", 160,-0.5,159.5, AliDielectronVarManager::kTPCsignalN);
809 // histos->UserHistogram("Track","","", 160,-0.5,159.5, AliDielectronVarManager::kNFclsTPCr);
810 // histos->UserHistogram("Track","","", 160,-0.5,159.5, 160,-0.5,159.5, AliDielectronVarManager::kNclsTPC,AliDielectronVarManager::kNFclsTPCr);
187de573 811 // TRD
2ed1b6ff 812 histos->UserHistogram("Track","","", 8,-0.5, 7.5, AliDielectronVarManager::kTRDpidQuality);
359a5e52
JB
813 histos->UserHistogram("Track","","", 101,-0.5, 100.5, AliDielectronVarManager::kTRDsignal);
814 histos->UserHistogram("Track","","", 101,-0.5, 100.5, AliDielectronVarManager::kTRDchi2);
187de573 815 // PID
2d109362
JB
816 histos->UserHistogram("Track","","", 400,0.2,20.,200,0.,200., AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCsignal,kTRUE);
817 histos->UserHistogram("Track","","", 400,0.2,20.,200,-10.,10.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaEle,kTRUE);
6720a01a 818 histos->UserHistogram("Track","","", 250,0.2,5.0,300,0.,1.2, AliDielectronVarManager::kPIn,AliDielectronVarManager::kTOFbeta,kTRUE);
359a5e52 819 // histos->UserHistogram("Track","","", 100,-1.,+1.,200,-10.,10.,AliDielectronVarManager::kEta,AliDielectronVarManager::kTPCnSigmaEle);
79284309 820
359a5e52
JB
821 // histos->UserHistogram("Track","","", 100,0.2,10.,100,0.,200.,
822 // AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCsignal,kTRUE);
823 // histos->UserHistogram("Track","","", 100,0.2,10.,100,-5.,+5.,
824 // AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaEle,kTRUE);
79284309 825 histos->UserHistogram("Track","","", 100,0.,4000.,100,0.,200.,
826 AliDielectronVarManager::kRefMultTPConly,AliDielectronVarManager::kTPCsignal);
827 histos->UserHistogram("Track","","", 100,0.,4000.,100,-5.,+5.,
828 AliDielectronVarManager::kRefMultTPConly,AliDielectronVarManager::kTPCnSigmaEle);
829 histos->UserHistogram("Track","","", 100,0.,100.,100,0.,200.,
830 AliDielectronVarManager::kCentrality,AliDielectronVarManager::kTPCsignal);
831 histos->UserHistogram("Track","","", 100,0.,100.,100,-5.,+5.,
832 AliDielectronVarManager::kCentrality,AliDielectronVarManager::kTPCnSigmaEle);
833 histos->UserHistogram("Track","","", 100,-1.,+1.,100,0.,200.,
834 AliDielectronVarManager::kEta,AliDielectronVarManager::kTPCsignal);
835 histos->UserHistogram("Track","","", 100,-1.,+1.,100,-5.,+5.,
836 AliDielectronVarManager::kEta,AliDielectronVarManager::kTPCnSigmaEle);
837 histos->UserHistogram("Track","","", 100,-1.,+1.,100,-5.,+5.,
838 AliDielectronVarManager::kEta,AliDielectronVarManager::kTPCnSigmaEleRaw);
6720a01a 839 histos->UserHistogram("Track","","", 100,-1.,+1.,100,-5.,+5.,
840 AliDielectronVarManager::kEta,AliDielectronVarManager::kTPCnSigmaPio);
2d109362 841 } //hist: tracks
187de573 842
187de573 843
359a5e52 844 if(cutDefinition==kAvgPt) {
2d109362 845 // add single electron efficiency histograms
6720a01a 846 AddQAHistsEff(die);
2d109362 847 }
187de573 848
ef0426e6 849 ////// MONTE CARLO //////
2d109362 850 if(cutDefinition==kLegEff) {
79284309 851
852 //add MC signal histograms to track class
853 if(die->GetMCSignals()) {
79284309 854
2d109362
JB
855 TString className="";
856 for (Int_t i=0; i<die->GetMCSignals()->GetEntriesFast(); ++i) {
857 TString sigMCname = die->GetMCSignals()->At(i)->GetName();
858
859 // mc truth
860 // histos->AddClass(Form("Pair_%s_MCtruth", sigMCname.Data()));
861 // histos->AddClass(Form("Track_Legs_%s_MCtruth",sigMCname.Data()));
862 // mc reconstructed
863 // histos->AddClass(Form("Pair_%s", sigMCname.Data()));
864 // histos->AddClass(Form("Track_Legs_%s", sigMCname.Data()));
865 // tracks
866 histos->AddClass(Form("Track_%s_%s",AliDielectron::PairClassName(AliDielectron::kEv1PM),sigMCname.Data()));
867 histos->AddClass(Form("Track_%s_%s_MCtruth",AliDielectron::PairClassName(AliDielectron::kEv1PM),sigMCname.Data()));
868 } //end: loop signals
869 } //end: has signals
870
871 // add single electron histograms
872 AddHistsEleEff(die);
873 // pdg codes
874 // histos->UserHistogram("Track","","", GetPDGcodes(), AliDielectronVarManager::kPdgCode);
875 // histos->UserHistogram("Track","","", GetPDGcodes(), AliDielectronVarManager::kPdgCodeMother);
876 // histos->UserHistogram("Track","","", GetPDGcodes(), AliDielectronVarManager::kPdgCodeGrandMother);
877 // histos->UserHistogram("Track","","", GetPDGcodes(), GetPDGcodes(),
878 // AliDielectronVarManager::kPdgCodeMother, AliDielectronVarManager::kPdgCodeGrandMother);
879 }
79284309 880
881
ef0426e6 882
8c06b662 883 die->SetHistogramManager(histos);
79284309 884
885
886 ////// LOG //////
887 TIter nextClass(histos->GetHistogramList());
888 THashList *l=0;
889 while ( (l=static_cast<THashList*>(nextClass())) ) {
890 //printf(" [D] HistogramManger: Class %s: Histograms: %04d \n", l->GetName(), l->GetEntries());
891 }
892
2d109362
JB
893} //end: init histograms
894
895void AddQAHistsPID(AliDielectron *die) {
896 //
897 // add histograms for PID validation, comparison, post calibration aso.
898 //
899
900 Bool_t hasMC=die->GetHasMC();
901 AliDielectronHistos *histos = die->GetHistoManager();
902
903 // add MC signal tracks
904 if(hasMC && die->GetMCSignals()) {
905 TString sigMCname = die->GetMCSignals()->Last()->GetName();
906 histos->AddClass(Form("Track_%s_%s",AliDielectron::PairClassName(AliDielectron::kEv1PM),sigMCname.Data()));
907 }
908
909
910 // for TPC post calibration
911
912 // arbitrary binning for variables
913 TVectorD *vcen = AliDielectronHelper::MakeLinBinning( 11, 0., 55.);
914 (*vcen)[21] = 90.;
915
916 // array of bin limits
917 TObjArray *limits = new TObjArray();
918 limits->Add(AliDielectronHelper::MakeLinBinning( 75,-10., 5.));
919 limits->Add(AliDielectronHelper::MakeLinBinning( 75,-10., 5.));
920 // limits->Add(AliDielectronHelper::MakeLinBinning(100, 0., 200.));
921 // limits->Add(AliDielectronHelper::MakeLinBinning(60, 0., 1.2));
922 limits->Add(AliDielectronHelper::MakeLinBinning( 50, 0., 4000.));
923 limits->Add(AliDielectronHelper::MakeLinBinning( 50, 0., 10.));
924 // limits->Add(vcen);
925 // limits->Add(AliDielectronHelper::MakeLinBinning( 36, 0., 90.));
926 limits->Add(AliDielectronHelper::MakeLinBinning( 20, -1., 1.));
927 limits->Add(GetRunNumbers2011());
928 UInt_t var[]={AliDielectronVarManager::kTPCnSigmaEleRaw, // NOTE: raw nsigma w/o corr
929 AliDielectronVarManager::kTPCnSigmaEle,
930 // AliDielectronVarManager::kTOFbeta,
931 // AliDielectronVarManager::kTPCsignal,
932 AliDielectronVarManager::kRefMultTPConly,
933 AliDielectronVarManager::kPIn,
934 // AliDielectronVarManager::kCentrality,
935 AliDielectronVarManager::kEta,
936 AliDielectronVarManager::kRunNumber
937 };
938 // add merged track histogram
939 histos->UserSparse("Track", limits->GetEntriesFast(), limits, var);
940
941 // run dependence of nisgma electron
942 histos->UserHistogram("Track","","", GetRunNumbers2011(),AliDielectronHelper::MakeLinBinning(100,-5.,+5.),
943 AliDielectronVarManager::kRunNumber,AliDielectronVarManager::kTPCnSigmaEleRaw);
944 histos->UserHistogram("Track","","", GetRunNumbers2011(),AliDielectronHelper::MakeLinBinning(100,-5.,+5.),
945 AliDielectronVarManager::kRunNumber,AliDielectronVarManager::kTPCnSigmaEle);
946
947 // post calibration check
948 histos->UserHistogram("Track","","", 100,0.2,10.,100,-5.,+5.,
949 AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaEleRaw,kTRUE);
950 histos->UserHistogram("Track","","", 100,0.2,10.,100,-5.,+5.,
951 AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaEle,kTRUE);
952
953 // TPC number of points used for nsigma calculation
954 histos->UserHistogram("Track","","", 160,-0.5,159.5, AliDielectronVarManager::kTPCsignalN);
955}
956
957void AddQAHistsEP(AliDielectron *die) {
958 //
959 // add histograms for event plane flattening aso.
960 //
961
962 Bool_t hasMC=die->GetHasMC();
963 AliDielectronHistos *histos = die->GetHistoManager();
964
6720a01a 965 histos->UserHistogram("Event","","", AliDielectronHelper::MakeLinBinning(100,-1.6,1.6), AliDielectronVarManager::kTPCrpH2);
966 histos->UserHistogram("Event","","", AliDielectronHelper::MakeLinBinning(100,-1.6,1.6), AliDielectronVarManager::kTPCrpH2uc);
967
2d109362
JB
968 // event plane resolutions
969 TObjArray *limits = new TObjArray();
970 limits->Add(AliDielectronHelper::MakeLinBinning( 18, 0., 90.));
971 // limits->Add(GetRunNumbers2011());
972 limits->Add(AliDielectronHelper::MakeLinBinning(100, -1., 1.));
973 limits->Add(AliDielectronHelper::MakeLinBinning(100, -1., 1.));
974 limits->Add(AliDielectronHelper::MakeLinBinning(100, -1., 1.));
975
976 UInt_t var[]={AliDielectronVarManager::kCentrality,
977 // AliDielectronVarManager::kRunNumber,
978 AliDielectronVarManager::kv0ATPCDiffH2,
979 AliDielectronVarManager::kv0CTPCDiffH2,
980 AliDielectronVarManager::kv0Av0CDiffH2 };
981 // histos->UserSparse("Event", 4, limits, var);
982
983 // event plane angles
984 TObjArray *limits2 = new TObjArray();
985 limits2->Add(AliDielectronHelper::MakeLinBinning( 18, 0., 90.));
986 // limits2->Add(GetRunNumbers2011());
987 limits2->Add(AliDielectronHelper::MakeLinBinning(100, -1.6, 1.6));
988 limits2->Add(AliDielectronHelper::MakeLinBinning(100, -1.6, 1.6));
989 limits2->Add(AliDielectronHelper::MakeLinBinning(100, -1.6., 1.6));
990
991 UInt_t var2[]={AliDielectronVarManager::kCentrality,
992 // AliDielectronVarManager::kRunNumber,
993 AliDielectronVarManager::kv0ArpH2,
994 AliDielectronVarManager::kv0CrpH2,
995 AliDielectronVarManager::kTPCrpH2 };
996 histos->UserSparse("Event", limits2->GetEntriesFast(), limits2, var2);
997
998 // VZERO event plane angles (sub rings)
999 histos->UserHistogram("Event","","", 100,-2.,2., AliDielectronVarManager::kv0A0rpH2);
1000 histos->UserHistogram("Event","","", 100,-2.,2., AliDielectronVarManager::kv0C0rpH2);
1001 histos->UserHistogram("Event","","", 100,-2.,2., AliDielectronVarManager::kv0A3rpH2);
1002 histos->UserHistogram("Event","","", 100,-2.,2., AliDielectronVarManager::kv0C3rpH2);
1003 histos->UserHistogram("Event","","", 100,-2.,2., AliDielectronVarManager::kv0ACrpH2); // combined A+C
1004
1005 // run dependence of the angles
1006 histos->UserHistogram("Event","","", GetRunNumbers2011(), AliDielectronHelper::MakeLinBinning(100,-1.6,1.6),
1007 AliDielectronVarManager::kRunNumber, AliDielectronVarManager::kv0ArpH2);
1008 histos->UserHistogram("Event","","", GetRunNumbers2011(), AliDielectronHelper::MakeLinBinning(100,-1.6,1.6),
1009 AliDielectronVarManager::kRunNumber, AliDielectronVarManager::kv0CrpH2);
1010 histos->UserHistogram("Event","","", GetRunNumbers2011(), AliDielectronHelper::MakeLinBinning(100,-1.6,1.6),
1011 AliDielectronVarManager::kRunNumber, AliDielectronVarManager::kTPCrpH2);
1012
1013
1014 // TPC q vector components
1015 histos->UserHistogram("Event","","", 100,-1500.,1500., AliDielectronVarManager::kTPCxH2);
1016 histos->UserHistogram("Event","","", 100,-1500.,1500., AliDielectronVarManager::kTPCyH2);
1017 // histos->UserHistogram("Event","","", 100, -2., 2., AliDielectronVarManager::kTPCsub1rpH2);
1018 // histos->UserHistogram("Event","","", 100, -2., 2., AliDielectronVarManager::kTPCsub2rpH2);
1019 // histos->UserHistogram("Event","","", 100, -1., 1., AliDielectronVarManager::kTPCsub12DiffH2);
1020
1021 // further event plane resolutions (used in 3 sub event method)
1022 histos->UserProfile("Event","","", AliDielectronVarManager::kv0ATPCDiffH2, 18, 0.,90., AliDielectronVarManager::kCentrality);
1023 histos->UserProfile("Event","","", AliDielectronVarManager::kv0CTPCDiffH2, 18, 0.,90., AliDielectronVarManager::kCentrality);
1024 histos->UserProfile("Event","","", AliDielectronVarManager::kv0Av0CDiffH2, 18, 0.,90., AliDielectronVarManager::kCentrality);
1025 histos->UserProfile("Event","","", AliDielectronVarManager::kTPCsub12DiffH2, 18, 0.,90., AliDielectronVarManager::kCentrality);
1026 histos->UserProfile("Event","","", AliDielectronVarManager::kv0Av0C0DiffH2, 18, 0.,90., AliDielectronVarManager::kCentrality);
1027 histos->UserProfile("Event","","", AliDielectronVarManager::kv0Av0C3DiffH2, 18, 0.,90., AliDielectronVarManager::kCentrality);
1028 histos->UserProfile("Event","","", AliDielectronVarManager::kv0Cv0A0DiffH2, 18, 0.,90., AliDielectronVarManager::kCentrality);
1029 histos->UserProfile("Event","","", AliDielectronVarManager::kv0Cv0A3DiffH2, 18, 0.,90., AliDielectronVarManager::kCentrality);
1030 histos->UserProfile("Event","","", AliDielectronVarManager::kv0A0v0A3DiffH2, 18, 0.,90., AliDielectronVarManager::kCentrality);
1031 histos->UserProfile("Event","","", AliDielectronVarManager::kv0C0v0C3DiffH2, 18, 0.,90., AliDielectronVarManager::kCentrality);
1032
1033 // EP angle correlation (range of phi angle)
1034 // histos->UserHistogram("Event","","", 320,-3.2.,3.2, 320,-3.2.,3.2,
1035 // AliDielectronVarManager::kTPCrpH2,AliDielectronVarManager::kv0ACrpH2);
1036
1037 // EP Qvector magnitudes
1038 histos->UserHistogram("Event","","", 200,0.,200., AliDielectronVarManager::kTPCmagH2);
1039 histos->UserHistogram("Event","","", 200,0.,800., AliDielectronVarManager::kv0ACmagH2);
1040 histos->UserHistogram("Event","","", 200,0.,800., AliDielectronVarManager::kv0AmagH2);
1041 histos->UserHistogram("Event","","", 200,0.,800., AliDielectronVarManager::kv0CmagH2);
1042
1043 // detector effects checks
1044 histos->UserHistogram("Event","","", 10,0.,100., 300,-1.0,1.0,
1045 AliDielectronVarManager::kCentrality, AliDielectronVarManager::kTPCsub12DiffH2Sin);
1046
1047 // TPC recentering
1048 // histos->UserProfile("Event","","", AliDielectronVarManager::kTPCxH2,
1049 // AliDielectronHelper::MakeLinBinning(9, 0.,90.), GetRunNumbers2011(),
1050 // AliDielectronVarManager::kCentrality, AliDielectronVarManager::kRunNumber);
1051 // histos->UserProfile("Event","","", AliDielectronVarManager::kTPCyH2,
1052 // AliDielectronHelper::MakeLinBinning(9, 0.,90.), GetRunNumbers2011(),
1053 // AliDielectronVarManager::kCentrality, AliDielectronVarManager::kRunNumber);
1054
1055}
1056
1057void AddHistsEleEff(AliDielectron *die) {
1058 //
1059 // adding histograms for single electron efficiencies
1060 //
1061
1062 Bool_t hasMC=die->GetHasMC();
1063 AliDielectronHistos *histos = die->GetHistoManager();
1064
2d109362
JB
1065 // single electron efficiecy
1066
1067 // arbitrary binning for variables
1068 // TVectorD *vpt = AliDielectronHelper::MakeLinBinning( 41, 0.0, 10.25);
1069 // (*vpt)[41] = 20.;
1070 TVectorD *vpt1 = AliDielectronHelper::MakeLinBinning( (int)(( 3. - 0.)/0.10), 0., 3.); //steps of 100MeV
1071 TVectorD *vpt2 = AliDielectronHelper::MakeLinBinning( (int)(( 10.- 3.25)/0.25), 3.25, 10.); //steps of 250MeV
1072 TVectorD *vpt3 = AliDielectronHelper::MakeLinBinning( (int)((100.-20.)/10.0), 20., 100.); //steps of 10GeV
1073 TVectorD *vpt = new TVectorD(vpt1->GetNrows()+vpt2->GetNrows()+vpt3->GetNrows());
1074 for(Int_t i=0; i<vpt1->GetNrows(); i++) (*vpt)[i] = (*vpt1)[i];
1075 for(Int_t i=0; i<vpt2->GetNrows(); i++) (*vpt)[vpt1->GetNrows()+i] = (*vpt2)[i];
1076 for(Int_t i=0; i<vpt3->GetNrows(); i++) (*vpt)[vpt1->GetNrows()+vpt2->GetNrows()+i] = (*vpt3)[i];
6720a01a 1077 delete vpt1; delete vpt2; delete vpt3; //vpt->Print();
2d109362
JB
1078
1079 // array of bin limits
1080 TObjArray *limEpm = new TObjArray();
1081 // limEpm->Add(AliDielectronHelper::MakeLinBinning( 75,-10., 5.));
1082 limEpm->Add(AliDielectronHelper::MakeLinBinning( 18, 0., 90.));
1083 limEpm->Add(vpt);
6720a01a 1084 limEpm->Add(AliDielectronHelper::MakeLinBinning( 20, 0., TMath::TwoPi()));
2d109362 1085 limEpm->Add(AliDielectronHelper::MakeLinBinning( 20, -1., +1.));
6720a01a 1086 // limEpm->Add(AliDielectronHelper::MakeLinBinning( 1, -1., +1.));
1087 // limEpm->Add(AliDielectronHelper::MakeLinBinning( 1, -1., +1.));
2d109362
JB
1088 limEpm->Add(GetRunNumbers2011());
1089 limEpm->Add(GetPDGcodes());
6720a01a 1090 limEpm->Add(GetPDGcodes());
2d109362
JB
1091 UInt_t varEpm[]={//AliDielectronVarManager::kTPCnSigmaEle,
1092 AliDielectronVarManager::kCentrality
1093 ,AliDielectronVarManager::kPt
6720a01a 1094 ,AliDielectronVarManager::kPhi
2d109362 1095 ,AliDielectronVarManager::kEta
6720a01a 1096 // ,AliDielectronVarManager::kImpactParXY
1097 // ,AliDielectronVarManager::kImpactParZ
2d109362
JB
1098 ,AliDielectronVarManager::kRunNumber
1099 ,AliDielectronVarManager::kPdgCodeMother
6720a01a 1100 ,AliDielectronVarManager::kPdgCodeGrandMother
2d109362
JB
1101 };
1102 // adding histogram
6720a01a 1103 if(hasMC) histos->UserSparse("Track", limEpm->GetEntriesFast(), limEpm, varEpm);
1104 delete limEpm;
2d109362
JB
1105
1106 histos->UserHistogram("Track","","", 500,-1.,1., AliDielectronVarManager::kImpactParXY);
1107 histos->UserHistogram("Track","","", 600,-3.,3., AliDielectronVarManager::kImpactParZ);
1108
1109 // polarisation //
1110 // array of bin limits
1111 TVectorD *vpt = AliDielectronHelper::MakeLinBinning( 21, 0.0, 10.5);
1112 (*vpt)[21] = 100.;
1113 TObjArray *limPair = new TObjArray();
1114 limPair->Add(AliDielectronHelper::MakeLinBinning( 18, 0., 90.));
1115 limPair->Add(AliDielectronHelper::MakeLinBinning( 20, -1., +1.));
1116 limPair->Add(vpt);
1117 // limPair->Add(GetPDGcodes());
1118 UInt_t varPair[]={
1119 AliDielectronVarManager::kCentrality
1120 ,AliDielectronVarManager::kThetaCS
1121 ,AliDielectronVarManager::kPt
1122 // ,AliDielectronVarManager::kPdgCodeMother
1123 };
1124 // if(hasMC) histos->UserSparse("Pair", limPair->GetEntriesFast(), limPair, varPair); // TAKES 4ever
6720a01a 1125 delete limPair;
79284309 1126
8c06b662 1127}
1128
6720a01a 1129void AddQAHistsEff(AliDielectron *die) {
1130 //
1131 // adding histograms for single electron efficiencies
1132 //
1133
1134 Bool_t hasMC=die->GetHasMC();
1135 AliDielectronHistos *histos = die->GetHistoManager();
1136
1137 // arbitrary binning for variables
1138 TVectorD *vpt1 = AliDielectronHelper::MakeLinBinning( (int)(( 3. - 0.)/0.10), 0., 3.);
1139 TVectorD *vpt2 = AliDielectronHelper::MakeLinBinning( (int)(( 10.- 3.25)/0.25), 3.25, 10.);
1140 TVectorD *vpt3 = AliDielectronHelper::MakeLinBinning( (int)((100.-20.)/10.0), 20., 100.);
1141 TVectorD *vpt = new TVectorD(vpt1->GetNrows()+vpt2->GetNrows()+vpt3->GetNrows());
1142 for(Int_t i=0; i<vpt1->GetNrows(); i++) (*vpt)[i] = (*vpt1)[i];
1143 for(Int_t i=0; i<vpt2->GetNrows(); i++) (*vpt)[vpt1->GetNrows()+i] = (*vpt2)[i];
1144 for(Int_t i=0; i<vpt3->GetNrows(); i++) (*vpt)[vpt1->GetNrows()+vpt2->GetNrows()+i] = (*vpt3)[i];
1145 delete vpt1; delete vpt2; delete vpt3;
1146
1147 // single electron efficiecy
1148 // applied efficiencies in collision data
1149 histos->UserHistogram("Track","","", 101,-0.01,1.0, AliDielectronVarManager::kLegEff);
1150 histos->UserProfile("Track","","", AliDielectronVarManager::kLegEff, GetRunNumbers2011(), AliDielectronVarManager::kRunNumber);
1151 histos->UserProfile("Track","","", AliDielectronVarManager::kLegEff, 18,0.0,90.0, AliDielectronVarManager::kCentrality);
1152 histos->UserProfile("Track","","", AliDielectronVarManager::kLegEff, vpt, AliDielectronVarManager::kPt);
1153 histos->UserProfile("Track","","", AliDielectronVarManager::kLegEff, 20,0.0,TMath::TwoPi(), AliDielectronVarManager::kPhi);
1154 histos->UserProfile("Track","","", AliDielectronVarManager::kLegEff, 20,-1.,+1., AliDielectronVarManager::kEta);
1155 // histos->UserProfile("Track","","", AliDielectronVarManager::kLegEff,
1156 // vpt, AliDielectronHelper::MakeLinBinning(20,0.0,TMath::TwoPi()),
1157 // AliDielectronVarManager::kPt,AliDielectronVarManager::kPhi);
1158
1159 histos->UserHistogram("Pair","","", 101,-0.01,1.0, AliDielectronVarManager::kPairEff);
1160 histos->UserProfile("Pair","","", AliDielectronVarManager::kPairEff, 125,.0,125*0.04, AliDielectronVarManager::kM);
1161 histos->UserProfile("Pair","","", AliDielectronVarManager::kPairEff, 100,.0,10.0, AliDielectronVarManager::kPt);
1162 histos->UserProfile("Pair","","", AliDielectronVarManager::kPairEff, 18,0.0,90.0, AliDielectronVarManager::kCentrality);
1163
1164 histos->UserHistogram("Pair","","", 125,.0,125*0.04, 101,-0.01,1.0,
1165 AliDielectronVarManager::kM, AliDielectronVarManager::kPairEff);
1166 histos->UserHistogram("Pair","","", 200,0,10., 101,-0.01,1.0,
1167 AliDielectronVarManager::kPt, AliDielectronVarManager::kPairEff);
1168
1169 // array of bin limits
1170 TObjArray *limEpm = new TObjArray();
1171 limEpm->Add(AliDielectronHelper::MakeLinBinning( 125, 0., 125*0.04));
1172 limEpm->Add(AliDielectronHelper::MakeLinBinning( 40, 0., 10.));
1173 limEpm->Add(AliDielectronHelper::MakeLinBinning( 101, -0.01, +1.0));
1174 UInt_t varEpm[]={
1175 AliDielectronVarManager::kM
1176 ,AliDielectronVarManager::kPt
1177 ,AliDielectronVarManager::kPairEff
1178 };
1179 // histos->UserSparse("Pair", limEpm->GetEntriesFast(), limEpm, varEpm);
1180 delete limEpm;
1181
1182 histos->UserProfile("Pair","","", AliDielectronVarManager::kPt,125,.0,125*0.04, AliDielectronVarManager::kM);
1183 //weighted
1184 histos->UserHistogram("Pair","","", AliDielectronHelper::MakeLinBinning(125,.0,125*0.04),
1185 AliDielectronVarManager::kM, AliDielectronVarManager::kOneOverPairEff);
1186 histos->UserProfile("Pair", "","", AliDielectronVarManager::kPt,AliDielectronHelper::MakeLinBinning(125,.0,125*0.04),
1187 AliDielectronVarManager::kM, "", AliDielectronVarManager::kOneOverPairEff);
1188}
1189
1190
443a091c 1191void InitHF(AliDielectron* die, Int_t cutDefinition)
1192{
1193 //
4d7704c5 1194 // Setup the HF arrays
443a091c 1195 //
2d109362
JB
1196 // do not fill
1197 switch(cutDefinition) {
6720a01a 1198 case kNoCut:
2d109362
JB
1199 case kEvent:
1200 case kPIDqa:
1201 case kLegEff:
1202 case kNoPID:
1203 case kRec:
6720a01a 1204 case kSysMC:
2d109362
JB
1205 return;
1206 }
443a091c 1207
2d109362
JB
1208 // has mc
1209 Bool_t hasMC=die->GetHasMC();
79284309 1210 // booleans for histo selection
2d109362
JB
1211 Bool_t bHistEff = kFALSE; //ATTENTION
1212 // mixing
1213 AliDielectronMixingHandler *mixH=die->GetMixingHandler();
1214 Int_t maxMixBins = (mixH ? mixH->GetNumberOfBins() : 0);
2ed1b6ff 1215
2d109362 1216 // container
443a091c 1217 AliDielectronHF *hf=new AliDielectronHF(die->GetName(),die->GetTitle());
79284309 1218 // define pair types and sources
1219 if(hasMC) hf->SetStepForMCGenerated();
2d109362 1220 hf->SetPairTypes(AliDielectronHF::kOSandMIX);
6720a01a 1221 if(hasMC && cutDefinition!=kAvgPt) hf->SetPairTypes(AliDielectronHF::kMConly); // only mc truth
2d109362 1222 // hf->SetPairTypes(AliDielectronHF::kAll); // all pair types
79284309 1223
2d109362 1224 //// define the grid size and granularity /////
6720a01a 1225 hf->AddCutVariable(AliDielectronVarManager::kCentrality, AliDielectronHelper::MakeArbitraryBinning("0.,10.,40.,50.,90."));
1226 hf->AddCutVariable(AliDielectronVarManager::kPt, AliDielectronHelper::MakeArbitraryBinning("0.,1.5,2.,2.5,3.,5.,6.,7.,8.,10.,100."));
1227 hf->AddCutVariable(AliDielectronVarManager::kY, AliDielectronHelper::MakeArbitraryBinning("-0.9,-0.8,0.8,0.9"));
1228
1229 // hf->AddCutVariable(AliDielectronVarManager::kCentrality, 9, 0., 90.);
1230 // TVectorD *vpt = AliDielectronHelper::MakeLinBinning( 21, 0.0, 10.5);
1231 // (*vpt)[21] = 100.;
1232 // hf->AddCutVariable(AliDielectronVarManager::kPt, vpt);
1233 // hf->AddCutVariable(AliDielectronVarManager::kY, 1, -0.8, 0.8);
1234 if(cutDefinition==kAvgPt ) //NEW
1235 hf->AddCutVariable(AliDielectronVarManager::kPairEff, AliDielectronHelper::MakeArbitraryBinning(".0,.01,.02,.03,.04,.05,.1,1."));
79284309 1236
1237 // defaults
1238 hf->UserHistogram("Pair", AliDielectronHelper::MakeLinBinning(125,.0,125*0.04), AliDielectronVarManager::kM);
1239 // for mixed event weighting
2d109362 1240 // if(mixH) hf->UserHistogram("Pair", AliDielectronHelper::MakeLinBinning(maxMixBins,0,maxMixBins), AliDielectronVarManager::kMixingBin);
79284309 1241
1242 // mean pt analysis
2d109362 1243 if(cutDefinition==kAvgPt) {
79284309 1244 hf->UserProfile("Pair", AliDielectronVarManager::kPt,
6720a01a 1245 AliDielectronHelper::MakeLinBinning(125,.0,125*0.04), AliDielectronVarManager::kM);
1246 // hf->UserProfile("Pair", AliDielectronVarManager::kPtSq,
1247 // AliDielectronHelper::MakeLinBinning(125,.0,125*0.04), AliDielectronVarManager::kM);
1248 // ME binning
1249 // hf->UserHistogram("Pair", AliDielectronHelper::MakeLinBinning(125,.0,125*0.04),
1250 // AliDielectronHelper::MakeLinBinning(maxMixBins,0,maxMixBins),
1251 // AliDielectronVarManager::kM, AliDielectronVarManager::kMixingBin);
1252 // hf->UserProfile("Pair", AliDielectronVarManager::kPt,
1253 // AliDielectronHelper::MakeLinBinning(125,.0,125*0.04),
1254 // AliDielectronHelper::MakeLinBinning(maxMixBins,0,maxMixBins),
1255 // AliDielectronVarManager::kM, AliDielectronVarManager::kMixingBin);
79284309 1256 }
1257
1258 // flow analysis
2d109362 1259 if(cutDefinition==kFlow && !hasMC) {
79284309 1260 // flow versus minv
1261 hf->UserProfile("Pair", AliDielectronVarManager::kv0ArpH2FlowV2,
1262 AliDielectronHelper::MakeLinBinning(125,.0,125*0.04), AliDielectronVarManager::kM);
1263 hf->UserProfile("Pair", AliDielectronVarManager::kv0CrpH2FlowV2,
1264 AliDielectronHelper::MakeLinBinning(125,.0,125*0.04), AliDielectronVarManager::kM);
1265 hf->UserProfile("Pair", AliDielectronVarManager::kTPCrpH2FlowV2,
1266 AliDielectronHelper::MakeLinBinning(125,.0,125*0.04), AliDielectronVarManager::kM);
1267 // detector effects
1268 hf->UserProfile("Pair", AliDielectronVarManager::kCosTPCrpH2,
1269 AliDielectronHelper::MakeLinBinning(1,.0,125*0.04), AliDielectronVarManager::kM);
1270 hf->UserProfile("Pair", AliDielectronVarManager::kSinTPCrpH2,
1271 AliDielectronHelper::MakeLinBinning(1,.0,125*0.04), AliDielectronVarManager::kM);
1272 hf->UserProfile("Pair", AliDielectronVarManager::kCosPhiH2,
1273 AliDielectronHelper::MakeLinBinning(1,.0,125*0.04), AliDielectronVarManager::kM);
1274 hf->UserProfile("Pair", AliDielectronVarManager::kSinPhiH2,
1275 AliDielectronHelper::MakeLinBinning(1,.0,125*0.04), AliDielectronVarManager::kM);
1276 hf->UserProfile("Pair", AliDielectronVarManager::kTPCrpH2FlowV2Sin,
1277 AliDielectronHelper::MakeLinBinning(125,.0,125*0.04), AliDielectronVarManager::kM);
2d109362
JB
1278
1279 // variables
1280 hf->AddCutVariable(AliDielectronVarManager::kDeltaPhiv0ArpH2, GetDeltaPhiBins());
1281 hf->AddCutVariable(AliDielectronVarManager::kDeltaPhiv0CrpH2, GetDeltaPhiBins());
1282 hf->AddCutVariable(AliDielectronVarManager::kDeltaPhiTPCrpH2, GetDeltaPhiBins());
1283 }
1284
1285 // on the fly efficienies
359a5e52 1286 if(cutDefinition==kAvgPt/* && (!hasMC || 0)*/) {
2d109362 1287 hf->UserProfile("Pair", AliDielectronVarManager::kPairEff,
6720a01a 1288 AliDielectronHelper::MakeLinBinning(125,.0,125*0.04), AliDielectronVarManager::kM);
2d109362 1289 hf->UserHistogram("Pair", AliDielectronHelper::MakeLinBinning(125,.0,125*0.04), AliDielectronVarManager::kM,
6720a01a 1290 AliDielectronVarManager::kOneOverPairEff);
2d109362 1291 hf->UserProfile("Pair", AliDielectronVarManager::kPt,
6720a01a 1292 AliDielectronHelper::MakeLinBinning(125,.0,125*0.04), AliDielectronVarManager::kM,
2d109362 1293 "", AliDielectronVarManager::kOneOverPairEff);
6720a01a 1294 // hf->UserProfile("Pair", AliDielectronVarManager::kPtSq,
1295 // AliDielectronHelper::MakeLinBinning(125,.0,125*0.04), AliDielectronVarManager::kM,
1296 // "", AliDielectronVarManager::kOneOverPairEff);
1297
1298 // ME binning
1299 if(maxMixBins) {
1300 hf->UserHistogram("Pair", AliDielectronHelper::MakeLinBinning(125,.0,125*0.04),
1301 AliDielectronHelper::MakeLinBinning(maxMixBins,0,maxMixBins),
1302 AliDielectronVarManager::kM, AliDielectronVarManager::kMixingBin,
1303 AliDielectronVarManager::kOneOverPairEff);
1304 hf->UserProfile("Pair", AliDielectronVarManager::kPt,
1305 AliDielectronHelper::MakeLinBinning(125,.0,125*0.04),
1306 AliDielectronHelper::MakeLinBinning(maxMixBins,0,maxMixBins),
1307 AliDielectronVarManager::kM, AliDielectronVarManager::kMixingBin,"",
1308 AliDielectronVarManager::kOneOverPairEff);
1309 }
79284309 1310 }
1311
2d109362
JB
1312
1313 /*
1314//// define the grid size and granularity /////
1315// event variables //
1316// hf->AddCutVariable(AliDielectronVarManager::kCentrality, AliDielectronHelper::MakeArbitraryBinning("0,10,50,90")); // flow only
1317if(hasMC) hf->AddCutVariable(AliDielectronVarManager::kCentrality, 18, 0., 90.);
1318else hf->AddCutVariable(AliDielectronVarManager::kCentrality, 9, 0., 90.);
1319// if(hasMC) hf->AddCutVariable(AliDielectronVarManager::kRunNumber, GetRunNumbers2011() );
1320// if(hasMC) hf->AddCutVariable(AliDielectronVarManager::kNacc, 3000,0.,3000.);
1321// if(hasMC) hf->AddCutVariable(AliDielectronVarManager::kNVtxContrib, 20,0.,4000.);
79284309 1322
1323 // pair variables //ATTENTION
1324 if(hasMC && 0) hf->AddCutVariable(AliDielectronVarManager::kY, 18, -0.9, 0.9);
1325 // hf->AddCutVariable(AliDielectronVarManager::kPt, 10, 0.0, 10.0);
1326 if(!hasMC)
1327 hf->AddCutVariable(AliDielectronVarManager::kPt, AliDielectronHelper::MakeArbitraryBinning("0,1,2,3,4,5,6,7,8,9,10,100"));
1328 // hf->AddCutVariable(AliDielectronVarManager::kPt, 20, 0.0, 10.0);
1329 else
1330 hf->AddCutVariable(AliDielectronVarManager::kPt, 50, 0.0, 10.0);
1331
1332 // if(hasMC) hf->AddCutVariable(AliDielectronVarManager::kTRDpidEffPair,101,0.0,1.01);
1333 // if(hasMC) hf->AddCutVariable(AliDielectronVarManager::kThetaCS,15,-1.,1.);
1334
1335 // flow variables //
1336 // if(!hasMC) hf->AddCutVariable(AliDielectronVarManager::kDeltaPhiv0ArpH2, GetDeltaPhiBins());
1337 // if(!hasMC) hf->AddCutVariable(AliDielectronVarManager::kDeltaPhiv0CrpH2, GetDeltaPhiBins());
1338 if(!hasMC && bHistFlow) hf->AddCutVariable(AliDielectronVarManager::kDeltaPhiTPCrpH2, GetDeltaPhiBins());
1339
1340 // leg variables // NOTE: switched off in HF??
1341 // if(hasMC) hf->AddCutVariable(AliDielectronVarManager::kPt, "0.85, 0.95, 1.1, 100.0", kTRUE, AliDielectronHF::kBinToMax);
1342 // if(hasMC) hf->AddCutVariable(AliDielectronVarManager::kEta,"-0.9,-0.8,0.8,0.9", kTRUE, AliDielectronHF::kSymBin);
779267ed 1343 // hf->AddCutVariable(AliDielectronVarManager::kY, 1, -0.9, 0.9 );
187de573 1344 // hf->AddCutVariable(AliDielectronVarManager::kPt, "0.8, 1.0, 1.1, 1.2, 1.5, 100.0", kTRUE, AliDielectronHF::kBinToMax);
79284309 1345 // hf->AddCutVariable(AliDielectronVarManager::kNclsTPC, "70,90,100,120,160", kTRUE, AliDielectronHF::kBinToMax);
779267ed 1346 // hf->AddCutVariable(AliDielectronVarManager::kTPCnSigmaEle,"-4,-3,-2.5,-2,2,2.5,3,4", kTRUE, AliDielectronHF::kSymBin);
1347 //hf->AddCutVariable(AliDielectronVarManager::kTPCnSigmaPio,"3.,3.5,4.,100.", kTRUE, AliDielectronHF::kBinToMax);
1348 //hf->AddCutVariable(AliDielectronVarManager::kITSLayerFirstCls,4,0.,4., kFALSE, kTRUE, AliDielectronHF::kBinFromMin);
187de573 1349 //hf->AddCutVariable(AliDielectronVarManager::kNclsITS, 5,2.,7., kFALSE, kTRUE, AliDielectronHF::kBinToMax);
79284309 1350 //hf->AddCutVariable(AliDielectronVarManager::kRunNumber, GetRunNumbers2011());
359a5e52 1351 */
443a091c 1352 die->SetHistogramArray(hf);
1353}
8c06b662 1354
1355void InitCF(AliDielectron* die, Int_t cutDefinition)
1356{
1357 //
1358 // Setup the CF Manager if needed
1359 //
2d109362
JB
1360 // do not fill
1361 switch(cutDefinition) {
6720a01a 1362 case kNoCut:
2d109362
JB
1363 case kEvent:
1364 case kPIDqa:
1365 case kLegEff:
1366 case kNoPID:
6720a01a 1367 case kAvgPt: //////////////////NEW
2d109362
JB
1368 return;
1369 }
1370
1371 // has mc
ab5dc7f9 1372 Bool_t hasMC=die->GetHasMC();
2ed1b6ff 1373
2d109362
JB
1374 // mixing
1375 AliDielectronMixingHandler *mixH=die->GetMixingHandler();
1376 Int_t maxMixBins = (mixH ? mixH->GetNumberOfBins() : 0);
1377
1378 // container
2ed1b6ff 1379 AliDielectronCF *cf=new AliDielectronCF(die->GetName(),die->GetTitle());
3c59f53e 1380
79284309 1381 //event variables
2d109362 1382 //cf->AddVariable(AliDielectronVarManager::kCentrality,"0.,5.0,10.0,15.0,20.0,25.0,30.0,35.0,40.0,50.0");
79284309 1383 cf->AddVariable(AliDielectronVarManager::kCentrality,"0.,5.0,10.0,15.0,20.0,25.0,30.0,35.0,40.0,50.0,60.0,70.0,80.,90.");
2d109362 1384 // cf->AddVariable(AliDielectronVarManager::kRunNumber, GetRunNumbers2011() );
6720a01a 1385 if(mixH && maxMixBins) cf->AddVariable(AliDielectronVarManager::kMixingBin, AliDielectronHelper::MakeLinBinning(maxMixBins,0,maxMixBins));
79284309 1386
1387 //pair variables
2d109362
JB
1388 TVectorD *vpt = AliDielectronHelper::MakeLinBinning( 21, 0.0, 10.5);
1389 (*vpt)[21] = 100.;
1390 cf->AddVariable(AliDielectronVarManager::kPt, vpt);
1391 // TVectorD *vpt = AliDielectronHelper::MakeLinBinning( 41, 0.0, 10.25);
1392 // (*vpt)[41] = 100.;
1393 // cf->AddVariable(AliDielectronVarManager::kPt,vpt);
1394 // cf->AddVariable(AliDielectronVarManager::kPt,80,0.0,100*0.25);
1395
79284309 1396 // cf->AddVariable(AliDielectronVarManager::kY,"-5,-1,-0.9,-0.8,-0.5,0.5,0.8,0.9,1.0,5");
2d109362
JB
1397 cf->AddVariable(AliDielectronVarManager::kY,"-0.9,-0.8,-0.7,+0.7,+0.8,+0.9");
1398 // cf->AddVariable(AliDielectronVarManager::kY,18,-0.9,+0.9);
79284309 1399 cf->AddVariable(AliDielectronVarManager::kM,125,0.,125*.04); //40Mev Steps
2d109362
JB
1400 // cf->AddVariable(AliDielectronVarManager::kPairType,1,1,1);
1401 cf->AddVariable(AliDielectronVarManager::kPairType,11,0,11);
79284309 1402 // cf->AddVariable(AliDielectronVarManager::kThetaCS,20,-1.,+1.);
1403 // cf->AddVariable(AliDielectronVarManager::kThetaHE,20,-1.,+1.);
1404 // cf->AddVariable(AliDielectronVarManager::kPhiCS,20,-3.2,+3.2);
1405 // cf->AddVariable(AliDielectronVarManager::kPhiHE,20,-3.2,+3.2);
359a5e52
JB
1406 /// cf->AddVariable(AliDielectronVarManager::kDeltaPhiTPCrpH2,GetDeltaPhiBins());
1407
1408 if(cutDefinition==kAvgPt && 0) { //ATTENTION
1409 cf->AddVariable(AliDielectronVarManager::kPairEff, AliDielectronHelper::MakeArbitraryBinning(".0,.01,.02,.03,.04,.05,.1,1."));
1410 }
1411
79284309 1412 //leg variables
6720a01a 1413 if(cutDefinition==kSysMC) { //ATTENTION
1414 // if(cutDefinition!=kSysMCele && 0) { //ATTENTION
2d109362
JB
1415 cf->AddVariable(AliDielectronVarManager::kPt,"0.85, 1.1, 100.0",kTRUE);
1416 // cf->AddVariable(AliDielectronVarManager::kNclsTPC,"0, 70, 80, 90, 100, 120, 160",kTRUE);
1417 cf->AddVariable(AliDielectronVarManager::kEta,"-0.9,-0.85,-0.8,-0.75,-0.70,0.70,0.75,0.8,0.85,0.9",kTRUE);
1418 cf->AddVariable(AliDielectronVarManager::kITSLayerFirstCls,3,-1.5,1.5,kTRUE);
1419 cf->AddVariable(AliDielectronVarManager::kTPCnSigmaPro,"3.5,4.0,4.5,100",kTRUE);
1420 cf->AddVariable(AliDielectronVarManager::kTPCnSigmaEle,"-1.5,-1.0,-0.6,3.0",kTRUE);
1421 }
1422 else if(0){
1423 cf->AddVariable(AliDielectronVarManager::kTPCnSigmaEle,"-3.0,-1.5,-1.0,-0.6,3.0",kTRUE);
1424 }
79284309 1425 /*
3c59f53e 1426 // event variables
79284309 1427 cf->AddVariable(AliDielectronVarManager::kCentrality, 18,0., 90.);
1428 if(hasMC) cf->AddVariable(AliDielectronVarManager::kRunNumber, GetRunNumbers2011() );
1429 // if(hasMC) cf->AddVariable(AliDielectronVarManager::kNacc, 3000,0.,3000.);
1430 // if(hasMC) cf->AddVariable(AliDielectronVarManager::kNVtxContrib, 20,0.,4000.);
3c59f53e 1431
8c06b662 1432 // pair variables
79284309 1433 if(hasMC) cf->AddVariable(AliDielectronVarManager::kPairType,1,1,1);
1434 else cf->AddVariable(AliDielectronVarManager::kPairType,11,0,11);
ab5dc7f9 1435 cf->AddVariable(AliDielectronVarManager::kM, 125, 0.0, 5.0); //40Mev Steps
79284309 1436 if(hasMC) cf->AddVariable(AliDielectronVarManager::kY, 18, -0.9, 0.9);
1437 if(hasMC) cf->AddVariable(AliDielectronVarManager::kPt, 100, 0.0, 20.0);
1438 else cf->AddVariable(AliDielectronVarManager::kPt, AliDielectronHelper::MakeArbitraryBinning("0,1,2,3,4,5,6,7,8,9,10,20"));
ab5dc7f9 1439 // if(hasMC) cf->AddVariable(AliDielectronVarManager::kTRDpidEffPair,101,0.0,1.01);
3c59f53e 1440 // if(hasMC) cf->AddVariable(AliDielectronVarManager::kThetaCS,15,-1.,1.);
1441
e0f6eeb2 1442 // flow variables
79284309 1443 //if(!hasMC) cf->AddVariable(AliDielectronVarManager::kDeltaPhiv0ArpH2, GetDeltaPhiBins());
1444 //if(!hasMC) cf->AddVariable(AliDielectronVarManager::kDeltaPhiv0CrpH2, GetDeltaPhiBins());
d28542ba 1445
3c59f53e 1446 // leg variables
79284309 1447 if(hasMC) cf->AddVariable(AliDielectronVarManager::kPt,"0.0, 0.85, 0.95, 1.0, 1.1, 100.0",kTRUE);
1448 if(hasMC) cf->AddVariable(AliDielectronVarManager::kEta,"-0.9,-0.8,-0.7, 0.7, 0.8, 0.9", kTRUE);
e0f6eeb2 1449 // cf->AddVariable(AliDielectronVarManager::kITSLayerFirstCls,7,-1.5,5.5,kTRUE);
3c59f53e 1450 // cf->AddVariable(AliDielectronVarManager::kNclsITS,"1,2,3,4,5,6",kTRUE);
ab5dc7f9 1451 // cf->AddVariable(AliDielectronVarManager::kTPCnSigmaEle,"-3,-2.5,-2,2,2.5,3",kTRUE);
1452 // cf->AddVariable(AliDielectronVarManager::kTPCnSigmaPio,"2.5,3.0,3.5,4.0,4.5,100",kTRUE);
1453 // cf->AddVariable(AliDielectronVarManager::kNclsTPC,"70, 90, 100, 120, 160",kTRUE);
3c59f53e 1454 // cf->AddVariable(AliDielectronVarManager::kTPCnSigmaPro,"3.5,4.0,4.5,5.0,100",kTRUE);
1455 // cf->AddVariable(AliDielectronVarManager::kTOFnSigmaEle,"-3,-2,2,3",kTRUE); break;
1456 // cf->AddVariable(AliDielectronVarManager::kTRDpidQuality,"3.5, 4.5, 5.5, 6.5",kTRUE);
1457 // if(!hasMC && isESD) cf->AddVariable(AliDielectronVarManager::kTRDchi2,"-1.,0.,2.,4.",kTRUE);
79284309 1458 */
3c59f53e 1459 // mc steps
8c06b662 1460 if(hasMC) {
79284309 1461 cf->SetStepForMCtruth();
ab5dc7f9 1462 // cf->SetStepForNoCutsMCmotherPid();
1463 // cf->SetStepForAfterAllCuts();
1464 // cf->SetStepsForEachCut();
1465 // cf->SetStepsForSignal();
2d109362 1466 // cf->SetStepsForBackground();
6720a01a 1467 if(cutDefinition!=kAvgPt) cf->SetStepsForMCtruthOnly();
8c06b662 1468 }
2d109362
JB
1469 else
1470 cf->SetStepsForSignal();
e0f6eeb2 1471
8c06b662 1472 die->SetCFManagerPair(cf);
1473}
1474
79284309 1475void AddMCSignals(AliDielectron *die, Int_t cutDefinition){
8c06b662 1476 //Do we have an MC handler?
ab5dc7f9 1477 if (!die->GetHasMC()) return;
1478
1479 AliDielectronSignalMC* inclusiveJpsi = new AliDielectronSignalMC("inclusiveJpsi","Inclusive");
8c06b662 1480 inclusiveJpsi->SetLegPDGs(11,-11);
1481 inclusiveJpsi->SetMotherPDGs(443,443);
1482 inclusiveJpsi->SetMothersRelation(AliDielectronSignalMC::kSame);
1483 inclusiveJpsi->SetFillPureMCStep(kTRUE);
1484 inclusiveJpsi->SetCheckBothChargesLegs(kTRUE,kTRUE);
1485 inclusiveJpsi->SetCheckBothChargesMothers(kTRUE,kTRUE);
ab5dc7f9 1486
1487 AliDielectronSignalMC* beautyJpsi = new AliDielectronSignalMC("beautyJpsi","Beauty");
1488 beautyJpsi->SetLegPDGs(11,-11);
1489 beautyJpsi->SetMotherPDGs(443,443);
1490 beautyJpsi->SetMothersRelation(AliDielectronSignalMC::kSame);
1491 beautyJpsi->SetGrandMotherPDGs(500,500);
1492 beautyJpsi->SetFillPureMCStep(kTRUE);
1493 beautyJpsi->SetCheckBothChargesLegs(kTRUE,kTRUE);
1494 beautyJpsi->SetCheckBothChargesMothers(kTRUE,kTRUE);
1495 beautyJpsi->SetCheckBothChargesGrandMothers(kTRUE,kTRUE);
ab5dc7f9 1496
1497 AliDielectronSignalMC* promptJpsi = new AliDielectronSignalMC("promptJpsi","Prompt"); // prompt J/psi (not from beauty decays)
8c06b662 1498 promptJpsi->SetLegPDGs(11,-11);
1499 promptJpsi->SetMotherPDGs(443,443);
1500 promptJpsi->SetGrandMotherPDGs(503,503,kTRUE,kTRUE); // not from beauty hadrons
1501 promptJpsi->SetMothersRelation(AliDielectronSignalMC::kSame);
1502 promptJpsi->SetFillPureMCStep(kTRUE);
1503 promptJpsi->SetLegSources(AliDielectronSignalMC::kFinalState, AliDielectronSignalMC::kFinalState);
1504 promptJpsi->SetCheckBothChargesLegs(kTRUE,kTRUE);
1505 promptJpsi->SetCheckBothChargesMothers(kTRUE,kTRUE);
1506 promptJpsi->SetCheckBothChargesGrandMothers(kTRUE,kTRUE);
0c09cae4 1507
1508 // prompt J/psi radiative channel
ab5dc7f9 1509 AliDielectronSignalMC* promptJpsiRad = new AliDielectronSignalMC("promptJpsiRad","PromptRadiative"); // prompt J/psi (not from beauty decays)
0c09cae4 1510 promptJpsiRad->SetLegPDGs(11,-11);
1511 promptJpsiRad->SetMotherPDGs(443,443);
1512 promptJpsiRad->SetGrandMotherPDGs(503,503,kTRUE,kTRUE); // not from beauty hadrons
1513 promptJpsiRad->SetMothersRelation(AliDielectronSignalMC::kSame);
1514 promptJpsiRad->SetFillPureMCStep(kTRUE);
1515 promptJpsiRad->SetLegSources(AliDielectronSignalMC::kFinalState, AliDielectronSignalMC::kFinalState);
1516 promptJpsiRad->SetCheckBothChargesLegs(kTRUE,kTRUE);
1517 promptJpsiRad->SetCheckBothChargesMothers(kTRUE,kTRUE);
1518 promptJpsiRad->SetCheckBothChargesGrandMothers(kTRUE,kTRUE);
1519 promptJpsiRad->SetJpsiRadiative(AliDielectronSignalMC::kIsRadiative);
0c09cae4 1520
1521 // prompt J/psi Non radiative channel
ab5dc7f9 1522 AliDielectronSignalMC* promptJpsiNonRad = new AliDielectronSignalMC("promptJpsiNonRad","PromptNonRadiative"); // prompt J/psi (not from beauty decays)
0c09cae4 1523 promptJpsiNonRad->SetLegPDGs(11,-11);
1524 promptJpsiNonRad->SetMotherPDGs(443,443);
1525 promptJpsiNonRad->SetGrandMotherPDGs(503,503,kTRUE,kTRUE); // not from beauty hadrons
1526 promptJpsiNonRad->SetMothersRelation(AliDielectronSignalMC::kSame);
1527 promptJpsiNonRad->SetFillPureMCStep(kTRUE);
1528 promptJpsiNonRad->SetLegSources(AliDielectronSignalMC::kFinalState, AliDielectronSignalMC::kFinalState);
1529 promptJpsiNonRad->SetCheckBothChargesLegs(kTRUE,kTRUE);
1530 promptJpsiNonRad->SetCheckBothChargesMothers(kTRUE,kTRUE);
1531 promptJpsiNonRad->SetCheckBothChargesGrandMothers(kTRUE,kTRUE);
1532 promptJpsiNonRad->SetJpsiRadiative(AliDielectronSignalMC::kIsNotRadiative);
ab5dc7f9 1533
1534 AliDielectronSignalMC* directJpsi = new AliDielectronSignalMC("directJpsi","Direct"); // embedded J/psi
1535 directJpsi->SetLegPDGs(11,-11);
1536 directJpsi->SetMotherPDGs(443,443);
1537 directJpsi->SetMothersRelation(AliDielectronSignalMC::kSame);
1538 directJpsi->SetFillPureMCStep(kTRUE);
1539 directJpsi->SetLegSources(AliDielectronSignalMC::kFinalState, AliDielectronSignalMC::kFinalState);
1540 directJpsi->SetMotherSources(AliDielectronSignalMC::kDirect, AliDielectronSignalMC::kDirect);
1541 directJpsi->SetCheckBothChargesLegs(kTRUE,kTRUE);
1542 directJpsi->SetCheckBothChargesMothers(kTRUE,kTRUE);
ab5dc7f9 1543
1544 AliDielectronSignalMC* gammaConversion = new AliDielectronSignalMC("gammaConversion","gamma conversions");
1545 gammaConversion->SetLegPDGs(11,-11);
1546 gammaConversion->SetCheckBothChargesLegs(kTRUE,kTRUE);
1547 gammaConversion->SetLegSources(AliDielectronSignalMC::kSecondary, AliDielectronSignalMC::kSecondary);
1548 gammaConversion->SetMotherPDGs(22,22);
1549 gammaConversion->SetMothersRelation(AliDielectronSignalMC::kSame);
ab5dc7f9 1550
8c06b662 1551
79284309 1552 AliDielectronSignalMC* electrons = new AliDielectronSignalMC("electrons","electrons");
1553 electrons->SetLegPDGs(11,1); //dummy second leg (never MCtrue)
1554 electrons->SetCheckBothChargesLegs(kTRUE,kTRUE);
1555 electrons->SetLegSources(AliDielectronSignalMC::kFinalState, AliDielectronSignalMC::kFinalState);
2d109362 1556 // electrons->SetGrandMotherPDGs(500,500,kTRUE,kTRUE); // exclude non-prompt jpsi eletrons
79284309 1557 electrons->SetFillPureMCStep(kTRUE);
1558 // electrons->SetMothersRelation(AliDielectronSignalMC::kSame);
1559
2d109362 1560 AliDielectronSignalMC* directElec = new AliDielectronSignalMC("directElec","directElec");
6720a01a 1561 directElec->SetLegPDGs(11,1); //NEW
1562 // directElec->SetMothersRelation(AliDielectronSignalMC::kSame);
2d109362
JB
1563 // directElec->SetGrandMotherPDGs(-1103,-1103);
1564 directElec->SetFillPureMCStep(kTRUE);
6720a01a 1565 directElec->SetLegSources(AliDielectronSignalMC::kFinalState, AliDielectronSignalMC::kFinalState);
2d109362 1566 directElec->SetMotherSources(AliDielectronSignalMC::kDirect, AliDielectronSignalMC::kDirect);
6720a01a 1567 directElec->SetCheckBothChargesLegs(kTRUE,kTRUE);
1568 // new
1569 directElec->SetCheckBothChargesGrandMothers(kTRUE,kTRUE);
1570 directElec->SetGrandMotherPDGs(902,902,kTRUE,kTRUE); // exclude open charm,beauty hadrons
2d109362
JB
1571
1572
1573 AliDielectronSignalMC* elecPrim = new AliDielectronSignalMC("elecPrim","elecPrim");
1574 elecPrim->SetLegPDGs(11,1); //dummy second leg (never MCtrue)
1575 elecPrim->SetCheckBothChargesLegs(kTRUE,kTRUE);
1576 elecPrim->SetLegSources(AliDielectronSignalMC::kFinalState, AliDielectronSignalMC::kFinalState);
1577 elecPrim->SetCheckBothChargesMothers(kTRUE,kTRUE);
6720a01a 1578 elecPrim->SetMotherPDGs(902,902,kTRUE,kTRUE); // exclude open charm,beauty hadrons
2d109362 1579 elecPrim->SetCheckBothChargesGrandMothers(kTRUE,kTRUE);
6720a01a 1580 elecPrim->SetGrandMotherPDGs(902,902,kTRUE,kTRUE); // exclude open charm,beauty hadrons
2d109362
JB
1581 elecPrim->SetFillPureMCStep(kTRUE);
1582
1583 // add direct di lepton resonances
1584 /*
1585 AliDielectronSignalMC* directP[7];
1586 TParticlePDG *ap;
1587 Int_t pdg[] = {111, 113, 221, 223, 331, 333, 443};
1588 for(Int_t i=0; i<7; i++) {
1589 ap = TDatabasePDG::Instance()->GetParticle(pdg[i]);
1590 directP[i] = new AliDielectronSignalMC(Form("direct%s",ap->GetName()),Form("direct%s",ap->GetName()));
1591 directP[i]->SetLegPDGs(11,-11);
1592 directP[i]->SetMotherPDGs(pdg[i],pdg[i]);
1593 directP[i]->SetMothersRelation(AliDielectronSignalMC::kSame);
1594 directP[i]->SetFillPureMCStep(kTRUE);
1595 directP[i]->SetLegSources(AliDielectronSignalMC::kFinalState, AliDielectronSignalMC::kFinalState);
1596 directP[i]->SetMotherSources(AliDielectronSignalMC::kDirect, AliDielectronSignalMC::kDirect);
1597 // directP[i]->SetCheckBothChargesLegs(kTRUE,kTRUE);
1598 // directP[i]->SetCheckBothChargesMothers(kTRUE,kTRUE);
1599 }
1600 */
1601
79284309 1602 /*
1603 AliDielectronSignalMC* eleHijing = new AliDielectronSignalMC("eleHijing","eleHijing");
1604 eleHijing->SetLegPDGs(11,1); //dummy second leg (never MCtrue)
1605 eleHijing->SetCheckBothChargesLegs(kTRUE,kTRUE);
1606 eleHijing->SetLegSources(AliDielectronSignalMC::kNoCocktail, AliDielectronSignalMC::kNoCocktail);
1607 eleHijing->SetFillPureMCStep(kTRUE);
1608 */
1609 /*
1610 AliDielectronSignalMC* electrons = new AliDielectronSignalMC("electrons","electrons");
1611 electrons->SetLegPDGs(11,-11); //dummy second leg (never MCtrue)
1612 electrons->SetCheckBothChargesLegs(kTRUE,kTRUE);
1613 electrons->SetLegSources(AliDielectronSignalMC::kFinalState, AliDielectronSignalMC::kFinalState);
1614 // electrons->SetMotherPDGs(111,111,kTRUE,kTRUE); // not from pi0
1615 // electrons->SetMothersRelation(AliDielectronSignalMC::kSame);
1616 electrons->SetFillPureMCStep(kTRUE);
1617 */
1618
1619 // selection
1620 switch(cutDefinition) {
2d109362 1621 case kPIDqa:
359a5e52 1622 return;
6720a01a 1623 //die->AddSignalMC(directElec);
2d109362 1624 break;
79284309 1625 case kRec:
1626 die->AddSignalMC(inclusiveJpsi);
1627 die->AddSignalMC(directJpsi);
1628 break;
6720a01a 1629 case kStd:
79284309 1630 die->AddSignalMC(inclusiveJpsi);
1631 // die->AddSignalMC(beautyJpsi);
1632 //die->AddSignalMC(promptJpsi);
1633 //die->AddSignalMC(promptJpsiRad);
1634 //die->AddSignalMC(promptJpsiNonRad);
1635 die->AddSignalMC(directJpsi);
1636 // die->AddSignalMC(gammaConversion);
1637 break;
359a5e52
JB
1638 case kAvgPt:
1639 die->AddSignalMC(inclusiveJpsi);
6720a01a 1640 // die->AddSignalMC(directJpsi);
359a5e52 1641 break;
79284309 1642 case kLegEff:
2d109362
JB
1643 // die->AddSignalMC(directJpsi);
1644 // die->AddSignalMC(inclusiveJpsi);
1645 // die->AddSignalMC(electrons);
1646 // die->AddSignalMC(elecPrim);
1647 die->AddSignalMC(directElec);
1648 //for(Int_t i=0; i<7; i++) die->AddSignalMC(directP[i]);
1649 break;
1650 default:
79284309 1651 die->AddSignalMC(directJpsi);
79284309 1652 break;
8c06b662 1653 }
1654
8c06b662 1655
79284309 1656}
1657
6720a01a 1658void SetEtaCorrection(AliDielectron *die) {
359a5e52 1659
79284309 1660
6720a01a 1661 // if(cutDefinition==kLegEff) return;
1662 // if (pid->GetCentroidCorrFunction()) return;
1663 Bool_t hasMC=die->GetHasMC();
1664 Bool_t hasTuneOnData=kFALSE;
1665 // ((AliAnalysisTaskPIDResponse*)AliAnalysisManager::GetAnalysisManager()->GetTasks()->At(0))->GetTuneOnData();
1666 printf("tune on data switched: %d \n",hasTuneOnData);
1667 // printf("name task at 0: %s \n",AliAnalysisManager::GetAnalysisManager()->GetTasks()->At(0)->GetName());
1668 // printf("input event %p \n", AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
1669 // printf("pid response %p \n",((AliInputEventHandler*)AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler())->GetPIDResponse());
1670 // printf("pid response task %p \n",AliAnalysisManager::GetAnalysisManager()->GetTasks()->At(0));
1671 // AliAnalysisManager::GetAnalysisManager()->GetTasks()->At(0)->Dump();;
1672
1673 // AliAnalysisManager* man = AliAnalysisManager::GetAnalysisManager();
1674 // AliInputEventHandler* inputHandler = dynamic_cast<AliInputEventHandler*>(man->GetInputEventHandler());
1675 // AliPIDResponse* pidResponse = inputHandler->GetPIDResponse();
1676 // if(pidResponse) hasTuneOnData = pidResponse->IsTunedOnData();
1677 // printf("man %p inp %p pid %p ====> %d \n",man,inputHandler,pidResponse,hasTuneOnData);
79284309 1678
1679 TF2 *fCntrdCorr=0x0;
1680 TF1 *fWdthCorr=0x0;
1681 /* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv DATA vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */
1682 // either data or MC with tune on data option
6720a01a 1683 if( !hasMC /*|| hasTuneOnData*/ ) {
79284309 1684 // 2-dimensional eta correction for the centroid of electron sigmas
359a5e52
JB
1685 fCntrdCorr = new TF2("fCntrdCorr",
1686 "[0] + [1]*y + [2]*y*y + [3]*TMath::Power(y,3) + [4]*TMath::Power(y,4) + [5]*TMath::Power(y,5) + [6]*TMath::Power(y,6) + [7]*x",
79284309 1687 // 0.0, 3000.0, -0.9, +0.9);
1688 0.0, 90.0, -0.9, +0.9);
359a5e52
JB
1689 // fCntrdCorr->SetParameters(0.723106, 0.23958, -6.31221, -0.687976, 15.912, 0.579609, -11.6901, -0.000354381); //Nacc dep.
1690 fCntrdCorr->SetParameters(+0.149002, +0.214644 , -6.034930, -0.529588, +14.97902, +0.402640, -10.890027, +0.011248); //Cent
79284309 1691
1692 // 1-dimensional eta correction for the width of electron sigmas
1693 fWdthCorr = new TF1("fWdthCorr", "pol2", 0.0, 90.0);
1694 // fWdthCorr->SetParameters(1.06108, 0.000217804,-5.80291e-08); //Nacc dep.
1695 fWdthCorr->SetParameters(+1.290755, -0.005261, +0.000021); //Cent dep.
1696
1697 // apply corrections
6720a01a 1698 // die->SetCentroidCorrFunction(fCntrdCorr,AliDielectronVarManager::kNacc,AliDielectronVarManager::kEta);
1699 // die->SetWidthCorrFunction(fWdthCorr,AliDielectronVarManager::kNacc);
1700 die->SetCentroidCorrFunction(fCntrdCorr,AliDielectronVarManager::kCentrality,AliDielectronVarManager::kEta);
1701 die->SetWidthCorrFunction(fWdthCorr,AliDielectronVarManager::kCentrality);
79284309 1702 printf(" DATA PID correction loaded!!!\n");
8c06b662 1703 }
79284309 1704 else {
1705 /* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv MONTE CARLO vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */
6720a01a 1706 // 2-dimensional eta correction for the centroid and width of electron sigmas
1707 fCntrdCorr = new TF2("fCntrdCorr",
1708 "[0] + [1]*y + [2]*y*y + [3]*TMath::Power(y,3) + [4]*TMath::Power(y,4) + [5]*TMath::Power(y,5) + [6]*TMath::Power(y,6) + [7]*x",
1709 0.0, 3000.0, -0.9, +0.9);
1710 fCntrdCorr->SetParameters(+0.293718,
1711 +0.010037,
1712 -2.632949,
1713 -0.241412,
1714 +8.304244,
1715 +0.525481,
1716 -4.874357,
1717 -0.000103); //TPCrefMult dep.
1718 fWdthCorr = new TF2("fWdthCorr",
1719 "[0] + [1]*y + [2]*y*y + [3]*TMath::Power(y,3) + [4]*TMath::Power(y,4) + [5]*TMath::Power(y,5) + [6]*TMath::Power(y,6) + [7]*x",
1720 0.0, 3000.0, -0.9, +0.9);
1721 fWdthCorr->SetParameters(+0.917840,
1722 -0.021500,
1723 -0.628371,
1724 +0.230847,
1725 +1.434907,
1726 -0.330751,
1727 -0.458941,
1728 +0.000036); //TPCrefMult dep.
1729
1730 // apply corrections
1731 die->SetCentroidCorrFunction(fCntrdCorr,
1732 AliDielectronVarManager::kRefMultTPConly,
1733 AliDielectronVarManager::kEta);
1734 die->SetWidthCorrFunction(fWdthCorr,
1735 AliDielectronVarManager::kRefMultTPConly,
1736 AliDielectronVarManager::kEta);
1737 /*
79284309 1738 // 2-dimensional eta correction for the centroid of electron sigmas
1739 fCntrdCorr = new TF2("fCntrdCorr", "[0] + [1]*y + [2]*y*y + [3]*TMath::Power(y,3) + [4]*TMath::Power(y,4) + [5]*TMath::Power(y,5) + [6]*TMath::Power(y,6) + [7]*x",
1740 0.0, 3000.0, -0.9, +0.9);
1741 fCntrdCorr->SetParameters(+0.378611, -0.070831, -3.076778, +0.121977, +8.576097, +0.113009, -5.001368, -0.000181);
1742 // 1-dimensional eta correction for the width of electron sigmas
1743 fWdthCorr = new TF1("fWdthCorr", "pol1", 0.0, 3000.0);
1744 fWdthCorr->SetParameters(+0.881894, +0.000053);
1745
1746 // apply corrections
6720a01a 1747 die->SetCentroidCorrFunction(fCntrdCorr,AliDielectronVarManager::kNacc,AliDielectronVarManager::kEta);
1748 die->SetWidthCorrFunction(fWdthCorr,AliDielectronVarManager::kNacc);
1749 // die->SetCentroidCorrFunction(fCntrdCorr,AliDielectronVarManager::kCentrality,AliDielectronVarManager::kEta);
1750 // die->SetWidthCorrFunction(fWdthCorr,AliDielectronVarManager::kCentrality);
1751 */
359a5e52 1752 printf(" MC PID correction loaded!!!\n");
79284309 1753 }
1754
1755
8c06b662 1756}
1757
79284309 1758TVectorD *GetRunNumbers2011() {
d28542ba 1759
1760 Double_t runLHC10h[] = { // all good runs based on RCT 29.Mai
1761 139510, 139507, 139505, 139503, 139465, 139438, 139437, 139360, 139329, 139328, 139314, 139310, 139309, 139173, 139107, 139105, 139038, 139037, 139036, 139029, 139028, 138872, 138871, 138870, 138837, 138732, 138730, 138666, 138662, 138653, 138652, 138638, 138624, 138621, 138583, 138582, 138579, 138578, 138534, 138469, 138442, 138439, 138438, 138396, 138364, 138275, 138225, 138201, 138197, 138192, 138190, 137848, 137844, 137752, 137751, 137724, 137722, 137718, 137704, 137693, 137692, 137691, 137686, 137685, 137639, 137638, 137608, 137595, 137549, 137546, 137544, 137541, 137539, 137531, 137530, 137443, 137441, 137440, 137439, 137434, 137432, 137431, 137430, 137366, 137243, 137236, 137235, 137232, 137231, 137230, 137162, 137161, 137135
8c06b662 1762 };
d28542ba 1763 Double_t runLHC11h[] = { // all good runs based on RCT 29.Mai
79284309 1764 167915, 167920, 167985, 167987, 167988, 168069, 168076, 168105, 168107, 168108, 168115, 168310, 168311, 168322, 168325, 168341, 168342, 168361, 168362, 168458, 168460, 168464, 168467, 168511, 168512, 168514, 168777, 168826, 168988, 168992, 169035, 169040, 169044, 169045, 169091, 169094, 169099, 169138, 169144, 169145, 169148, 169156, 169160, 169167, 169238, 169411, 169415, 169417, 169418, 169419, 169420, 169475, 169498, 169504, 169506, 169512, 169515, 169550, 169553, 169554, 169555, 169557, 169586, 169587, 169588, 169590, 169591, 169835, 169837, 169838, 169846, 169855, 169858, 169859, 169923, 169965, 170027, 170040, 170081, 170083, 170084, 170085, 170088, 170089, 170091, 170155, 170159, 170163, 170193, 170203, 170204, 170207, 170228, 170230, 170268, 170269, 170270, 170306, 170308, 170309, 170311, 170312, 170313, 170315, 170387, 170388, 170572, 170593,
1765 170593+1
d28542ba 1766 };
79284309 1767 /*
2d7910f3 1768 if(list.Contains("LHC10h") || list.Contains("LHC11a10")) {
2d7910f3 1769 if( list.Contains("LHC11h") || list.Contains("LHC12a17") ) {
79284309 1770 */
1771 Int_t size = (int) (sizeof(runLHC11h)/sizeof(Double_t));
1772 TVectorD *vec = new TVectorD(size,runLHC11h);
1773 //vec->Print("");
256b2ae5 1774 return vec;
8c06b662 1775}
2ed1b6ff 1776
2d109362
JB
1777TVectorD *GetPDGcodes() {
1778 //
1779 // array of pdgcodes stored in TDatabasePDG
1780 //
1781 TDatabasePDG *pdg = new TDatabasePDG();
1782 pdg->ReadPDGTable();
1783 TGraph *gr = new TGraph();
1784 TIter next(pdg->ParticleList());
1785 TParticlePDG *p;
1786 Int_t i=0;
1787 while ((p = (TParticlePDG *)next())) {
1788 if(TMath::Abs(p->PdgCode()) < 1e+6) {
1789 // printf("%s -> %d \n",p->GetName(),p->PdgCode());
1790 gr->SetPoint(i++, p->PdgCode(),1.);
1791 }
1792 }
1793 gr->Sort();
1794 TVectorD *vec = new TVectorD(gr->GetN(), gr->GetX());
1795 // vec->Print();
1796 delete pdg;
1797 delete gr;
1798 return vec;
1799
1800}
1801
2ed1b6ff 1802TVectorD *GetDeltaPhiBins() {
1803 //
1804 // for in and out of event plane bins
1805 //
1806 Double_t pi = TMath::Pi();
1807 TVectorD *deltaPhi = new TVectorD(6);
1808 (*deltaPhi)[0] = -1. *pi;
1809 (*deltaPhi)[1] = -3./4. *pi;
1810 (*deltaPhi)[2] = -1./4. *pi;
1811 (*deltaPhi)[3] = +1./4. *pi;
1812 (*deltaPhi)[4] = +3./4. *pi;
1813 (*deltaPhi)[5] = +1. *pi;
1814 return deltaPhi;
1815}