1 /*************************************************************************
4 * Task for Jet Chemistry Analysis in PWG4 Jet Task Force Train *
5 * Analysis of K0s, Lambda and Antilambda with and without Jetevents *
7 *************************************************************************/
9 /**************************************************************************
10 * Copyright(c) 1998-2012, ALICE Experiment at CERN, All rights reserved. *
12 * Author: The ALICE Off-line Project. *
13 * Contributors are mentioned in the code where appropriate. *
15 * Permission to use, copy, modify and distribute this software and its *
16 * documentation strictly for non-commercial purposes is hereby grante *
18 * without fee, provided that the above copyright notice appears in all *
19 * copies and that both the copyright notice and this permission notice *
20 * appear in the supporting documentation. The authors make no claims *
21 * about the suitability of this software for any purpose. It is *
22 * provided "as is" without express or implied warranty. *
23 **************************************************************************/
41 #include "THnSparse.h"
44 #include "AliAnalysisHelperJetTasks.h"
45 #include "TDatabasePDG.h"
47 #include "AliAnalysisManager.h"
48 #include "AliAODHandler.h"
49 #include "AliAODInputHandler.h"
50 #include "AliESDEvent.h"
51 #include "AliGenPythiaEventHeader.h"
52 #include "AliGenHijingEventHeader.h"
53 #include "AliGenEventHeader.h"
54 #include "TLorentzVector.h"
55 #include "AliAODEvent.h"
56 #include "AliAODJet.h"
58 #include "AliAODTrack.h"
59 #include "AliCentrality.h"
60 #include "AliAnalysisTaskSE.h"
61 #include "AliESDtrack.h"
62 #include "AliESDtrackCuts.h"
63 #include "AliESDEvent.h"
64 #include "AliESDInputHandler.h"
66 #include "AliPIDResponse.h"
67 #include "AliAODPid.h"
68 #include "AliExternalTrackParam.h"
69 #include "AliAnalysisTaskJetChem.h"
70 #include "AliPhysicsSelection.h"
71 #include "AliBackgroundSelection.h"
72 #include "AliInputEventHandler.h"
73 #include "AliAODMCHeader.h"
74 #include "AliAODPid.h"
75 #include "AliVEvent.h"
76 #include "AliAODMCParticle.h"
80 ClassImp(AliAnalysisTaskJetChem)
82 //____________________________________________________________________________
83 AliAnalysisTaskJetChem::AliAnalysisTaskJetChem()
84 : AliAnalysisTaskFragmentationFunction()
96 ,fCutV0cosPointAngle(0)
97 ,fCutChi2PosDaughter(0)
98 ,fCutChi2NegDaughter(0)
105 ,fCutDcaV0Daughters(0)
106 ,fCutDcaPosToPrimVertex(0)
107 ,fCutDcaNegToPrimVertex(0)
117 ,fFFHistosRecCutsK0Evt(0)
118 ,fFFHistosIMK0AllEvt(0)
120 ,fFFHistosIMK0Cone(0)
121 ,fFFHistosPhiCorrIMK0(0)
125 ,fFFHistosIMLaAllEvt(0)
127 ,fFFHistosIMLaCone(0)
128 ,fFFHistosPhiCorrIMLa(0)
132 ,fListFeeddownLaCand(0)
133 ,fListFeeddownALaCand(0)
139 ,fListMCgenK0sCone(0)
141 ,fListMCgenALaCone(0)
142 ,IsArmenterosSelected(0)
143 ,fFFHistosIMALaAllEvt(0)
144 ,fFFHistosIMALaJet(0)
145 ,fFFHistosIMALaCone(0)
146 ,fFFHistosPhiCorrIMALa(0)
162 ,fFFIMLaNBinsJetPt(0)
177 ,fPhiCorrIMNBinsPt(0)
180 ,fPhiCorrIMNBinsPhi(0)
183 ,fPhiCorrIMNBinsInvM(0)
184 ,fPhiCorrIMInvMMin(0)
185 ,fPhiCorrIMInvMMax(0)
186 ,fPhiCorrIMLaNBinsPt(0)
187 ,fPhiCorrIMLaPtMin(0)
188 ,fPhiCorrIMLaPtMax(0)
189 ,fPhiCorrIMLaNBinsPhi(0)
190 ,fPhiCorrIMLaPhiMin(0)
191 ,fPhiCorrIMLaPhiMax(0)
192 ,fPhiCorrIMLaNBinsInvM(0)
193 ,fPhiCorrIMLaInvMMin(0)
194 ,fPhiCorrIMLaInvMMax(0)
221 ,fh2ProperLifetimeK0sVsPtBeforeCut(0)
222 ,fh2ProperLifetimeK0sVsPtAfterCut(0)
223 ,fh1ProperLifetimeV0BeforeCut(0)
224 ,fh1ProperLifetimeV0AfterCut(0)
226 ,fh1DcaV0Daughters(0)
227 ,fh1DcaPosToPrimVertex(0)
228 ,fh1DcaNegToPrimVertex(0)
229 ,fh2ArmenterosBeforeCuts(0)
230 ,fh2ArmenterosAfterCuts(0)
233 ,fh1CrossedRowsOverFindableNeg(0)
234 ,fh1CrossedRowsOverFindablePos(0)
235 ,fh1PosDaughterCharge(0)
236 ,fh1NegDaughterCharge(0)
243 ,fh3InvMassEtaTrackPtK0s(0)
244 ,fh3InvMassEtaTrackPtLa(0)
245 ,fh3InvMassEtaTrackPtALa(0)
252 ,fh2MCEtagenK0Cone(0)
253 ,fh2MCEtagenLaCone(0)
254 ,fh2MCEtagenALaCone(0)
255 ,fh1FFIMK0ConeSmear(0)
256 ,fh1FFIMLaConeSmear(0)
257 ,fh1FFIMALaConeSmear(0)
261 ,fh3MCrecK0ConeSmear(0)
262 ,fh3MCrecLaConeSmear(0)
263 ,fh3MCrecALaConeSmear(0)
269 ,fh3IMK0MedianCone(0)
270 ,fh3IMLaMedianCone(0)
271 ,fh3IMALaMedianCone(0)
272 ,fh1MCMultiplicityPrimary(0)
273 ,fh1MCMultiplicityTracks(0)
278 ,fh3FeedDownLaCone(0)
279 ,fh3FeedDownALaCone(0)
280 ,fh1MCProdRadiusK0s(0)
281 ,fh1MCProdRadiusLambda(0)
282 ,fh1MCProdRadiusAntiLambda(0)
286 ,fh1MCPtAntiLambda(0)
294 ,fh1MCRapAntiLambda(0)
298 ,fh1MCEtaAntiLambda(0)
301 // default constructor
304 //__________________________________________________________________________________________
305 AliAnalysisTaskJetChem::AliAnalysisTaskJetChem(const char *name)
306 : AliAnalysisTaskFragmentationFunction(name)
318 ,fCutV0cosPointAngle(0)
319 ,fCutChi2PosDaughter(0)
320 ,fCutChi2NegDaughter(0)
327 ,fCutDcaV0Daughters(0)
328 ,fCutDcaPosToPrimVertex(0)
329 ,fCutDcaNegToPrimVertex(0)
339 ,fFFHistosRecCutsK0Evt(0)
340 ,fFFHistosIMK0AllEvt(0)
342 ,fFFHistosIMK0Cone(0)
343 ,fFFHistosPhiCorrIMK0(0)
347 ,fFFHistosIMLaAllEvt(0)
349 ,fFFHistosIMLaCone(0)
350 ,fFFHistosPhiCorrIMLa(0)
354 ,fListFeeddownLaCand(0)
355 ,fListFeeddownALaCand(0)
361 ,fListMCgenK0sCone(0)
363 ,fListMCgenALaCone(0)
364 ,IsArmenterosSelected(0)
365 ,fFFHistosIMALaAllEvt(0)
366 ,fFFHistosIMALaJet(0)
367 ,fFFHistosIMALaCone(0)
368 ,fFFHistosPhiCorrIMALa(0)
384 ,fFFIMLaNBinsJetPt(0)
399 ,fPhiCorrIMNBinsPt(0)
402 ,fPhiCorrIMNBinsPhi(0)
405 ,fPhiCorrIMNBinsInvM(0)
406 ,fPhiCorrIMInvMMin(0)
407 ,fPhiCorrIMInvMMax(0)
408 ,fPhiCorrIMLaNBinsPt(0)
409 ,fPhiCorrIMLaPtMin(0)
410 ,fPhiCorrIMLaPtMax(0)
411 ,fPhiCorrIMLaNBinsPhi(0)
412 ,fPhiCorrIMLaPhiMin(0)
413 ,fPhiCorrIMLaPhiMax(0)
414 ,fPhiCorrIMLaNBinsInvM(0)
415 ,fPhiCorrIMLaInvMMin(0)
416 ,fPhiCorrIMLaInvMMax(0)
443 ,fh2ProperLifetimeK0sVsPtBeforeCut(0)
444 ,fh2ProperLifetimeK0sVsPtAfterCut(0)
445 ,fh1ProperLifetimeV0BeforeCut(0)
446 ,fh1ProperLifetimeV0AfterCut(0)
448 ,fh1DcaV0Daughters(0)
449 ,fh1DcaPosToPrimVertex(0)
450 ,fh1DcaNegToPrimVertex(0)
451 ,fh2ArmenterosBeforeCuts(0)
452 ,fh2ArmenterosAfterCuts(0)
455 ,fh1CrossedRowsOverFindableNeg(0)
456 ,fh1CrossedRowsOverFindablePos(0)
457 ,fh1PosDaughterCharge(0)
458 ,fh1NegDaughterCharge(0)
465 ,fh3InvMassEtaTrackPtK0s(0)
466 ,fh3InvMassEtaTrackPtLa(0)
467 ,fh3InvMassEtaTrackPtALa(0)
473 ,fh2MCEtagenK0Cone(0)
474 ,fh2MCEtagenLaCone(0)
475 ,fh2MCEtagenALaCone(0)
476 ,fh1FFIMK0ConeSmear(0)
477 ,fh1FFIMLaConeSmear(0)
478 ,fh1FFIMALaConeSmear(0)
482 ,fh3MCrecK0ConeSmear(0)
483 ,fh3MCrecLaConeSmear(0)
484 ,fh3MCrecALaConeSmear(0)
490 ,fh3IMK0MedianCone(0)
491 ,fh3IMLaMedianCone(0)
492 ,fh3IMALaMedianCone(0)
493 ,fh1MCMultiplicityPrimary(0)
494 ,fh1MCMultiplicityTracks(0)
499 ,fh3FeedDownLaCone(0)
500 ,fh3FeedDownALaCone(0)
501 ,fh1MCProdRadiusK0s(0)
502 ,fh1MCProdRadiusLambda(0)
503 ,fh1MCProdRadiusAntiLambda(0)
507 ,fh1MCPtAntiLambda(0)
515 ,fh1MCRapAntiLambda(0)
519 ,fh1MCEtaAntiLambda(0)
525 DefineOutput(1,TList::Class());
528 //__________________________________________________________________________________________________________________________
529 AliAnalysisTaskJetChem::AliAnalysisTaskJetChem(const AliAnalysisTaskJetChem ©)
530 : AliAnalysisTaskFragmentationFunction()
532 ,fAnalysisMC(copy.fAnalysisMC)
533 ,fDeltaVertexZ(copy.fDeltaVertexZ)
534 ,fCuttrackNegNcls(copy.fCuttrackNegNcls)
535 ,fCuttrackPosNcls(copy.fCuttrackPosNcls)
536 ,fCutPostrackRap(copy.fCutPostrackRap)
537 ,fCutNegtrackRap(copy.fCutNegtrackRap)
538 ,fCutRap(copy.fCutRap)
539 ,fCutPostrackEta(copy.fCutPostrackEta)
540 ,fCutNegtrackEta(copy.fCutNegtrackEta)
541 ,fCutEta(copy.fCutEta)
542 ,fCutV0cosPointAngle(copy.fCutV0cosPointAngle)
543 ,fCutChi2PosDaughter(copy.fCutChi2PosDaughter)
544 ,fCutChi2NegDaughter(copy.fCutChi2NegDaughter)
545 ,fKinkDaughters(copy.fKinkDaughters)
546 ,fRequireTPCRefit(copy.fRequireTPCRefit)
547 ,fCutArmenteros(copy.fCutArmenteros)
548 ,fCutV0DecayMin(copy.fCutV0DecayMin)
549 ,fCutV0DecayMax(copy.fCutV0DecayMax)
550 ,fCutV0totMom(copy.fCutV0totMom)
551 ,fCutDcaV0Daughters(copy.fCutDcaV0Daughters)
552 ,fCutDcaPosToPrimVertex(copy.fCutDcaPosToPrimVertex)
553 ,fCutDcaNegToPrimVertex(copy.fCutDcaNegToPrimVertex)
554 ,fCutV0RadiusMin(copy.fCutV0RadiusMin)
555 ,fCutV0RadiusMax(copy.fCutV0RadiusMax)
556 ,fCutBetheBloch(copy.fCutBetheBloch)
557 ,fCutRatio(copy.fCutRatio)
558 ,fK0Type(copy.fK0Type)
559 ,fFilterMaskK0(copy.fFilterMaskK0)
560 ,fListK0s(copy.fListK0s)
561 ,fPIDResponse(copy.fPIDResponse)
562 ,fV0QAK0(copy.fV0QAK0)
563 ,fFFHistosRecCutsK0Evt(copy.fFFHistosRecCutsK0Evt)
564 ,fFFHistosIMK0AllEvt(copy.fFFHistosIMK0AllEvt)
565 ,fFFHistosIMK0Jet(copy.fFFHistosIMK0Jet)
566 ,fFFHistosIMK0Cone(copy.fFFHistosIMK0Cone)
567 ,fFFHistosPhiCorrIMK0(copy.fFFHistosPhiCorrIMK0)
568 ,fLaType(copy.fLaType)
569 ,fFilterMaskLa(copy.fFilterMaskLa)
570 ,fListLa(copy.fListLa)
571 ,fFFHistosIMLaAllEvt(copy.fFFHistosIMLaAllEvt)
572 ,fFFHistosIMLaJet(copy.fFFHistosIMLaJet)
573 ,fFFHistosIMLaCone(copy.fFFHistosIMLaCone)
574 ,fFFHistosPhiCorrIMLa(copy.fFFHistosPhiCorrIMLa)
575 ,fALaType(copy.fALaType)
576 ,fFilterMaskALa(copy.fFilterMaskALa)
577 ,fListALa(copy.fListALa)
578 ,fListFeeddownLaCand(copy.fListFeeddownLaCand)
579 ,fListFeeddownALaCand(copy.fListFeeddownALaCand)
580 ,jetConeFDLalist(copy.jetConeFDLalist)
581 ,jetConeFDALalist(copy.jetConeFDALalist)
582 ,fListMCgenK0s(copy.fListMCgenK0s)
583 ,fListMCgenLa(copy.fListMCgenLa)
584 ,fListMCgenALa(copy.fListMCgenALa)
585 ,fListMCgenK0sCone(copy.fListMCgenK0sCone)
586 ,fListMCgenLaCone(copy.fListMCgenLaCone)
587 ,fListMCgenALaCone(copy.fListMCgenALaCone)
588 ,IsArmenterosSelected(copy.IsArmenterosSelected)
589 ,fFFHistosIMALaAllEvt(copy.fFFHistosIMALaAllEvt)
590 ,fFFHistosIMALaJet(copy.fFFHistosIMALaJet)
591 ,fFFHistosIMALaCone(copy.fFFHistosIMALaCone)
592 ,fFFHistosPhiCorrIMALa(copy.fFFHistosPhiCorrIMALa)
593 ,fFFIMNBinsJetPt(copy.fFFIMNBinsJetPt)
594 ,fFFIMJetPtMin(copy.fFFIMJetPtMin)
595 ,fFFIMJetPtMax(copy.fFFIMJetPtMax)
596 ,fFFIMNBinsInvM(copy.fFFIMNBinsInvM)
597 ,fFFIMInvMMin(copy.fFFIMInvMMin)
598 ,fFFIMInvMMax(copy.fFFIMInvMMax)
599 ,fFFIMNBinsPt(copy.fFFIMNBinsPt)
600 ,fFFIMPtMin(copy.fFFIMPtMin)
601 ,fFFIMPtMax(copy.fFFIMPtMax)
602 ,fFFIMNBinsXi(copy.fFFIMNBinsXi)
603 ,fFFIMXiMin(copy.fFFIMXiMin)
604 ,fFFIMXiMax(copy.fFFIMXiMax)
605 ,fFFIMNBinsZ(copy.fFFIMNBinsZ)
606 ,fFFIMZMin(copy.fFFIMZMin)
607 ,fFFIMZMax(copy.fFFIMZMax)
608 ,fFFIMLaNBinsJetPt(copy.fFFIMLaNBinsJetPt)
609 ,fFFIMLaJetPtMin(copy.fFFIMLaJetPtMin)
610 ,fFFIMLaJetPtMax(copy.fFFIMLaJetPtMax)
611 ,fFFIMLaNBinsInvM(copy.fFFIMLaNBinsInvM)
612 ,fFFIMLaInvMMin(copy.fFFIMLaInvMMin)
613 ,fFFIMLaInvMMax(copy.fFFIMLaInvMMax)
614 ,fFFIMLaNBinsPt(copy.fFFIMLaNBinsPt)
615 ,fFFIMLaPtMin(copy.fFFIMLaPtMin)
616 ,fFFIMLaPtMax(copy.fFFIMLaPtMax)
617 ,fFFIMLaNBinsXi(copy.fFFIMLaNBinsXi)
618 ,fFFIMLaXiMin(copy.fFFIMLaXiMin)
619 ,fFFIMLaXiMax(copy.fFFIMLaXiMax)
620 ,fFFIMLaNBinsZ(copy.fFFIMLaNBinsZ)
621 ,fFFIMLaZMin(copy.fFFIMLaZMin)
622 ,fFFIMLaZMax(copy.fFFIMLaZMax)
623 ,fPhiCorrIMNBinsPt(copy.fPhiCorrIMNBinsPt)
624 ,fPhiCorrIMPtMin(copy.fPhiCorrIMPtMin)
625 ,fPhiCorrIMPtMax(copy.fPhiCorrIMPtMax)
626 ,fPhiCorrIMNBinsPhi(copy.fPhiCorrIMNBinsPhi)
627 ,fPhiCorrIMPhiMin(copy.fPhiCorrIMPhiMin)
628 ,fPhiCorrIMPhiMax(copy.fPhiCorrIMPhiMax)
629 ,fPhiCorrIMNBinsInvM(copy.fPhiCorrIMNBinsInvM)
630 ,fPhiCorrIMInvMMin(copy.fPhiCorrIMInvMMin)
631 ,fPhiCorrIMInvMMax(copy.fPhiCorrIMInvMMax)
632 ,fPhiCorrIMLaNBinsPt(copy.fPhiCorrIMLaNBinsPt)
633 ,fPhiCorrIMLaPtMin(copy.fPhiCorrIMLaPtMin)
634 ,fPhiCorrIMLaPtMax(copy.fPhiCorrIMLaPtMax)
635 ,fPhiCorrIMLaNBinsPhi(copy.fPhiCorrIMLaNBinsPhi)
636 ,fPhiCorrIMLaPhiMin(copy.fPhiCorrIMLaPhiMin)
637 ,fPhiCorrIMLaPhiMax(copy.fPhiCorrIMLaPhiMax)
638 ,fPhiCorrIMLaNBinsInvM(copy.fPhiCorrIMLaNBinsInvM)
639 ,fPhiCorrIMLaInvMMin(copy.fPhiCorrIMLaInvMMin)
640 ,fPhiCorrIMLaInvMMax(copy.fPhiCorrIMLaInvMMax)
641 ,fh1EvtAllCent(copy.fh1EvtAllCent)
643 ,fh1K0Mult(copy.fh1K0Mult)
644 ,fh1dPhiJetK0(copy.fh1dPhiJetK0)
645 ,fh1LaMult(copy.fh1LaMult)
646 ,fh1dPhiJetLa(copy.fh1dPhiJetLa)
647 ,fh1ALaMult(copy.fh1ALaMult)
648 ,fh1dPhiJetALa(copy.fh1dPhiJetALa)
649 ,fh1JetEta(copy.fh1JetEta)
650 ,fh1JetPhi(copy.fh1JetPhi)
651 ,fh2JetEtaPhi(copy.fh2JetEtaPhi)
652 ,fh1V0JetPt(copy.fh1V0JetPt)
653 ,fh2FFJetTrackEta(copy.fh2FFJetTrackEta)
654 ,fh1trackPosNCls(copy.fh1trackPosNCls)
655 ,fh1trackNegNCls(copy.fh1trackNegNCls)
656 ,fh1trackPosRap(copy.fh1trackPosRap)
657 ,fh1trackNegRap(copy.fh1trackNegRap)
658 ,fh1V0Rap(copy.fh1V0Rap)
659 ,fh1trackPosEta(copy.fh1trackPosEta)
660 ,fh1trackNegEta(copy.fh1trackNegEta)
661 ,fh1V0Eta(copy.fh1V0Eta)
662 ,fh1V0totMom(copy.fh1V0totMom)
663 ,fh1CosPointAngle(copy.fh1CosPointAngle)
664 ,fh1Chi2Pos(copy.fh1Chi2Pos)
665 ,fh1Chi2Neg(copy.fh1Chi2Neg)
666 ,fh1DecayLengthV0(copy.fh1DecayLengthV0)
667 ,fh2ProperLifetimeK0sVsPtBeforeCut(copy.fh2ProperLifetimeK0sVsPtBeforeCut)
668 ,fh2ProperLifetimeK0sVsPtAfterCut(copy.fh2ProperLifetimeK0sVsPtAfterCut)
669 ,fh1ProperLifetimeV0BeforeCut(copy.fh1ProperLifetimeV0BeforeCut)
670 ,fh1ProperLifetimeV0AfterCut(copy.fh1ProperLifetimeV0AfterCut)
671 ,fh1V0Radius(copy.fh1V0Radius)
672 ,fh1DcaV0Daughters(copy.fh1DcaV0Daughters)
673 ,fh1DcaPosToPrimVertex(copy.fh1DcaPosToPrimVertex)
674 ,fh1DcaNegToPrimVertex(copy.fh1DcaNegToPrimVertex)
675 ,fh2ArmenterosBeforeCuts(copy.fh2ArmenterosBeforeCuts)
676 ,fh2ArmenterosAfterCuts(copy.fh2ArmenterosAfterCuts)
677 ,fh2BBLaPos(copy.fh2BBLaPos)
678 ,fh2BBLaNeg(copy.fh2BBLaPos)
679 ,fh1CrossedRowsOverFindableNeg(copy.fh1CrossedRowsOverFindableNeg)
680 ,fh1CrossedRowsOverFindablePos(copy.fh1CrossedRowsOverFindablePos)
681 ,fh1PosDaughterCharge(copy.fh1PosDaughterCharge)
682 ,fh1NegDaughterCharge(copy.fh1NegDaughterCharge)
683 ,fh1PtMCK0s(copy.fh1PtMCK0s)
684 ,fh1PtMCLa(copy.fh1PtMCLa)
685 ,fh1PtMCALa(copy.fh1PtMCALa)
686 ,fh1EtaK0s(copy.fh1EtaK0s)
687 ,fh1EtaLa(copy.fh1EtaLa)
688 ,fh1EtaALa(copy.fh1EtaALa)
689 ,fh3InvMassEtaTrackPtK0s(copy.fh3InvMassEtaTrackPtK0s)
690 ,fh3InvMassEtaTrackPtLa(copy.fh3InvMassEtaTrackPtLa)
691 ,fh3InvMassEtaTrackPtALa(copy.fh3InvMassEtaTrackPtALa)
693 ,fh1TrackMultCone(copy.fh1TrackMultCone)
694 ,fh2TrackMultCone(copy.fh2TrackMultCone)
695 ,fh2MCgenK0Cone(copy.fh2MCgenK0Cone)
696 ,fh2MCgenLaCone(copy.fh2MCgenLaCone)
697 ,fh2MCgenALaCone(copy.fh2MCgenALaCone)
698 ,fh2MCEtagenK0Cone(copy.fh2MCEtagenK0Cone)
699 ,fh2MCEtagenLaCone(copy.fh2MCEtagenLaCone)
700 ,fh2MCEtagenALaCone(copy.fh2MCEtagenALaCone)
701 ,fh1FFIMK0ConeSmear(copy.fh1FFIMK0ConeSmear)
702 ,fh1FFIMLaConeSmear(copy.fh1FFIMLaConeSmear)
703 ,fh1FFIMALaConeSmear(copy.fh1FFIMALaConeSmear)
704 ,fh3MCrecK0Cone(copy.fh3MCrecK0Cone)
705 ,fh3MCrecLaCone(copy.fh3MCrecLaCone)
706 ,fh3MCrecALaCone(copy.fh3MCrecALaCone)
707 ,fh3MCrecK0ConeSmear(copy.fh3MCrecK0ConeSmear)
708 ,fh3MCrecLaConeSmear(copy.fh3MCrecLaConeSmear)
709 ,fh3MCrecALaConeSmear(copy.fh3MCrecALaConeSmear)
710 ,fh3SecContinCone(copy.fh3SecContinCone)
711 ,fh3StrContinCone(copy.fh3StrContinCone)
712 ,fh3IMK0PerpCone(copy.fh3IMK0PerpCone)
713 ,fh3IMLaPerpCone(copy.fh3IMLaPerpCone)
714 ,fh3IMALaPerpCone(copy.fh3IMALaPerpCone)
715 ,fh3IMK0MedianCone(copy.fh3IMK0MedianCone)
716 ,fh3IMLaMedianCone(copy.fh3IMLaMedianCone)
717 ,fh3IMALaMedianCone(copy.fh3IMALaMedianCone)
718 ,fh1MCMultiplicityPrimary(copy.fh1MCMultiplicityPrimary)
719 ,fh1MCMultiplicityTracks(copy.fh1MCMultiplicityTracks)
720 ,fh1MCmotherLa(copy.fh1MCmotherLa)
721 ,fh1MCmotherALa(copy.fh1MCmotherALa)
722 ,fh3FeedDownLa(copy.fh3FeedDownLa)
723 ,fh3FeedDownALa(copy.fh3FeedDownALa)
724 ,fh3FeedDownLaCone(copy.fh3FeedDownLaCone)
725 ,fh3FeedDownALaCone(copy.fh3FeedDownALaCone)
726 ,fh1MCProdRadiusK0s(copy.fh1MCProdRadiusK0s)
727 ,fh1MCProdRadiusLambda(copy.fh1MCProdRadiusLambda)
728 ,fh1MCProdRadiusAntiLambda(copy.fh1MCProdRadiusAntiLambda)
729 ,fh1MCPtV0s(copy.fh1MCPtV0s)
730 ,fh1MCPtK0s(copy.fh1MCPtK0s)
731 ,fh1MCPtLambda(copy.fh1MCPtLambda)
732 ,fh1MCPtAntiLambda(copy.fh1MCPtAntiLambda)
733 ,fh1MCXiPt(copy.fh1MCXiPt)
734 ,fh1MCXibarPt(copy.fh1MCXibarPt)
735 ,fh2MCEtaVsPtK0s(copy.fh2MCEtaVsPtK0s)
736 ,fh2MCEtaVsPtLa(copy.fh2MCEtaVsPtLa)
737 ,fh2MCEtaVsPtALa(copy.fh2MCEtaVsPtALa)
738 ,fh1MCRapK0s(copy.fh1MCRapK0s)
739 ,fh1MCRapLambda(copy.fh1MCRapLambda)
740 ,fh1MCRapAntiLambda(copy.fh1MCRapAntiLambda)
741 ,fh1MCEtaAllK0s(copy.fh1MCEtaAllK0s)
742 ,fh1MCEtaK0s(copy.fh1MCEtaK0s)
743 ,fh1MCEtaLambda(copy.fh1MCEtaLambda)
744 ,fh1MCEtaAntiLambda(copy.fh1MCEtaAntiLambda)
751 // _________________________________________________________________________________________________________________________________
752 AliAnalysisTaskJetChem& AliAnalysisTaskJetChem::operator=(const AliAnalysisTaskJetChem& o)
757 AliAnalysisTaskFragmentationFunction::operator=(o);
759 fAnalysisMC = o.fAnalysisMC;
760 fDeltaVertexZ = o.fDeltaVertexZ;
761 fCuttrackNegNcls = o.fCuttrackNegNcls;
762 fCuttrackPosNcls = o.fCuttrackPosNcls;
763 fCutPostrackRap = o.fCutPostrackRap;
764 fCutNegtrackRap = o.fCutNegtrackRap;
766 fCutPostrackEta = o.fCutPostrackEta;
767 fCutNegtrackEta = o.fCutNegtrackEta;
769 fCutV0cosPointAngle = o.fCutV0cosPointAngle;
770 fCutChi2PosDaughter = o.fCutChi2PosDaughter;
771 fCutChi2NegDaughter = o.fCutChi2NegDaughter;
772 fKinkDaughters = o.fKinkDaughters;
773 fRequireTPCRefit = o.fRequireTPCRefit;
774 fCutArmenteros = o.fCutArmenteros;
775 fCutV0DecayMin = o.fCutV0DecayMin;
776 fCutV0DecayMax = o.fCutV0DecayMax;
777 fCutV0totMom = o.fCutV0totMom;
778 fCutDcaV0Daughters = o.fCutDcaV0Daughters;
779 fCutDcaPosToPrimVertex = o.fCutDcaPosToPrimVertex;
780 fCutDcaNegToPrimVertex = o.fCutDcaNegToPrimVertex;
781 fCutV0RadiusMin = o.fCutV0RadiusMin;
782 fCutV0RadiusMax = o.fCutV0RadiusMax;
783 fCutBetheBloch = o.fCutBetheBloch;
784 fCutRatio = o.fCutRatio;
786 fFilterMaskK0 = o.fFilterMaskK0;
787 fListK0s = o.fListK0s;
788 fPIDResponse = o.fPIDResponse;
790 fFFHistosRecCutsK0Evt = o.fFFHistosRecCutsK0Evt;
791 fFFHistosIMK0AllEvt = o.fFFHistosIMK0AllEvt;
792 fFFHistosIMK0Jet = o.fFFHistosIMK0Jet;
793 fFFHistosIMK0Cone = o.fFFHistosIMK0Cone;
794 fFFHistosPhiCorrIMK0 = o.fFFHistosPhiCorrIMK0;
796 fFilterMaskLa = o.fFilterMaskLa;
798 fFFHistosIMLaAllEvt = o.fFFHistosIMLaAllEvt;
799 fFFHistosIMLaJet = o.fFFHistosIMLaJet;
800 fFFHistosIMLaCone = o.fFFHistosIMLaCone;
801 fFFHistosPhiCorrIMLa = o.fFFHistosPhiCorrIMLa;
802 fALaType = o.fALaType;
803 fFilterMaskALa = o.fFilterMaskALa;
804 fListFeeddownLaCand = o.fListFeeddownLaCand;
805 fListFeeddownALaCand = o.fListFeeddownALaCand;
806 jetConeFDLalist = o.jetConeFDLalist;
807 jetConeFDALalist = o.jetConeFDALalist;
808 fListMCgenK0s = o.fListMCgenK0s;
809 fListMCgenLa = o.fListMCgenLa;
810 fListMCgenALa = o.fListMCgenALa;
811 fListMCgenK0sCone = o.fListMCgenK0sCone;
812 fListMCgenLaCone = o.fListMCgenLaCone;
813 fListMCgenALaCone = o.fListMCgenALaCone;
814 IsArmenterosSelected = o.IsArmenterosSelected;
815 fFFHistosIMALaAllEvt = o.fFFHistosIMALaAllEvt;
816 fFFHistosIMALaJet = o.fFFHistosIMALaJet;
817 fFFHistosIMALaCone = o.fFFHistosIMALaCone;
818 fFFHistosPhiCorrIMALa = o.fFFHistosPhiCorrIMALa;
819 fFFIMNBinsJetPt = o.fFFIMNBinsJetPt;
820 fFFIMJetPtMin = o.fFFIMJetPtMin;
821 fFFIMJetPtMax = o.fFFIMJetPtMax;
822 fFFIMNBinsPt = o.fFFIMNBinsPt;
823 fFFIMPtMin = o.fFFIMPtMin;
824 fFFIMPtMax = o.fFFIMPtMax;
825 fFFIMNBinsXi = o.fFFIMNBinsXi;
826 fFFIMXiMin = o.fFFIMXiMin;
827 fFFIMXiMax = o.fFFIMXiMax;
828 fFFIMNBinsZ = o.fFFIMNBinsZ;
829 fFFIMZMin = o.fFFIMZMin;
830 fFFIMZMax = o.fFFIMZMax;
831 fFFIMLaNBinsJetPt = o.fFFIMLaNBinsJetPt;
832 fFFIMLaJetPtMin = o.fFFIMLaJetPtMin;
833 fFFIMLaJetPtMax = o.fFFIMLaJetPtMax;
834 fFFIMLaNBinsPt = o.fFFIMLaNBinsPt;
835 fFFIMLaPtMin = o.fFFIMLaPtMin;
836 fFFIMLaPtMax = o.fFFIMLaPtMax;
837 fFFIMLaNBinsXi = o.fFFIMLaNBinsXi;
838 fFFIMLaXiMin = o.fFFIMLaXiMin;
839 fFFIMLaXiMax = o.fFFIMLaXiMax;
840 fFFIMLaNBinsZ = o.fFFIMLaNBinsZ;
841 fFFIMLaZMin = o.fFFIMLaZMin;
842 fFFIMLaZMax = o.fFFIMLaZMax;
843 fPhiCorrIMNBinsPt = o.fPhiCorrIMNBinsPt;
844 fPhiCorrIMPtMin = o.fPhiCorrIMPtMin;
845 fPhiCorrIMPtMax = o.fPhiCorrIMPtMax;
846 fPhiCorrIMNBinsPhi = o.fPhiCorrIMNBinsPhi;
847 fPhiCorrIMPhiMin = o.fPhiCorrIMPhiMin;
848 fPhiCorrIMPhiMax = o.fPhiCorrIMPhiMax;
849 fPhiCorrIMNBinsInvM = o.fPhiCorrIMNBinsInvM;
850 fPhiCorrIMInvMMin = o.fPhiCorrIMInvMMin;
851 fPhiCorrIMInvMMax = o.fPhiCorrIMInvMMax;
852 fPhiCorrIMLaNBinsPt = o.fPhiCorrIMLaNBinsPt;
853 fPhiCorrIMLaPtMin = o.fPhiCorrIMLaPtMin;
854 fPhiCorrIMLaPtMax = o.fPhiCorrIMLaPtMax;
855 fPhiCorrIMLaNBinsPhi = o.fPhiCorrIMLaNBinsPhi;
856 fPhiCorrIMLaPhiMin = o.fPhiCorrIMLaPhiMin;
857 fPhiCorrIMLaPhiMax = o.fPhiCorrIMLaPhiMax;
858 fPhiCorrIMLaNBinsInvM = o.fPhiCorrIMLaNBinsInvM;
859 fPhiCorrIMLaInvMMin = o.fPhiCorrIMLaInvMMin;
860 fPhiCorrIMLaInvMMax = o.fPhiCorrIMLaInvMMax;
861 fh1EvtAllCent = o.fh1EvtAllCent;
863 fh1K0Mult = o.fh1K0Mult;
864 fh1dPhiJetK0 = o.fh1dPhiJetK0;
865 fh1LaMult = o.fh1LaMult;
866 fh1dPhiJetLa = o.fh1dPhiJetLa;
867 fh1ALaMult = o.fh1ALaMult;
868 fh1dPhiJetALa = o.fh1dPhiJetALa;
869 fh1JetEta = o.fh1JetEta;
870 fh1JetPhi = o.fh1JetPhi;
871 fh2JetEtaPhi = o.fh2JetEtaPhi;
872 fh1V0JetPt = o.fh1V0JetPt;
873 fh2FFJetTrackEta = o.fh2FFJetTrackEta;
874 fh1trackPosNCls = o.fh1trackPosNCls;
875 fh1trackNegNCls = o.fh1trackNegNCls;
876 fh1trackPosRap = o.fh1trackPosRap;
877 fh1trackNegRap = o.fh1trackNegRap;
878 fh1V0Rap = o.fh1V0Rap;
879 fh1trackPosEta = o.fh1trackPosEta;
880 fh1trackNegEta = o.fh1trackNegEta;
881 fh1V0Eta = o.fh1V0Eta;
882 fh1V0totMom = o.fh1V0totMom;
883 fh1CosPointAngle = o.fh1CosPointAngle;
884 fh1Chi2Pos = o.fh1Chi2Pos;
885 fh1Chi2Neg = o.fh1Chi2Neg;
886 fh1DecayLengthV0 = o.fh1DecayLengthV0;
887 fh2ProperLifetimeK0sVsPtBeforeCut = o.fh2ProperLifetimeK0sVsPtBeforeCut;
888 fh2ProperLifetimeK0sVsPtAfterCut= o.fh2ProperLifetimeK0sVsPtAfterCut;
889 fh1ProperLifetimeV0BeforeCut = o.fh1ProperLifetimeV0BeforeCut;
890 fh1ProperLifetimeV0AfterCut = o.fh1ProperLifetimeV0AfterCut;
891 fh1V0Radius = o.fh1V0Radius;
892 fh1DcaV0Daughters = o.fh1DcaV0Daughters;
893 fh1DcaPosToPrimVertex = o.fh1DcaPosToPrimVertex;
894 fh1DcaNegToPrimVertex = o.fh1DcaNegToPrimVertex;
895 fh2ArmenterosBeforeCuts = o.fh2ArmenterosBeforeCuts;
896 fh2ArmenterosAfterCuts = o.fh2ArmenterosAfterCuts;
897 fh2BBLaPos = o.fh2BBLaPos;
898 fh2BBLaNeg = o.fh2BBLaPos;
899 fh1CrossedRowsOverFindableNeg = o.fh1CrossedRowsOverFindableNeg;
900 fh1CrossedRowsOverFindablePos = o.fh1CrossedRowsOverFindablePos;
901 fh1PosDaughterCharge = o.fh1PosDaughterCharge;
902 fh1NegDaughterCharge = o.fh1NegDaughterCharge;
903 fh1PtMCK0s = o.fh1PtMCK0s;
904 fh1PtMCLa = o.fh1PtMCLa;
905 fh1PtMCALa = o.fh1PtMCALa;
906 fh1EtaK0s = o.fh1EtaK0s;
907 fh1EtaLa = o.fh1EtaLa;
908 fh1EtaALa = o.fh1EtaALa;
909 fh3InvMassEtaTrackPtK0s = o.fh3InvMassEtaTrackPtK0s;
910 fh3InvMassEtaTrackPtLa = o.fh3InvMassEtaTrackPtLa;
911 fh3InvMassEtaTrackPtALa = o.fh3InvMassEtaTrackPtALa;
912 fh1TrackMultCone = o.fh1TrackMultCone;
913 fh2TrackMultCone = o.fh2TrackMultCone;
914 fh2MCgenK0Cone = o.fh2MCgenK0Cone;
915 fh2MCgenLaCone = o.fh2MCgenLaCone;
916 fh2MCgenALaCone = o.fh2MCgenALaCone;
917 fh2MCEtagenK0Cone = o.fh2MCEtagenK0Cone;
918 fh2MCEtagenLaCone = o.fh2MCEtagenLaCone;
919 fh2MCEtagenALaCone = o.fh2MCEtagenALaCone;
920 fh1FFIMK0ConeSmear = o.fh1FFIMK0ConeSmear;
921 fh1FFIMLaConeSmear = o.fh1FFIMLaConeSmear;
922 fh1FFIMALaConeSmear = o.fh1FFIMALaConeSmear;
923 fh3MCrecK0Cone = o.fh3MCrecK0Cone;
924 fh3MCrecLaCone = o.fh3MCrecLaCone;
925 fh3MCrecALaCone = o.fh3MCrecALaCone;
926 fh3MCrecK0ConeSmear = o.fh3MCrecK0ConeSmear;
927 fh3MCrecLaConeSmear = o.fh3MCrecLaConeSmear;
928 fh3MCrecALaConeSmear = o.fh3MCrecALaConeSmear;
929 fh3SecContinCone = o.fh3SecContinCone;
930 fh3StrContinCone = o.fh3StrContinCone;
931 fh3IMK0PerpCone = o.fh3IMK0PerpCone;
932 fh3IMLaPerpCone = o.fh3IMLaPerpCone;
933 fh3IMALaPerpCone = o.fh3IMALaPerpCone;
934 fh3IMK0MedianCone = o.fh3IMK0MedianCone;
935 fh3IMLaMedianCone = o.fh3IMLaMedianCone;
936 fh3IMALaMedianCone = o.fh3IMALaMedianCone;
937 fh1MCMultiplicityPrimary = o.fh1MCMultiplicityPrimary;
938 fh1MCMultiplicityTracks = o.fh1MCMultiplicityTracks;
939 fh1MCmotherLa = o.fh1MCmotherLa;
940 fh1MCmotherALa = o.fh1MCmotherALa;
941 fh3FeedDownLa = o.fh3FeedDownLa;
942 fh3FeedDownALa = o.fh3FeedDownALa;
943 fh3FeedDownLaCone = o.fh3FeedDownLaCone;
944 fh3FeedDownALaCone = o.fh3FeedDownALaCone;
945 fh1MCProdRadiusK0s = o.fh1MCProdRadiusK0s;
946 fh1MCProdRadiusLambda = o.fh1MCProdRadiusLambda;
947 fh1MCProdRadiusAntiLambda = o.fh1MCProdRadiusAntiLambda;
948 fh1MCPtV0s = o.fh1MCPtV0s;
949 fh1MCPtK0s = o.fh1MCPtK0s;
950 fh1MCPtLambda = o.fh1MCPtLambda;
951 fh1MCPtAntiLambda = o.fh1MCPtAntiLambda;
952 fh1MCXiPt = o.fh1MCXiPt;
953 fh1MCXibarPt = o.fh1MCXibarPt;
954 fh2MCEtaVsPtK0s = o.fh2MCEtaVsPtK0s;
955 fh2MCEtaVsPtLa = o.fh2MCEtaVsPtLa;
956 fh2MCEtaVsPtALa = o.fh2MCEtaVsPtALa;
957 fh1MCRapK0s = o.fh1MCRapK0s;
958 fh1MCRapLambda = o.fh1MCRapLambda;
959 fh1MCRapAntiLambda = o.fh1MCRapAntiLambda;
960 fh1MCEtaAllK0s = o.fh1MCEtaAllK0s;
961 fh1MCEtaK0s = o.fh1MCEtaK0s;
962 fh1MCEtaLambda = o.fh1MCEtaLambda;
963 fh1MCEtaAntiLambda = o.fh1MCEtaAntiLambda;
969 //_______________________________________________
970 AliAnalysisTaskJetChem::~AliAnalysisTaskJetChem()
975 if(fListK0s) delete fListK0s;
976 if(fListLa) delete fListLa;
977 if(fListALa) delete fListALa;
978 if(fListFeeddownLaCand) delete fListFeeddownLaCand;
979 if(fListFeeddownALaCand) delete fListFeeddownALaCand;
980 if(jetConeFDLalist) delete jetConeFDLalist;
981 if(jetConeFDALalist) delete jetConeFDALalist;
982 if(fListMCgenK0s) delete fListMCgenK0s;
983 if(fListMCgenLa) delete fListMCgenLa;
984 if(fListMCgenALa) delete fListMCgenALa;
990 //________________________________________________________________________________________________________________________________
991 AliAnalysisTaskJetChem::AliFragFuncHistosInvMass::AliFragFuncHistosInvMass(const char* name,
992 Int_t nJetPt, Float_t jetPtMin, Float_t jetPtMax,
993 Int_t nInvMass, Float_t invMassMin, Float_t invMassMax,
994 Int_t nPt, Float_t ptMin, Float_t ptMax,
995 Int_t nXi, Float_t xiMin, Float_t xiMax,
996 Int_t nZ , Float_t zMin , Float_t zMax )
1000 ,fJetPtMax(jetPtMax)
1001 ,fNBinsInvMass(nInvMass)
1002 ,fInvMassMin(invMassMin)
1003 ,fInvMassMax(invMassMax)
1019 // default constructor
1023 //______________________________________________________________________________________________________________
1024 AliAnalysisTaskJetChem::AliFragFuncHistosInvMass::AliFragFuncHistosInvMass(const AliFragFuncHistosInvMass& copy)
1026 ,fNBinsJetPt(copy.fNBinsJetPt)
1027 ,fJetPtMin(copy.fJetPtMin)
1028 ,fJetPtMax(copy.fJetPtMax)
1029 ,fNBinsInvMass(copy.fNBinsInvMass)
1030 ,fInvMassMin(copy.fInvMassMin)
1031 ,fInvMassMax(copy.fInvMassMax)
1032 ,fNBinsPt(copy.fNBinsPt)
1033 ,fPtMin(copy.fPtMin)
1035 ,fPtMax(copy.fPtMax)
1036 ,fNBinsXi(copy.fNBinsXi)
1037 ,fXiMin(copy.fXiMin)
1038 ,fXiMax(copy.fXiMax)
1039 ,fNBinsZ(copy.fNBinsZ)
1042 ,fh3TrackPt(copy.fh3TrackPt)
1045 ,fh1JetPt(copy.fh1JetPt)
1046 ,fNameFF(copy.fNameFF)
1051 //______________________________________________________________________________________________________________________________________________________________________
1052 AliAnalysisTaskJetChem::AliFragFuncHistosInvMass& AliAnalysisTaskJetChem::AliFragFuncHistosInvMass::operator=(const AliAnalysisTaskJetChem::AliFragFuncHistosInvMass& o)
1057 TObject::operator=(o);
1058 fNBinsJetPt = o.fNBinsJetPt;
1059 fJetPtMin = o.fJetPtMin;
1060 fJetPtMax = o.fJetPtMax;
1061 fNBinsInvMass = o.fNBinsInvMass;
1062 fInvMassMin = o.fInvMassMin;
1063 fInvMassMax = o.fInvMassMax;
1064 fNBinsPt = o.fNBinsPt;
1067 fNBinsXi = o.fNBinsXi;
1070 fNBinsZ = o.fNBinsZ;
1073 fh3TrackPt = o.fh3TrackPt;
1076 fh1JetPt = o.fh1JetPt;
1077 fNameFF = o.fNameFF;
1083 //___________________________________________________________________________
1084 AliAnalysisTaskJetChem::AliFragFuncHistosInvMass::~AliFragFuncHistosInvMass()
1088 if(fh1JetPt) delete fh1JetPt;
1089 if(fh3TrackPt) delete fh3TrackPt;
1090 if(fh3Xi) delete fh3Xi;
1091 if(fh3Z) delete fh3Z;
1094 //_________________________________________________________________
1095 void AliAnalysisTaskJetChem::AliFragFuncHistosInvMass::DefineHistos()
1099 fh1JetPt = new TH1F(Form("fh1FFJetPtIM%s", fNameFF.Data()),"",fNBinsJetPt,fJetPtMin,fJetPtMax);
1100 fh3TrackPt = new TH3F(Form("fh3FFTrackPtIM%s",fNameFF.Data()),"",fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsInvMass, fInvMassMin, fInvMassMax, fNBinsPt, fPtMin, fPtMax);
1101 fh3Xi = new TH3F(Form("fh3FFXiIM%s", fNameFF.Data()),"", fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsInvMass, fInvMassMin, fInvMassMax, fNBinsXi, fXiMin, fXiMax);
1102 fh3Z = new TH3F(Form("fh3FFZIM%s", fNameFF.Data()),"", fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsInvMass, fInvMassMin, fInvMassMax, fNBinsZ, fZMin, fZMax);
1104 AliAnalysisTaskFragmentationFunction::SetProperties(fh1JetPt, "p_{t} (GeV/c)", "entries");
1105 AliAnalysisTaskJetChem::SetProperties(fh3TrackPt,"jet p_{t} (GeV/c)","inv Mass (GeV/c^2)","p_{t} (GeV/c)");
1106 AliAnalysisTaskJetChem::SetProperties(fh3Xi,"jet p_{t} (GeV/c)","inv Mass (GeV/c^2)","#xi");
1107 AliAnalysisTaskJetChem::SetProperties(fh3Z,"jet p_{t} (GeV/c)","inv Mass (GeV/c^2)","z");
1110 //________________________________________________________________________________________________________________________________
1111 void AliAnalysisTaskJetChem::AliFragFuncHistosInvMass::FillFF(Float_t trackPt, Float_t invM, Float_t jetPt, Bool_t incrementJetPt)
1115 if(incrementJetPt) fh1JetPt->Fill(jetPt);
1116 fh3TrackPt->Fill(jetPt,invM,trackPt);//Fill(x,y,z)
1119 if(jetPt>0) z = trackPt / jetPt;
1121 if(z>0) xi = TMath::Log(1/z);
1123 fh3Xi->Fill(jetPt,invM,xi);
1124 fh3Z->Fill(jetPt,invM,z);
1127 //___________________________________________________________________________________
1128 void AliAnalysisTaskJetChem::AliFragFuncHistosInvMass::AddToOutput(TList* list) const
1130 // add histos to list
1132 list->Add(fh1JetPt);
1133 list->Add(fh3TrackPt);
1141 //_______________________________________________________________________________________________________
1142 AliAnalysisTaskJetChem::AliFragFuncHistosPhiCorrInvMass::AliFragFuncHistosPhiCorrInvMass(const char* name,
1143 Int_t nPt, Float_t ptMin, Float_t ptMax,
1144 Int_t nPhi, Float_t phiMin, Float_t phiMax,
1145 Int_t nInvMass, Float_t invMassMin, Float_t invMassMax)
1153 ,fNBinsInvMass(nInvMass)
1154 ,fInvMassMin(invMassMin)
1155 ,fInvMassMax(invMassMax)
1159 // default constructor
1162 //____________________________________________________________________________________________________________________________________
1163 AliAnalysisTaskJetChem::AliFragFuncHistosPhiCorrInvMass::AliFragFuncHistosPhiCorrInvMass(const AliFragFuncHistosPhiCorrInvMass& copy)
1165 ,fNBinsPt(copy.fNBinsPt)
1166 ,fPtMin(copy.fPtMin)
1167 ,fPtMax(copy.fPtMax)
1168 ,fNBinsPhi(copy.fNBinsPhi)
1169 ,fPhiMin(copy.fPhiMin)
1170 ,fPhiMax(copy.fPhiMax)
1171 ,fNBinsInvMass(copy.fNBinsInvMass)
1172 ,fInvMassMin(copy.fInvMassMin)
1173 ,fInvMassMax(copy.fInvMassMax)
1174 ,fh3PhiCorr(copy.fh3PhiCorr)
1175 ,fNamePhiCorr(copy.fNamePhiCorr)
1180 //________________________________________________________________________________________________________________________________________________________________________
1181 AliAnalysisTaskJetChem::AliFragFuncHistosPhiCorrInvMass& AliAnalysisTaskJetChem::AliFragFuncHistosPhiCorrInvMass::operator=(const AliAnalysisTaskJetChem::AliFragFuncHistosPhiCorrInvMass& o)
1186 TObject::operator=(o);
1187 fNBinsPt = o.fNBinsPt;
1190 fNBinsPhi = o.fNBinsPhi;
1191 fPhiMin = o.fPhiMin;
1192 fPhiMax = o.fPhiMax;
1193 fNBinsInvMass = o.fNBinsInvMass;
1194 fInvMassMin = o.fInvMassMin;
1195 fInvMassMax = o.fInvMassMax;
1196 fh3PhiCorr = o.fh3PhiCorr;
1197 fNamePhiCorr = o.fNamePhiCorr;
1203 //_________________________________________________________________________________________
1204 AliAnalysisTaskJetChem::AliFragFuncHistosPhiCorrInvMass::~AliFragFuncHistosPhiCorrInvMass()
1208 if(fh3PhiCorr) delete fh3PhiCorr;
1211 //__________________________________________________________________________
1212 void AliAnalysisTaskJetChem::AliFragFuncHistosPhiCorrInvMass::DefineHistos()
1214 // book jet QA histos
1216 fh3PhiCorr = new TH3F(Form("fh3PhiCorrIM%s", fNamePhiCorr.Data()),
1217 Form("%s: p_{t} - #phi - m_{inv} distribution",fNamePhiCorr.Data()),
1218 fNBinsPt, fPtMin, fPtMax,
1219 fNBinsPhi, fPhiMin, fPhiMax,
1220 fNBinsInvMass, fInvMassMin, fInvMassMax);
1222 AliAnalysisTaskJetChem::SetProperties(fh3PhiCorr, "p_{t} (GeV/c)", "#phi", "m_{inv} (GeV/c^2)");
1225 //___________________________________________________________________________________________________________
1226 void AliAnalysisTaskJetChem::AliFragFuncHistosPhiCorrInvMass::FillPhiCorr(Float_t pt, Float_t phi, Float_t invM)
1228 // fill jet QA histos
1230 fh3PhiCorr->Fill(pt, phi, invM);
1233 //______________________________________________________________________________________________
1234 void AliAnalysisTaskJetChem::AliFragFuncHistosPhiCorrInvMass::AddToOutput(TList* list) const
1236 // add histos to list
1238 list->Add(fh3PhiCorr);
1241 //____________________________________________________
1242 void AliAnalysisTaskJetChem::UserCreateOutputObjects()
1244 // create output objects
1246 if(fDebug > 1) Printf("AliAnalysisTaskJetChem::UserCreateOutputObjects()");
1248 // create list of tracks and jets
1250 fTracksRecCuts = new TList();
1251 fTracksRecCuts->SetOwner(kFALSE); //objects in TList wont be deleted when TList is deleted
1252 fJetsRecCuts = new TList();
1253 fJetsRecCuts->SetOwner(kFALSE);
1254 fBckgJetsRec = new TList();
1255 fBckgJetsRec->SetOwner(kFALSE);
1256 fListK0s = new TList();
1257 fListK0s->SetOwner(kFALSE);
1258 fListLa = new TList();
1259 fListLa->SetOwner(kFALSE);
1260 fListALa = new TList();
1261 fListALa->SetOwner(kFALSE);
1262 fListFeeddownLaCand = new TList(); //feeddown Lambda candidates
1263 fListFeeddownLaCand->SetOwner(kFALSE);
1264 fListFeeddownALaCand = new TList(); //feeddown Antilambda candidates
1265 fListFeeddownALaCand->SetOwner(kFALSE);
1266 jetConeFDLalist = new TList();
1267 jetConeFDLalist->SetOwner(kFALSE); //feeddown Lambda candidates in jet cone
1268 jetConeFDALalist = new TList();
1269 jetConeFDALalist->SetOwner(kFALSE); //feeddown Antilambda candidates in jet cone
1270 fListMCgenK0s = new TList(); //MC generated K0s
1271 fListMCgenK0s->SetOwner(kFALSE);
1272 fListMCgenLa = new TList(); //MC generated Lambdas
1273 fListMCgenLa->SetOwner(kFALSE);
1274 fListMCgenALa = new TList(); //MC generated Antilambdas
1275 fListMCgenALa->SetOwner(kFALSE);
1278 // Create histograms / output container
1280 //for AliPIDResponse:
1281 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
1282 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
1283 fPIDResponse = inputHandler->GetPIDResponse();
1286 fCommonHistList = new TList();
1288 Bool_t oldStatus = TH1::AddDirectoryStatus();
1289 TH1::AddDirectory(kFALSE);//By default (fAddDirectory = kTRUE), histograms are automatically added to the list of objects in memory
1291 // histograms inherited from AliAnalysisTaskFragmentationFunction
1293 fh1EvtSelection = new TH1F("fh1EvtSelection", "Event Selection", 6, -0.5, 5.5);
1294 fh1EvtSelection->GetXaxis()->SetBinLabel(1,"ACCEPTED");
1295 fh1EvtSelection->GetXaxis()->SetBinLabel(2,"event trigger selection: rejected");
1296 fh1EvtSelection->GetXaxis()->SetBinLabel(3,"event class: rejected");
1297 fh1EvtSelection->GetXaxis()->SetBinLabel(4,"vertex Ncontr: rejected");
1298 fh1EvtSelection->GetXaxis()->SetBinLabel(5,"vertex z: rejected");
1299 fh1EvtSelection->GetXaxis()->SetBinLabel(6,"vertex type: rejected");
1302 fh1EvtCent = new TH1F("fh1EvtCent","centrality",100,0.,100.);
1303 fh1VertexNContributors = new TH1F("fh1VertexNContributors", "Vertex N contributors", 11,-.5, 10.5);
1304 fh1VertexZ = new TH1F("fh1VertexZ", "Vertex z distribution", 30, -15., 15.);
1305 fh1Xsec = new TProfile("fh1Xsec","xsec from pyxsec.root",1,0,1);
1306 fh1Xsec->GetXaxis()->SetBinLabel(1,"<#sigma>");
1307 fh1Trials = new TH1F("fh1Trials","trials from pyxsec.root",1,0,1);
1308 fh1Trials->GetXaxis()->SetBinLabel(1,"#sum{ntrials}");
1309 fh1PtHard = new TH1F("fh1PtHard","PYTHIA Pt hard;p_{T,hard}",350,-.5,349.5);
1310 fh1PtHardTrials = new TH1F("fh1PtHardTrials","PYTHIA Pt hard weight with trials;p_{T,hard}",350,-.5,349.5);
1311 fh1nRecJetsCuts = new TH1F("fh1nRecJetsCuts","reconstructed jets per event",100,-0.5,99.5);
1313 // histograms JetChem task
1315 fh1EvtAllCent = new TH1F("fh1EvtAllCent","before centrality selection",100,0.,100.);
1316 fh1Evt = new TH1F("fh1Evt", "All events runned over", 3, 0.,1.);
1317 fh1EvtMult = new TH1F("fh1EvtMult","multiplicity",1200,0.,12000.);
1318 fh1K0Mult = new TH1F("fh1K0Mult","K0 multiplicity",1000,0.,1000.);//500. all
1319 fh1dPhiJetK0 = new TH1F("fh1dPhiJetK0","",640,-1,5.4);
1320 fh1LaMult = new TH1F("fh1LaMult","La multiplicity",1000,0.,1000.);
1321 fh1dPhiJetLa = new TH1F("fh1dPhiJetLa","",640,-1,5.4);
1322 fh1ALaMult = new TH1F("fh1ALaMult","ALa multiplicity",1000,0.,1000.);
1323 fh1dPhiJetALa = new TH1F("fh1dPhiJetALa","",640,-1,5.4);
1324 fh1JetEta = new TH1F("fh1JetEta","#eta distribution of all jets",400,-2.,2.);
1325 fh1JetPhi = new TH1F("fh1JetPhi","#phi distribution of all jets",630,0.,6.3);
1326 fh2JetEtaPhi = new TH2F("fh2JetEtaPhi","#eta and #phi distribution of all jets",400,-2.,2.,630,0.,6.3);
1327 fh1V0JetPt = new TH1F("fh1V0JetPt","#p_{T} distribution of all jets containing v0s",200,0.,200.);
1328 fh2FFJetTrackEta = new TH2F("fh2FFJetTrackEta","charged track eta distr. in jet cone",200,-1.,1.,40,0.,200.);
1329 fh1trackPosNCls = new TH1F("fh1trackPosNCls","NTPC clusters positive daughters",250,0.,250.);
1330 fh1trackNegNCls = new TH1F("fh1trackNegNCls","NTPC clusters negative daughters",250,0.,250.);
1331 fh1trackPosEta = new TH1F("fh1trackPosEta","eta positive daughters",100,-2.,2.);
1332 fh1trackNegEta = new TH1F("fh1trackNegEta","eta negative daughters",100,-2.,2.);
1333 fh1V0Eta = new TH1F("fh1V0Eta","V0 eta",60,-1.5,1.5);
1334 fh1V0totMom = new TH1F("fh1V0totMom","V0 tot mom",240,0.,20.);
1335 fh1CosPointAngle = new TH1F("fh1CosPointAngle", "Cosine of V0's pointing angle",100,0.99,1.0);
1336 fh1Chi2Pos = new TH1F("fh1Chi2Pos", "V0s chi2",100,0.,5.);
1337 fh1Chi2Neg = new TH1F("fh1Chi2Neg", "V0s chi2",100,0.,5.);
1338 fh1DecayLengthV0 = new TH1F("fh1DecayLengthV0", "V0s decay Length;decay length(cm)",1200,0.,120.);
1339 fh2ProperLifetimeK0sVsPtBeforeCut = new TH2F("fh2ProperLifetimeK0sVsPtBeforeCut"," K0s ProperLifetime vs Pt; p_{T} (GeV/#it{c})",150,0.,15.,250,0.,250.);
1340 fh2ProperLifetimeK0sVsPtAfterCut = new TH2F("fh2ProperLifetimeK0sVsPtAfterCut"," K0s ProperLifetime vs Pt; p_{T} (GeV/#it{c})",1500,0.,15.,250,0.,250.);
1341 fh1ProperLifetimeV0BeforeCut = new TH1F("fh1ProperLifetimeV0BeforeCut", "V0s 2D distance over transerse mom.;(cm)",120,0.,120.);
1342 fh1ProperLifetimeV0AfterCut = new TH1F("fh1ProperLifetimeV0AfterCut", "V0s 2D distance over transverse mom.;(cm)",120,0.,120.);
1343 fh1V0Radius = new TH1F("fh1V0Radius", "V0s Radius;Radius(cm)",200,0.,40.);
1344 fh1DcaV0Daughters = new TH1F("fh1DcaV0Daughters", "DCA between daughters;dca(cm)",200,0.,2.);
1345 fh1DcaPosToPrimVertex = new TH1F("fh1DcaPosToPrimVertex", "Positive V0 daughter;dca(cm)",100,0.,10.);
1346 fh1DcaNegToPrimVertex = new TH1F("fh1DcaNegToPrimVertex", "Negative V0 daughter;dca(cm)",100,0.,10.);
1347 fh2ArmenterosBeforeCuts = new TH2F("fh2ArmenterosBeforeCuts","Armenteros Podolanski Plot for K0s Candidates;#alpha;(p^{arm})_{T}/(GeV/#it{c})",200,-1.2,1.2,350,0.,0.35);
1348 fh2ArmenterosAfterCuts = new TH2F("fh2ArmenterosAfterCuts","Armenteros Podolanski Plot for K0s Candidates;#alpha;(p^{arm})_{T}/(GeV/#it{c});",200,-1.2,1.2,350,0.,0.35);
1349 fh2BBLaPos = new TH2F("fh2BBLaPos","PID of the positive daughter of La candidates; P (GeV); -dE/dx (keV/cm ?)",100,0,10,200,0,200);
1350 fh2BBLaNeg = new TH2F("fh2BBLaNeg","PID of the negative daughter of La candidates; P (GeV); -dE/dx (keV/cm ?)",100,0,10,200,0,200);
1351 fh1CrossedRowsOverFindableNeg = new TH1F("fh1CrossedRowsOverFindableNeg","pos daughter crossed rows over findable in TPC;counts",20,0.,2.);
1352 fh1CrossedRowsOverFindablePos = new TH1F("fh1CrossedRowsOverFindablePos","neg daughter crossed rows over findable in TPC;counts",20,0.,2.);
1353 fh1PosDaughterCharge = new TH1F("fh1PosDaughterCharge","charge of V0 positive daughters; V0 daughters",3,-2.,2.);
1354 fh1NegDaughterCharge = new TH1F("fh1NegDaughterCharge","charge of V0 negative daughters; V0 daughters",3,-2.,2.);
1355 fh1PtMCK0s = new TH1F("fh1PtMCK0s","Pt of MC rec K0s; #it{p}_{T} (GeV/#it{c})",200,0.,20.);
1356 fh1PtMCLa = new TH1F("fh1PtMCLa","Pt of MC rec La; #it{p}_{T} (GeV/#it{c})",200,0.,20.);
1357 fh1PtMCALa = new TH1F("fh1PtMCALa","Pt of MC rec ALa; #it{p}_{T} (GeV/#it{c})",200,0.,20.);
1358 fh1EtaK0s = new TH1F("fh1EtaK0s","K^{0}_{s} entries ;#eta",200,-1.,1.);
1359 fh1EtaLa = new TH1F("fh1EtaLa","#Lambda entries ;#eta",200,-1.,1.);
1360 fh1EtaALa = new TH1F("fh1EtaALa","#bar{#Lambda} entries ;#eta",200,-1.,1.);
1361 fh3InvMassEtaTrackPtK0s = new TH3F("fh3InvMassEtaTrackPtK0s","#eta; invMass (GeV/{#it{c}}^{2}); #it{p}_{T} (GeV/#it{c})", 200, -1., 1., 240, 0.4, 0.6, 140, 0., 14.);
1362 fh3InvMassEtaTrackPtLa = new TH3F("fh3InvMassEtaTrackPtLa", "#eta; invMass (GeV/{#it{c}}^{2}; #it{p}_{T} (GeV/#it{c}))", 200, -1., 1., 140, 1.06, 1.2, 140, 0., 14.);
1363 fh3InvMassEtaTrackPtALa = new TH3F("fh3InvMassEtaTrackPtALa","#eta; invMass (GeV/#it{c}^{2}); #it{p}_{T} (GeV/#it{c})", 200, -1., 1., 140, 1.06, 1.2, 140, 0., 14.);
1364 fh3IMK0PerpCone = new TH3F("fh3IMK0PerpCone","{K_{0}}^{s} content in perpendicular cone",39,5.,200., 400,0.3,0.7, 200,0.,20.);
1365 fh3IMLaPerpCone = new TH3F("fh3IMLaPerpCone","#Lambda content in perpendicular cone",39,5.,200., 140,1.06,1.2, 200,0.,20.);
1366 fh3IMALaPerpCone = new TH3F("fh3IMALaPerpCone","#Antilambda content in perpendicular cone",39,5.,200., 140,1.06,1.2, 200,0.,20.);
1367 fh3IMK0MedianCone = new TH3F("fh3IMK0MedianCone","{K_{0}}^{s} content in median cluster cone",39,5.,200., 400,0.3,0.7, 200,0.,20.);
1368 fh3IMLaMedianCone = new TH3F("fh3IMLaMedianCone","#Lambda content in median cluster cone",39,5.,200., 140,1.06,1.2, 200,0.,20.);
1369 fh3IMALaMedianCone = new TH3F("fh3IMALaMedianCone","#Antilambda content in median cluster cone",39,5.,200., 140,1.06,1.2, 200,0.,20.);
1372 fh1TrackMultCone = new TH1F("fh1TrackMultCone","track multiplicity in jet cone; number of tracks",200,0.,1000.);
1374 fh2TrackMultCone = new TH2F("fh2TrackMultCone","track multiplicity in jet cone vs. jet momentum; number of tracks; jet it{p}_{T} (GeV/it{c})",200,0.,1000.,39,5.,200.);
1376 fFFHistosRecCuts = new AliFragFuncHistos("RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax,
1377 fFFNBinsPt, fFFPtMin, fFFPtMax,
1378 fFFNBinsXi, fFFXiMin, fFFXiMax,
1379 fFFNBinsZ , fFFZMin , fFFZMax);
1381 fV0QAK0 = new AliFragFuncQATrackHistos("V0QAK0",fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax,
1382 fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
1383 fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax,
1384 fQATrackHighPtThreshold);
1386 fFFHistosRecCutsK0Evt = new AliFragFuncHistos("RecCutsK0Evt", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax,
1387 fFFNBinsPt, fFFPtMin, fFFPtMax,
1388 fFFNBinsXi, fFFXiMin, fFFXiMax,
1389 fFFNBinsZ , fFFZMin , fFFZMax);
1392 fFFHistosIMK0AllEvt = new AliFragFuncHistosInvMass("K0AllEvt", fFFIMNBinsJetPt, fFFIMJetPtMin, fFFIMJetPtMax,
1393 fFFIMNBinsInvM,fFFIMInvMMin,fFFIMInvMMax,
1394 fFFIMNBinsPt, fFFIMPtMin, fFFIMPtMax,
1395 fFFIMNBinsXi, fFFIMXiMin, fFFIMXiMax,
1396 fFFIMNBinsZ , fFFIMZMin , fFFIMZMax);
1398 fFFHistosIMK0Jet = new AliFragFuncHistosInvMass("K0Jet", fFFIMNBinsJetPt, fFFIMJetPtMin, fFFIMJetPtMax,
1399 fFFIMNBinsInvM,fFFIMInvMMin,fFFIMInvMMax,
1400 fFFIMNBinsPt, fFFIMPtMin, fFFIMPtMax,
1401 fFFIMNBinsXi, fFFIMXiMin, fFFIMXiMax,
1402 fFFIMNBinsZ , fFFIMZMin , fFFIMZMax);
1404 fFFHistosIMK0Cone = new AliFragFuncHistosInvMass("K0Cone", fFFIMNBinsJetPt, fFFIMJetPtMin, fFFIMJetPtMax,
1405 fFFIMNBinsInvM,fFFIMInvMMin,fFFIMInvMMax,
1406 fFFIMNBinsPt, fFFIMPtMin, fFFIMPtMax,
1407 fFFIMNBinsXi, fFFIMXiMin, fFFIMXiMax,
1408 fFFIMNBinsZ , fFFIMZMin , fFFIMZMax);
1410 fFFHistosPhiCorrIMK0 = new AliFragFuncHistosPhiCorrInvMass("K0",fPhiCorrIMNBinsPt, fPhiCorrIMPtMin, fPhiCorrIMPtMax,
1411 fPhiCorrIMNBinsPhi, fPhiCorrIMPhiMin, fPhiCorrIMPhiMax,
1412 fPhiCorrIMNBinsInvM , fPhiCorrIMInvMMin , fPhiCorrIMInvMMax);
1414 fFFHistosIMLaAllEvt = new AliFragFuncHistosInvMass("LaAllEvt", fFFIMLaNBinsJetPt, fFFIMLaJetPtMin, fFFIMLaJetPtMax,
1415 fFFIMLaNBinsInvM,fFFIMLaInvMMin,fFFIMLaInvMMax,
1416 fFFIMLaNBinsPt, fFFIMLaPtMin, fFFIMLaPtMax,
1417 fFFIMLaNBinsXi, fFFIMLaXiMin, fFFIMLaXiMax,
1418 fFFIMLaNBinsZ , fFFIMLaZMin , fFFIMLaZMax);
1420 fFFHistosIMLaJet = new AliFragFuncHistosInvMass("LaJet", fFFIMLaNBinsJetPt, fFFIMLaJetPtMin, fFFIMLaJetPtMax,
1421 fFFIMLaNBinsInvM,fFFIMLaInvMMin,fFFIMLaInvMMax,
1422 fFFIMLaNBinsPt, fFFIMLaPtMin, fFFIMLaPtMax,
1423 fFFIMLaNBinsXi, fFFIMLaXiMin, fFFIMLaXiMax,
1424 fFFIMLaNBinsZ , fFFIMLaZMin , fFFIMLaZMax);
1427 fFFHistosIMLaCone = new AliFragFuncHistosInvMass("LaCone", fFFIMLaNBinsJetPt, fFFIMLaJetPtMin, fFFIMLaJetPtMax,
1428 fFFIMLaNBinsInvM,fFFIMLaInvMMin,fFFIMLaInvMMax,
1429 fFFIMLaNBinsPt, fFFIMLaPtMin, fFFIMLaPtMax,
1430 fFFIMLaNBinsXi, fFFIMLaXiMin, fFFIMLaXiMax,
1431 fFFIMLaNBinsZ , fFFIMLaZMin , fFFIMLaZMax);
1433 fFFHistosPhiCorrIMLa = new AliFragFuncHistosPhiCorrInvMass("La",fPhiCorrIMLaNBinsPt, fPhiCorrIMLaPtMin, fPhiCorrIMLaPtMax,
1434 fPhiCorrIMLaNBinsPhi, fPhiCorrIMLaPhiMin, fPhiCorrIMLaPhiMax,
1435 fPhiCorrIMLaNBinsInvM , fPhiCorrIMLaInvMMin , fPhiCorrIMLaInvMMax);
1438 fFFHistosIMALaAllEvt = new AliFragFuncHistosInvMass("ALaAllEvt", fFFIMLaNBinsJetPt, fFFIMLaJetPtMin, fFFIMLaJetPtMax,
1439 fFFIMLaNBinsInvM,fFFIMLaInvMMin,fFFIMLaInvMMax,
1440 fFFIMLaNBinsPt, fFFIMLaPtMin, fFFIMLaPtMax,
1441 fFFIMLaNBinsXi, fFFIMLaXiMin, fFFIMLaXiMax,
1442 fFFIMLaNBinsZ , fFFIMLaZMin , fFFIMLaZMax);
1444 fFFHistosIMALaJet = new AliFragFuncHistosInvMass("ALaJet", fFFIMLaNBinsJetPt, fFFIMLaJetPtMin, fFFIMLaJetPtMax,
1445 fFFIMLaNBinsInvM,fFFIMLaInvMMin,fFFIMLaInvMMax,
1446 fFFIMLaNBinsPt, fFFIMLaPtMin, fFFIMLaPtMax,
1447 fFFIMLaNBinsXi, fFFIMLaXiMin, fFFIMLaXiMax,
1448 fFFIMLaNBinsZ , fFFIMLaZMin , fFFIMLaZMax);
1450 fFFHistosIMALaCone = new AliFragFuncHistosInvMass("ALaCone", fFFIMLaNBinsJetPt, fFFIMLaJetPtMin, fFFIMLaJetPtMax,
1451 fFFIMLaNBinsInvM,fFFIMLaInvMMin,fFFIMLaInvMMax,
1452 fFFIMLaNBinsPt, fFFIMLaPtMin, fFFIMLaPtMax,
1453 fFFIMLaNBinsXi, fFFIMLaXiMin, fFFIMLaXiMax,
1454 fFFIMLaNBinsZ , fFFIMLaZMin , fFFIMLaZMax);
1456 fFFHistosPhiCorrIMALa = new AliFragFuncHistosPhiCorrInvMass("ALa",fPhiCorrIMLaNBinsPt, fPhiCorrIMLaPtMin, fPhiCorrIMLaPtMax,
1457 fPhiCorrIMLaNBinsPhi, fPhiCorrIMLaPhiMin, fPhiCorrIMLaPhiMax,
1458 fPhiCorrIMLaNBinsInvM , fPhiCorrIMLaInvMMin , fPhiCorrIMLaInvMMax);
1464 fh2MCgenK0Cone = new TH2F("fh2MCgenK0Cone", "MC gen {K^{0}}^{s} #it{p}_{T} in cone around rec jet axis versus jet #it{p}_{T}; jet #it{p}_{T}",39,5.,200.,200,0.,20.);
1465 fh2MCgenLaCone = new TH2F("fh2MCgenLaCone", "MC gen #Lambda #it{p}_{T} in cone around rec jet axis versus jet #it{p}_{T} ; jet #it{p}_{T}",39,5.,200.,200,0.,20.);
1466 fh2MCgenALaCone = new TH2F("fh2MCgenALaCone", "MC gen #Antilambda #it{p}_{T} in cone around rec jet axis versus jet #it{p}_{T}; jet #it{p}_{T}",39,5.,200.,200,0.,20.);
1468 fh2MCgenK0Cone->GetYaxis()->SetTitle("MC gen K^{0}}^{s} #it{p}_{T}");
1469 fh2MCgenLaCone->GetYaxis()->SetTitle("MC gen #Lambda #it{p}_{T}");
1470 fh2MCgenALaCone->GetYaxis()->SetTitle("MC gen #Antilambda #it{p}_{T}");
1472 fh2MCEtagenK0Cone = new TH2F("fh2MCEtagenK0Cone","MC gen {K^{0}}^{s} #it{p}_{T} #eta distribution in jet cone;#eta",39,5.,200.,200,-1.,1.);
1473 fh2MCEtagenLaCone = new TH2F("fh2MCEtagenLaCone","MC gen #Lambda #it{p}_{T} #eta distribution in jet cone;#eta",39,5.,200.,200,-1.,1.);
1474 fh2MCEtagenALaCone = new TH2F("fh2MCEtagenALaCone","MC gen #Antilambda #it{p}_{T} #eta distribution in jet cone;#eta",39,5.,200.,200,-1.,1.);
1475 fh1FFIMK0ConeSmear = new TH1F("fh1FFIMK0ConeSmear","Smeared jet pt study for K0s-in-cone-jets; smeared jet #it{p}_{T}", 39,5.,200.);
1476 fh1FFIMLaConeSmear = new TH1F("fh1FFIMLaConeSmear","Smeared jet pt study for La-in-cone-jets; smeared jet #it{p}_{T}", 39,5.,200.);
1477 fh1FFIMALaConeSmear = new TH1F("fh1FFIMALaConeSmear","Smeared jet pt study for ALa-in-cone-jets; smeared jet #it{p}_{T}", 39,5.,200.);
1479 fh3MCrecK0Cone = new TH3F("fh3MCrecK0Cone", "MC rec {K^{0}}^{s} #it{p}_{T} in cone around jet axis matching MC gen particle; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2};#it{p}_{T}",39,5.,200., 400,0.3,0.7, 200,0.,20.);
1480 fh3MCrecLaCone = new TH3F("fh3MCrecLaCone", "MC rec {#Lambda #it{p}_{T} in cone around jet axis matching MC gen particle; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2});#it{p}_{T}",39,5.,200., 140,1.05,1.25, 200,0.,20.);
1481 fh3MCrecALaCone = new TH3F("fh3MCrecALaCone", "MC rec {#Antilambda #it{p}_{T} in cone around jet axis matching MC gen particle; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2});#it{p}_{T}",39,5.,200.,140,1.05,1.25, 200,0.,20.);
1482 fh3MCrecK0ConeSmear = new TH3F("fh3MCrecK0ConeSmear", "MC rec {K^{0}}^{s} #it{p}_{T} in cone around jet axis matching MC gen particle, with jet p_{T} smeared; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2};#it{p}_{T}",39,5.,200., 400,0.3,0.7, 200,0.,20.);
1483 fh3MCrecLaConeSmear = new TH3F("fh3MCrecLaConeSmear", "MC rec {#Lambda #it{p}_{T} in cone around jet axis matching MC gen particle, with jet p_{T} smeared; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2});#it{p}_{T}",39,5.,200., 140,1.06,1.2, 200,0.,20.);
1484 fh3MCrecALaConeSmear = new TH3F("fh3MCrecALaConeSmear", "MC rec {#Antilambda #it{p}_{T} in cone around jet axis matching MC gen particle, with jet p_{T} smeared; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2});#it{p}_{T}",39,5.,200.,140,1.06,1.2, 200,0.,20.);
1485 fh3SecContinCone = new TH3F("fh3SecContinCone","secondary contamination of jet cones; jet #it{p}_{T}; track #it{p}_{T}, #eta",39,5.,200.,200,0.,20.,200,-1.,1.);
1486 fh3StrContinCone = new TH3F("fh3StrContinCone","strange particle contamination of jet cones; jet #it{p}_{T}; track #it{p}_{T}, #eta",39,5.,200.,200,0.,20.,200,-1.,1.);
1488 fh1MCMultiplicityPrimary = new TH1F("fh1MCMultiplicityPrimary", "MC Primary Particles;NPrimary;Count", 201, -0.5, 200.5);
1489 fh1MCMultiplicityTracks = new TH1F("h1MCMultiplicityTracks", "MC Tracks;Ntracks;Count", 201, -0.5, 200.5);
1490 // fh1MCmotherK0s = new TH1F("fh1MCmotherK0s","K0s mother pdg codes",10,0.,10.);
1491 fh1MCmotherLa = new TH1F("fh1MCmotherLa","Lambdas mother pdg codes",10,0.,10.);
1492 fh1MCmotherLa->GetXaxis()->SetBinLabel(1,"#Sigma^{-}");
1493 fh1MCmotherLa->GetXaxis()->SetBinLabel(2,"#Sigma^{0}");
1494 fh1MCmotherLa->GetXaxis()->SetBinLabel(3,"#Sigma^{+}");
1495 fh1MCmotherLa->GetXaxis()->SetBinLabel(4,"#Omega^{-}");
1496 fh1MCmotherLa->GetXaxis()->SetBinLabel(5,"#Xi^{0}");
1497 fh1MCmotherLa->GetXaxis()->SetBinLabel(6,"#Xi^{-}");
1498 fh1MCmotherLa->GetXaxis()->SetBinLabel(7,"#Xi^{+}");
1499 fh1MCmotherLa->GetXaxis()->SetBinLabel(8,"primary particle");
1500 fh1MCmotherALa = new TH1F("fh1MCmotherALa","Antilambdas mother pdg codes",10,0.,10.);
1501 fh1MCmotherALa->GetXaxis()->SetBinLabel(1,"#bar{#Sigma^{-}}");
1502 fh1MCmotherALa->GetXaxis()->SetBinLabel(2,"#bar{#Sigma^{0}}");
1503 fh1MCmotherALa->GetXaxis()->SetBinLabel(3,"#bar{#Sigma^{+}}");
1504 fh1MCmotherALa->GetXaxis()->SetBinLabel(4,"#bar{#Omega^{-}}");
1505 fh1MCmotherALa->GetXaxis()->SetBinLabel(5,"#bar{#Xi^{0}}");
1506 fh1MCmotherALa->GetXaxis()->SetBinLabel(6,"#Xi^{-}");
1507 fh1MCmotherALa->GetXaxis()->SetBinLabel(7,"#Xi^{+}");
1508 fh1MCmotherALa->GetXaxis()->SetBinLabel(8,"primary particle");
1509 fh3FeedDownLa = new TH3F("fh3FeedDownLa","#Lambda stemming from feeddown from Xi(0/-)", 39, 5., 200., 200, 1.05, 1.25, 200,0.,20.);
1510 fh3FeedDownALa = new TH3F("fh3FeedDownALa","#bar#Lambda stemming from feeddown from Xibar(0/+)", 39, 5., 200., 200, 1.05, 1.25, 200, 0., 20.);
1511 fh3FeedDownLaCone = new TH3F("fh3FeedDownLaCone","#Lambda stemming from feeddown from Xi(0/-) in jet cone", 39, 5., 200., 200, 1.05, 1.25, 200,0.,20.);
1512 fh3FeedDownALaCone = new TH3F("fh3FeedDownALaCone","#bar#Lambda stemming from feeddown from Xibar(0/+) in jet cone", 39, 5., 200., 200, 1.05, 1.25, 200, 0., 20.);
1513 fh1MCProdRadiusK0s = new TH1F("fh1MCProdRadiusK0s","MC gen. MC K0s prod radius",600,0.,200.);
1514 fh1MCProdRadiusLambda = new TH1F("fh1MCProdRadiusLambda","MC gen. MC La prod radius",600,0.,200.);
1515 fh1MCProdRadiusAntiLambda = new TH1F("fh1MCProdRadiusAntiLambda","MC gen. MC ALa prod radius",600,0.,200.);
1517 // Pt and inv mass distributions
1519 fh1MCPtV0s = new TH1F("fh1MCPtV0s", "MC gen. V^{0} in rap range;#it{p}_{T} (GeV/#it{c})",200,0,20.);// 0.1 GeV/c steps
1520 fh1MCPtK0s = new TH1F("fh1MCPtK0s", "MC gen. K^{0}_{s} in eta range;#it{p}_{T} (GeV/#it{c})",200,0.,20.);
1521 fh1MCPtLambda = new TH1F("fh1MCPtLambda", "MC gen. #Lambda in rap range;#it{p}_{T} (GeV/#it{c})",200,0.,20.);
1522 fh1MCPtAntiLambda = new TH1F("fh1MCPtAntiLambda", "MC gen. #AntiLambda in rap range;#it{p}_{T} (GeV/#it{c})",200,0.,20.);
1523 fh1MCXiPt = new TH1F("fh1MCXiPt", "MC gen. #Xi^{-/o};#it{p}_{T} (GeV/#it{c})",200,0.,20.);
1524 fh1MCXibarPt = new TH1F("fh1MCXibarPt", "MC gen. #bar{#Xi}^{+/o};#it{p}_{T} (GeV/#it{c})",200,0.,20.);
1525 fh2MCEtaVsPtK0s = new TH2F("fh2MCEtaVsPtK0s","MC gen. K^{0}_{s} #eta; #it{p}_{T}",200,0.,20.,200,-1.,1.);
1526 fh2MCEtaVsPtLa = new TH2F("fh2MCEtaVsPtLa","MC gen. #Lambda #eta; #it{p}_{T}",200,0.,20.,200,-1.,1.);
1527 fh2MCEtaVsPtALa = new TH2F("fh2MCEtaVsPtALa","MC gen. #bar{#Lambda} #eta; #it{p}_{T}",200,0.,20.,200,-1.,1.);
1530 fh1MCRapK0s = new TH1F("fh1MCRapK0s", "MC gen. K0s;rap with cut",200,-10,10);
1531 fh1MCRapLambda = new TH1F("fh1MCRapLambda", "MC gen. #Lambda;rap",200,-10,10);
1532 fh1MCRapAntiLambda = new TH1F("fh1MCRapAntiLambda", "MC gen. #bar{#Lambda};rap",200,-10,10);
1533 fh1MCEtaAllK0s = new TH1F("fh1MCEtaAllK0s", "MC gen. K0s;#eta",200,-1.,1.);
1534 fh1MCEtaK0s = new TH1F("fh1MCEtaK0s", "MC gen. K0s;#eta with cut",200,-1.,1.);
1535 fh1MCEtaLambda = new TH1F("fh1MCEtaLambda", "MC gen. #Lambda;#eta",200,-1.,1.);
1536 fh1MCEtaAntiLambda = new TH1F("fh1MCEtaAntiLambda", "MC gen. #bar{#Lambda};#eta",200,-1.,1.);
1538 fV0QAK0->DefineHistos();
1539 fFFHistosRecCuts->DefineHistos();
1540 fFFHistosRecCutsK0Evt->DefineHistos();
1541 fFFHistosIMK0AllEvt->DefineHistos();
1542 fFFHistosIMK0Jet->DefineHistos();
1543 fFFHistosIMK0Cone->DefineHistos();
1544 fFFHistosPhiCorrIMK0->DefineHistos();
1545 fFFHistosIMLaAllEvt->DefineHistos();
1546 fFFHistosIMLaJet->DefineHistos();
1547 fFFHistosIMLaCone->DefineHistos();
1548 fFFHistosPhiCorrIMLa->DefineHistos();
1549 fFFHistosIMALaAllEvt->DefineHistos();
1550 fFFHistosIMALaJet->DefineHistos();
1551 fFFHistosIMALaCone->DefineHistos();
1552 fFFHistosPhiCorrIMALa->DefineHistos();
1554 const Int_t saveLevel = 5;
1557 fCommonHistList->Add(fh1EvtAllCent);
1558 fCommonHistList->Add(fh1Evt);
1559 fCommonHistList->Add(fh1EvtSelection);
1560 fCommonHistList->Add(fh1EvtCent);
1561 fCommonHistList->Add(fh1VertexNContributors);
1562 fCommonHistList->Add(fh1VertexZ);
1563 fCommonHistList->Add(fh1Xsec);
1564 fCommonHistList->Add(fh1Trials);
1565 fCommonHistList->Add(fh1PtHard);
1566 fCommonHistList->Add(fh1PtHardTrials);
1567 fCommonHistList->Add(fh1nRecJetsCuts);
1568 fCommonHistList->Add(fh1EvtMult);
1569 fCommonHistList->Add(fh1K0Mult);
1570 fCommonHistList->Add(fh1dPhiJetK0);
1571 fCommonHistList->Add(fh1LaMult);
1572 fCommonHistList->Add(fh1dPhiJetLa);
1573 fCommonHistList->Add(fh1ALaMult);
1574 fCommonHistList->Add(fh1dPhiJetALa);
1575 fCommonHistList->Add(fh1JetEta);
1576 fCommonHistList->Add(fh1JetPhi);
1577 fCommonHistList->Add(fh2JetEtaPhi);
1578 fCommonHistList->Add(fh1V0JetPt);
1579 fCommonHistList->Add(fh2FFJetTrackEta);
1580 fCommonHistList->Add(fh1trackPosNCls);
1581 fCommonHistList->Add(fh1trackNegNCls);
1582 fCommonHistList->Add(fh1trackPosEta);
1583 fCommonHistList->Add(fh1trackNegEta);
1584 fCommonHistList->Add(fh1V0Eta);
1585 fCommonHistList->Add(fh1V0totMom);
1586 fCommonHistList->Add(fh1CosPointAngle);
1587 fCommonHistList->Add(fh1Chi2Pos);
1588 fCommonHistList->Add(fh1Chi2Neg);
1589 fCommonHistList->Add(fh1DecayLengthV0);
1590 fCommonHistList->Add(fh2ProperLifetimeK0sVsPtBeforeCut);
1591 fCommonHistList->Add(fh2ProperLifetimeK0sVsPtAfterCut);
1592 fCommonHistList->Add(fh1ProperLifetimeV0BeforeCut);
1593 fCommonHistList->Add(fh1ProperLifetimeV0AfterCut);
1594 fCommonHistList->Add(fh1V0Radius);
1595 fCommonHistList->Add(fh1DcaV0Daughters);
1596 fCommonHistList->Add(fh1DcaPosToPrimVertex);
1597 fCommonHistList->Add(fh1DcaNegToPrimVertex);
1598 fCommonHistList->Add(fh2ArmenterosBeforeCuts);
1599 fCommonHistList->Add(fh2ArmenterosAfterCuts);
1600 fCommonHistList->Add(fh2BBLaPos);
1601 fCommonHistList->Add(fh2BBLaNeg);
1602 fCommonHistList->Add(fh1CrossedRowsOverFindableNeg);
1603 fCommonHistList->Add(fh1CrossedRowsOverFindablePos);
1604 fCommonHistList->Add(fh1PosDaughterCharge);
1605 fCommonHistList->Add(fh1NegDaughterCharge);
1606 fCommonHistList->Add(fh1PtMCK0s);
1607 fCommonHistList->Add(fh1PtMCLa);
1608 fCommonHistList->Add(fh1PtMCALa);
1609 fCommonHistList->Add(fh1EtaK0s);
1610 fCommonHistList->Add(fh1EtaLa);
1611 fCommonHistList->Add(fh1EtaALa);
1612 fCommonHistList->Add(fh3InvMassEtaTrackPtK0s);
1613 fCommonHistList->Add(fh3InvMassEtaTrackPtLa);
1614 fCommonHistList->Add(fh3InvMassEtaTrackPtALa);
1615 fCommonHistList->Add(fh1TrackMultCone);
1616 fCommonHistList->Add(fh2TrackMultCone);
1617 fCommonHistList->Add(fh2MCgenK0Cone);
1618 fCommonHistList->Add(fh2MCgenLaCone);
1619 fCommonHistList->Add(fh2MCgenALaCone);
1620 fCommonHistList->Add(fh2MCEtagenK0Cone);
1621 fCommonHistList->Add(fh2MCEtagenLaCone);
1622 fCommonHistList->Add(fh2MCEtagenALaCone);
1623 fCommonHistList->Add(fh1FFIMK0ConeSmear);
1624 fCommonHistList->Add(fh1FFIMLaConeSmear);
1625 fCommonHistList->Add(fh1FFIMALaConeSmear);
1626 fCommonHistList->Add(fh3MCrecK0Cone);
1627 fCommonHistList->Add(fh3MCrecLaCone);
1628 fCommonHistList->Add(fh3MCrecALaCone);
1629 fCommonHistList->Add(fh3MCrecK0ConeSmear);
1630 fCommonHistList->Add(fh3MCrecLaConeSmear);
1631 fCommonHistList->Add(fh3MCrecALaConeSmear);
1632 fCommonHistList->Add(fh3SecContinCone);
1633 fCommonHistList->Add(fh3StrContinCone);
1634 fCommonHistList->Add(fh3IMK0PerpCone);
1635 fCommonHistList->Add(fh3IMLaPerpCone);
1636 fCommonHistList->Add(fh3IMALaPerpCone);
1637 fCommonHistList->Add(fh3IMK0MedianCone);
1638 fCommonHistList->Add(fh3IMLaMedianCone);
1639 fCommonHistList->Add(fh3IMALaMedianCone);
1640 fCommonHistList->Add(fh1MCMultiplicityPrimary);
1641 fCommonHistList->Add(fh1MCMultiplicityTracks);
1642 fCommonHistList->Add(fh1MCmotherLa);
1643 fCommonHistList->Add(fh1MCmotherALa);
1644 fCommonHistList->Add(fh3FeedDownLa);
1645 fCommonHistList->Add(fh3FeedDownALa);
1646 fCommonHistList->Add(fh3FeedDownLaCone);
1647 fCommonHistList->Add(fh3FeedDownALaCone);
1648 fCommonHistList->Add(fh1MCProdRadiusK0s);
1649 fCommonHistList->Add(fh1MCProdRadiusLambda);
1650 fCommonHistList->Add(fh1MCProdRadiusAntiLambda);
1651 fCommonHistList->Add(fh1MCPtV0s);
1652 fCommonHistList->Add(fh1MCPtK0s);
1653 fCommonHistList->Add(fh1MCPtLambda);
1654 fCommonHistList->Add(fh1MCPtAntiLambda);
1655 fCommonHistList->Add(fh1MCXiPt);
1656 fCommonHistList->Add(fh1MCXibarPt);
1657 fCommonHistList->Add(fh2MCEtaVsPtK0s);
1658 fCommonHistList->Add(fh2MCEtaVsPtLa);
1659 fCommonHistList->Add(fh2MCEtaVsPtALa);
1660 fCommonHistList->Add(fh1MCRapK0s);
1661 fCommonHistList->Add(fh1MCRapLambda);
1662 fCommonHistList->Add(fh1MCRapAntiLambda);
1663 fCommonHistList->Add(fh1MCEtaAllK0s);
1664 fCommonHistList->Add(fh1MCEtaK0s);
1665 fCommonHistList->Add(fh1MCEtaLambda);
1666 fCommonHistList->Add(fh1MCEtaAntiLambda);
1668 fV0QAK0->AddToOutput(fCommonHistList);
1669 fFFHistosRecCuts->AddToOutput(fCommonHistList);
1670 fFFHistosRecCutsK0Evt->AddToOutput(fCommonHistList);
1671 fFFHistosIMK0AllEvt->AddToOutput(fCommonHistList);
1672 fFFHistosIMK0Jet->AddToOutput(fCommonHistList);
1673 fFFHistosIMK0Cone->AddToOutput(fCommonHistList);
1674 fFFHistosPhiCorrIMK0->AddToOutput(fCommonHistList);
1675 fFFHistosIMLaAllEvt->AddToOutput(fCommonHistList);
1676 fFFHistosIMLaJet->AddToOutput(fCommonHistList);
1677 fFFHistosIMLaCone->AddToOutput(fCommonHistList);
1678 fFFHistosPhiCorrIMLa->AddToOutput(fCommonHistList);
1679 fFFHistosIMALaAllEvt->AddToOutput(fCommonHistList);
1680 fFFHistosIMALaJet->AddToOutput(fCommonHistList);
1681 fFFHistosIMALaCone->AddToOutput(fCommonHistList);
1682 fFFHistosPhiCorrIMALa->AddToOutput(fCommonHistList);
1687 // =========== Switch on Sumw2 for all histos ===========
1688 for (Int_t i=0; i<fCommonHistList->GetEntries(); ++i){
1690 TH1 *h1 = dynamic_cast<TH1*>(fCommonHistList->At(i));
1692 if (h1) h1->Sumw2();//The error per bin will be computed as sqrt(sum of squares of weight) for each bin
1694 THnSparse *hnSparse = dynamic_cast<THnSparse*>(fCommonHistList->At(i));
1695 if(hnSparse) hnSparse->Sumw2();
1699 TH1::AddDirectory(oldStatus);
1703 //_______________________________________________
1704 void AliAnalysisTaskJetChem::UserExec(Option_t *)
1707 // Called for each event
1709 if(fDebug > 1) Printf("AliAnalysisTaskJetChem::UserExec()");
1711 if(fDebug > 1) Printf("Analysis event #%5d", (Int_t) fEntry);
1713 // Trigger selection
1714 AliInputEventHandler* inputHandler = (AliInputEventHandler*)
1715 ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
1717 //std::cout<<"inputHandler->IsEventSelected(): "<<inputHandler->IsEventSelected()<<std::endl;
1718 //std::cout<<"fEvtSelectionMask: "<<fEvtSelectionMask<<std::endl;
1720 if(!(inputHandler->IsEventSelected() & fEvtSelectionMask)){
1721 //std::cout<<"########event rejected!!############"<<std::endl;
1722 fh1EvtSelection->Fill(1.);
1723 if (fDebug > 1 ) Printf(" Trigger Selection: event REJECTED ... ");
1724 PostData(1, fCommonHistList);
1728 fESD = dynamic_cast<AliESDEvent*>(InputEvent());//casting of pointers for inherited class, only for ESDs
1730 if(fDebug>3) Printf("%s:%d ESDEvent not found in the input", (char*)__FILE__,__LINE__);
1733 fMCEvent = MCEvent();
1735 if(fDebug>3) Printf("%s:%d MCEvent not found in the input", (char*)__FILE__,__LINE__);
1738 // get AOD event from input/output
1739 TObject* handler = AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler();
1740 if( handler && handler->InheritsFrom("AliAODInputHandler") ) {
1741 fAOD = ((AliAODInputHandler*)handler)->GetEvent();
1742 if(fUseAODInputJets) fAODJets = fAOD;
1743 if (fDebug > 1) Printf("%s:%d AOD event from input", (char*)__FILE__,__LINE__);
1746 handler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler();
1747 if( handler && handler->InheritsFrom("AliAODHandler") ) {
1748 fAOD = ((AliAODHandler*)handler)->GetAOD();
1750 if (fDebug > 1) Printf("%s:%d AOD event from output", (char*)__FILE__,__LINE__);
1754 if(!fAODJets && !fUseAODInputJets){ // case we have AOD in input & output and want jets from output
1755 TObject* outHandler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler();
1756 if( outHandler && outHandler->InheritsFrom("AliAODHandler") ){
1757 fAODJets = ((AliAODHandler*)outHandler)->GetAOD();
1758 if (fDebug > 1) Printf("%s:%d jets from output AOD", (char*)__FILE__,__LINE__);
1762 if(fNonStdFile.Length()!=0){
1763 // case we have an AOD extension - fetch the jets from the extended output
1765 AliAODHandler *aodH = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
1766 fAODExtension = (aodH?aodH->GetExtension(fNonStdFile.Data()):0);
1768 if(fDebug>1)Printf("AODExtension not found for %s",fNonStdFile.Data());
1773 Printf("%s:%d AODEvent not found", (char*)__FILE__,__LINE__);
1777 Printf("%s:%d AODEvent with jet branch not found", (char*)__FILE__,__LINE__);
1781 //primary vertex position:
1782 AliAODVertex *myPrimaryVertex = NULL;
1783 myPrimaryVertex = (AliAODVertex*)fAOD->GetPrimaryVertex();
1784 if (!myPrimaryVertex) return;
1785 fh1Evt->Fill(1.);//fill in every event that was accessed with InputHandler
1787 // event selection *****************************************
1789 // *** vertex cut ***
1790 AliAODVertex* primVtx = fAOD->GetPrimaryVertex();
1791 Int_t nTracksPrim = primVtx->GetNContributors();
1792 fh1VertexNContributors->Fill(nTracksPrim);
1794 if (fDebug > 1) Printf("%s:%d primary vertex selection: %d", (char*)__FILE__,__LINE__,nTracksPrim);
1796 if(nTracksPrim <= 2){
1797 if (fDebug > 1) Printf("%s:%d primary vertex selection: event REJECTED...",(char*)__FILE__,__LINE__);
1798 fh1EvtSelection->Fill(3.);
1799 PostData(1, fCommonHistList);
1803 fh1VertexZ->Fill(primVtx->GetZ());
1805 if(TMath::Abs(primVtx->GetZ())>fMaxVertexZ){
1806 if (fDebug > 1) Printf("%s:%d primary vertex z = %f: event REJECTED...",(char*)__FILE__,__LINE__,primVtx->GetZ());
1807 fh1EvtSelection->Fill(4.);
1808 PostData(1, fCommonHistList);
1812 // accepts only events that have same "primary" and SPD vertex, special issue of LHC11h PbPb data
1814 //fAOD: pointer to global primary vertex
1816 const AliAODVertex* spdVtx = fAOD->GetPrimaryVertexSPD();
1818 if (TMath::Abs(spdVtx->GetZ() - primVtx->GetZ())>fDeltaVertexZ) { if (fDebug > 1) Printf("deltaZVertex: event REJECTED..."); return;}
1821 //check for vertex radius to be smaller than 1 cm, (that was first applied by Vit Kucera in his analysis)
1823 Double_t vtxX = primVtx->GetX();
1824 Double_t vtxY = primVtx->GetY();
1826 if(TMath::Sqrt(vtxX*vtxX + vtxY*vtxY)>=1){
1827 if (fDebug > 1) Printf("%s:%d primary vertex r = %f: event REJECTED...",(char*)__FILE__,__LINE__,TMath::Sqrt(vtxX*vtxX + vtxY*vtxY));
1832 TString primVtxName(primVtx->GetName());
1834 if(primVtxName.CompareTo("TPCVertex",TString::kIgnoreCase) == 1){
1835 if (fDebug > 1) Printf("%s:%d primary vertex selection: TPC vertex, event REJECTED...",(char*)__FILE__,__LINE__);
1836 fh1EvtSelection->Fill(5.);
1837 PostData(1, fCommonHistList);
1841 Bool_t selectedHelper = AliAnalysisHelperJetTasks::Selected();
1842 if(!selectedHelper){
1843 fh1EvtSelection->Fill(6.);
1844 PostData(1, fCommonHistList);
1848 // event selection *****************************************
1850 Double_t centPercent = -1;
1854 if(handler && handler->InheritsFrom("AliAODInputHandler")){
1856 centPercent = fAOD->GetHeader()->GetCentrality();
1858 //std::cout<<"centPercent: "<<centPercent<<std::endl;
1860 fh1EvtAllCent->Fill(centPercent);
1862 if(centPercent>10) cl = 2; //standard PWG-JE binning
1863 if(centPercent>30) cl = 3;
1864 if(centPercent>50) cl = 4;
1868 if(centPercent < 0) cl = -1;
1869 if(centPercent >= 0) cl = 1;
1870 if(centPercent > 10) cl = 2; //standard PWG-JE binning
1871 if(centPercent > 30) cl = 3;
1872 if(centPercent > 50) cl = 4;
1873 if(centPercent > 80) cl = 5; //takes centralities higher than my upper edge of 80%, not to be used
1878 cl = AliAnalysisHelperJetTasks::EventClass();
1880 if(fESD) centPercent = fESD->GetCentrality()->GetCentralityPercentile("V0M"); //ESD JetServices Task has the centrality binning 0-10,10-30,30-50,50-80
1881 fh1EvtAllCent->Fill(centPercent);
1884 if(cl!=fEventClass){ // event not in selected event class, reject event#########################################
1886 if (fDebug > 1) Printf("%s:%d event not in selected event class: event REJECTED ...",(char*)__FILE__,__LINE__);
1887 fh1EvtSelection->Fill(2.);
1888 PostData(1, fCommonHistList);
1891 }//end if fEventClass > 0
1894 if (fDebug > 1) Printf("%s:%d event ACCEPTED ...",(char*)__FILE__,__LINE__);
1897 //Printf("Analysis event #%5d", (Int_t) fEntry);
1899 fh1EvtSelection->Fill(0.);
1900 fh1EvtCent->Fill(centPercent);
1902 //___ get MC information __________________________________________________________________
1905 Double_t ptHard = 0.; //parton energy bins -> energy of particle
1906 Double_t nTrials = 1; // trials for MC trigger weight for real data
1909 AliGenEventHeader* genHeader = fMCEvent->GenEventHeader();
1910 AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);//check usage of Pythia (pp) or Hijing (PbPb)
1911 AliGenHijingEventHeader* hijingGenHeader = 0x0;
1913 if(pythiaGenHeader){
1914 if(fDebug>3) Printf("%s:%d pythiaGenHeader found", (char*)__FILE__,__LINE__);
1915 nTrials = pythiaGenHeader->Trials();
1916 ptHard = pythiaGenHeader->GetPtHard();
1918 fh1PtHard->Fill(ptHard);
1919 fh1PtHardTrials->Fill(ptHard,nTrials);
1922 } else { // no pythia, hijing?
1924 if(fDebug>3) Printf("%s:%d no pythiaGenHeader found", (char*)__FILE__,__LINE__);
1926 hijingGenHeader = dynamic_cast<AliGenHijingEventHeader*>(genHeader);
1927 if(!hijingGenHeader){
1928 if(fDebug>3) Printf("%s:%d no pythiaGenHeader or hjingGenHeader found", (char*)__FILE__,__LINE__);
1930 if(fDebug>3) Printf("%s:%d hijingGenHeader found", (char*)__FILE__,__LINE__);
1934 fh1Trials->Fill("#sum{ntrials}",fAvgTrials);
1937 //____ fetch jets _______________________________________________________________
1939 Int_t nJCuts = GetListOfJets(fJetsRecCuts, kJetsRecAcceptance);//fetch list with jets
1941 Int_t nRecJetsCuts = 0; //number of reconstructed jets after jet cuts
1942 if(nJCuts>=0) nRecJetsCuts = fJetsRecCuts->GetEntries();
1943 if(fDebug>2)Printf("%s:%d Selected Rec jets after cuts: %d %d",(char*)__FILE__,__LINE__,nJCuts,nRecJetsCuts);
1944 if(nRecJetsCuts != nJCuts) Printf("%s:%d Mismatch selected Rec jets after cuts: %d %d",(char*)__FILE__,__LINE__,nJCuts,nRecJetsCuts);
1945 fh1nRecJetsCuts->Fill(nRecJetsCuts);
1948 //____ fetch background clusters ___________________________________________________
1949 if(fBranchRecBckgClusters.Length() != 0){
1951 Int_t nBJ = GetListOfBckgJets(fBckgJetsRec, kJetsRec);
1952 Int_t nRecBckgJets = 0;
1953 if(nBJ>=0) nRecBckgJets = fBckgJetsRec->GetEntries();
1954 if(fDebug>2)Printf("%s:%d Selected Rec background jets: %d %d",(char*)__FILE__,__LINE__,nBJ,nRecBckgJets);
1955 if(nBJ != nRecBckgJets) Printf("%s:%d Mismatch Selected Rec background jets: %d %d",(char*)__FILE__,__LINE__,nBJ,nRecBckgJets);
1959 //____ fetch reconstructed particles __________________________________________________________
1961 Int_t nTCuts = GetListOfTracks(fTracksRecCuts, kTrackAODCuts);//all tracks of event
1962 if(fDebug>2)Printf("%s:%d selected reconstructed tracks after cuts: %d %d",(char*)__FILE__,__LINE__,nTCuts,fTracksRecCuts->GetEntries());
1963 if(fTracksRecCuts->GetEntries() != nTCuts)
1964 Printf("%s:%d Mismatch selected reconstructed tracks after cuts: %d %d",(char*)__FILE__,__LINE__,nTCuts,fTracksRecCuts->GetEntries());
1965 fh1EvtMult->Fill(fTracksRecCuts->GetEntries());
1967 Int_t nK0s = GetListOfV0s(fListK0s,fK0Type,kK0,myPrimaryVertex,fAOD);//all V0s in event with K0s assumption
1969 if(fDebug>5){std::cout<<"fK0Type: "<<fK0Type<<" kK0: "<<kK0<<" myPrimaryVertex: "<<myPrimaryVertex<<" fAOD: "<<fAOD<<std::endl;}
1971 //std::cout<< "nK0s: "<<nK0s<<std::endl;
1973 if(fDebug>2)Printf("%s:%d Selected V0s after cuts: %d %d",(char*)__FILE__,__LINE__,nK0s,fListK0s->GetEntries());
1974 if(nK0s != fListK0s->GetEntries()) Printf("%s:%d Mismatch selected K0s: %d %d",(char*)__FILE__,__LINE__,nK0s,fListK0s->GetEntries());
1975 fh1K0Mult->Fill(fListK0s->GetEntries());
1978 Int_t nLa = GetListOfV0s(fListLa,fLaType,kLambda,myPrimaryVertex,fAOD);//all V0s in event with Lambda particle assumption
1979 if(fDebug>2)Printf("%s:%d Selected Rec tracks after cuts: %d %d",(char*)__FILE__,__LINE__,nLa,fListLa->GetEntries());
1980 if(nLa != fListLa->GetEntries()) Printf("%s:%d Mismatch selected La: %d %d",(char*)__FILE__,__LINE__,nLa,fListLa->GetEntries());
1981 fh1LaMult->Fill(fListLa->GetEntries());
1983 Int_t nALa = GetListOfV0s(fListALa,fALaType,kAntiLambda,myPrimaryVertex,fAOD);//all V0s in event with Antilambda particle assumption
1984 if(fDebug>2)Printf("%s:%d Selected Rec tracks after cuts: %d %d",(char*)__FILE__,__LINE__,nALa,fListALa->GetEntries());
1985 if(nALa != fListALa->GetEntries()) Printf("%s:%d Mismatch selected ALa: %d %d",(char*)__FILE__,__LINE__,nALa,fListALa->GetEntries());
1986 fh1ALaMult->Fill(fListALa->GetEntries());
1990 //fetch MC gen particles_______________________________________________________
1992 if(fAnalysisMC){ // here
1994 //fill feeddown histo for associated particles
1996 // Access MC generated particles, fill TLists and histograms :
1998 Int_t nMCgenK0s = GetListOfMCParticles(fListMCgenK0s,kK0,fAOD); //fill TList with MC generated primary true K0s (list to fill, particletype, mc aod event)
1999 if(nMCgenK0s != fListMCgenK0s->GetEntries()) Printf("%s:%d Mismatch selected MCgenK0s: %d %d",(char*)__FILE__,__LINE__,nMCgenK0s,fListMCgenK0s->GetEntries());
2002 for(Int_t it=0; it<fListMCgenK0s->GetSize(); ++it){ // loop MC generated K0s, filling histograms
2004 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenK0s->At(it));
2009 Double_t fRapCurrentPart = MyRapidity(mcp0->E(),mcp0->Pz());
2010 Double_t fEtaCurrentPart = mcp0->Eta();
2011 Double_t fPtCurrentPart = mcp0->Pt();
2013 fh1MCEtaK0s->Fill(fEtaCurrentPart);
2014 fh1MCRapK0s->Fill(fRapCurrentPart);
2015 fh1MCPtK0s->Fill(fPtCurrentPart);
2017 fh2MCEtaVsPtK0s->Fill(fPtCurrentPart,fEtaCurrentPart); //eta cut, physical primary selection and decay mode considered
2022 Int_t nMCgenLa = GetListOfMCParticles(fListMCgenLa,kLambda,fAOD); //fill TList with MC generated primary true Lambdas (list to fill, particletype, mc aod event)
2023 if(nMCgenLa != fListMCgenLa->GetEntries()) Printf("%s:%d Mismatch selected MCgenLa: %d %d",(char*)__FILE__,__LINE__,nMCgenLa,fListMCgenLa->GetEntries());
2026 for(Int_t it=0; it<fListMCgenLa->GetSize(); ++it){ // loop MC generated La, filling histograms
2028 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenLa->At(it));
2033 Double_t fRapCurrentPart = MyRapidity(mcp0->E(),mcp0->Pz());
2034 Double_t fEtaCurrentPart = mcp0->Eta();
2035 Double_t fPtCurrentPart = mcp0->Pt();
2037 fh1MCEtaLambda->Fill(fEtaCurrentPart);
2038 fh1MCRapLambda->Fill(fRapCurrentPart);
2039 fh1MCPtLambda->Fill(fPtCurrentPart);
2040 fh2MCEtaVsPtLa->Fill(fPtCurrentPart,fEtaCurrentPart); //eta cut, physical primary selection and decay mode considered
2045 Int_t nMCgenALa = GetListOfMCParticles(fListMCgenALa,kAntiLambda,fAOD); //fill TList with MC generated primary true Antilambdas (list to fill, particletype, mc aod event)
2046 if(nMCgenALa != fListMCgenALa->GetEntries()) Printf("%s:%d Mismatch selected MCgenALa: %d %d",(char*)__FILE__,__LINE__,nMCgenALa,fListMCgenALa->GetEntries());
2049 for(Int_t it=0; it<fListMCgenALa->GetSize(); ++it){ // loop MC generated ALa, filling histograms
2051 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenALa->At(it));
2054 //MC gen Antilambdas
2056 Double_t fRapCurrentPart = MyRapidity(mcp0->E(),mcp0->Pz());
2057 Double_t fEtaCurrentPart = mcp0->Eta();
2058 Double_t fPtCurrentPart = mcp0->Pt();
2060 fh1MCEtaAntiLambda->Fill(fEtaCurrentPart);
2061 fh1MCRapAntiLambda->Fill(fRapCurrentPart);
2062 fh1MCPtAntiLambda->Fill(fPtCurrentPart);
2063 fh2MCEtaVsPtALa->Fill(fPtCurrentPart,fEtaCurrentPart); //eta cut, physical primary selection and decay mode considered
2069 //loop over MC feeddown candidates in TList
2074 } //end MCAnalysis part for gen particles
2077 // ___ V0 QA + K0s + La + ALa pt spectra all events _______________________________________________
2079 Double_t lPrimaryVtxPosition[3];
2080 Double_t lV0Position[3];
2081 lPrimaryVtxPosition[0] = primVtx->GetX();
2082 lPrimaryVtxPosition[1] = primVtx->GetY();
2083 lPrimaryVtxPosition[2] = primVtx->GetZ();
2085 //------------------------------------------
2087 for(Int_t it=0; it<fListK0s->GetSize(); ++it){ // loop all K0s
2089 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListK0s->At(it));
2092 // VO's main characteristics to check the reconstruction cuts
2094 Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
2097 Double_t fV0Radius = -999;
2098 Double_t fDcaV0Daughters = v0->DcaV0Daughters();
2099 Double_t fDcaPosToPrimVertex = v0->DcaPosToPrimVertex();//IP of positive charged daughter
2100 Double_t fDcaNegToPrimVertex = v0->DcaNegToPrimVertex();//IP of negative charged daughter
2101 Int_t negDaughterpdg = 0;
2102 Int_t posDaughterpdg = 0;
2103 Int_t motherType = 0;
2106 Bool_t fPhysicalPrimary = kFALSE;//don't use IsPhysicalPrimary() anymore for MC analysis, use instead 2D distance from primary to secondary vertex
2107 Int_t MCv0PdgCode = 0;
2109 AliAODTrack *trackPos = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(0));
2110 AliAODTrack *trackNeg = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(1));
2112 Double_t PosEta = trackPos->AliAODTrack::Eta();//daughter track charge is sometimes wrong here, account for that!!!
2113 Double_t NegEta = trackNeg->AliAODTrack::Eta();
2115 //Double_t trackPosNcls = trackPos->GetTPCNcls();//Get number of clusters for positive charged tracks
2116 //Double_t trackNegNcls = trackNeg->GetTPCNcls();//Get number of clusters for negative charged tracks
2118 CalculateInvMass(v0, kK0, invMK0s, trackPt); //function to calculate invMass with TLorentzVector class
2120 Double_t jetPt = fFFIMJetPtMin; // assign pro forma jet energy
2121 //Double_t fRap = v0->RapK0Short();
2122 Double_t fEta = v0->PseudoRapV0();
2124 Double_t fV0cosPointAngle = v0->CosPointingAngle(lPrimaryVtxPosition);
2126 lV0Position[0]= v0->DecayVertexV0X();
2127 lV0Position[1]= v0->DecayVertexV0Y();
2128 lV0Position[2]= v0->DecayVertexV0Z();
2132 fV0mom[0]=v0->MomV0X();
2133 fV0mom[1]=v0->MomV0Y();
2134 fV0mom[2]=v0->MomV0Z();
2135 Double_t fV0TotalMomentum = TMath::Sqrt(fV0mom[0]*fV0mom[0]+fV0mom[1]*fV0mom[1]+fV0mom[2]*fV0mom[2]);
2136 Double_t fV0DecayLength = v0->DecayLengthV0(lPrimaryVtxPosition);
2137 fV0Radius = TMath::Sqrt(lV0Position[0]*lV0Position[0]+lV0Position[1]*lV0Position[1]);
2139 fV0QAK0->FillTrackQA(v0->Eta(), TVector2::Phi_0_2pi(v0->Phi()), v0->Pt());
2140 fFFHistosIMK0AllEvt->FillFF(trackPt, invMK0s, jetPt, incrementJetPt);
2141 //fh1trackPosNCls->Fill(trackPosNcls);
2142 //fh1trackNegNCls->Fill(trackNegNcls);
2143 fh1EtaK0s->Fill(fEta);
2145 TList *listmc = fAOD->GetList();
2146 Bool_t mclabelcheck = MCLabelCheck(v0, kK0, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode);
2147 //if(fPhysicalPrimary == kFALSE)continue;
2148 //std::cout<<"mclabelcheck: "<<mclabelcheck<<std::endl;
2149 //std::cout<<"IsPhysicalPrimary: "<<fPhysicalPrimary<<std::endl;
2151 if(mclabelcheck == kFALSE)continue;
2152 fh3InvMassEtaTrackPtK0s->Fill(fEta,invMK0s,trackPt);//includes also feeddown particles
2153 fh1PtMCK0s->Fill(MCPt);
2157 fh1V0Eta->Fill(fEta);
2158 fh1V0totMom->Fill(fV0TotalMomentum);
2159 fh1CosPointAngle->Fill(fV0cosPointAngle);
2160 fh1DecayLengthV0->Fill(fV0DecayLength);
2161 fh1V0Radius->Fill(fV0Radius);
2162 fh1DcaV0Daughters->Fill(fDcaV0Daughters);
2163 fh1DcaPosToPrimVertex->Fill(fDcaPosToPrimVertex);
2164 fh1DcaNegToPrimVertex->Fill(fDcaNegToPrimVertex);
2165 fh1trackPosEta->Fill(PosEta);
2166 fh1trackNegEta->Fill(NegEta);
2170 // __La pt spectra all events _______________________________________________
2173 for(Int_t it=0; it<fListLa->GetSize(); ++it){ // loop all La
2175 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListLa->At(it));
2178 // VO's main characteristics to check the reconstruction cuts
2179 Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
2182 Double_t fV0Radius = -999;
2183 Double_t fDcaV0Daughters = v0->DcaV0Daughters();
2184 Double_t fDcaPosToPrimVertex = v0->DcaPosToPrimVertex();//IP of positive charged daughter
2185 Double_t fDcaNegToPrimVertex = v0->DcaNegToPrimVertex();//IP of negative charged daughter
2186 Int_t negDaughterpdg = 0;
2187 Int_t posDaughterpdg = 0;
2188 Int_t motherType = 0;
2191 Bool_t fPhysicalPrimary = kFALSE;
2192 Int_t MCv0PdgCode = 0;
2193 AliAODTrack *trackPos = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(0));
2194 AliAODTrack *trackNeg = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(1));
2196 //Double_t trackPosNcls = trackPos->GetTPCNcls();//Get number of clusters for positive charged tracks
2197 //Double_t trackNegNcls = trackNeg->GetTPCNcls();//Get number of clusters for negative charged tracks
2199 Double_t PosEta = trackPos->AliAODTrack::Eta();//daughter track charge is sometimes wrong here, account for that!!!
2200 Double_t NegEta = trackNeg->AliAODTrack::Eta();
2202 CalculateInvMass(v0, kLambda, invMLa, trackPt);//function to calculate invMass with TLorentzVector class
2205 Double_t jetPt = fFFIMJetPtMin; // assign pro forma jet energy
2206 // Double_t fRap = v0->Y(3122);
2207 Double_t fEta = v0->PseudoRapV0();
2211 fV0mom[0]=v0->MomV0X();
2212 fV0mom[1]=v0->MomV0Y();
2213 fV0mom[2]=v0->MomV0Z();
2214 Double_t fV0TotalMomentum = TMath::Sqrt(fV0mom[0]*fV0mom[0]+fV0mom[1]*fV0mom[1]+fV0mom[2]*fV0mom[2]);
2215 Double_t fV0DecayLength = v0->DecayLengthV0(lPrimaryVtxPosition);
2216 Double_t fV0cosPointAngle = v0->CosPointingAngle(lPrimaryVtxPosition);
2217 lV0Position[0]= v0->DecayVertexV0X();
2218 lV0Position[1]= v0->DecayVertexV0Y();
2219 lV0Position[2]= v0->DecayVertexV0Z();
2221 fV0Radius = TMath::Sqrt(lV0Position[0]*lV0Position[0]+lV0Position[1]*lV0Position[1]);
2223 fFFHistosIMLaAllEvt->FillFF(trackPt, invMLa, jetPt, incrementJetPt);
2224 //fh1trackPosNCls->Fill(trackPosNcls);
2225 //fh1trackNegNCls->Fill(trackNegNcls);
2226 fh1EtaLa->Fill(fEta);
2228 TList* listmc = fAOD->GetList();
2229 Bool_t mclabelcheck = MCLabelCheck(v0, kLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode);
2230 if(mclabelcheck == kFALSE)continue;
2231 //if(fPhysicalPrimary == kFALSE)continue;
2232 fh3InvMassEtaTrackPtLa->Fill(fEta,invMLa,trackPt);
2233 fh1PtMCLa->Fill(MCPt);
2235 fh1V0Eta->Fill(fEta);
2236 fh1V0totMom->Fill(fV0TotalMomentum);
2237 fh1CosPointAngle->Fill(fV0cosPointAngle);
2238 fh1DecayLengthV0->Fill(fV0DecayLength);
2239 fh1V0Radius->Fill(fV0Radius);
2240 fh1DcaV0Daughters->Fill(fDcaV0Daughters);
2241 fh1DcaPosToPrimVertex->Fill(fDcaPosToPrimVertex);
2242 fh1DcaNegToPrimVertex->Fill(fDcaNegToPrimVertex);
2243 fh1trackPosEta->Fill(PosEta);
2244 fh1trackNegEta->Fill(NegEta);
2247 // __ALa pt spectra all events _______________________________________________
2249 for(Int_t it=0; it<fListALa->GetSize(); ++it){ // loop all ALa
2251 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListALa->At(it));
2255 //VO's main characteristics to check the reconstruction cuts
2256 Double_t invMALa =0;
2258 Double_t fV0Radius = -999;
2259 Double_t fDcaV0Daughters = v0->DcaV0Daughters();
2260 Double_t fDcaPosToPrimVertex = v0->DcaPosToPrimVertex();//IP of positive charged daughter
2261 Double_t fDcaNegToPrimVertex = v0->DcaNegToPrimVertex();//IP of negative charged daughter
2262 Int_t negDaughterpdg = 0;
2263 Int_t posDaughterpdg = 0;
2264 Int_t motherType = 0;
2267 Bool_t fPhysicalPrimary = kFALSE;
2268 Int_t MCv0PdgCode = 0;
2270 AliAODTrack *trackPos = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(0));
2271 AliAODTrack *trackNeg = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(1));
2273 Double_t PosEta = trackPos->AliAODTrack::Eta();//daughter track charge is sometimes wrong here, account for that!!!
2274 Double_t NegEta = trackNeg->AliAODTrack::Eta();
2276 //Double_t trackPosNcls = trackPos->GetTPCNcls();//Get number of clusters for positive charged tracks //not used anymore by Strangeness PAG group
2277 //Double_t trackNegNcls = trackNeg->GetTPCNcls();//Get number of clusters for negative charged tracks
2279 CalculateInvMass(v0, kAntiLambda, invMALa, trackPt); //function to calculate invMass with TLorentzVector class
2281 Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
2282 Double_t jetPt = fFFIMJetPtMin; // assign pro forma jet energy
2283 // Double_t fRap = v0->Y(-3122);
2284 Double_t fEta = v0->PseudoRapV0();
2288 fV0mom[0]=v0->MomV0X();
2289 fV0mom[1]=v0->MomV0Y();
2290 fV0mom[2]=v0->MomV0Z();
2291 Double_t fV0TotalMomentum = TMath::Sqrt(fV0mom[0]*fV0mom[0]+fV0mom[1]*fV0mom[1]+fV0mom[2]*fV0mom[2]);
2293 Double_t fV0cosPointAngle = v0->CosPointingAngle(lPrimaryVtxPosition);
2294 lV0Position[0]= v0->DecayVertexV0X();
2295 lV0Position[1]= v0->DecayVertexV0Y();
2296 lV0Position[2]= v0->DecayVertexV0Z();
2297 Double_t fV0DecayLength = v0->DecayLengthV0(lPrimaryVtxPosition);
2298 fV0Radius = TMath::Sqrt(lV0Position[0]*lV0Position[0]+lV0Position[1]*lV0Position[1]);
2300 fFFHistosIMALaAllEvt->FillFF(trackPt, invMALa, jetPt, incrementJetPt);
2301 //fh1trackPosNCls->Fill(trackPosNcls);
2302 //fh1trackNegNCls->Fill(trackNegNcls);
2303 fh1EtaALa->Fill(fEta);
2305 TList* listmc = fAOD->GetList();
2306 Bool_t mclabelcheck = MCLabelCheck(v0, kAntiLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode);
2307 if(mclabelcheck == kFALSE)continue;
2308 //if(fPhysicalPrimary == kFALSE)continue;
2309 fh3InvMassEtaTrackPtALa->Fill(fEta,invMALa,trackPt);
2310 fh1PtMCALa->Fill(MCPt);
2312 fh1V0Eta->Fill(fEta);
2313 fh1V0totMom->Fill(fV0TotalMomentum);
2314 fh1CosPointAngle->Fill(fV0cosPointAngle);
2315 fh1DecayLengthV0->Fill(fV0DecayLength);
2316 fh1V0Radius->Fill(fV0Radius);
2317 fh1DcaV0Daughters->Fill(fDcaV0Daughters);
2318 fh1DcaPosToPrimVertex->Fill(fDcaPosToPrimVertex);
2319 fh1DcaNegToPrimVertex->Fill(fDcaNegToPrimVertex);
2320 fh1trackPosEta->Fill(PosEta);
2321 fh1trackNegEta->Fill(NegEta);
2324 //_____no jets events______________________________________________________________________________________________________________________________________
2326 if(nRecJetsCuts == 0){
2328 // std::cout<<"################## found event without any jet!!!!!###################"<<std::endl;
2335 //____ fill all jet related histos ________________________________________________________________________________________________________________________
2336 //##########################jet loop########################################################################################################################
2338 //fill jet histos in general
2339 for(Int_t ij=0; ij<nRecJetsCuts; ++ij){ // ij is an index running over the list of the reconstructed jets after cuts, all jets in event
2341 AliAODJet* jet = (AliAODJet*) (fJetsRecCuts->At(ij));
2343 Double_t jetPt = jet->Pt();
2344 Double_t jetEta = jet->Eta();
2345 Double_t jetPhi = jet->Phi();
2347 //if(ij==0){ // loop over leading jets for ij = 0, for ij>= 0 look into all jets
2349 if(ij>=0){//all jets in event
2351 TList* jettracklist = new TList();
2352 Double_t sumPt = 0.;
2353 Bool_t isBadJet = kFALSE;
2354 Int_t njetTracks = 0;
2356 if(GetFFRadius()<=0){
2357 GetJetTracksTrackrefs(jettracklist, jet, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet);// list of jet tracks from trackrefs
2359 GetJetTracksPointing(fTracksRecCuts, jettracklist, jet, GetFFRadius(), sumPt, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet); // fill list of tracks in cone around jet axis with cone Radius (= 0.4 standard)
2362 if(GetFFMinNTracks()>0 && jettracklist->GetSize() <= GetFFMinNTracks()) isBadJet = kTRUE; // reject jets with less tracks than fFFMinNTracks
2363 if(isBadJet) continue; // rejects jets in which no track has a track pt higher than 5 GeV/c (see AddTask macro)
2366 Float_t fJetAreaMin = 0.6*TMath::Pi()*GetFFRadius()*GetFFRadius(); // minimum jet area cut
2368 //std::cout<<"GetFFRadius(): "<<GetFFRadius()<<std::endl;
2369 //std::cout<<"jet->EffectiveAreaCharged()"<<jet->EffectiveAreaCharged()<<std::endl;
2370 //std::cout<<"fJetAreaMin: "<<fJetAreaMin<<std::endl;
2372 if (jet->EffectiveAreaCharged() < fJetAreaMin)continue;// cut on jet area
2375 fh1JetEta->Fill(jetEta);
2376 fh1JetPhi->Fill(jetPhi);
2377 fh2JetEtaPhi->Fill(jetEta,jetPhi);
2379 // printf("pT = %f, eta = %f, phi = %f, leadtr pt = %f\n, ",jetPt,jetEta,jetphi,leadtrack);
2381 for(Int_t it=0; it<jettracklist->GetSize(); ++it){//loop over all particles in jet
2383 AliVParticle* trackVP = dynamic_cast<AliVParticle*>(jettracklist->At(it));//all tracks in jet cone
2384 if(!trackVP)continue;
2386 Float_t trackPt = trackVP->Pt();//transversal momentum of jet particle
2387 Float_t trackEta = trackVP->Eta();
2389 Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
2391 fFFHistosRecCuts->FillFF(trackPt, jetPt, incrementJetPt);
2392 if(nK0s>0) fFFHistosRecCutsK0Evt->FillFF(trackPt, jetPt, incrementJetPt);
2393 fh2FFJetTrackEta->Fill(trackEta,jetPt);
2398 njetTracks = jettracklist->GetSize();
2400 //____________________________________________________________________________________________________________________
2401 //alternative method to estimate secondary constribution in jet cone (second method you can see below in rec. K0s loop & rec. Lambdas loop & rec. Antilambdas loop)
2405 TList *list = fAOD->GetList();
2406 AliAODMCHeader *mcHeadr=(AliAODMCHeader*)list->FindObject(AliAODMCHeader::StdBranchName());
2407 if(!mcHeadr)continue;
2409 Double_t mcXv=0., mcYv=0., mcZv=0.;//MC primary vertex position
2411 mcXv=mcHeadr->GetVtxX(); mcYv=mcHeadr->GetVtxY(); mcZv=mcHeadr->GetVtxZ(); // position of the MC primary vertex
2413 for(Int_t it=0; it<jettracklist->GetSize(); ++it){//loop over all tracks in the jet
2415 AliVParticle* trackVP = dynamic_cast<AliVParticle*>(jettracklist->At(it));//track in jet cone
2416 if(!trackVP)continue;
2417 AliAODTrack *tr = dynamic_cast<AliAODTrack*> (trackVP); //fetch one jet track from the TList
2420 //get MC label information
2421 TList *mclist = fAOD->GetList();
2423 //fetch the MC stack
2424 TClonesArray* stackMC = (TClonesArray*)mclist->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
2425 if (!stackMC) {Printf("ERROR: stack not available");}
2429 Int_t trackLabel = TMath::Abs(tr->GetLabel()); //fetch jet track label in MC stack
2431 AliAODMCParticle *part = dynamic_cast<AliAODMCParticle*>(stackMC->At(trackLabel)); //fetch MC gen. particle for rec. jet track
2433 if(!part)continue; //skip non-existing objects
2436 //Bool_t IsPhysicalPrimary = part->IsPhysicalPrimary();//not recommended to check, better use distance between primary vertex and secondary vertex
2438 Float_t fDistPrimaryMax = 0.01;
2439 // Get the distance between production point of the MC mother particle and the primary vertex
2441 Double_t dx = mcXv-part->Xv();//mc primary vertex - mc gen. v0 vertex
2442 Double_t dy = mcYv-part->Yv();
2443 Double_t dz = mcZv-part->Zv();
2445 Float_t fDistPrimary = TMath::Sqrt(dx*dx + dy*dy + dz*dz);
2446 Bool_t fPhysicalPrimary = (fDistPrimary < fDistPrimaryMax);
2448 // std::cout<<"fDistPrimary"<<fDistPrimary<<std::endl;
2449 // std::cout<<"fPhysicalPrimary"<<fPhysicalPrimary<<std::endl;
2451 if(!fPhysicalPrimary)continue;//rejects Kstar and other strong decaying particles from Secondary Contamination
2453 Bool_t isFromStrange = kFALSE;// flag to check whether particle has strange mother
2455 Int_t iMother = part->GetMother(); //get mother MC gen. particle label
2458 AliAODMCParticle *partM = dynamic_cast<AliAODMCParticle*>(stackMC->At(iMother)); //fetch mother of MC gen. particle
2459 if(!partM) continue;
2461 Int_t codeM = TMath::Abs(partM->GetPdgCode()); //mothers pdg code
2463 Int_t mfl = Int_t (codeM/ TMath::Power(10, Int_t(TMath::Log10(codeM)))); //asks for first number of mothers pdg code (strange particles always start with 3..)
2465 if (mfl == 3 && codeM != 3) isFromStrange = kTRUE;
2468 //cut on primary particles:
2473 if(isFromStrange == kTRUE){
2475 Double_t trackPt = part->Pt();
2476 Double_t trackEta = part->Eta();
2477 fh3StrContinCone->Fill(jetPt, trackPt, trackEta);//MC gen. particle parameters, but rec. jet pt
2479 }//isFromStrange is kTRUE
2481 }//end loop over jet tracks
2486 fh1TrackMultCone->Fill(njetTracks);
2487 fh2TrackMultCone->Fill(njetTracks,jetPt);
2491 // fQAJetHistosRecCutsLeading->FillJetQA( jet->Eta(), TVector2::Phi_0_2pi(jet->Phi()), jet->Pt() );
2493 for(Int_t it=0; it<fListK0s->GetSize(); ++it){ // loop all K0s
2495 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListK0s->At(it));
2496 if(!v0) continue;//rejection of events with no V0 vertex
2500 TVector3 v0MomVect(v0Mom);
2502 Double_t dPhiJetK0 = (jet->MomentumVector()->Vect()).DeltaPhi(v0MomVect);
2503 Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
2505 if(incrementJetPt){fh1V0JetPt->Fill(jetPt);}
2507 Double_t invMK0s =0;
2509 CalculateInvMass(v0, kK0, invMK0s, trackPt); //function to calculate invMass with TLorentzVector class
2511 fFFHistosIMK0Jet->FillFF(trackPt, invMK0s, jetPt, incrementJetPt);
2512 fFFHistosPhiCorrIMK0->FillPhiCorr(trackPt,TVector2::Phi_0_2pi(dPhiJetK0),invMK0s); //filled for MC with all particles, no association checks (pdg code, proper decay mode etc..) or matching to MC truth
2514 if(dPhiJetK0<fh1dPhiJetK0->GetXaxis()->GetXmin()) dPhiJetK0 += 2*TMath::Pi();
2515 fh1dPhiJetK0->Fill(dPhiJetK0);
2519 if(fListK0s->GetSize() == 0){ // no K0: increment jet pt spectrum
2521 Bool_t incrementJetPt = kTRUE;
2522 fFFHistosIMK0Jet->FillFF(-1, -1, jetPt, incrementJetPt);
2525 //____fetch reconstructed K0s in cone around jet axis:_______________________________________________________________________________
2527 TList* jetConeK0list = new TList();
2529 Double_t sumPtK0 = 0.;
2531 Bool_t isBadJetK0 = kFALSE; // dummy, do not use
2534 GetTracksInCone(fListK0s, jetConeK0list, jet, GetFFRadius(), sumPtK0, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetK0); //reconstructed K0s in cone around jet axis
2536 if(fDebug>2)Printf("%s:%d nK0s total: %d, in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nK0s,jetConeK0list->GetEntries(),GetFFRadius());
2539 for(Int_t it=0; it<jetConeK0list->GetSize(); ++it){ // loop for K0s in jet cone
2541 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetConeK0list->At(it));
2544 Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
2545 Double_t invMK0s =0;
2548 CalculateInvMass(v0, kK0, invMK0s, trackPt); //function to calculate invMass with TLorentzVector class
2551 Double_t jetPtSmear = -1;
2552 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
2553 if(incrementJetPt == kTRUE){fh1FFIMK0ConeSmear->Fill(jetPtSmear);} //fill TH1F for normalization purposes
2556 fFFHistosIMK0Cone->FillFF(trackPt, invMK0s, jetPt, incrementJetPt);
2560 if(jetConeK0list->GetSize() == 0){ // no K0: increment jet pt spectrum
2562 Bool_t incrementJetPt = kTRUE;
2563 fFFHistosIMK0Cone->FillFF(-1, -1, jetPt, incrementJetPt);
2565 Double_t jetPtSmear = -1;
2566 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
2567 if(incrementJetPt == kTRUE){fh1FFIMK0ConeSmear->Fill(jetPtSmear);} //fill TH1F for normalization purposes
2571 //fetch particles in perpendicular cone to estimate UE event contribution to particle spectrum
2572 //these perpendicular cone particle spectra serve to subtract the particles in jet cones, that are stemming from the Underlying event, on a statistical basis
2573 //for normalization the common jet pT spectrum is used: fh1FFIMK0Cone, fh1FFIMLaCone and fh1FFIMALaCone
2575 //____fetch reconstructed K0s in cone perpendicular to jet axis:_______________________________________________________________________________
2577 TList* jetPerpConeK0list = new TList();
2579 Double_t sumPerpPtK0 = 0.;
2581 GetTracksInPerpCone(fListK0s, jetPerpConeK0list, jet, GetFFRadius(), sumPerpPtK0); //reconstructed K0s in cone around jet axis
2583 if(fDebug>2)Printf("%s:%d nK0s total: %d, in perp jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nK0s,jetPerpConeK0list->GetEntries(),GetFFRadius());
2585 for(Int_t it=0; it<jetPerpConeK0list->GetSize(); ++it){ // loop for K0s in perpendicular cone
2587 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetPerpConeK0list->At(it));
2590 Double_t invMPerpK0s =0;
2593 CalculateInvMass(v0, kK0, invMPerpK0s, trackPt); //function to calculate invMass with TLorentzVector class
2595 fh3IMK0PerpCone->Fill(jetPt, invMPerpK0s, trackPt); //(x,y,z) //pay attention, this histogram contains the V0 content of both (+/- 90 degrees) perp. cones!!
2599 if(jetPerpConeK0list->GetSize() == 0){ // no K0s in jet cone
2601 //Bool_t incrementPerpJetPt = kTRUE;
2602 fh3IMK0PerpCone->Fill(jetPt, -1, -1);
2605 // ____ rec K0s in median cluster___________________________________________________________________________________________________________
2607 TList* jetMedianConeK0list = new TList();
2609 AliAODJet* medianCluster = GetMedianCluster();
2611 Double_t sumMedianPtK0 = 0.;
2613 Bool_t isBadJetK0Median = kFALSE; // dummy, do not use
2615 GetTracksInCone(fListK0s, jetMedianConeK0list, medianCluster, GetFFRadius(), sumMedianPtK0, 0., 0., isBadJetK0Median); //reconstructed K0s in median cone around jet axis
2616 //GetTracksInCone(fListK0s, jetConeK0list, jet, GetFFRadius(), sumPtK0, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetK0); //original use of function
2618 //cut parameters from Fragmentation Function task:
2619 //Float_t fFFMinLTrackPt; // reject jets with leading track with pt smaller than this value, use GetFFMinLTrackPt()
2620 //Float_t fFFMaxTrackPt; // reject jetscontaining any track with pt larger than this value, use GetFFMaxTrackPt()
2622 for(Int_t it=0; it<jetMedianConeK0list->GetSize(); ++it){ // loop for K0s in median cone
2624 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetMedianConeK0list->At(it));
2627 Double_t invMMedianK0s =0;
2630 CalculateInvMass(v0, kK0, invMMedianK0s, trackPt); //function to calculate invMass with TLorentzVector class
2632 fh3IMK0MedianCone->Fill(jetPt, invMMedianK0s, trackPt); //(x,y,z)
2635 if(jetMedianConeK0list->GetSize() == 0){ // no K0s in median cluster cone
2637 fh3IMK0MedianCone->Fill(jetPt, -1, -1);
2640 //_________________________________________________________________________________________________________________________________________
2642 //____fetch reconstructed Lambdas in cone perpendicular to jet axis:__________________________________________________________________________
2644 TList* jetPerpConeLalist = new TList();
2646 Double_t sumPerpPtLa = 0.;
2648 GetTracksInPerpCone(fListLa, jetPerpConeLalist, jet, GetFFRadius(), sumPerpPtLa); //reconstructed Lambdas in cone around jet axis //pay attention, this histogram contains the V0 content of both (+/- 90 degrees) perp. cones!!
2650 if(fDebug>2)Printf("%s:%d nLa total: %d, in perp jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nLa,jetPerpConeLalist->GetEntries(),GetFFRadius());
2652 for(Int_t it=0; it<jetPerpConeLalist->GetSize(); ++it){ // loop for Lambdas in perpendicular cone
2654 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetPerpConeLalist->At(it));
2657 Double_t invMPerpLa =0;
2660 CalculateInvMass(v0, kLambda, invMPerpLa, trackPt); //function to calculate invMass with TLorentzVector class
2662 fh3IMLaPerpCone->Fill(jetPt, invMPerpLa, trackPt);
2666 if(jetPerpConeLalist->GetSize() == 0){ // no Lambdas in jet
2668 fh3IMLaPerpCone->Fill(jetPt, -1, -1);
2672 //__________________________________________________________________________________________________________________________________________
2673 // ____ rec Lambdas in median cluster___________________________________________________________________________________________________________
2675 TList* jetMedianConeLalist = new TList();
2677 //AliAODJet* medianCluster = GetMedianCluster(); //already loaded at part for K0s ??
2679 Double_t sumMedianPtLa = 0.;
2680 Bool_t isBadJetLaMedian = kFALSE; // dummy, do not use
2682 GetTracksInCone(fListLa, jetMedianConeLalist, medianCluster, GetFFRadius(), sumMedianPtLa, 0, 0, isBadJetLaMedian); //reconstructed Lambdas in median cone around jet axis
2684 //cut parameters from Fragmentation Function task:
2685 //Float_t fFFMinLTrackPt; // reject jets with leading track with pt smaller than this value, use GetFFMinLTrackPt()
2686 //Float_t fFFMaxTrackPt; // reject jets containing any track with pt larger than this value, use GetFFMaxTrackPt()
2688 for(Int_t it=0; it<jetMedianConeLalist->GetSize(); ++it){ // loop for Lambdas in perpendicular cone
2690 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetMedianConeLalist->At(it));
2693 Double_t invMMedianLa =0;
2696 CalculateInvMass(v0, kLambda, invMMedianLa, trackPt); //function to calculate invMass with TLorentzVector class
2698 fh3IMLaMedianCone->Fill(jetPt, invMMedianLa, trackPt); //(x,y,z)
2701 if(jetMedianConeLalist->GetSize() == 0){ // no Lambdas in median cluster cone
2703 fh3IMLaMedianCone->Fill(jetPt, -1, -1);
2706 //_________________________________________________________________________________________________________________________________________
2709 //____fetch reconstructed Antilambdas in cone perpendicular to jet axis:___________________________________________________________________
2711 TList* jetPerpConeALalist = new TList();
2713 Double_t sumPerpPtALa = 0.;
2715 GetTracksInPerpCone(fListALa, jetPerpConeALalist, jet, GetFFRadius(), sumPerpPtALa); //reconstructed Antilambdas in cone around jet axis //pay attention, this histogram contains the V0 content of both (+/- 90 degrees) perp. cones!!
2717 if(fDebug>2)Printf("%s:%d nALa total: %d, in perp jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nALa,jetPerpConeALalist->GetEntries(),GetFFRadius());
2719 for(Int_t it=0; it<jetPerpConeALalist->GetSize(); ++it){ // loop for ALa in perpendicular cone
2721 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetPerpConeALalist->At(it));
2724 Double_t invMPerpALa =0;
2727 CalculateInvMass(v0, kAntiLambda, invMPerpALa, trackPt); //function to calculate invMass with TLorentzVector class
2729 fh3IMALaPerpCone->Fill(jetPt, invMPerpALa, trackPt);
2734 if(jetPerpConeALalist->GetSize() == 0){ // no Antilambda
2736 fh3IMALaPerpCone->Fill(jetPt, -1, -1);
2741 // ____ rec Antilambdas in median cluster___________________________________________________________________________________________________________
2743 TList* jetMedianConeALalist = new TList();
2745 //AliAODJet* medianCluster = GetMedianCluster(); //already loaded at part for K0s
2747 Double_t sumMedianPtALa = 0.;
2749 Bool_t isBadJetALaMedian = kFALSE; // dummy, do not use
2751 GetTracksInCone(fListALa, jetMedianConeALalist, medianCluster, GetFFRadius(), sumMedianPtALa, 0, 0, isBadJetALaMedian); //reconstructed Antilambdas in median cone around jet axis
2754 //cut parameters from Fragmentation Function task:
2755 //Float_t fFFMinLTrackPt; // reject jets with leading track with pt smaller than this value, use GetFFMinLTrackPt()
2756 //Float_t fFFMaxTrackPt; // reject jets containing any track with pt larger than this value, use GetFFMaxTrackPt()
2758 for(Int_t it=0; it<jetMedianConeALalist->GetSize(); ++it){ // loop for Antilambdas in median cluster cone
2760 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetMedianConeALalist->At(it));
2763 Double_t invMMedianALa =0;
2766 CalculateInvMass(v0, kAntiLambda, invMMedianALa, trackPt); //function to calculate invMass with TLorentzVector class
2768 fh3IMALaMedianCone->Fill(jetPt, invMMedianALa, trackPt); //(x,y,z)
2771 if(jetMedianConeALalist->GetSize() == 0){ // no Antilambdas in median cluster cone
2773 fh3IMALaMedianCone->Fill(jetPt, -1, -1);
2776 //_________________________________________________________________________________________________________________________________________
2781 //__________________________________________________________________________________________________________________________________________
2785 //fill feeddown candidates from TList
2786 //std::cout<<"fListFeeddownLaCand entries: "<<fListFeeddownLaCand->GetSize()<<std::endl;
2788 Double_t sumPtFDLa = 0.;
2789 Bool_t isBadJetFDLa = kFALSE; // dummy, do not use
2791 GetTracksInCone(fListFeeddownLaCand, jetConeFDLalist, jet, GetFFRadius(), sumPtFDLa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetFDLa);
2793 Double_t sumPtFDALa = 0.;
2794 Bool_t isBadJetFDALa = kFALSE; // dummy, do not use
2796 GetTracksInCone(fListFeeddownALaCand, jetConeFDALalist, jet, GetFFRadius(), sumPtFDALa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetFDALa);
2798 //_________________________________________________________________
2799 for(Int_t it=0; it<fListFeeddownLaCand->GetSize(); ++it){
2801 AliAODv0* mcfd = dynamic_cast<AliAODv0*>(fListFeeddownLaCand->At(it));
2804 Double_t invMLaFDcand = 0;
2805 Double_t trackPt = 0;//pt of ass. particle, not used for the histos
2807 CalculateInvMass(mcfd, kLambda, invMLaFDcand, trackPt);
2809 //Get MC gen. Lambda transverse momentum
2810 TClonesArray *st = 0x0;
2813 TList *lt = fAOD->GetList();
2816 st = (TClonesArray*)lt->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
2819 AliAODTrack *daughtertrack = (AliAODTrack *) (mcfd->GetSecondaryVtx()->GetDaughter(0));//fetch the first of the two daughter tracks
2820 Int_t AssLabel = TMath::Abs(daughtertrack->GetLabel());
2822 AliAODMCParticle *mcDaughterPart =(AliAODMCParticle*)st->UncheckedAt(AssLabel);
2824 Int_t v0lab = mcDaughterPart->GetMother();
2826 // Int_t v0lab= TMath::Abs(mcfd->GetLabel());//GetLabel doesn't work for AliAODv0 class!!! Only for AliAODtrack
2828 if((!v0lab) || (v0lab<0) || (v0lab > st->GetEntriesFast()))continue;//validity checks
2830 AliAODMCParticle *mcp=(AliAODMCParticle*)st->UncheckedAt(v0lab);
2832 Double_t genLaPt = mcp->Pt();
2834 //std::cout<<"Incl FD, genLaPt:"<<genLaPt<<std::endl;
2836 fh3FeedDownLa->Fill(5., invMLaFDcand, genLaPt);
2838 }//end loop over feeddown candidates for Lambda particles in jet cone
2839 //fetch MC truth in jet cones, denominator of rec. efficiency in jet cones
2840 //_________________________________________________________________
2841 for(Int_t it=0; it<jetConeFDLalist->GetSize(); ++it){
2843 AliAODv0* mcfd = dynamic_cast<AliAODv0*>(jetConeFDLalist->At(it));
2846 //std::cout<<"Cone, recLaPt:"<<mcfd->Pt()<<std::endl;
2848 Double_t invMLaFDcand = 0;
2849 Double_t trackPt = mcfd->Pt();//pt of ass. particle, not used for the histos
2851 CalculateInvMass(mcfd, kLambda, invMLaFDcand, trackPt);
2853 //Get MC gen. Lambda transverse momentum
2854 TClonesArray *st = 0x0;
2856 TList *lt = fAOD->GetList();
2859 st = (TClonesArray*)lt->FindObject(AliAODMCParticle::StdBranchName());
2861 AliAODTrack *daughtertrack = (AliAODTrack *) (mcfd->GetSecondaryVtx()->GetDaughter(0));//fetch the first of the two daughter tracks
2862 Int_t AssLabel = TMath::Abs(daughtertrack->GetLabel());
2864 AliAODMCParticle *mcDaughterPart =(AliAODMCParticle*)st->UncheckedAt(AssLabel);
2866 Int_t v0lab = mcDaughterPart->GetMother();
2868 //std::cout<<"v0lab: "<<v0lab<<std::endl;
2870 if((!v0lab) || (v0lab<0) || (v0lab > st->GetEntriesFast()))continue;//validity checks
2872 AliAODMCParticle *mcp=(AliAODMCParticle*)st->UncheckedAt(v0lab);
2874 Double_t genLaPt = mcp->Pt();
2877 //std::cout<<"Cone FD, genLaPt:"<<genLaPt<<std::endl;
2879 fh3FeedDownLaCone->Fill(jetPt, invMLaFDcand, genLaPt);
2881 }//end loop over feeddown candidates for Lambda particles in jet cone
2883 //_________________________________________________________________
2884 for(Int_t it=0; it<fListFeeddownALaCand->GetSize(); ++it){
2886 AliAODv0* mcfd = dynamic_cast<AliAODv0*>(fListFeeddownALaCand->At(it));
2889 Double_t invMALaFDcand = 0;
2890 Double_t trackPt = 0;//pt of ass. particle, not used for the histos
2892 CalculateInvMass(mcfd, kAntiLambda, invMALaFDcand, trackPt);
2894 //Get MC gen. Antilambda transverse momentum
2895 TClonesArray *st = 0x0;
2897 TList *lt = fAOD->GetList();
2900 st = (TClonesArray*)lt->FindObject(AliAODMCParticle::StdBranchName());
2902 AliAODTrack *daughtertrack = (AliAODTrack *) (mcfd->GetSecondaryVtx()->GetDaughter(0));//fetch the first of the two daughter tracks
2903 Int_t AssLabel = TMath::Abs(daughtertrack->GetLabel());
2905 AliAODMCParticle *mcDaughterPart =(AliAODMCParticle*)st->UncheckedAt(AssLabel);
2907 Int_t v0lab = mcDaughterPart->GetMother();
2910 if((!v0lab) || (v0lab<0) || (v0lab > st->GetEntriesFast()))continue;//validity checks
2912 AliAODMCParticle *mcp=(AliAODMCParticle*)st->UncheckedAt(v0lab);
2914 Double_t genALaPt = mcp->Pt();
2916 fh3FeedDownALa->Fill(5., invMALaFDcand, genALaPt);
2918 }//end loop over feeddown candidates for Antilambda particles
2920 //_________________________________________________________________
2921 //feeddown for Antilambdas from Xi(bar)+ and Xi(bar)0 in jet cone:
2923 for(Int_t it=0; it<jetConeFDALalist->GetSize(); ++it){
2925 AliAODv0* mcfd = dynamic_cast<AliAODv0*>(jetConeFDALalist->At(it));
2928 Double_t invMALaFDcand = 0;
2929 Double_t trackPt = 0;//pt of ass. particle, not used for the histos
2931 CalculateInvMass(mcfd, kAntiLambda, invMALaFDcand, trackPt);
2933 //Get MC gen. Antilambda transverse momentum
2934 TClonesArray *st = 0x0;
2936 TList *lt = fAOD->GetList();
2939 st = (TClonesArray*)lt->FindObject(AliAODMCParticle::StdBranchName());
2941 AliAODTrack *daughtertrack = (AliAODTrack *) (mcfd->GetSecondaryVtx()->GetDaughter(0));//fetch the first of the two daughter tracks
2942 Int_t AssLabel = TMath::Abs(daughtertrack->GetLabel());
2944 AliAODMCParticle *mcDaughterPart =(AliAODMCParticle*)st->UncheckedAt(AssLabel);
2946 Int_t v0lab = mcDaughterPart->GetMother();
2948 if((!v0lab) || (v0lab<0) || (v0lab > st->GetEntriesFast()))continue;//validity checks
2950 AliAODMCParticle *mcp=(AliAODMCParticle*)st->UncheckedAt(v0lab);
2952 Double_t genALaPt = mcp->Pt();
2954 fh3FeedDownALaCone->Fill(jetPt, invMALaFDcand, genALaPt);
2956 }//end loop over feeddown candidates for Antilambda particles in jet cone
2960 //____fetch MC generated K0s in cone around jet axis__(note: particles can stem from fragmentation but also from underlying event)________
2962 Double_t sumPtMCgenK0s = 0.;
2963 Bool_t isBadJetMCgenK0s = kFALSE; // dummy, do not use
2966 fListMCgenK0sCone = new TList(); //MC generated K0s in (only geometrical) jet cone (these are MC gen K0s falling geometrically into jet cone (R = 0.4) around jet axis, that was found by anti-kt jet finder, particles can stem from fragmentation but also from underlying event!!)
2968 //first: sampling MC gen K0s
2970 GetTracksInCone(fListMCgenK0s, fListMCgenK0sCone, jet, GetFFRadius(), sumPtMCgenK0s, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetMCgenK0s); //MC generated K0s in cone around jet axis
2972 if(fDebug>2)Printf("%s:%d nMCgenK0s in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,fListMCgenK0sCone->GetEntries(),GetFFRadius());
2975 for(Int_t it=0; it<fListMCgenK0sCone->GetSize(); ++it){ // loop MC generated K0s in cone around jet axis
2977 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenK0sCone->At(it));
2980 //Double_t fRapMCgenK0s = MyRapidity(mcp0->E(),mcp0->Pz());//get rec. particle in cone information
2981 Double_t fEtaMCgenK0s = mcp0->Eta();
2982 Double_t fPtMCgenK0s = mcp0->Pt();
2984 fh2MCgenK0Cone->Fill(jetPt,fPtMCgenK0s);
2985 fh2MCEtagenK0Cone->Fill(jetPt,fEtaMCgenK0s);
2989 //check whether the reconstructed K0s in jet cone are stemming from MC gen K0s (on MCgenK0s list):__________________________________________________
2991 for(Int_t ic=0; ic<jetConeK0list->GetSize(); ++ic){ //loop over all reconstructed K0s in jet cone
2993 //for(Int_t ic=0; ic<fListK0s->GetSize(); ++ic){ //loop over all reconstructed K0s -> previous definition of reconstruction efficiency, not sure what is the better one to choose
2995 Int_t negDaughterpdg;
2996 Int_t posDaughterpdg;
2999 Double_t fPtMCrecK0Match;
3000 Double_t invMK0Match;
3004 Bool_t fPhysicalPrimary = -1;
3005 Int_t MCv0PDGCode =0;
3006 Double_t jetPtSmear = -1;
3008 AliAODv0* v0c = dynamic_cast<AliAODv0*>(jetConeK0list->At(ic));//pointer to reconstructed K0s inside jet cone (cone is placed around reconstructed jet axis)
3010 //AliAODv0* v0c = dynamic_cast<AliAODv0*>(fListK0s->At(ic));//pointer to reconstructed K0s
3013 Bool_t daughtercheck = DaughterTrackCheck(v0c, nnum, pnum);//check daughter tracks have proper sign
3014 if(daughtercheck == kFALSE)continue;
3016 const AliAODTrack *trackMCNeg=(AliAODTrack *)(v0c->GetDaughter(nnum));
3017 const AliAODTrack *trackMCPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
3019 TList *listmc = fAOD->GetList();
3021 Bool_t mclabelcheck = MCLabelCheck(v0c, kK0, trackMCNeg, trackMCPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PDGCode);
3023 if(mclabelcheck == kFALSE)continue;
3024 if(fPhysicalPrimary == kFALSE)continue; //requirements for rec. V0 associated to MC true primary particle
3026 for(Int_t it=0; it<fListMCgenK0s->GetSize(); ++it){ // loop over MC generated K0s in event, check whether associated MC particle is part of it
3028 //for(Int_t it=0; it<fListMCgenK0sCone->GetSize(); ++it){//belongs to previous definition of rec. eff. of V0s within jet cone
3030 //Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
3031 //AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenK0sCone->At(it));
3032 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenK0s->At(it));
3035 Bool_t particleMatching = IsParticleMatching(mcp0, v0Label);
3037 if(particleMatching == kFALSE)continue; //if reconstructed V0 particle doesn't match to the associated MC particle go to next stack entry
3038 CalculateInvMass(v0c, kK0, invMK0Match, fPtMCrecK0Match);
3040 Double_t fPtMCgenK0s = mcp0->Pt();
3042 fh3MCrecK0Cone->Fill(jetPt,invMK0Match,fPtMCgenK0s); //fill matching rec. K0s in 3D histogram
3044 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear); //jetPt, cent, jetRadius, ptmintrack, &jetPtSmear
3046 fh3MCrecK0ConeSmear->Fill(jetPtSmear,invMK0Match,fPtMCgenK0s); //fill matching rec. K0s in 3D histogram, jet pT smeared according to deltaptjet distribution width
3049 } // end MCgenK0s / MCgenK0sCone loop
3052 //check the K0s daughters contamination of the jet tracks:
3054 TClonesArray *stackMC = 0x0;
3056 for(Int_t it=0; it<jettracklist->GetSize(); ++it){//loop over all particles in the jet
3058 AliVParticle* trackVP = dynamic_cast<AliVParticle*>(jettracklist->At(it));//all tracks in jet cone
3059 if(!trackVP)continue;
3060 AliAODTrack *tr = dynamic_cast<AliAODTrack*> (trackVP); //fetch one jet track from the TList
3063 //get MC label information
3064 TList *mclist = fAOD->GetList(); //fetch the MC stack
3065 if(!mclist)continue;
3067 stackMC = (TClonesArray*)mclist->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
3068 if (!stackMC) {Printf("ERROR: stack not available");}
3071 Int_t particleLabel = TMath::Abs(tr->GetLabel()); //fetch jet track label in MC stack
3073 //v0c is pointer to K0s candidate, is fetched already above, here it is just checked again whether daughters are properly ordered by their charge
3075 Bool_t daughterchecks = DaughterTrackCheck(v0c, nnum, pnum);
3077 if(daughterchecks == kFALSE)continue; //make sure that daughters are properly ordered
3079 const AliAODTrack *trackNeg=(AliAODTrack *)(v0c->GetDaughter(nnum)); //fetch v0 daughters of reconstructed K0s
3080 const AliAODTrack *trackPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
3082 if(!trackNeg)continue;
3083 if(!trackPos)continue;
3085 Int_t negAssLabel = TMath::Abs(trackNeg->GetLabel()); //negative (reconstructed) charged track label in MC stack
3086 Int_t posAssLabel = TMath::Abs(trackPos->GetLabel()); //positive (reconstructed) charged track label in MC stack
3089 if(particleLabel == posAssLabel){ //check whether jet track and each of the rec. K0s daughters have same MC stack label -> are identical
3090 AliAODMCParticle* mctrackPos = dynamic_cast<AliAODMCParticle*>(stackMC->At(posAssLabel));
3091 if(!mctrackPos) continue;
3092 Double_t trackPosPt = mctrackPos->Pt();
3093 Double_t trackPosEta = mctrackPos->Eta();
3094 fh3SecContinCone->Fill(jetPt, trackPosPt, trackPosEta);} //if it's the case, fill jet pt, daughter track pt and track eta in histo
3096 if(particleLabel == negAssLabel){
3097 AliAODMCParticle* mctrackNeg = dynamic_cast<AliAODMCParticle*>(stackMC->At(negAssLabel));
3098 if(!mctrackNeg) continue;
3099 Double_t trackNegPt = mctrackNeg->Pt();
3100 Double_t trackNegEta = mctrackNeg->Eta();
3101 fh3SecContinCone->Fill(jetPt, trackNegPt, trackNegEta);} //if it's the case, fill jet pt, daughter track pt and track eta in histo
3109 } //end rec-K0-in-cone loop
3111 //________________________________________________________________________________________________________________________________________________________
3115 delete fListMCgenK0sCone;
3120 delete jetConeK0list;
3121 delete jetPerpConeK0list;
3122 delete jetPerpConeLalist;
3123 delete jetPerpConeALalist;
3124 delete jetMedianConeK0list;
3125 delete jetMedianConeLalist;
3126 delete jetMedianConeALalist;
3128 //---------------La--------------------------------------------------------------------------------------------------------------------------------------------
3130 // fQAJetHistosRecCutsLeading->FillJetQA( jet->Eta(), TVector2::Phi_0_2pi(jet->Phi()), jet->Pt() );
3132 for(Int_t it=0; it<fListLa->GetSize(); ++it){ // loop all La
3134 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListLa->At(it));
3139 TVector3 v0MomVect(v0Mom);
3141 Double_t dPhiJetLa = (jet->MomentumVector()->Vect()).DeltaPhi(v0MomVect);
3146 CalculateInvMass(v0, kLambda, invMLa, trackPt); //function to calculate invMass with TLorentzVector class
3147 Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
3149 //if(incrementJetPt){fh1V0JetPt->Fill(jetPt);}
3151 fFFHistosIMLaJet->FillFF(trackPt, invMLa, jetPt, incrementJetPt);
3152 fFFHistosPhiCorrIMLa->FillPhiCorr(trackPt,TVector2::Phi_0_2pi(dPhiJetLa),invMLa);
3154 if(dPhiJetLa<fh1dPhiJetLa->GetXaxis()->GetXmin()) dPhiJetLa += 2*TMath::Pi();
3155 fh1dPhiJetLa->Fill(dPhiJetLa);
3158 if(fListLa->GetSize() == 0){ // no La: increment jet pt spectrum
3160 Bool_t incrementJetPt = kTRUE;
3161 fFFHistosIMLaJet->FillFF(-1, -1, jetPt, incrementJetPt);
3165 // ____fetch rec. Lambdas in cone around jet axis_______________________________________________________________________________________
3167 TList* jetConeLalist = new TList();
3168 Double_t sumPtLa = 0.;
3169 Bool_t isBadJetLa = kFALSE; // dummy, do not use
3171 GetTracksInCone(fListLa, jetConeLalist, jet, GetFFRadius(), sumPtLa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetLa);//method inherited from FF
3173 if(fDebug>2)Printf("%s:%d nLa total: %d, in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nLa,jetConeLalist->GetEntries(),GetFFRadius());
3175 for(Int_t it=0; it<jetConeLalist->GetSize(); ++it){ // loop La in jet cone
3177 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetConeLalist->At(it));
3182 CalculateInvMass(v0, kLambda, invMLa, trackPt); //function to calculate invMass with TLorentzVector class
3184 Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
3187 Double_t jetPtSmear = -1;
3188 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
3189 if(incrementJetPt == kTRUE){fh1FFIMLaConeSmear->Fill(jetPtSmear);} //fill TH1F for normalization purposes
3192 fFFHistosIMLaCone->FillFF(trackPt, invMLa, jetPt, incrementJetPt);
3195 if(jetConeLalist->GetSize() == 0){ // no La: increment jet pt spectrum
3197 Bool_t incrementJetPt = kTRUE;
3198 fFFHistosIMLaCone->FillFF(-1, -1, jetPt, incrementJetPt);
3201 Double_t jetPtSmear;
3202 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
3203 if(incrementJetPt == kTRUE)fh1FFIMLaConeSmear->Fill(jetPtSmear);}
3209 //____fetch MC generated Lambdas in cone around jet axis__(particles can stem from fragmentation but also from underlying event)_____________
3211 Double_t sumPtMCgenLa = 0.;
3212 Bool_t isBadJetMCgenLa = kFALSE; // dummy, do not use
3214 //sampling MC gen. Lambdas in cone around reconstructed jet axis
3215 fListMCgenLaCone = new TList();
3217 GetTracksInCone(fListMCgenLa, fListMCgenLaCone, jet, GetFFRadius(), sumPtMCgenLa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetMCgenLa);//fetch MC generated Lambdas in cone of resolution parameter R around jet axis
3219 if(fDebug>2)Printf("%s:%d nMCgenLa in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,fListMCgenLaCone->GetEntries(),GetFFRadius());
3221 for(Int_t it=0; it<fListMCgenLaCone->GetSize(); ++it){ // loop MC generated La in cone around jet axis
3223 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenLaCone->At(it));
3226 //Double_t fRapMCgenLa = MyRapidity(mcp0->E(),mcp0->Pz());
3227 Double_t fEtaMCgenLa = mcp0->Eta();
3228 Double_t fPtMCgenLa = mcp0->Pt();
3230 fh2MCgenLaCone->Fill(jetPt,fPtMCgenLa);
3231 fh2MCEtagenLaCone->Fill(jetPt,fEtaMCgenLa);
3235 //check whether the reconstructed La are stemming from MC gen La on fListMCgenLa List:__________________________________________________
3237 for(Int_t ic=0; ic<jetConeLalist->GetSize(); ++ic){//loop over all reconstructed La within jet cone, new definition
3239 //for(Int_t ic=0; ic<fListLa->GetSize(); ++ic){//old definition
3241 Int_t negDaughterpdg;
3242 Int_t posDaughterpdg;
3245 Double_t fPtMCrecLaMatch;
3246 Double_t invMLaMatch;
3250 Bool_t fPhysicalPrimary = -1;
3251 Int_t MCv0PDGCode =0;
3252 Double_t jetPtSmear = -1;
3254 AliAODv0* v0c = dynamic_cast<AliAODv0*>(jetConeLalist->At(ic));//new definition
3256 //AliAODv0* v0c = dynamic_cast<AliAODv0*>(fListLa->At(ic));//old definition
3259 Bool_t daughtercheck = DaughterTrackCheck(v0c, nnum, pnum);
3260 if(daughtercheck == kFALSE)continue;
3262 const AliAODTrack *trackMCNeg=(AliAODTrack *)(v0c->GetDaughter(nnum));
3263 const AliAODTrack *trackMCPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
3265 TList *listmc = fAOD->GetList();
3267 Bool_t mclabelcheck = MCLabelCheck(v0c, kLambda, trackMCNeg, trackMCPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PDGCode);
3269 if(mclabelcheck == kFALSE)continue;
3270 if(fPhysicalPrimary == kFALSE)continue;
3272 for(Int_t it=0; it<fListMCgenLa->GetSize(); ++it){//new definition // loop over MC generated K0s in cone around jet axis
3274 // for(Int_t it=0; it<fListMCgenLaCone->GetSize(); ++it){//old definition // loop over MC generated La in cone around jet axis
3276 //Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
3278 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenLa->At(it));//new definition
3279 //AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenLaCone->At(it));//old definition
3283 Bool_t particleMatching = IsParticleMatching(mcp0, v0Label);
3286 if(particleMatching == kFALSE)continue; //particle doesn't match on any associated MC gen particle in cone around rec jet axis
3288 CalculateInvMass(v0c, kLambda, invMLaMatch, fPtMCrecLaMatch);
3290 Double_t fPtMCgenLa = mcp0->Pt();
3292 fh3MCrecLaCone->Fill(jetPt,invMLaMatch,fPtMCgenLa); //fill matching rec. K0s 3D histogram
3294 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
3296 fh3MCrecLaConeSmear->Fill(jetPtSmear,invMLaMatch,fPtMCgenLa); //fill matching rec. Lambdas in 3D histogram, jet pT smeared according to deltaptjet distribution width
3299 } // end MCgenLa loop
3301 //check the Lambda daughters contamination of the jet tracks://///////////////////////////////////////////////////////////////////////////////////////////
3303 TClonesArray *stackMC = 0x0;
3305 for(Int_t it=0; it<jettracklist->GetSize(); ++it){//loop over all particles in the jet
3307 AliVParticle* trackVP = dynamic_cast<AliVParticle*>(jettracklist->At(it));//all tracks in jet cone
3308 if(!trackVP)continue;
3309 AliAODTrack *tr = dynamic_cast<AliAODTrack*> (trackVP); //fetch one jet track from the TList
3312 //get MC label information
3313 TList *mclist = fAOD->GetList(); //fetch the MC stack
3315 stackMC = (TClonesArray*)mclist->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
3316 if (!stackMC) {Printf("ERROR: stack not available");}
3319 Int_t particleLabel = TMath::Abs(tr->GetLabel()); //fetch jet track label in MC stack
3321 Bool_t daughterchecks = DaughterTrackCheck(v0c, nnum, pnum);
3323 if(daughterchecks == kFALSE)continue; //make sure that daughters are properly ordered
3325 const AliAODTrack *trackNeg=(AliAODTrack *)(v0c->GetDaughter(nnum)); //fetch v0 daughters of reconstructed K0s
3326 const AliAODTrack *trackPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
3328 Int_t negAssLabel = TMath::Abs(trackNeg->GetLabel()); //negative (reconstructed) charged track label in MC stack
3329 Int_t posAssLabel = TMath::Abs(trackPos->GetLabel()); //positive (reconstructed) charged track label in MC stack
3332 if(particleLabel == posAssLabel){ //check whether jet track and each of the rec. K0s daughters have same MC stack label -> are identical
3334 AliAODMCParticle* mctrackPos = dynamic_cast<AliAODMCParticle*>(stackMC->At(posAssLabel));
3335 if(!mctrackPos) continue;
3337 Double_t trackPosPt = trackPos->Pt();
3338 Double_t trackPosEta = trackPos->Eta();
3339 fh3SecContinCone->Fill(jetPt, trackPosPt, trackPosEta);} //if it's the case, fill jet pt, daughter track pt and track eta in histo
3341 if(particleLabel == negAssLabel){
3343 AliAODMCParticle* mctrackNeg = dynamic_cast<AliAODMCParticle*>(stackMC->At(negAssLabel));
3344 if(!mctrackNeg) continue;
3346 Double_t trackNegPt = trackNeg->Pt();
3347 Double_t trackNegEta = trackNeg->Eta();
3348 fh3SecContinCone->Fill(jetPt, trackNegPt, trackNegEta);} //if it's the case, fill jet pt, daughter track pt and track eta in histo
3354 } //end rec-La-in-cone loop
3355 //________________________________________________________________________________________________________________________________________________________
3357 delete fListMCgenLaCone;
3361 delete jetConeLalist;
3365 //---------------ALa-----------
3368 // fQAJetHistosRecCutsLeading->FillJetQA( jet->Eta(), TVector2::Phi_0_2pi(jet->Phi()), jet->Pt() );
3370 for(Int_t it=0; it<fListALa->GetSize(); ++it){ // loop all ALa
3372 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListALa->At(it));
3377 TVector3 v0MomVect(v0Mom);
3379 Double_t dPhiJetALa = (jet->MomentumVector()->Vect()).DeltaPhi(v0MomVect);
3381 Double_t invMALa =0;
3384 CalculateInvMass(v0, kAntiLambda, invMALa, trackPt); //function to calculate invMass with TLorentzVector class
3385 Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
3387 //if(incrementJetPt){fh1V0JetPt->Fill(jetPt);}
3389 fFFHistosIMALaJet->FillFF(trackPt, invMALa, jetPt, incrementJetPt);
3390 fFFHistosPhiCorrIMALa->FillPhiCorr(trackPt,TVector2::Phi_0_2pi(dPhiJetALa),invMALa);
3392 if(dPhiJetALa<fh1dPhiJetALa->GetXaxis()->GetXmin()) dPhiJetALa += 2*TMath::Pi();
3393 fh1dPhiJetALa->Fill(dPhiJetALa);
3396 if(fListALa->GetSize() == 0){ // no ALa: increment jet pt spectrum
3398 Bool_t incrementJetPt = kTRUE;
3399 fFFHistosIMALaJet->FillFF(-1, -1, jetPt, incrementJetPt);
3403 // ____fetch rec. Antilambdas in cone around jet axis_______________________________________________________________________________________
3405 TList* jetConeALalist = new TList();
3406 Double_t sumPtALa = 0.;
3407 Bool_t isBadJetALa = kFALSE; // dummy, do not use
3409 GetTracksInCone(fListALa, jetConeALalist, jet, GetFFRadius(), sumPtALa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetALa);//method inherited from FF
3411 if(fDebug>2)Printf("%s:%d nALa total: %d, in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nALa,jetConeALalist->GetEntries(),GetFFRadius());
3413 for(Int_t it=0; it<jetConeALalist->GetSize(); ++it){ // loop ALa in jet cone
3415 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetConeALalist->At(it));
3417 Double_t invMALa =0;
3420 CalculateInvMass(v0, kAntiLambda, invMALa, trackPt); //function to calculate invMass with TLorentzVector class
3422 Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
3424 if(fAnalysisMC){ //jet pt smearing study for Antilambdas
3425 Double_t jetPtSmear = -1;
3426 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
3427 if(incrementJetPt == kTRUE){fh1FFIMALaConeSmear->Fill(jetPtSmear);} //fill TH1F for normalization purposes
3430 fFFHistosIMALaCone->FillFF(trackPt, invMALa, jetPt, incrementJetPt);
3433 if(jetConeALalist->GetSize() == 0){ // no ALa: increment jet pt spectrum
3435 Bool_t incrementJetPt = kTRUE;
3436 fFFHistosIMALaCone->FillFF(-1, -1, jetPt, incrementJetPt);
3439 Double_t jetPtSmear;
3440 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
3441 if(incrementJetPt == kTRUE)fh1FFIMALaConeSmear->Fill(jetPtSmear);}
3447 //____fetch MC generated Antilambdas in cone around jet axis__(particles can stem from fragmentation but also from underlying event)_____________
3449 Double_t sumPtMCgenALa = 0.;
3450 Bool_t isBadJetMCgenALa = kFALSE; // dummy, do not use
3452 //sampling MC gen Antilambdas in cone around reconstructed jet axis
3453 fListMCgenALaCone = new TList();
3455 GetTracksInCone(fListMCgenALa, fListMCgenALaCone, jet, GetFFRadius(), sumPtMCgenALa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetMCgenALa);//MC generated K0s in cone around jet axis
3457 if(fDebug>2)Printf("%s:%d nMCgenALa in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,fListMCgenALaCone->GetEntries(),GetFFRadius());
3459 for(Int_t it=0; it<fListMCgenALaCone->GetSize(); ++it){ // loop MC generated La in cone around jet axis
3461 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenALaCone->At(it));
3464 //Double_t fRapMCgenALa = MyRapidity(mcp0->E(),mcp0->Pz());
3465 Double_t fEtaMCgenALa = mcp0->Eta();
3466 Double_t fPtMCgenALa = mcp0->Pt();
3468 fh2MCgenALaCone->Fill(jetPt,fPtMCgenALa);
3469 fh2MCEtagenALaCone->Fill(jetPt,fEtaMCgenALa);
3473 //check whether the reconstructed ALa are stemming from MC gen ALa on MCgenALa List:__________________________________________________
3475 for(Int_t ic=0; ic<jetConeALalist->GetSize(); ++ic){//loop over all reconstructed ALa
3477 Int_t negDaughterpdg;
3478 Int_t posDaughterpdg;
3481 Double_t fPtMCrecALaMatch;
3482 Double_t invMALaMatch;
3486 Bool_t fPhysicalPrimary = -1;
3487 Int_t MCv0PDGCode =0;
3488 Double_t jetPtSmear = -1;
3490 AliAODv0* v0c = dynamic_cast<AliAODv0*>(jetConeALalist->At(ic));
3493 Bool_t daughtercheck = DaughterTrackCheck(v0c, nnum, pnum);
3494 if(daughtercheck == kFALSE)continue;
3496 const AliAODTrack *trackMCNeg=(AliAODTrack *)(v0c->GetDaughter(nnum));
3497 const AliAODTrack *trackMCPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
3499 TList *listmc = fAOD->GetList();
3500 if(!listmc)continue;
3502 Bool_t mclabelcheck = MCLabelCheck(v0c, kAntiLambda, trackMCNeg, trackMCPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PDGCode);
3504 if(mclabelcheck == kFALSE)continue;
3505 if(fPhysicalPrimary == kFALSE)continue;
3507 for(Int_t it=0; it<fListMCgenALa->GetSize(); ++it){ // loop over MC generated Antilambdas in cone around jet axis
3509 //Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
3511 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenALa->At(it));
3514 Bool_t particleMatching = IsParticleMatching(mcp0, v0Label);
3516 if(particleMatching == kFALSE)continue; //particle doesn't match on any associated MC gen particle in cone around rec jet axis
3518 CalculateInvMass(v0c, kAntiLambda, invMALaMatch, fPtMCrecALaMatch);
3520 Double_t fPtMCgenALa = mcp0->Pt();
3522 fh3MCrecALaCone->Fill(jetPt,invMALaMatch,fPtMCgenALa); //fill matching rec. K0s 3D histogram
3524 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
3526 fh3MCrecALaConeSmear->Fill(jetPtSmear,invMALaMatch,fPtMCgenALa);
3529 } // end MCgenALa loop
3533 //check the Antilambda daughters contamination of the jet tracks:
3535 TClonesArray *stackMC = 0x0;
3537 for(Int_t it=0; it<jettracklist->GetSize(); ++it){//loop over all particles in the jet
3539 AliVParticle* trackVP = dynamic_cast<AliVParticle*>(jettracklist->At(it));//all tracks in jet cone
3540 if(!trackVP)continue;
3541 AliAODTrack *tr = dynamic_cast<AliAODTrack*> (trackVP); //fetch one jet track from the TList
3544 //get MC label information
3545 TList *mclist = fAOD->GetList(); //fetch the MC stack
3546 if(!mclist)continue;
3548 stackMC = (TClonesArray*)mclist->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
3549 if (!stackMC) {Printf("ERROR: stack not available");}
3552 Int_t particleLabel = TMath::Abs(tr->GetLabel()); //fetch jet track label in MC stack
3554 Bool_t daughterchecks = DaughterTrackCheck(v0c, nnum, pnum);
3556 if(daughterchecks == kFALSE)continue; //make sure that daughters are properly ordered
3558 const AliAODTrack *trackNeg=(AliAODTrack *)(v0c->GetDaughter(nnum)); //fetch v0 daughters of reconstructed K0s
3559 const AliAODTrack *trackPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
3560 if(!trackPos)continue;
3561 if(!trackNeg)continue;
3563 Int_t negAssLabel = TMath::Abs(trackNeg->GetLabel()); //negative (reconstructed) charged track label in MC stack
3564 Int_t posAssLabel = TMath::Abs(trackPos->GetLabel()); //positive (reconstructed) charged track label in MC stack
3566 if(!negAssLabel)continue;
3567 if(!posAssLabel)continue;
3569 if(particleLabel == posAssLabel){ //check whether jet track and each of the rec. K0s daughters have same MC stack label -> are identical
3570 AliAODMCParticle* mctrackPos = dynamic_cast<AliAODMCParticle*>(stackMC->At(posAssLabel));
3571 if(!mctrackPos) continue;
3573 Double_t trackPosPt = trackPos->Pt();
3574 Double_t trackPosEta = trackPos->Eta();
3575 if(!trackPosPt)continue;
3576 if(!trackPosEta)continue;
3578 fh3SecContinCone->Fill(jetPt, trackPosPt, trackPosEta);} //if it's the case, fill jet pt, daughter track pt and track eta in histo
3580 if(particleLabel == negAssLabel){
3582 AliAODMCParticle* mctrackNeg = dynamic_cast<AliAODMCParticle*>(stackMC->At(negAssLabel));
3583 if(!mctrackNeg) continue;
3585 Double_t trackNegPt = trackNeg->Pt();
3586 Double_t trackNegEta = trackNeg->Eta();
3588 if(!trackNegPt)continue;
3589 if(!trackNegEta)continue;
3591 fh3SecContinCone->Fill(jetPt, trackNegPt, trackNegEta);} //if it's the case, fill jet pt, daughter track pt and track eta in histo
3595 } //end rec-ALa-in-cone loop
3596 //________________________________________________________________________________________________________________________________________________________
3598 delete fListMCgenALaCone;
3602 delete jetConeALalist;
3603 delete jettracklist; //had been initialised at jet loop beginning
3606 }//end of if 'leading' or 'all jet' requirement
3612 fTracksRecCuts->Clear();
3613 fJetsRecCuts->Clear();
3614 fBckgJetsRec->Clear();
3618 fListFeeddownLaCand->Clear();
3619 fListFeeddownALaCand->Clear();
3620 jetConeFDLalist->Clear();
3621 jetConeFDALalist->Clear();
3622 fListMCgenK0s->Clear();
3623 fListMCgenLa->Clear();
3624 fListMCgenALa->Clear();
3627 PostData(1, fCommonHistList);
3630 // ____________________________________________________________________________________________
3631 void AliAnalysisTaskJetChem::SetProperties(TH3F* h,const char* x, const char* y, const char* z)
3633 //Set properties of histos (x,y and z title)
3638 h->GetXaxis()->SetTitleColor(1);
3639 h->GetYaxis()->SetTitleColor(1);
3640 h->GetZaxis()->SetTitleColor(1);
3644 //________________________________________________________________________________________________________________________________________
3645 Bool_t AliAnalysisTaskJetChem::AcceptBetheBloch(AliAODv0 *v0, AliPIDResponse *PIDResponse, const Int_t particletype) //dont use for MC Analysis
3651 const AliAODTrack *ntracktest=(AliAODTrack *)v0->GetDaughter(nnum);
3652 if(ntracktest->Charge() > 0){nnum = 0; pnum = 1;}
3654 const AliAODTrack *trackNeg=(AliAODTrack *)(v0->GetDaughter(nnum));
3655 const AliAODTrack *trackPos=(AliAODTrack *)(v0->GetDaughter(pnum));
3657 //Check if both tracks are available
3658 if (!trackPos || !trackNeg) {
3659 Printf("strange analysis::UserExec:: Error:Could not retrieve one of the daughter tracks\n");
3663 //remove like sign V0s
3664 if ( trackPos->Charge() == trackNeg->Charge() ){
3665 //if(fDebug>1) Printf("%s:%d found like-sign V0", (char*)__FILE__,__LINE__);
3670 Double_t nsig_p = 0; //number of sigmas that positive daughter track has got in TPC pid information
3671 Double_t nsig_n = 0;
3673 const AliAODPid *pid_p=trackPos->GetDetPid(); // returns fDetPID, more detailed or detector specific pid information
3674 const AliAODPid *pid_n=trackNeg->GetDetPid();
3676 if(!pid_p)return kFALSE;
3677 if(!pid_n)return kFALSE;
3681 if(particletype == 1) //PID cut on positive charged Lambda daughters (only those with pt < 1 GeV/c)
3684 nsig_p=PIDResponse->NumberOfSigmasTPC(trackPos,AliPID::kProton);
3685 Double_t protonPt = trackPos->Pt();
3686 if ((TMath::Abs(nsig_p) >= fCutBetheBloch) && (fCutBetheBloch >0) && (protonPt < 1)) return kFALSE;
3695 if(particletype == 2)
3697 nsig_n=PIDResponse->NumberOfSigmasTPC(trackNeg,AliPID::kProton);
3698 Double_t antiprotonPt = trackNeg->Pt();
3699 if ((TMath::Abs(nsig_n) >= fCutBetheBloch) && (fCutBetheBloch >0) && (antiprotonPt < 1)) return kFALSE;
3707 //___________________________________________________________________
3708 Bool_t AliAnalysisTaskJetChem::IsK0InvMass(const Double_t mass) const
3710 // K0 mass ? Use FF histo limits
3712 if(fFFIMInvMMin <= mass && mass < fFFIMInvMMax) return kTRUE;
3716 //___________________________________________________________________
3717 Bool_t AliAnalysisTaskJetChem::IsLaInvMass(const Double_t mass) const
3719 // La mass ? Use FF histo limits
3722 if(fFFIMLaInvMMin <= mass && mass < fFFIMLaInvMMax) return kTRUE;
3727 //_____________________________________________________________________________________
3728 Int_t AliAnalysisTaskJetChem::GetListOfV0s(TList *list, const Int_t type, const Int_t particletype, AliAODVertex* primVertex, AliAODEvent* aod)
3730 // fill list of V0s selected according to type
3733 if(fDebug>1) Printf("%s:%d no input list", (char*)__FILE__,__LINE__);
3738 if(fDebug>5){std::cout<<"AliAnalysisTaskJetChem::GetListOfV0s(): type: "<<type<<" particletype: "<<particletype<<"aod: "<<aod<<std::endl;
3739 if(type==kTrackUndef){std::cout<<"AliAnalysisTaskJetChem::GetListOfV0s(): kTrackUndef!! "<<std::endl;}
3743 if(type==kTrackUndef) return 0;
3745 if(!primVertex) return 0;
3747 Double_t lPrimaryVtxPosition[3];
3748 Double_t lV0Position[3];
3749 lPrimaryVtxPosition[0] = primVertex->GetX();
3750 lPrimaryVtxPosition[1] = primVertex->GetY();
3751 lPrimaryVtxPosition[2] = primVertex->GetZ();
3753 if(fDebug>5){ std::cout<<"AliAnalysisTaskJetChem::GetListOfV0s(): aod->GetNumberOfV0s: "<<aod->GetNumberOfV0s()<<std::endl; }
3756 for(int i=0; i<aod->GetNumberOfV0s(); i++){ // loop over V0s
3759 AliAODv0* v0 = aod->GetV0(i);
3763 std::cout << std::endl
3764 << "Warning in AliAnalysisTaskJetChem::GetListOfV0s:" << std::endl
3765 << "v0 = " << v0 << std::endl;
3769 Bool_t isOnFly = v0->GetOnFlyStatus();
3771 if(!isOnFly && (type == kOnFly || type == kOnFlyPID || type == kOnFlydEdx || type == kOnFlyPrim)) continue;
3772 if( isOnFly && (type == kOffl || type == kOfflPID || type == kOffldEdx || type == kOfflPrim)) continue;
3774 Int_t motherType = -1;
3775 //Double_t v0CalcMass = 0; //mass of MC v0
3776 Double_t MCPt = 0; //pt of MC v0
3778 Double_t pp[3]={0,0,0}; //3-momentum positive charged track
3779 Double_t pm[3]={0,0,0}; //3-momentum negative charged track
3780 Double_t v0mom[3]={0,0,0};
3791 Bool_t daughtercheck = DaughterTrackCheck(v0, nnum, pnum);
3793 if(daughtercheck == kFALSE)continue;
3795 const AliAODTrack *trackNeg=(AliAODTrack *)(v0->GetDaughter(nnum));
3796 const AliAODTrack *trackPos=(AliAODTrack *)(v0->GetDaughter(pnum));
3799 ///////////////////////////////////////////////////////////////////////////////////
3801 //calculate InvMass for every V0 particle assumption (Kaon=1,Lambda=2,Antilambda=3)
3802 switch(particletype){
3804 CalculateInvMass(v0, kK0, invM, trackPt); //function to calculate invMass with TLorentzVector class
3808 CalculateInvMass(v0, kLambda, invM, trackPt);
3812 CalculateInvMass(v0, kAntiLambda, invM, trackPt);
3816 std::cout<<"***NO VALID PARTICLETYPE***"<<std::endl;
3821 /////////////////////////////////////////////////////////////
3822 //V0 and track Cuts:
3825 if(fDebug>6){if(!(IsK0InvMass(invMK0s)) && !(IsLaInvMass(invMLa)) && !(IsLaInvMass(invMALa))){std::cout<<"AliAnalysisTaskJetChem::GetListOfV0s: invM not in selected mass window "<<std::endl;}}
3827 if(!(IsK0InvMass(invMK0s)) && !(IsLaInvMass(invMLa)) && !(IsLaInvMass(invMALa)))continue;
3829 // Double_t PosEta = trackPos->AliAODTrack::Eta();//daughter track charge is sometimes wrong here, account for that!!!
3830 // Double_t NegEta = trackNeg->AliAODTrack::Eta();
3832 Double_t PosEta = trackPos->Eta();//daughter track charge is sometimes wrong here, account for that!!!
3833 Double_t NegEta = trackNeg->Eta();
3835 Double_t PosCharge = trackPos->Charge();
3836 Double_t NegCharge = trackNeg->Charge();
3838 if((trackPos->Charge() == 1) && (trackNeg->Charge() == -1)) //Fill daughters charge into histo to check if they are symmetric distributed
3839 { fh1PosDaughterCharge->Fill(PosCharge);
3840 fh1NegDaughterCharge->Fill(NegCharge);
3843 //DistOverTotMom_in_2D___________
3845 Float_t fMassK0s = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass();
3846 Float_t fMassLambda = TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass();
3849 AliAODVertex* primVtx = fAOD->GetPrimaryVertex(); // get the primary vertex
3850 Double_t dPrimVtxPos[3]; // primary vertex position {x,y,z}
3851 primVtx->GetXYZ(dPrimVtxPos);
3853 Float_t fPtV0 = TMath::Sqrt(v0->Pt2V0()); // transverse momentum of V0
3854 Double_t dSecVtxPos[3]; // V0 vertex position {x,y,z}
3855 v0->GetSecondaryVtx(dSecVtxPos);
3856 Double_t dDecayPath[3];
3857 for (Int_t iPos = 0; iPos < 3; iPos++)
3858 dDecayPath[iPos] = dSecVtxPos[iPos]-dPrimVtxPos[iPos]; // vector of the V0 path
3859 Float_t fDecLen2D = TMath::Sqrt(dDecayPath[0]*dDecayPath[0]+dDecayPath[1]*dDecayPath[1]); //transverse path length R
3860 Float_t fROverPt = fDecLen2D/fPtV0; // R/pT
3862 Float_t fMROverPtK0s = fMassK0s*fROverPt; // m*R/pT
3863 Float_t fMROverPtLambda = fMassLambda*fROverPt; // m*R/pT
3865 //___________________
3866 Double_t fRap = -999;//init values
3867 Double_t fEta = -999;
3868 Double_t fV0cosPointAngle = -999;
3869 Double_t fV0DecayLength = v0->DecayLengthV0(lPrimaryVtxPosition);
3873 fV0mom[0]=v0->MomV0X();
3874 fV0mom[1]=v0->MomV0Y();
3875 fV0mom[2]=v0->MomV0Z();
3877 Double_t fV0TotalMomentum = TMath::Sqrt(fV0mom[0]*fV0mom[0]+fV0mom[1]*fV0mom[1]+fV0mom[2]*fV0mom[2]);
3878 // const Double_t K0sPDGmass = 0.497614;
3879 // const Double_t LambdaPDGmass = 1.115683;
3881 const Double_t K0sPDGmass = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass();
3882 const Double_t LambdaPDGmass = TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass();
3884 Double_t fDistOverTotMomK0s = 0;
3885 Double_t fDistOverTotMomLa = 0;
3887 //calculate proper lifetime of particles in 3D (not recommended anymore)
3889 if(particletype == kK0){
3891 fDistOverTotMomK0s = fV0DecayLength * K0sPDGmass;
3892 fDistOverTotMomK0s /= (fV0TotalMomentum+1e-10);
3895 if((particletype == kLambda)||(particletype == kAntiLambda)){
3897 fDistOverTotMomLa = fV0DecayLength * LambdaPDGmass;
3898 fDistOverTotMomLa /= (fV0TotalMomentum+1e-10);
3901 //TPC cluster (not used anymore) and TPCRefit cuts
3903 //Double_t trackPosNcls = trackPos->GetTPCNcls();//Get number of clusters for positive charged tracks
3904 //Double_t trackNegNcls = trackNeg->GetTPCNcls();//Get number of clusters for negative charged tracks
3906 if(fRequireTPCRefit==kTRUE){//if kTRUE: accept only if daughter track is refitted in TPC!!
3907 Bool_t isPosTPCRefit = (trackPos->AliAODTrack::IsOn(AliESDtrack::kTPCrefit));
3908 Bool_t isNegTPCRefit = (trackNeg->AliAODTrack::IsOn(AliESDtrack::kTPCrefit));
3909 if (!isPosTPCRefit)continue;
3910 if (!isNegTPCRefit)continue;
3913 if(fKinkDaughters==kFALSE){//if kFALSE: no acceptance of kink daughters
3914 AliAODVertex* ProdVtxDaughtersPos = (AliAODVertex*) (trackPos->AliAODTrack::GetProdVertex());
3915 Char_t isAcceptKinkDaughtersPos = ProdVtxDaughtersPos->GetType();
3916 if(isAcceptKinkDaughtersPos==AliAODVertex::kKink)continue;
3918 AliAODVertex* ProdVtxDaughtersNeg = (AliAODVertex*) (trackNeg->AliAODTrack::GetProdVertex());
3919 Char_t isAcceptKinkDaughtersNeg = ProdVtxDaughtersNeg->GetType();
3920 if(isAcceptKinkDaughtersNeg==AliAODVertex::kKink)continue;
3924 Double_t fV0Radius = -999;
3925 Double_t fDcaV0Daughters = v0->DcaV0Daughters();
3926 Double_t fDcaPosToPrimVertex = v0->DcaPosToPrimVertex();//IP of positive charged daughter
3927 Double_t fDcaNegToPrimVertex = v0->DcaNegToPrimVertex();//IP of negative charged daughter
3928 Double_t avDecayLengthK0s = 2.6844;
3929 Double_t avDecayLengthLa = 7.89;
3931 //Float_t fCTauK0s = 2.6844; // [cm] c tau of K0S
3932 //Float_t fCTauLambda = 7.89; // [cm] c tau of Lambda and Antilambda
3934 fV0cosPointAngle = v0->CosPointingAngle(lPrimaryVtxPosition);
3935 lV0Position[0]= v0->DecayVertexV0X();
3936 lV0Position[1]= v0->DecayVertexV0Y();
3937 lV0Position[2]= v0->DecayVertexV0Z();
3939 fV0Radius = TMath::Sqrt(lV0Position[0]*lV0Position[0]+lV0Position[1]*lV0Position[1]);
3941 if(particletype == kK0) {fRap = v0->RapK0Short();
3942 fEta = v0->PseudoRapV0();}
3943 if(particletype == kLambda) {fRap = v0->RapLambda();
3944 fEta = v0->PseudoRapV0();}
3945 if(particletype == kAntiLambda) {fRap = v0->Y(-3122);
3946 fEta = v0->PseudoRapV0();}
3949 //cut on 3D DistOverTotMom: (not used anymore)
3950 //if((particletype == kLambda)||(particletype == kAntiLambda)){if(fDistOverTotMomLa >= (fCutV0DecayMax * avDecayLengthLa)) continue;}
3952 //cut on K0s applied below after all other cuts for histo fill purposes..
3954 //cut on 2D DistOverTransMom: (recommended from Iouri)
3955 if((particletype == kLambda)||(particletype == kAntiLambda)){if(fMROverPtLambda > (fCutV0DecayMax * avDecayLengthLa))continue;}//fCutV0DecayMax set to 5 in AddTask macro
3957 //Armenteros Podolanski Plot for K0s:////////////////////////////
3959 Double_t ArmenterosAlpha=-999;
3960 Double_t ArmenterosPt=-999;
3966 if(particletype == kK0){
3968 pp[0]=v0->MomPosX();
3969 pp[1]=v0->MomPosY();
3970 pp[2]=v0->MomPosZ();
3972 pm[0]=v0->MomNegX();
3973 pm[1]=v0->MomNegY();
3974 pm[2]=v0->MomNegZ();
3977 v0mom[0]=v0->MomV0X();
3978 v0mom[1]=v0->MomV0Y();
3979 v0mom[2]=v0->MomV0Z();
3981 TVector3 v0Pos(pp[0],pp[1],pp[2]);
3982 TVector3 v0Neg(pm[0],pm[1],pm[2]);
3983 TVector3 v0totMom(v0mom[0], v0mom[1], v0mom[2]); //vector for tot v0 momentum
3985 PosPt = v0Pos.Perp(v0totMom); //longitudinal momentum of positive charged daughter track
3986 PosPl = v0Pos.Dot(v0totMom)/v0totMom.Mag(); //transversal momentum of positive charged daughter track
3988 NegPt = v0Neg.Perp(v0totMom); //longitudinal momentum of negative charged daughter track
3989 NegPl = v0Neg.Dot(v0totMom)/v0totMom.Mag(); //transversal momentum of nergative charged daughter track
3991 ArmenterosAlpha = 1.-2./(1+(PosPl/NegPl));
3992 ArmenterosPt= v0->PtArmV0();
3996 if(particletype == kK0){//only cut on K0s histos
3997 if(IsArmenterosSelected == 1){// Armenteros Cut to reject Lambdas contamination in K0s inv. massspectrum
3998 fh2ArmenterosBeforeCuts->Fill(ArmenterosAlpha,ArmenterosPt);
4002 //some more cuts on v0s and daughter tracks:
4005 if((TMath::Abs(PosEta)>fCutPostrackEta) || (TMath::Abs(NegEta)>fCutNegtrackEta))continue; //Daughters pseudorapidity cut
4006 if (fV0cosPointAngle < fCutV0cosPointAngle) continue; //cospointangle cut
4008 //if(TMath::Abs(fRap) > fCutRap)continue; //V0 Rapidity Cut
4009 if(TMath::Abs(fEta) > fCutEta) continue; //V0 Eta Cut
4010 if (fDcaV0Daughters > fCutDcaV0Daughters)continue;
4011 if ((fDcaPosToPrimVertex < fCutDcaPosToPrimVertex) || (fDcaNegToPrimVertex < fCutDcaNegToPrimVertex))continue;
4012 if ((fV0Radius < fCutV0RadiusMin) || (fV0Radius > fCutV0RadiusMax))continue;
4014 const AliAODPid *pid_p1=trackPos->GetDetPid();
4015 const AliAODPid *pid_n1=trackNeg->GetDetPid();
4018 if(particletype == kLambda){
4019 // if(AcceptBetheBloch(v0, fPIDResponse, 1) == kFALSE){std::cout<<"******PID cut rejects Lambda!!!************"<<std::endl;}
4020 if(AcceptBetheBloch(v0, fPIDResponse, 1) == kFALSE)continue;
4021 fh2BBLaPos->Fill(pid_p1->GetTPCmomentum(),pid_p1->GetTPCsignal());//positive lambda daughter
4022 fh2BBLaNeg->Fill(pid_n1->GetTPCmomentum(),pid_n1->GetTPCsignal());//negative lambda daughter
4024 //Double_t phi = v0->Phi();
4025 //Double_t massLa = v0->MassLambda();
4027 //printf("La: i = %d, m = %f, pT = %f, eta = %f, phi = %f\n, ",i,massLa,trackPt,fEta,phi);
4031 if(particletype == kAntiLambda){
4033 if(AcceptBetheBloch(v0, fPIDResponse, 2) == kFALSE)continue;
4034 fh2BBLaPos->Fill(pid_p1->GetTPCmomentum(),pid_p1->GetTPCsignal());//positive antilambda daughter
4035 fh2BBLaNeg->Fill(pid_n1->GetTPCmomentum(),pid_n1->GetTPCsignal());//negative antilambda daughter
4040 //Armenteros cut on K0s:
4041 if(particletype == kK0){
4042 if(IsArmenterosSelected == 1){// Armenteros Cut to reject Lambdas contamination in K0s inv. massspectrum
4044 if((ArmenterosPt<=(TMath::Abs(fCutArmenteros*ArmenterosAlpha))) && (fCutArmenteros!=-999))continue; //Cuts out Lambda contamination in K0s histos
4045 fh2ArmenterosAfterCuts->Fill(ArmenterosAlpha,ArmenterosPt);
4049 //not used anymore in 3D, z component of total momentum has bad resolution, cut instead in 2D and use pT
4050 //Proper Lifetime Cut: DecayLength3D * PDGmass / |p_tot| < 3*2.68cm (ctau(betagamma=1)) ; |p|/mass = beta*gamma
4051 //////////////////////////////////////////////
4053 //cut on 3D DistOverTotMom
4054 /* if(particletype == kK0){
4056 fh2ProperLifetimeK0sVsPtBeforeCut->Fill(trackPt,fDistOverTotMomK0s); //fill these histos after all other cuts
4057 fh1ProperLifetimeV0BeforeCut->Fill(fDistOverTotMomK0s);
4058 if(fDistOverTotMomK0s >= (fCutV0DecayMax * avDecayLengthK0s))continue;
4059 fh1ProperLifetimeV0AfterCut->Fill(fDistOverTotMomK0s);
4060 fh2ProperLifetimeK0sVsPtAfterCut->Fill(trackPt,fDistOverTotMomK0s);
4064 //cut on 2D DistOverTransMom
4065 if(particletype == kK0){//the cut on Lambdas you can find above
4067 fh2ProperLifetimeK0sVsPtBeforeCut->Fill(trackPt,fMROverPtK0s); //fill these histos after all other cuts
4068 fh1ProperLifetimeV0BeforeCut->Fill(fMROverPtK0s);
4069 if(fMROverPtK0s > (fCutV0DecayMax * avDecayLengthK0s))continue;
4070 fh1ProperLifetimeV0AfterCut->Fill(fMROverPtK0s);
4071 fh2ProperLifetimeK0sVsPtAfterCut->Fill(trackPt,fMROverPtK0s);
4073 //Double_t phi = v0->Phi();
4074 // Double_t massK0s = v0->MassK0Short();
4075 //printf("K0S: i = %d, m = %f, pT = %f, eta = %f, phi = %f\n",i,invMK0s,trackPt,fEta,phi);
4077 //test std::cout<<" Index accepted K0s candidate in list of V0s in event: "<<i<<" m: "<<invMK0s<<" pT: "<<trackPt<<" eta: "<<fEta<<" phi: "<<v0->Phi()<<std::endl;
4080 //MC Associated V0 particles: (reconstructed particles associated with MC truth (MC truth: true primary MC generated particle))
4083 if(fAnalysisMC){// begin MC part
4085 Int_t negDaughterpdg = 0;
4086 Int_t posDaughterpdg = 0;
4088 Bool_t fPhysicalPrimary = -1; //v0 physical primary check
4089 Int_t MCv0PdgCode = 0;
4090 Bool_t mclabelcheck = kFALSE;
4092 TList *listmc = aod->GetList(); //AliAODEvent* is inherited from AliVEvent*, listmc is pointer to reconstructed event in MC list, member of AliAODEvent
4094 if(!listmc)continue;
4096 if((particletype == kLambda) || (particletype == kAntiLambda)){// at this point the v0 candidates already survived all V0 cuts, for the MC analysis they still have to survive the association checks in the following block
4098 //feeddown-correction for Lambda/Antilambda particles
4099 //feedddown comes mainly from charged and neutral Xi particles
4100 //feeddown from Sigma decays so quickly that it's not possible to distinguish from primary Lambdas with detector
4101 //feeddown for K0s from phi decays is neglectible
4102 //TH2F* fh2FeedDownMatrix = 0x0; //histo for feeddown already decleared above
4105 //first for all Lambda and Antilambda candidates____________________________________________________________________
4107 if(particletype == kLambda){
4109 mclabelcheck = MCLabelCheck(v0, kLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode);
4112 if((motherType == 3312)||(motherType == 3322)){//mother of v0 is neutral or negative Xi
4114 fListFeeddownLaCand->Add(v0); //fill TList with ass. particles, stemming from feeddown from Xi(bar) decays
4118 if(particletype == kAntiLambda){
4119 mclabelcheck = MCLabelCheck(v0, kAntiLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode);
4121 if((motherType == -3312)||(motherType == -3322)){
4122 fListFeeddownALaCand->Add(v0); //fill TList with ass. particles, stemming from feeddown from Xi(bar) decays
4127 //_only true primary particles survive the following checks_______________________________________________________________________________________________
4129 if(particletype == kK0){
4130 mclabelcheck = MCLabelCheck(v0, kK0, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode);
4131 if(mclabelcheck == kFALSE)continue;
4133 if(particletype == kLambda){
4134 mclabelcheck = MCLabelCheck(v0, kLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode);
4135 if(mclabelcheck == kFALSE)continue;
4137 if(particletype == kAntiLambda){
4138 mclabelcheck = MCLabelCheck(v0, kAntiLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode);
4139 if(mclabelcheck == kFALSE)continue;
4142 if(fPhysicalPrimary != 1)continue; //V0 candidate (K0s, Lambda or Antilambda) must be physical primary, this means there is no mother particle existing
4151 Int_t nPart=list->GetSize();
4154 } // end GetListOfV0s()
4156 // -------------------------------------------------------------------------------------------------------
4158 void AliAnalysisTaskJetChem::CalculateInvMass(AliAODv0* v0vtx, const Int_t particletype, Double_t& invM, Double_t& trackPt){
4168 Double_t pp[3]={0,0,0}; //3-momentum positive charged track
4169 Double_t pm[3]={0,0,0}; //3-momentum negative charged track
4171 const Double_t massPi = 0.13957018; //better use PDG code at this point
4172 const Double_t massP = 0.93827203;
4177 TLorentzVector vector; //lorentzvector V0 particle
4178 TLorentzVector fourmom1;//lorentzvector positive daughter
4179 TLorentzVector fourmom2;//lorentzvector negative daughter
4181 //--------------------------------------------------------------
4183 AliAODTrack *trackPos = (AliAODTrack *) (v0vtx->GetSecondaryVtx()->GetDaughter(0));//index 0 defined as positive charged track in AliESDFilter
4185 if( trackPos->Charge() == 1 ){
4187 pp[0]=v0vtx->MomPosX();
4188 pp[1]=v0vtx->MomPosY();
4189 pp[2]=v0vtx->MomPosZ();
4191 pm[0]=v0vtx->MomNegX();
4192 pm[1]=v0vtx->MomNegY();
4193 pm[2]=v0vtx->MomNegZ();
4196 if( trackPos->Charge() == -1 ){
4198 pm[0]=v0vtx->MomPosX();
4199 pm[1]=v0vtx->MomPosY();
4200 pm[2]=v0vtx->MomPosZ();
4202 pp[0]=v0vtx->MomNegX();
4203 pp[1]=v0vtx->MomNegY();
4204 pp[2]=v0vtx->MomNegZ();
4207 if (particletype == kK0){ // case K0s
4208 mass1 = massPi;//positive particle
4209 mass2 = massPi;//negative particle
4210 } else if (particletype == kLambda){ // case Lambda
4211 mass1 = massP;//positive particle
4212 mass2 = massPi;//negative particle
4213 } else if (particletype == kAntiLambda){ //case AntiLambda
4214 mass1 = massPi;//positive particle
4215 mass2 = massP; //negative particle
4218 fourmom1.SetXYZM(pp[0],pp[1],pp[2],mass1);//positive track
4219 fourmom2.SetXYZM(pm[0],pm[1],pm[2],mass2);//negative track
4220 vector=fourmom1 + fourmom2;
4223 trackPt = vector.Pt();
4225 /*// don't apply AliAODv0 methods to get the inv. mass for the OnFly finder, since the daughter labels are sometimes switched!!!! For Offline V0 finder no problem
4227 if(particletype == kK0){
4228 std::cout << "invMK0s: " << invM <<std::endl;
4229 std::cout << "v0vtx->MassK0Short(): " << v0vtx->MassK0Short() << std::endl;
4230 std::cout << " " <<std::endl;
4231 //invM = v0vtx->MassK0Short();
4234 if(particletype == kLambda){
4235 std::cout << "invMLambda: " << invM <<std::endl;
4236 std::cout << "v0vtx->MassMassLambda(): " << v0vtx->MassLambda() << std::endl;
4237 std::cout << " " <<std::endl;
4238 //invM = v0vtx->MassLambda();
4241 if(particletype == kAntiLambda){
4242 std::cout << "invMAntiLambda: " << invM <<std::endl;
4243 std::cout << "v0vtx->MassAntiLambda(): " << v0vtx->MassAntiLambda() << std::endl;
4244 std::cout << " " <<std::endl;
4245 //invM = v0vtx->MassAntiLambda();
4253 //_____________________________________________________________________________________
4254 Int_t AliAnalysisTaskJetChem::GetListOfMCParticles(TList *outputlist, const Int_t particletype, AliAODEvent *mcaodevent) //(list to fill here e.g. fListMCgenK0s, particle species to search for)
4257 outputlist->Clear();
4259 TClonesArray *stack = 0x0;
4260 Double_t mcXv=0., mcYv=0., mcZv=0.;//MC vertex position
4263 // get MC generated particles
4265 Int_t fPdgcodeCurrentPart = 0; //pdg code current particle
4266 Double_t fRapCurrentPart = 0; //get rapidity
4267 Double_t fPtCurrentPart = 0; //get transverse momentum
4268 Double_t fEtaCurrentPart = 0; //get pseudorapidity
4270 //variable for check: physical primary particle
4271 //Bool_t IsPhysicalPrimary = -1;
4272 //Int_t index = 0; //check number of injected particles
4273 //****************************
4274 // Start loop over MC particles
4276 TList *lst = mcaodevent->GetList();
4279 if(fDebug>1) Printf("%s:%d no input list", (char*)__FILE__,__LINE__);
4283 stack = (TClonesArray*)lst->FindObject(AliAODMCParticle::StdBranchName());
4285 Printf("ERROR: stack not available");
4289 AliAODMCHeader *mcHdr=(AliAODMCHeader*)lst->FindObject(AliAODMCHeader::StdBranchName());
4290 if(!mcHdr)return -1;
4292 mcXv=mcHdr->GetVtxX(); mcYv=mcHdr->GetVtxY(); mcZv=mcHdr->GetVtxZ(); // position of the MC primary vertex
4295 ntrk=stack->GetEntriesFast();
4297 //if(TMath::Abs(mcZv)>10)return; //i also cut at the reconstructed particles - here i also want to cut for a second time on z vertex (?) -> could be possible bias because of resolution effects on edges of acceptance, also the case for pseudorapidity...
4300 for (Int_t iMc = 0; iMc < ntrk; iMc++) { //loop over mc generated particles
4303 AliAODMCParticle *p0=(AliAODMCParticle*)stack->UncheckedAt(iMc);
4305 //Printf("ERROR: particle with label %d not found in stack (mc loop)", iMc);
4308 fPdgcodeCurrentPart = p0->GetPdgCode();
4310 // Keep only K0s, Lambda and AntiLambda, Xi and Phi:
4311 //if ( (fPdgcodeCurrentPart != 310 ) && (fPdgcodeCurrentPart != 3122 ) && (fPdgcodeCurrentPart != -3122 ) && (fPdgcodeCurrentPart != 3312 ) && (fPdgcodeCurrentPart != -3312) && (fPdgcodeCurrentPart != -333) ) continue;
4315 //Rejection of Pythia injected particles with David Chinellatos method - not the latest method, better Method with TString from MC generator in IsInjected() function below!
4317 /* if( (p0->GetStatus()==21) ||
4318 ((p0->GetPdgCode() == 443) &&
4319 (p0->GetMother() == -1) &&
4320 (p0->GetDaughter(0) == (iMc))) ){ index++; }
4322 if(p0->GetStatus()==21){std::cout<< "hello !!!!" <<std::endl;}
4324 std::cout<< "MC particle status: " << p0->GetStatus() <<std::endl;
4328 //if(index>=1){std::cout<< "MC particle status: " << p0->GetStatus() <<std::endl;}//if first injected MC particle was found, the Status is printed out for this and every following MC particle
4331 //injected particles could be from GenBox (single high pt tracks) or jet related tracks, both generated from PYTHIA MC generator
4333 //Check: MC particle mother
4335 //for feed-down checks
4336 /* //MC gen particles
4337 Int_t iMother = p0->GetMother(); //Motherparticle of V0 candidate (e.g. phi particle,..)
4339 AliAODMCParticle *partM = (AliAODMCParticle*)stack->UncheckedAt(iMother);
4341 if(partM) codeM = TMath::Abs(partM->GetPdgCode());
4344 3312 Xi- -3312 Xibar+
4345 3322 Xi0 -3322 Xibar0
4348 if((codeM == 3312)||(codeM == 3322))// feeddown for Lambda coming from Xi- and Xi0
4354 /* //Check: MC gen. particle decays via 2-pion decay? -> only to be done for the rec. particles !! (-> branching ratio ~ 70 % for K0s -> pi+ pi-)
4356 Int_t daughter0Label = p0->GetDaughter(0);
4357 AliAODMCParticle *mcDaughter0 = (AliAODMCParticle *)stack->UncheckedAt(daughter0Label);
4358 if(daughter0Label >= 0)
4359 {daughter0Type = mcDaughter0->GetPdgCode();}
4361 Int_t daughter1Label = p0->GetDaughter(1);
4362 AliAODMCParticle *mcDaughter1 = (AliAODMCParticle *)stack->UncheckedAt(daughter1Label);
4364 if(daughter1Label >= 1)
4365 {daughter1Type = mcDaughter1->GetPdgCode();} //requirement that daughters are pions is only done for the reconstructed V0s in GetListofV0s() below
4370 // Keep only K0s, Lambda and AntiLambda:
4371 if ( (fPdgcodeCurrentPart != 310 ) && (fPdgcodeCurrentPart != 3122 ) && (fPdgcodeCurrentPart != -3122 )) continue;
4372 // Check: Is physical primary
4374 //do not use anymore: //IsPhysicalPrimary = p0->IsPhysicalPrimary();
4375 //if(!IsPhysicalPrimary)continue;
4377 Float_t fDistPrimaryMax = 0.01; // [cm] max distance of production point to the primary vertex (criterion for choice of MC particles considered as primary)
4379 // Get the distance between production point of the MC mother particle and the primary vertex
4381 Double_t dx = mcXv-p0->Xv();//mc primary vertex - mc gen. v0 vertex
4382 Double_t dy = mcYv-p0->Yv();
4383 Double_t dz = mcZv-p0->Zv();
4385 Double_t fDistPrimary = TMath::Sqrt(dx*dx + dy*dy + dz*dz);
4386 Bool_t fPhysicalPrimary = (fDistPrimary < fDistPrimaryMax);
4388 if(!fPhysicalPrimary)continue;
4390 //if(fPhysicalPrimary){std::cout<<"hello**********************"<<std::endl;}
4392 /* std::cout<<"dx: "<<dx<<std::endl;
4393 std::cout<<"dy: "<<dy<<std::endl;
4394 std::cout<<"dz: "<<dz<<std::endl;
4396 std::cout<<"start: "<<std::endl;
4397 std::cout<<"mcXv: "<<mcXv<<std::endl;
4398 std::cout<<"mcYv: "<<mcYv<<std::endl;
4399 std::cout<<"mcZv: "<<mcZv<<std::endl;
4401 std::cout<<"p0->Xv(): "<<p0->Xv()<<std::endl;
4402 std::cout<<"p0->Yv(): "<<p0->Yv()<<std::endl;
4403 std::cout<<"p0->Zv(): "<<p0->Zv()<<std::endl;
4404 std::cout<<" "<<std::endl;
4405 std::cout<<"fDistPrimary"<<fDistPrimary<<std::endl;
4406 std::cout<<"fPhysicalPrimary"<<fPhysicalPrimary<<std::endl;
4409 //Is close enough to primary vertex to be considered as primary-like?
4411 fRapCurrentPart = MyRapidity(p0->E(),p0->Pz());
4412 fEtaCurrentPart = p0->Eta();
4413 fPtCurrentPart = p0->Pt();
4415 if (TMath::Abs(fEtaCurrentPart) < fCutEta){
4416 // if (TMath::Abs(fRapCurrentPart) > fCutRap)continue; //rap cut for crosschecks
4418 if(particletype == kK0){ //MC gen. K0s
4419 if (fPdgcodeCurrentPart==310){
4420 outputlist->Add(p0);
4424 if(particletype == kLambda){ //MC gen. Lambdas
4425 if (fPdgcodeCurrentPart==3122) {
4426 outputlist->Add(p0);
4430 if(particletype == kAntiLambda){
4431 if (fPdgcodeCurrentPart==-3122) { //MC gen. Antilambdas
4432 outputlist->Add(p0);
4437 }//end loop over MC generated particle
4439 Int_t nMCPart=outputlist->GetSize();
4446 //---------------------------------------------------------------------------
4448 Bool_t AliAnalysisTaskJetChem::FillFeeddownMatrix(TList* fListFeeddownCand, Int_t particletype)
4451 // Define Feeddown matrix
4452 Double_t lFeedDownMatrix [100][100];
4453 // FeedDownMatrix [Lambda Bin][Xi Bin];
4455 //Initialize entries of matrix:
4456 for(Int_t ilb = 0; ilb<100; ilb++){
4457 for(Int_t ixb = 0; ixb<100; ixb++){
4458 lFeedDownMatrix[ilb][ixb]=0; //first lambda bins, xi bins
4463 //----------------------------------------------------------------------------
4465 Double_t AliAnalysisTaskJetChem::MyRapidity(Double_t rE, Double_t rPz) const
4467 // Local calculation for rapidity
4468 return 0.5*TMath::Log((rE+rPz)/(rE-rPz+1.e-13));
4470 //----------------------------------------------------------------------------
4472 // ________________________________________________________________________________________________________________________//function to get the MC gen. jet particles
4474 void AliAnalysisTaskJetChem::GetTracksInCone(TList* inputlist, TList* outputlist, const AliAODJet* jet,
4475 const Double_t radius, Double_t& sumPt, const Double_t minPt, const Double_t maxPt, Bool_t& isBadPt)
4477 // fill list of tracks in cone around jet axis
4480 Bool_t isBadMaxPt = kFALSE;
4481 Bool_t isBadMinPt = kTRUE;
4485 jet->PxPyPz(jetMom);
4486 TVector3 jet3mom(jetMom);
4488 for (Int_t itrack=0; itrack<inputlist->GetSize(); itrack++){
4490 AliVParticle* track = dynamic_cast<AliVParticle*>(inputlist->At(itrack));
4492 Double_t trackMom[3];
4493 track->PxPyPz(trackMom);
4494 TVector3 track3mom(trackMom);
4496 Double_t dR = jet3mom.DeltaR(track3mom);
4500 outputlist->Add(track);
4502 sumPt += track->Pt();
4504 if(maxPt>0 && track->Pt()>maxPt) isBadMaxPt = kTRUE; // reject jets containing any track with pt larger than this value, use GetFFMaxTrackPt()
4505 if(minPt>0 && track->Pt()>minPt) isBadMinPt = kFALSE; // reject jets with leading track with pt smaller than this value, use GetFFMinLTrackPt()
4511 if(minPt>0 && isBadMinPt) isBadPt = kTRUE; //either the jet is bad because of too small leading track pt.. (probability to be purely combinatorial jet is too high to accept it)
4512 if(maxPt>0 && isBadMaxPt) isBadPt = kTRUE; //..or because of leading track with too high pt (could be fake track)
4518 //____________________________________________________________________________________________________________________
4521 void AliAnalysisTaskJetChem::GetTracksInPerpCone(TList* inputlist, TList* outputlist, const AliAODJet* jet,
4522 const Double_t radius, Double_t& sumPerpPt)
4524 // fill list of tracks in two cones around jet axis rotated in phi +/- 90 degrees
4526 Double_t jetMom[3]; //array for entries in TVector3
4527 Double_t perpjetplusMom[3]; //array for entries in TVector3
4528 Double_t perpjetnegMom[3];
4532 jet->PxPyPz(jetMom); //get 3D jet momentum
4533 Double_t jetPerpPt = jet->Pt(); //original jet pt, invariant under rotations
4534 Double_t jetPhi = jet->Phi(); //original jet phi
4536 Double_t jetPerpposPhi = jetPhi + ((TMath::Pi())*0.5);//get new perp. jet axis phi clockwise
4537 Double_t jetPerpnegPhi = jetPhi - ((TMath::Pi())*0.5);//get new perp. jet axis phi counterclockwise
4539 TVector3 jet3mom(jetMom); //3-Vector for original rec. jet axis
4541 //Double_t phitest = jet3mom.Phi();
4543 perpjetplusMom[0]=(TMath::Cos(jetPerpposPhi)*jetPerpPt); //x coordinate (sidewards - when looking in beam direction)
4544 perpjetplusMom[1]=(TMath::Sin(jetPerpposPhi)*jetPerpPt); //y coordinate (upwards - when looking in beam direction)
4545 perpjetplusMom[2]=jetMom[2]; //z coordinate (along beam axis), invariant under azimuthal rotation
4547 perpjetnegMom[0]=(TMath::Cos(jetPerpnegPhi)*jetPerpPt); //x coordinate (sidewards - when looking in beam direction)
4548 perpjetnegMom[1]=(TMath::Sin(jetPerpnegPhi)*jetPerpPt); //y coordinate (upwards - when looking in beam direction)
4549 perpjetnegMom[2]=jetMom[2]; //z coordinate (along beam axis), invariant under azimuthal rotation
4552 TVector3 perpjetplus3mom(perpjetplusMom); //3-Vector for new perp. jet axis, clockwise rotated
4553 TVector3 perpjetneg3mom(perpjetnegMom); //3-Vector for new perp. jet axis, counterclockwise rotated
4555 //for crosscheck TVector3 rotation method
4557 //Double_t jetMomplusTest[3];
4558 //Double_t jetMomminusTest[3];
4560 //jet3mom.RotateZ(TMath::Pi()*0.5);//rotate original jet axis around +90 degrees in phi
4562 //perpjetminus3momTest = jet3mom.RotateZ((-1)*TMath::Pi()*0.5);
4564 // jet3mom.RotateZ(TMath::Pi()*0.5);
4565 // jet3mom.RotateZ((-1)*TMath::Pi()*0.5);
4567 //jetMomplusTest[0] = jet3mom.X(); //fetching perp. axis coordinates
4568 //jetMomplusTest[1] = jet3mom.Y();
4569 //jetMomplusTest[2] = jet3mom.Z();
4571 //TVector3 perpjetplus3momTest(jetMomplusTest); //new TVector3 for +90deg rotated jet axis with rotation method from ROOT
4572 //TVector3 perpjetminus3momTest(jetMomminusTest); //new TVector3 for -90deg rotated jet axis with rotation method from ROOT
4575 for (Int_t itrack=0; itrack<inputlist->GetSize(); itrack++){ //collect V0 content in perp cone, rotated clockwise
4577 AliVParticle* track = dynamic_cast<AliVParticle*>(inputlist->At(itrack)); //inputlist is fListK0s, all reconstructed K0s in event
4578 if(!track){std::cout<<"K0s track not found!!!"<<std::endl; continue;}
4580 Double_t trackMom[3];//3-mom of V0 particle
4581 track->PxPyPz(trackMom);
4582 TVector3 track3mom(trackMom);
4584 Double_t dR = perpjetplus3mom.DeltaR(track3mom);
4588 outputlist->Add(track); // output list is jetPerpConeK0list
4590 sumPerpPt += track->Pt();
4597 for (Int_t itrack=0; itrack<inputlist->GetSize(); itrack++){//collect V0 content in perp cone, rotated counterclockwise
4599 AliVParticle* track = dynamic_cast<AliVParticle*>(inputlist->At(itrack)); //inputlist is fListK0s, all reconstructed K0s in event
4600 if(!track){std::cout<<"K0s track not found!!!"<<std::endl; continue;}
4602 Double_t trackMom[3];//3-mom of V0 particle
4603 track->PxPyPz(trackMom);
4604 TVector3 track3mom(trackMom);
4606 Double_t dR = perpjetneg3mom.DeltaR(track3mom);
4610 outputlist->Add(track); // output list is jetPerpConeK0list
4612 sumPerpPt += track->Pt();
4618 // pay attention: this list contains the double amount of V0s, found in both cones
4619 // before using it, devide spectra by 2!!!
4620 sumPerpPt = sumPerpPt*0.5; //correct to do this?
4628 // _______________________________________________________________________________________________________________________________________________________
4630 Bool_t AliAnalysisTaskJetChem::MCLabelCheck(AliAODv0* v0, Int_t particletype,const AliAODTrack* trackNeg, const AliAODTrack* trackPos, TList *listmc, Int_t& negDaughterpdg, Int_t& posDaughterpdg, Int_t& motherType, Int_t& v0Label, Double_t& MCPt, Bool_t& fPhysicalPrimary, Int_t& MCv0PDGCode){
4632 TClonesArray *stackmc = 0x0;
4633 stackmc = (TClonesArray*)listmc->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
4636 Printf("ERROR: stack not available");
4641 Int_t negAssLabel = TMath::Abs(trackNeg->GetLabel()); //negative (reconstructed) charged track label in MC stack
4642 Int_t posAssLabel = TMath::Abs(trackPos->GetLabel()); //positive (reconstructed) charged track label in MC stack
4644 //injected particle checks
4650 AliAODMCHeader *header=(AliAODMCHeader*)listmc->FindObject(AliAODMCHeader::StdBranchName());
4651 if(!header)return kFALSE;
4653 mcXv=header->GetVtxX(); mcYv=header->GetVtxY(); mcZv=header->GetVtxZ();
4655 Int_t trackinjected = IsTrackInjected(v0, header, stackmc); //requires AliAODTrack instead of AliVTrack
4657 if(trackinjected == 0){std::cout<<"HIJING track injected!!: "<<trackinjected<<std::endl;}
4661 if(negAssLabel>=0 && negAssLabel < stackmc->GetEntriesFast() && posAssLabel>=0 && posAssLabel < stackmc->GetEntriesFast()){//safety check if label has valid value of stack
4663 AliAODMCParticle *mcNegPart =(AliAODMCParticle*)stackmc->UncheckedAt(negAssLabel);//fetch the, with one MC truth track associated (reconstructed), negative charged track
4664 v0Label = mcNegPart->GetMother();// mother of negative charged particle is v0, get v0 label here
4665 negDaughterpdg = mcNegPart->GetPdgCode();
4666 AliAODMCParticle *mcPosPart =(AliAODMCParticle*)stackmc->UncheckedAt(posAssLabel);//fetch the, with one MC truth track associated (reconstructed), positive charged track
4667 Int_t v0PosLabel = mcPosPart->GetMother(); //get mother label of positive charged track label
4668 posDaughterpdg = mcPosPart->GetPdgCode();
4670 if(v0Label >= 0 && v0Label < stackmc->GetEntriesFast() && v0Label == v0PosLabel){//first v0 mc label check, then: check if both daughters are stemming from same particle
4672 AliAODMCParticle *mcv0 = (AliAODMCParticle *)stackmc->UncheckedAt(v0Label); //fetch MC ass. particle to v0 (mother of the both charged daughter tracks)
4674 //do not use anymore:
4675 //fPhysicalPrimary = mcv0->IsPhysicalPrimary();
4678 Float_t fDistPrimaryMax = 0.01; // [cm] max distance of production point to the primary vertex (criterion for choice of MC particles considered as primary)
4680 // Get the distance between production point of the MC mother particle and the primary vertex
4682 Double_t dx = mcXv-mcv0->Xv();//mc primary vertex - mc particle production vertex
4683 Double_t dy = mcYv-mcv0->Yv();
4684 Double_t dz = mcZv-mcv0->Zv();
4686 Float_t fDistPrimary = TMath::Sqrt(dx*dx + dy*dy + dz*dz);
4687 fPhysicalPrimary = kFALSE;//init
4689 fPhysicalPrimary = (fDistPrimary < fDistPrimaryMax);
4691 //if(fPhysicalPrimary == kTRUE){std::cout<<"hello*********!!!!!!!!!!!!! "<<std::endl;}
4692 //if(fPhysicalPrimary == kFALSE)return kFALSE;
4694 MCv0PDGCode = mcv0->GetPdgCode();
4696 //std::cout<<"MCv0PDGCode: "<<MCv0PDGCode<<std::endl;
4698 MCPt = mcv0->Pt();//for MC data, always use MC gen. pt for any pt distributions, also for the spectra, used for normalisation
4699 //for feed-down checks later
4701 Int_t motherLabel = mcv0->GetMother(); //get mother particle label of v0 particle
4702 // std::cout<<"motherLabel: "<<motherLabel<<std::endl;
4704 if(motherLabel >= 0 && v0Label < stackmc->GetEntriesFast()) //do safety check for mother label
4706 AliAODMCParticle *mcMother = (AliAODMCParticle *)stackmc->UncheckedAt(motherLabel); //get mother particle
4707 motherType = mcMother->GetPdgCode(); //get PDG code of mother
4710 Double_t XibarPt = 0.;
4712 if(particletype == kLambda){
4713 if((motherType == 3312)||(motherType == 3322)){ //if v0 mother is Xi0 or Xi- fill MC gen. pt in FD La histogram
4714 XiPt = mcMother->Pt();
4715 fh1MCXiPt->Fill(XiPt);
4718 if(particletype == kAntiLambda){
4719 if((motherType == -3312)||(motherType == -3322)){ //if v0 mother is Xibar0 or Xibar+ fill MC gen. pt in FD ALa histogram
4720 XibarPt = mcMother->Pt();
4721 fh1MCXibarPt->Fill(XibarPt);
4727 //pdg code checks etc..
4729 if(particletype == kK0){
4731 if(TMath::Abs(posDaughterpdg) != 211){return kFALSE;}//one or both of the daughters are not a pion
4732 if(TMath::Abs(negDaughterpdg) != 211){return kFALSE;}
4734 if(MCv0PDGCode != 310) {return kFALSE;}
4737 if(particletype == kLambda){
4738 if(MCv0PDGCode != 3122)return kFALSE;//if particle is not Antilambda, v0 is rejected
4739 if(posDaughterpdg != 2212)return kFALSE;
4740 if(negDaughterpdg != -211)return kFALSE; //pdg code check for Lambda daughters
4742 //{if((motherType == 3312)||(motherType == 3322)){continue;}//if Xi0 and Xi- is motherparticle of Lambda, particle is rejected, pay attention, most possible Xi-, Xi0 and Omega- are not distributed physically and are much more abundant than expected by physics //}
4745 if(particletype == kAntiLambda){
4746 if(MCv0PDGCode != -3122)return kFALSE;
4747 if(posDaughterpdg != 211)return kFALSE;
4748 if(negDaughterpdg !=-2212)return kFALSE; //pdg code check for Antilambda daughters
4749 //if(fPhysicalPrimary == 1){fh1MCmotherALa->Fill(7.);}
4751 //{if((motherType == -3312)||(motherType == -3322)){continue;}//if bar{Xi0} and Xi+ is motherparticle of Antilambda, particle is rejected
4755 return kTRUE; //check was successful
4756 }//end mc v0 label check
4757 }// end of stack label check
4762 return kFALSE; //check wasn't successful
4764 //________________________________________________________________________________________________________________________________________________________
4767 Bool_t AliAnalysisTaskJetChem::IsParticleMatching(const AliAODMCParticle* mcp0, const Int_t v0Label){
4769 const Int_t mcp0label = mcp0->GetLabel();
4771 if(v0Label == mcp0label)return kTRUE;
4776 //_______________________________________________________________________________________________________________________________________________________
4778 Bool_t AliAnalysisTaskJetChem::DaughterTrackCheck(AliAODv0* v0, Int_t& nnum, Int_t& pnum){
4781 if(v0->GetNDaughters() != 2) return kFALSE;//case v0 has more or less than 2 daughters, avoids seg. break at some AOD files //reason?
4784 // safety check of input parameters
4787 if(fDebug > 1){std::cout << std::endl
4788 << "Warning in AliAnalysisTaskJetChem::DaughterTrackCheck:" << std::endl
4789 << "v0 = " << v0 << std::endl;}
4795 //Daughters track check: its Luke Hanrattys method to check daughters charge
4801 AliAODTrack *ntracktest =(AliAODTrack*)(v0->GetDaughter(nnum));
4803 if(ntracktest == NULL)
4805 if(fDebug > 1){std::cout << std::endl
4806 << "Warning in AliAnalysisTaskJetChem::DaughterTrackCheck:" << std::endl
4807 << "ntracktest = " << ntracktest << std::endl;}
4812 if(ntracktest->Charge() > 0)
4818 const AliAODTrack *trackNeg=(AliAODTrack *)(v0->GetDaughter(nnum));
4819 const AliAODTrack *trackPos=(AliAODTrack *)(v0->GetDaughter(pnum));
4821 //Check if both tracks are available
4822 if (!trackPos || !trackNeg) {
4823 if(fDebug > 1) Printf("strange analysis::UserExec:: Error:Could not retrieve one of the daughter tracks\n");
4828 //remove like sign V0s
4829 if ( trackPos->Charge() == trackNeg->Charge() ){
4830 //if(fDebug>1) Printf("%s:%d found like-sign V0", (char*)__FILE__,__LINE__);
4838 //_______________________________________________________________________________________________________________________________________________________
4840 Int_t AliAnalysisTaskJetChem::IsTrackInjected(AliAODv0 *v0, AliAODMCHeader *header, TClonesArray *arrayMC){//info in TString should be available from 2011 data productions on..
4842 if(!v0){std::cout << " !part " << std::endl;return 1;}
4843 if(!header){std::cout << " !header " << std::endl;return 1;}
4844 if(!arrayMC){std::cout << " !arrayMC " << std::endl;return 1;}
4846 Int_t lab=v0->GetLabel();
4847 if(lab<0) {return 1;}
4848 TString bbb = GetGenerator(lab,header);
4851 // std::cout << " TString bbb: " << bbb << std::endl;
4853 // std::cout << " FIRST CALL " << bbb << std::endl;
4855 while(bbb.IsWhitespace()){
4856 AliAODMCParticle *mcpart= (AliAODMCParticle*)arrayMC->At(lab);
4857 if(!mcpart){return 1;}
4858 Int_t mother = mcpart->GetMother();
4860 bbb = GetGenerator(mother,header);
4861 std::cout << "Testing " << bbb << " " << std::endl;
4864 std::cout << " FINAL CALL " << bbb << std::endl;
4866 //std::transform(bbb.begin(), bbb.end(), bbb.begin(), ::tolower); //convert TString bbb into lower case, to avoid that TString could be written in lower or upper case
4868 if(bbb.Contains("ijing")){std::cout << " particle is injected!! " << std::endl; return 0;}//if TString returns something with "ijing" return this method with 0 -> select out all HIJING particles, all others return with "1"
4874 //______________________________________________________________________
4875 TString AliAnalysisTaskJetChem::GetGenerator(Int_t label, AliAODMCHeader* header){
4877 TList *lh=header->GetCocktailHeaders();
4878 Int_t nh=lh->GetEntries();
4879 for(Int_t i=0;i<nh;i++){
4880 AliGenEventHeader* gh=(AliGenEventHeader*)lh->At(i);
4881 TString genname=gh->GetName();
4882 Int_t npart=gh->NProduced();
4883 if(label>=nsumpart && label<(nsumpart+npart)) return genname;
4890 //_________________________________________________________________________________________________________________________________________
4891 Double_t AliAnalysisTaskJetChem::SmearJetPt(Double_t jetPt, Int_t /*cent*/, Double_t /*jetRadius*/, Double_t /*ptmintrack*/, Double_t& jetPtSmear){
4893 static TF1 fsmear("f1","[0]*exp(-1*(x-[1])*(x-[1])/(2*[2]*[2]))",-100.,100.); //smearing according to gaussian function in between +/- 10 GeV/c
4897 /* if(cent>10) cl = 2;
4902 fsmear.SetParameters(1,0,11.19);//for 2010 PbPb jets, R=0.4, ptmintrack = 0.15 GeV/c, cent 00-10%, delta-pt width estimated via single track embedding
4903 //fsmear->SetParameters(1,0,3.28);//for 2010 PbPb jets, R=0.4, ptmintrack = 0.15 GeV/c, cent 50-60%, delta-pt width estimated via single track embedding
4905 //fsmear->SetParameters(1,0,4.472208);// for 2010 PbPb jets, R=0.2, ptmintrack = 0.15 GeV/c, cent 00-10%
4907 /* //delta-pt width for anti-kt jet finder:
4910 if((cl == 1)&&(jetRadius == 0.4)&&(ptmintrack == 0.15)){
4911 fsmear->SetParameters(1,0,10.178069);//(max.,mean,sigma) of gaussian, needs to be adjusted for every combination of jet cone size, centrality and min. pt constituents cut
4913 if((cl == 2)&&(jetRadius == 0.4)&&(ptmintrack == 0.15)){
4914 fsmear->SetParameters(1,0,8.536195);
4916 if((cl == 3)&&(jetRadius == 0.4)&&(ptmintrack == 0.15)){
4917 fsmear->SetParameters(1,0,?);
4919 if((cl == 4)&&(jetRadius == 0.4)&&(ptmintrack == 0.15)){
4920 fsmear->SetParameters(1,0,5.229839);
4924 if((cl == 1)&&(jetRadius == 0.3)&&(ptmintrack == 0.15)){
4925 fsmear->SetParameters(1,0,7.145967);
4927 if((cl == 2)&&(jetRadius == 0.3)&&(ptmintrack == 0.15)){
4928 fsmear->SetParameters(1,0,5.844796);
4930 if((cl == 3)&&(jetRadius == 0.3)&&(ptmintrack == 0.15)){
4931 fsmear->SetParameters(1,0,?);
4933 if((cl == 4)&&(jetRadius == 0.3)&&(ptmintrack == 0.15)){
4934 fsmear->SetParameters(1,0,3.630751);
4938 if((cl == 1)&&(jetRadius == 0.2)&&(ptmintrack == 0.15)){
4939 fsmear->SetParameters(1,0,4.472208);
4941 if((cl == 2)&&(jetRadius == 0.2)&&(ptmintrack == 0.15)){
4942 fsmear->SetParameters(1,0,3.543938);
4944 if((cl == 3)&&(jetRadius == 0.2)&&(ptmintrack == 0.15)){
4945 fsmear->SetParameters(1,0,?);
4947 if((cl == 4)&&(jetRadius == 0.2)&&(ptmintrack == 0.15)){
4948 fsmear->SetParameters(1,0,1.037476);
4953 Double_t r = fsmear.GetRandom();
4954 jetPtSmear = jetPt + r;
4956 // std::cout<<"jetPt: "<<jetPt<<std::endl;
4957 // std::cout<<"jetPtSmear: "<<jetPtSmear<<std::endl;
4958 // std::cout<<"r: "<<r<<std::endl;
4965 // _______________________________________________________________________________________________________________________
4966 AliAODJet* AliAnalysisTaskJetChem::GetMedianCluster()
4968 // fill tracks from bckgCluster branch,
4969 // using cluster with median density (odd number of clusters)
4970 // or picking randomly one of the two closest to median (even number)
4972 Int_t nBckgClusters = fBckgJetsRec->GetEntries(); // not 'recCuts': use all clusters in full eta range
4974 if(nBckgClusters<3) return 0; // need at least 3 clusters (skipping 2 highest)
4976 Double_t* bgrDensity = new Double_t[nBckgClusters];
4977 Int_t* indices = new Int_t[nBckgClusters];
4979 for(Int_t ij=0; ij<nBckgClusters; ++ij){
4981 AliAODJet* bgrCluster = (AliAODJet*)(fBckgJetsRec->At(ij));
4982 Double_t clusterPt = bgrCluster->Pt();
4983 Double_t area = bgrCluster->EffectiveAreaCharged();
4985 Double_t density = 0;
4986 if(area>0) density = clusterPt/area;
4988 bgrDensity[ij] = density;
4992 TMath::Sort(nBckgClusters, bgrDensity, indices);
4994 // get median cluster
4996 AliAODJet* medianCluster = 0;
4997 Double_t medianDensity = 0;
4999 if(TMath::Odd(nBckgClusters)){
5001 //Int_t medianIndex = indices[(Int_t) (0.5*(nBckgClusters-1))];
5002 Int_t medianIndex = indices[(Int_t) (0.5*(nBckgClusters+1))];
5004 medianCluster = (AliAODJet*)(fBckgJetsRec->At(medianIndex));
5006 Double_t clusterPt = medianCluster->Pt();
5007 Double_t area = medianCluster->EffectiveAreaCharged();
5009 if(area>0) medianDensity = clusterPt/area;
5013 //Int_t medianIndex1 = indices[(Int_t) (0.5*nBckgClusters-1)];
5014 //Int_t medianIndex2 = indices[(Int_t) (0.5*nBckgClusters)];
5016 Int_t medianIndex1 = indices[(Int_t) (0.5*nBckgClusters)];
5017 Int_t medianIndex2 = indices[(Int_t) (0.5*nBckgClusters+1)];
5019 AliAODJet* medianCluster1 = (AliAODJet*)(fBckgJetsRec->At(medianIndex1));
5020 AliAODJet* medianCluster2 = (AliAODJet*)(fBckgJetsRec->At(medianIndex2));
5022 Double_t density1 = 0;
5023 Double_t clusterPt1 = medianCluster1->Pt();
5024 Double_t area1 = medianCluster1->EffectiveAreaCharged();
5025 if(area1>0) density1 = clusterPt1/area1;
5027 Double_t density2 = 0;
5028 Double_t clusterPt2 = medianCluster2->Pt();
5029 Double_t area2 = medianCluster2->EffectiveAreaCharged();
5030 if(area2>0) density2 = clusterPt2/area2;
5032 medianDensity = 0.5*(density1+density2);
5034 medianCluster = ( (gRandom->Rndm()>0.5) ? medianCluster1 : medianCluster2 ); // select one randomly to avoid adding areas
5037 delete[] bgrDensity;
5040 return medianCluster;