Fix coverity defect 24647
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliAnalysisTaskSELc2V0bachelor.cxx
CommitLineData
992ba7d8 1/**************************************************************************
2 * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appeuear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id$ */
17
18//
19//
20// Base class for Lc2V0 Analysis
21//
22//
23// The Lc spectra study is done 2D histograms:
24// cascade_invariantMass VS cascade_pT
25//
26// Cuts have been centralized in AliRDHFCutsLctoV0 class
27//
28//-------------------------------------------------------------------------
29//
30// Authors: A.De Caro(a,b), P. Pagano(b)
e7af8919 31// (a) Centro 'E.Fermi' - Roma
32// (b) INFN and University of Salerno
992ba7d8 33//
e7af8919 34// Contatcs: decaro@sa.infn.it
35// paola.pagano@sa.infn.it
992ba7d8 36//-------------------------------------------------------------------------
37
38#include <TSystem.h>
39#include <TParticle.h>
40#include <TParticlePDG.h>
41#include <TH1F.h>
42#include <TH2F.h>
516f546e 43#include <TH3F.h>
44#include <THnSparse.h>
a578b2da 45#include <TTree.h>
992ba7d8 46#include "TROOT.h"
47#include <TDatabasePDG.h>
48#include <AliAnalysisDataSlot.h>
49#include <AliAnalysisDataContainer.h>
50#include "AliStack.h"
51#include "AliMCEvent.h"
52#include "AliAnalysisManager.h"
53#include "AliAODMCHeader.h"
54#include "AliAODHandler.h"
55#include "AliLog.h"
43c7bace 56#include "AliExternalTrackParam.h"
992ba7d8 57#include "AliAODVertex.h"
58#include "AliAODRecoDecay.h"
59#include "AliAODRecoDecayHF.h"
60#include "AliAODRecoCascadeHF.h"
61#include "AliAnalysisVertexingHF.h"
62#include "AliESDtrack.h"
63#include "AliAODTrack.h"
64#include "AliAODv0.h"
65#include "AliAODMCParticle.h"
66#include "AliAnalysisTaskSE.h"
67#include "AliAnalysisTaskSELc2V0bachelor.h"
68#include "AliNormalizationCounter.h"
69#include "AliAODPidHF.h"
992ba7d8 70#include "AliInputEventHandler.h"
43c7bace 71#include "AliESDtrackCuts.h"
72#include "AliNeutralTrackParam.h"
992ba7d8 73
c64cb1f6 74using std::cout;
75using std::endl;
76
992ba7d8 77ClassImp(AliAnalysisTaskSELc2V0bachelor)
78
79//__________________________________________________________________________
43c7bace 80AliAnalysisTaskSELc2V0bachelor::AliAnalysisTaskSELc2V0bachelor() : AliAnalysisTaskSE(),
992ba7d8 81 fUseMCInfo(kFALSE),
82 fOutput(0),
83 fOutputAll(0),
84 fOutputPIDBach(0),
85 fCEvents(0),
43c7bace 86 fIsK0SAnalysis(kFALSE),
992ba7d8 87 fCounter(0),
992ba7d8 88 fAnalCuts(0),
0dbd1d4f 89 fUseOnTheFlyV0(kFALSE),
a578b2da 90 fIsEventSelected(kFALSE),
91 fWriteVariableTree(kFALSE),
92 fVariablesTree(0),
93 fCandidateVariables(),
94 fVtx1(0),
43c7bace 95 fBzkG(0),
516f546e 96 fAdditionalChecks(kFALSE),
97 fTrackRotation(kFALSE),
98 fOutputPIDBachTR(0),
99 fMinAngleForRot(5*TMath::Pi()/6),
100 fMaxAngleForRot(7*TMath::Pi()/6),
101 fMinMass(0),
102 fMaxMass(0),
b833016c 103 fNRotations(9),
104 fPtMinToFillTheTree(0.),
105 fPtMaxToFillTheTree(999.)
992ba7d8 106{
107 //
108 // Default ctor
109 //
516f546e 110
111 Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
112 fMinMass=mLcPDG-0.250;
113 fMaxMass=mLcPDG+0.250;
114
992ba7d8 115}
116//___________________________________________________________________________
43c7bace 117AliAnalysisTaskSELc2V0bachelor::AliAnalysisTaskSELc2V0bachelor(const Char_t* name,
a578b2da 118 AliRDHFCutsLctoV0* analCuts, Bool_t useOnTheFly,
516f546e 119 Bool_t writeVariableTree, Bool_t additionalChecks, Bool_t trackRotation) :
992ba7d8 120 AliAnalysisTaskSE(name),
121 fUseMCInfo(kFALSE),
122 fOutput(0),
123 fOutputAll(0),
124 fOutputPIDBach(0),
125 fCEvents(0),
43c7bace 126 fIsK0SAnalysis(kFALSE),
992ba7d8 127 fCounter(0),
992ba7d8 128 fAnalCuts(analCuts),
0dbd1d4f 129 fUseOnTheFlyV0(useOnTheFly),
a578b2da 130 fIsEventSelected(kFALSE),
131 fWriteVariableTree(writeVariableTree),
132 fVariablesTree(0),
133 fCandidateVariables(),
134 fVtx1(0),
43c7bace 135 fBzkG(0),
516f546e 136 fAdditionalChecks(additionalChecks),
137 fTrackRotation(trackRotation),
138 fOutputPIDBachTR(0),
139 fMinAngleForRot(5*TMath::Pi()/6),
140 fMaxAngleForRot(7*TMath::Pi()/6),
141 fMinMass(0),
142 fMaxMass(0),
b833016c 143 fNRotations(9),
144 fPtMinToFillTheTree(0.),
145 fPtMaxToFillTheTree(999.)
992ba7d8 146{
147 //
148 // Constructor. Initialization of Inputs and Outputs
149 //
150 Info("AliAnalysisTaskSELc2V0bachelor","Calling Constructor");
151
b833016c 152 if (fWriteVariableTree && fTrackRotation) {
153 AliInfo(Form("You cannot initialize fWriteVariableTree=%d and fTrackRotation=%d => fTrackRotation=0",fWriteVariableTree,fTrackRotation));
154 fTrackRotation=kFALSE;
155 }
156
516f546e 157 Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
158 fMinMass=mLcPDG-0.250;
159 fMaxMass=mLcPDG+0.250;
160
992ba7d8 161 DefineOutput(1,TList::Class()); //conters
43c7bace 162 DefineOutput(2,AliNormalizationCounter::Class());
163 DefineOutput(3,AliRDHFCutsLctoV0::Class());
164 if (!writeVariableTree) {
165 DefineOutput(4,TList::Class()); //All Entries output
166 DefineOutput(5,TList::Class()); //3sigma PID output
516f546e 167 if (trackRotation) {
168 DefineOutput(6,TList::Class()); //All Entries output
169 }
43c7bace 170 } else {
171 // Output slot #4 keeps a tree of the candidate variables after track selection
172 DefineOutput(4,TTree::Class()); //My private output
173 }
a578b2da 174
992ba7d8 175}
176
177//___________________________________________________________________________
178AliAnalysisTaskSELc2V0bachelor::~AliAnalysisTaskSELc2V0bachelor() {
179 //
180 // destructor
181 //
182 Info("~AliAnalysisTaskSELc2V0bachelor","Calling Destructor");
183
184 if (fOutput) {
185 delete fOutput;
186 fOutput = 0;
187 }
188
189 if (fOutputAll) {
190 delete fOutputAll;
191 fOutputAll = 0;
192 }
193
194 if (fOutputPIDBach) {
195 delete fOutputPIDBach;
196 fOutputPIDBach = 0;
197 }
198
992ba7d8 199 if (fCounter) {
200 delete fCounter;
201 fCounter = 0;
202 }
203
992ba7d8 204 if (fAnalCuts) {
205 delete fAnalCuts;
206 fAnalCuts = 0;
207 }
208
43c7bace 209 if (fVariablesTree) {
a578b2da 210 delete fVariablesTree;
211 fVariablesTree = 0;
212 }
213
516f546e 214 if (fOutputPIDBachTR) {
215 delete fOutputPIDBachTR;
216 fOutputPIDBachTR = 0;
217 }
218
992ba7d8 219}
220//_________________________________________________
221void AliAnalysisTaskSELc2V0bachelor::Init() {
222 //
223 // Initialization
224 //
225
0dbd1d4f 226 fIsEventSelected=kFALSE;
227
992ba7d8 228 if (fDebug > 1) AliInfo("Init");
229
43c7bace 230 PostData(3,fAnalCuts);
992ba7d8 231
232 return;
233}
234
235//_________________________________________________
236void AliAnalysisTaskSELc2V0bachelor::UserExec(Option_t *)
237{
238 // user exec
239 if (!fInputEvent) {
240 AliError("NO EVENT FOUND!");
241 return;
242 }
243
244 AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
245 TClonesArray *arrayLctopKos=0;
246
247 if (!aodEvent && AODEvent() && IsStandardAOD()) {
248 // In case there is an AOD handler writing a standard AOD, use the AOD
249 // event in memory rather than the input (ESD) event.
250 aodEvent = dynamic_cast<AliAODEvent*> (AODEvent());
251 // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
252 // have to taken from the AOD event hold by the AliAODExtension
253 AliAODHandler* aodHandler = (AliAODHandler*)
254 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
43c7bace 255
992ba7d8 256 if (aodHandler->GetExtensions()) {
257 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
258 AliAODEvent *aodFromExt = ext->GetAOD();
259 arrayLctopKos=(TClonesArray*)aodFromExt->GetList()->FindObject("CascadesHF");
260 }
261 } else {
262 arrayLctopKos=(TClonesArray*)aodEvent->GetList()->FindObject("CascadesHF");
263 }
264
265 fCEvents->Fill(1);
43c7bace 266
267 if (fUseMCInfo)
268 fAnalCuts->SetTriggerClass("");
992ba7d8 269
0dbd1d4f 270 // AOD primary vertex
a578b2da 271 fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
272 if (!fVtx1) return;
0dbd1d4f 273
43c7bace 274 fIsEventSelected = fAnalCuts->IsEventSelected(aodEvent); // better to initialize before CheckEventSelection call
275
276 CheckEventSelection(aodEvent);
277
278
992ba7d8 279 // fix for temporary bug in ESDfilter
a578b2da 280 fBzkG = (Double_t)aodEvent->GetMagneticField();
281 if (TMath::Abs(fBzkG)<0.001) return;
992ba7d8 282 fCEvents->Fill(2);
283
992ba7d8 284 if (!arrayLctopKos) {
285 AliInfo("Could not find array of HF cascades, skipping the event");
286 return;
287 } else {
0dbd1d4f 288 if (arrayLctopKos->GetEntriesFast()) {
992ba7d8 289 AliInfo(Form("Found %d cascades",arrayLctopKos->GetEntriesFast()));
290 }
291 }
43c7bace 292 fCEvents->Fill(3);
992ba7d8 293
294 // mc analysis
295 TClonesArray *mcArray = 0;
296 AliAODMCHeader *mcHeader=0;
297
298 if (fUseMCInfo) {
299 // MC array need for maching
300 mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
301 if (!mcArray) {
302 AliError("Could not find Monte-Carlo in AOD");
303 return;
304 }
43c7bace 305 fCEvents->Fill(4); // in case of MC events
992ba7d8 306
307 // load MC header
308 mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
309 if (!mcHeader) {
310 AliError("AliAnalysisTaskSELc2V0bachelor::UserExec: MC header branch not found!\n");
311 return;
312 }
43c7bace 313 fCEvents->Fill(5); // in case of MC events
53c91ed7 314
315 Double_t zMCVertex = mcHeader->GetVtxZ();
316 if (TMath::Abs(zMCVertex) > fAnalCuts->GetMaxVtxZ()) {
317 AliDebug(2,Form("Event rejected: abs(zVtxMC)=%f > fAnalCuts->GetMaxVtxZ()=%f",zMCVertex,fAnalCuts->GetMaxVtxZ()));
318 return;
319 } else {
320 fCEvents->Fill(17); // in case of MC events
321 }
992ba7d8 322 }
323
43c7bace 324 fCounter->StoreEvent(aodEvent,fAnalCuts,fUseMCInfo); // it is very important that it stays BEFORE any other event selection
0dbd1d4f 325
43c7bace 326 if (fVtx1->GetNContributors()>0) // this check is done in IsEventSelected
327 fCEvents->Fill(6);
0dbd1d4f 328
43c7bace 329 if ( !fIsEventSelected ) return; // don't take into account not selected events
330 fCEvents->Fill(7);
0dbd1d4f 331
43c7bace 332 Int_t nSelectedAnal = 0;
333 if (fIsK0SAnalysis) {
334 MakeAnalysisForLc2prK0S(arrayLctopKos,mcArray, nSelectedAnal, fAnalCuts);
0dbd1d4f 335
43c7bace 336 if (nSelectedAnal)
337 CheckEventSelectionWithCandidates(aodEvent);
0dbd1d4f 338
339 }
340
43c7bace 341 fCounter->StoreCandidates(aodEvent,nSelectedAnal,kTRUE);
992ba7d8 342 fCounter->StoreCandidates(aodEvent,nSelectedAnal,kFALSE);
343
344 PostData(1,fOutput);
43c7bace 345 PostData(2,fCounter);
346 if (!fWriteVariableTree) {
347 PostData(4,fOutputAll);
348 PostData(5,fOutputPIDBach);
516f546e 349 if (fTrackRotation)
350 PostData(6,fOutputPIDBachTR);
43c7bace 351 } else {
352 PostData(4,fVariablesTree);
353 }
354
355 fIsEventSelected=kFALSE;
992ba7d8 356
43c7bace 357 return;
992ba7d8 358}
43c7bace 359
992ba7d8 360//________________________________________ terminate ___________________________
361void AliAnalysisTaskSELc2V0bachelor::Terminate(Option_t*)
362{
363 // The Terminate() function is the last function to be called during
364 // a query. It always runs on the client, it can be used to present
365 // the results graphically or save the results to file.
366
367 //AliInfo("Terminate","");
368 AliAnalysisTaskSE::Terminate();
369
370 fOutput = dynamic_cast<TList*> (GetOutputData(1));
371 if (!fOutput) {
372 AliError("fOutput not available");
373 return;
374 }
375
a578b2da 376 //fCEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fCEvents"));
43c7bace 377 if (!fWriteVariableTree) {
378 fOutputAll = dynamic_cast<TList*> (GetOutputData(4));
379 if (!fOutputAll) {
380 AliError("fOutputAll not available");
381 return;
382 }
992ba7d8 383
43c7bace 384 fOutputPIDBach = dynamic_cast<TList*> (GetOutputData(5));
385 if (!fOutputPIDBach) {
386 AliError("fOutputPIDBach not available");
387 return;
388 }
516f546e 389
390 if (fTrackRotation) {
391 fOutputPIDBachTR = dynamic_cast<TList*> (GetOutputData(6));
392 if (!fOutputPIDBachTR) {
393 AliError("fOutputPIDBachTR not available");
394 return;
395 }
396 }
397
b833016c 398 } else {
399 fVariablesTree = dynamic_cast<TTree*> (GetOutputData(4));
400 if (!fVariablesTree) {
401 AliError("fVariablesTree not available");
402 return;
403 }
992ba7d8 404 }
405
406 return;
407}
408//___________________________________________________________________________
409void AliAnalysisTaskSELc2V0bachelor::UserCreateOutputObjects() {
410 // output
411 AliInfo(Form("CreateOutputObjects of task %s\n", GetName()));
992ba7d8 412
43c7bace 413 fOutput = new TList();
414 fOutput->SetOwner();
415 fOutput->SetName("chist0");
416 DefineGeneralHistograms(); // define general histograms
992ba7d8 417 PostData(1,fOutput);
992ba7d8 418
419 fCounter = new AliNormalizationCounter("NormalizationCounter");
420 fCounter->Init();
43c7bace 421 PostData(2,fCounter);
422
423 if (!fWriteVariableTree) {
424
425 fOutputAll = new TList();
426 fOutputAll->SetOwner();
427 fOutputAll->SetName("listAll");
428
429 fOutputPIDBach = new TList();
430 fOutputPIDBach->SetOwner();
431 fOutputPIDBach->SetName("listPIDBach");
432
516f546e 433 if (fTrackRotation) {
434 fOutputPIDBachTR = new TList();
435 fOutputPIDBachTR->SetOwner();
436 fOutputPIDBachTR->SetName("listPIDBachTR");
437 }
438
43c7bace 439 DefineAnalysisHistograms(); // define analysis histograms
440
441 PostData(4,fOutputAll);
442 PostData(5,fOutputPIDBach);
516f546e 443
444 if (fTrackRotation)
445 PostData(6,fOutputPIDBachTR);
446
43c7bace 447 }
448 else {
449 DefineTreeVariables();
450 PostData(4,fVariablesTree);
a578b2da 451 }
452
992ba7d8 453 return;
454}
992ba7d8 455
43c7bace 456//-------------------------------------------------------------------------------
457void AliAnalysisTaskSELc2V0bachelor::MakeAnalysisForLc2prK0S(TClonesArray *arrayLctopKos,
458 TClonesArray *mcArray,
459 Int_t &nSelectedAnal,
460 AliRDHFCutsLctoV0 *cutsAnal)
461{
992ba7d8 462
43c7bace 463 // make the analysis
992ba7d8 464
43c7bace 465 Int_t pdgCand = 4122;
466 Int_t pdgDgLctoV0bachelor[2]={2212,310}; // always 1st bachelor, 2nd V0
467 Int_t pdgDgV0toDaughters[2]={211,211};
992ba7d8 468
43c7bace 469 // loop over cascades to search for candidates Lc->p+K0S
470 Int_t nCascades= arrayLctopKos->GetEntriesFast();
471 if (nCascades==0) {
472 AliInfo("Could not find cascades, skipping the event");
473 return;
474 }
992ba7d8 475
43c7bace 476 for (Int_t iLctopK0S = 0; iLctopK0S<nCascades; iLctopK0S++) {
992ba7d8 477
43c7bace 478 ((TH1F*)(fOutput->FindObject("hCandidateSelection")))->Fill(0);
992ba7d8 479
43c7bace 480 // Lc candidates and K0S from Lc
481 AliAODRecoCascadeHF* lcK0Spr = dynamic_cast<AliAODRecoCascadeHF*>(arrayLctopKos->At(iLctopK0S));
482 if (!lcK0Spr) {
483 AliDebug(2,Form("Cascade %d doens't exist, skipping",iLctopK0S));
484 continue;
485 }
a578b2da 486
53c91ed7 487 Bool_t unsetvtx=kFALSE;
488 if (!lcK0Spr->GetOwnPrimaryVtx()) {
489 lcK0Spr->SetOwnPrimaryVtx(fVtx1);
490 unsetvtx=kTRUE;
491 }
492
43c7bace 493 if (!lcK0Spr->GetSecondaryVtx()) {
494 AliInfo("No secondary vertex"); // it will be done in AliRDHFCutsLctoV0::IsSelected
495 continue;
496 }
a578b2da 497
43c7bace 498 if (lcK0Spr->GetNDaughters()!=2) {
499 AliDebug(2,Form("Cascade %d has not 2 daughters (nDaughters=%d)",iLctopK0S,lcK0Spr->GetNDaughters())); // it will be done in AliRDHFCutsLctoV0::IsSelected
500 continue;
501 }
a578b2da 502
43c7bace 503 AliAODv0 * v0part = dynamic_cast<AliAODv0*>(lcK0Spr->Getv0());
504 AliAODTrack * bachPart = dynamic_cast<AliAODTrack*>(lcK0Spr->GetBachelor());
505 if (!v0part || !bachPart) {
506 AliDebug(2,Form("Cascade %d has no V0 or no bachelor object",iLctopK0S)); // it will be done in AliRDHFCutsLctoV0::IsSelected
507 continue;
508 }
a578b2da 509
43c7bace 510 if (!v0part->GetSecondaryVtx()) {
511 AliDebug(2,Form("No secondary vertex for V0 by cascade %d",iLctopK0S)); // it will be done in AliRDHFCutsLctoV0::IsSelected
512 continue;
513 }
a578b2da 514
43c7bace 515 if (v0part->GetNDaughters()!=2) {
516 AliDebug(2,Form("current V0 has not 2 daughters (onTheFly=%d, nDaughters=%d)",v0part->GetOnFlyStatus(),v0part->GetNDaughters())); // it will be done in AliRDHFCutsLctoV0::IsSelected
517 continue;
518 }
a578b2da 519
43c7bace 520 AliAODTrack * v0Pos = dynamic_cast<AliAODTrack*>(lcK0Spr->Getv0PositiveTrack());
521 AliAODTrack * v0Neg = dynamic_cast<AliAODTrack*>(lcK0Spr->Getv0NegativeTrack());
91ec9084 522 if (!v0Neg || !v0Pos) {
43c7bace 523 AliDebug(2,Form("V0 by cascade %d has no V0positive of V0negative object",iLctopK0S)); // it will be done in AliRDHFCutsLctoV0::IsSelected
524 continue;
525 }
a578b2da 526
43c7bace 527 ((TH1F*)(fOutput->FindObject("hCandidateSelection")))->Fill(1);
a578b2da 528
43c7bace 529 if (v0Pos->Charge() == v0Neg->Charge()) continue;
a578b2da 530
43c7bace 531 ((TH1F*)(fOutput->FindObject("hCandidateSelection")))->Fill(2);
a578b2da 532
43c7bace 533 Int_t isLc = 0;
a578b2da 534
43c7bace 535 if (fUseMCInfo) {
a578b2da 536
43c7bace 537 Int_t pdgCode=-2;
a578b2da 538
43c7bace 539 // find associated MC particle for Lc -> p+K0 and K0S->pi+pi
540 Int_t mcLabel = lcK0Spr->MatchToMC(pdgCand,pdgDgLctoV0bachelor[1],pdgDgLctoV0bachelor,pdgDgV0toDaughters,mcArray,kTRUE);
541 if (mcLabel!=-1) {
542 AliDebug(2,Form(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cascade number %d (total cascade number = %d)", iLctopK0S,nCascades));
0dbd1d4f 543
43c7bace 544 AliAODMCParticle *partLc = dynamic_cast<AliAODMCParticle*>(mcArray->At(mcLabel));
545 if (partLc) {
546 pdgCode = partLc->GetPdgCode();
547 if (pdgCode<0) AliDebug(2,Form(" ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ MClabel=%d ~~~~~~~~~~ pdgCode=%d", mcLabel, pdgCode));
548 pdgCode = TMath::Abs(pdgCode);
549 isLc = 1;
550 }
551 } else {
53c91ed7 552 AliDebug(2,Form("No MC candidate (cascade number %d -total cascade number = %d -)", iLctopK0S,nCascades));
43c7bace 553 pdgCode=-1;
554 }
555 }
0dbd1d4f 556
43c7bace 557 FillLc2pK0Sspectrum(lcK0Spr, isLc,
558 nSelectedAnal, cutsAnal,
559 mcArray);
53c91ed7 560
561 if (unsetvtx) lcK0Spr->UnsetOwnPrimaryVtx();
562
43c7bace 563 }
0dbd1d4f 564
43c7bace 565 AliDebug(2, Form("Found %d Reco particles that are Lc!!", nSelectedAnal));
992ba7d8 566
567 return;
568}
43c7bace 569
992ba7d8 570//________________________________________________________________________
571void AliAnalysisTaskSELc2V0bachelor::FillLc2pK0Sspectrum(AliAODRecoCascadeHF *part,
a578b2da 572 Int_t isLc,
a578b2da 573 Int_t &nSelectedAnal,
574 AliRDHFCutsLctoV0 *cutsAnal,
575 TClonesArray *mcArray)
992ba7d8 576{
577 //
578 // Fill histos for Lc -> K0S+proton
579 //
992ba7d8 580
581 TString fillthis="";
582
43c7bace 583 AliAODTrack *bachelor = (AliAODTrack*)part->GetBachelor();
584 Double_t momBach = bachelor->P();
992ba7d8 585
586 AliAODv0 * v0part = (AliAODv0*)part->Getv0();
587 Bool_t onFlyV0 = v0part->GetOnFlyStatus(); // on-the-flight V0s
43c7bace 588
589 Bool_t areCutsUsingPID = cutsAnal->GetIsUsePID();
590 cutsAnal->SetUsePID(kFALSE);
a578b2da 591 Bool_t isInCascadeWindow = (((cutsAnal->IsSelectedSingleCut(part,AliRDHFCuts::kCandidate,0))&(AliRDHFCutsLctoV0::kLcToK0Spr))==(AliRDHFCutsLctoV0::kLcToK0Spr)); // cut on Lc->p+K0S invMass
43c7bace 592 cutsAnal->SetUsePID(areCutsUsingPID);
992ba7d8 593
43c7bace 594 if ( onFlyV0 && !fUseOnTheFlyV0 ) return;
0dbd1d4f 595
43c7bace 596 if (fAdditionalChecks) CheckCandidatesAtDifferentLevels(part,cutsAnal);
a578b2da 597
516f546e 598 // track rotation
599 if (fTrackRotation) {
600 if (onFlyV0) {
601 TrackRotation(cutsAnal,part,"");
602 }
603 else {
604 TrackRotation(cutsAnal,part,"Offline");
605 }
606 if (fUseMCInfo) {
607 if (isLc==1) {
608 if (onFlyV0) {
609 TrackRotation(cutsAnal,part,"Sgn");
610 }
611 else {
612 TrackRotation(cutsAnal,part,"OfflineSgn");
613 }
614 }// sgn
615 else { // bkg
616 if (onFlyV0) {
617 TrackRotation(cutsAnal,part,"Bkg");
618 }
619 else {
620 TrackRotation(cutsAnal,part,"OfflineBkg");
621 }
622 }
623 } // if fUseMCInfo
624 } // if fTrackRotation
625
626
627
628
43c7bace 629 if ( !(cutsAnal->IsInFiducialAcceptance(part->Pt(),part->Y(4122))) ) return;
a578b2da 630
53c91ed7 631 if ( !( ( (cutsAnal->IsSelected(part,AliRDHFCuts::kTracks))&(AliRDHFCutsLctoV0::kLcToK0Spr)) == (AliRDHFCutsLctoV0::kLcToK0Spr) ) ) return;
632
43c7bace 633 if ( ( ( (cutsAnal->IsSelected(part,AliRDHFCuts::kAll))&(AliRDHFCutsLctoV0::kLcToK0Spr)) == (AliRDHFCutsLctoV0::kLcToK0Spr) ) ) nSelectedAnal++;
a578b2da 634
43c7bace 635 // Fill candidate variable Tree (track selection, V0 invMass selection)
636 if ( fWriteVariableTree ) {
637 Double_t invmassK0S = v0part->MassK0Short();
638 Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
b833016c 639 if ( !onFlyV0 && isInCascadeWindow &&
640 part->CosV0PointingAngle()>0.99 && TMath::Abs(invmassK0S-mk0sPDG)<=0.05 &&
641 part->Pt()>=fPtMinToFillTheTree && part->Pt()<fPtMaxToFillTheTree)
43c7bace 642 FillTheTree(part,cutsAnal,mcArray,isLc);
643 return;
a578b2da 644 }
992ba7d8 645
43c7bace 646 cutsAnal->SetUsePID(kFALSE);
647 Bool_t isCandidateSelectedCuts = (((cutsAnal->IsSelected(part,AliRDHFCuts::kCandidate))&(AliRDHFCutsLctoV0::kLcToK0Spr))==(AliRDHFCutsLctoV0::kLcToK0Spr)); // kinematic/topological cuts
648 cutsAnal->SetUsePID(areCutsUsingPID);
649 Bool_t isBachelorID = (((cutsAnal->IsSelected(part,AliRDHFCuts::kPID))&(AliRDHFCutsLctoV0::kLcToK0Spr))==(AliRDHFCutsLctoV0::kLcToK0Spr)); // ID x bachelor
0dbd1d4f 650
43c7bace 651 //if (((cutsAnal->IsSelected(part,AliRDHFCuts::kCandidate))&AliRDHFCutsLctoV0::kLcToK0Spr)==AliRDHFCutsLctoV0::kLcToK0Spr) {
652 if (((cutsAnal->IsSelected(part,AliRDHFCuts::kAll))&AliRDHFCutsLctoV0::kLcToK0Spr)==AliRDHFCutsLctoV0::kLcToK0Spr) {
653 if (fUseMCInfo && isLc && !fWriteVariableTree) {
654 Int_t pdgCand1 = 4122;
655 Int_t pdgDgLctoV0bachelor1[2]={2212,310};
656 Int_t pdgDgV0toDaughters1[2]={211,211};
657 Int_t mcLabel1=part->MatchToMC(pdgCand1,pdgDgLctoV0bachelor1[1],pdgDgLctoV0bachelor1,pdgDgV0toDaughters1,mcArray,kTRUE);
658 AliDebug(2,Form(" Found true MC candidate: Lc->pK0S(%d) - onTheFly=%1d",mcLabel1,onFlyV0));
a578b2da 659 }
660 }
0dbd1d4f 661
a578b2da 662 Double_t nSigmaTPCpr=-999.;
663 cutsAnal->GetPidHF()->GetnSigmaTPC(bachelor,4,nSigmaTPCpr);
664 Double_t nSigmaTOFpr=-999.;
665 cutsAnal->GetPidHF()->GetnSigmaTOF(bachelor,4,nSigmaTOFpr);
666
a578b2da 667 Double_t nSigmaTPCpi=-999.;
668 cutsAnal->GetPidHF()->GetnSigmaTPC(bachelor,2,nSigmaTPCpi);
669 Double_t nSigmaTOFpi=-999.;
670 cutsAnal->GetPidHF()->GetnSigmaTOF(bachelor,2,nSigmaTOFpi);
671
a578b2da 672 Double_t nSigmaTPCka=-999.;
673 cutsAnal->GetPidHF()->GetnSigmaTPC(bachelor,3,nSigmaTPCka);
674 Double_t nSigmaTOFka=-999.;
675 cutsAnal->GetPidHF()->GetnSigmaTOF(bachelor,3,nSigmaTOFka);
676
43c7bace 677 if (onFlyV0) {
b833016c 678
679 fillthis="histArmPodK0S";
680 FillArmPodDistribution(v0part,fillthis,isCandidateSelectedCuts,isBachelorID);
681
682 fillthis="histArmPodLc";
683 FillArmPodDistribution(part,fillthis,isCandidateSelectedCuts,isBachelorID);
684
685 //if (isCandidateSelectedCuts) {
686 FillAnalysisHistograms(part,cutsAnal,"");
687 //}
992ba7d8 688 }
43c7bace 689 else {
b833016c 690
691 fillthis="histArmPodK0SOffline";
692 FillArmPodDistribution(v0part,fillthis,isCandidateSelectedCuts,isBachelorID);
693
694 fillthis="histArmPodLcOffline";
695 FillArmPodDistribution(part,fillthis,isCandidateSelectedCuts,isBachelorID);
696
697 FillAnalysisHistograms(part,cutsAnal,"Offline");
a578b2da 698 if (isCandidateSelectedCuts) {
a578b2da 699 fillthis="histoprotonBachSigmaVspTOF";
700 ((TH2F*)(fOutput->FindObject(fillthis)))->Fill(momBach,nSigmaTOFpr);
701 fillthis="histoprotonBachSigmaVspTPC";
702 ((TH2F*)(fOutput->FindObject(fillthis)))->Fill(momBach,nSigmaTPCpr);
b833016c 703 //FillAnalysisHistograms(part,cutsAnal,"Offline");
992ba7d8 704 }
705 }
992ba7d8 706 if (fUseMCInfo) {
707 if (isLc==1) {
43c7bace 708 if (onFlyV0) {
b833016c 709
710 fillthis="histArmPodK0SSgn";
711 FillArmPodDistribution(v0part,fillthis,isCandidateSelectedCuts,isBachelorID);
712
713 fillthis="histArmPodLcSgn";
714 FillArmPodDistribution(part,fillthis,isCandidateSelectedCuts,isBachelorID);
715
716 //if (isCandidateSelectedCuts) {
717 FillAnalysisHistograms(part,cutsAnal,"Sgn");
718 //}
992ba7d8 719 }
b833016c 720 else {
721
722 fillthis="histArmPodK0SOfflineSgn";
723 FillArmPodDistribution(v0part,fillthis,isCandidateSelectedCuts,isBachelorID);
724
725 fillthis="histArmPodLcOfflineSgn";
726 FillArmPodDistribution(part,fillthis,isCandidateSelectedCuts,isBachelorID);
727
728 FillAnalysisHistograms(part,cutsAnal,"OfflineSgn");
a578b2da 729 if (isCandidateSelectedCuts) {
a578b2da 730 fillthis="histoprotonBachSigmaVspTOFsgn";
731 ((TH2F*)(fOutput->FindObject(fillthis)))->Fill(momBach,nSigmaTOFpr);
732 fillthis="histoprotonBachSigmaVspTPCsgn";
733 ((TH2F*)(fOutput->FindObject(fillthis)))->Fill(momBach,nSigmaTPCpr);
b833016c 734 //FillAnalysisHistograms(part,cutsAnal,"OfflineSgn");
992ba7d8 735 }
992ba7d8 736 }
992ba7d8 737 }// sgn
738 else { // bkg
43c7bace 739 if (onFlyV0) {
b833016c 740
741 fillthis="histArmPodK0SBkg";
742 FillArmPodDistribution(v0part,fillthis,isCandidateSelectedCuts,isBachelorID);
743
744 fillthis="histArmPodLcBkg";
745 FillArmPodDistribution(part,fillthis,isCandidateSelectedCuts,isBachelorID);
746
747 //if (isCandidateSelectedCuts) {
748 FillAnalysisHistograms(part,cutsAnal,"Bkg");
749 //}
992ba7d8 750 }
43c7bace 751 else {
b833016c 752
753 fillthis="histArmPodK0SOfflineBkg";
754 FillArmPodDistribution(v0part,fillthis,isCandidateSelectedCuts,isBachelorID);
755
756 fillthis="histArmPodLcOfflineBkg";
757 FillArmPodDistribution(part,fillthis,isCandidateSelectedCuts,isBachelorID);
758
759 FillAnalysisHistograms(part,cutsAnal,"OfflineBkg");
a578b2da 760 if (isCandidateSelectedCuts) {
a578b2da 761 fillthis="histoprotonBachSigmaVspTOFbkg";
762 ((TH2F*)(fOutput->FindObject(fillthis)))->Fill(momBach,nSigmaTOFpr);
763 fillthis="histoprotonBachSigmaVspTPCbkg";
764 ((TH2F*)(fOutput->FindObject(fillthis)))->Fill(momBach,nSigmaTPCpr);
b833016c 765 //FillAnalysisHistograms(part,cutsAnal,"OfflineBkg");
992ba7d8 766 }
0dbd1d4f 767 }
992ba7d8 768 }
769 } // if fUseMCInfo
516f546e 770
992ba7d8 771 return;
772}
992ba7d8 773
43c7bace 774//----------------------------------------------------
775void AliAnalysisTaskSELc2V0bachelor::DefineK0SHistos()
776{
992ba7d8 777
43c7bace 778 Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
779 Double_t mK0SPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
b833016c 780 Double_t mMinLambdaPDG = TDatabasePDG::Instance()->GetParticle(2212)->Mass()+
781 TDatabasePDG::Instance()->GetParticle(211)->Mass();
782
783 TString nameHisto=" ", nameHistoSgn=" ", nameHistoBkg=" ";
784 TString titleHisto=" ", titleHistoSgn=" ", titleHistoBkg=" ";
785
786 // pt(Lc)
787 Double_t *binLimpTLc=new Double_t[11+1]; // 11 pT(Lc) bins
788 binLimpTLc[ 0]= 0.;
789 binLimpTLc[ 1]= 1.;
790 binLimpTLc[ 2]= 2.;
791 binLimpTLc[ 3]= 3.;
792 binLimpTLc[ 4]= 4.;
793 binLimpTLc[ 5]= 5.;
794 binLimpTLc[ 6]= 6.;
795 binLimpTLc[ 7]= 8.;
796 binLimpTLc[ 8]=12.;
797 binLimpTLc[ 9]=17.;
798 binLimpTLc[10]=25.;
799 binLimpTLc[11]=35.;
800
801 // pt(prong)
802 Double_t *binLimpTprong=new Double_t[41+1]; // 41 pT(prong) bins
803 binLimpTprong[ 0]= 0.0;
804 binLimpTprong[ 1]= 0.1;
805 binLimpTprong[ 2]= 0.2;
806 binLimpTprong[ 3]= 0.3;
807 binLimpTprong[ 4]= 0.4;
808 binLimpTprong[ 5]= 0.5;
809 binLimpTprong[ 6]= 0.6;
810 binLimpTprong[ 7]= 0.7;
811 binLimpTprong[ 8]= 0.8;
812 binLimpTprong[ 9]= 0.9;
813 binLimpTprong[10]= 1.0;
814 binLimpTprong[11]= 1.2;
815 binLimpTprong[12]= 1.4;
816 binLimpTprong[13]= 1.6;
817 binLimpTprong[14]= 1.8;
818 binLimpTprong[15]= 2.0;
819 binLimpTprong[16]= 2.2;
820 binLimpTprong[17]= 2.4;
821 binLimpTprong[18]= 2.6;
822 binLimpTprong[19]= 2.8;
823 binLimpTprong[20]= 3.0;
824 binLimpTprong[21]= 3.5;
825 binLimpTprong[22]= 4.0;
826 binLimpTprong[23]= 4.5;
827 binLimpTprong[24]= 5.0;
828 binLimpTprong[25]= 5.5;
829 binLimpTprong[26]= 6.0;
830 binLimpTprong[27]= 6.5;
831 binLimpTprong[28]= 7.0;
832 binLimpTprong[29]= 7.5;
833 binLimpTprong[30]= 8.0;
834 binLimpTprong[31]= 9.0;
835 binLimpTprong[32]=10.0;
836 binLimpTprong[33]=11.0;
837 binLimpTprong[34]=12.0;
838 binLimpTprong[35]=13.0;
839 binLimpTprong[36]=14.0;
840 binLimpTprong[37]=15.0;
841 binLimpTprong[38]=20.0;
842 binLimpTprong[39]=25.0;
843 binLimpTprong[40]=30.0;
844 binLimpTprong[41]=35.0;
992ba7d8 845
43c7bace 846 if (fUseOnTheFlyV0) {
0dbd1d4f 847
43c7bace 848 // V0 invariant masses (on-the-fly)
b833016c 849 nameHisto="histK0SMass";
850 titleHisto="K^{0}_{S} invariant mass VS p_{T}; m_{inv}(#pi^{+},#pi^{-}) [GeV/c^{2}]; p_{T}(K^{0}_{S}) [GeV/c]; Entries";
851 TH2F* spectrumK0SMass = new TH2F(nameHisto.Data(),titleHisto.Data(),1000,mK0SPDG-0.050,mK0SPDG+0.050,41,binLimpTprong);
ff12b981 852
43c7bace 853 // Lc invariant masses (x K0S on-the-fly)
b833016c 854 nameHisto="histLcMassByK0S";
855 titleHisto="#Lambda_{c} invariant mass (by K^{0}_{S}) vs p_{T}; m_{inv}(p,K^{0}_{S}) [GeV/c^{2}]; p_{T}(#Lambda_{c}) [GeV/c]";
856 TH2F* spectrumLcMassByK0S = new TH2F(nameHisto.Data(),titleHisto.Data(),1000,mLcPDG-0.250,mLcPDG+0.250,11,binLimpTLc);
992ba7d8 857
b833016c 858 nameHisto="histpK0Svsp";
859 titleHisto="p(K^{0}_{S}) vs p(p); p(p) [GeV/c]; p(K^{0}_{S}) [GeV/c]";
860 TH2F* momentumDistributionK0Svsp = new TH2F(nameHisto.Data(),titleHisto.Data(),41,binLimpTprong,41,binLimpTprong);
ff12b981 861
b833016c 862 nameHisto="histArmPodK0S";
863 titleHisto="K^{0}_{S} Armenteros-Podolanski distribution; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
864 TH2F* armenterosPodK0S = new TH2F(nameHisto.Data(),titleHisto.Data(),200,-1.,1.,300,0.,0.3);
865
866 nameHisto="histArmPodLc";
867 titleHisto="#Lambda_{c} Armenteros-Podolanski distribution; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
868 TH2F* armenterosPodLc = new TH2F(nameHisto.Data(),titleHisto.Data(),200,-4.,4.,800,0.,1.6);
43c7bace 869
43c7bace 870 TH2F* allspectrumK0SMass = (TH2F*)spectrumK0SMass->Clone();
b833016c 871 TH2F* allspectrumLcMassByK0S = (TH2F*)spectrumLcMassByK0S->Clone();
872 TH2F* allmomentumDistributionK0Svsp = (TH2F*)momentumDistributionK0Svsp->Clone();
873 TH2F* allArmenterosPodK0S = (TH2F*)armenterosPodK0S->Clone();
874 TH2F* allArmenterosPodLc = (TH2F*)armenterosPodLc->Clone();
ff12b981 875
43c7bace 876 TH2F* pidBachspectrumK0SMass = (TH2F*)spectrumK0SMass->Clone();
b833016c 877 TH2F* pidBachspectrumLcMassByK0S = (TH2F*)spectrumLcMassByK0S->Clone();
878 TH2F* pidBachmomentumDistributionK0Svsp = (TH2F*)momentumDistributionK0Svsp->Clone();
43c7bace 879 TH2F* pidBachArmenterosPodK0S = (TH2F*)armenterosPodK0S->Clone();
b833016c 880 TH2F* pidBachArmenterosPodLc = (TH2F*)armenterosPodLc->Clone();
ff12b981 881
43c7bace 882 fOutputAll->Add(allspectrumK0SMass);
883 fOutputAll->Add(allspectrumLcMassByK0S);
884 fOutputAll->Add(allmomentumDistributionK0Svsp);
885 fOutputAll->Add(allArmenterosPodK0S);
b833016c 886 fOutputAll->Add(allArmenterosPodLc);
0dbd1d4f 887
43c7bace 888 fOutputPIDBach->Add(pidBachspectrumK0SMass);
889 fOutputPIDBach->Add(pidBachspectrumLcMassByK0S);
890 fOutputPIDBach->Add(pidBachmomentumDistributionK0Svsp);
891 fOutputPIDBach->Add(pidBachArmenterosPodK0S);
b833016c 892 fOutputPIDBach->Add(pidBachArmenterosPodLc);
893
894 nameHisto="histArmPodK0S0";
895 titleHisto="K^{0}_{S} Armenteros-Podolanski distribution; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
896 TH2F* armenterosPodK0S0 = new TH2F(nameHisto.Data(),titleHisto.Data(),200,-1.,1.,300,0.,0.3);
897 nameHisto="histArmPodLc0";
898 titleHisto="#Lambda_{c} Armenteros-Podolanski distribution; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
899 TH2F* armenterosPodLc0 = new TH2F(nameHisto.Data(),titleHisto.Data(),200,-4.,4.,800,0.,1.6);
900 fOutputAll->Add(armenterosPodK0S0);
901 fOutputAll->Add(armenterosPodLc0);
43c7bace 902
b833016c 903
904 if (fTrackRotation) {
905 TH2F* pidBachTRspectrumLcMassByK0S = (TH2F*)spectrumLcMassByK0S->Clone();
516f546e 906 fOutputPIDBachTR->Add(pidBachTRspectrumLcMassByK0S);
907 }
908
ff12b981 909
0dbd1d4f 910
b833016c 911 nameHisto="histptK0S";
912 titleHisto="p_{T}(K^{0}_{S}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(K^{0}_{S}) [GeV/c]; Entries";
913 TH2F* ptK0S = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,41,binLimpTprong);
914
915 nameHisto="histptP";
916 titleHisto="p_{T}(p) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(p) [GeV/c]; Entries";
917 TH2F* ptP = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,41,binLimpTprong);
918
919 nameHisto="histptPip";
920 titleHisto="p_{T}(#pi^{+}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(#pi^{+}) [GeV/c]; Entries";
921 TH2F* ptPiP = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,41,binLimpTprong);
922
923 nameHisto="histptPim";
924 titleHisto="p_{T}(#pi^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(#pi^{-}) [GeV/c]; Entries";
925 TH2F* ptPiM = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,41,binLimpTprong);
926
927 nameHisto="histLambdaMass";
928 titleHisto="m_{inv}(p,#pi^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(p,#pi^{-}) [GeV/c^{2}]; Entries";
929 TH2F* massLambda = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,1000,mMinLambdaPDG,mMinLambdaPDG+0.5);
930
931 nameHisto="histLambdaBarMass";
932 titleHisto="m_{inv}(#bar{p},#pi^{+}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(#bar{p},#pi^{+}) [GeV/c^{2}]; Entries";
933 TH2F* massLambdaBar = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,1000,mMinLambdaPDG,mMinLambdaPDG+0.5);
934
935 nameHisto="histGammaMass";
936 titleHisto="m_{inv}(e^{+},e^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(e^{+},e^{-}) [GeV/c^{2}]; Entries";
937 TH2F* massGamma = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,100,0.,1.);
938
939 nameHisto="histD0K0S";
940 titleHisto="d_{0}(K^{0}_{S}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; d_{0}(K^{0}_{S}) [#sigmas]; Entries";
941 TH2F* d0K0S = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,1000,-1.,1.);
942
943 nameHisto="histD0P";
944 titleHisto="d_{0}(p) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; d_{0}(p) [cm]; Entries";
945 TH2F* d0P = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,1000,-1.,1.);
946
947 nameHisto="histCosPAK0S";
948 titleHisto="K^{0}_{S} cosine of pointing angle wrt primary vertex vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; cosine; Entries";
949 TH2F *cosPAK0S = new TH2F(nameHisto.Data(),titleHisto.Data(),41,binLimpTprong,100,0.99,1.);
950
951 TH2F* allptK0S = (TH2F*)ptK0S->Clone();
952 TH2F* allptP = (TH2F*)ptP->Clone();
953 TH2F* allptPiP = (TH2F*)ptPiP->Clone();
954 TH2F* allptPiM = (TH2F*)ptPiM->Clone();
955 TH2F* allmassLambda = (TH2F*)massLambda->Clone();
956 TH2F* allmassLambdaBar = (TH2F*)massLambdaBar->Clone();
957 TH2F* allmassGamma = (TH2F*)massGamma->Clone();
958 TH2F* alld0K0S = (TH2F*)d0K0S->Clone();
959 TH2F* alld0P = (TH2F*)d0P->Clone();
960 TH2F* allcosPAK0S = (TH2F*)cosPAK0S->Clone();
961
962 TH2F* pidptK0S = (TH2F*)ptK0S->Clone();
963 TH2F* pidptP = (TH2F*)ptP->Clone();
964 TH2F* pidptPiP = (TH2F*)ptPiP->Clone();
965 TH2F* pidptPiM = (TH2F*)ptPiM->Clone();
966 TH2F* pidmassLambda = (TH2F*)massLambda->Clone();
967 TH2F* pidmassLambdaBar = (TH2F*)massLambdaBar->Clone();
968 TH2F* pidmassGamma = (TH2F*)massGamma->Clone();
969 TH2F* pidd0K0S = (TH2F*)d0K0S->Clone();
970 TH2F* pidd0P = (TH2F*)d0P->Clone();
971 TH2F* pidcosPAK0S = (TH2F*)cosPAK0S->Clone();
972
973 fOutputAll->Add(allptK0S);
974 fOutputAll->Add(allptP);
975 fOutputAll->Add(allptPiP);
976 fOutputAll->Add(allptPiM);
977 fOutputAll->Add(allmassLambda);
978 fOutputAll->Add(allmassLambdaBar);
979 fOutputAll->Add(allmassGamma);
980 fOutputAll->Add(alld0K0S);
981 fOutputAll->Add(alld0P);
982 fOutputAll->Add(allcosPAK0S);
983
984 fOutputPIDBach->Add(pidptK0S);
985 fOutputPIDBach->Add(pidptP);
986 fOutputPIDBach->Add(pidptPiP);
987 fOutputPIDBach->Add(pidptPiM);
988 fOutputPIDBach->Add(pidmassLambda);
989 fOutputPIDBach->Add(pidmassLambdaBar);
990 fOutputPIDBach->Add(pidmassGamma);
991 fOutputPIDBach->Add(pidd0K0S);
992 fOutputPIDBach->Add(pidd0P);
993 fOutputPIDBach->Add(pidcosPAK0S);
992ba7d8 994
b833016c 995 if (fTrackRotation) {
992ba7d8 996
b833016c 997 TH2F* pidTRptK0S = (TH2F*)ptK0S->Clone();
998 TH2F* pidTRptP = (TH2F*)ptP->Clone();
999 TH2F* pidTRptPiP = (TH2F*)ptPiP->Clone();
1000 TH2F* pidTRptPiM = (TH2F*)ptPiM->Clone();
1001 TH2F* pidTRmassLambda = (TH2F*)massLambda->Clone();
1002 TH2F* pidTRmassLambdaBar = (TH2F*)massLambdaBar->Clone();
1003 TH2F* pidTRmassGamma = (TH2F*)massGamma->Clone();
1004 TH2F* pidTRcosPAK0S = (TH2F*)cosPAK0S->Clone();
1005 fOutputPIDBachTR->Add(pidTRptK0S);
1006 fOutputPIDBachTR->Add(pidTRptP);
1007 fOutputPIDBachTR->Add(pidTRptPiP);
1008 fOutputPIDBachTR->Add(pidTRptPiM);
1009 fOutputPIDBachTR->Add(pidTRmassLambda);
1010 fOutputPIDBachTR->Add(pidTRmassLambdaBar);
1011 fOutputPIDBachTR->Add(pidTRmassGamma);
1012 fOutputPIDBachTR->Add(pidTRcosPAK0S);
992ba7d8 1013
b833016c 1014 }
992ba7d8 1015
b833016c 1016 }
992ba7d8 1017
b833016c 1018 // V0 invariant masses (offline)
1019 nameHisto="histK0SMassOffline";
1020 titleHisto="K^{0}_{S} invariant mass VS p_{T}; m_{inv}(#pi^{+},#pi^{-}) [GeV/c^{2}]; p_{T}(K^{0}_{S}) [GeV/c]; Entries";
1021 TH2F* spectrumK0SMassOffline = new TH2F(nameHisto.Data(),titleHisto.Data(),1000,mK0SPDG-0.050,mK0SPDG+0.050,41,binLimpTprong);
1022
1023 // Lc invariant masses (x K0S offline)
1024 nameHisto="histLcMassByK0SOffline";
1025 titleHisto="#Lambda_{c} invariant mass (by K^{0}_{S}) vs p_{T}; m_{inv}(p,K^{0}_{S}) [GeV/c^{2}]; p_{T}(#Lambda_{c}) [GeV/c]";
1026 TH2F* spectrumLcMassOfflineByK0S = new TH2F(nameHisto.Data(),titleHisto.Data(),1000,mLcPDG-0.250,mLcPDG+0.250,11,binLimpTLc);
992ba7d8 1027
b833016c 1028 nameHisto="histpK0SvspOffline";
1029 titleHisto="p(K^{0}_{S}) vs p(p); p(p) [GeV/c]; p(K^{0}_{S}) [GeV/c]";
1030 TH2F* momentumDistributionK0SvspOffline = new TH2F(nameHisto.Data(),titleHisto.Data(),41,binLimpTprong,41,binLimpTprong);
1031
1032 nameHisto="histArmPodK0SOffline";
1033 titleHisto="K^{0}_{S} Armenteros-Podolanski distribution; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1034 TH2F* armenterosPodK0SOffline = new TH2F(nameHisto.Data(),titleHisto.Data(),200,-1.,1.,300,0.,0.3);
1035
1036 nameHisto="histArmPodLcOffline";
1037 titleHisto="#Lambda_{c} Armenteros-Podolanski distribution; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1038 TH2F* armenterosPodLcOffline = new TH2F(nameHisto.Data(),titleHisto.Data(),200,-4.,4.,800,0.,1.6);
992ba7d8 1039
43c7bace 1040 TH2F* allspectrumK0SMassOffline = (TH2F*)spectrumK0SMassOffline->Clone();
b833016c 1041 TH2F* allspectrumLcMassOfflineByK0S = (TH2F*)spectrumLcMassOfflineByK0S->Clone();
1042 TH2F* allmomentumDistributionK0SvspOffline = (TH2F*)momentumDistributionK0SvspOffline->Clone();
1043 TH2F* allArmenterosPodK0SOffline = (TH2F*)armenterosPodK0SOffline->Clone();
1044 TH2F* allArmenterosPodLcOffline = (TH2F*)armenterosPodLcOffline->Clone();
992ba7d8 1045
43c7bace 1046 TH2F* pidBachspectrumK0SMassOffline = (TH2F*)spectrumK0SMassOffline->Clone();
b833016c 1047 TH2F* pidBachspectrumLcMassOfflineByK0S = (TH2F*)spectrumLcMassOfflineByK0S->Clone();
1048 TH2F* pidBachmomentumDistributionK0SvspOffline = (TH2F*)momentumDistributionK0SvspOffline->Clone();
1049 TH2F* pidBachArmenterosPodK0SOffline = (TH2F*)armenterosPodK0SOffline->Clone();
1050 TH2F* pidBachArmenterosPodLcOffline = (TH2F*)armenterosPodLcOffline->Clone();
992ba7d8 1051
43c7bace 1052 fOutputAll->Add(allspectrumK0SMassOffline);
1053 fOutputAll->Add(allspectrumLcMassOfflineByK0S);
1054 fOutputAll->Add(allmomentumDistributionK0SvspOffline);
b833016c 1055 fOutputAll->Add(allArmenterosPodK0SOffline);
1056 fOutputAll->Add(allArmenterosPodLcOffline);
85036182 1057
43c7bace 1058 fOutputPIDBach->Add(pidBachspectrumK0SMassOffline);
1059 fOutputPIDBach->Add(pidBachspectrumLcMassOfflineByK0S);
1060 fOutputPIDBach->Add(pidBachmomentumDistributionK0SvspOffline);
b833016c 1061 fOutputPIDBach->Add(pidBachArmenterosPodK0SOffline);
1062 fOutputPIDBach->Add(pidBachArmenterosPodLcOffline);
1063
1064 nameHisto="histArmPodK0SOffline0";
1065 titleHisto="K^{0}_{S} Armenteros-Podolanski distribution; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1066 TH2F* armenterosPodK0SOffline0 = new TH2F(nameHisto.Data(),titleHisto.Data(),200,-1.,1.,300,0.,0.3);
1067 nameHisto="histArmPodLcOffline0";
1068 titleHisto="#Lambda_{c} Armenteros-Podolanski distribution; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1069 TH2F* armenterosPodLcOffline0 = new TH2F(nameHisto.Data(),titleHisto.Data(),200,-4.,4.,800,0.,1.6);
1070 fOutputAll->Add(armenterosPodK0SOffline0);
1071 fOutputAll->Add(armenterosPodLcOffline0);
43c7bace 1072
516f546e 1073 if (fTrackRotation) {
b833016c 1074 TH2F* pidBachTRspectrumLcMassOfflineByK0S = (TH2F*)spectrumLcMassOfflineByK0S->Clone();
516f546e 1075 fOutputPIDBachTR->Add(pidBachTRspectrumLcMassOfflineByK0S);
1076 }
1077
b833016c 1078
1079
1080
1081 nameHisto="histptK0SOffline";
1082 titleHisto="p_{T}(K^{0}_{S}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(K^{0}_{S}) [GeV/c]; Entries";
1083 TH2F* ptK0SOffline = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,41,binLimpTprong);
1084
1085 nameHisto="histptPOffline";
1086 titleHisto="p_{T}(p) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(p) [GeV/c]; Entries";
1087 TH2F* ptPOffline = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,41,binLimpTprong);
1088
1089 nameHisto="histptPipOffline";
1090 titleHisto="p_{T}(#pi^{+}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(#pi^{+}) [GeV/c]; Entries";
1091 TH2F* ptPiPOffline = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,41,binLimpTprong);
1092
1093 nameHisto="histptPimOffline";
1094 titleHisto="p_{T}(#pi^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(#pi^{-}) [GeV/c]; Entries";
1095 TH2F* ptPiMOffline = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,41,binLimpTprong);
1096
1097 nameHisto="histLambdaMassOffline";
1098 titleHisto="m_{inv}(p,#pi^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(p,#pi^{-}) [GeV/c^{2}]; Entries";
1099 TH2F* massLambdaOffline = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,1000,mMinLambdaPDG,mMinLambdaPDG+0.5);
1100
1101 nameHisto="histLambdaBarMassOffline";
1102 titleHisto="m_{inv}(#bar{p},#pi^{+}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(#bar{p},#pi^{+}) [GeV/c^{2}]; Entries";
1103 TH2F* massLambdaBarOffline = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,1000,mMinLambdaPDG,mMinLambdaPDG+0.5);
1104
1105 nameHisto="histGammaMassOffline";
1106 titleHisto="m_{inv}(e^{+},e^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(e^{+},e^{-}) [GeV/c^{2}]; Entries";
1107 TH2F* massGammaOffline = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,100,0.,1.);
1108
1109 nameHisto="histD0K0SOffline";
1110 titleHisto="d_{0}(K^{0}_{S}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; d_{0}(K^{0}_{S}) [#sigmas]; Entries";
1111 TH2F* d0K0SOffline = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,1000,-1.,1.);
1112
1113 nameHisto="histD0POffline";
1114 titleHisto="d_{0}(p) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; d_{0}(p) [cm]; Entries";
1115 TH2F* d0POffline = new TH2F(nameHisto.Data(),titleHisto.Data(),11,binLimpTLc,1000,-1.,1.);
1116
1117 nameHisto="histCosPAK0SOffline";
1118 titleHisto="K^{0}_{S} cosine of pointing angle wrt primary vertex vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; cosine; Entries";
1119 TH2F *cosPAK0SOffline = new TH2F(nameHisto.Data(),titleHisto.Data(),41,binLimpTprong,100,0.99,1.);
1120
1121 TH2F* allptK0SOffline = (TH2F*)ptK0SOffline->Clone();
1122 TH2F* allptPOffline = (TH2F*)ptPOffline->Clone();
1123 TH2F* allptPiPOffline = (TH2F*)ptPiPOffline->Clone();
1124 TH2F* allptPiMOffline = (TH2F*)ptPiMOffline->Clone();
1125 TH2F* allmassLambdaOffline = (TH2F*)massLambdaOffline->Clone();
1126 TH2F* allmassLambdaBarOffline = (TH2F*)massLambdaBarOffline->Clone();
1127 TH2F* allmassGammaOffline = (TH2F*)massGammaOffline->Clone();
1128 TH2F* alld0K0SOffline = (TH2F*)d0K0SOffline->Clone();
1129 TH2F* alld0POffline = (TH2F*)d0POffline->Clone();
1130 TH2F* allcosPAK0SOffline = (TH2F*)cosPAK0SOffline->Clone();
1131
1132 TH2F* pidptK0SOffline = (TH2F*)ptK0SOffline->Clone();
1133 TH2F* pidptPOffline = (TH2F*)ptPOffline->Clone();
1134 TH2F* pidptPiPOffline = (TH2F*)ptPiPOffline->Clone();
1135 TH2F* pidptPiMOffline = (TH2F*)ptPiMOffline->Clone();
1136 TH2F* pidmassLambdaOffline = (TH2F*)massLambdaOffline->Clone();
1137 TH2F* pidmassLambdaBarOffline = (TH2F*)massLambdaBarOffline->Clone();
1138 TH2F* pidmassGammaOffline = (TH2F*)massGammaOffline->Clone();
1139 TH2F* pidd0K0SOffline = (TH2F*)d0K0SOffline->Clone();
1140 TH2F* pidd0POffline = (TH2F*)d0POffline->Clone();
1141 TH2F* pidcosPAK0SOffline = (TH2F*)cosPAK0SOffline->Clone();
1142
1143 fOutputAll->Add(allptK0SOffline);
1144 fOutputAll->Add(allptPOffline);
1145 fOutputAll->Add(allptPiPOffline);
1146 fOutputAll->Add(allptPiMOffline);
1147 fOutputAll->Add(allmassLambdaOffline);
1148 fOutputAll->Add(allmassLambdaBarOffline);
1149 fOutputAll->Add(allmassGammaOffline);
1150 fOutputAll->Add(alld0K0SOffline);
1151 fOutputAll->Add(alld0POffline);
1152 fOutputAll->Add(allcosPAK0SOffline);
1153
1154 fOutputPIDBach->Add(pidptK0SOffline);
1155 fOutputPIDBach->Add(pidptPOffline);
1156 fOutputPIDBach->Add(pidptPiPOffline);
1157 fOutputPIDBach->Add(pidptPiMOffline);
1158 fOutputPIDBach->Add(pidmassLambdaOffline);
1159 fOutputPIDBach->Add(pidmassLambdaBarOffline);
1160 fOutputPIDBach->Add(pidmassGammaOffline);
1161 fOutputPIDBach->Add(pidd0K0SOffline);
1162 fOutputPIDBach->Add(pidd0POffline);
1163 fOutputPIDBach->Add(pidcosPAK0SOffline);
1164
1165 if (fTrackRotation) {
1166
1167 TH2F* pidTRptK0SOffline = (TH2F*)ptK0SOffline->Clone();
1168 TH2F* pidTRptPOffline = (TH2F*)ptPOffline->Clone();
1169 TH2F* pidTRptPiPOffline = (TH2F*)ptPiPOffline->Clone();
1170 TH2F* pidTRptPiMOffline = (TH2F*)ptPiMOffline->Clone();
1171 TH2F* pidTRmassLambdaOffline = (TH2F*)massLambdaOffline->Clone();
1172 TH2F* pidTRmassLambdaBarOffline = (TH2F*)massLambdaBarOffline->Clone();
1173 TH2F* pidTRmassGammaOffline = (TH2F*)massGammaOffline->Clone();
1174 TH2F* pidTRcosPAK0SOffline = (TH2F*)cosPAK0SOffline->Clone();
1175 fOutputPIDBachTR->Add(pidTRptK0SOffline);
1176 fOutputPIDBachTR->Add(pidTRptPOffline);
1177 fOutputPIDBachTR->Add(pidTRptPiPOffline);
1178 fOutputPIDBachTR->Add(pidTRptPiMOffline);
1179 fOutputPIDBachTR->Add(pidTRmassLambdaOffline);
1180 fOutputPIDBachTR->Add(pidTRmassLambdaBarOffline);
1181 fOutputPIDBachTR->Add(pidTRmassGammaOffline);
1182 fOutputPIDBachTR->Add(pidTRcosPAK0SOffline);
1183
1184 }
1185
1186
1187
1188
1189
43c7bace 1190 if (fUseMCInfo) {
1191
1192 if (fUseOnTheFlyV0) {
1193
b833016c 1194 nameHistoSgn="histK0SMassSgn";
1195 nameHistoBkg="histK0SMassBkg";
1196 titleHistoSgn="K^{0}_{S} - sgn: invariant mass VS p_{T} - MC; m_{inv}(#pi^{+},#pi^{-}) [GeV/c^{2}]; p_{T}(K^{0}_{S}) [GeV/c]; Entries";
1197 titleHistoBkg="K^{0}_{S} - bkg: invariant mass VS p_{T} - MC; m_{inv}(#pi^{+},#pi^{-}) [GeV/c^{2}]; p_{T}(K^{0}_{S}) [GeV/c]; Entries";
1198 TH2F* spectrumK0SMassSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),1000,mK0SPDG-0.050,mK0SPDG+0.050,41,binLimpTprong);
1199 TH2F* spectrumK0SMassBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),1000,mK0SPDG-0.050,mK0SPDG+0.050,41,binLimpTprong);
1200
1201 nameHistoSgn="histLcMassByK0SSgn";
1202 nameHistoBkg="histLcMassByK0SBkg";
1203 titleHistoSgn="#Lambda_{c} - sgn: invariant mass (by K^{0}_{S}) vs p_{T} - MC; m_{inv}(p,K^{0}_{S}) [GeV/c^{2}]; p_{T}(#Lambda_{c}) [GeV/c]";
1204 titleHistoBkg="#Lambda_{c} - bkg: invariant mass (by K^{0}_{S}) vs p_{T} - MC; m_{inv}(p,K^{0}_{S}) [GeV/c^{2}]; p_{T}(#Lambda_{c}) [GeV/c]";
1205 TH2F* spectrumLcMassByK0SSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),1000,mLcPDG-0.250,mLcPDG+0.250,11,binLimpTLc);
1206 TH2F* spectrumLcMassByK0SBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),1000,mLcPDG-0.250,mLcPDG+0.250,11,binLimpTLc);
1207
1208 nameHistoSgn="histpK0SvspSgn";
1209 nameHistoBkg="histpK0SvspBkg";
1210 titleHistoSgn="#Lambda_{c} - sgn: K^{0}_{S} vs p Total Momentum Distribution - MC; p(p) [GeV/c]; p(K^{0}_{S}) [GeV/c]";
1211 titleHistoBkg="#Lambda_{c} - bkg: K^{0}_{S} vs p Total Momentum Distribution - MC; p(p) [GeV/c]; p(K^{0}_{S}) [GeV/c]";
1212 TH2F* momentumDistributionK0SvspSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),41,binLimpTprong,41,binLimpTprong);
1213 TH2F* momentumDistributionK0SvspBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),41,binLimpTprong,41,binLimpTprong);
1214
43c7bace 1215 // armenteros-podolanski plots K0S
b833016c 1216 nameHistoSgn="histArmPodK0SSgn";
1217 nameHistoBkg="histArmPodK0SBkg";
1218 titleHistoSgn="K^{0}_{S} Armenteros-Podolanski distribution (sgn); #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1219 titleHistoBkg="K^{0}_{S} Armenteros-Podolanski distribution (bkg); #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1220 TH2F* armenterosPodK0SSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),200,-1.,1.,300,0.,0.3);
1221 TH2F* armenterosPodK0SBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),200,-1.,1.,300,0.,0.3);
1222
1223 nameHistoSgn="histArmPodLcSgn";
1224 nameHistoBkg="histArmPodLcBkg";
1225 titleHistoSgn="#Lambda_{c} Armenteros-Podolanski distribution (sgn); #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1226 titleHistoBkg="#Lambda_{c} Armenteros-Podolanski distribution (bkg); #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1227 TH2F* armenterosPodLcSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),200,-4.,4.,800,0.,1.6);
1228 TH2F* armenterosPodLcBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),200,-4.,4.,800,0.,1.6);
1229
1230 TH2F* allspectrumK0SMassSgn = (TH2F*)spectrumK0SMassSgn->Clone();
1231 TH2F* allspectrumK0SMassBkg = (TH2F*)spectrumK0SMassBkg->Clone();
1232 TH2F* allspectrumLcMassByK0SSgn = (TH2F*)spectrumLcMassByK0SSgn->Clone();
1233 TH2F* allspectrumLcMassByK0SBkg = (TH2F*)spectrumLcMassByK0SBkg->Clone();
1234 TH2F* allmomentumDistributionK0SvspSgn = (TH2F*)momentumDistributionK0SvspSgn->Clone();
1235 TH2F* allmomentumDistributionK0SvspBkg = (TH2F*)momentumDistributionK0SvspBkg->Clone();
516f546e 1236 TH2F* allArmenterosPodK0SSgn = (TH2F*)armenterosPodK0SSgn->Clone();
1237 TH2F* allArmenterosPodK0SBkg = (TH2F*)armenterosPodK0SBkg->Clone();
b833016c 1238 TH2F* allArmenterosPodLcSgn = (TH2F*)armenterosPodLcSgn->Clone();
1239 TH2F* allArmenterosPodLcBkg = (TH2F*)armenterosPodLcBkg->Clone();
1240
1241 TH2F* pidBachspectrumK0SMassSgn = (TH2F*)spectrumK0SMassSgn->Clone();
1242 TH2F* pidBachspectrumK0SMassBkg = (TH2F*)spectrumK0SMassBkg->Clone();
1243 TH2F* pidBachspectrumLcMassByK0SSgn = (TH2F*)spectrumLcMassByK0SSgn->Clone();
1244 TH2F* pidBachspectrumLcMassByK0SBkg = (TH2F*)spectrumLcMassByK0SBkg->Clone();
1245 TH2F* pidBachmomentumDistributionK0SvspSgn = (TH2F*)momentumDistributionK0SvspSgn->Clone();
1246 TH2F* pidBachmomentumDistributionK0SvspBkg = (TH2F*)momentumDistributionK0SvspBkg->Clone();
516f546e 1247 TH2F* pidBachArmenterosPodK0SSgn = (TH2F*)armenterosPodK0SSgn->Clone();
1248 TH2F* pidBachArmenterosPodK0SBkg = (TH2F*)armenterosPodK0SBkg->Clone();
b833016c 1249 TH2F* pidBachArmenterosPodLcSgn = (TH2F*)armenterosPodLcSgn->Clone();
1250 TH2F* pidBachArmenterosPodLcBkg = (TH2F*)armenterosPodLcBkg->Clone();
43c7bace 1251
516f546e 1252 fOutputAll->Add(allspectrumK0SMassSgn);
1253 fOutputAll->Add(allspectrumK0SMassBkg);
1254 fOutputAll->Add(allspectrumLcMassByK0SSgn);
1255 fOutputAll->Add(allspectrumLcMassByK0SBkg);
b833016c 1256 fOutputAll->Add(allmomentumDistributionK0SvspSgn);
1257 fOutputAll->Add(allmomentumDistributionK0SvspBkg);
516f546e 1258 fOutputAll->Add(allArmenterosPodK0SSgn);
1259 fOutputAll->Add(allArmenterosPodK0SBkg);
b833016c 1260 fOutputAll->Add(allArmenterosPodLcSgn);
1261 fOutputAll->Add(allArmenterosPodLcBkg);
516f546e 1262
1263 fOutputPIDBach->Add(pidBachspectrumK0SMassSgn);
1264 fOutputPIDBach->Add(pidBachspectrumK0SMassBkg);
1265 fOutputPIDBach->Add(pidBachspectrumLcMassByK0SSgn);
1266 fOutputPIDBach->Add(pidBachspectrumLcMassByK0SBkg);
b833016c 1267 fOutputPIDBach->Add(pidBachmomentumDistributionK0SvspSgn);
1268 fOutputPIDBach->Add(pidBachmomentumDistributionK0SvspBkg);
516f546e 1269 fOutputPIDBach->Add(pidBachArmenterosPodK0SSgn);
1270 fOutputPIDBach->Add(pidBachArmenterosPodK0SBkg);
b833016c 1271 fOutputPIDBach->Add(pidBachArmenterosPodLcSgn);
1272 fOutputPIDBach->Add(pidBachArmenterosPodLcBkg);
1273
1274 nameHistoSgn="histArmPodK0SSgn0";
1275 nameHistoBkg="histArmPodK0SBkg0";
1276 titleHistoSgn="K^{0}_{S} Armenteros-Podolanski distribution (sgn); #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1277 titleHistoBkg="K^{0}_{S} Armenteros-Podolanski distribution (bkg); #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1278 TH2F* armenterosPodK0SSgn0 = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),200,-1.,1.,300,0.,0.3);
1279 TH2F* armenterosPodK0SBkg0 = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),200,-1.,1.,300,0.,0.3);
1280 fOutputAll->Add(armenterosPodK0SSgn0);
1281 fOutputAll->Add(armenterosPodK0SBkg0);
1282 nameHistoSgn="histArmPodLcSgn0";
1283 nameHistoBkg="histArmPodLcBkg0";
1284 titleHistoSgn="#Lambda_{c} Armenteros-Podolanski distribution (sgn); #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1285 titleHistoBkg="#Lambda_{c} Armenteros-Podolanski distribution (bkg); #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1286 TH2F* armenterosPodLcSgn0 = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),200,-4.,4.,800,0.,1.6);
1287 TH2F* armenterosPodLcBkg0 = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),200,-4.,4.,800,0.,1.6);
1288 fOutputAll->Add(armenterosPodLcSgn0);
1289 fOutputAll->Add(armenterosPodLcBkg0);
43c7bace 1290
516f546e 1291 if (fTrackRotation) {
b833016c 1292 TH2F* pidBachTRspectrumLcMassByK0SSgn = (TH2F*)spectrumLcMassByK0SSgn->Clone();
1293 TH2F* pidBachTRspectrumLcMassByK0SBkg = (TH2F*)spectrumLcMassByK0SBkg->Clone();
516f546e 1294 fOutputPIDBachTR->Add(pidBachTRspectrumLcMassByK0SSgn);
1295 fOutputPIDBachTR->Add(pidBachTRspectrumLcMassByK0SBkg);
1296 }
1297
b833016c 1298
1299
1300 nameHistoSgn="histptK0SSgn";
1301 nameHistoBkg="histptK0SBkg";
1302 titleHistoSgn="p_{T}(K^{0}_{S}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(K^{0}_{S}) [GeV/c]; Entries";
1303 titleHistoBkg="p_{T}(K^{0}_{S}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(K^{0}_{S}) [GeV/c]; Entries";
1304 TH2F* ptK0SSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,41,binLimpTprong);
1305 TH2F* ptK0SBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,41,binLimpTprong);
1306
1307 nameHistoSgn="histptPSgn";
1308 nameHistoBkg="histptPBkg";
1309 titleHistoSgn="p_{T}(p) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(p) [GeV/c]; Entries";
1310 titleHistoBkg="p_{T}(p) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(p) [GeV/c]; Entries";
1311 TH2F* ptPSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,41,binLimpTprong);
1312 TH2F* ptPBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,41,binLimpTprong);
1313
1314 nameHistoSgn="histptPipSgn";
1315 nameHistoBkg="histptPipBkg";
1316 titleHistoSgn="p_{T}(#pi^{+}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(#pi^{+}) [GeV/c]; Entries";
1317 titleHistoBkg="p_{T}(#pi^{+}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(#pi^{+}) [GeV/c]; Entries";
1318 TH2F* ptPiPSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,41,binLimpTprong);
1319 TH2F* ptPiPBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,41,binLimpTprong);
1320
1321 nameHistoSgn="histptPimSgn";
1322 nameHistoBkg="histptPimBkg";
1323 titleHistoSgn="p_{T}(#pi^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(#pi^{-}) [GeV/c]; Entries";
1324 titleHistoBkg="p_{T}(#pi^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(#pi^{-}) [GeV/c]; Entries";
1325 TH2F* ptPiMSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,41,binLimpTprong);
1326 TH2F* ptPiMBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,41,binLimpTprong);
1327
1328 nameHistoSgn="histLambdaMassSgn";
1329 nameHistoBkg="histLambdaMassBkg";
1330 titleHistoSgn="m_{inv}(p,#pi^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(p,#pi^{-}) [GeV/c^{2}]; Entries";
1331 titleHistoBkg="m_{inv}(p,#pi^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(p,#pi^{-}) [GeV/c^{2}]; Entries";
1332 TH2F* massLambdaSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,1000,mMinLambdaPDG,mMinLambdaPDG+0.5);
1333 TH2F* massLambdaBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,1000,mMinLambdaPDG,mMinLambdaPDG+0.5);
1334
1335 nameHistoSgn="histLambdaBarMassSgn";
1336 nameHistoBkg="histLambdaBarMassBkg";
1337 titleHistoSgn="m_{inv}(#bar{p},#pi^{+}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(#bar{p},#pi^{+}) [GeV/c^{2}]; Entries";
1338 titleHistoBkg="m_{inv}(#bar{p},#pi^{+}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(#bar{p},#pi^{+}) [GeV/c^{2}]; Entries";
1339 TH2F* massLambdaBarSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,1000,mMinLambdaPDG,mMinLambdaPDG+0.5);
1340 TH2F* massLambdaBarBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,1000,mMinLambdaPDG,mMinLambdaPDG+0.5);
1341
1342 nameHistoSgn="histGammaMassSgn";
1343 nameHistoBkg="histGammaMassBkg";
1344 titleHistoSgn="m_{inv}(e^{+},e^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(e^{+},e^{-}) [GeV/c^{2}]; Entries";
1345 titleHistoBkg="m_{inv}(e^{+},e^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(e^{+},e^{-}) [GeV/c^{2}]; Entries";
1346 TH2F* massGammaSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,100,0.,1.);
1347 TH2F* massGammaBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,100,0.,1.);
1348
1349 nameHistoSgn="histD0K0SSgn";
1350 nameHistoBkg="histD0K0SBkg";
1351 titleHistoSgn="d_{0}(K^{0}_{S}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; d_{0}(K^{0}_{S}) [#sigmas]; Entries";
1352 titleHistoBkg="d_{0}(K^{0}_{S}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; d_{0}(K^{0}_{S}) [#sigmas]; Entries";
1353 TH2F* d0K0SSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,1000,-1.,1.);
1354 TH2F* d0K0SBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,1000,-1.,1.);
1355
1356 nameHistoSgn="histD0PSgn";
1357 nameHistoBkg="histD0PBkg";
1358 titleHistoSgn="d_{0}(p) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; d_{0}(p) [cm]; Entries";
1359 titleHistoBkg="d_{0}(p) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; d_{0}(p) [cm]; Entries";
1360 TH2F* d0PSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,1000,-1.,1.);
1361 TH2F* d0PBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,1000,-1.,1.);
1362
1363 nameHistoSgn="histCosPAK0SSgn";
1364 nameHistoBkg="histCosPAK0SBkg";
1365 titleHistoSgn="K^{0}_{S} cosine of pointing angle wrt primary vertex vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; cosine; Entries";
1366 titleHistoBkg="K^{0}_{S} cosine of pointing angle wrt primary vertex vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; cosine; Entries";
1367 TH2F *cosPAK0SSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),41,binLimpTprong,100,0.99,1.);
1368 TH2F *cosPAK0SBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),41,binLimpTprong,100,0.99,1.);
1369
1370 TH2F* allptK0SSgn = (TH2F*)ptK0SSgn->Clone();
1371 TH2F* allptK0SBkg = (TH2F*)ptK0SBkg->Clone();
1372 TH2F* allptPSgn = (TH2F*)ptPSgn->Clone();
1373 TH2F* allptPBkg = (TH2F*)ptPBkg->Clone();
1374 TH2F* allptPiPSgn = (TH2F*)ptPiPSgn->Clone();
1375 TH2F* allptPiPBkg = (TH2F*)ptPiPBkg->Clone();
1376 TH2F* allptPiMSgn = (TH2F*)ptPiMSgn->Clone();
1377 TH2F* allptPiMBkg = (TH2F*)ptPiMBkg->Clone();
1378 TH2F* allmassLambdaSgn = (TH2F*)massLambdaSgn->Clone();
1379 TH2F* allmassLambdaBkg = (TH2F*)massLambdaBkg->Clone();
1380 TH2F* allmassLambdaBarSgn = (TH2F*)massLambdaBarSgn->Clone();
1381 TH2F* allmassLambdaBarBkg = (TH2F*)massLambdaBarBkg->Clone();
1382 TH2F* allmassGammaSgn = (TH2F*)massGammaSgn->Clone();
1383 TH2F* allmassGammaBkg = (TH2F*)massGammaBkg->Clone();
1384 TH2F* alld0K0SSgn = (TH2F*)d0K0SSgn->Clone();
1385 TH2F* alld0K0SBkg = (TH2F*)d0K0SBkg->Clone();
1386 TH2F* alld0PSgn = (TH2F*)d0PSgn->Clone();
1387 TH2F* alld0PBkg = (TH2F*)d0PBkg->Clone();
1388 TH2F* allcosPAK0SSgn = (TH2F*)cosPAK0SSgn->Clone();
1389 TH2F* allcosPAK0SBkg = (TH2F*)cosPAK0SBkg->Clone();
1390
1391 TH2F* pidptK0SSgn = (TH2F*)ptK0SSgn->Clone();
1392 TH2F* pidptK0SBkg = (TH2F*)ptK0SBkg->Clone();
1393 TH2F* pidptPSgn = (TH2F*)ptPSgn->Clone();
1394 TH2F* pidptPBkg = (TH2F*)ptPBkg->Clone();
1395 TH2F* pidptPiPSgn = (TH2F*)ptPiPSgn->Clone();
1396 TH2F* pidptPiPBkg = (TH2F*)ptPiPBkg->Clone();
1397 TH2F* pidptPiMSgn = (TH2F*)ptPiMSgn->Clone();
1398 TH2F* pidptPiMBkg = (TH2F*)ptPiMBkg->Clone();
1399 TH2F* pidmassLambdaSgn = (TH2F*)massLambdaSgn->Clone();
1400 TH2F* pidmassLambdaBkg = (TH2F*)massLambdaBkg->Clone();
1401 TH2F* pidmassLambdaBarSgn = (TH2F*)massLambdaBarSgn->Clone();
1402 TH2F* pidmassLambdaBarBkg = (TH2F*)massLambdaBarBkg->Clone();
1403 TH2F* pidmassGammaSgn = (TH2F*)massGammaSgn->Clone();
1404 TH2F* pidmassGammaBkg = (TH2F*)massGammaBkg->Clone();
1405 TH2F* pidd0K0SSgn = (TH2F*)d0K0SSgn->Clone();
1406 TH2F* pidd0K0SBkg = (TH2F*)d0K0SBkg->Clone();
1407 TH2F* pidd0PSgn = (TH2F*)d0PSgn->Clone();
1408 TH2F* pidd0PBkg = (TH2F*)d0PBkg->Clone();
1409 TH2F* pidcosPAK0SSgn = (TH2F*)cosPAK0SSgn->Clone();
1410 TH2F* pidcosPAK0SBkg = (TH2F*)cosPAK0SBkg->Clone();
1411
1412 fOutputAll->Add(allptK0SSgn);
1413 fOutputAll->Add(allptK0SBkg);
1414 fOutputAll->Add(allptPSgn);
1415 fOutputAll->Add(allptPBkg);
1416 fOutputAll->Add(allptPiPSgn);
1417 fOutputAll->Add(allptPiPBkg);
1418 fOutputAll->Add(allptPiMSgn);
1419 fOutputAll->Add(allptPiMBkg);
1420 fOutputAll->Add(allmassLambdaSgn);
1421 fOutputAll->Add(allmassLambdaBkg);
1422 fOutputAll->Add(allmassLambdaBarSgn);
1423 fOutputAll->Add(allmassLambdaBarBkg);
1424 fOutputAll->Add(allmassGammaSgn);
1425 fOutputAll->Add(allmassGammaBkg);
1426 fOutputAll->Add(alld0K0SSgn);
1427 fOutputAll->Add(alld0K0SBkg);
1428 fOutputAll->Add(alld0PSgn);
1429 fOutputAll->Add(alld0PBkg);
1430 fOutputAll->Add(allcosPAK0SSgn);
1431 fOutputAll->Add(allcosPAK0SBkg);
1432
1433 fOutputPIDBach->Add(pidptK0SSgn);
1434 fOutputPIDBach->Add(pidptK0SBkg);
1435 fOutputPIDBach->Add(pidptPSgn);
1436 fOutputPIDBach->Add(pidptPBkg);
1437 fOutputPIDBach->Add(pidptPiPSgn);
1438 fOutputPIDBach->Add(pidptPiPBkg);
1439 fOutputPIDBach->Add(pidptPiMSgn);
1440 fOutputPIDBach->Add(pidptPiMBkg);
1441 fOutputPIDBach->Add(pidmassLambdaSgn);
1442 fOutputPIDBach->Add(pidmassLambdaBkg);
1443 fOutputPIDBach->Add(pidmassLambdaBarSgn);
1444 fOutputPIDBach->Add(pidmassLambdaBarBkg);
1445 fOutputPIDBach->Add(pidmassGammaSgn);
1446 fOutputPIDBach->Add(pidmassGammaBkg);
1447 fOutputPIDBach->Add(pidd0K0SSgn);
1448 fOutputPIDBach->Add(pidd0K0SBkg);
1449 fOutputPIDBach->Add(pidd0PSgn);
1450 fOutputPIDBach->Add(pidd0PBkg);
1451 fOutputPIDBach->Add(pidcosPAK0SSgn);
1452 fOutputPIDBach->Add(pidcosPAK0SBkg);
1453
1454 if (fTrackRotation) {
1455
1456 TH2F* pidTRptK0SSgn = (TH2F*)ptK0SSgn->Clone();
1457 TH2F* pidTRptK0SBkg = (TH2F*)ptK0SBkg->Clone();
1458 TH2F* pidTRptPSgn = (TH2F*)ptPSgn->Clone();
1459 TH2F* pidTRptPBkg = (TH2F*)ptPBkg->Clone();
1460 TH2F* pidTRptPiPSgn = (TH2F*)ptPiPSgn->Clone();
1461 TH2F* pidTRptPiPBkg = (TH2F*)ptPiPBkg->Clone();
1462 TH2F* pidTRptPiMSgn = (TH2F*)ptPiMSgn->Clone();
1463 TH2F* pidTRptPiMBkg = (TH2F*)ptPiMBkg->Clone();
1464 TH2F* pidTRmassLambdaSgn = (TH2F*)massLambdaSgn->Clone();
1465 TH2F* pidTRmassLambdaBkg = (TH2F*)massLambdaBkg->Clone();
1466 TH2F* pidTRmassLambdaBarSgn = (TH2F*)massLambdaBarSgn->Clone();
1467 TH2F* pidTRmassLambdaBarBkg = (TH2F*)massLambdaBarBkg->Clone();
1468 TH2F* pidTRmassGammaSgn = (TH2F*)massGammaSgn->Clone();
1469 TH2F* pidTRmassGammaBkg = (TH2F*)massGammaBkg->Clone();
1470 TH2F* pidTRcosPAK0SSgn = (TH2F*)cosPAK0SSgn->Clone();
1471 TH2F* pidTRcosPAK0SBkg = (TH2F*)cosPAK0SBkg->Clone();
1472 fOutputPIDBachTR->Add(pidTRptK0SSgn);
1473 fOutputPIDBachTR->Add(pidTRptK0SBkg);
1474 fOutputPIDBachTR->Add(pidTRptPSgn);
1475 fOutputPIDBachTR->Add(pidTRptPBkg);
1476 fOutputPIDBachTR->Add(pidTRptPiPSgn);
1477 fOutputPIDBachTR->Add(pidTRptPiPBkg);
1478 fOutputPIDBachTR->Add(pidTRptPiMSgn);
1479 fOutputPIDBachTR->Add(pidTRptPiMBkg);
1480 fOutputPIDBachTR->Add(pidTRmassLambdaSgn);
1481 fOutputPIDBachTR->Add(pidTRmassLambdaBkg);
1482 fOutputPIDBachTR->Add(pidTRmassLambdaBarSgn);
1483 fOutputPIDBachTR->Add(pidTRmassLambdaBarBkg);
1484 fOutputPIDBachTR->Add(pidTRmassGammaSgn);
1485 fOutputPIDBachTR->Add(pidTRmassGammaBkg);
1486 fOutputPIDBachTR->Add(pidTRcosPAK0SSgn);
1487 fOutputPIDBachTR->Add(pidTRcosPAK0SBkg);
1488
43c7bace 1489 }
1490
1491
b833016c 1492 } // useOnTheFly
1493
1494
1495 nameHistoSgn="histK0SMassOfflineSgn";
1496 nameHistoBkg="histK0SMassOfflineBkg";
1497 titleHistoSgn="K^{0}_{S} - sgn: invariant mass VS p_{T} - MC; m_{inv}(#pi^{+},#pi^{-}) [GeV/c^{2}]; p_{T}(K^{0}_{S}) [GeV/c]; Entries";
1498 titleHistoBkg="K^{0}_{S} - bkg: invariant mass VS p_{T} - MC; m_{inv}(#pi^{+},#pi^{-}) [GeV/c^{2}]; p_{T}(K^{0}_{S}) [GeV/c]; Entries";
1499 TH2F* spectrumK0SMassOfflineSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),1000,mK0SPDG-0.050,mK0SPDG+0.050,41,binLimpTprong);
1500 TH2F* spectrumK0SMassOfflineBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),1000,mK0SPDG-0.050,mK0SPDG+0.050,41,binLimpTprong);
1501
1502 nameHistoSgn="histLcMassByK0SOfflineSgn";
1503 nameHistoBkg="histLcMassByK0SOfflineBkg";
1504 titleHistoSgn="#Lambda_{c} - sgn: invariant mass (by K^{0}_{S}) vs p_{T} - MC; m_{inv}(p,K^{0}_{S}) [GeV/c^{2}]; p_{T}(#Lambda_{c}) [GeV/c]";
1505 titleHistoBkg="#Lambda_{c} - bkg: invariant mass (by K^{0}_{S}) vs p_{T} - MC; m_{inv}(p,K^{0}_{S}) [GeV/c^{2}]; p_{T}(#Lambda_{c}) [GeV/c]";
1506 TH2F* spectrumLcMassOfflineByK0SSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),1000,mLcPDG-0.250,mLcPDG+0.250,11,binLimpTLc);
1507 TH2F* spectrumLcMassOfflineByK0SBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),1000,mLcPDG-0.250,mLcPDG+0.250,11,binLimpTLc);
1508
1509 nameHistoSgn="histpK0SvspOfflineSgn";
1510 nameHistoBkg="histpK0SvspOfflineBkg";
1511 titleHistoSgn="#Lambda_{c} - sgn: K^{0}_{S} vs p Total Momentum Distribution - Offline - MC; p(p) [GeV/c]; p(K^{0}_{S}) [GeV/c]";
1512 titleHistoBkg="#Lambda_{c} - bkg: K^{0}_{S} vs p Total Momentum Distribution - Offline - MC; p(p) [GeV/c]; p(K^{0}_{S}) [GeV/c]";
1513 TH2F* momentumDistributionK0SvspOfflineSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),41,binLimpTprong,41,binLimpTprong);
1514 TH2F* momentumDistributionK0SvspOfflineBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),41,binLimpTprong,41,binLimpTprong);
1515
43c7bace 1516 // armenteros-podolanski plots K0S (offline)
b833016c 1517 nameHistoSgn="histArmPodK0SOfflineSgn";
1518 nameHistoBkg="histArmPodK0SOfflineBkg";
1519 titleHistoSgn="K^{0}_{S} Armenteros-Podolanski distribution (sgn) -offline-; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1520 titleHistoBkg="K^{0}_{S} Armenteros-Podolanski distribution (bkg) -offline-; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1521 TH2F* armenterosPodK0SOfflineSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),200,-1.,1.,300,0.,0.3);
1522 TH2F* armenterosPodK0SOfflineBkg = new TH2F(nameHistoBkg.Data(),titleHistoSgn.Data(),200,-1.,1.,300,0.,0.3);
1523
1524 nameHistoSgn="histArmPodLcOfflineSgn";
1525 nameHistoBkg="histArmPodLcOfflineBkg";
1526 titleHistoSgn="#Lambda_{c} Armenteros-Podolanski distribution (sgn) -offline-; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1527 titleHistoBkg="#Lambda_{c} Armenteros-Podolanski distribution (bkg) -offline-; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1528 TH2F* armenterosPodLcOfflineSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),200,-4.,4.,800,0.,1.6);
1529 TH2F* armenterosPodLcOfflineBkg = new TH2F(nameHistoBkg.Data(),titleHistoSgn.Data(),200,-4.,4.,800,0.,1.6);
43c7bace 1530
516f546e 1531
1532 TH2F* allspectrumK0SMassOfflineSgn = (TH2F*)spectrumK0SMassOfflineSgn->Clone();
1533 TH2F* allspectrumK0SMassOfflineBkg = (TH2F*) spectrumK0SMassOfflineBkg->Clone();
1534 TH2F* allspectrumLcMassOfflineByK0SSgn = (TH2F*)spectrumLcMassOfflineByK0SSgn->Clone();
1535 TH2F* allspectrumLcMassOfflineByK0SBkg = (TH2F*) spectrumLcMassOfflineByK0SBkg->Clone();
b833016c 1536 TH2F* allmomentumDistributionK0SvspOfflineSgn = (TH2F*)momentumDistributionK0SvspOfflineSgn->Clone();
1537 TH2F* allmomentumDistributionK0SvspOfflineBkg = (TH2F*)momentumDistributionK0SvspOfflineBkg->Clone();
1538 TH2F* allArmenterosPodK0SOfflineSgn = (TH2F*)armenterosPodK0SOfflineSgn->Clone();
1539 TH2F* allArmenterosPodK0SOfflineBkg = (TH2F*)armenterosPodK0SOfflineBkg->Clone();
1540 TH2F* allArmenterosPodLcOfflineSgn = (TH2F*)armenterosPodLcOfflineSgn->Clone();
1541 TH2F* allArmenterosPodLcOfflineBkg = (TH2F*)armenterosPodLcOfflineBkg->Clone();
1542
1543 TH2F* pidBachspectrumLcMassOfflineByK0SSgn = (TH2F*)spectrumLcMassOfflineByK0SSgn->Clone();
1544 TH2F* pidBachspectrumLcMassOfflineByK0SBkg = (TH2F*) spectrumLcMassOfflineByK0SBkg->Clone();
1545 TH2F* pidBachspectrumK0SMassOfflineSgn = (TH2F*)spectrumK0SMassOfflineSgn->Clone();
516f546e 1546 TH2F* pidBachspectrumK0SMassOfflineBkg = (TH2F*) spectrumK0SMassOfflineBkg->Clone();
b833016c 1547 TH2F* pidBachmomentumDistributionK0SvspOfflineSgn = (TH2F*)momentumDistributionK0SvspOfflineSgn->Clone();
1548 TH2F* pidBachmomentumDistributionK0SvspOfflineBkg = (TH2F*)momentumDistributionK0SvspOfflineBkg->Clone();
1549 TH2F* pidBachArmenterosPodK0SOfflineSgn = (TH2F*)armenterosPodK0SOfflineSgn->Clone();
1550 TH2F* pidBachArmenterosPodK0SOfflineBkg = (TH2F*)armenterosPodK0SOfflineBkg->Clone();
1551 TH2F* pidBachArmenterosPodLcOfflineSgn = (TH2F*)armenterosPodLcOfflineSgn->Clone();
1552 TH2F* pidBachArmenterosPodLcOfflineBkg = (TH2F*)armenterosPodLcOfflineBkg->Clone();
43c7bace 1553
516f546e 1554 fOutputAll->Add(allspectrumK0SMassOfflineSgn);
1555 fOutputAll->Add(allspectrumK0SMassOfflineBkg);
1556 fOutputAll->Add(allspectrumLcMassOfflineByK0SSgn);
1557 fOutputAll->Add(allspectrumLcMassOfflineByK0SBkg);
b833016c 1558 fOutputAll->Add(allmomentumDistributionK0SvspOfflineSgn);
1559 fOutputAll->Add(allmomentumDistributionK0SvspOfflineBkg);
1560 fOutputAll->Add(allArmenterosPodK0SOfflineSgn);
1561 fOutputAll->Add(allArmenterosPodK0SOfflineBkg);
1562 fOutputAll->Add(allArmenterosPodLcOfflineSgn);
1563 fOutputAll->Add(allArmenterosPodLcOfflineBkg);
516f546e 1564
1565 fOutputPIDBach->Add(pidBachspectrumK0SMassOfflineSgn);
1566 fOutputPIDBach->Add(pidBachspectrumK0SMassOfflineBkg);
1567 fOutputPIDBach->Add(pidBachspectrumLcMassOfflineByK0SSgn);
1568 fOutputPIDBach->Add(pidBachspectrumLcMassOfflineByK0SBkg);
b833016c 1569 fOutputPIDBach->Add(pidBachmomentumDistributionK0SvspOfflineSgn);
1570 fOutputPIDBach->Add(pidBachmomentumDistributionK0SvspOfflineBkg);
1571 fOutputPIDBach->Add(pidBachArmenterosPodK0SOfflineSgn);
1572 fOutputPIDBach->Add(pidBachArmenterosPodK0SOfflineBkg);
1573 fOutputPIDBach->Add(pidBachArmenterosPodLcOfflineSgn);
1574 fOutputPIDBach->Add(pidBachArmenterosPodLcOfflineBkg);
1575
1576 nameHistoSgn="histArmPodK0SOfflineSgn0";
1577 nameHistoBkg="histArmPodK0SOfflineBkg0";
1578 titleHistoSgn="K^{0}_{S} Armenteros-Podolanski distribution (sgn) -offline-; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1579 titleHistoBkg="K^{0}_{S} Armenteros-Podolanski distribution (bkg) -offline-; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1580 TH2F* armenterosPodK0SOfflineSgn0 = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),200,-1.,1.,300,0.,0.3);
1581 TH2F* armenterosPodK0SOfflineBkg0 = new TH2F(nameHistoBkg.Data(),titleHistoSgn.Data(),200,-1.,1.,300,0.,0.3);
1582 nameHistoSgn="histArmPodLcOfflineSgn0";
1583 nameHistoBkg="histArmPodLcOfflineBkg0";
1584 titleHistoSgn="#Lambda_{c} Armenteros-Podolanski distribution (sgn) -offline-; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1585 titleHistoBkg="#Lambda_{c} Armenteros-Podolanski distribution (bkg) -offline-; #frac{p_{L}^{+}-p_{L}^{-}}{p_{L}^{+}+p_{L}^{-}}; p_{T}^{+} [GeV/c]";
1586 TH2F* armenterosPodLcOfflineSgn0 = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),200,-4.,4.,800,0.,1.6);
1587 TH2F* armenterosPodLcOfflineBkg0 = new TH2F(nameHistoBkg.Data(),titleHistoSgn.Data(),200,-4.,4.,800,0.,1.6);
1588 fOutputAll->Add(armenterosPodK0SOfflineSgn0);
1589 fOutputAll->Add(armenterosPodK0SOfflineBkg0);
1590 fOutputAll->Add(armenterosPodLcOfflineSgn0);
1591 fOutputAll->Add(armenterosPodLcOfflineBkg0);
43c7bace 1592
516f546e 1593 if (fTrackRotation) {
1594 TH2F* pidBachTRspectrumLcMassOfflineByK0SSgn = (TH2F*)spectrumLcMassOfflineByK0SSgn->Clone();
1595 TH2F* pidBachTRspectrumLcMassOfflineByK0SBkg = (TH2F*) spectrumLcMassOfflineByK0SBkg->Clone();
1596 fOutputPIDBachTR->Add(pidBachTRspectrumLcMassOfflineByK0SSgn);
1597 fOutputPIDBachTR->Add(pidBachTRspectrumLcMassOfflineByK0SBkg);
1598 }
1599
b833016c 1600
1601
1602
1603 nameHistoSgn="histptK0SOfflineSgn";
1604 nameHistoBkg="histptK0SOfflineBkg";
1605 titleHistoSgn="p_{T}(K^{0}_{S}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(K^{0}_{S}) [GeV/c]; Entries";
1606 titleHistoBkg="p_{T}(K^{0}_{S}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(K^{0}_{S}) [GeV/c]; Entries";
1607 TH2F* ptK0SOfflineSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,41,binLimpTprong);
1608 TH2F* ptK0SOfflineBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,41,binLimpTprong);
1609
1610 nameHistoSgn="histptPOfflineSgn";
1611 nameHistoBkg="histptPOfflineBkg";
1612 titleHistoSgn="p_{T}(p) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(p) [GeV/c]; Entries";
1613 titleHistoBkg="p_{T}(p) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(p) [GeV/c]; Entries";
1614 TH2F* ptPOfflineSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,41,binLimpTprong);
1615 TH2F* ptPOfflineBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,41,binLimpTprong);
1616
1617 nameHistoSgn="histptPipOfflineSgn";
1618 nameHistoBkg="histptPipOfflineBkg";
1619 titleHistoSgn="p_{T}(#pi^{+}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(#pi^{+}) [GeV/c]; Entries";
1620 titleHistoBkg="p_{T}(#pi^{+}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(#pi^{+}) [GeV/c]; Entries";
1621 TH2F* ptPiPOfflineSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,41,binLimpTprong);
1622 TH2F* ptPiPOfflineBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,41,binLimpTprong);
1623
1624 nameHistoSgn="histptPimOfflineSgn";
1625 nameHistoBkg="histptPimOfflineBkg";
1626 titleHistoSgn="p_{T}(#pi^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(#pi^{-}) [GeV/c]; Entries";
1627 titleHistoBkg="p_{T}(#pi^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; p_{T}(#pi^{-}) [GeV/c]; Entries";
1628 TH2F* ptPiMOfflineSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,41,binLimpTprong);
1629 TH2F* ptPiMOfflineBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,41,binLimpTprong);
1630
1631 nameHistoSgn="histLambdaMassOfflineSgn";
1632 nameHistoBkg="histLambdaMassOfflineBkg";
1633 titleHistoSgn="m_{inv}(p,#pi^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(p,#pi^{-}) [GeV/c^{2}]; Entries";
1634 titleHistoBkg="m_{inv}(p,#pi^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(p,#pi^{-}) [GeV/c^{2}]; Entries";
1635 TH2F* massLambdaOfflineSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,1000,mMinLambdaPDG,mMinLambdaPDG+0.5);
1636 TH2F* massLambdaOfflineBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,1000,mMinLambdaPDG,mMinLambdaPDG+0.5);
1637
1638 nameHistoSgn="histLambdaBarMassOfflineSgn";
1639 nameHistoBkg="histLambdaBarMassOfflineBkg";
1640 titleHistoSgn="m_{inv}(#bar{p},#pi^{+}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(#bar{p},#pi^{+}) [GeV/c^{2}]; Entries";
1641 titleHistoBkg="m_{inv}(#bar{p},#pi^{+}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(#bar{p},#pi^{+}) [GeV/c^{2}]; Entries";
1642 TH2F* massLambdaBarOfflineSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,1000,mMinLambdaPDG,mMinLambdaPDG+0.5);
1643 TH2F* massLambdaBarOfflineBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,1000,mMinLambdaPDG,mMinLambdaPDG+0.5);
1644
1645 nameHistoSgn="histGammaMassOfflineSgn";
1646 nameHistoBkg="histGammaMassOfflineBkg";
1647 titleHistoSgn="m_{inv}(e^{+},e^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(e^{+},e^{-}) [GeV/c^{2}]; Entries";
1648 titleHistoBkg="m_{inv}(e^{+},e^{-}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; m_{inv}(e^{+},e^{-}) [GeV/c^{2}]; Entries";
1649 TH2F* massGammaOfflineSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,100,0.,1.);
1650 TH2F* massGammaOfflineBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,100,0.,1.);
1651
1652 nameHistoSgn="histD0K0SOfflineSgn";
1653 nameHistoBkg="histD0K0SOfflineBkg";
1654 titleHistoSgn="d_{0}(K^{0}_{S}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; d_{0}(K^{0}_{S}) [#sigmas]; Entries";
1655 titleHistoBkg="d_{0}(K^{0}_{S}) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; d_{0}(K^{0}_{S}) [#sigmas]; Entries";
1656 TH2F* d0K0SOfflineSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,1000,-1.,1.);
1657 TH2F* d0K0SOfflineBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,1000,-1.,1.);
1658
1659 nameHistoSgn="histD0POfflineSgn";
1660 nameHistoBkg="histD0POfflineBkg";
1661 titleHistoSgn="d_{0}(p) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; d_{0}(p) [cm]; Entries";
1662 titleHistoBkg="d_{0}(p) vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; d_{0}(p) [cm]; Entries";
1663 TH2F* d0POfflineSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),11,binLimpTLc,1000,-1.,1.);
1664 TH2F* d0POfflineBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),11,binLimpTLc,1000,-1.,1.);
1665
1666 nameHistoSgn="histCosPAK0SOfflineSgn";
1667 nameHistoBkg="histCosPAK0SOfflineBkg";
1668 titleHistoSgn="K^{0}_{S} cosine of pointing angle wrt primary vertex vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; cosine; Entries";
1669 titleHistoBkg="K^{0}_{S} cosine of pointing angle wrt primary vertex vs p_{T}(#Lambda_{c}); p_{T}(#Lambda_{c}) [GeV/c]; cosine; Entries";
1670 TH2F *cosPAK0SOfflineSgn = new TH2F(nameHistoSgn.Data(),titleHistoSgn.Data(),41,binLimpTprong,100,0.99,1.);
1671 TH2F *cosPAK0SOfflineBkg = new TH2F(nameHistoBkg.Data(),titleHistoBkg.Data(),41,binLimpTprong,100,0.99,1.);
1672
1673 TH2F* allptK0SOfflineSgn = (TH2F*)ptK0SOfflineSgn->Clone();
1674 TH2F* allptK0SOfflineBkg = (TH2F*)ptK0SOfflineBkg->Clone();
1675 TH2F* allptPOfflineSgn = (TH2F*)ptPOfflineSgn->Clone();
1676 TH2F* allptPOfflineBkg = (TH2F*)ptPOfflineBkg->Clone();
1677 TH2F* allptPiPOfflineSgn = (TH2F*)ptPiPOfflineSgn->Clone();
1678 TH2F* allptPiPOfflineBkg = (TH2F*)ptPiPOfflineBkg->Clone();
1679 TH2F* allptPiMOfflineSgn = (TH2F*)ptPiMOfflineSgn->Clone();
1680 TH2F* allptPiMOfflineBkg = (TH2F*)ptPiMOfflineBkg->Clone();
1681 TH2F* allmassLambdaOfflineSgn = (TH2F*)massLambdaOfflineSgn->Clone();
1682 TH2F* allmassLambdaOfflineBkg = (TH2F*)massLambdaOfflineBkg->Clone();
1683 TH2F* allmassLambdaBarOfflineSgn = (TH2F*)massLambdaBarOfflineSgn->Clone();
1684 TH2F* allmassLambdaBarOfflineBkg = (TH2F*)massLambdaBarOfflineBkg->Clone();
1685 TH2F* allmassGammaOfflineSgn = (TH2F*)massGammaOfflineSgn->Clone();
1686 TH2F* allmassGammaOfflineBkg = (TH2F*)massGammaOfflineBkg->Clone();
1687 TH2F* alld0K0SOfflineSgn = (TH2F*)d0K0SOfflineSgn->Clone();
1688 TH2F* alld0K0SOfflineBkg = (TH2F*)d0K0SOfflineBkg->Clone();
1689 TH2F* alld0POfflineSgn = (TH2F*)d0POfflineSgn->Clone();
1690 TH2F* alld0POfflineBkg = (TH2F*)d0POfflineBkg->Clone();
1691 TH2F* allcosPAK0SOfflineSgn = (TH2F*)cosPAK0SOfflineSgn->Clone();
1692 TH2F* allcosPAK0SOfflineBkg = (TH2F*)cosPAK0SOfflineBkg->Clone();
1693
1694 TH2F* pidptK0SOfflineSgn = (TH2F*)ptK0SOfflineSgn->Clone();
1695 TH2F* pidptK0SOfflineBkg = (TH2F*)ptK0SOfflineBkg->Clone();
1696 TH2F* pidptPOfflineSgn = (TH2F*)ptPOfflineSgn->Clone();
1697 TH2F* pidptPOfflineBkg = (TH2F*)ptPOfflineBkg->Clone();
1698 TH2F* pidptPiPOfflineSgn = (TH2F*)ptPiPOfflineSgn->Clone();
1699 TH2F* pidptPiPOfflineBkg = (TH2F*)ptPiPOfflineBkg->Clone();
1700 TH2F* pidptPiMOfflineSgn = (TH2F*)ptPiMOfflineSgn->Clone();
1701 TH2F* pidptPiMOfflineBkg = (TH2F*)ptPiMOfflineBkg->Clone();
1702 TH2F* pidmassLambdaOfflineSgn = (TH2F*)massLambdaOfflineSgn->Clone();
1703 TH2F* pidmassLambdaOfflineBkg = (TH2F*)massLambdaOfflineBkg->Clone();
1704 TH2F* pidmassLambdaBarOfflineSgn = (TH2F*)massLambdaBarOfflineSgn->Clone();
1705 TH2F* pidmassLambdaBarOfflineBkg = (TH2F*)massLambdaBarOfflineBkg->Clone();
1706 TH2F* pidmassGammaOfflineSgn = (TH2F*)massGammaOfflineSgn->Clone();
1707 TH2F* pidmassGammaOfflineBkg = (TH2F*)massGammaOfflineBkg->Clone();
1708 TH2F* pidd0K0SOfflineSgn = (TH2F*)d0K0SOfflineSgn->Clone();
1709 TH2F* pidd0K0SOfflineBkg = (TH2F*)d0K0SOfflineBkg->Clone();
1710 TH2F* pidd0POfflineSgn = (TH2F*)d0POfflineSgn->Clone();
1711 TH2F* pidd0POfflineBkg = (TH2F*)d0POfflineBkg->Clone();
1712 TH2F* pidcosPAK0SOfflineSgn = (TH2F*)cosPAK0SOfflineSgn->Clone();
1713 TH2F* pidcosPAK0SOfflineBkg = (TH2F*)cosPAK0SOfflineBkg->Clone();
1714
1715 fOutputAll->Add(allptK0SOfflineSgn);
1716 fOutputAll->Add(allptK0SOfflineBkg);
1717 fOutputAll->Add(allptPOfflineSgn);
1718 fOutputAll->Add(allptPOfflineBkg);
1719 fOutputAll->Add(allptPiPOfflineSgn);
1720 fOutputAll->Add(allptPiPOfflineBkg);
1721 fOutputAll->Add(allptPiMOfflineSgn);
1722 fOutputAll->Add(allptPiMOfflineBkg);
1723 fOutputAll->Add(allmassLambdaOfflineSgn);
1724 fOutputAll->Add(allmassLambdaOfflineBkg);
1725 fOutputAll->Add(allmassLambdaBarOfflineSgn);
1726 fOutputAll->Add(allmassLambdaBarOfflineBkg);
1727 fOutputAll->Add(allmassGammaOfflineSgn);
1728 fOutputAll->Add(allmassGammaOfflineBkg);
1729 fOutputAll->Add(alld0K0SOfflineSgn);
1730 fOutputAll->Add(alld0K0SOfflineBkg);
1731 fOutputAll->Add(alld0POfflineSgn);
1732 fOutputAll->Add(alld0POfflineBkg);
1733 fOutputAll->Add(allcosPAK0SOfflineSgn);
1734 fOutputAll->Add(allcosPAK0SOfflineBkg);
1735
1736 fOutputPIDBach->Add(pidptK0SOfflineSgn);
1737 fOutputPIDBach->Add(pidptK0SOfflineBkg);
1738 fOutputPIDBach->Add(pidptPOfflineSgn);
1739 fOutputPIDBach->Add(pidptPOfflineBkg);
1740 fOutputPIDBach->Add(pidptPiPOfflineSgn);
1741 fOutputPIDBach->Add(pidptPiPOfflineBkg);
1742 fOutputPIDBach->Add(pidptPiMOfflineSgn);
1743 fOutputPIDBach->Add(pidptPiMOfflineBkg);
1744 fOutputPIDBach->Add(pidmassLambdaOfflineSgn);
1745 fOutputPIDBach->Add(pidmassLambdaOfflineBkg);
1746 fOutputPIDBach->Add(pidmassLambdaBarOfflineSgn);
1747 fOutputPIDBach->Add(pidmassLambdaBarOfflineBkg);
1748 fOutputPIDBach->Add(pidmassGammaOfflineSgn);
1749 fOutputPIDBach->Add(pidmassGammaOfflineBkg);
1750 fOutputPIDBach->Add(pidd0K0SOfflineSgn);
1751 fOutputPIDBach->Add(pidd0K0SOfflineBkg);
1752 fOutputPIDBach->Add(pidd0POfflineSgn);
1753 fOutputPIDBach->Add(pidd0POfflineBkg);
1754 fOutputPIDBach->Add(pidcosPAK0SOfflineSgn);
1755 fOutputPIDBach->Add(pidcosPAK0SOfflineBkg);
1756
1757 if (fTrackRotation) {
1758
1759 TH2F* pidTRptK0SOfflineSgn = (TH2F*)ptK0SOfflineSgn->Clone();
1760 TH2F* pidTRptK0SOfflineBkg = (TH2F*)ptK0SOfflineBkg->Clone();
1761 TH2F* pidTRptPOfflineSgn = (TH2F*)ptPOfflineSgn->Clone();
1762 TH2F* pidTRptPOfflineBkg = (TH2F*)ptPOfflineBkg->Clone();
1763 TH2F* pidTRptPiPOfflineSgn = (TH2F*)ptPiPOfflineSgn->Clone();
1764 TH2F* pidTRptPiPOfflineBkg = (TH2F*)ptPiPOfflineBkg->Clone();
1765 TH2F* pidTRptPiMOfflineSgn = (TH2F*)ptPiMOfflineSgn->Clone();
1766 TH2F* pidTRptPiMOfflineBkg = (TH2F*)ptPiMOfflineBkg->Clone();
1767 TH2F* pidTRmassLambdaOfflineSgn = (TH2F*)massLambdaOfflineSgn->Clone();
1768 TH2F* pidTRmassLambdaOfflineBkg = (TH2F*)massLambdaOfflineBkg->Clone();
1769 TH2F* pidTRmassLambdaBarOfflineSgn = (TH2F*)massLambdaBarOfflineSgn->Clone();
1770 TH2F* pidTRmassLambdaBarOfflineBkg = (TH2F*)massLambdaBarOfflineBkg->Clone();
1771 TH2F* pidTRmassGammaOfflineSgn = (TH2F*)massGammaOfflineSgn->Clone();
1772 TH2F* pidTRmassGammaOfflineBkg = (TH2F*)massGammaOfflineBkg->Clone();
1773 TH2F* pidTRcosPAK0SOfflineSgn = (TH2F*)cosPAK0SOfflineSgn->Clone();
1774 TH2F* pidTRcosPAK0SOfflineBkg = (TH2F*)cosPAK0SOfflineBkg->Clone();
1775 fOutputPIDBachTR->Add(pidTRptK0SOfflineSgn);
1776 fOutputPIDBachTR->Add(pidTRptK0SOfflineBkg);
1777 fOutputPIDBachTR->Add(pidTRptPOfflineSgn);
1778 fOutputPIDBachTR->Add(pidTRptPOfflineBkg);
1779 fOutputPIDBachTR->Add(pidTRptPiPOfflineSgn);
1780 fOutputPIDBachTR->Add(pidTRptPiPOfflineBkg);
1781 fOutputPIDBachTR->Add(pidTRptPiMOfflineSgn);
1782 fOutputPIDBachTR->Add(pidTRptPiMOfflineBkg);
1783 fOutputPIDBachTR->Add(pidTRmassLambdaOfflineSgn);
1784 fOutputPIDBachTR->Add(pidTRmassLambdaOfflineBkg);
1785 fOutputPIDBachTR->Add(pidTRmassLambdaBarOfflineSgn);
1786 fOutputPIDBachTR->Add(pidTRmassLambdaBarOfflineBkg);
1787 fOutputPIDBachTR->Add(pidTRmassGammaOfflineSgn);
1788 fOutputPIDBachTR->Add(pidTRmassGammaOfflineBkg);
1789 fOutputPIDBachTR->Add(pidTRcosPAK0SOfflineSgn);
1790 fOutputPIDBachTR->Add(pidTRcosPAK0SOfflineBkg);
1791
1792 }
1793
1794 } // useMCinfo
516f546e 1795
1796
1797 if (fTrackRotation) {
1798
b833016c 1799 TH3F *phiVSthetaVSpt = new TH3F("phiVSthetaVSpt","",35,0.,35.,360,0.,2.*TMath::Pi(),100,40.*TMath::DegToRad(),140.*TMath::DegToRad());
1800 TH3F *phiVSthetaVSptRot = new TH3F("phiVSthetaVSptRot","",35,0.,35.,360,0.,2.*TMath::Pi(),100,40.*TMath::DegToRad(),140.*TMath::DegToRad());
1801 TH3F *phiVSthetaVSptOffline = new TH3F("phiVSthetaVSptOffline","",35,0.,35.,360,0.,2.*TMath::Pi(),100,40.*TMath::DegToRad(),140.*TMath::DegToRad());
1802 TH3F *phiVSthetaVSptRotOffline = new TH3F("phiVSthetaVSptRotOffline","",35,0.,35.,360,0.,2.*TMath::Pi(),100,40.*TMath::DegToRad(),140.*TMath::DegToRad());
1803 fOutputPIDBachTR->Add(phiVSthetaVSpt);
1804 fOutputPIDBachTR->Add(phiVSthetaVSptRot);
1805 fOutputPIDBachTR->Add(phiVSthetaVSptOffline);
1806 fOutputPIDBachTR->Add(phiVSthetaVSptRotOffline);
1807
1808 TH1F *hNormRotated=new TH1F("hNormRotated","",fNRotations+1,-0.5,fNRotations+0.5);
1809 TH1F *hNormRotatedOffline=new TH1F("hNormRotatedOffline","",fNRotations+1,-0.5,fNRotations+0.5);
1810 /*
516f546e 1811 hNormRotated->Sumw2();
1812 hNormRotatedOffline->Sumw2();
b833016c 1813
516f546e 1814 hNormRotated->SetMinimum(0);
1815 hNormRotatedOffline->SetMinimum(0);
b833016c 1816 */
516f546e 1817
1818 fOutputPIDBachTR->Add(hNormRotated);
1819 fOutputPIDBachTR->Add(hNormRotatedOffline);
516f546e 1820
b833016c 1821 if (fUseMCInfo) {
516f546e 1822
b833016c 1823 TH3F *phiVSthetaVSptSgn = new TH3F("phiVSthetaVSptSgn","",35,0.,35.,360,0.,2.*TMath::Pi(),100,40.*TMath::DegToRad(),140.*TMath::DegToRad());
1824 TH3F *phiVSthetaVSptRotSgn = new TH3F("phiVSthetaVSptRotSgn","",35,0.,35.,360,0.,2.*TMath::Pi(),100,40.*TMath::DegToRad(),140.*TMath::DegToRad());
1825 TH3F *phiVSthetaVSptOfflineSgn = new TH3F("phiVSthetaVSptOfflineSgn","",35,0.,35.,360,0.,2.*TMath::Pi(),100,40.*TMath::DegToRad(),140.*TMath::DegToRad());
1826 TH3F *phiVSthetaVSptRotOfflineSgn = new TH3F("phiVSthetaVSptRotOfflineSgn","",35,0.,35.,360,0.,2.*TMath::Pi(),100,40.*TMath::DegToRad(),140.*TMath::DegToRad());
1827 fOutputPIDBachTR->Add(phiVSthetaVSptSgn);
1828 fOutputPIDBachTR->Add(phiVSthetaVSptRotSgn);
1829 fOutputPIDBachTR->Add(phiVSthetaVSptOfflineSgn);
1830 fOutputPIDBachTR->Add(phiVSthetaVSptRotOfflineSgn);
1831
1832 TH3F *phiVSthetaVSptBkg = new TH3F("phiVSthetaVSptBkg","",35,0.,35.,360,0.,2.*TMath::Pi(),100,40.*TMath::DegToRad(),140.*TMath::DegToRad());
1833 TH3F *phiVSthetaVSptRotBkg = new TH3F("phiVSthetaVSptRotBkg","",35,0.,35.,360,0.,2.*TMath::Pi(),100,40.*TMath::DegToRad(),140.*TMath::DegToRad());
1834 TH3F *phiVSthetaVSptOfflineBkg = new TH3F("phiVSthetaVSptOfflineBkg","",35,0.,35.,360,0.,2.*TMath::Pi(),100,40.*TMath::DegToRad(),140.*TMath::DegToRad());
1835 TH3F *phiVSthetaVSptRotOfflineBkg = new TH3F("phiVSthetaVSptRotOfflineBkg","",35,0.,35.,360,0.,2.*TMath::Pi(),100,40.*TMath::DegToRad(),140.*TMath::DegToRad());
1836 fOutputPIDBachTR->Add(phiVSthetaVSptBkg);
1837 fOutputPIDBachTR->Add(phiVSthetaVSptRotBkg);
1838 fOutputPIDBachTR->Add(phiVSthetaVSptOfflineBkg);
1839 fOutputPIDBachTR->Add(phiVSthetaVSptRotOfflineBkg);
1840
1841 TH1F *hNormRotatedSgn=new TH1F("hNormRotatedSgn","",fNRotations+1,-0.5,fNRotations+0.5);
1842 TH1F *hNormRotatedOfflineSgn=new TH1F("hNormRotatedOfflineSgn","",fNRotations+1,-0.5,fNRotations+0.5);
1843 TH1F *hNormRotatedBkg=new TH1F("hNormRotatedBkg","",fNRotations+1,-0.5,fNRotations+0.5);
1844 TH1F *hNormRotatedOfflineBkg=new TH1F("hNormRotatedOfflineBkg","",fNRotations+1,-0.5,fNRotations+0.5);
1845 /*
1846 hNormRotatedSgn->Sumw2();
1847 hNormRotatedOfflineSgn->Sumw2();
1848 hNormRotatedBkg->Sumw2();
1849 hNormRotatedOfflineBkg->Sumw2();
1850
1851 hNormRotatedSgn->SetMinimum(0);
1852 hNormRotatedOfflineSgn->SetMinimum(0);
1853 hNormRotatedBkg->SetMinimum(0);
1854 hNormRotatedOfflineBkg->SetMinimum(0);
1855 */
1856
1857 fOutputPIDBachTR->Add(hNormRotatedSgn);
1858 fOutputPIDBachTR->Add(hNormRotatedOfflineSgn);
1859 fOutputPIDBachTR->Add(hNormRotatedBkg);
1860 fOutputPIDBachTR->Add(hNormRotatedOfflineBkg);
1861
1862 }
1863
5f20cf43 1864 Int_t nMassBins=(Int_t)(fMaxMass*1000.-fMinMass*1000.);
b833016c 1865 Double_t maxm=fMinMass+nMassBins*0.001;
1866 TH3F *hMassVsPtVsY=new TH3F("hMassVsPtVsY","",nMassBins,fMinMass,maxm,15,0.,15.,20,-1.,1.);
1867 TH3F *hMassVsPtVsYOffline=new TH3F("hMassVsPtVsYOffline","",nMassBins,fMinMass,maxm,15,0.,15.,20,-1.,1.);
1868 /*
516f546e 1869 hMassVsPtVsY->Sumw2();
1870 hMassVsPtVsYOffline->Sumw2();
b833016c 1871
516f546e 1872 hMassVsPtVsY->SetMinimum(0);
1873 hMassVsPtVsYOffline->SetMinimum(0);
b833016c 1874 */
516f546e 1875
1876 fOutputPIDBachTR->Add(hMassVsPtVsY);
1877 fOutputPIDBachTR->Add(hMassVsPtVsYOffline);
516f546e 1878
b833016c 1879 if (fUseMCInfo) {
1880
1881 TH3F *hMassVsPtVsYSgn=new TH3F("hMassVsPtVsYSgn","",nMassBins,fMinMass,maxm,15,0.,15.,20,-1.,1.);
1882 TH3F *hMassVsPtVsYOfflineSgn=new TH3F("hMassVsPtVsYOfflineSgn","",nMassBins,fMinMass,maxm,15,0.,15.,20,-1.,1.);
1883 TH3F *hMassVsPtVsYBkg=new TH3F("hMassVsPtVsYBkg","",nMassBins,fMinMass,maxm,15,0.,15.,20,-1.,1.);
1884 TH3F *hMassVsPtVsYOfflineBkg=new TH3F("hMassVsPtVsYOfflineBkg","",nMassBins,fMinMass,maxm,15,0.,15.,20,-1.,1.);
1885
1886 /*
1887 hMassVsPtVsYSgn->Sumw2();
1888 hMassVsPtVsYOfflineSgn->Sumw2();
1889 hMassVsPtVsYBkg->Sumw2();
1890 hMassVsPtVsYOfflineBkg->Sumw2();
1891
1892 hMassVsPtVsYSgn->SetMinimum(0);
1893 hMassVsPtVsYOfflineSgn->SetMinimum(0);
1894 hMassVsPtVsYBkg->SetMinimum(0);
1895 hMassVsPtVsYOfflineBkg->SetMinimum(0);
1896 */
1897
1898 fOutputPIDBachTR->Add(hMassVsPtVsYSgn);
1899 fOutputPIDBachTR->Add(hMassVsPtVsYOfflineSgn);
1900 fOutputPIDBachTR->Add(hMassVsPtVsYBkg);
1901 fOutputPIDBachTR->Add(hMassVsPtVsYOfflineBkg);
1902
1903 }
1904
1905 TH3F *hMassVsPtVsYRot=new TH3F("hMassVsPtVsYRot","",nMassBins,fMinMass,maxm,15,0.,15.,20,-1.,1.);
1906 TH3F *hMassVsPtVsYRotOffline=new TH3F("hMassVsPtVsYRotOffline","",nMassBins,fMinMass,maxm,15,0.,15.,20,-1.,1.);
1907 /*
516f546e 1908 hMassVsPtVsYRot->Sumw2();
1909 hMassVsPtVsYRotOffline->Sumw2();
b833016c 1910
516f546e 1911 hMassVsPtVsYRot->SetMinimum(0);
1912 hMassVsPtVsYRotOffline->SetMinimum(0);
b833016c 1913 */
516f546e 1914
1915 fOutputPIDBachTR->Add(hMassVsPtVsYRot);
1916 fOutputPIDBachTR->Add(hMassVsPtVsYRotOffline);
516f546e 1917
b833016c 1918 if (fUseMCInfo) {
1919
1920 TH3F *hMassVsPtVsYRotSgn=new TH3F("hMassVsPtVsYRotSgn","",nMassBins,fMinMass,maxm,15,0.,15.,20,-1.,1.);
1921 TH3F *hMassVsPtVsYRotOfflineSgn=new TH3F("hMassVsPtVsYRotOfflineSgn","",nMassBins,fMinMass,maxm,15,0.,15.,20,-1.,1.);
1922 TH3F *hMassVsPtVsYRotBkg=new TH3F("hMassVsPtVsYRotBkg","",nMassBins,fMinMass,maxm,15,0.,15.,20,-1.,1.);
1923 TH3F *hMassVsPtVsYRotOfflineBkg=new TH3F("hMassVsPtVsYRotOfflineBkg","",nMassBins,fMinMass,maxm,15,0.,15.,20,-1.,1.);
1924 /*
1925 hMassVsPtVsYRotSgn->Sumw2();
1926 hMassVsPtVsYRotOfflineSgn->Sumw2();
1927 hMassVsPtVsYRotBkg->Sumw2();
1928 hMassVsPtVsYRotOfflineBkg->Sumw2();
1929
1930 hMassVsPtVsYRotSgn->SetMinimum(0);
1931 hMassVsPtVsYRotOfflineSgn->SetMinimum(0);
1932 hMassVsPtVsYRotBkg->SetMinimum(0);
1933 hMassVsPtVsYRotOfflineBkg->SetMinimum(0);
1934 */
1935
1936 fOutputPIDBachTR->Add(hMassVsPtVsYRotSgn);
1937 fOutputPIDBachTR->Add(hMassVsPtVsYRotOfflineSgn);
1938 fOutputPIDBachTR->Add(hMassVsPtVsYRotBkg);
1939 fOutputPIDBachTR->Add(hMassVsPtVsYRotOfflineBkg);
1940
1941 }
516f546e 1942
1943 TH1F *hDeltaMass=new TH1F("hDeltaMass","",100,-0.4,0.4);
1944 TH1F *hDeltaMassOffline=new TH1F("hDeltaMassOffline","",100,-0.4,0.4);
b833016c 1945 /*
516f546e 1946 hDeltaMass->Sumw2();
1947 hDeltaMassOffline->Sumw2();
516f546e 1948
1949 hDeltaMass->SetMinimum(0);
1950 hDeltaMassOffline->SetMinimum(0);
b833016c 1951 */
516f546e 1952
1953 fOutputPIDBachTR->Add(hDeltaMass);
1954 fOutputPIDBachTR->Add(hDeltaMassOffline);
b833016c 1955
1956 if (fUseMCInfo) {
1957
1958 TH1F *hDeltaMassSgn=new TH1F("hDeltaMassSgn","",100,-0.4,0.4);
1959 TH1F *hDeltaMassOfflineSgn=new TH1F("hDeltaMassOfflineSgn","",100,-0.4,0.4);
1960 TH1F *hDeltaMassBkg=new TH1F("hDeltaMassBkg","",100,-0.4,0.4);
1961 TH1F *hDeltaMassOfflineBkg=new TH1F("hDeltaMassOfflineBkg","",100,-0.4,0.4);
1962 /*
1963 hDeltaMassSgn->Sumw2();
1964 hDeltaMassOfflineSgn->Sumw2();
1965 hDeltaMassBkg->Sumw2();
1966 hDeltaMassOfflineBkg->Sumw2();
1967
1968 hDeltaMassSgn->SetMinimum(0);
1969 hDeltaMassOfflineSgn->SetMinimum(0);
1970 hDeltaMassBkg->SetMinimum(0);
1971 hDeltaMassOfflineBkg->SetMinimum(0);
1972 */
1973
1974 fOutputPIDBachTR->Add(hDeltaMassSgn);
1975 fOutputPIDBachTR->Add(hDeltaMassOfflineSgn);
1976 fOutputPIDBachTR->Add(hDeltaMassBkg);
1977 fOutputPIDBachTR->Add(hDeltaMassOfflineBkg);
1978
1979 }
516f546e 1980
1981 /*
1982 Int_t binSparseDMassRot[5]={nMassBins,100,24,40,20};
1983 Double_t edgeLowSparseDMassRot[5]={fMinMass,-0.4,0.,-4.,0};
1984 Double_t edgeHighSparseDMassRot[5]={maxm,0.4,12.,4.,3.14};
b833016c 1985 THnSparse *hDeltaMassFullAnalysis=new THnSparseF("hDeltaMassFullAnalysis","hDeltaMassFullAnalysis;inv mass (GeV/c);#Delta inv mass (GeV/c); p_{T}^{#Lambda_{c}} (GeV/c); #Delta p_{T} (GeV/c); daughter angle (2prongs) (rad);",5,binSparseDMassRot,edgeLowSparseDMassRot,edgeHighSparseDMassRot);
1986 THnSparse *hDeltaMassFullAnalysisOffline=new THnSparseF("fDeltaMassFullAnalysisOffline","hDeltaMassFullAnalysisOffline;inv mass (GeV/c);#Delta inv mass (GeV/c); p_{T}^{#Lambda_{c}} (GeV/c); #Delta p_{T} (GeV/c); daughter angle (2prongs) (rad);",5,binSparseDMassRot,edgeLowSparseDMassRot,edgeHighSparseDMassRot);
516f546e 1987
1988 fOutputPIDBachTR->Add(hDeltaMassFullAnalysis);
1989 fOutputPIDBachTR->Add(hDeltaMassFullAnalysisOffline);
b833016c 1990
1991 if (fUseMCInfo) {
1992
1993 THnSparse *hDeltaMassFullAnalysisSgn=new THnSparseF("hDeltaMassFullAnalysisSgn","hDeltaMassFullAnalysisSgn;inv mass (GeV/c);#Delta inv mass (GeV/c); p_{T}^{#Lambda_{c}} (GeV/c); #Delta p_{T} (GeV/c); daughter angle (2prongs) (rad);",5,binSparseDMassRot,edgeLowSparseDMassRot,edgeHighSparseDMassRot);
1994 THnSparse *hDeltaMassFullAnalysisOfflineSgn=new THnSparseF("fDeltaMassFullAnalysisOfflineSgn","hDeltaMassFullAnalysisOfflineSgn;inv mass (GeV/c);#Delta inv mass (GeV/c); p_{T}^{#Lambda_{c}} (GeV/c); #Delta p_{T} (GeV/c); daughter angle (2prongs) (rad);",5,binSparseDMassRot,edgeLowSparseDMassRot,edgeHighSparseDMassRot);
1995
1996 THnSparse *hDeltaMassFullAnalysisBkg=new THnSparseF("hDeltaMassFullAnalysisBkg","hDeltaMassFullAnalysisBkg;inv mass (GeV/c);#Delta inv mass (GeV/c); p_{T}^{#Lambda_{c}} (GeV/c); #Delta p_{T} (GeV/c); daughter angle (2prongs) (rad);",5,binSparseDMassRot,edgeLowSparseDMassRot,edgeHighSparseDMassRot);
1997 THnSparse *hDeltaMassFullAnalysisOfflineBkg=new THnSparseF("fDeltaMassFullAnalysisOfflineBkg","hDeltaMassFullAnalysisOfflineBkg;inv mass (GeV/c);#Delta inv mass (GeV/c); p_{T}^{#Lambda_{c}} (GeV/c); #Delta p_{T} (GeV/c); daughter angle (2prongs) (rad);",5,binSparseDMassRot,edgeLowSparseDMassRot,edgeHighSparseDMassRot);
1998
516f546e 1999 fOutputPIDBachTR->Add(hDeltaMassFullAnalysisSgn);
2000 fOutputPIDBachTR->Add(hDeltaMassFullAnalysisOfflineSgn);
2001 fOutputPIDBachTR->Add(hDeltaMassFullAnalysisBkg);
2002 fOutputPIDBachTR->Add(hDeltaMassFullAnalysisOfflineBkg);
b833016c 2003
2004 }
516f546e 2005 */
b833016c 2006
43c7bace 2007 }
2008
b833016c 2009 /*
2010 fOutputAll->Print();
2011 fOutputPIDBach->Print();
2012 if (fTrackRotation) fOutputPIDBachTR->Print();
2013 */
43c7bace 2014 return;
2015}
2016
2017//---------------------------
2018void AliAnalysisTaskSELc2V0bachelor::CheckEventSelection(AliAODEvent *aodEvent) {
2019 //
2020 // To fill control histograms
2021 //
2022
2023 TClonesArray *arrayLctopKos=0;
14666b78 2024 if (!aodEvent){
2025 if(AODEvent() && IsStandardAOD()) {
2026 // In case there is an AOD handler writing a standard AOD, use the AOD
2027 // event in memory rather than the input (ESD) event.
2028 aodEvent = dynamic_cast<AliAODEvent*> (AODEvent());
2029 // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
2030 // have to taken from the AOD event hold by the AliAODExtension
2031 AliAODHandler* aodHandler = (AliAODHandler*)
2032 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
2033
2034 if (aodHandler->GetExtensions()) {
2035 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
2036 AliAODEvent *aodFromExt = ext->GetAOD();
2037 arrayLctopKos=(TClonesArray*)aodFromExt->GetList()->FindObject("CascadesHF");
2038 }
43c7bace 2039 }
2040 } else {
2041 arrayLctopKos=(TClonesArray*)aodEvent->GetList()->FindObject("CascadesHF");
2042 }
2043
2044 Float_t zVertex = fVtx1->GetZ();
2045 TString titleVtx=fVtx1->GetTitle();
2046
2047 if (TMath::Abs(fBzkG)>=0.001) {
2048
2049 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ2")))->Fill(zVertex);
2050
2051 if (arrayLctopKos) {
2052
2053 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ3")))->Fill(zVertex);
2054
2055 // mc analysis
2056 TClonesArray *mcArray = 0;
2057 AliAODMCHeader *mcHeader=0;
2058
2059 if (fUseMCInfo) {
2060 // MC array need for maching
2061 mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
43c7bace 2062
2063 if (mcArray) {
2064 // load MC header
14666b78 2065 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ4")))->Fill(zVertex);
43c7bace 2066 mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
14666b78 2067
2068 if (mcHeader && fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ5")))->Fill(zVertex);
43c7bace 2069
2070 // check on MC Lc Daughter
2071 if (fAdditionalChecks) {
2072 for (Int_t iii=0; iii<mcArray->GetEntries(); iii++)
2073 SearchLcDaughter(mcArray,iii);
2074 }
2075
2076 }
2077
2078 }
2079
2080 if (fVtx1->GetNContributors()>0) {
2081 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ6")))->Fill(zVertex);
2082
2083 TString firedTriggerClasses = aodEvent->GetFiredTriggerClasses(); // trigger class
2084 ULong64_t fTriggerMask=AliVEvent::kAnyINT;
2085 Bool_t check1 = kFALSE;
2086 if ( !fUseMCInfo && // don't do for MC...
2087 (aodEvent->GetRunNumber()<136851 || aodEvent->GetRunNumber()>139517) ) { // ...and for PbPb 2010 data
2088 if ( !(firedTriggerClasses.Contains("CINT1")) ) {
2089 AliInfo(Form(" ======================== firedTriggerClasses.Data() = %s",firedTriggerClasses.Data()));
2090 fCEvents->Fill(8);
2091 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ8")))->Fill(zVertex);
2092 check1 = kTRUE;
2093 }
2094 }
2095
2096 Bool_t isSelectedAAA = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & fTriggerMask);
2097 if (!isSelectedAAA) {
2098 fCEvents->Fill(9);
2099 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ9")))->Fill(zVertex);
2100 }
2101
2102 if (!isSelectedAAA || check1) {
2103 fCEvents->Fill(16);
2104 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ16")))->Fill(zVertex);
2105 }
2106
2107 fTriggerMask=AliVEvent::kAny;
2108 Bool_t isSelectedBBB = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & fTriggerMask);
2109 if (!isSelectedBBB) {
2110 fCEvents->Fill(10);
2111 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ10")))->Fill(zVertex);
2112 }
2113
2114 if (titleVtx.Contains("Z")) {
2115 fCEvents->Fill(11);
2116 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ11")))->Fill(zVertex);
2117 }
2118 else if (titleVtx.Contains("3D")) {
2119 fCEvents->Fill(12);
2120 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ12")))->Fill(zVertex);
2121 } else {
2122 fCEvents->Fill(13);
2123 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ13")))->Fill(zVertex);
2124 }
2125
2126 if (TMath::Abs(zVertex)<=fAnalCuts->GetMaxVtxZ()) {
2127 fCEvents->Fill(14);
2128 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ14")))->Fill(zVertex);
2129 }
2130
2131 if ( fIsEventSelected ) {
2132 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ7")))->Fill(zVertex);
2133 } else {
2134 fCEvents->Fill(15);
2135 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ15")))->Fill(zVertex);
2136 }
2137
2138 } // nContributors>=1
2139 } // analysisArray exists
2140 } // magnetic field exists
2141
2142 return;
2143}
2144
2145//-----------------
2146void AliAnalysisTaskSELc2V0bachelor::CheckEventSelectionWithCandidates(AliAODEvent *aodEvent) {
2147 //
2148 // To fill control histograms
2149 //
2150
2151 Float_t zVertex = fVtx1->GetZ();
2152 TString titleVtx=fVtx1->GetTitle();
2153 TString firedTriggerClasses = aodEvent->GetFiredTriggerClasses(); // trigger class
2154 ULong64_t fTriggerMask=AliVEvent::kAnyINT;
2155
2156 ((TH1F*)(fOutput->FindObject("hEventsWithCandidates")))->Fill(6);
2157 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ6a")))->Fill(zVertex);
2158
2159 Bool_t check1a = kFALSE;
2160 if ( !fUseMCInfo && // don't do for MC...
2161 (aodEvent->GetRunNumber()<136851 || aodEvent->GetRunNumber()>139517) ) { // ...and for PbPb 2010 data
2162 if ( !(firedTriggerClasses.Contains("CINT1")) ) {
2163 AliInfo(Form(" ======================== firedTriggerClasses.Data() = %s",firedTriggerClasses.Data()));
2164 ((TH1F*)(fOutput->FindObject("hEventsWithCandidates")))->Fill(8);
2165 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ8a")))->Fill(zVertex);
2166 check1a = kTRUE;
2167 }
2168 }
2169
2170 Bool_t isSelectedAAAa = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & fTriggerMask);
2171 if (!isSelectedAAAa) {
2172 ((TH1F*)(fOutput->FindObject("hEventsWithCandidates")))->Fill(9);
2173 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ9a")))->Fill(zVertex);
2174 }
2175
2176 if (!isSelectedAAAa || check1a) {
2177 ((TH1F*)(fOutput->FindObject("hEventsWithCandidates")))->Fill(16);
2178 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ16a")))->Fill(zVertex);
2179 }
2180
2181 fTriggerMask=AliVEvent::kAny;
2182 Bool_t isSelectedBBBa = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & fTriggerMask);
2183 if (!isSelectedBBBa) {
2184 ((TH1F*)(fOutput->FindObject("hEventsWithCandidates")))->Fill(10);
2185 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ10a")))->Fill(zVertex);
2186 }
2187
2188 if (titleVtx.Contains("Z")) {
2189 ((TH1F*)(fOutput->FindObject("hEventsWithCandidates")))->Fill(11);
2190 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ11a")))->Fill(zVertex);
2191 }
2192 else if (titleVtx.Contains("3D")) {
2193 ((TH1F*)(fOutput->FindObject("hEventsWithCandidates")))->Fill(12);
2194 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ12a")))->Fill(zVertex);
2195 } else {
2196 ((TH1F*)(fOutput->FindObject("hEventsWithCandidates")))->Fill(13);
2197 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ13a")))->Fill(zVertex);
2198 }
2199
2200 if (TMath::Abs(zVertex)<=fAnalCuts->GetMaxVtxZ()) {
2201 ((TH1F*)(fOutput->FindObject("hEventsWithCandidates")))->Fill(14);
2202 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ14a")))->Fill(zVertex);
2203 }
2204
2205 if ( fIsEventSelected ) {
2206 ((TH1F*)(fOutput->FindObject("hEventsWithCandidates")))->Fill(7);
2207 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ7a")))->Fill(zVertex);
2208 } else {
2209 ((TH1F*)(fOutput->FindObject("hEventsWithCandidates")))->Fill(15);
2210 if (fAdditionalChecks) ((TH1F*)(fOutput->FindObject("hZ15a")))->Fill(zVertex);
2211 }
2212
2213 return;
2214}
2215
2216//-----------------------------
2217Int_t AliAnalysisTaskSELc2V0bachelor::MatchToMC(AliAODRecoCascadeHF *lc2bacV0,
2218 Int_t *pdgDgLc2bacV0, Int_t *pdgDgV0,
2219 TClonesArray *mcArray) {
2220 //
2221 // This is now implemented in AliAODRecoCascadeHF
2222 //
2223
2224 // bachelor
2225 AliAODTrack *bachelor = (AliAODTrack*)lc2bacV0->GetBachelor();
2226 if (!bachelor) return -1;
2227 Int_t labBachelor = TMath::Abs(bachelor->GetLabel());
2228 if (labBachelor<0) return -1;
2229 AliAODMCParticle *partBachelor = (AliAODMCParticle*)mcArray->At(labBachelor);
2230 if (!partBachelor) return -1;
2231 if (TMath::Abs(partBachelor->GetPdgCode())!=pdgDgLc2bacV0[0]) return -1;
2232
2233 Int_t labBacMother = partBachelor->GetMother();
2234 if (labBacMother<0) return -1;
2235 AliAODMCParticle *partBacMother = (AliAODMCParticle*)mcArray->At(labBacMother);
2236 if (!partBacMother) return -1;
2237 if (TMath::Abs(partBacMother->GetPdgCode())!=4122) return -1;
2238
2239 // V0
2240 AliAODTrack *posV0Daugh = (AliAODTrack*)lc2bacV0->Getv0PositiveTrack();
2241 AliAODTrack *negV0Daugh = (AliAODTrack*)lc2bacV0->Getv0NegativeTrack();
2242 if (!posV0Daugh || !negV0Daugh) return -1;
2243
2244 Int_t labV0pos = TMath::Abs(posV0Daugh->GetLabel());
2245 Int_t labV0neg = TMath::Abs(negV0Daugh->GetLabel());
992ba7d8 2246 if (labV0pos<0 || labV0neg<0) return -1;
85036182 2247
992ba7d8 2248 AliAODMCParticle *partV0pos = (AliAODMCParticle*)mcArray->At(labV0neg);
2249 AliAODMCParticle *partV0neg = (AliAODMCParticle*)mcArray->At(labV0pos);
85036182 2250 if (!partV0pos || !partV0neg) return -1;
992ba7d8 2251
2252 if ( ! ( (TMath::Abs(partV0pos->GetPdgCode())==pdgDgV0[0] &&
2253 TMath::Abs(partV0neg->GetPdgCode())==pdgDgV0[1]) ||
2254 (TMath::Abs(partV0pos->GetPdgCode())==pdgDgV0[1] &&
2255 TMath::Abs(partV0neg->GetPdgCode())==pdgDgV0[0]) ) ) return -1;
2256 Int_t labV0posMother = partV0pos->GetMother();
2257 Int_t labV0negMother = partV0neg->GetMother();
2258
2259 if (labV0posMother<0 || labV0negMother<0) return -1;
2260 if (labV0posMother!=labV0negMother) return -1;
2261
2262 AliAODMCParticle *motherV0 = (AliAODMCParticle*)mcArray->At(labV0posMother);
85036182 2263 if (!motherV0) return-1;
992ba7d8 2264
2265 if (TMath::Abs(motherV0->GetPdgCode())!=pdgDgLc2bacV0[1]) return -1;
2266 Int_t labV0mother = motherV0->GetMother();
2267 if (labV0mother<0) return -1;
2268 AliAODMCParticle *gMotherV0 = (AliAODMCParticle*)mcArray->At(labV0mother);
85036182 2269 if (!gMotherV0) return-1;
992ba7d8 2270
2271 if ( !(pdgDgLc2bacV0[1]==310 && TMath::Abs(gMotherV0->GetPdgCode())==311) &&
2272 !(pdgDgLc2bacV0[1]==3122 && TMath::Abs(motherV0->GetPdgCode())==3122) ) return -1;
2273
2274 if ( (pdgDgLc2bacV0[1]==310 && TMath::Abs(gMotherV0->GetPdgCode())==311) ) {
2275 Int_t labV0GMother = gMotherV0->GetMother();
2276 if (labV0GMother<0) return -1;
2277 AliAODMCParticle *ggMotherV0 = (AliAODMCParticle*)mcArray->At(labV0GMother);
85036182 2278 if (!ggMotherV0) return-1;
992ba7d8 2279
2280 if (TMath::Abs(ggMotherV0->GetPdgCode())!=4122) return -1;
2281 gMotherV0 = (AliAODMCParticle*)ggMotherV0;
2282 labV0mother=labV0GMother;
2283 }
2284 else if (pdgDgLc2bacV0[1]==3122 && TMath::Abs(motherV0->GetPdgCode())==3122) {
2285 if (TMath::Abs(gMotherV0->GetPdgCode())!=4122) return -1;
2286 }
2287
2288 if (labBacMother!=labV0mother) {
992ba7d8 2289 return -1;
2290 }
2291
43c7bace 2292 return labBacMother;
992ba7d8 2293
2294}
2295
ff12b981 2296//________________________________________________________________
43c7bace 2297Int_t AliAnalysisTaskSELc2V0bachelor::SearchLcDaughter(TClonesArray *arrayMC, Int_t iii) {
2298 //
2299 // This is to check Lc dinasty
2300 //
ff12b981 2301
2302 Int_t indexToBeReturned=-999;
2303
2304 Int_t pdgLc=4122;
2305 Int_t pdgLambda=3122;
2306 Int_t pdgV0=310;
2307 Int_t pdgK0=311;
2308 Int_t pdgBachelor=2212;
2309 Int_t pdgBachelorPi=211;
992ba7d8 2310
2311 TString fillthis="";
2312 fillthis="histMcStatLc";
2313
ff12b981 2314 AliAODMCParticle *searchLc = dynamic_cast<AliAODMCParticle*>(arrayMC->At(iii));
4184976e 2315 if(!searchLc) return -999;
ff12b981 2316 if (TMath::Abs(searchLc->GetPdgCode()) != pdgLc) return -999;
2317
2318 ((TH1F*)(fOutput->FindObject(fillthis)))->Fill(0);
2319 indexToBeReturned = 0;
2320
2321 ((TH1F*)(fOutput->FindObject(fillthis)))->Fill(TMath::Nint(searchLc->Charge()/3.)*1);
2322 indexToBeReturned = TMath::Nint(searchLc->Charge()/3.)*1;
2323
2324 Int_t nDaughLc = searchLc->GetNDaughters();
2325 if (nDaughLc!=2) {
2326 ((TH1F*)(fOutput->FindObject(fillthis)))->Fill(TMath::Nint(searchLc->Charge()/3.)*10);
2327 indexToBeReturned = TMath::Nint(searchLc->Charge()/3.)*10;
2328 return indexToBeReturned;
2329 }
2330
2331 Int_t index1=searchLc->GetDaughter(0);
2332 Int_t index2=searchLc->GetDaughter(1);
2333 if (index1<=0 || index2<=0) {
2334 return -999;
2335 }
2336
2337 AliAODMCParticle *daugh1 = dynamic_cast<AliAODMCParticle*>(arrayMC->At(index1));
2338 AliAODMCParticle *daugh2 = dynamic_cast<AliAODMCParticle*>(arrayMC->At(index2));
2339 if (!daugh1 || !daugh2) return -999;
2340
2341 Int_t daughPdg1 = TMath::Abs(daugh1->GetPdgCode());
2342 Int_t daughPdg2 = TMath::Abs(daugh2->GetPdgCode());
2343 if ( !( (daughPdg1==pdgBachelor && daughPdg2==pdgK0) ||
2344 (daughPdg2==pdgBachelor && daughPdg1==pdgK0) ||
2345 (daughPdg1==pdgLambda && daughPdg2==pdgBachelorPi) ||
2346 (daughPdg2==pdgLambda && daughPdg1==pdgBachelorPi) ) ) {
2347 ((TH1F*)(fOutput->FindObject(fillthis)))->Fill(TMath::Nint(searchLc->Charge()/3.)*10);
2348 indexToBeReturned = TMath::Nint(searchLc->Charge()/3.)*10;
2349 return indexToBeReturned;
2350 }
2351
2352 if (daughPdg1==pdgK0 || daughPdg1==pdgLambda) {
2353 index1=searchLc->GetDaughter(1);
2354 index2=searchLc->GetDaughter(0);
2355 }
2356 daugh1 = dynamic_cast<AliAODMCParticle*>(arrayMC->At(index1));
2357 daugh2 = dynamic_cast<AliAODMCParticle*>(arrayMC->At(index2));
4184976e 2358 if (!daugh1 || !daugh2) return -999;
2359
ff12b981 2360 daughPdg1=TMath::Abs(daugh1->GetPdgCode());
2361 daughPdg2=TMath::Abs(daugh2->GetPdgCode());
2362
2363 if ( daughPdg1==pdgBachelor && daughPdg2==pdgK0 ) { // Lc+ -> p K0bar
2364
2365 ((TH1F*)(fOutput->FindObject(fillthis)))->Fill(TMath::Nint(searchLc->Charge()/3.)*2);
2366 indexToBeReturned = TMath::Nint(searchLc->Charge()/3.)*2;
2367
2368 Int_t nDaughK0 = daugh2->GetNDaughters();
2369 if (nDaughK0!=1) return -999;
2370
2371 Int_t indexK0daugh=daugh2->GetDaughter(0);
2372 if (indexK0daugh<=0) return -999;
2373
2374 AliAODMCParticle *daughK0 = dynamic_cast<AliAODMCParticle*>(arrayMC->At(indexK0daugh));
2375 if (!daughK0) return -999;
2376
2377 Int_t daughK0Pdg=TMath::Abs(daughK0->GetPdgCode());
2378 if (daughK0Pdg!=pdgV0) {
2379 ((TH1F*)(fOutput->FindObject(fillthis)))->Fill(TMath::Nint(searchLc->Charge()/3.)*4); // K0L
2380 indexToBeReturned = TMath::Nint(searchLc->Charge()/3.)*4;
2381 return indexToBeReturned;
2382 }
2383 ((TH1F*)(fOutput->FindObject(fillthis)))->Fill(TMath::Nint(searchLc->Charge()/3.)*3); // K0S
2384 indexToBeReturned = TMath::Nint(searchLc->Charge()/3.)*3;
2385
2386 Int_t nDaughK0S = daughK0->GetNDaughters();
2387 if (nDaughK0S!=2) {
2388 ((TH1F*)(fOutput->FindObject(fillthis)))->Fill(TMath::Nint(searchLc->Charge()/3.)*5); // other decays for K0S
2389 indexToBeReturned = TMath::Nint(searchLc->Charge()/3.)*5;
2390 return indexToBeReturned;
2391 }
2392
2393 index1=daughK0->GetDaughter(0);
2394 index2=daughK0->GetDaughter(1);
2395 if(index1<=0 || index2<=0) {
2396 return -999;
2397 }
2398
43c7bace 2399 AliAODMCParticle *daughK0S1 = dynamic_cast<AliAODMCParticle*>(arrayMC->At(index1));
2400 AliAODMCParticle *daughK0S2 = dynamic_cast<AliAODMCParticle*>(arrayMC->At(index2));
2401 if (!daughK0S1 || !daughK0S2) return -999;
ff12b981 2402
43c7bace 2403 Int_t daughK0S1pdg=TMath::Abs(daughK0S1->GetPdgCode());
2404 Int_t daughK0S2pdg=TMath::Abs(daughK0S2->GetPdgCode());
ff12b981 2405
43c7bace 2406 if ( daughK0S1pdg==211 && daughK0S2pdg==211 ) {
ff12b981 2407 ((TH1F*)(fOutput->FindObject(fillthis)))->Fill(TMath::Nint(searchLc->Charge()/3.)*6); // K0S -> pi+ pi-
2408 indexToBeReturned = TMath::Nint(searchLc->Charge()/3.)*6;
2409 } else {
2410 ((TH1F*)(fOutput->FindObject(fillthis)))->Fill(TMath::Nint(searchLc->Charge()/3.)*5); // other decays for K0S
43c7bace 2411 indexToBeReturned = TMath::Nint(searchLc->Charge()/3.)*5;
ff12b981 2412 }
2413
2414 } //if (daughPdg1==pdgBachelor && daughPdg2==pdgK0)
2415 else if ( daughPdg1==pdgBachelorPi && daughPdg2==pdgLambda ) { // Lc+ -> pi+ Lambda
2416
2417 ((TH1F*)(fOutput->FindObject(fillthis)))->Fill(TMath::Nint(searchLc->Charge()/3.)*7);
2418 indexToBeReturned = TMath::Nint(searchLc->Charge()/3.)*7;
992ba7d8 2419
ff12b981 2420 Int_t nDaughL = daugh2->GetNDaughters();
2421 if (nDaughL!=2) {
2422 ((TH1F*)(fOutput->FindObject(fillthis)))->Fill(TMath::Nint(searchLc->Charge()/3.)*8);
2423 indexToBeReturned = TMath::Nint(searchLc->Charge()/3.)*8;
2424 return indexToBeReturned;
2425 }
2426
2427 index1=daugh2->GetDaughter(0);
2428 index2=daugh2->GetDaughter(1);
2429 if(index1<=0 || index2<=0) {
2430 return -999;
2431 }
2432
2433 AliAODMCParticle *daughL1 = dynamic_cast<AliAODMCParticle*>(arrayMC->At(index1));
2434 AliAODMCParticle *daughL2 = dynamic_cast<AliAODMCParticle*>(arrayMC->At(index2));
2435 if (!daughL1 || !daughL2) return -999;
2436
2437 Int_t daughL1pdg=TMath::Abs(daughL1->GetPdgCode());
2438 Int_t daughL2pdg=TMath::Abs(daughL2->GetPdgCode());
2439 if ( (daughL1pdg==211 && daughL2pdg==2212) ||
2440 (daughL2pdg==211 && daughL1pdg==2212) ) {
2441 ((TH1F*)(fOutput->FindObject(fillthis)))->Fill(TMath::Nint(searchLc->Charge()/3.)*9);
2442 indexToBeReturned = TMath::Nint(searchLc->Charge()/3.)*9;
2443 } else {
2444 ((TH1F*)(fOutput->FindObject(fillthis)))->Fill(TMath::Nint(searchLc->Charge()/3.)*8);
2445 indexToBeReturned = TMath::Nint(searchLc->Charge()/3.)*8;
2446 }
2447
2448 } //else if (daughPdg1==pdgBachelorPi && daughPdg2==pdgLambda)
2449
2450 return indexToBeReturned;
ff12b981 2451}
43c7bace 2452
ff12b981 2453//________________________________________________________________
b833016c 2454void AliAnalysisTaskSELc2V0bachelor::FillArmPodDistribution(AliAODRecoDecay *vZero,
43c7bace 2455 TString histoTitle,
b833016c 2456 Bool_t isCandidateSelectedCuts,
2457 Bool_t isBachelorID) {
43c7bace 2458 //
2459 // This is to fill Armenteros Podolanski plots
2460 //
992ba7d8 2461
b833016c 2462 Double_t alpha = vZero->Alpha();//AlphaV0();
2463 Double_t qT = vZero->QtProng();//PtArmV0();
992ba7d8 2464
b833016c 2465 ((TH2F*)(fOutputAll->FindObject(histoTitle+"0")))->Fill(alpha,qT);
2466 if (isCandidateSelectedCuts) {
2467 ((TH2F*)(fOutputAll->FindObject(histoTitle)))->Fill(alpha,qT);
2468 if (isBachelorID)
2469 ((TH2F*)(fOutputPIDBach->FindObject(histoTitle)))->Fill(alpha,qT);
2470 }
992ba7d8 2471
2472}
992ba7d8 2473
43c7bace 2474//-------------------------------------------------------------------------------
2475void AliAnalysisTaskSELc2V0bachelor::CheckCandidatesAtDifferentLevels(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0* cutsAnal) {
2476 //
2477 // This is to check candidates at different levels
2478 //
992ba7d8 2479
43c7bace 2480 Bool_t areCutsUsingPID = cutsAnal->GetIsUsePID();
992ba7d8 2481
43c7bace 2482 AliAODv0 * v0part = (AliAODv0*)part->Getv0();
2483 Bool_t onFlyV0 = v0part->GetOnFlyStatus(); // on-the-flight V0s
0dbd1d4f 2484
43c7bace 2485 AliAODTrack *bachelor = (AliAODTrack*)part->GetBachelor();
0dbd1d4f 2486
43c7bace 2487 if ( !onFlyV0 )
2488 ((TH1F*)(fOutput->FindObject("hCandidateSelection")))->Fill(3); // it counts number of candidates coming from offline V0s
a578b2da 2489
43c7bace 2490 if ( cutsAnal->IsInFiducialAcceptance(part->Pt(),part->Y(4122)) )
2491 ((TH1F*)(fOutput->FindObject("hCandidateSelection")))->Fill(4);
2492 if ( (((cutsAnal->IsSelected(part,AliRDHFCuts::kTracks))&(AliRDHFCutsLctoV0::kLcToK0Spr))==(AliRDHFCutsLctoV0::kLcToK0Spr)) )
2493 ((TH1F*)(fOutput->FindObject("hCandidateSelection")))->Fill(5);
2494 cutsAnal->SetUsePID(kFALSE);
2495 if ( (((cutsAnal->IsSelected(part,AliRDHFCuts::kCandidate))&(AliRDHFCutsLctoV0::kLcToK0Spr))==(AliRDHFCutsLctoV0::kLcToK0Spr)) )
2496 ((TH1F*)(fOutput->FindObject("hCandidateSelection")))->Fill(6);
2497 cutsAnal->SetUsePID(areCutsUsingPID);
2498 if ( (((cutsAnal->IsSelected(part,AliRDHFCuts::kPID))&(AliRDHFCutsLctoV0::kLcToK0Spr))==(AliRDHFCutsLctoV0::kLcToK0Spr)) )
2499 ((TH1F*)(fOutput->FindObject("hCandidateSelection")))->Fill(7);
2500 if ( (((cutsAnal->IsSelected(part,AliRDHFCuts::kCandidate))&(AliRDHFCutsLctoV0::kLcToK0Spr))==(AliRDHFCutsLctoV0::kLcToK0Spr)) )
2501 ((TH1F*)(fOutput->FindObject("hCandidateSelection")))->Fill(8);
2502 if ( (((cutsAnal->IsSelected(part,AliRDHFCuts::kAll))&(AliRDHFCutsLctoV0::kLcToK0Spr))==(AliRDHFCutsLctoV0::kLcToK0Spr)) )
2503 ((TH1F*)(fOutput->FindObject("hCandidateSelection")))->Fill(9);
a578b2da 2504
43c7bace 2505 if ( cutsAnal->IsInFiducialAcceptance(part->Pt(),part->Y(4122)) ) {
0dbd1d4f 2506
43c7bace 2507 if ( ( (cutsAnal->IsSelected(part,AliRDHFCuts::kTracks))&(AliRDHFCutsLctoV0::kLcToK0Spr)) == (AliRDHFCutsLctoV0::kLcToK0Spr) ) {
a578b2da 2508
43c7bace 2509 Int_t aaa = cutsAnal->IsSelected(part,AliRDHFCuts::kTracks);
2510 if ( (aaa&AliRDHFCutsLctoV0::kLcToK0Spr)==AliRDHFCutsLctoV0::kLcToK0Spr ) {
2511 if ( ( (aaa&AliRDHFCutsLctoV0::kLcToLpi)==AliRDHFCutsLctoV0::kLcToLpi && bachelor->Charge()==-1) ||
2512 ( (aaa&AliRDHFCutsLctoV0::kLcToLBarpi)==AliRDHFCutsLctoV0::kLcToLBarpi && bachelor->Charge()==+1) )
2513 ((TH1F*)(fOutput->FindObject("hSwitchOnCandidates1")))->Fill( -aaa );
2514 else
2515 ((TH1F*)(fOutput->FindObject("hSwitchOnCandidates1")))->Fill( aaa );
2516 }
0dbd1d4f 2517
43c7bace 2518 cutsAnal->SetUsePID(kFALSE);
2519 aaa = cutsAnal->IsSelected(part,AliRDHFCuts::kCandidate);
2520 if ((aaa&AliRDHFCutsLctoV0::kLcToK0Spr)==AliRDHFCutsLctoV0::kLcToK0Spr) {
2521 if ( ( (aaa&AliRDHFCutsLctoV0::kLcToLpi)==AliRDHFCutsLctoV0::kLcToLpi && bachelor->Charge()==-1) ||
2522 ( (aaa&AliRDHFCutsLctoV0::kLcToLBarpi)==AliRDHFCutsLctoV0::kLcToLBarpi && bachelor->Charge()==+1) )
2523 ((TH1F*)(fOutput->FindObject("hSwitchOnCandidates2")))->Fill( -aaa );
2524 else
2525 ((TH1F*)(fOutput->FindObject("hSwitchOnCandidates2")))->Fill( aaa );
2526 }
2527 cutsAnal->SetUsePID(areCutsUsingPID);
2528
2529 aaa = cutsAnal->IsSelected(part,AliRDHFCuts::kPID);
2530 if ((aaa&AliRDHFCutsLctoV0::kLcToK0Spr)==AliRDHFCutsLctoV0::kLcToK0Spr) {
2531 if ( ( (aaa&AliRDHFCutsLctoV0::kLcToLpi)==AliRDHFCutsLctoV0::kLcToLpi && bachelor->Charge()==-1) ||
2532 ( (aaa&AliRDHFCutsLctoV0::kLcToLBarpi)==AliRDHFCutsLctoV0::kLcToLBarpi && bachelor->Charge()==+1) )
2533 ((TH1F*)(fOutput->FindObject("hSwitchOnCandidates3")))->Fill( -aaa );
2534 else
2535 ((TH1F*)(fOutput->FindObject("hSwitchOnCandidates3")))->Fill( aaa );
2536 }
0dbd1d4f 2537
43c7bace 2538 aaa = cutsAnal->IsSelected(part,AliRDHFCuts::kAll);
2539 if ((aaa&AliRDHFCutsLctoV0::kLcToK0Spr)==AliRDHFCutsLctoV0::kLcToK0Spr) {
2540 if ( ( (aaa&AliRDHFCutsLctoV0::kLcToLpi)==AliRDHFCutsLctoV0::kLcToLpi && bachelor->Charge()==-1) ||
2541 ( (aaa&AliRDHFCutsLctoV0::kLcToLBarpi)==AliRDHFCutsLctoV0::kLcToLBarpi && bachelor->Charge()==+1) )
2542 ((TH1F*)(fOutput->FindObject("hSwitchOnCandidates4")))->Fill( -aaa );
2543 else
2544 ((TH1F*)(fOutput->FindObject("hSwitchOnCandidates4")))->Fill( aaa );
2545 }
0dbd1d4f 2546
43c7bace 2547 }
2548 }
0dbd1d4f 2549
43c7bace 2550 return;
2551}
0dbd1d4f 2552
43c7bace 2553//-------------------------------------------------------------------------------
2554void AliAnalysisTaskSELc2V0bachelor::FillTheTree(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0 *cutsAnal, TClonesArray *mcArray, Int_t isLc) {
2555 //
2556 // This is to fill tree
2557 //
992ba7d8 2558
43c7bace 2559 Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
2560 Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
992ba7d8 2561
43c7bace 2562 Double_t invmassLc = part->InvMassLctoK0sP();
2563 Double_t invmassLc2Lpi = part->InvMassLctoLambdaPi();
992ba7d8 2564
43c7bace 2565 AliAODTrack *bachelor = (AliAODTrack*)part->GetBachelor();
992ba7d8 2566
43c7bace 2567 AliAODv0 * v0part = (AliAODv0*)part->Getv0();
2568 Double_t dcaV0ptp = v0part->GetDCA();
2569 Double_t invmassK0S = v0part->MassK0Short();
2570 Double_t invmassLambda = v0part->MassLambda();
2571 Double_t invmassLambdaBar = v0part->MassAntiLambda();
0dbd1d4f 2572
43c7bace 2573 Int_t isLc2LBarpi=0, isLc2Lpi=0;
2574 Int_t mcLabel = -1;
2575 Int_t isDp2K0Spi=0, isDs2K0SK=0;
2576 Int_t mcLabel2 = -1;
2577 Int_t mcLabel3 = -1;
14fe9f43 2578 Int_t isKstar12K0Spi=0, isKstar22K0Spi=0;
2579 Int_t mcLabel4 = -1;
2580 Int_t mcLabel5 = -1;
53c91ed7 2581 Double_t ptCandByMC = 0.;//fmcPartCandidate->Pt();
b833016c 2582 Double_t yCandByMC = 0.;//fmcPartCandidate->Y();
43c7bace 2583 if (fUseMCInfo) {
53c91ed7 2584 if (isLc) {
2585 Int_t pdgCand0 = 4122;
2586 Int_t pdgDgLctoV0bachelor0[2]={2212,310};
2587 Int_t pdgDgV0toDaughters0[2]={211,211};
2588 Int_t mcLabelLc2pK0S = part->MatchToMC(pdgCand0,pdgDgLctoV0bachelor0[1],pdgDgLctoV0bachelor0,pdgDgV0toDaughters0,mcArray,kTRUE);
2589 AliAODMCParticle *lambdaCpartMC = (AliAODMCParticle*)mcArray->At(mcLabelLc2pK0S);
2590 if (lambdaCpartMC) {
2591 ptCandByMC = lambdaCpartMC->Pt();
b833016c 2592 yCandByMC = lambdaCpartMC->Y();
53c91ed7 2593 }
2594 }
2595
43c7bace 2596 Int_t pdgCand = 4122;
2597 Int_t pdgDgLctoV0bachelor[2]={211,3122};
2598 Int_t pdgDgV0toDaughters[2]={2212,211};
2599 mcLabel = part->MatchToMC(pdgCand,pdgDgLctoV0bachelor[1],pdgDgLctoV0bachelor,pdgDgV0toDaughters,mcArray,kTRUE);
2600 if (mcLabel!=-1) {
2601 if (bachelor->Charge()==-1) isLc2LBarpi=1;
2602 if (bachelor->Charge()==+1) isLc2Lpi=1;
53c91ed7 2603 AliAODMCParticle *lambdaCpartMC = (AliAODMCParticle*)mcArray->At(mcLabel);
2604 if (lambdaCpartMC) {
2605 ptCandByMC = lambdaCpartMC->Pt();
b833016c 2606 yCandByMC = lambdaCpartMC->Y();
53c91ed7 2607 }
43c7bace 2608 }
0dbd1d4f 2609
43c7bace 2610 Int_t pdgCand2 = 411; // D+ -> pi+ K0S
2611 Int_t pdgCand3 = 431; // Ds+ -> K+ K0S
2612 Int_t pdgDgCand2[2]={211,310};
2613 Int_t pdgDgCand3[2]={321,310};
2614 pdgDgV0toDaughters[0]=211;
2615 pdgDgV0toDaughters[1]=211;
2616 mcLabel2 = part->MatchToMC(pdgCand2,pdgDgCand2[1],pdgDgCand2,pdgDgV0toDaughters,mcArray,kTRUE);
2617 mcLabel3 = part->MatchToMC(pdgCand3,pdgDgCand3[1],pdgDgCand3,pdgDgV0toDaughters,mcArray,kTRUE);
53c91ed7 2618 if (mcLabel2!=-1) {
2619 isDp2K0Spi=1;
2620 AliAODMCParticle *lambdaCpartMC = (AliAODMCParticle*)mcArray->At(mcLabel2);
2621 if (lambdaCpartMC) {
2622 ptCandByMC = lambdaCpartMC->Pt();
b833016c 2623 yCandByMC = lambdaCpartMC->Y();
53c91ed7 2624 }
2625 }
2626 if (mcLabel3!=-1) {
2627 isDs2K0SK=1;
2628 AliAODMCParticle *lambdaCpartMC = (AliAODMCParticle*)mcArray->At(mcLabel3);
2629 if (lambdaCpartMC) {
2630 ptCandByMC = lambdaCpartMC->Pt();
b833016c 2631 yCandByMC = lambdaCpartMC->Y();
53c91ed7 2632 }
2633 }
14fe9f43 2634
2635 Int_t pdgCand4 = 313; // K*(892)+ -> pi+ K0S
2636 Int_t pdgCand5 = 325; // K*(1430)+ -> pi+ K0S
2637 Int_t pdgDgCand4[2]={211,310};
2638 Int_t pdgDgCand5[2]={211,310};
2639 pdgDgV0toDaughters[0]=211;
2640 pdgDgV0toDaughters[1]=211;
2641 mcLabel4 = part->MatchToMC(pdgCand4,pdgDgCand4[1],pdgDgCand4,pdgDgV0toDaughters,mcArray,kTRUE);
2642 mcLabel5 = part->MatchToMC(pdgCand5,pdgDgCand5[1],pdgDgCand5,pdgDgV0toDaughters,mcArray,kTRUE);
2643 if (mcLabel4!=-1) {
2644 isKstar12K0Spi=1;
2645 AliAODMCParticle *lambdaCpartMC = (AliAODMCParticle*)mcArray->At(mcLabel4);
2646 if (lambdaCpartMC) {
2647 ptCandByMC = lambdaCpartMC->Pt();
b833016c 2648 yCandByMC = lambdaCpartMC->Y();
14fe9f43 2649 }
2650 }
2651 if (mcLabel5!=-1) {
2652 isKstar22K0Spi=1;
2653 AliAODMCParticle *lambdaCpartMC = (AliAODMCParticle*)mcArray->At(mcLabel5);
2654 if (lambdaCpartMC) {
2655 ptCandByMC = lambdaCpartMC->Pt();
b833016c 2656 yCandByMC = lambdaCpartMC->Y();
14fe9f43 2657 }
2658 }
43c7bace 2659 }
992ba7d8 2660
14fe9f43 2661 Int_t isLcByMC = isLc+isLc2LBarpi*2+isLc2Lpi*4+isDp2K0Spi*8+isDs2K0SK*16+isKstar12K0Spi*32+isKstar22K0Spi*64;
a578b2da 2662
53c91ed7 2663 Bool_t isMCparticleInFiducialAcceptance = kTRUE;
14fe9f43 2664 if (isLc || isLc2LBarpi || isLc2Lpi || isDp2K0Spi || isDs2K0SK || isKstar12K0Spi || isKstar22K0Spi) {
53c91ed7 2665 isMCparticleInFiducialAcceptance = cutsAnal->IsInFiducialAcceptance(ptCandByMC,yCandByMC);
2666 }
2667
43c7bace 2668 Int_t isK0S = 0;
2669 Int_t isLambda = 0;
2670 Int_t isLambdaBar = 0;
2671 Int_t isGamma = 0;
2672 if (fUseMCInfo) {
2673 Int_t pdgDg2prong[2] = {211, 211};
2674 Int_t labelK0S = v0part->MatchToMC(310,mcArray,2,pdgDg2prong);
2675 if (labelK0S>=0) isK0S = 1;
992ba7d8 2676
43c7bace 2677 pdgDg2prong[0] = 211;
2678 pdgDg2prong[1] = 2212;
2679 Int_t lambdaLabel = v0part->MatchToMC(3122,mcArray,2,pdgDg2prong);
2680 if (lambdaLabel>=0) {
2681 AliAODMCParticle *lambdaTrack = (AliAODMCParticle*)mcArray->At(lambdaLabel);
2682 if (lambdaTrack->GetPdgCode()==3122) isLambda = 1;
2683 else if (lambdaTrack->GetPdgCode()==-3122) isLambdaBar = 1;
2684 }
992ba7d8 2685
43c7bace 2686 pdgDg2prong[0] = 11;
2687 pdgDg2prong[1] = 11;
2688 Int_t gammaLabel = v0part->MatchToMC(22,mcArray,2,pdgDg2prong);
2689 if (gammaLabel>=0) {
2690 AliAODMCParticle *gammaTrack = (AliAODMCParticle*)mcArray->At(gammaLabel);
2691 if (gammaTrack->GetPdgCode()==22) isGamma = 1;
2692 }
2693 }
992ba7d8 2694
43c7bace 2695 Int_t isV0ByMC = isK0S+isLambdaBar*2+isLambda*4+isGamma*8;
992ba7d8 2696
43c7bace 2697 Int_t isBachelorSelected = (bachelor->TestFilterMask(BIT(4)))*1 + (!(bachelor->TestFilterMask(BIT(4))))*2;
2698 isBachelorSelected += (bachelor->GetLabel()<0)*4 + (bachelor->GetLabel()>=0)*8;
2699 if ( ( !(bachelor->HasPointOnITSLayer(0)) && !(bachelor->HasPointOnITSLayer(1)) ) )
2700 isBachelorSelected += 16;
2701 else {
2702 if ( bachelor->HasPointOnITSLayer(0) && !(bachelor->HasPointOnITSLayer(1)) )
2703 isBachelorSelected += 32;
2704 else if ( !(bachelor->HasPointOnITSLayer(0)) && bachelor->HasPointOnITSLayer(1) )
2705 isBachelorSelected += 64;
2706 else
2707 isBachelorSelected += 128;
2708 }
992ba7d8 2709
43c7bace 2710 AliAODTrack *v0pos = (AliAODTrack*)part->Getv0PositiveTrack();
b833016c 2711 AliAODTrack *v0neg = (AliAODTrack*)part->Getv0NegativeTrack();
992ba7d8 2712
43c7bace 2713 Int_t areV0daughtersSelected = (v0pos->TestFilterMask(BIT(4)))*1 + (!(v0pos->TestFilterMask(BIT(4))))*2;
2714 areV0daughtersSelected += (v0pos->GetLabel()<0)*4 + (v0pos->GetLabel()>=0)*8;
2715 areV0daughtersSelected += (v0neg->TestFilterMask(BIT(4)))*16 + (!(v0neg->TestFilterMask(BIT(4))))*32;
2716 areV0daughtersSelected += (v0neg->GetLabel()<0)*64 + (v0neg->GetLabel()>=0)*128;
992ba7d8 2717
43c7bace 2718 Double_t nSigmaITSpr=-999.;
2719 cutsAnal->GetPidHF()->GetnSigmaITS(bachelor,4,nSigmaITSpr);
2720 Double_t nSigmaTPCpr=-999.;
2721 cutsAnal->GetPidHF()->GetnSigmaTPC(bachelor,4,nSigmaTPCpr);
2722 Double_t nSigmaTOFpr=-999.;
2723 cutsAnal->GetPidHF()->GetnSigmaTOF(bachelor,4,nSigmaTOFpr);
2724
2725 Double_t nSigmaITSpi=-999.;
2726 cutsAnal->GetPidHF()->GetnSigmaITS(bachelor,2,nSigmaITSpi);
2727 Double_t nSigmaTPCpi=-999.;
2728 cutsAnal->GetPidHF()->GetnSigmaTPC(bachelor,2,nSigmaTPCpi);
2729 Double_t nSigmaTOFpi=-999.;
2730 cutsAnal->GetPidHF()->GetnSigmaTOF(bachelor,2,nSigmaTOFpi);
2731
2732 Double_t nSigmaITSka=-999.;
2733 cutsAnal->GetPidHF()->GetnSigmaITS(bachelor,3,nSigmaITSka);
2734 Double_t nSigmaTPCka=-999.;
2735 cutsAnal->GetPidHF()->GetnSigmaTPC(bachelor,3,nSigmaTPCka);
2736 Double_t nSigmaTOFka=-999.;
2737 cutsAnal->GetPidHF()->GetnSigmaTOF(bachelor,3,nSigmaTOFka);
992ba7d8 2738
43c7bace 2739
2740 Int_t flagToCheckCandidate = 1*(TMath::Abs(invmassK0S-mk0sPDG)<=0.050);
2741 flagToCheckCandidate+=2*((TMath::Abs(invmassLambdaBar-mLPDG)<=0.050) && (bachelor->Charge()==-1));
2742 flagToCheckCandidate+=4*((TMath::Abs(invmassLambda-mLPDG)<=0.050) && (bachelor->Charge()==+1));
2743 flagToCheckCandidate+=8*((TMath::Abs(invmassLambdaBar-mLPDG)<=0.050) && (bachelor->Charge()==+1));
2744 flagToCheckCandidate+=16*((TMath::Abs(invmassLambda-mLPDG)<=0.050) && (bachelor->Charge()==-1));
992ba7d8 2745
a578b2da 2746 /*
43c7bace 2747 Bool_t areCutsUsingPID = cutsAnal->GetIsUsePID();
2748 cutsAnal->SetUsePID(kFALSE);
2749 Int_t aaa = cutsAnal->IsSelected(part,AliRDHFCuts::kCandidate);
2750 if ( (aaa&AliRDHFCutsLctoV0::kLcToK0Spr)==AliRDHFCutsLctoV0::kLcToK0Spr ) {
2751 if ( aaa==AliRDHFCutsLctoV0::kLcToK0Spr ) {
2752 flagToCheckCandidate = aaa; // Lc->K0S+p OK
2753 } else {
2754 if ( (aaa&AliRDHFCutsLctoV0::kLcToLpi)==AliRDHFCutsLctoV0::kLcToLpi ) {
2755 if (bachelor->Charge()==+1)
2756 flagToCheckCandidate = aaa; // Lc->Lambda+pi+
2757 else if (bachelor->Charge()==-1)
2758 flagToCheckCandidate =-aaa; // Lambda+pi- AS Lc->K0S+p candidate
2759 }
2760 if ( (aaa&AliRDHFCutsLctoV0::kLcToLBarpi)==AliRDHFCutsLctoV0::kLcToLBarpi ) {
2761 if (bachelor->Charge()==-1)
2762 flagToCheckCandidate = aaa; // Lc->LambdaBar+pi-
2763 else if (bachelor->Charge()==+1)
2764 flagToCheckCandidate =-aaa; // LambdaBar+pi+ AS Lc->K0S+p candidate
2765 }
2766 }
2767 } else {
2768 //if ( aaa==AliRDHFCutsLctoV0::kLcToK0Spr ) {
2769 //flagToCheckCandidate = -10-(AliRDHFCutsLctoV0::kLcToK0Spr); // NEVER
2770 //} else {
2771 if ( (aaa&AliRDHFCutsLctoV0::kLcToLpi)==AliRDHFCutsLctoV0::kLcToLpi ) {
2772 if (bachelor->Charge()==+1)
2773 flagToCheckCandidate = aaa; // Lc->Lambda+pi+ OK
2774 else if (bachelor->Charge()==-1)
2775 flagToCheckCandidate =-aaa; // Lambda+pi- AS Lc->Lambda+pi+ candidate
2776 }
2777 if ( (aaa&AliRDHFCutsLctoV0::kLcToLBarpi)==AliRDHFCutsLctoV0::kLcToLBarpi ) {
2778 if (bachelor->Charge()==-1)
2779 flagToCheckCandidate = aaa; // Lc->LambdaBar+pi- OK
2780 else if (bachelor->Charge()==+1)
2781 flagToCheckCandidate =-aaa; // LambdaBar+pi+ AS Lc->LambdaBar+pi- candidate
2782 }
2783 //}
2784 }
2785 cutsAnal->SetUsePID(areCutsUsingPID);
a578b2da 2786 */
992ba7d8 2787
516f546e 2788 fCandidateVariables[ 0] = fUseMCInfo+isLcByMC; // 0: real data; 1: bkg; 2: Lc->K0S+p; 3: Lc->LambdaBar+pbar; 5: Lc->Lambda+p; 9: D+->K0S+pi; 17: Ds+->K0S+K; 33: K*+->K0S+pi; 65: K*+->K0S+K
43c7bace 2789 fCandidateVariables[ 1] = fUseMCInfo+isV0ByMC; // 0: real data; 1: bkg; 2: K0S->pi+pi; 3: LambdaBar->pbar+pi+; 5: Lambda->p+pi-
2790 fCandidateVariables[ 2] = isBachelorSelected;
2791 fCandidateVariables[ 3] = areV0daughtersSelected;
2792 fCandidateVariables[ 4] = flagToCheckCandidate;
2793 fCandidateVariables[ 5] = invmassLc;
2794 fCandidateVariables[ 6] = invmassLc2Lpi;
2795 fCandidateVariables[ 7] = part->InvMass2Prongs(0,1,211,310); // D+ -> pi+ K0S
2796 fCandidateVariables[ 8] = part->InvMass2Prongs(0,1,321,310); // D+S -> K+ K0S
2797 fCandidateVariables[ 9] = invmassK0S;
2798 fCandidateVariables[10] = invmassLambda;
2799 fCandidateVariables[11] = invmassLambdaBar;
2800 fCandidateVariables[12] = v0part->InvMass2Prongs(0,1,11,11);
2801 fCandidateVariables[13] = part->GetDCA();
2802 fCandidateVariables[14] = dcaV0ptp;
2803 fCandidateVariables[15] = part->Getd0Prong(0);
2804 fCandidateVariables[16] = part->Getd0Prong(1);
2805 fCandidateVariables[17] = v0part->Getd0Prong(0);
2806 fCandidateVariables[18] = v0part->Getd0Prong(1);
2807 fCandidateVariables[19] = part->CosPointingAngle();
2808 fCandidateVariables[20] = part->CosV0PointingAngle();
2809 fCandidateVariables[21] = v0part->RadiusSecVtx();
2810 fCandidateVariables[22] = nSigmaITSpr;
2811 fCandidateVariables[23] = nSigmaITSpi;
2812 fCandidateVariables[24] = nSigmaITSka;
2813 fCandidateVariables[25] = nSigmaTPCpr;
2814 fCandidateVariables[26] = nSigmaTPCpi;
2815 fCandidateVariables[27] = nSigmaTPCka;
2816 fCandidateVariables[28] = nSigmaTOFpr;
2817 fCandidateVariables[29] = nSigmaTOFpi;
2818 fCandidateVariables[30] = nSigmaTOFka;
2819 fCandidateVariables[31] = part->Y(4122);
2820 fCandidateVariables[32] = bachelor->Eta();
2821 fCandidateVariables[33] = v0pos->Eta();
2822 fCandidateVariables[34] = v0neg->Eta();
2823 fCandidateVariables[35] = part->P();
2824 fCandidateVariables[36] = part->Pt();
2825 fCandidateVariables[37] = v0part->P();
2826 fCandidateVariables[38] = v0part->Pt();
2827 fCandidateVariables[39] = bachelor->P();
2828 fCandidateVariables[40] = bachelor->Pt();
2829 fCandidateVariables[41] = v0pos->P();
2830 fCandidateVariables[42] = v0pos->Pt();
2831 fCandidateVariables[43] = v0neg->P();
2832 fCandidateVariables[44] = v0neg->Pt();
2833 fCandidateVariables[45] = part->DecayLength();
2834 fCandidateVariables[46] = part->DecayLengthV0();
2835 fCandidateVariables[47] = part->CosPointingAngleXY();
2836 fCandidateVariables[48] = part->CosV0PointingAngleXY();
2837 fCandidateVariables[49] = part->DecayLengthXY();
2838 fCandidateVariables[50] = part->DecayLengthXYV0();
2839 fCandidateVariables[51] = part->NormalizedDecayLength();
2840 fCandidateVariables[52] = part->NormalizedV0DecayLength();
2841 fCandidateVariables[53] = part->NormalizedDecayLengthXY();
2842 fCandidateVariables[54] = part->NormalizedV0DecayLengthXY();
2843 Double_t xVtxLc=0, yVtxLc=0, zVtxLc=0;
2844 Double_t xLcMC=0,yLcMC=0,zLcMC=0;
2845 Double_t pxVtxBachelor=0, pyVtxBachelor=0, pzVtxBachelor=0;
2846 Double_t dcaForLc = PropagateToDCA(v0part,bachelor,fBzkG, xVtxLc, yVtxLc, zVtxLc, pxVtxBachelor, pyVtxBachelor, pzVtxBachelor);
2847 if (isLc) {
2848 Int_t pdgCand0 = 4122;
2849 Int_t pdgDgLctoV0bachelor0[2]={2212,310};
2850 Int_t pdgDgV0toDaughters0[2]={211,211};
2851 Int_t mcLabel0 = part->MatchToMC(pdgCand0,pdgDgLctoV0bachelor0[1],pdgDgLctoV0bachelor0,pdgDgV0toDaughters0,mcArray,kTRUE);
2852 AliAODMCParticle *partLc = dynamic_cast<AliAODMCParticle*>(mcArray->At(mcLabel0));
14666b78 2853 if(partLc){
2854 AliAODMCParticle *partLcDaug0 = dynamic_cast<AliAODMCParticle*>(mcArray->At(partLc->GetDaughter(0)));
2855 if(partLcDaug0){
2856 xLcMC=partLcDaug0->Xv(), yLcMC=partLcDaug0->Yv(), zLcMC=partLcDaug0->Zv();
2857 }
2858 }
43c7bace 2859 } else if (isLc2LBarpi || isLc2Lpi) {
2860 AliAODMCParticle *partLc = dynamic_cast<AliAODMCParticle*>(mcArray->At(mcLabel));
2861 AliAODMCParticle *partLcDaug0 = dynamic_cast<AliAODMCParticle*>(mcArray->At(partLc->GetDaughter(0)));
2862 xLcMC=partLcDaug0->Xv(), yLcMC=partLcDaug0->Yv(), zLcMC=partLcDaug0->Zv();
2863 } else if (isDp2K0Spi) {
2864 AliAODMCParticle *partLc = dynamic_cast<AliAODMCParticle*>(mcArray->At(mcLabel2));
2865 AliAODMCParticle *partLcDaug0 = dynamic_cast<AliAODMCParticle*>(mcArray->At(partLc->GetDaughter(0)));
2866 xLcMC=partLcDaug0->Xv(), yLcMC=partLcDaug0->Yv(), zLcMC=partLcDaug0->Zv();
2867 } else if (isDs2K0SK) {
2868 AliAODMCParticle *partLc = dynamic_cast<AliAODMCParticle*>(mcArray->At(mcLabel3));
2869 AliAODMCParticle *partLcDaug0 = dynamic_cast<AliAODMCParticle*>(mcArray->At(partLc->GetDaughter(0)));
2870 xLcMC=partLcDaug0->Xv(), yLcMC=partLcDaug0->Yv(), zLcMC=partLcDaug0->Zv();
14fe9f43 2871 } else if (isKstar12K0Spi) {
2872 AliAODMCParticle *partLc = dynamic_cast<AliAODMCParticle*>(mcArray->At(mcLabel4));
2873 AliAODMCParticle *partLcDaug0 = dynamic_cast<AliAODMCParticle*>(mcArray->At(partLc->GetDaughter(0)));
2874 xLcMC=partLcDaug0->Xv(), yLcMC=partLcDaug0->Yv(), zLcMC=partLcDaug0->Zv();
2875 } else if (isKstar22K0Spi) {
2876 AliAODMCParticle *partLc = dynamic_cast<AliAODMCParticle*>(mcArray->At(mcLabel5));
2877 AliAODMCParticle *partLcDaug0 = dynamic_cast<AliAODMCParticle*>(mcArray->At(partLc->GetDaughter(0)));
2878 xLcMC=partLcDaug0->Xv(), yLcMC=partLcDaug0->Yv(), zLcMC=partLcDaug0->Zv();
43c7bace 2879 }
2880 fCandidateVariables[55]=dcaForLc;
2881 fCandidateVariables[56]=part->GetSecVtxX();
2882 fCandidateVariables[57]=part->GetSecVtxY();
2883 fCandidateVariables[58]=part->GetSecVtxZ();
2884 fCandidateVariables[59]=xVtxLc;
2885 fCandidateVariables[60]=yVtxLc;
2886 fCandidateVariables[61]=zVtxLc;
2887 fCandidateVariables[62]=xLcMC;
2888 fCandidateVariables[63]=yLcMC;
2889 fCandidateVariables[64]=zLcMC;
2890 fCandidateVariables[65]=bachelor->Px();
2891 fCandidateVariables[66]=bachelor->Py();
2892 fCandidateVariables[67]=pxVtxBachelor;
2893 fCandidateVariables[68]=pyVtxBachelor;
2894 fCandidateVariables[69]=v0part->Px();
2895 fCandidateVariables[70]=v0part->Py();
2896 fCandidateVariables[71]=fVtx1->GetX();
2897 fCandidateVariables[72]=fVtx1->GetY();
2898 fCandidateVariables[73]=fVtx1->GetZ();
2899 fCandidateVariables[74]=part->CosThetaStar(0,4122,2212,310);
2900 fCandidateVariables[75]=part->CosThetaStar(1,4122,2212,310);
2901 fCandidateVariables[76]=v0part->Eta();
2902 fCandidateVariables[77]=v0part->Y(310);
2903 fCandidateVariables[78]=pzVtxBachelor;
2904 fCandidateVariables[79]=v0part->Pz();
53c91ed7 2905 fCandidateVariables[80]=bachelor->Charge();
2906 fCandidateVariables[81]=isMCparticleInFiducialAcceptance;
2907 if (fUseMCInfo) {
2db138e0 2908 fCandidateVariables[82]=0;
53c91ed7 2909 if (bachelor->GetLabel()!=-1) {
2910 AliAODMCParticle *partBachelor = dynamic_cast<AliAODMCParticle*>(mcArray->At(TMath::Abs(bachelor->GetLabel())));
2db138e0 2911 if(partBachelor) fCandidateVariables[82]=partBachelor->GetPdgCode();
53c91ed7 2912 }
2913 } else {
2914 fCandidateVariables[82]=-1;
2915 }
14fe9f43 2916 fCandidateVariables[83] = part->InvMass2Prongs(0,1,211,310); // Kstar( 892)+ -> pi+K0S
2917 fCandidateVariables[84] = part->InvMass2Prongs(0,1,321,310); // Kstar(1430)+ -> pi+K0S
2918
2919 fCandidateVariables[85]=0;
2920 fCandidateVariables[86]=0;
2921 fCandidateVariables[87]=0;
516f546e 2922 fCandidateVariables[88]=0;
14fe9f43 2923 if (fUseMCInfo) {
516f546e 2924 if (v0pos->GetLabel()!=-1 &&
2925 v0neg->GetLabel()!=-1) {
2926 const Int_t ndg=2;
2927 Int_t dgLabels[ndg]={TMath::Abs(v0pos->GetLabel()),
2928 TMath::Abs(v0neg->GetLabel())};
2929 Int_t ndgCk=0;
2930 Int_t *pdgDg=0;
2931 Int_t absLabelMother=-1;
2932 Int_t nDauCand=-1;
2933 fCandidateVariables[88]=SearchForCommonMother(mcArray,
2934 dgLabels,ndg,ndgCk,pdgDg,absLabelMother,nDauCand);
2935 }
14fe9f43 2936 if (bachelor->GetLabel()!=-1 &&
2937 v0pos->GetLabel()!=-1 &&
2938 v0neg->GetLabel()!=-1) {
2939 const Int_t ndg=3;
2940 Int_t dgLabels[ndg]={TMath::Abs(bachelor->GetLabel()),
2941 TMath::Abs(v0pos->GetLabel()),
2942 TMath::Abs(v0neg->GetLabel())};
2943 Int_t ndgCk=0;
2944 Int_t *pdgDg=0;
2945 Int_t absLabelMother=-1;
516f546e 2946 Int_t nDauCand=-1;
14fe9f43 2947 fCandidateVariables[85]=SearchForCommonMother(mcArray,
516f546e 2948 dgLabels,ndg,ndgCk,pdgDg,absLabelMother,nDauCand);
14fe9f43 2949 AliAODMCParticle *part1 = dynamic_cast<AliAODMCParticle*>(mcArray->At(TMath::Abs(v0pos->GetLabel())));
2950 AliAODMCParticle *part2 = dynamic_cast<AliAODMCParticle*>(mcArray->At(TMath::Abs(v0neg->GetLabel())));
516f546e 2951 if(part1) fCandidateVariables[86]=part1->GetPdgCode();
2952 if(part2) fCandidateVariables[87]=part2->GetPdgCode();
14fe9f43 2953 }
2954 }
2955
2956 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
2957 AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
2958 AliPIDResponse *pidResponse=inputHandler->GetPIDResponse();
516f546e 2959 fCandidateVariables[89]=pidResponse->GetTOFResponse().GetStartTimeMask(bachelor->P());
43c7bace 2960
2961 //fCandidateVariables[65] = bachelor->Px();
2962 //fCandidateVariables[66] = bachelor->Py();
2963 //fCandidateVariables[67] = bachelor->Pz();
2964 //fCandidateVariables[68] = v0pos->Px();
2965 //fCandidateVariables[69] = v0pos->Py();
2966 //fCandidateVariables[70] = v0pos->Pz();
2967 //fCandidateVariables[71] = v0neg->Px();
2968 //fCandidateVariables[72] = v0neg->Py();
2969 //fCandidateVariables[73] = v0neg->Pz();
2970 //fCandidateVariables[74] = part->PxProng(0);
2971 //fCandidateVariables[75] = part->PyProng(0);
2972 //fCandidateVariables[76] = part->PzProng(0);
2973 //fCandidateVariables[77] = part->PxProng(1);
2974 //fCandidateVariables[78] = part->PyProng(1);
2975 //fCandidateVariables[79] = part->PzProng(1);
2976 //fCandidateVariables[80] = v0part->PxProng(0);
2977 //fCandidateVariables[81] = v0part->PyProng(0);
2978 //fCandidateVariables[82] = v0part->PzProng(0);
2979 //fCandidateVariables[83] = v0part->PxProng(1);
2980 //fCandidateVariables[84] = v0part->PyProng(1);
2981 //fCandidateVariables[85] = v0part->PzProng(1);
2982 //fCandidateVariables[86] = part->QtProng(0);
2983 //fCandidateVariables[87] = part->Alpha();
2984
2985 fVariablesTree->Fill();
992ba7d8 2986
43c7bace 2987 return;
2988}
0dbd1d4f 2989