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 **************************************************************************/
24 //Task for K0s, Lambda and Antilambda analysis in jets
25 //Author: Alice Zimmermann (zimmermann@physi.uni-heidelberg.de)
43 #include "THnSparse.h"
46 #include "AliAnalysisHelperJetTasks.h"
47 #include "TDatabasePDG.h"
49 #include "AliAnalysisManager.h"
50 #include "AliAODHandler.h"
51 #include "AliAODInputHandler.h"
52 #include "AliESDEvent.h"
53 #include "AliGenPythiaEventHeader.h"
54 #include "AliGenHijingEventHeader.h"
55 #include "AliGenEventHeader.h"
56 #include "TLorentzVector.h"
57 #include "AliAODEvent.h"
58 #include "AliAODJet.h"
60 #include "AliAODTrack.h"
61 #include "AliCentrality.h"
62 #include "AliAnalysisTaskSE.h"
63 #include "AliESDtrack.h"
64 #include "AliESDtrackCuts.h"
65 #include "AliESDEvent.h"
66 #include "AliESDInputHandler.h"
68 #include "AliPIDResponse.h"
69 #include "AliAODPid.h"
70 #include "AliExternalTrackParam.h"
71 #include "AliAnalysisTaskJetChem.h"
72 #include "AliPhysicsSelection.h"
73 #include "AliBackgroundSelection.h"
74 #include "AliInputEventHandler.h"
75 #include "AliAODMCHeader.h"
76 #include "AliAODPid.h"
77 #include "AliVEvent.h"
78 #include "AliAODMCParticle.h"
82 ClassImp(AliAnalysisTaskJetChem)
84 //____________________________________________________________________________
85 AliAnalysisTaskJetChem::AliAnalysisTaskJetChem()
86 : AliAnalysisTaskFragmentationFunction()
100 ,fCutV0cosPointAngle(0)
107 ,fCutDcaV0Daughters(0)
108 ,fCutDcaPosToPrimVertex(0)
109 ,fCutDcaNegToPrimVertex(0)
120 ,jetPerpConeK0list(0)
121 ,jetPerpConeLalist(0)
122 ,jetPerpConeALalist(0)
123 ,jetMedianConeK0list(0)
124 ,jetMedianConeLalist(0)
125 ,jetMedianConeALalist(0)
132 ,fFFHistosRecCutsK0Evt(0)
133 //,fFFHistosIMK0AllEvt(0)
134 //,fFFHistosIMK0Jet(0)
135 //,fFFHistosIMK0Cone(0)
139 // ,fFFHistosIMLaAllEvt(0)
140 // ,fFFHistosIMLaJet(0)
141 //,fFFHistosIMLaCone(0)
145 ,fListFeeddownLaCand(0)
146 ,fListFeeddownALaCand(0)
152 ,fListMCgenK0sCone(0)
154 ,fListMCgenALaCone(0)
155 ,IsArmenterosSelected(0)
156 // ,fFFHistosIMALaAllEvt(0)
157 // ,fFFHistosIMALaJet(0)
158 // ,fFFHistosIMALaCone(0)
174 ,fFFIMLaNBinsJetPt(0)
205 //,fh1trackPosNCls(0)
206 //,fh1trackNegNCls(0)
216 ,fh2ProperLifetimeK0sVsPtBeforeCut(0)
217 ,fh2ProperLifetimeK0sVsPtAfterCut(0)
219 ,fh1DcaV0Daughters(0)
220 ,fh1DcaPosToPrimVertex(0)
221 ,fh1DcaNegToPrimVertex(0)
222 ,fh2ArmenterosBeforeCuts(0)
223 ,fh2ArmenterosAfterCuts(0)
226 ,fh1PosDaughterCharge(0)
227 ,fh1NegDaughterCharge(0)
241 ,fhnInvMassEtaTrackPtK0s(0)
242 ,fhnInvMassEtaTrackPtLa(0)
243 ,fhnInvMassEtaTrackPtALa(0)
249 // ,fh2MCgenK0Cone(0)
250 // ,fh2MCgenLaCone(0)
251 // ,fh2MCgenALaCone(0)
252 // ,fh2MCEtagenK0Cone(0)
253 // ,fh2MCEtagenLaCone(0)
254 // ,fh2MCEtagenALaCone(0)
255 ,fh2CorrHijingLaProton(0)
256 ,fh2CorrInjectLaProton(0)
257 ,fh2CorrHijingALaAProton(0)
258 ,fh2CorrInjectALaAProton(0)
261 ,fh1IMALaConeSmear(0)
262 ,fh2MCEtaVsPtHijingLa(0)
263 ,fh2MCEtaVsPtInjectLa(0)
264 ,fh2MCEtaVsPtHijingALa(0)
265 ,fh2MCEtaVsPtInjectALa(0)
266 ,fhnrecMCHijingLaIncl(0)
267 ,fhnrecMCHijingLaCone(0)
268 ,fhnrecMCHijingALaIncl(0)
269 ,fhnrecMCHijingALaCone(0)
270 ,fhnrecMCInjectLaIncl(0)
271 ,fhnrecMCInjectLaCone(0)
272 ,fhnrecMCInjectALaIncl(0)
273 ,fhnrecMCInjectALaCone(0)
277 ,fhnMCrecK0ConeSmear(0)
278 ,fhnMCrecLaConeSmear(0)
279 ,fhnMCrecALaConeSmear(0)
280 ,fhnK0sSecContinCone(0)
281 ,fhnLaSecContinCone(0)
282 ,fhnALaSecContinCone(0)
307 ,fh1MCMultiplicityPrimary(0)
308 ,fh1MCMultiplicityTracks(0)
311 ,fhnFeedDownLaCone(0)
312 ,fhnFeedDownALaCone(0)
313 ,fh1MCProdRadiusK0s(0)
314 ,fh1MCProdRadiusLambda(0)
315 ,fh1MCProdRadiusAntiLambda(0)
319 ,fh1MCPtAntiLambda(0)
327 //,fh1MCRapAntiLambda(0)
331 ,fh1MCEtaAntiLambda(0)
334 // default constructor
337 //__________________________________________________________________________________________
338 AliAnalysisTaskJetChem::AliAnalysisTaskJetChem(const char *name)
339 : AliAnalysisTaskFragmentationFunction(name)
353 ,fCutV0cosPointAngle(0)
360 ,fCutDcaV0Daughters(0)
361 ,fCutDcaPosToPrimVertex(0)
362 ,fCutDcaNegToPrimVertex(0)
373 ,jetPerpConeK0list(0)
374 ,jetPerpConeLalist(0)
375 ,jetPerpConeALalist(0)
376 ,jetMedianConeK0list(0)
377 ,jetMedianConeLalist(0)
378 ,jetMedianConeALalist(0)
385 ,fFFHistosRecCutsK0Evt(0)
386 //,fFFHistosIMK0AllEvt(0)
387 //,fFFHistosIMK0Jet(0)
388 //,fFFHistosIMK0Cone(0)
392 //,fFFHistosIMLaAllEvt(0)
393 //,fFFHistosIMLaJet(0)
394 //,fFFHistosIMLaCone(0)
398 ,fListFeeddownLaCand(0)
399 ,fListFeeddownALaCand(0)
405 ,fListMCgenK0sCone(0)
407 ,fListMCgenALaCone(0)
408 ,IsArmenterosSelected(0)
409 //,fFFHistosIMALaAllEvt(0)
410 //,fFFHistosIMALaJet(0)
411 // ,fFFHistosIMALaCone(0)
427 ,fFFIMLaNBinsJetPt(0)
458 // ,fh1trackPosNCls(0)
459 // ,fh1trackNegNCls(0)
469 ,fh2ProperLifetimeK0sVsPtBeforeCut(0)
470 ,fh2ProperLifetimeK0sVsPtAfterCut(0)
472 ,fh1DcaV0Daughters(0)
473 ,fh1DcaPosToPrimVertex(0)
474 ,fh1DcaNegToPrimVertex(0)
475 ,fh2ArmenterosBeforeCuts(0)
476 ,fh2ArmenterosAfterCuts(0)
479 ,fh1PosDaughterCharge(0)
480 ,fh1NegDaughterCharge(0)
494 ,fhnInvMassEtaTrackPtK0s(0)
495 ,fhnInvMassEtaTrackPtLa(0)
496 ,fhnInvMassEtaTrackPtALa(0)
504 //,fh2MCgenALaCone(0)
505 //,fh2MCEtagenK0Cone(0)
506 //,fh2MCEtagenLaCone(0)
507 //,fh2MCEtagenALaCone(0)
508 ,fh2CorrHijingLaProton(0)
509 ,fh2CorrInjectLaProton(0)
510 ,fh2CorrHijingALaAProton(0)
511 ,fh2CorrInjectALaAProton(0)
514 ,fh1IMALaConeSmear(0)
515 ,fh2MCEtaVsPtHijingLa(0)
516 ,fh2MCEtaVsPtInjectLa(0)
517 ,fh2MCEtaVsPtHijingALa(0)
518 ,fh2MCEtaVsPtInjectALa(0)
519 ,fhnrecMCHijingLaIncl(0)
520 ,fhnrecMCHijingLaCone(0)
521 ,fhnrecMCHijingALaIncl(0)
522 ,fhnrecMCHijingALaCone(0)
523 ,fhnrecMCInjectLaIncl(0)
524 ,fhnrecMCInjectLaCone(0)
525 ,fhnrecMCInjectALaIncl(0)
526 ,fhnrecMCInjectALaCone(0)
530 ,fhnMCrecK0ConeSmear(0)
531 ,fhnMCrecLaConeSmear(0)
532 ,fhnMCrecALaConeSmear(0)
533 ,fhnK0sSecContinCone(0)
534 ,fhnLaSecContinCone(0)
535 ,fhnALaSecContinCone(0)
560 ,fh1MCMultiplicityPrimary(0)
561 ,fh1MCMultiplicityTracks(0)
564 ,fhnFeedDownLaCone(0)
565 ,fhnFeedDownALaCone(0)
566 ,fh1MCProdRadiusK0s(0)
567 ,fh1MCProdRadiusLambda(0)
568 ,fh1MCProdRadiusAntiLambda(0)
572 ,fh1MCPtAntiLambda(0)
580 //,fh1MCRapAntiLambda(0)
584 ,fh1MCEtaAntiLambda(0)
590 DefineOutput(1,TList::Class());
593 //__________________________________________________________________________________________________________________________
594 AliAnalysisTaskJetChem::AliAnalysisTaskJetChem(const AliAnalysisTaskJetChem ©)
595 : AliAnalysisTaskFragmentationFunction()
597 ,fRandom(copy.fRandom)
598 ,fAnalysisMC(copy.fAnalysisMC)
599 ,fDeltaVertexZ(copy.fDeltaVertexZ)
600 ,fCutjetEta(copy.fCutjetEta)
601 ,fCuttrackNegNcls(copy.fCuttrackNegNcls)
602 ,fCuttrackPosNcls(copy.fCuttrackPosNcls)
603 ,fCutPostrackRap(copy.fCutPostrackRap)
604 ,fCutNegtrackRap(copy.fCutNegtrackRap)
605 ,fCutRap(copy.fCutRap)
606 ,fCutPostrackEta(copy.fCutPostrackEta)
607 ,fCutNegtrackEta(copy.fCutNegtrackEta)
608 ,fCutEta(copy.fCutEta)
609 ,fCutV0cosPointAngle(copy.fCutV0cosPointAngle)
610 ,fKinkDaughters(copy.fKinkDaughters)
611 ,fRequireTPCRefit(copy.fRequireTPCRefit)
612 ,fCutArmenteros(copy.fCutArmenteros)
613 ,fCutV0DecayMin(copy.fCutV0DecayMin)
614 ,fCutV0DecayMax(copy.fCutV0DecayMax)
615 ,fCutV0totMom(copy.fCutV0totMom)
616 ,fCutDcaV0Daughters(copy.fCutDcaV0Daughters)
617 ,fCutDcaPosToPrimVertex(copy.fCutDcaPosToPrimVertex)
618 ,fCutDcaNegToPrimVertex(copy.fCutDcaNegToPrimVertex)
619 ,fCutV0RadiusMin(copy.fCutV0RadiusMin)
620 ,fCutV0RadiusMax(copy.fCutV0RadiusMax)
621 ,fCutBetheBloch(copy.fCutBetheBloch)
622 ,fCutRatio(copy.fCutRatio)
623 ,fK0Type(copy.fK0Type)
624 ,fFilterMaskK0(copy.fFilterMaskK0)
625 ,jettracklist(copy.jettracklist)
626 ,jetConeK0list(copy.jetConeK0list)
627 ,jetConeLalist(copy.jetConeLalist)
628 ,jetConeALalist(copy.jetConeALalist)
629 ,jetPerpConeK0list(copy.jetPerpConeK0list)
630 ,jetPerpConeLalist(copy.jetPerpConeLalist)
631 ,jetPerpConeALalist(copy.jetPerpConeALalist)
632 ,jetMedianConeK0list(copy.jetMedianConeK0list)
633 ,jetMedianConeLalist(copy.jetMedianConeLalist)
634 ,jetMedianConeALalist(copy.jetMedianConeALalist)
635 ,fListK0sRC(copy.fListK0sRC)
636 ,fListLaRC(copy.fListLaRC)
637 ,fListALaRC(copy.fListALaRC)
638 ,fListK0s(copy.fListK0s)
639 ,fPIDResponse(copy.fPIDResponse)
640 ,fV0QAK0(copy.fV0QAK0)
641 ,fFFHistosRecCutsK0Evt(copy.fFFHistosRecCutsK0Evt)
642 //,fFFHistosIMK0AllEvt(copy.fFFHistosIMK0AllEvt)
643 //,fFFHistosIMK0Jet(copy.fFFHistosIMK0Jet)
644 //,fFFHistosIMK0Cone(copy.fFFHistosIMK0Cone)
645 ,fLaType(copy.fLaType)
646 ,fFilterMaskLa(copy.fFilterMaskLa)
647 ,fListLa(copy.fListLa)
648 //,fFFHistosIMLaAllEvt(copy.fFFHistosIMLaAllEvt)
649 //,fFFHistosIMLaJet(copy.fFFHistosIMLaJet)
650 //,fFFHistosIMLaCone(copy.fFFHistosIMLaCone)
651 ,fALaType(copy.fALaType)
652 ,fFilterMaskALa(copy.fFilterMaskALa)
653 ,fListALa(copy.fListALa)
654 ,fListFeeddownLaCand(copy.fListFeeddownLaCand)
655 ,fListFeeddownALaCand(copy.fListFeeddownALaCand)
656 ,jetConeFDLalist(copy.jetConeFDLalist)
657 ,jetConeFDALalist(copy.jetConeFDALalist)
658 ,fListMCgenK0s(copy.fListMCgenK0s)
659 ,fListMCgenLa(copy.fListMCgenLa)
660 ,fListMCgenALa(copy.fListMCgenALa)
661 ,fListMCgenK0sCone(copy.fListMCgenK0sCone)
662 ,fListMCgenLaCone(copy.fListMCgenLaCone)
663 ,fListMCgenALaCone(copy.fListMCgenALaCone)
664 ,IsArmenterosSelected(copy.IsArmenterosSelected)
665 //,fFFHistosIMALaAllEvt(copy.fFFHistosIMALaAllEvt)
666 //,fFFHistosIMALaJet(copy.fFFHistosIMALaJet)
667 //,fFFHistosIMALaCone(copy.fFFHistosIMALaCone)
668 ,fFFIMNBinsJetPt(copy.fFFIMNBinsJetPt)
669 ,fFFIMJetPtMin(copy.fFFIMJetPtMin)
670 ,fFFIMJetPtMax(copy.fFFIMJetPtMax)
671 ,fFFIMNBinsInvM(copy.fFFIMNBinsInvM)
672 ,fFFIMInvMMin(copy.fFFIMInvMMin)
673 ,fFFIMInvMMax(copy.fFFIMInvMMax)
674 ,fFFIMNBinsPt(copy.fFFIMNBinsPt)
675 ,fFFIMPtMin(copy.fFFIMPtMin)
676 ,fFFIMPtMax(copy.fFFIMPtMax)
677 ,fFFIMNBinsXi(copy.fFFIMNBinsXi)
678 ,fFFIMXiMin(copy.fFFIMXiMin)
679 ,fFFIMXiMax(copy.fFFIMXiMax)
680 ,fFFIMNBinsZ(copy.fFFIMNBinsZ)
681 ,fFFIMZMin(copy.fFFIMZMin)
682 ,fFFIMZMax(copy.fFFIMZMax)
683 ,fFFIMLaNBinsJetPt(copy.fFFIMLaNBinsJetPt)
684 ,fFFIMLaJetPtMin(copy.fFFIMLaJetPtMin)
685 ,fFFIMLaJetPtMax(copy.fFFIMLaJetPtMax)
686 ,fFFIMLaNBinsInvM(copy.fFFIMLaNBinsInvM)
687 ,fFFIMLaInvMMin(copy.fFFIMLaInvMMin)
688 ,fFFIMLaInvMMax(copy.fFFIMLaInvMMax)
689 ,fFFIMLaNBinsPt(copy.fFFIMLaNBinsPt)
690 ,fFFIMLaPtMin(copy.fFFIMLaPtMin)
691 ,fFFIMLaPtMax(copy.fFFIMLaPtMax)
692 ,fFFIMLaNBinsXi(copy.fFFIMLaNBinsXi)
693 ,fFFIMLaXiMin(copy.fFFIMLaXiMin)
694 ,fFFIMLaXiMax(copy.fFFIMLaXiMax)
695 ,fFFIMLaNBinsZ(copy.fFFIMLaNBinsZ)
696 ,fFFIMLaZMin(copy.fFFIMLaZMin)
697 ,fFFIMLaZMax(copy.fFFIMLaZMax)
698 ,fh1EvtAllCent(copy.fh1EvtAllCent)
700 ,fh1K0Mult(copy.fh1K0Mult)
701 ,fh1dPhiJetK0(copy.fh1dPhiJetK0)
702 ,fh1LaMult(copy.fh1LaMult)
703 ,fh1dPhiJetLa(copy.fh1dPhiJetLa)
704 ,fh1ALaMult(copy.fh1ALaMult)
705 ,fh1dPhiJetALa(copy.fh1dPhiJetALa)
706 ,fh1JetEta(copy.fh1JetEta)
707 ,fh1JetPhi(copy.fh1JetPhi)
708 ,fh2JetEtaPhi(copy.fh2JetEtaPhi)
709 //,fh1V0JetPt(copy.fh1V0JetPt)
710 ,fh1IMK0Cone(copy.fh1IMK0Cone)
711 ,fh1IMLaCone(copy.fh1IMLaCone)
712 ,fh1IMALaCone(copy.fh1IMALaCone)
713 ,fh2FFJetTrackEta(copy.fh2FFJetTrackEta)
714 //,fh1trackPosNCls(copy.fh1trackPosNCls)
715 //,fh1trackNegNCls(copy.fh1trackNegNCls)
716 ,fh1trackPosRap(copy.fh1trackPosRap)
717 ,fh1trackNegRap(copy.fh1trackNegRap)
718 //,fh1V0Rap(copy.fh1V0Rap)
719 ,fh1trackPosEta(copy.fh1trackPosEta)
720 ,fh1trackNegEta(copy.fh1trackNegEta)
721 ,fh1V0Eta(copy.fh1V0Eta)
722 //,fh1V0totMom(copy.fh1V0totMom)
723 ,fh1CosPointAngle(copy.fh1CosPointAngle)
724 ,fh1DecayLengthV0(copy.fh1DecayLengthV0)
725 ,fh2ProperLifetimeK0sVsPtBeforeCut(copy.fh2ProperLifetimeK0sVsPtBeforeCut)
726 ,fh2ProperLifetimeK0sVsPtAfterCut(copy.fh2ProperLifetimeK0sVsPtAfterCut)
727 ,fh1V0Radius(copy.fh1V0Radius)
728 ,fh1DcaV0Daughters(copy.fh1DcaV0Daughters)
729 ,fh1DcaPosToPrimVertex(copy.fh1DcaPosToPrimVertex)
730 ,fh1DcaNegToPrimVertex(copy.fh1DcaNegToPrimVertex)
731 ,fh2ArmenterosBeforeCuts(copy.fh2ArmenterosBeforeCuts)
732 ,fh2ArmenterosAfterCuts(copy.fh2ArmenterosAfterCuts)
733 ,fh2BBLaPos(copy.fh2BBLaPos)
734 ,fh2BBLaNeg(copy.fh2BBLaPos)
735 ,fh1PosDaughterCharge(copy.fh1PosDaughterCharge)
736 ,fh1NegDaughterCharge(copy.fh1NegDaughterCharge)
737 ,fh1PtMCK0s(copy.fh1PtMCK0s)
738 ,fh1PtMCLa(copy.fh1PtMCLa)
739 ,fh1PtMCALa(copy.fh1PtMCALa)
740 ,fh1EtaK0s(copy.fh1EtaK0s)
741 ,fh1EtaLa(copy.fh1EtaLa)
742 ,fh1EtaALa(copy.fh1EtaALa)
744 ,fh1RCBiasK0(copy.fh1RCBiasK0)
745 ,fh1RCBiasLa(copy.fh1RCBiasLa)
746 ,fh1RCBiasALa(copy.fh1RCBiasALa)
750 ,fhnInvMassEtaTrackPtK0s(copy.fhnInvMassEtaTrackPtK0s)
751 ,fhnInvMassEtaTrackPtLa(copy.fhnInvMassEtaTrackPtLa)
752 ,fhnInvMassEtaTrackPtALa(copy.fhnInvMassEtaTrackPtALa)
753 ,fh1TrackMultCone(copy.fh1TrackMultCone)
754 ,fh2TrackMultCone(copy.fh2TrackMultCone)
755 ,fhnNJK0(copy.fhnNJK0)
756 ,fhnNJLa(copy.fhnNJLa)
757 ,fhnNJALa(copy.fhnNJALa)
758 //,fh2MCgenK0Cone(copy.fh2MCgenK0Cone)
759 //,fh2MCgenLaCone(copy.fh2MCgenLaCone)
760 //,fh2MCgenALaCone(copy.fh2MCgenALaCone)
761 //,fh2MCEtagenK0Cone(copy.fh2MCEtagenK0Cone)
762 //,fh2MCEtagenLaCone(copy.fh2MCEtagenLaCone)
763 //,fh2MCEtagenALaCone(copy.fh2MCEtagenALaCone)
764 ,fh2CorrHijingLaProton(copy.fh2CorrHijingLaProton)
765 ,fh2CorrInjectLaProton(copy.fh2CorrInjectLaProton)
766 ,fh2CorrHijingALaAProton(copy.fh2CorrHijingALaAProton)
767 ,fh2CorrInjectALaAProton(copy.fh2CorrInjectALaAProton)
768 ,fh1IMK0ConeSmear(copy.fh1IMK0ConeSmear)
769 ,fh1IMLaConeSmear(copy.fh1IMLaConeSmear)
770 ,fh1IMALaConeSmear(copy.fh1IMALaConeSmear)
771 ,fh2MCEtaVsPtHijingLa(copy.fh2MCEtaVsPtHijingLa)
772 ,fh2MCEtaVsPtInjectLa(copy.fh2MCEtaVsPtInjectLa)
773 ,fh2MCEtaVsPtHijingALa(copy.fh2MCEtaVsPtHijingALa)
774 ,fh2MCEtaVsPtInjectALa(copy.fh2MCEtaVsPtInjectALa)
775 ,fhnrecMCHijingLaIncl(copy.fhnrecMCHijingLaIncl)
776 ,fhnrecMCHijingLaCone(copy.fhnrecMCHijingLaCone)
777 ,fhnrecMCHijingALaIncl(copy.fhnrecMCHijingALaIncl)
778 ,fhnrecMCHijingALaCone(copy.fhnrecMCHijingALaCone)
779 ,fhnrecMCInjectLaIncl(copy.fhnrecMCInjectLaIncl)
780 ,fhnrecMCInjectLaCone(copy.fhnrecMCInjectLaCone)
781 ,fhnrecMCInjectALaIncl(copy.fhnrecMCInjectALaIncl)
782 ,fhnrecMCInjectALaCone(copy.fhnrecMCInjectALaCone)
783 ,fhnMCrecK0Cone(copy.fhnMCrecK0Cone)
784 ,fhnMCrecLaCone(copy.fhnMCrecLaCone)
785 ,fhnMCrecALaCone(copy.fhnMCrecALaCone)
786 ,fhnMCrecK0ConeSmear(copy.fhnMCrecK0ConeSmear)
787 ,fhnMCrecLaConeSmear(copy.fhnMCrecLaConeSmear)
788 ,fhnMCrecALaConeSmear(copy.fhnMCrecALaConeSmear)
789 ,fhnK0sSecContinCone(copy.fhnK0sSecContinCone)
790 ,fhnLaSecContinCone(copy.fhnLaSecContinCone)
791 ,fhnALaSecContinCone(copy.fhnALaSecContinCone)
792 ,fhnK0sIncl(copy.fhnK0sIncl)
793 ,fhnK0sCone(copy.fhnK0sCone)
794 ,fhnLaIncl(copy.fhnLaIncl)
795 ,fhnLaCone(copy.fhnLaCone)
796 ,fhnALaIncl(copy.fhnALaIncl)
797 ,fhnALaCone(copy.fhnALaCone)
798 ,fhnK0sPC(copy.fhnK0sPC)
799 ,fhnLaPC(copy.fhnLaPC)
800 ,fhnALaPC(copy.fhnALaPC)
801 ,fhnK0sMCC(copy.fhnK0sMCC)
802 ,fhnLaMCC(copy.fhnLaMCC)
803 ,fhnALaMCC(copy.fhnALaMCC)
804 ,fhnK0sRC(copy.fhnK0sRC)
805 ,fhnLaRC(copy.fhnLaRC)
806 ,fhnALaRC(copy.fhnALaRC)
807 ,fhnK0sRCBias(copy.fhnK0sRCBias)
808 ,fhnLaRCBias(copy.fhnLaRCBias)
809 ,fhnALaRCBias(copy.fhnALaRCBias)
810 ,fhnK0sOC(copy.fhnK0sOC)
811 ,fhnLaOC(copy.fhnLaOC)
812 ,fhnALaOC(copy.fhnALaOC)
813 ,fh1AreaExcluded(copy.fh1AreaExcluded)
814 ,fh1MedianEta(copy.fh1MedianEta)
815 ,fh1JetPtMedian(copy.fh1JetPtMedian)
816 ,fh1MCMultiplicityPrimary(copy.fh1MCMultiplicityPrimary)
817 ,fh1MCMultiplicityTracks(copy.fh1MCMultiplicityTracks)
818 ,fhnFeedDownLa(copy.fhnFeedDownLa)
819 ,fhnFeedDownALa(copy.fhnFeedDownALa)
820 ,fhnFeedDownLaCone(copy.fhnFeedDownLaCone)
821 ,fhnFeedDownALaCone(copy.fhnFeedDownALaCone)
822 ,fh1MCProdRadiusK0s(copy.fh1MCProdRadiusK0s)
823 ,fh1MCProdRadiusLambda(copy.fh1MCProdRadiusLambda)
824 ,fh1MCProdRadiusAntiLambda(copy.fh1MCProdRadiusAntiLambda)
825 ,fh1MCPtV0s(copy.fh1MCPtV0s)
826 ,fh1MCPtK0s(copy.fh1MCPtK0s)
827 ,fh1MCPtLambda(copy.fh1MCPtLambda)
828 ,fh1MCPtAntiLambda(copy.fh1MCPtAntiLambda)
829 ,fh1MCXiPt(copy.fh1MCXiPt)
830 ,fh1MCXibarPt(copy.fh1MCXibarPt)
831 ,fh2MCEtaVsPtK0s(copy.fh2MCEtaVsPtK0s)
832 ,fh2MCEtaVsPtLa(copy.fh2MCEtaVsPtLa)
833 ,fh2MCEtaVsPtALa(copy.fh2MCEtaVsPtALa)
834 //,fh1MCRapK0s(copy.fh1MCRapK0s)
835 //,fh1MCRapLambda(copy.fh1MCRapLambda)
836 //,fh1MCRapAntiLambda(copy.fh1MCRapAntiLambda)
837 ,fh1MCEtaAllK0s(copy.fh1MCEtaAllK0s)
838 ,fh1MCEtaK0s(copy.fh1MCEtaK0s)
839 ,fh1MCEtaLambda(copy.fh1MCEtaLambda)
840 ,fh1MCEtaAntiLambda(copy.fh1MCEtaAntiLambda)
847 // _________________________________________________________________________________________________________________________________
848 AliAnalysisTaskJetChem& AliAnalysisTaskJetChem::operator=(const AliAnalysisTaskJetChem& o)
853 AliAnalysisTaskFragmentationFunction::operator=(o);
856 fAnalysisMC = o.fAnalysisMC;
857 fDeltaVertexZ = o.fDeltaVertexZ;
858 fCutjetEta = o.fCutjetEta;
859 fCuttrackNegNcls = o.fCuttrackNegNcls;
860 fCuttrackPosNcls = o.fCuttrackPosNcls;
861 fCutPostrackRap = o.fCutPostrackRap;
862 fCutNegtrackRap = o.fCutNegtrackRap;
864 fCutPostrackEta = o.fCutPostrackEta;
865 fCutNegtrackEta = o.fCutNegtrackEta;
867 fCutV0cosPointAngle = o.fCutV0cosPointAngle;
868 fKinkDaughters = o.fKinkDaughters;
869 fRequireTPCRefit = o.fRequireTPCRefit;
870 fCutArmenteros = o.fCutArmenteros;
871 fCutV0DecayMin = o.fCutV0DecayMin;
872 fCutV0DecayMax = o.fCutV0DecayMax;
873 fCutV0totMom = o.fCutV0totMom;
874 fCutDcaV0Daughters = o.fCutDcaV0Daughters;
875 fCutDcaPosToPrimVertex = o.fCutDcaPosToPrimVertex;
876 fCutDcaNegToPrimVertex = o.fCutDcaNegToPrimVertex;
877 fCutV0RadiusMin = o.fCutV0RadiusMin;
878 fCutV0RadiusMax = o.fCutV0RadiusMax;
879 fCutBetheBloch = o.fCutBetheBloch;
880 fCutRatio = o.fCutRatio;
882 fFilterMaskK0 = o.fFilterMaskK0;
883 jettracklist = o.jettracklist;
884 jetConeK0list = o.jetConeK0list;
885 jetConeLalist = o.jetConeLalist;
886 jetConeALalist = o.jetConeALalist;
887 jetPerpConeK0list = o.jetPerpConeK0list;
888 jetPerpConeLalist = o.jetPerpConeLalist;
889 jetPerpConeALalist = o.jetPerpConeALalist;
890 jetMedianConeK0list = o.jetMedianConeK0list;
891 jetMedianConeLalist = o.jetMedianConeLalist;
892 jetMedianConeALalist = o.jetMedianConeALalist;
893 fListK0sRC = o.fListK0sRC;
894 fListLaRC = o.fListLaRC;
895 fListALaRC = o.fListALaRC;
896 fListK0s = o.fListK0s;
897 fPIDResponse = o.fPIDResponse;
899 fFFHistosRecCutsK0Evt = o.fFFHistosRecCutsK0Evt;
900 //fFFHistosIMK0AllEvt = o.fFFHistosIMK0AllEvt;
901 //fFFHistosIMK0Jet = o.fFFHistosIMK0Jet;
902 //fFFHistosIMK0Cone = o.fFFHistosIMK0Cone;
904 fFilterMaskLa = o.fFilterMaskLa;
906 //fFFHistosIMLaAllEvt = o.fFFHistosIMLaAllEvt;
907 //fFFHistosIMLaJet = o.fFFHistosIMLaJet;
908 //fFFHistosIMLaCone = o.fFFHistosIMLaCone;
909 fALaType = o.fALaType;
910 fFilterMaskALa = o.fFilterMaskALa;
911 fListFeeddownLaCand = o.fListFeeddownLaCand;
912 fListFeeddownALaCand = o.fListFeeddownALaCand;
913 jetConeFDLalist = o.jetConeFDLalist;
914 jetConeFDALalist = o.jetConeFDALalist;
915 fListMCgenK0s = o.fListMCgenK0s;
916 fListMCgenLa = o.fListMCgenLa;
917 fListMCgenALa = o.fListMCgenALa;
918 fListMCgenK0sCone = o.fListMCgenK0sCone;
919 fListMCgenLaCone = o.fListMCgenLaCone;
920 fListMCgenALaCone = o.fListMCgenALaCone;
921 IsArmenterosSelected = o.IsArmenterosSelected;
922 // fFFHistosIMALaAllEvt = o.fFFHistosIMALaAllEvt;
923 // fFFHistosIMALaJet = o.fFFHistosIMALaJet;
924 // fFFHistosIMALaCone = o.fFFHistosIMALaCone;
925 fFFIMNBinsJetPt = o.fFFIMNBinsJetPt;
926 fFFIMJetPtMin = o.fFFIMJetPtMin;
927 fFFIMJetPtMax = o.fFFIMJetPtMax;
928 fFFIMNBinsPt = o.fFFIMNBinsPt;
929 fFFIMPtMin = o.fFFIMPtMin;
930 fFFIMPtMax = o.fFFIMPtMax;
931 fFFIMNBinsXi = o.fFFIMNBinsXi;
932 fFFIMXiMin = o.fFFIMXiMin;
933 fFFIMXiMax = o.fFFIMXiMax;
934 fFFIMNBinsZ = o.fFFIMNBinsZ;
935 fFFIMZMin = o.fFFIMZMin;
936 fFFIMZMax = o.fFFIMZMax;
937 fFFIMLaNBinsJetPt = o.fFFIMLaNBinsJetPt;
938 fFFIMLaJetPtMin = o.fFFIMLaJetPtMin;
939 fFFIMLaJetPtMax = o.fFFIMLaJetPtMax;
940 fFFIMLaNBinsPt = o.fFFIMLaNBinsPt;
941 fFFIMLaPtMin = o.fFFIMLaPtMin;
942 fFFIMLaPtMax = o.fFFIMLaPtMax;
943 fFFIMLaNBinsXi = o.fFFIMLaNBinsXi;
944 fFFIMLaXiMin = o.fFFIMLaXiMin;
945 fFFIMLaXiMax = o.fFFIMLaXiMax;
946 fFFIMLaNBinsZ = o.fFFIMLaNBinsZ;
947 fFFIMLaZMin = o.fFFIMLaZMin;
948 fFFIMLaZMax = o.fFFIMLaZMax;
949 fh1EvtAllCent = o.fh1EvtAllCent;
951 fh1K0Mult = o.fh1K0Mult;
952 fh1dPhiJetK0 = o.fh1dPhiJetK0;
953 fh1LaMult = o.fh1LaMult;
954 fh1dPhiJetLa = o.fh1dPhiJetLa;
955 fh1ALaMult = o.fh1ALaMult;
956 fh1dPhiJetALa = o.fh1dPhiJetALa;
957 fh1JetEta = o.fh1JetEta;
958 fh1JetPhi = o.fh1JetPhi;
959 fh2JetEtaPhi = o.fh2JetEtaPhi;
960 //fh1V0JetPt = o.fh1V0JetPt;
961 fh1IMK0Cone = o.fh1IMK0Cone;
962 fh1IMLaCone = o.fh1IMLaCone;
963 fh1IMALaCone = o.fh1IMALaCone;
964 fh2FFJetTrackEta = o.fh2FFJetTrackEta;
965 //fh1trackPosNCls = o.fh1trackPosNCls;
966 //fh1trackNegNCls = o.fh1trackNegNCls;
967 fh1trackPosRap = o.fh1trackPosRap;
968 fh1trackNegRap = o.fh1trackNegRap;
969 //fh1V0Rap = o.fh1V0Rap;
970 fh1trackPosEta = o.fh1trackPosEta;
971 fh1trackNegEta = o.fh1trackNegEta;
972 fh1V0Eta = o.fh1V0Eta;
973 // fh1V0totMom = o.fh1V0totMom;
974 fh1CosPointAngle = o.fh1CosPointAngle;
975 fh1DecayLengthV0 = o.fh1DecayLengthV0;
976 fh2ProperLifetimeK0sVsPtBeforeCut = o.fh2ProperLifetimeK0sVsPtBeforeCut;
977 fh2ProperLifetimeK0sVsPtAfterCut= o.fh2ProperLifetimeK0sVsPtAfterCut;
978 fh1V0Radius = o.fh1V0Radius;
979 fh1DcaV0Daughters = o.fh1DcaV0Daughters;
980 fh1DcaPosToPrimVertex = o.fh1DcaPosToPrimVertex;
981 fh1DcaNegToPrimVertex = o.fh1DcaNegToPrimVertex;
982 fh2ArmenterosBeforeCuts = o.fh2ArmenterosBeforeCuts;
983 fh2ArmenterosAfterCuts = o.fh2ArmenterosAfterCuts;
984 fh2BBLaPos = o.fh2BBLaPos;
985 fh2BBLaNeg = o.fh2BBLaPos;
986 fh1PosDaughterCharge = o.fh1PosDaughterCharge;
987 fh1NegDaughterCharge = o.fh1NegDaughterCharge;
988 fh1PtMCK0s = o.fh1PtMCK0s;
989 fh1PtMCLa = o.fh1PtMCLa;
990 fh1PtMCALa = o.fh1PtMCALa;
991 fh1EtaK0s = o.fh1EtaK0s;
992 fh1EtaLa = o.fh1EtaLa;
993 fh1EtaALa = o.fh1EtaALa;
995 fh1RCBiasK0 = o.fh1RCBiasK0;
996 fh1RCBiasLa = o.fh1RCBiasLa;
997 fh1RCBiasALa = o.fh1RCBiasALa;
1001 fhnInvMassEtaTrackPtK0s = o.fhnInvMassEtaTrackPtK0s;
1002 fhnInvMassEtaTrackPtLa = o.fhnInvMassEtaTrackPtLa;
1003 fhnInvMassEtaTrackPtALa = o.fhnInvMassEtaTrackPtALa;
1004 fh1TrackMultCone = o.fh1TrackMultCone;
1005 fh2TrackMultCone = o.fh2TrackMultCone;
1006 fhnNJK0 = o.fhnNJK0;
1007 fhnNJLa = o.fhnNJLa;
1008 fhnNJALa = o.fhnNJALa;
1009 //fh2MCgenK0Cone = o.fh2MCgenK0Cone;
1010 //fh2MCgenLaCone = o.fh2MCgenLaCone;
1011 //fh2MCgenALaCone = o.fh2MCgenALaCone;
1012 //fh2MCEtagenK0Cone = o.fh2MCEtagenK0Cone;
1013 //fh2MCEtagenLaCone = o.fh2MCEtagenLaCone;
1014 //fh2MCEtagenALaCone = o.fh2MCEtagenALaCone;
1015 fh1IMK0ConeSmear = o.fh1IMK0ConeSmear;
1016 fh1IMLaConeSmear = o.fh1IMLaConeSmear;
1017 fh1IMALaConeSmear = o.fh1IMALaConeSmear;
1018 fh2MCEtaVsPtHijingLa = o.fh2MCEtaVsPtHijingLa;
1019 fh2MCEtaVsPtInjectLa = o.fh2MCEtaVsPtInjectLa;
1020 fh2MCEtaVsPtHijingALa = o.fh2MCEtaVsPtHijingALa;
1021 fh2MCEtaVsPtInjectALa = o.fh2MCEtaVsPtInjectALa;
1022 fhnrecMCHijingLaIncl = o.fhnrecMCHijingLaIncl;
1023 fhnrecMCHijingLaCone = o.fhnrecMCHijingLaCone;
1024 fhnrecMCHijingALaIncl = o.fhnrecMCHijingALaIncl;
1025 fhnrecMCHijingALaCone = o.fhnrecMCHijingALaCone;
1026 fhnrecMCInjectLaIncl = o.fhnrecMCInjectLaIncl;
1027 fhnrecMCInjectLaCone = o.fhnrecMCInjectLaCone;
1028 fhnrecMCInjectALaIncl = o.fhnrecMCInjectALaIncl;
1029 fhnrecMCInjectALaCone = o.fhnrecMCInjectALaCone;
1030 fhnMCrecK0Cone = o.fhnMCrecK0Cone;
1031 fhnMCrecLaCone = o.fhnMCrecLaCone;
1032 fhnMCrecALaCone = o.fhnMCrecALaCone;
1033 fhnMCrecK0ConeSmear = o.fhnMCrecK0ConeSmear;
1034 fhnMCrecLaConeSmear = o.fhnMCrecLaConeSmear;
1035 fhnMCrecALaConeSmear = o.fhnMCrecALaConeSmear;
1036 fhnK0sSecContinCone = o.fhnK0sSecContinCone;
1037 fhnLaSecContinCone = o.fhnLaSecContinCone;
1038 fhnALaSecContinCone = o.fhnALaSecContinCone;
1039 fhnK0sIncl = o.fhnK0sIncl;
1040 fhnK0sCone = o.fhnK0sCone;
1041 fhnLaIncl = o.fhnLaIncl;
1042 fhnLaCone = o.fhnLaCone;
1043 fhnALaIncl = o.fhnALaIncl;
1044 fhnALaCone = o.fhnALaCone;
1045 fhnK0sPC = o.fhnK0sPC;
1046 fhnLaPC = o.fhnLaPC;
1047 fhnALaPC = o.fhnALaPC;
1048 fhnK0sRC = o.fhnK0sRC;
1049 fhnLaRC = o.fhnLaRC;
1050 fhnALaRC = o.fhnALaRC;
1051 fhnK0sRCBias = o.fhnK0sRCBias;
1052 fhnLaRCBias = o.fhnLaRCBias;
1053 fhnALaRCBias = o.fhnALaRCBias;
1054 fhnK0sOC = o.fhnK0sOC;
1055 fhnLaOC = o.fhnLaOC;
1056 fhnALaOC = o.fhnALaOC;
1057 fh1AreaExcluded = o.fh1AreaExcluded;
1058 fh1MedianEta = o.fh1MedianEta;
1059 fh1JetPtMedian = o.fh1JetPtMedian;
1060 fh1MCMultiplicityPrimary = o.fh1MCMultiplicityPrimary;
1061 fh1MCMultiplicityTracks = o.fh1MCMultiplicityTracks;
1062 fhnFeedDownLa = o.fhnFeedDownLa;
1063 fhnFeedDownALa = o.fhnFeedDownALa;
1064 fhnFeedDownLaCone = o.fhnFeedDownLaCone;
1065 fhnFeedDownALaCone = o.fhnFeedDownALaCone;
1066 fh1MCProdRadiusK0s = o.fh1MCProdRadiusK0s;
1067 fh1MCProdRadiusLambda = o.fh1MCProdRadiusLambda;
1068 fh1MCProdRadiusAntiLambda = o.fh1MCProdRadiusAntiLambda;
1069 fh1MCPtV0s = o.fh1MCPtV0s;
1070 fh1MCPtK0s = o.fh1MCPtK0s;
1071 fh1MCPtLambda = o.fh1MCPtLambda;
1072 fh1MCPtAntiLambda = o.fh1MCPtAntiLambda;
1073 fh1MCXiPt = o.fh1MCXiPt;
1074 fh1MCXibarPt = o.fh1MCXibarPt;
1075 fh2MCEtaVsPtK0s = o.fh2MCEtaVsPtK0s;
1076 fh2MCEtaVsPtLa = o.fh2MCEtaVsPtLa;
1077 fh2MCEtaVsPtALa = o.fh2MCEtaVsPtALa;
1078 //fh1MCRapK0s = o.fh1MCRapK0s;
1079 //fh1MCRapLambda = o.fh1MCRapLambda;
1080 //fh1MCRapAntiLambda = o.fh1MCRapAntiLambda;
1081 fh1MCEtaAllK0s = o.fh1MCEtaAllK0s;
1082 fh1MCEtaK0s = o.fh1MCEtaK0s;
1083 fh1MCEtaLambda = o.fh1MCEtaLambda;
1084 fh1MCEtaAntiLambda = o.fh1MCEtaAntiLambda;
1090 //_______________________________________________
1091 AliAnalysisTaskJetChem::~AliAnalysisTaskJetChem()
1095 if(jettracklist) delete jettracklist;
1096 if(jetConeK0list) delete jetConeK0list;
1097 if(jetConeLalist) delete jetConeLalist;
1098 if(jetConeALalist) delete jetConeALalist;
1099 if(jetPerpConeK0list) delete jetPerpConeK0list;
1100 if(jetPerpConeLalist) delete jetPerpConeLalist;
1101 if(jetPerpConeALalist) delete jetPerpConeALalist;
1102 if(jetMedianConeK0list) delete jetMedianConeK0list;
1103 if(jetMedianConeLalist) delete jetMedianConeLalist;
1104 if(jetMedianConeALalist) delete jetMedianConeALalist;
1105 if(fListK0sRC) delete fListK0sRC;
1106 if(fListLaRC) delete fListLaRC;
1107 if(fListALaRC) delete fListALaRC;
1108 if(fListK0s) delete fListK0s;
1109 if(fListLa) delete fListLa;
1110 if(fListALa) delete fListALa;
1111 if(fListFeeddownLaCand) delete fListFeeddownLaCand;
1112 if(fListFeeddownALaCand) delete fListFeeddownALaCand;
1113 if(jetConeFDLalist) delete jetConeFDLalist;
1114 if(jetConeFDALalist) delete jetConeFDALalist;
1115 if(fListMCgenK0s) delete fListMCgenK0s;
1116 if(fListMCgenLa) delete fListMCgenLa;
1117 if(fListMCgenALa) delete fListMCgenALa;
1118 if(fListMCgenK0sCone) delete fListMCgenK0sCone;
1119 if(fListMCgenLaCone) delete fListMCgenLaCone;
1120 if(fListMCgenALaCone) delete fListMCgenALaCone;
1121 if(fRandom) delete fRandom;
1124 //________________________________________________________________________________________________________________________________
1125 AliAnalysisTaskJetChem::AliFragFuncHistosInvMass::AliFragFuncHistosInvMass(const char* name,
1126 Int_t nJetPt, Float_t jetPtMin, Float_t jetPtMax,
1127 Int_t nInvMass, Float_t invMassMin, Float_t invMassMax,
1128 Int_t nPt, Float_t ptMin, Float_t ptMax,
1129 Int_t nXi, Float_t xiMin, Float_t xiMax,
1130 Int_t nZ , Float_t zMin , Float_t zMax )
1132 ,fNBinsJetPt(nJetPt)
1133 ,fJetPtMin(jetPtMin)
1134 ,fJetPtMax(jetPtMax)
1135 ,fNBinsInvMass(nInvMass)
1136 ,fInvMassMin(invMassMin)
1137 ,fInvMassMax(invMassMax)
1153 // default constructor
1157 //______________________________________________________________________________________________________________
1158 AliAnalysisTaskJetChem::AliFragFuncHistosInvMass::AliFragFuncHistosInvMass(const AliFragFuncHistosInvMass& copy)
1160 ,fNBinsJetPt(copy.fNBinsJetPt)
1161 ,fJetPtMin(copy.fJetPtMin)
1162 ,fJetPtMax(copy.fJetPtMax)
1163 ,fNBinsInvMass(copy.fNBinsInvMass)
1164 ,fInvMassMin(copy.fInvMassMin)
1165 ,fInvMassMax(copy.fInvMassMax)
1166 ,fNBinsPt(copy.fNBinsPt)
1167 ,fPtMin(copy.fPtMin)
1168 ,fPtMax(copy.fPtMax)
1169 ,fNBinsXi(copy.fNBinsXi)
1170 ,fXiMin(copy.fXiMin)
1171 ,fXiMax(copy.fXiMax)
1172 ,fNBinsZ(copy.fNBinsZ)
1175 ,fh3TrackPt(copy.fh3TrackPt)
1178 ,fh1JetPt(copy.fh1JetPt)
1179 ,fNameFF(copy.fNameFF)
1184 //______________________________________________________________________________________________________________________________________________________________________
1185 AliAnalysisTaskJetChem::AliFragFuncHistosInvMass& AliAnalysisTaskJetChem::AliFragFuncHistosInvMass::operator=(const AliAnalysisTaskJetChem::AliFragFuncHistosInvMass& o)
1190 TObject::operator=(o);
1191 fNBinsJetPt = o.fNBinsJetPt;
1192 fJetPtMin = o.fJetPtMin;
1193 fJetPtMax = o.fJetPtMax;
1194 fNBinsInvMass = o.fNBinsInvMass;
1195 fInvMassMin = o.fInvMassMin;
1196 fInvMassMax = o.fInvMassMax;
1197 fNBinsPt = o.fNBinsPt;
1200 fNBinsXi = o.fNBinsXi;
1203 fNBinsZ = o.fNBinsZ;
1206 fh3TrackPt = o.fh3TrackPt;
1209 fh1JetPt = o.fh1JetPt;
1210 fNameFF = o.fNameFF;
1216 //___________________________________________________________________________
1217 AliAnalysisTaskJetChem::AliFragFuncHistosInvMass::~AliFragFuncHistosInvMass()
1221 if(fh1JetPt) delete fh1JetPt;
1222 if(fh3TrackPt) delete fh3TrackPt;
1223 if(fh3Xi) delete fh3Xi;
1224 if(fh3Z) delete fh3Z;
1227 //_________________________________________________________________
1228 void AliAnalysisTaskJetChem::AliFragFuncHistosInvMass::DefineHistos()
1232 fh1JetPt = new TH1F(Form("fh1FFJetPtIM%s", fNameFF.Data()),"",fNBinsJetPt,fJetPtMin,fJetPtMax);
1233 fh3TrackPt = new TH3F(Form("fh3FFTrackPtIM%s",fNameFF.Data()),"",fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsInvMass, fInvMassMin, fInvMassMax, fNBinsPt, fPtMin, fPtMax);
1234 fh3Xi = new TH3F(Form("fh3FFXiIM%s", fNameFF.Data()),"", fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsInvMass, fInvMassMin, fInvMassMax, fNBinsXi, fXiMin, fXiMax);
1235 fh3Z = new TH3F(Form("fh3FFZIM%s", fNameFF.Data()),"", fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsInvMass, fInvMassMin, fInvMassMax, fNBinsZ, fZMin, fZMax);
1237 AliAnalysisTaskFragmentationFunction::SetProperties(fh1JetPt, "p_{t} (GeV/c)", "entries");
1238 AliAnalysisTaskJetChem::SetProperties(fh3TrackPt,"jet p_{t} (GeV/c)","inv Mass (GeV/c^2)","p_{t} (GeV/c)");
1239 AliAnalysisTaskJetChem::SetProperties(fh3Xi,"jet p_{t} (GeV/c)","inv Mass (GeV/c^2)","#xi");
1240 AliAnalysisTaskJetChem::SetProperties(fh3Z,"jet p_{t} (GeV/c)","inv Mass (GeV/c^2)","z");
1243 //________________________________________________________________________________________________________________________________
1244 void AliAnalysisTaskJetChem::AliFragFuncHistosInvMass::FillFF(Float_t trackPt, Float_t invM, Float_t jetPt, Bool_t incrementJetPt)
1246 // fill FF, don't use TH3F anymore use THnSparse instead to save memory
1248 if(incrementJetPt) fh1JetPt->Fill(jetPt);
1249 //fh3TrackPt->Fill(jetPt,invM,trackPt);//Fill(x,y,z)
1252 if(jetPt>0) z = trackPt / jetPt;
1254 //if(z>0) xi = TMath::Log(1/z);
1256 //fh3Xi->Fill(jetPt,invM,xi);
1257 //fh3Z->Fill(jetPt,invM,z);
1260 //___________________________________________________________________________________
1261 void AliAnalysisTaskJetChem::AliFragFuncHistosInvMass::AddToOutput(TList* list) const
1263 // add histos to list
1265 list->Add(fh1JetPt);
1266 //list->Add(fh3TrackPt);
1272 //____________________________________________________
1273 void AliAnalysisTaskJetChem::UserCreateOutputObjects()
1275 // create output objects
1277 fRandom = new TRandom3(0);
1278 fRandom->SetSeed(0);
1280 if(fDebug > 1) Printf("AliAnalysisTaskJetChem::UserCreateOutputObjects()");
1282 // create list of tracks and jets
1283 jettracklist = new TList();
1284 jettracklist->SetOwner(kFALSE);
1285 jetConeK0list = new TList();
1286 jetConeK0list->SetOwner(kFALSE);
1287 jetConeLalist = new TList();
1288 jetConeLalist->SetOwner(kFALSE);
1289 jetConeALalist = new TList();
1290 jetConeALalist->SetOwner(kFALSE);
1291 jetPerpConeK0list = new TList();
1292 jetPerpConeK0list->SetOwner(kFALSE);
1293 jetPerpConeLalist = new TList();
1294 jetPerpConeLalist->SetOwner(kFALSE);
1295 jetPerpConeALalist = new TList();
1296 jetPerpConeALalist->SetOwner(kFALSE);
1297 jetMedianConeK0list = new TList();
1298 jetMedianConeK0list->SetOwner(kFALSE);
1299 jetMedianConeLalist = new TList();
1300 jetMedianConeLalist->SetOwner(kFALSE);
1301 jetMedianConeALalist = new TList();
1302 jetMedianConeALalist->SetOwner(kFALSE);
1303 fListK0sRC = new TList();
1304 fListK0sRC->SetOwner(kFALSE);
1305 fListLaRC = new TList();
1306 fListLaRC->SetOwner(kFALSE);
1307 fListALaRC = new TList();
1308 fListALaRC->SetOwner(kFALSE);
1309 fTracksRecCuts = new TList();
1310 fTracksRecCuts->SetOwner(kFALSE); //objects in TList wont be deleted when TList is deleted
1311 fJetsRecCuts = new TList();
1312 fJetsRecCuts->SetOwner(kFALSE);
1313 fBckgJetsRec = new TList();
1314 fBckgJetsRec->SetOwner(kFALSE);
1315 fListK0s = new TList();
1316 fListK0s->SetOwner(kFALSE);
1317 fListLa = new TList();
1318 fListLa->SetOwner(kFALSE);
1319 fListALa = new TList();
1320 fListALa->SetOwner(kFALSE);
1321 fListFeeddownLaCand = new TList(); //feeddown Lambda candidates
1322 fListFeeddownLaCand->SetOwner(kFALSE);
1323 fListFeeddownALaCand = new TList(); //feeddown Antilambda candidates
1324 fListFeeddownALaCand->SetOwner(kFALSE);
1325 jetConeFDLalist = new TList();
1326 jetConeFDLalist->SetOwner(kFALSE); //feeddown Lambda candidates in jet cone
1327 jetConeFDALalist = new TList();
1328 jetConeFDALalist->SetOwner(kFALSE); //feeddown Antilambda candidates in jet cone
1329 fListMCgenK0s = new TList(); //MC generated K0s
1330 fListMCgenK0s->SetOwner(kFALSE);
1331 fListMCgenLa = new TList(); //MC generated Lambdas
1332 fListMCgenLa->SetOwner(kFALSE);
1333 fListMCgenALa = new TList(); //MC generated Antilambdas
1334 fListMCgenALa->SetOwner(kFALSE);
1335 fListMCgenK0sCone = new TList();
1336 fListMCgenK0sCone->SetOwner(kFALSE);
1337 fListMCgenLaCone = new TList();
1338 fListMCgenLaCone->SetOwner(kFALSE);
1339 fListMCgenALaCone = new TList();
1340 fListMCgenALaCone->SetOwner(kFALSE);
1342 // Create histograms / output container
1344 fCommonHistList = new TList();
1345 fCommonHistList->SetOwner();
1347 Bool_t oldStatus = TH1::AddDirectoryStatus();
1348 TH1::AddDirectory(kFALSE);//By default (fAddDirectory = kTRUE), histograms are automatically added to the list of objects in memory
1350 // histograms inherited from AliAnalysisTaskFragmentationFunction
1352 fh1EvtSelection = new TH1F("fh1EvtSelection", "Event Selection", 6, -0.5, 5.5);
1353 fh1EvtSelection->GetXaxis()->SetBinLabel(1,"ACCEPTED");
1354 fh1EvtSelection->GetXaxis()->SetBinLabel(2,"event trigger selection: rejected");
1355 fh1EvtSelection->GetXaxis()->SetBinLabel(3,"event class: rejected");
1356 fh1EvtSelection->GetXaxis()->SetBinLabel(4,"vertex Ncontr: rejected");
1357 fh1EvtSelection->GetXaxis()->SetBinLabel(5,"vertex z: rejected");
1358 fh1EvtSelection->GetXaxis()->SetBinLabel(6,"vertex type: rejected");
1361 fh1EvtCent = new TH1F("fh1EvtCent","centrality",100,0.,100.);
1362 fh1VertexNContributors = new TH1F("fh1VertexNContributors", "Vertex N contributors", 11,-.5, 10.5);
1363 fh1VertexZ = new TH1F("fh1VertexZ", "Vertex z distribution", 30, -15., 15.);
1364 fh1Xsec = new TProfile("fh1Xsec","xsec from pyxsec.root",1,0,1);
1365 fh1Xsec->GetXaxis()->SetBinLabel(1,"<#sigma>");
1366 fh1Trials = new TH1F("fh1Trials","trials from pyxsec.root",1,0,1);
1367 fh1Trials->GetXaxis()->SetBinLabel(1,"#sum{ntrials}");
1368 fh1PtHard = new TH1F("fh1PtHard","PYTHIA Pt hard;p_{T,hard}",350,-.5,349.5);
1369 fh1PtHardTrials = new TH1F("fh1PtHardTrials","PYTHIA Pt hard weight with trials;p_{T,hard}",350,-.5,349.5);
1370 fh1nRecJetsCuts = new TH1F("fh1nRecJetsCuts","reconstructed jets per event",100,-0.5,99.5);
1372 // histograms JetChem task
1374 fh1EvtAllCent = new TH1F("fh1EvtAllCent","before centrality selection",100,0.,100.);
1375 fh1Evt = new TH1F("fh1Evt", "All events runned over", 3, 0.,1.);
1376 fh1EvtMult = new TH1F("fh1EvtMult","multiplicity",240,0.,240.);
1377 fh1K0Mult = new TH1F("fh1K0Mult","K0 multiplicity",100,0.,100.);//500. all
1378 fh1dPhiJetK0 = new TH1F("fh1dPhiJetK0","",64,-1,5.4);
1379 fh1LaMult = new TH1F("fh1LaMult","La multiplicity",100,0.,100.);
1380 fh1dPhiJetLa = new TH1F("fh1dPhiJetLa","",64,-1,5.4);
1381 fh1ALaMult = new TH1F("fh1ALaMult","ALa multiplicity",100,0.,100.);
1382 fh1dPhiJetALa = new TH1F("fh1dPhiJetALa","",64,-1,5.4);
1383 fh1JetEta = new TH1F("fh1JetEta","#eta distribution of all jets",40,-2.,2.);
1384 fh1JetPhi = new TH1F("fh1JetPhi","#phi distribution of all jets",63,0.,6.3);
1385 fh2JetEtaPhi = new TH2F("fh2JetEtaPhi","#eta and #phi distribution of all jets",400,-2.,2.,63,0.,6.3);
1388 //fh1V0JetPt = new TH1F("fh1V0JetPt","p_{T} distribution of all jets containing v0s",200,0.,200.);
1389 fh1IMK0Cone = new TH1F("fh1IMK0Cone","p_{T} distribution of all jets containing K0s candidates",19,5.,100.);
1390 fh1IMLaCone = new TH1F("fh1IMLaCone","p_{T} distribution of all jets containing #Lambda candidates",19,5.,100.);
1391 fh1IMALaCone = new TH1F("fh1IMALaCone","p_{T} distribution of all jets containing #bar{#Lambda} candidates",19,5.,100.);
1393 fh2FFJetTrackEta = new TH2F("fh2FFJetTrackEta","charged track eta distr. in jet cone",200,-1.,1.,40,0.,200.);
1394 //fh1trackPosNCls = new TH1F("fh1trackPosNCls","NTPC clusters positive daughters",10,0.,100.);
1395 //fh1trackNegNCls = new TH1F("fh1trackNegNCls","NTPC clusters negative daughters",10,0.,100.);
1396 fh1trackPosEta = new TH1F("fh1trackPosEta","eta positive daughters",100,-2.,2.);
1397 fh1trackNegEta = new TH1F("fh1trackNegEta","eta negative daughters",100,-2.,2.);
1398 fh1V0Eta = new TH1F("fh1V0Eta","V0 eta",60,-1.5,1.5);
1399 //fh1V0totMom = new TH1F("fh1V0totMom","V0 tot mom",100,0.,20.);
1400 fh1CosPointAngle = new TH1F("fh1CosPointAngle", "Cosine of V0's pointing angle",50,0.99,1.0);
1401 fh1DecayLengthV0 = new TH1F("fh1DecayLengthV0", "V0s decay Length;decay length(cm)",1200,0.,120.);
1402 fh2ProperLifetimeK0sVsPtBeforeCut = new TH2F("fh2ProperLifetimeK0sVsPtBeforeCut"," K0s ProperLifetime vs Pt; p_{T} (GeV/#it{c})",150,0.,15.,250,0.,250.);
1403 fh2ProperLifetimeK0sVsPtAfterCut = new TH2F("fh2ProperLifetimeK0sVsPtAfterCut"," K0s ProperLifetime vs Pt; p_{T} (GeV/#it{c})",150,0.,15.,250,0.,250.);
1404 fh1V0Radius = new TH1F("fh1V0Radius", "V0s Radius;Radius(cm)",200,0.,40.);
1405 fh1DcaV0Daughters = new TH1F("fh1DcaV0Daughters", "DCA between daughters;dca(cm)",200,0.,2.);
1406 fh1DcaPosToPrimVertex = new TH1F("fh1DcaPosToPrimVertex", "Positive V0 daughter;dca(cm)",100,0.,10.);
1407 fh1DcaNegToPrimVertex = new TH1F("fh1DcaNegToPrimVertex", "Negative V0 daughter;dca(cm)",100,0.,10.);
1408 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);
1409 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);
1410 fh2BBLaPos = new TH2F("fh2BBLaPos","PID of the positive daughter of La candidates; P (GeV); -dE/dx (keV/cm ?)",100,0,10,200,0,200);
1411 fh2BBLaNeg = new TH2F("fh2BBLaNeg","PID of the negative daughter of La candidates; P (GeV); -dE/dx (keV/cm ?)",100,0,10,200,0,200);
1412 fh1PosDaughterCharge = new TH1F("fh1PosDaughterCharge","charge of V0 positive daughters; V0 daughters",3,-2.,2.);
1413 fh1NegDaughterCharge = new TH1F("fh1NegDaughterCharge","charge of V0 negative daughters; V0 daughters",3,-2.,2.);
1414 fh1PtMCK0s = new TH1F("fh1PtMCK0s","Pt of MC rec K0s; #it{p}_{T} (GeV/#it{c})",200,0.,20.);
1415 fh1PtMCLa = new TH1F("fh1PtMCLa","Pt of MC rec La; #it{p}_{T} (GeV/#it{c})",200,0.,20.);
1416 fh1PtMCALa = new TH1F("fh1PtMCALa","Pt of MC rec ALa; #it{p}_{T} (GeV/#it{c})",200,0.,20.);
1417 fh1EtaK0s = new TH1F("fh1EtaK0s","K^{0}_{s} entries ;#eta",200,-1.,1.);
1418 fh1EtaLa = new TH1F("fh1EtaLa","#Lambda entries ;#eta",200,-1.,1.);
1419 fh1EtaALa = new TH1F("fh1EtaALa","#bar{#Lambda} entries ;#eta",200,-1.,1.);
1421 //histos for normalisation of MCC, RC, OC and NJ
1423 fh1RC = new TH1F("fh1RC"," # random cones used",1,0.5,1.5);
1424 fh1RCBiasK0 = new TH1F("fh1RCBiasK0"," # random cones with K0s trigger particle",1,0.5,1.5);
1425 fh1RCBiasLa = new TH1F("fh1RCBiasLa"," # random cones with La trigger particle",1,0.5,1.5);
1426 fh1RCBiasALa = new TH1F("fh1RCBiasALa"," # random cones with ALa trigger particle",1,0.5,1.5);
1427 fh1MCC = new TH1F("fh1MCC","# median cluster cones used",1,0.5,1.5);
1428 fh1OC = new TH1F("fh1OC","# outside cones used, number of jet events",1,0.5,1.5);
1429 fh1NJ = new TH1F("fh1NJ","# non-jet events used",1,0.5,1.5);
1431 Int_t binsInvMassEtaTrackPtK0s[3] = {200, 200, 120};//eta,invM,trackPt
1432 Double_t xminInvMassEtaTrackPtK0s[3] = {-1.,0.3,0.};
1433 Double_t xmaxInvMassEtaTrackPtK0s[3] = {1.,0.7,12.};
1435 fhnInvMassEtaTrackPtK0s = new THnSparseF("fhnInvMassEtaTrackPtK0s","#eta; K0s invM (GeV/{#it{c}}^{2}); #it{p}_{T} (GeV/#it{c})",3,binsInvMassEtaTrackPtK0s,xminInvMassEtaTrackPtK0s,xmaxInvMassEtaTrackPtK0s);
1437 Int_t binsInvMassEtaTrackPtLa[3] = {200, 200, 120};//eta,invM,trackPt
1438 Double_t xminInvMassEtaTrackPtLa[3] = {-1.,1.05,0.};
1439 Double_t xmaxInvMassEtaTrackPtLa[3] = {1.,1.25,12.};
1441 fhnInvMassEtaTrackPtLa = new THnSparseF("fhnInvMassEtaTrackPtLa","#eta; #Lambda invM (GeV/{#it{c}}^{2}); #it{p}_{T} (GeV/#it{c})",3,binsInvMassEtaTrackPtLa,xminInvMassEtaTrackPtLa,xmaxInvMassEtaTrackPtLa);
1443 Int_t binsInvMassEtaTrackPtALa[3] = {200, 200, 120};//eta,invM,trackPt
1444 Double_t xminInvMassEtaTrackPtALa[3] = {-1.,1.05,0.};
1445 Double_t xmaxInvMassEtaTrackPtALa[3] = {1.,1.25,12.};
1447 fhnInvMassEtaTrackPtALa = new THnSparseF("fhnInvMassEtaTrackPtALa","#eta; #bar{#Lambda} invM (GeV/{#it{c}}^{2}); #it{p}_{T} (GeV/#it{c})",3,binsInvMassEtaTrackPtALa,xminInvMassEtaTrackPtALa,xmaxInvMassEtaTrackPtALa);
1449 Int_t binsK0sPC[4] = {19, 200, 120, 200};
1450 Double_t xminK0sPC[4] = {5.,0.3, 0., -1.};
1451 Double_t xmaxK0sPC[4] = {100.,0.7, 12., 1.};
1452 fhnK0sPC = new THnSparseF("fhnK0sPC","jet pT; K0s invM; particle pT; particle #eta",4,binsK0sPC,xminK0sPC,xmaxK0sPC);
1454 Int_t binsLaPC[4] = {19, 200, 120, 200};
1455 Double_t xminLaPC[4] = {5.,1.05, 0., -1.};
1456 Double_t xmaxLaPC[4] = {100.,1.25, 12., 1.};
1457 fhnLaPC = new THnSparseF("fhnLaPC","jet pT; #Lambda invM; particle pT; particle #eta",4,binsLaPC,xminLaPC,xmaxLaPC);
1459 Int_t binsALaPC[4] = {19, 200, 120, 200};
1460 Double_t xminALaPC[4] = {5.,1.05, 0., -1.};
1461 Double_t xmaxALaPC[4] = {100.,1.25, 12., 1.};
1462 fhnALaPC = new THnSparseF("fhnALaPC","jet pT; #bar#Lambda invM; particle pT; particle #eta",4,binsALaPC,xminALaPC,xmaxALaPC);
1464 Int_t binsK0sMCC[3] = {200, 120, 200};
1465 Double_t xminK0sMCC[3] = {0.3, 0., -1.};
1466 Double_t xmaxK0sMCC[3] = {0.7, 12., 1.};
1467 fhnK0sMCC = new THnSparseF("fhnK0sMCC","jet pT; K0s invM; particle pT; particle #eta",3,binsK0sMCC,xminK0sMCC,xmaxK0sMCC);
1469 Int_t binsLaMCC[3] = {200, 120, 200};
1470 Double_t xminLaMCC[3] = {1.05, 0., -1.};
1471 Double_t xmaxLaMCC[3] = {1.25, 12., 1.};
1472 fhnLaMCC = new THnSparseF("fhnLaMCC","jet pT; #Lambda invM; particle pT; particle #eta",3,binsLaMCC,xminLaMCC,xmaxLaMCC);
1474 Int_t binsALaMCC[3] = {200, 120, 200};
1475 Double_t xminALaMCC[3] = {1.05, 0., -1.};
1476 Double_t xmaxALaMCC[3] = {1.25, 12., 1.};
1477 fhnALaMCC = new THnSparseF("fhnALaMCC","jet pT; #bara#Lambda invM; particle pT; particle #eta",3,binsALaMCC,xminALaMCC,xmaxALaMCC);
1479 Int_t binsK0sRC[3] = {200, 120, 200};
1480 Double_t xminK0sRC[3] = {0.3, 0., -1.};
1481 Double_t xmaxK0sRC[3] = {0.7, 12., 1.};
1482 fhnK0sRC = new THnSparseF("fhnK0sRC","jet pT; K0s invM; particle pT; particle #eta",3,binsK0sRC,xminK0sRC,xmaxK0sRC);
1484 Int_t binsLaRC[3] = {200, 120, 200};
1485 Double_t xminLaRC[3] = {1.05, 0., -1.};
1486 Double_t xmaxLaRC[3] = {1.25, 12., 1.};
1487 fhnLaRC = new THnSparseF("fhnLaRC","jet pT; #Lambda invM; particle pT; particle #eta",3,binsLaRC,xminLaRC,xmaxLaRC);
1489 Int_t binsALaRC[3] = {200, 120, 200};
1490 Double_t xminALaRC[3] = {1.05, 0., -1.};
1491 Double_t xmaxALaRC[3] = {1.25, 12., 1.};
1492 fhnALaRC = new THnSparseF("fhnALaRC","jet pT; #bara#Lambda invM; particle pT; particle #eta",3,binsALaRC,xminALaRC,xmaxALaRC);
1494 Int_t binsK0sRCBias[3] = {200, 120, 200};
1495 Double_t xminK0sRCBias[3] = {0.3, 0., -1.};
1496 Double_t xmaxK0sRCBias[3] = {0.7, 12., 1.};
1497 fhnK0sRCBias = new THnSparseF("fhnK0sRCBias","jet pT; K0s invM; particle pT; particle #eta",3,binsK0sRCBias,xminK0sRCBias,xmaxK0sRCBias);
1499 Int_t binsLaRCBias[3] = {200, 120, 200};
1500 Double_t xminLaRCBias[3] = {1.05, 0., -1.};
1501 Double_t xmaxLaRCBias[3] = {1.25, 12., 1.};
1502 fhnLaRCBias = new THnSparseF("fhnLaRCBias","jet pT; #Lambda invM; particle pT; particle #eta",3,binsLaRCBias,xminLaRCBias,xmaxLaRCBias);
1504 Int_t binsALaRCBias[3] = {200, 120, 200};
1505 Double_t xminALaRCBias[3] = {1.05, 0., -1.};
1506 Double_t xmaxALaRCBias[3] = {1.25, 12., 1.};
1507 fhnALaRCBias = new THnSparseF("fhnALaRCBias","jet pT; #bara#Lambda invM; particle pT; particle #eta",3,binsALaRCBias,xminALaRCBias,xmaxALaRCBias);
1509 Int_t binsK0sOC[3] = {200, 120, 200};
1510 Double_t xminK0sOC[3] = {0.3, 0., -1.};
1511 Double_t xmaxK0sOC[3] = {0.7, 12., 1.};
1512 fhnK0sOC = new THnSparseF("fhnK0sOC","jet pT; K0s invM; particle pT; particle #eta",3,binsK0sOC,xminK0sOC,xmaxK0sOC);
1514 Int_t binsLaOC[3] = {200, 120, 200};
1515 Double_t xminLaOC[3] = {1.05, 0., -1.};
1516 Double_t xmaxLaOC[3] = {1.25, 12., 1.};
1517 fhnLaOC = new THnSparseF("fhnLaOC","jet pT; #Lambda invM; particle pT; particle #eta",3,binsLaOC,xminLaOC,xmaxLaOC);
1519 Int_t binsALaOC[3] = {200, 120, 200};
1520 Double_t xminALaOC[3] = {1.05, 0., -1.};
1521 Double_t xmaxALaOC[3] = {1.25, 12., 1.};
1523 fhnALaOC = new THnSparseF("fhnALaOC","jet pT; #bara#Lambda invM; particle pT; particle #eta",3,binsALaOC,xminALaOC,xmaxALaOC);
1525 fh1AreaExcluded = new TH1F("fh1AreaExcluded","area excluded for selected jets in event acceptance",50,0.,1.);
1527 fh1MedianEta = new TH1F("fh1MedianEta","Median cluster axis ;#eta",200,-1.,1.);
1528 fh1JetPtMedian = new TH1F("fh1JetPtMedian"," (selected) jet it{p}_{T} distribution for MCC method; #GeV/it{c}",19,5.,100.);
1530 fh1TrackMultCone = new TH1F("fh1TrackMultCone","track multiplicity in jet cone; number of tracks",20,0.,50.);
1532 fh2TrackMultCone = new TH2F("fh2TrackMultCone","track multiplicity in jet cone vs. jet momentum; number of tracks; jet it{p}_{T} (GeV/it{c})",50,0.,50.,19,5.,100.);
1534 Int_t binsNJK0[3] = {200, 120, 200};
1535 Double_t xminNJK0[3] = {0.3, 0., -1.};
1536 Double_t xmaxNJK0[3] = {0.7, 12., 1.};
1537 fhnNJK0 = new THnSparseF("fhnNJK0","K0s candidates in events wo selected jets;",3,binsNJK0,xminNJK0,xmaxNJK0);
1539 Int_t binsNJLa[3] = {200, 120, 200};
1540 Double_t xminNJLa[3] = {1.05, 0., -1.};
1541 Double_t xmaxNJLa[3] = {1.25, 12., 1.};
1542 fhnNJLa = new THnSparseF("fhnNJLa","La candidates in events wo selected jets; ",3,binsNJLa,xminNJLa,xmaxNJLa);
1544 Int_t binsNJALa[3] = {200, 120, 200};
1545 Double_t xminNJALa[3] = {1.05, 0., -1.};
1546 Double_t xmaxNJALa[3] = {1.25, 12., 1.};
1547 fhnNJALa = new THnSparseF("fhnNJALa","ALa candidates in events wo selected jets; ",3,binsNJALa,xminNJALa,xmaxNJALa);
1549 fFFHistosRecCuts = new AliFragFuncHistos("RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax,
1550 fFFNBinsPt, fFFPtMin, fFFPtMax,
1551 fFFNBinsXi, fFFXiMin, fFFXiMax,
1552 fFFNBinsZ , fFFZMin , fFFZMax);
1554 fV0QAK0 = new AliFragFuncQATrackHistos("V0QAK0",fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax,
1555 fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
1556 fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax,
1557 fQATrackHighPtThreshold);
1559 fFFHistosRecCutsK0Evt = new AliFragFuncHistos("RecCutsK0Evt", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax,
1560 fFFNBinsPt, fFFPtMin, fFFPtMax,
1561 fFFNBinsXi, fFFXiMin, fFFXiMax,
1562 fFFNBinsZ , fFFZMin , fFFZMax);
1565 fFFHistosIMK0AllEvt = new AliFragFuncHistosInvMass("K0AllEvt", fFFIMNBinsJetPt, fFFIMJetPtMin, fFFIMJetPtMax,
1566 fFFIMNBinsInvM,fFFIMInvMMin,fFFIMInvMMax,
1567 fFFIMNBinsPt, fFFIMPtMin, fFFIMPtMax,
1568 fFFIMNBinsXi, fFFIMXiMin, fFFIMXiMax,
1569 fFFIMNBinsZ , fFFIMZMin , fFFIMZMax);
1571 fFFHistosIMK0Jet = new AliFragFuncHistosInvMass("K0Jet", fFFIMNBinsJetPt, fFFIMJetPtMin, fFFIMJetPtMax,
1572 fFFIMNBinsInvM,fFFIMInvMMin,fFFIMInvMMax,
1573 fFFIMNBinsPt, fFFIMPtMin, fFFIMPtMax,
1574 fFFIMNBinsXi, fFFIMXiMin, fFFIMXiMax,
1575 fFFIMNBinsZ , fFFIMZMin , fFFIMZMax);
1577 fFFHistosIMK0Cone = new AliFragFuncHistosInvMass("K0Cone", fFFIMNBinsJetPt, fFFIMJetPtMin, fFFIMJetPtMax,
1578 fFFIMNBinsInvM,fFFIMInvMMin,fFFIMInvMMax,
1579 fFFIMNBinsPt, fFFIMPtMin, fFFIMPtMax,
1580 fFFIMNBinsXi, fFFIMXiMin, fFFIMXiMax,
1581 fFFIMNBinsZ , fFFIMZMin , fFFIMZMax);
1583 fFFHistosIMLaAllEvt = new AliFragFuncHistosInvMass("LaAllEvt", fFFIMLaNBinsJetPt, fFFIMLaJetPtMin, fFFIMLaJetPtMax,
1584 fFFIMLaNBinsInvM,fFFIMLaInvMMin,fFFIMLaInvMMax,
1585 fFFIMLaNBinsPt, fFFIMLaPtMin, fFFIMLaPtMax,
1586 fFFIMLaNBinsXi, fFFIMLaXiMin, fFFIMLaXiMax,
1587 fFFIMLaNBinsZ , fFFIMLaZMin , fFFIMLaZMax);
1589 fFFHistosIMLaJet = new AliFragFuncHistosInvMass("LaJet", fFFIMLaNBinsJetPt, fFFIMLaJetPtMin, fFFIMLaJetPtMax,
1590 fFFIMLaNBinsInvM,fFFIMLaInvMMin,fFFIMLaInvMMax,
1591 fFFIMLaNBinsPt, fFFIMLaPtMin, fFFIMLaPtMax,
1592 fFFIMLaNBinsXi, fFFIMLaXiMin, fFFIMLaXiMax,
1593 fFFIMLaNBinsZ , fFFIMLaZMin , fFFIMLaZMax);
1596 fFFHistosIMLaCone = new AliFragFuncHistosInvMass("LaCone", fFFIMLaNBinsJetPt, fFFIMLaJetPtMin, fFFIMLaJetPtMax,
1597 fFFIMLaNBinsInvM,fFFIMLaInvMMin,fFFIMLaInvMMax,
1598 fFFIMLaNBinsPt, fFFIMLaPtMin, fFFIMLaPtMax,
1599 fFFIMLaNBinsXi, fFFIMLaXiMin, fFFIMLaXiMax,
1600 fFFIMLaNBinsZ , fFFIMLaZMin , fFFIMLaZMax);
1603 fFFHistosIMALaAllEvt = new AliFragFuncHistosInvMass("ALaAllEvt", fFFIMLaNBinsJetPt, fFFIMLaJetPtMin, fFFIMLaJetPtMax,
1604 fFFIMLaNBinsInvM,fFFIMLaInvMMin,fFFIMLaInvMMax,
1605 fFFIMLaNBinsPt, fFFIMLaPtMin, fFFIMLaPtMax,
1606 fFFIMLaNBinsXi, fFFIMLaXiMin, fFFIMLaXiMax,
1607 fFFIMLaNBinsZ , fFFIMLaZMin , fFFIMLaZMax);
1609 fFFHistosIMALaJet = new AliFragFuncHistosInvMass("ALaJet", fFFIMLaNBinsJetPt, fFFIMLaJetPtMin, fFFIMLaJetPtMax,
1610 fFFIMLaNBinsInvM,fFFIMLaInvMMin,fFFIMLaInvMMax,
1611 fFFIMLaNBinsPt, fFFIMLaPtMin, fFFIMLaPtMax,
1612 fFFIMLaNBinsXi, fFFIMLaXiMin, fFFIMLaXiMax,
1613 fFFIMLaNBinsZ , fFFIMLaZMin , fFFIMLaZMax);
1615 fFFHistosIMALaCone = new AliFragFuncHistosInvMass("ALaCone", fFFIMLaNBinsJetPt, fFFIMLaJetPtMin, fFFIMLaJetPtMax,
1616 fFFIMLaNBinsInvM,fFFIMLaInvMMin,fFFIMLaInvMMax,
1617 fFFIMLaNBinsPt, fFFIMLaPtMin, fFFIMLaPtMax,
1618 fFFIMLaNBinsXi, fFFIMLaXiMin, fFFIMLaXiMax,
1619 fFFIMLaNBinsZ , fFFIMLaZMin , fFFIMLaZMax);
1626 //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}",19,5.,100.,200,0.,20.);
1627 //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}",19,5.,100.,200,0.,20.);
1628 //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}",19,5.,100.,200,0.,20.);
1630 //fh2MCgenK0Cone->GetYaxis()->SetTitle("MC gen K^{0}}^{s} #it{p}_{T}");
1631 //fh2MCgenLaCone->GetYaxis()->SetTitle("MC gen #Lambda #it{p}_{T}");
1632 //fh2MCgenALaCone->GetYaxis()->SetTitle("MC gen #Antilambda #it{p}_{T}");
1634 //fh2MCEtagenK0Cone = new TH2F("fh2MCEtagenK0Cone","MC gen {K^{0}}^{s} #it{p}_{T} #eta distribution in jet cone;#eta",19,5.,100.,200,-1.,1.);
1635 //fh2MCEtagenLaCone = new TH2F("fh2MCEtagenLaCone","MC gen #Lambda #it{p}_{T} #eta distribution in jet cone;#eta",19,5.,100.,200,-1.,1.);
1636 //fh2MCEtagenALaCone = new TH2F("fh2MCEtagenALaCone","MC gen #Antilambda #it{p}_{T} #eta distribution in jet cone;#eta",19,5.,100.,200,-1.,1.);
1637 fh1IMK0ConeSmear = new TH1F("fh1IMK0ConeSmear","Smeared jet pt study for K0s-in-cone-jets; smeared jet #it{p}_{T}", 19,5.,100.);
1638 fh1IMLaConeSmear = new TH1F("fh1IMLaConeSmear","Smeared jet pt study for La-in-cone-jets; smeared jet #it{p}_{T}", 19,5.,100.);
1639 fh1IMALaConeSmear = new TH1F("fh1IMALaConeSmear","Smeared jet pt study for ALa-in-cone-jets; smeared jet #it{p}_{T}", 19,5.,100.);
1641 fh2CorrHijingLaProton = new TH2F("fh2CorrHijingLaProton","#Lambda - proton pT correlation, Hijing;#it{p^{#Lambda}}_{T} (GeV/c);#it{p^{proton}}_{T} (GeV/c)",120,0.,12.,120,0.,12.);
1642 fh2CorrInjectLaProton = new TH2F("fh2CorrInjectLaProton","#Lambda - proton pT correlation, Injected;#it{p^{#Lambda}}_{T} (GeV/c);#it{p^{proton}}_{T} (GeV/c)",120,0.,12.,120,0.,12.);
1643 fh2CorrHijingALaAProton = new TH2F("fh2CorrHijingALaAProton","#bar{#Lambda} - proton pT correlation, Hijing;#it{p^{#Lambda}}_{T} (GeV/c);#it{p^{#bar{proton}}}_{T} (GeV/c)",120,0.,12.,120,0.,12.);
1644 fh2CorrInjectALaAProton = new TH2F("fh2CorrInjectALaAProton","#bar{#Lambda} - proton pT correlation, Injected;#it{p^{#Lambda}}_{T} (GeV/c);#it{p^{#bar{proton}}}_{T} (GeV/c)",120,0.,12.,120,0.,12.);
1645 //12 new histograms: Cone, Incl, Lambda, Antilambda, Hijing, Injected:
1647 fh2MCEtaVsPtHijingLa = new TH2F("fh2MCEtaVsPtHijingLa","MC Hijing gen. #Lambda #eta; #it{p}_{T}",200,0.,20.,200,-1.,1.);
1648 fh2MCEtaVsPtInjectLa = new TH2F("fh2MCEtaVsPtInjectLa","MC injected gen. #Lambda #eta; #it{p}_{T}",200,0.,20.,200,-1.,1.);
1649 fh2MCEtaVsPtHijingALa = new TH2F("fh2MCEtaVsPtHijingALa","MC gen. Hijing #bar{#Lambda} #eta; #it{p}_{T}",200,0.,20.,200,-1.,1.);
1650 fh2MCEtaVsPtInjectALa = new TH2F("fh2MCEtaVsPtInjectALa","MC gen. injected #bar{#Lambda} #eta; #it{p}_{T}",200,0.,20.,200,-1.,1.);
1652 Int_t binsrecMCHijingLaIncl[3] = {200, 120, 200};
1653 Double_t xminrecMCHijingLaIncl[3] = {1.05, 0., -1.};
1654 Double_t xmaxrecMCHijingLaIncl[3] = {1.25, 12., 1.};
1655 fhnrecMCHijingLaIncl = new THnSparseF("fhnrecMCHijingLaIncl","La inv. mass; particle pT; particle #eta",3,binsrecMCHijingLaIncl,xminrecMCHijingLaIncl,xmaxrecMCHijingLaIncl);
1657 Int_t binsrecMCHijingLaCone[4] = {19, 200, 120, 200};
1658 Double_t xminrecMCHijingLaCone[4] = {5., 1.05, 0., -1.};
1659 Double_t xmaxrecMCHijingLaCone[4] = {100., 1.25, 12., 1.};
1660 fhnrecMCHijingLaCone = new THnSparseF("fhnrecMCHijingLaCone","La inv. mass; particle pT; particle #eta",4,binsrecMCHijingLaCone,xminrecMCHijingLaCone,xmaxrecMCHijingLaCone);
1662 Int_t binsrecMCHijingALaIncl[3] = {200, 120, 200};
1663 Double_t xminrecMCHijingALaIncl[3] = {1.05, 0., -1.};
1664 Double_t xmaxrecMCHijingALaIncl[3] = {1.25, 12., 1.};
1665 fhnrecMCHijingALaIncl = new THnSparseF("fhnrecMCHijingALaIncl","ALa inv. mass; particle pT; particle #eta",3,binsrecMCHijingALaIncl,xminrecMCHijingALaIncl,xmaxrecMCHijingALaIncl);
1667 Int_t binsrecMCHijingALaCone[4] = {19, 200, 120, 200};
1668 Double_t xminrecMCHijingALaCone[4] = {5., 1.05, 0., -1.};
1669 Double_t xmaxrecMCHijingALaCone[4] = {100., 1.25, 12., 1.};
1670 fhnrecMCHijingALaCone = new THnSparseF("fhnrecMCHijingALaCone","ALa inv. mass; particle pT; particle #eta",4,binsrecMCHijingALaCone,xminrecMCHijingALaCone,xmaxrecMCHijingALaCone);
1672 Int_t binsrecMCInjectLaIncl[3] = {200, 120, 200};
1673 Double_t xminrecMCInjectLaIncl[3] = {1.05, 0., -1.};
1674 Double_t xmaxrecMCInjectLaIncl[3] = {1.25, 12., 1.};
1675 fhnrecMCInjectLaIncl = new THnSparseF("fhnrecMCInjectLaIncl","La inv. mass; particle pT; particle #eta",3,binsrecMCInjectLaIncl,xminrecMCInjectLaIncl,xmaxrecMCInjectLaIncl);
1677 Int_t binsrecMCInjectLaCone[4] = {19, 200, 120, 200};
1678 Double_t xminrecMCInjectLaCone[4] = {5., 1.05, 0., -1.};
1679 Double_t xmaxrecMCInjectLaCone[4] = {100., 1.25, 12., 1.};
1680 fhnrecMCInjectLaCone = new THnSparseF("fhnrecMCInjectLaCone","La jet pT;inv. mass; particle pT; particle #eta",4,binsrecMCInjectLaCone,xminrecMCInjectLaCone,xmaxrecMCInjectLaCone);
1682 Int_t binsrecMCInjectALaIncl[3] = {200, 120, 200};
1683 Double_t xminrecMCInjectALaIncl[3] = {1.05, 0., -1.};
1684 Double_t xmaxrecMCInjectALaIncl[3] = {1.25, 12., 1.};
1685 fhnrecMCInjectALaIncl = new THnSparseF("fhnrecMCInjectALaIncl","ALa inv. mass; particle pT; particle #eta",3,binsrecMCInjectALaIncl,xminrecMCInjectALaIncl,xmaxrecMCInjectALaIncl);
1687 Int_t binsrecMCInjectALaCone[4] = {19, 200, 120, 200};
1688 Double_t xminrecMCInjectALaCone[4] = {5., 1.05, 0., -1.};
1689 Double_t xmaxrecMCInjectALaCone[4] = {100., 1.25, 12., 1.};
1690 fhnrecMCInjectALaCone = new THnSparseF("fhnrecMCInjectALaCone","ALa inv. mass; particle pT; particle #eta",4,binsrecMCInjectALaCone,xminrecMCInjectALaCone,xmaxrecMCInjectALaCone);
1693 Int_t binsMCrecK0Cone[4] = {19, 200, 120, 200};
1694 Double_t xminMCrecK0Cone[4] = {5.,0.3, 0., -1.};
1695 Double_t xmaxMCrecK0Cone[4] = {100.,0.7, 12., 1.};
1696 fhnMCrecK0Cone = new THnSparseF("fhnMCrecK0Cone", "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}",4,binsMCrecK0Cone,xminMCrecK0Cone,xmaxMCrecK0Cone);
1698 Int_t binsMCrecLaCone[4] = {19, 200, 120, 200};
1699 Double_t xminMCrecLaCone[4] = {5.,0.3, 0., -1.};
1700 Double_t xmaxMCrecLaCone[4] = {100.,0.7, 12., 1.};
1701 fhnMCrecLaCone = new THnSparseF("fhnMCrecLaCone", "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}",4,binsMCrecLaCone,xminMCrecLaCone,xmaxMCrecLaCone);
1703 Int_t binsMCrecALaCone[4] = {19, 200, 120, 200};
1704 Double_t xminMCrecALaCone[4] = {5.,0.3, 0., -1.};
1705 Double_t xmaxMCrecALaCone[4] = {100.,0.7, 12., 1.};
1706 fhnMCrecALaCone = new THnSparseF("fhnMCrecALaCone", "MC rec {#bar{#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}",4,binsMCrecALaCone,xminMCrecALaCone,xmaxMCrecALaCone);
1708 Int_t binsMCrecK0ConeSmear[4] = {19, 200, 120, 200};
1709 Double_t xminMCrecK0ConeSmear[4] = {5.,0.3, 0., -1.};
1710 Double_t xmaxMCrecK0ConeSmear[4] = {100.,0.7, 12., 1.};
1711 fhnMCrecK0ConeSmear = new THnSparseF("fhnMCrecK0ConeSmear", "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}",4,binsMCrecK0ConeSmear,xminMCrecK0ConeSmear,xmaxMCrecK0ConeSmear);
1713 Int_t binsMCrecLaConeSmear[4] = {19, 200, 120, 200};
1714 Double_t xminMCrecLaConeSmear[4] = {5.,1.05, 0., -1.};
1715 Double_t xmaxMCrecLaConeSmear[4] = {100.,1.25, 12., 1.};
1716 fhnMCrecLaConeSmear = new THnSparseF("fhnMCrecLaConeSmear", "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}",4,binsMCrecLaConeSmear,xminMCrecLaConeSmear,xmaxMCrecLaConeSmear);
1718 Int_t binsMCrecALaConeSmear[4] = {19, 200, 120, 200};
1719 Double_t xminMCrecALaConeSmear[4] = {5.,1.05, 0., -1.};
1720 Double_t xmaxMCrecALaConeSmear[4] = {100.,1.25, 12., 1.};
1721 fhnMCrecALaConeSmear = new THnSparseF("fhnMCrecALaConeSmear", "MC rec {#bar{#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}",4,binsMCrecALaConeSmear,xminMCrecALaConeSmear,xmaxMCrecALaConeSmear);
1723 Int_t binsK0sSecContinCone[3] = {19, 120, 200};
1724 Double_t xminK0sSecContinCone[3] = {5.,0., -1.};
1725 Double_t xmaxK0sSecContinCone[3] = {100.,12., 1.};
1726 fhnK0sSecContinCone = new THnSparseF("fhnK0sSecContinCone", "Secondary contamination {K^{0}}^{s} #it{p}_{T} in cone around jet axis; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2};#it{p}_{T}",3,binsK0sSecContinCone,xminK0sSecContinCone,xmaxK0sSecContinCone);
1728 Int_t binsLaSecContinCone[3] = {19, 120, 200};
1729 Double_t xminLaSecContinCone[3] = {5.,0., -1.};
1730 Double_t xmaxLaSecContinCone[3] = {100.,12., 1.};
1731 fhnLaSecContinCone = new THnSparseF("fhnLaSecContinCone", "Secondary contamination {#Lambda #it{p}_{T} in cone around jet axis; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2};#it{p}_{T}",3,binsLaSecContinCone,xminLaSecContinCone,xmaxLaSecContinCone);
1733 Int_t binsALaSecContinCone[3] = {19, 120, 200};
1734 Double_t xminALaSecContinCone[3] = {5.,0., -1.};
1735 Double_t xmaxALaSecContinCone[3] = {100.,12., 1.};
1736 fhnALaSecContinCone = new THnSparseF("fhnALaSecContinCone", "Secondary contamination {#bar{#Lambda} #it{p}_{T} in cone around jet axis; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2};#it{p}_{T}",3,binsALaSecContinCone,xminALaSecContinCone,xmaxALaSecContinCone);
1738 Int_t binsK0sIncl[3] = {200, 120, 200};
1739 Double_t xminK0sIncl[3] = {0.3, 0., -1.};
1740 Double_t xmaxK0sIncl[3] = {0.7, 12., 1.};
1741 fhnK0sIncl = new THnSparseF("fhnK0sIncl","K0s inv. mass; particle pT; particle #eta",3,binsK0sIncl,xminK0sIncl,xmaxK0sIncl);
1743 Int_t binsK0sCone[4] = {19, 200, 120, 200};
1744 Double_t xminK0sCone[4] = {5.,0.3, 0., -1.};
1745 Double_t xmaxK0sCone[4] = {100.,0.7, 12., 1.};
1746 fhnK0sCone = new THnSparseF("fhnK0sCone","jet pT; K0s inv. mass; particle pT; particle #eta",4,binsK0sCone,xminK0sCone,xmaxK0sCone);
1748 Int_t binsLaIncl[3] = {200, 120, 200};
1749 Double_t xminLaIncl[3] = {1.05, 0., -1.};
1750 Double_t xmaxLaIncl[3] = {1.25, 12., 1.};
1751 fhnLaIncl = new THnSparseF("fhnLaIncl","La inv. mass; particle pT; particle #eta",3,binsLaIncl,xminLaIncl,xmaxLaIncl);
1753 Int_t binsLaCone[4] = {19, 200, 120, 200};
1754 Double_t xminLaCone[4] = {5.,1.05, 0., -1.};
1755 Double_t xmaxLaCone[4] = {100.,1.25, 12., 1.};
1756 fhnLaCone = new THnSparseF("fhnLaCone","jet pT; La inv. mass; particle pT; particle #eta",4,binsLaCone,xminLaCone,xmaxLaCone);
1758 Int_t binsALaIncl[3] = {200, 120, 200};
1759 Double_t xminALaIncl[3] = {1.05, 0., -1.};
1760 Double_t xmaxALaIncl[3] = {1.25, 12., 1.};
1761 fhnALaIncl = new THnSparseF("fhnALaIncl","ALa inv. mass; particle pT; particle #eta",3,binsALaIncl,xminALaIncl,xmaxALaIncl);
1763 Int_t binsALaCone[4] = {19, 200, 120, 200};
1764 Double_t xminALaCone[4] = {5.,1.05, 0., -1.};
1765 Double_t xmaxALaCone[4] = {100.,1.25, 12., 1.};
1766 fhnALaCone = new THnSparseF("fhnALaCone","jet pT; ALa inv. mass; particle pT; particle #eta",4,binsALaCone,xminALaCone,xmaxALaCone);
1768 fh1MCMultiplicityPrimary = new TH1F("fh1MCMultiplicityPrimary", "MC Primary Particles;NPrimary;Count", 201, -0.5, 200.5);
1769 fh1MCMultiplicityTracks = new TH1F("h1MCMultiplicityTracks", "MC Tracks;Ntracks;Count", 201, -0.5, 200.5);
1772 Int_t binsFeedDownLa[3] = {19, 200, 120};
1773 Double_t xminFeedDownLa[3] = {5.,1.05, 0.};
1774 Double_t xmaxFeedDownLa[3] = {100.,1.25, 12.};
1775 fhnFeedDownLa = new THnSparseF("fhnFeedDownLa","#Lambda stemming from feeddown from Xi(0/-)",3,binsFeedDownLa,xminFeedDownLa,xmaxFeedDownLa);
1777 Int_t binsFeedDownALa[3] = {19, 200, 120};
1778 Double_t xminFeedDownALa[3] = {5.,1.05, 0.};
1779 Double_t xmaxFeedDownALa[3] = {100.,1.25, 12.};
1780 fhnFeedDownALa = new THnSparseF("fhnFeedDownALa","#bar#Lambda stemming from feeddown from Xibar(0/+)",3,binsFeedDownALa,xminFeedDownALa,xmaxFeedDownALa);
1782 Int_t binsFeedDownLaCone[3] = {19, 200, 120};
1783 Double_t xminFeedDownLaCone[3] = {5.,1.05, 0.};
1784 Double_t xmaxFeedDownLaCone[3] = {100.,1.25, 12.};
1785 fhnFeedDownLaCone = new THnSparseF("fhnFeedDownLaCone","#Lambda stemming from feeddown from Xi(0/-) in jet cone",3,binsFeedDownLaCone,xminFeedDownLaCone,xmaxFeedDownLaCone);
1787 Int_t binsFeedDownALaCone[3] = {19, 200, 120};
1788 Double_t xminFeedDownALaCone[3] = {5.,1.05, 0.};
1789 Double_t xmaxFeedDownALaCone[3] = {100.,1.25, 12.};
1790 fhnFeedDownALaCone = new THnSparseF("fhnFeedDownALaCone","#bar#Lambda stemming from feeddown from Xibar(0/+) in jet cone",3,binsFeedDownALaCone,xminFeedDownALaCone,xmaxFeedDownALaCone);
1793 fh1MCProdRadiusK0s = new TH1F("fh1MCProdRadiusK0s","MC gen. MC K0s prod radius",100,0.,100.);
1794 fh1MCProdRadiusLambda = new TH1F("fh1MCProdRadiusLambda","MC gen. MC La prod radius",100,0.,100.);
1795 fh1MCProdRadiusAntiLambda = new TH1F("fh1MCProdRadiusAntiLambda","MC gen. MC ALa prod radius",100,0.,100.);
1797 // Pt and inv mass distributions
1799 fh1MCPtV0s = new TH1F("fh1MCPtV0s", "MC gen. V^{0} in rap range;#it{p}_{T} (GeV/#it{c})",120,0,12.);// 0.1 GeV/c steps
1800 fh1MCPtK0s = new TH1F("fh1MCPtK0s", "MC gen. K^{0}_{s} in eta range;#it{p}_{T} (GeV/#it{c})",120,0.,12.);
1801 fh1MCPtLambda = new TH1F("fh1MCPtLambda", "MC gen. #Lambda in rap range;#it{p}_{T} (GeV/#it{c})",120,0.,12.);
1802 fh1MCPtAntiLambda = new TH1F("fh1MCPtAntiLambda", "MC gen. #AntiLambda in rap range;#it{p}_{T} (GeV/#it{c})",120,0.,12.);
1803 fh1MCXiPt = new TH1F("fh1MCXiPt", "MC gen. #Xi^{-/o};#it{p}_{T} (GeV/#it{c})",120,0.,12.);
1804 fh1MCXibarPt = new TH1F("fh1MCXibarPt", "MC gen. #bar{#Xi}^{+/o};#it{p}_{T} (GeV/#it{c})",120,0.,12.);
1805 fh2MCEtaVsPtK0s = new TH2F("fh2MCEtaVsPtK0s","MC gen. K^{0}_{s} #eta; #it{p}_{T}",120,0.,12.,200,-1.,1.);
1806 fh2MCEtaVsPtLa = new TH2F("fh2MCEtaVsPtLa","MC gen. #Lambda #eta; #it{p}_{T}",120,0.,12.,200,-1.,1.);
1807 fh2MCEtaVsPtALa = new TH2F("fh2MCEtaVsPtALa","MC gen. #bar{#Lambda} #eta; #it{p}_{T}",120,0.,12.,200,-1.,1.);
1810 //fh1MCRapK0s = new TH1F("fh1MCRapK0s", "MC gen. K0s;rap with cut",200,-10,10);
1811 //fh1MCRapLambda = new TH1F("fh1MCRapLambda", "MC gen. #Lambda;rap",200,-10,10);
1812 //fh1MCRapAntiLambda = new TH1F("fh1MCRapAntiLambda", "MC gen. #bar{#Lambda};rap",200,-10,10);
1813 fh1MCEtaAllK0s = new TH1F("fh1MCEtaAllK0s", "MC gen. K0s;#eta",200,-1.,1.);
1814 fh1MCEtaK0s = new TH1F("fh1MCEtaK0s", "MC gen. K0s;#eta with cut",200,-1.,1.);
1815 fh1MCEtaLambda = new TH1F("fh1MCEtaLambda", "MC gen. #Lambda;#eta",200,-1.,1.);
1816 fh1MCEtaAntiLambda = new TH1F("fh1MCEtaAntiLambda", "MC gen. #bar{#Lambda};#eta",200,-1.,1.);
1818 fV0QAK0->DefineHistos();
1819 fFFHistosRecCuts->DefineHistos();
1820 fFFHistosRecCutsK0Evt->DefineHistos();
1821 /* fFFHistosIMK0AllEvt->DefineHistos();
1822 fFFHistosIMK0Jet->DefineHistos();
1823 fFFHistosIMK0Cone->DefineHistos();
1824 fFFHistosIMLaAllEvt->DefineHistos();
1825 fFFHistosIMLaJet->DefineHistos();
1826 fFFHistosIMLaCone->DefineHistos();
1827 fFFHistosIMALaAllEvt->DefineHistos();
1828 fFFHistosIMALaJet->DefineHistos();
1829 fFFHistosIMALaCone->DefineHistos();
1832 const Int_t saveLevel = 5;
1835 fCommonHistList->Add(fh1EvtAllCent);
1836 fCommonHistList->Add(fh1Evt);
1837 fCommonHistList->Add(fh1EvtSelection);
1838 fCommonHistList->Add(fh1EvtCent);
1839 fCommonHistList->Add(fh1VertexNContributors);
1840 fCommonHistList->Add(fh1VertexZ);
1841 fCommonHistList->Add(fh1Xsec);
1842 fCommonHistList->Add(fh1Trials);
1843 fCommonHistList->Add(fh1PtHard);
1844 fCommonHistList->Add(fh1PtHardTrials);
1845 fCommonHistList->Add(fh1nRecJetsCuts);
1846 fCommonHistList->Add(fh1EvtMult);
1847 fCommonHistList->Add(fh1K0Mult);
1848 fCommonHistList->Add(fh1dPhiJetK0);
1849 fCommonHistList->Add(fh1LaMult);
1850 fCommonHistList->Add(fh1dPhiJetLa);
1851 fCommonHistList->Add(fh1ALaMult);
1852 fCommonHistList->Add(fh1dPhiJetALa);
1853 fCommonHistList->Add(fh1JetEta);
1854 fCommonHistList->Add(fh1JetPhi);
1855 fCommonHistList->Add(fh2JetEtaPhi);
1856 //fCommonHistList->Add(fh1V0JetPt);
1857 fCommonHistList->Add(fh1IMK0Cone);
1858 fCommonHistList->Add(fh1IMLaCone);
1859 fCommonHistList->Add(fh1IMALaCone);
1860 fCommonHistList->Add(fh2FFJetTrackEta);
1861 // fCommonHistList->Add(fh1trackPosNCls);
1862 //fCommonHistList->Add(fh1trackNegNCls);
1863 fCommonHistList->Add(fh1trackPosEta);
1864 fCommonHistList->Add(fh1trackNegEta);
1865 fCommonHistList->Add(fh1V0Eta);
1866 // fCommonHistList->Add(fh1V0totMom);
1867 fCommonHistList->Add(fh1CosPointAngle);
1868 fCommonHistList->Add(fh1DecayLengthV0);
1869 fCommonHistList->Add(fh2ProperLifetimeK0sVsPtBeforeCut);
1870 fCommonHistList->Add(fh2ProperLifetimeK0sVsPtAfterCut);
1871 fCommonHistList->Add(fh1V0Radius);
1872 fCommonHistList->Add(fh1DcaV0Daughters);
1873 fCommonHistList->Add(fh1DcaPosToPrimVertex);
1874 fCommonHistList->Add(fh1DcaNegToPrimVertex);
1875 fCommonHistList->Add(fh2ArmenterosBeforeCuts);
1876 fCommonHistList->Add(fh2ArmenterosAfterCuts);
1877 fCommonHistList->Add(fh2BBLaPos);
1878 fCommonHistList->Add(fh2BBLaNeg);
1879 fCommonHistList->Add(fh1PosDaughterCharge);
1880 fCommonHistList->Add(fh1NegDaughterCharge);
1881 fCommonHistList->Add(fh1PtMCK0s);
1882 fCommonHistList->Add(fh1PtMCLa);
1883 fCommonHistList->Add(fh1PtMCALa);
1884 fCommonHistList->Add(fh1EtaK0s);
1885 fCommonHistList->Add(fh1EtaLa);
1886 fCommonHistList->Add(fh1EtaALa);
1887 fCommonHistList->Add(fh1RC);
1888 fCommonHistList->Add(fh1RCBiasK0);
1889 fCommonHistList->Add(fh1RCBiasLa);
1890 fCommonHistList->Add(fh1RCBiasALa);
1891 fCommonHistList->Add(fh1MCC);
1892 fCommonHistList->Add(fh1OC);
1893 fCommonHistList->Add(fh1NJ);
1894 fCommonHistList->Add(fhnInvMassEtaTrackPtK0s);
1895 fCommonHistList->Add(fhnInvMassEtaTrackPtLa);
1896 fCommonHistList->Add(fhnInvMassEtaTrackPtALa);
1897 fCommonHistList->Add(fh1TrackMultCone);
1898 fCommonHistList->Add(fh2TrackMultCone);
1899 fCommonHistList->Add(fhnNJK0);
1900 fCommonHistList->Add(fhnNJLa);
1901 fCommonHistList->Add(fhnNJALa);
1902 //fCommonHistList->Add(fh2MCgenK0Cone);
1903 //fCommonHistList->Add(fh2MCgenLaCone);
1904 //fCommonHistList->Add(fh2MCgenALaCone);
1905 //fCommonHistList->Add(fh2MCEtagenK0Cone);
1906 //fCommonHistList->Add(fh2MCEtagenLaCone);
1907 //fCommonHistList->Add(fh2MCEtagenALaCone);
1908 fCommonHistList->Add(fh2CorrHijingLaProton);
1909 fCommonHistList->Add(fh2CorrInjectLaProton);
1910 fCommonHistList->Add(fh2CorrHijingALaAProton);
1911 fCommonHistList->Add(fh2CorrInjectALaAProton);
1912 fCommonHistList->Add(fh2MCEtaVsPtHijingLa);
1913 fCommonHistList->Add(fh2MCEtaVsPtInjectLa);
1914 fCommonHistList->Add(fh2MCEtaVsPtHijingALa);
1915 fCommonHistList->Add(fh2MCEtaVsPtInjectALa);
1916 fCommonHistList->Add(fh1IMK0ConeSmear);
1917 fCommonHistList->Add(fh1IMLaConeSmear);
1918 fCommonHistList->Add(fh1IMALaConeSmear);
1919 fCommonHistList->Add(fhnrecMCHijingLaIncl);
1920 fCommonHistList->Add(fhnrecMCHijingLaCone);
1921 fCommonHistList->Add(fhnrecMCHijingALaIncl);
1922 fCommonHistList->Add(fhnrecMCHijingALaCone);
1923 fCommonHistList->Add(fhnrecMCInjectLaIncl);
1924 fCommonHistList->Add(fhnrecMCInjectLaCone);
1925 fCommonHistList->Add(fhnrecMCInjectALaIncl);
1926 fCommonHistList->Add(fhnrecMCInjectALaCone);
1927 fCommonHistList->Add(fhnMCrecK0Cone);
1928 fCommonHistList->Add(fhnMCrecLaCone);
1929 fCommonHistList->Add(fhnMCrecALaCone);
1930 fCommonHistList->Add(fhnMCrecK0ConeSmear);
1931 fCommonHistList->Add(fhnMCrecLaConeSmear);
1932 fCommonHistList->Add(fhnMCrecALaConeSmear);
1933 fCommonHistList->Add(fhnK0sSecContinCone);
1934 fCommonHistList->Add(fhnLaSecContinCone);
1935 fCommonHistList->Add(fhnALaSecContinCone);
1936 fCommonHistList->Add(fhnK0sIncl);
1937 fCommonHistList->Add(fhnK0sCone);
1938 fCommonHistList->Add(fhnLaIncl);
1939 fCommonHistList->Add(fhnLaCone);
1940 fCommonHistList->Add(fhnALaIncl);
1941 fCommonHistList->Add(fhnALaCone);
1942 fCommonHistList->Add(fhnK0sPC);
1943 fCommonHistList->Add(fhnLaPC);
1944 fCommonHistList->Add(fhnALaPC);
1945 fCommonHistList->Add(fhnK0sMCC);
1946 fCommonHistList->Add(fhnLaMCC);
1947 fCommonHistList->Add(fhnALaMCC);
1948 fCommonHistList->Add(fhnK0sRC);
1949 fCommonHistList->Add(fhnLaRC);
1950 fCommonHistList->Add(fhnALaRC);
1951 fCommonHistList->Add(fhnK0sRCBias);
1952 fCommonHistList->Add(fhnLaRCBias);
1953 fCommonHistList->Add(fhnALaRCBias);
1954 fCommonHistList->Add(fhnK0sOC);
1955 fCommonHistList->Add(fhnLaOC);
1956 fCommonHistList->Add(fhnALaOC);
1957 fCommonHistList->Add(fh1AreaExcluded);
1958 fCommonHistList->Add(fh1MedianEta);
1959 fCommonHistList->Add(fh1JetPtMedian);
1960 fCommonHistList->Add(fh1MCMultiplicityPrimary);
1961 fCommonHistList->Add(fh1MCMultiplicityTracks);
1962 fCommonHistList->Add(fhnFeedDownLa);
1963 fCommonHistList->Add(fhnFeedDownALa);
1964 fCommonHistList->Add(fhnFeedDownLaCone);
1965 fCommonHistList->Add(fhnFeedDownALaCone);
1966 fCommonHistList->Add(fh1MCProdRadiusK0s);
1967 fCommonHistList->Add(fh1MCProdRadiusLambda);
1968 fCommonHistList->Add(fh1MCProdRadiusAntiLambda);
1969 fCommonHistList->Add(fh1MCPtV0s);
1970 fCommonHistList->Add(fh1MCPtK0s);
1971 fCommonHistList->Add(fh1MCPtLambda);
1972 fCommonHistList->Add(fh1MCPtAntiLambda);
1973 fCommonHistList->Add(fh1MCXiPt);
1974 fCommonHistList->Add(fh1MCXibarPt);
1975 fCommonHistList->Add(fh2MCEtaVsPtK0s);
1976 fCommonHistList->Add(fh2MCEtaVsPtLa);
1977 fCommonHistList->Add(fh2MCEtaVsPtALa);
1978 //fCommonHistList->Add(fh1MCRapK0s);
1979 //fCommonHistList->Add(fh1MCRapLambda);
1980 //fCommonHistList->Add(fh1MCRapAntiLambda);
1981 fCommonHistList->Add(fh1MCEtaAllK0s);
1982 fCommonHistList->Add(fh1MCEtaK0s);
1983 fCommonHistList->Add(fh1MCEtaLambda);
1984 fCommonHistList->Add(fh1MCEtaAntiLambda);
1988 fV0QAK0->AddToOutput(fCommonHistList);
1989 fFFHistosRecCuts->AddToOutput(fCommonHistList);
1990 fFFHistosRecCutsK0Evt->AddToOutput(fCommonHistList);
1991 // fFFHistosIMK0AllEvt->AddToOutput(fCommonHistList);
1992 // fFFHistosIMK0Jet->AddToOutput(fCommonHistList);
1993 // fFFHistosIMK0Cone->AddToOutput(fCommonHistList);
1994 // fFFHistosIMLaAllEvt->AddToOutput(fCommonHistList);
1995 // fFFHistosIMLaJet->AddToOutput(fCommonHistList);
1996 // fFFHistosIMLaCone->AddToOutput(fCommonHistList);
1997 // fFFHistosIMALaAllEvt->AddToOutput(fCommonHistList);
1998 // fFFHistosIMALaJet->AddToOutput(fCommonHistList);
1999 // fFFHistosIMALaCone->AddToOutput(fCommonHistList);
2004 // =========== Switch on Sumw2 for all histos ===========
2005 for (Int_t i=0; i<fCommonHistList->GetEntries(); ++i){
2007 TH1 *h1 = dynamic_cast<TH1*>(fCommonHistList->At(i));
2009 if (h1) h1->Sumw2();//The error per bin will be computed as sqrt(sum of squares of weight) for each bin
2011 THnSparse *hnSparse = dynamic_cast<THnSparse*>(fCommonHistList->At(i));
2012 if(hnSparse) hnSparse->Sumw2();
2016 TH1::AddDirectory(oldStatus);
2017 PostData(1, fCommonHistList);
2020 //_______________________________________________
2021 void AliAnalysisTaskJetChem::UserExec(Option_t *)
2024 // Called for each event
2026 if(fDebug > 1) Printf("AliAnalysisTaskJetChem::UserExec()");
2028 if(fDebug > 1) Printf("Analysis event #%5d", (Int_t) fEntry);
2030 // Trigger selection
2031 AliInputEventHandler* inputHandler = (AliInputEventHandler*)
2032 ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
2035 //for AliPIDResponse:
2036 //AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
2037 //AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
2038 fPIDResponse = inputHandler->GetPIDResponse();
2040 if (!fPIDResponse){if(fDebug > 1) Printf("AliAnalysisTaskJetChem::UserExec(): fPIDResponse does not exist!"); return;}
2042 //std::cout<<"inputHandler->IsEventSelected(): "<<inputHandler->IsEventSelected()<<std::endl;
2043 //std::cout<<"fEvtSelectionMask: "<<fEvtSelectionMask<<std::endl;
2045 if(!(inputHandler->IsEventSelected() & fEvtSelectionMask)){
2046 //std::cout<<"########event rejected!!############"<<std::endl;
2047 fh1EvtSelection->Fill(1.);
2048 if (fDebug > 1 ) Printf(" Trigger Selection: event REJECTED ... ");
2049 PostData(1, fCommonHistList);
2053 fESD = dynamic_cast<AliESDEvent*>(InputEvent());//casting of pointers for inherited class, only for ESDs
2055 if(fDebug>3) Printf("%s:%d ESDEvent not found in the input", (char*)__FILE__,__LINE__);
2058 fMCEvent = MCEvent();
2060 if(fDebug>3) Printf("%s:%d MCEvent not found in the input", (char*)__FILE__,__LINE__);
2063 // get AOD event from input/output
2064 TObject* handler = AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler();
2065 if( handler && handler->InheritsFrom("AliAODInputHandler") ) {
2066 fAOD = ((AliAODInputHandler*)handler)->GetEvent();
2067 if(fUseAODInputJets) fAODJets = fAOD;
2068 if (fDebug > 1) Printf("%s:%d AOD event from input", (char*)__FILE__,__LINE__);
2071 handler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler();
2072 if( handler && handler->InheritsFrom("AliAODHandler") ) {
2073 fAOD = ((AliAODHandler*)handler)->GetAOD();
2075 if (fDebug > 1) Printf("%s:%d AOD event from output", (char*)__FILE__,__LINE__);
2079 if(!fAODJets && !fUseAODInputJets){ // case we have AOD in input & output and want jets from output
2080 TObject* outHandler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler();
2081 if( outHandler && outHandler->InheritsFrom("AliAODHandler") ){
2082 fAODJets = ((AliAODHandler*)outHandler)->GetAOD();
2083 if (fDebug > 1) Printf("%s:%d jets from output AOD", (char*)__FILE__,__LINE__);
2087 if(fNonStdFile.Length()!=0){
2088 // case we have an AOD extension - fetch the jets from the extended output
2090 AliAODHandler *aodH = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
2091 fAODExtension = (aodH?aodH->GetExtension(fNonStdFile.Data()):0);
2093 if(fDebug>1)Printf("AODExtension not found for %s",fNonStdFile.Data());
2098 Printf("%s:%d AODEvent not found", (char*)__FILE__,__LINE__);
2102 Printf("%s:%d AODEvent with jet branch not found", (char*)__FILE__,__LINE__);
2106 //primary vertex position:
2107 AliAODVertex *myPrimaryVertex = NULL;
2108 myPrimaryVertex = (AliAODVertex*)fAOD->GetPrimaryVertex();
2109 if (!myPrimaryVertex) return;
2110 fh1Evt->Fill(1.);//fill in every event that was accessed with InputHandler
2112 // event selection *****************************************
2114 // *** vertex cut ***
2115 AliAODVertex* primVtx = fAOD->GetPrimaryVertex();
2116 Int_t nTracksPrim = primVtx->GetNContributors();
2117 fh1VertexNContributors->Fill(nTracksPrim);
2119 if (fDebug > 1) Printf("%s:%d primary vertex selection: %d", (char*)__FILE__,__LINE__,nTracksPrim);
2121 if(nTracksPrim <= 2){
2122 if (fDebug > 1) Printf("%s:%d primary vertex selection: event REJECTED...",(char*)__FILE__,__LINE__);
2123 fh1EvtSelection->Fill(3.);
2124 PostData(1, fCommonHistList);
2128 fh1VertexZ->Fill(primVtx->GetZ());
2130 if(TMath::Abs(primVtx->GetZ())>fMaxVertexZ){
2131 if (fDebug > 1) Printf("%s:%d primary vertex z = %f: event REJECTED...",(char*)__FILE__,__LINE__,primVtx->GetZ());
2132 fh1EvtSelection->Fill(4.);
2133 PostData(1, fCommonHistList);
2137 // accepts only events that have same "primary" and SPD vertex, special issue of LHC11h PbPb data
2139 //fAOD: pointer to global primary vertex
2141 const AliAODVertex* spdVtx = fAOD->GetPrimaryVertexSPD();
2143 if (TMath::Abs(spdVtx->GetZ() - primVtx->GetZ())>fDeltaVertexZ) { if (fDebug > 1) Printf("deltaZVertex: event REJECTED..."); return;}
2146 //check for vertex radius to be smaller than 1 cm, (that was first applied by Vit Kucera in his analysis)
2148 Double_t vtxX = primVtx->GetX();
2149 Double_t vtxY = primVtx->GetY();
2151 if(TMath::Sqrt(vtxX*vtxX + vtxY*vtxY)>=1){
2152 if (fDebug > 1) Printf("%s:%d primary vertex r = %f: event REJECTED...",(char*)__FILE__,__LINE__,TMath::Sqrt(vtxX*vtxX + vtxY*vtxY));
2157 TString primVtxName(primVtx->GetName());
2159 if(primVtxName.CompareTo("TPCVertex",TString::kIgnoreCase) == 1){
2160 if (fDebug > 1) Printf("%s:%d primary vertex selection: TPC vertex, event REJECTED...",(char*)__FILE__,__LINE__);
2161 fh1EvtSelection->Fill(5.);
2162 PostData(1, fCommonHistList);
2166 Bool_t selectedHelper = AliAnalysisHelperJetTasks::Selected();
2167 if(!selectedHelper){
2168 fh1EvtSelection->Fill(6.);
2169 PostData(1, fCommonHistList);
2173 // event selection *****************************************
2175 Double_t centPercent = -1;
2179 if(handler && handler->InheritsFrom("AliAODInputHandler")){
2181 centPercent = ((AliVAODHeader*)fAOD->GetHeader())->GetCentrality();
2183 //std::cout<<"centPercent: "<<centPercent<<std::endl;
2185 fh1EvtAllCent->Fill(centPercent);
2187 if(centPercent>10) cl = 2; //standard PWG-JE binning
2188 if(centPercent>30) cl = 3;
2189 if(centPercent>50) cl = 4;
2193 if(centPercent < 0) cl = -1;
2194 if(centPercent >= 0) cl = 1;
2195 if(centPercent > 10) cl = 2; //standard PWG-JE binning
2196 if(centPercent > 30) cl = 3;
2197 if(centPercent > 50) cl = 4;
2198 if(centPercent > 80) cl = 5; //takes centralities higher than my upper edge of 80%, not to be used
2203 cl = AliAnalysisHelperJetTasks::EventClass();
2205 if(fESD) centPercent = fESD->GetCentrality()->GetCentralityPercentile("V0M"); //ESD JetServices Task has the centrality binning 0-10,10-30,30-50,50-80
2206 fh1EvtAllCent->Fill(centPercent);
2209 if(cl!=fEventClass){ // event not in selected event class, reject event#########################################
2211 if (fDebug > 1) Printf("%s:%d event not in selected event class: event REJECTED ...",(char*)__FILE__,__LINE__);
2212 fh1EvtSelection->Fill(2.);
2213 PostData(1, fCommonHistList);
2216 }//end if fEventClass > 0
2219 if (fDebug > 1) Printf("%s:%d event ACCEPTED ...",(char*)__FILE__,__LINE__);
2222 //Printf("Analysis event #%5d", (Int_t) fEntry);
2224 fh1EvtSelection->Fill(0.);
2225 fh1EvtCent->Fill(centPercent);
2227 //___ get MC information __________________________________________________________________
2230 Double_t ptHard = 0.; //parton energy bins -> energy of particle
2231 Double_t nTrials = 1; // trials for MC trigger weight for real data
2234 AliGenEventHeader* genHeader = fMCEvent->GenEventHeader();
2235 AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);//check usage of Pythia (pp) or Hijing (PbPb)
2236 AliGenHijingEventHeader* hijingGenHeader = 0x0;
2238 if(pythiaGenHeader){
2239 if(fDebug>3) Printf("%s:%d pythiaGenHeader found", (char*)__FILE__,__LINE__);
2240 nTrials = pythiaGenHeader->Trials();
2241 ptHard = pythiaGenHeader->GetPtHard();
2243 fh1PtHard->Fill(ptHard);
2244 fh1PtHardTrials->Fill(ptHard,nTrials);
2247 } else { // no pythia, hijing?
2249 if(fDebug>3) Printf("%s:%d no pythiaGenHeader found", (char*)__FILE__,__LINE__);
2251 hijingGenHeader = dynamic_cast<AliGenHijingEventHeader*>(genHeader);
2252 if(!hijingGenHeader){
2253 if(fDebug>3) Printf("%s:%d no pythiaGenHeader or hjingGenHeader found", (char*)__FILE__,__LINE__);
2255 if(fDebug>3) Printf("%s:%d hijingGenHeader found", (char*)__FILE__,__LINE__);
2259 fh1Trials->Fill("#sum{ntrials}",fAvgTrials);
2262 //____ fetch jets _______________________________________________________________
2264 Int_t nJCuts = GetListOfJets(fJetsRecCuts, kJetsRecAcceptance);//fetch list with jets that survived all jet cuts: fJetsRecCuts
2266 Int_t nRecJetsCuts = 0; //number of reconstructed jets after jet cuts
2267 if(nJCuts>=0) nRecJetsCuts = fJetsRecCuts->GetEntries();
2268 if(fDebug>2)Printf("%s:%d Selected Rec jets after cuts: %d %d",(char*)__FILE__,__LINE__,nJCuts,nRecJetsCuts);
2269 if(nRecJetsCuts != nJCuts) Printf("%s:%d Mismatch selected Rec jets after cuts: %d %d",(char*)__FILE__,__LINE__,nJCuts,nRecJetsCuts);
2270 fh1nRecJetsCuts->Fill(nRecJetsCuts);
2273 //____ fetch background clusters ___________________________________________________
2274 if(fBranchRecBckgClusters.Length() != 0){
2276 Int_t nBJ = GetListOfBckgJets(fBckgJetsRec, kJetsRec);
2277 Int_t nRecBckgJets = 0;
2278 if(nBJ>=0) nRecBckgJets = fBckgJetsRec->GetEntries();
2279 if(fDebug>2)Printf("%s:%d Selected Rec background jets: %d %d",(char*)__FILE__,__LINE__,nBJ,nRecBckgJets);
2280 if(nBJ != nRecBckgJets) Printf("%s:%d Mismatch Selected Rec background jets: %d %d",(char*)__FILE__,__LINE__,nBJ,nRecBckgJets);
2284 //____ fetch reconstructed particles __________________________________________________________
2286 Int_t nTCuts = GetListOfTracks(fTracksRecCuts, kTrackAODCuts);//all tracks of event
2287 if(fDebug>2)Printf("%s:%d selected reconstructed tracks after cuts: %d %d",(char*)__FILE__,__LINE__,nTCuts,fTracksRecCuts->GetEntries());
2288 if(fTracksRecCuts->GetEntries() != nTCuts)
2289 Printf("%s:%d Mismatch selected reconstructed tracks after cuts: %d %d",(char*)__FILE__,__LINE__,nTCuts,fTracksRecCuts->GetEntries());
2290 fh1EvtMult->Fill(fTracksRecCuts->GetEntries());
2292 Int_t nK0s = GetListOfV0s(fListK0s,fK0Type,kK0,myPrimaryVertex,fAOD);//all V0s in event with K0s assumption
2294 if(fDebug>5){std::cout<<"fK0Type: "<<fK0Type<<" kK0: "<<kK0<<" myPrimaryVertex: "<<myPrimaryVertex<<" fAOD: "<<fAOD<<std::endl;}
2296 //std::cout<< "nK0s: "<<nK0s<<std::endl;
2298 if(fDebug>2)Printf("%s:%d Selected V0s after cuts: %d %d",(char*)__FILE__,__LINE__,nK0s,fListK0s->GetEntries());
2299 if(nK0s != fListK0s->GetEntries()) Printf("%s:%d Mismatch selected K0s: %d %d",(char*)__FILE__,__LINE__,nK0s,fListK0s->GetEntries());
2300 fh1K0Mult->Fill(fListK0s->GetEntries());
2303 Int_t nLa = GetListOfV0s(fListLa,fLaType,kLambda,myPrimaryVertex,fAOD);//all V0s in event with Lambda particle assumption
2304 if(fDebug>2)Printf("%s:%d Selected Rec tracks after cuts: %d %d",(char*)__FILE__,__LINE__,nLa,fListLa->GetEntries());
2305 if(nLa != fListLa->GetEntries()) Printf("%s:%d Mismatch selected La: %d %d",(char*)__FILE__,__LINE__,nLa,fListLa->GetEntries());
2306 fh1LaMult->Fill(fListLa->GetEntries());
2308 Int_t nALa = GetListOfV0s(fListALa,fALaType,kAntiLambda,myPrimaryVertex,fAOD);//all V0s in event with Antilambda particle assumption
2309 if(fDebug>2)Printf("%s:%d Selected Rec tracks after cuts: %d %d",(char*)__FILE__,__LINE__,nALa,fListALa->GetEntries());
2310 if(nALa != fListALa->GetEntries()) Printf("%s:%d Mismatch selected ALa: %d %d",(char*)__FILE__,__LINE__,nALa,fListALa->GetEntries());
2311 fh1ALaMult->Fill(fListALa->GetEntries());
2315 //fetch MC gen particles_______________________________________________________
2317 if(fAnalysisMC){ // here
2319 //fill feeddown histo for associated particles
2321 // Access MC generated particles, fill TLists and histograms :
2323 Int_t nMCgenK0s = GetListOfMCParticles(fListMCgenK0s,kK0,fAOD); //fill TList with MC generated primary true K0s (list to fill, particletype, mc aod event)
2324 if(nMCgenK0s != fListMCgenK0s->GetEntries()) Printf("%s:%d Mismatch selected MCgenK0s: %d %d",(char*)__FILE__,__LINE__,nMCgenK0s,fListMCgenK0s->GetEntries());
2327 for(Int_t it=0; it<fListMCgenK0s->GetSize(); ++it){ // loop MC generated K0s, filling histograms
2329 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenK0s->At(it));
2334 //Double_t fRapCurrentPart = MyRapidity(mcp0->E(),mcp0->Pz());
2335 Double_t fEtaCurrentPart = mcp0->Eta();
2336 Double_t fPtCurrentPart = mcp0->Pt();
2338 fh1MCEtaK0s->Fill(fEtaCurrentPart);
2339 //fh1MCRapK0s->Fill(fRapCurrentPart);
2340 fh1MCPtK0s->Fill(fPtCurrentPart);
2342 fh2MCEtaVsPtK0s->Fill(fPtCurrentPart,fEtaCurrentPart); //eta cut, physical primary selection and decay mode considered
2346 Int_t nMCgenLa = GetListOfMCParticles(fListMCgenLa,kLambda,fAOD); //fill TList with MC generated primary true Lambdas (list to fill, particletype, mc aod event)
2347 if(nMCgenLa != fListMCgenLa->GetEntries()) Printf("%s:%d Mismatch selected MCgenLa: %d %d",(char*)__FILE__,__LINE__,nMCgenLa,fListMCgenLa->GetEntries());
2349 TList *mclist = fAOD->GetList();
2350 TClonesArray *stackMC = 0x0;
2351 stackMC = (TClonesArray*)mclist->FindObject(AliAODMCParticle::StdBranchName());
2353 Printf("ERROR: AliAnalysisTaskJetChem.cxx: loop over MC gen. particles: stackMC not available!");
2356 AliAODMCHeader *mcHdr=(AliAODMCHeader*)mclist->FindObject(AliAODMCHeader::StdBranchName());
2357 if(!mcHdr)Printf("ERROR: AliAnalysisTaskJetChem.cxx: loop over MC gen. particles: mcHdr not available!");
2359 for(Int_t it=0; it<fListMCgenLa->GetSize(); ++it){ // loop MC generated La, filling histograms
2361 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenLa->At(it));
2366 //Double_t fRapCurrentPart = MyRapidity(mcp0->E(),mcp0->Pz());
2367 Double_t fEtaCurrentPart = mcp0->Eta();
2368 Double_t fPtCurrentPart = mcp0->Pt();
2369 TString generatorName;
2371 fh1MCEtaLambda->Fill(fEtaCurrentPart);
2372 //fh1MCRapLambda->Fill(fRapCurrentPart);
2373 fh1MCPtLambda->Fill(fPtCurrentPart);
2374 fh2MCEtaVsPtLa->Fill(fPtCurrentPart,fEtaCurrentPart); //eta cut, physical primary selection and decay mode considered
2376 Int_t mcp0label = mcp0->GetLabel();
2377 Bool_t istrackInject = IsTrackInjected(mcp0label, mcHdr, stackMC, generatorName);
2379 //std::cout<<"generatorName: "<<generatorName<<std::endl;
2382 if(generatorName == "Hijing"){
2383 fh2MCEtaVsPtHijingLa->Fill(fPtCurrentPart,fEtaCurrentPart);
2386 if(istrackInject == kTRUE){
2387 fh2MCEtaVsPtInjectLa->Fill(fPtCurrentPart,fEtaCurrentPart);
2393 Int_t nMCgenALa = GetListOfMCParticles(fListMCgenALa,kAntiLambda,fAOD); //fill TList with MC generated primary true Antilambdas (list to fill, particletype, mc aod event)
2394 if(nMCgenALa != fListMCgenALa->GetEntries()) Printf("%s:%d Mismatch selected MCgenALa: %d %d",(char*)__FILE__,__LINE__,nMCgenALa,fListMCgenALa->GetEntries());
2397 for(Int_t it=0; it<fListMCgenALa->GetSize(); ++it){ // loop MC generated ALa, filling histograms
2399 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenALa->At(it));
2402 //MC gen Antilambdas
2404 //Double_t fRapCurrentPart = MyRapidity(mcp0->E(),mcp0->Pz());
2405 Double_t fEtaCurrentPart = mcp0->Eta();
2406 Double_t fPtCurrentPart = mcp0->Pt();
2407 TString generatorName;
2409 fh1MCEtaAntiLambda->Fill(fEtaCurrentPart);
2410 //fh1MCRapAntiLambda->Fill(fRapCurrentPart);
2411 fh1MCPtAntiLambda->Fill(fPtCurrentPart);
2412 fh2MCEtaVsPtALa->Fill(fPtCurrentPart,fEtaCurrentPart); //eta cut, physical primary selection and decay mode considered
2415 Int_t mcp0label = mcp0->GetLabel();
2416 Bool_t istrackInject = IsTrackInjected(mcp0label, mcHdr, stackMC, generatorName);
2418 //std::cout<<"generatorName: "<<generatorName<<std::endl;
2421 if(generatorName == "Hijing"){
2422 fh2MCEtaVsPtHijingALa->Fill(fPtCurrentPart,fEtaCurrentPart);
2425 if(istrackInject == kTRUE){
2426 fh2MCEtaVsPtInjectALa->Fill(fPtCurrentPart,fEtaCurrentPart);
2434 //loop over MC feeddown candidates in TList
2439 } //end MCAnalysis part for gen particles
2442 // ___ V0 QA + K0s + La + ALa pt spectra all events _______________________________________________
2444 Double_t lPrimaryVtxPosition[3];
2445 Double_t lV0Position[3];
2446 lPrimaryVtxPosition[0] = primVtx->GetX();
2447 lPrimaryVtxPosition[1] = primVtx->GetY();
2448 lPrimaryVtxPosition[2] = primVtx->GetZ();
2449 Double_t dRadiusExcludeCone = 2*GetFFRadius(); //2 times jet radius
2450 //------------------------------------------
2451 for(Int_t it=0; it<fListK0s->GetSize(); ++it){
2453 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListK0s->At(it));
2456 // VO's main characteristics to check the reconstruction cuts
2458 //Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
2461 Double_t fV0Radius = -999;
2462 Double_t fDcaV0Daughters = v0->DcaV0Daughters();
2463 Double_t fDcaPosToPrimVertex = v0->DcaPosToPrimVertex();//IP of positive charged daughter
2464 Double_t fDcaNegToPrimVertex = v0->DcaNegToPrimVertex();//IP of negative charged daughter
2465 Int_t negDaughterpdg = 0;
2466 Int_t posDaughterpdg = 0;
2467 Int_t motherType = 0;
2470 Bool_t fPhysicalPrimary = kFALSE;//don't use IsPhysicalPrimary() anymore for MC analysis, use instead 2D distance from primary to secondary vertex
2471 Int_t MCv0PdgCode = 0;
2473 AliAODTrack *trackPos = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(0));
2474 AliAODTrack *trackNeg = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(1));
2476 Double_t PosEta = trackPos->AliAODTrack::Eta();//daughter track charge is sometimes wrong here, account for that!!!
2477 Double_t NegEta = trackNeg->AliAODTrack::Eta();
2479 //Double_t trackPosNcls = trackPos->GetTPCNcls();//Get number of clusters for positive charged tracks
2480 //Double_t trackNegNcls = trackNeg->GetTPCNcls();//Get number of clusters for negative charged tracks
2482 CalculateInvMass(v0, kK0, invMK0s, trackPt); //function to calculate invMass with TLorentzVector class
2485 //OUTSIDE CONES:########
2487 Double_t fEta = v0->PseudoRapV0();
2488 Bool_t bIsInCone = kFALSE;//init boolean, is not in any cone (OC)
2489 Int_t nRemainingJets = nRecJetsCuts; //init value Int_t nRemainingJets = nRecJetsCuts; //init value
2491 for(Int_t ij=0; ij<nRecJetsCuts; ++ij){ // loop over all jets in event
2493 AliAODJet* jet = (AliAODJet*) (fJetsRecCuts->At(ij));
2494 jettracklist->Clear();
2495 Double_t sumPt = 0.;
2496 Bool_t isBadJet = kFALSE;
2498 if(GetFFRadius()<=0){
2499 GetJetTracksTrackrefs(jettracklist, jet, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet);// list of jet tracks from trackrefs
2501 GetJetTracksPointing(fTracksRecCuts, jettracklist, jet, GetFFRadius(), sumPt, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet); // fill list of tracks in cone around jet axis with cone Radius (= 0.4 standard)
2504 //leading track pt bias on jets inside this small jet loop
2505 //APPLICATION OF REMAINING JET CUTS (leading track pt bias etc..):
2507 nRemainingJets = nRemainingJets-1;//remove one jet from nRemainingJets (was initialized with nRecJetsCuts) continue;//all bad jets are rejected
2511 //if jet is selected, then check whether V0 is part of the jet cone:
2512 if(IsParticleInCone(jet, v0, dRadiusExcludeCone) == kTRUE) {bIsInCone = kTRUE;}
2514 jettracklist->Clear();
2517 if((bIsInCone==kFALSE)&&(nRemainingJets > 0)){//K0s is not part of any selected jet in event, but its a jet event
2518 Double_t vK0sOC[3] = {invMK0s,trackPt,fEta};
2519 fhnK0sOC->Fill(vK0sOC);
2522 //end of outside cone K0s
2524 Double_t fV0cosPointAngle = v0->CosPointingAngle(lPrimaryVtxPosition);
2526 lV0Position[0]= v0->DecayVertexV0X();
2527 lV0Position[1]= v0->DecayVertexV0Y();
2528 lV0Position[2]= v0->DecayVertexV0Z();
2530 Double_t fV0DecayLength = v0->DecayLengthV0(lPrimaryVtxPosition);
2531 fV0Radius = TMath::Sqrt(lV0Position[0]*lV0Position[0]+lV0Position[1]*lV0Position[1]);
2534 fV0QAK0->FillTrackQA(v0->Eta(), TVector2::Phi_0_2pi(v0->Phi()), v0->Pt());
2535 //fFFHistosIMK0AllEvt->FillFF(trackPt, invMK0s, jetPt, incrementJetPt);
2536 //fh1trackPosNCls->Fill(trackPosNcls);
2537 //fh1trackNegNCls->Fill(trackNegNcls);
2538 fh1EtaK0s->Fill(fEta);
2540 Double_t vK0sIncl[3] = {invMK0s,trackPt,fEta}; //fill all K0s in event into THnSparse of 3 dimensions
2541 fhnK0sIncl->Fill(vK0sIncl);
2545 TString generatorName;
2547 TList *listmc = fAOD->GetList();
2548 Bool_t mclabelcheck = MCLabelCheck(v0, kK0, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode, generatorName, isinjected);
2549 //if(fPhysicalPrimary == kFALSE)continue;
2550 //std::cout<<"mclabelcheck: "<<mclabelcheck<<std::endl;
2551 //std::cout<<"IsPhysicalPrimary: "<<fPhysicalPrimary<<std::endl;
2553 if(mclabelcheck == kFALSE)continue;
2555 Double_t vInvMassEtaTrackPtK0s[3] = {fEta,invMK0s,trackPt};
2556 fhnInvMassEtaTrackPtK0s->Fill(vInvMassEtaTrackPtK0s);//includes also feeddown particles, mainly phi particles whose decay products are considered here as primary
2559 fh1PtMCK0s->Fill(MCPt);
2563 fh1V0Eta->Fill(fEta);
2564 //fh1V0totMom->Fill(fV0TotalMomentum);
2565 fh1CosPointAngle->Fill(fV0cosPointAngle);
2566 fh1DecayLengthV0->Fill(fV0DecayLength);
2567 fh1V0Radius->Fill(fV0Radius);
2568 fh1DcaV0Daughters->Fill(fDcaV0Daughters);
2569 fh1DcaPosToPrimVertex->Fill(fDcaPosToPrimVertex);
2570 fh1DcaNegToPrimVertex->Fill(fDcaNegToPrimVertex);
2571 fh1trackPosEta->Fill(PosEta);
2572 fh1trackNegEta->Fill(NegEta);
2576 // __La pt spectra all events _______________________________________________
2579 for(Int_t it=0; it<fListLa->GetSize(); ++it){ // loop all La
2581 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListLa->At(it));
2584 // VO's main characteristics to check the reconstruction cuts
2585 // Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
2588 Double_t fV0Radius = -999;
2589 Double_t fDcaV0Daughters = v0->DcaV0Daughters();
2590 Double_t fDcaPosToPrimVertex = v0->DcaPosToPrimVertex();//IP of positive charged daughter
2591 Double_t fDcaNegToPrimVertex = v0->DcaNegToPrimVertex();//IP of negative charged daughter
2592 Int_t negDaughterpdg = 0;
2593 Int_t posDaughterpdg = 0;
2594 Int_t motherType = 0;
2597 Bool_t fPhysicalPrimary = kFALSE;
2598 Int_t MCv0PdgCode = 0;
2599 AliAODTrack *trackPos = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(0));
2600 AliAODTrack *trackNeg = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(1));
2602 //Double_t trackPosNcls = trackPos->GetTPCNcls();//Get number of clusters for positive charged tracks
2603 //Double_t trackNegNcls = trackNeg->GetTPCNcls();//Get number of clusters for negative charged tracks
2605 Double_t PosEta = trackPos->AliAODTrack::Eta();//daughter track charge is sometimes wrong here, account for that!!!
2606 Double_t NegEta = trackNeg->AliAODTrack::Eta();
2608 Double_t fEta = v0->PseudoRapV0();
2609 Bool_t bIsInCone = kFALSE;//init boolean, is not in any cone (OC)
2610 Int_t nRemainingJets = nRecJetsCuts; //init value
2612 CalculateInvMass(v0, kLambda, invMLa, trackPt);//function to calculate invMass with TLorentzVector class
2615 for(Int_t ij=0; ij<nRecJetsCuts; ++ij){ // loop over all jets in event
2617 AliAODJet* jet = (AliAODJet*) (fJetsRecCuts->At(ij));
2618 jettracklist->Clear();
2619 Double_t sumPt = 0.;
2620 Bool_t isBadJet = kFALSE;
2622 if(GetFFRadius()<=0){
2623 GetJetTracksTrackrefs(jettracklist, jet, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet);// list of jet tracks from trackrefs
2625 GetJetTracksPointing(fTracksRecCuts, jettracklist, jet, GetFFRadius(), sumPt, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet); // fill list of tracks in cone around jet axis with cone Radius (= 0.4 standard)
2629 //leading track pt bias on jets inside this small jet loop
2632 nRemainingJets = nRemainingJets-1;//remove one jet from nRemainingJets (was initialized with nRecJetsCuts) continue;//all bad jets are rejected
2638 if(IsParticleInCone(jet, v0, dRadiusExcludeCone) == kTRUE) {bIsInCone = kTRUE;}
2640 jettracklist->Clear();
2643 if((bIsInCone == kFALSE)&&(nRemainingJets > 0)){//success! Lambda doesn't belong to any selected jet in event
2644 Double_t vLaOC[3] = {invMLa, trackPt,fEta};
2645 fhnLaOC->Fill(vLaOC);
2648 // Double_t jetPt = fFFIMJetPtMin; // assign pro forma jet energy
2649 // Double_t fRap = v0->Y(3122);
2651 Double_t fV0DecayLength = v0->DecayLengthV0(lPrimaryVtxPosition);
2652 Double_t fV0cosPointAngle = v0->CosPointingAngle(lPrimaryVtxPosition);
2653 lV0Position[0]= v0->DecayVertexV0X();
2654 lV0Position[1]= v0->DecayVertexV0Y();
2655 lV0Position[2]= v0->DecayVertexV0Z();
2657 fV0Radius = TMath::Sqrt(lV0Position[0]*lV0Position[0]+lV0Position[1]*lV0Position[1]);
2659 //fFFHistosIMLaAllEvt->FillFF(trackPt, invMLa, jetPt, incrementJetPt);
2660 //fh1trackPosNCls->Fill(trackPosNcls);
2661 //fh1trackNegNCls->Fill(trackNegNcls);
2662 fh1EtaLa->Fill(fEta);
2664 Double_t vLaIncl[3] = {invMLa,trackPt,fEta};
2665 fhnLaIncl->Fill(vLaIncl);
2669 TString generatorName;
2671 TList* listmc = fAOD->GetList();
2672 Bool_t mclabelcheck = MCLabelCheck(v0, kLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode, generatorName, isinjected);
2673 if(mclabelcheck == kFALSE)continue;
2674 //if(fPhysicalPrimary == kFALSE)continue;
2676 if(generatorName == "Hijing"){
2677 Double_t vrecMCHijingLaIncl[3] = {invMLa,trackPt,fEta};
2678 fhnrecMCHijingLaIncl->Fill(vrecMCHijingLaIncl);
2680 Double_t protonPt = trackPos->Pt();
2681 fh2CorrHijingLaProton->Fill(trackPt,protonPt);
2684 if(isinjected == kTRUE){
2685 Double_t vrecMCInjectLaIncl[3] = {invMLa,trackPt,fEta};
2686 fhnrecMCInjectLaIncl->Fill(vrecMCInjectLaIncl);
2688 Double_t protonPt = trackPos->Pt();
2689 fh2CorrInjectLaProton->Fill(trackPt,protonPt);
2692 Double_t vInvMassEtaTrackPtLa[3] = {fEta,invMLa,trackPt};
2693 fhnInvMassEtaTrackPtLa->Fill(vInvMassEtaTrackPtLa);//includes also feed-down particles
2694 fh1PtMCLa->Fill(MCPt);
2697 fh1PtMCLa->Fill(MCPt);
2701 fh1V0Eta->Fill(fEta);
2702 //fh1V0totMom->Fill(fV0TotalMomentum);
2703 fh1CosPointAngle->Fill(fV0cosPointAngle);
2704 fh1DecayLengthV0->Fill(fV0DecayLength);
2705 fh1V0Radius->Fill(fV0Radius);
2706 fh1DcaV0Daughters->Fill(fDcaV0Daughters);
2707 fh1DcaPosToPrimVertex->Fill(fDcaPosToPrimVertex);
2708 fh1DcaNegToPrimVertex->Fill(fDcaNegToPrimVertex);
2709 fh1trackPosEta->Fill(PosEta);
2710 fh1trackNegEta->Fill(NegEta);
2713 // __ALa pt spectra all events _______________________________________________
2715 for(Int_t it=0; it<fListALa->GetSize(); ++it){ // loop all ALa
2717 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListALa->At(it));
2721 //VO's main characteristics to check the reconstruction cuts
2722 Double_t invMALa =0;
2724 Double_t fV0Radius = -999;
2725 Double_t fDcaV0Daughters = v0->DcaV0Daughters();
2726 Double_t fDcaPosToPrimVertex = v0->DcaPosToPrimVertex();//IP of positive charged daughter
2727 Double_t fDcaNegToPrimVertex = v0->DcaNegToPrimVertex();//IP of negative charged daughter
2728 Int_t negDaughterpdg = 0;
2729 Int_t posDaughterpdg = 0;
2730 Int_t motherType = 0;
2733 Bool_t fPhysicalPrimary = kFALSE;
2734 Int_t MCv0PdgCode = 0;
2736 AliAODTrack *trackPos = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(0));
2737 AliAODTrack *trackNeg = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(1));
2739 Double_t PosEta = trackPos->AliAODTrack::Eta();//daughter track charge is sometimes wrong here, account for that!!!
2740 Double_t NegEta = trackNeg->AliAODTrack::Eta();
2742 Double_t fEta = v0->PseudoRapV0();
2743 Bool_t bIsInCone = kFALSE;//init boolean for OC
2744 Int_t nRemainingJets = nRecJetsCuts; //init value
2746 CalculateInvMass(v0, kAntiLambda, invMALa, trackPt); //function to calculate invMass with TLorentzVector class
2748 for(Int_t ij=0; ij<nRecJetsCuts; ++ij){ // loop over all jets in event
2750 AliAODJet* jet = (AliAODJet*) (fJetsRecCuts->At(ij));
2751 jettracklist->Clear();
2752 Double_t sumPt = 0.;
2753 Bool_t isBadJet = kFALSE;
2756 if(GetFFRadius()<=0){
2757 GetJetTracksTrackrefs(jettracklist, jet, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet);// list of jet tracks from trackrefs
2759 GetJetTracksPointing(fTracksRecCuts, jettracklist, jet, GetFFRadius(), sumPt, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet); // fill list of tracks in cone around jet axis with cone Radius (= 0.4 standard)
2762 //leading track pt bias on jets inside this small jet loop
2765 nRemainingJets = nRemainingJets-1;//remove one jet from nRemainingJets (was initialized with nRecJetsCuts) continue;//all bad jets are rejected
2770 if(IsParticleInCone(jet, v0, dRadiusExcludeCone) == kTRUE){
2774 jettracklist->Clear();
2777 if((bIsInCone == kFALSE)&&(nRemainingJets > 0)){//success!
2778 Double_t vALaOC[3] = {invMALa, trackPt,fEta};
2779 fhnALaOC->Fill(vALaOC);
2782 //Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
2783 //Double_t jetPt = fFFIMJetPtMin; // assign pro forma jet energy
2784 // Double_t fRap = v0->Y(-3122);
2787 Double_t fV0cosPointAngle = v0->CosPointingAngle(lPrimaryVtxPosition);
2788 lV0Position[0]= v0->DecayVertexV0X();
2789 lV0Position[1]= v0->DecayVertexV0Y();
2790 lV0Position[2]= v0->DecayVertexV0Z();
2791 Double_t fV0DecayLength = v0->DecayLengthV0(lPrimaryVtxPosition);
2792 fV0Radius = TMath::Sqrt(lV0Position[0]*lV0Position[0]+lV0Position[1]*lV0Position[1]);
2794 //fFFHistosIMALaAllEvt->FillFF(trackPt, invMALa, jetPt, incrementJetPt);
2795 //fh1trackPosNCls->Fill(trackPosNcls);
2796 //fh1trackNegNCls->Fill(trackNegNcls);
2797 fh1EtaALa->Fill(fEta);
2799 Double_t vALaIncl[3] = {invMALa,trackPt,fEta};
2800 fhnALaIncl->Fill(vALaIncl);
2803 TString generatorName;
2805 TList* listmc = fAOD->GetList();
2806 Bool_t mclabelcheck = MCLabelCheck(v0, kAntiLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode, generatorName, isinjected);
2807 if(mclabelcheck == kFALSE)continue;
2808 //if(fPhysicalPrimary == kFALSE)continue;//take also feeddown particles into account
2810 if(generatorName == "Hijing"){
2811 Double_t vrecMCHijingALaIncl[3] = {invMALa,trackPt,fEta};
2812 fhnrecMCHijingALaIncl->Fill(vrecMCHijingALaIncl);
2814 Double_t aprotonPt = trackNeg->Pt();
2815 fh2CorrHijingALaAProton->Fill(trackPt,aprotonPt);
2819 if(isinjected == kTRUE){
2820 Double_t vrecMCInjectALaIncl[3] = {invMALa,trackPt,fEta};
2821 fhnrecMCInjectALaIncl->Fill(vrecMCInjectALaIncl);
2823 Double_t aprotonPt = trackNeg->Pt();
2824 fh2CorrInjectALaAProton->Fill(trackPt,aprotonPt);
2829 Double_t vInvMassEtaTrackPtALa[3] = {fEta,invMALa,trackPt};
2830 fhnInvMassEtaTrackPtALa->Fill(vInvMassEtaTrackPtALa);
2831 fh1PtMCALa->Fill(MCPt);
2834 fh1V0Eta->Fill(fEta);
2835 //fh1V0totMom->Fill(fV0TotalMomentum);
2836 fh1CosPointAngle->Fill(fV0cosPointAngle);
2837 fh1DecayLengthV0->Fill(fV0DecayLength);
2838 fh1V0Radius->Fill(fV0Radius);
2839 fh1DcaV0Daughters->Fill(fDcaV0Daughters);
2840 fh1DcaPosToPrimVertex->Fill(fDcaPosToPrimVertex);
2841 fh1DcaNegToPrimVertex->Fill(fDcaNegToPrimVertex);
2842 fh1trackPosEta->Fill(PosEta);
2843 fh1trackNegEta->Fill(NegEta);
2846 //_____no jets events______________________________________________________________________________________________________________________________________
2848 if(nRecJetsCuts == 0){//no jet events, before the remaining jet cuts are applied, the second part for the non-jet events comes inside the jet loop
2850 fh1NJ->Fill(1.);//for normalisation by number of NJ events for events in which no rec. jets are found right from the beginning and before even the leading track bias is applied
2852 if(fDebug>6) { std::cout<<"################## nRecJetsCuts == 0 ###################"<<std::endl;
2853 //std::cout<<"fListK0s->GetSize() in NJ event: "<<fListK0s->GetSize()<<std::endl;
2856 for(Int_t it=0; it<fListK0s->GetSize(); ++it){ // loop all K0s
2858 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListK0s->At(it));
2861 Double_t invMK0s =0;
2863 CalculateInvMass(v0, kK0, invMK0s, trackPt);
2864 Double_t fEta = v0->Eta();
2866 Double_t vNJK0[3] = {invMK0s,trackPt,fEta}; //fill all K0s in events wo selected jets
2867 fhnNJK0->Fill(vNJK0);
2871 for(Int_t it=0; it<fListLa->GetSize(); ++it){ // loop all La
2873 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListLa->At(it));
2878 CalculateInvMass(v0, kLambda, invMLa, trackPt);
2879 Double_t fEta = v0->Eta();
2881 Double_t vNJLa[3] = {invMLa,trackPt,fEta}; //fill all K0s in events wo selected jets
2882 fhnNJLa->Fill(vNJLa);
2886 for(Int_t it=0; it<fListALa->GetSize(); ++it){ // loop all ALa
2888 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListALa->At(it));
2891 Double_t invMALa =0;
2893 CalculateInvMass(v0, kAntiLambda, invMALa, trackPt);
2895 Double_t fEta = v0->Eta();
2897 Double_t vNJALa[3] = {invMALa,trackPt,fEta}; //fill all K0s in events wo selected jets
2898 fhnNJALa->Fill(vNJALa);
2905 //____ fill all jet related histos ________________________________________________________________________________________________________________________
2906 //##########################jet loop########################################################################################################################
2908 Int_t nSelJets = nRecJetsCuts; //init value
2909 Bool_t IsOCEvt = kFALSE; //init for this outside cones normalisation histo (total number of OC events)
2910 Bool_t IsRCEvt = kFALSE; //init for that the random cone is placed only once per event
2911 Bool_t IsMCCEvt = kFALSE; //init for that the median cluster cone is placed only once per event
2913 //fill jet histos in general
2914 for(Int_t ij=0; ij<nRecJetsCuts; ++ij){ // ij is an index running over the list of the reconstructed jets after most of the cuts, but not yet the leading track bias, all jets in event are looped
2916 AliAODJet* jet = (AliAODJet*) (fJetsRecCuts->At(ij));
2918 Double_t jetPt = jet->Pt();
2919 Double_t jetEta = jet->Eta();
2920 Double_t jetPhi = jet->Phi();
2922 //if(ij==0){ // loop over leading jets for ij = 0, for ij>= 0 look into all jets
2924 if(ij>=0){//all jets in event
2926 jettracklist->Clear();
2927 Double_t sumPt = 0.;
2928 Bool_t isBadJet = kFALSE;
2929 Int_t njetTracks = 0;
2931 if(GetFFRadius()<=0){
2932 GetJetTracksTrackrefs(jettracklist, jet, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet);// list of jet tracks from trackrefs
2934 GetJetTracksPointing(fTracksRecCuts, jettracklist, jet, GetFFRadius(), sumPt, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet); // fill list of charged hybrid tracks in cone around jet axis with cone Radius (= 0.4 standard), application of leading track cut
2937 //not applied at the moment:
2938 if(GetFFMinNTracks()>0 && jettracklist->GetSize() <= GetFFMinNTracks()) isBadJet = kTRUE; // reject jets with less tracks than fFFMinNTracks
2940 //APPLICATION OF REMAINING JET CUTS (leading track pt bias etc..) + NJ events
2943 nSelJets = nSelJets-1;//remove one jet from nSelJets (was initialized with nRecJetsCuts)
2945 if(nSelJets == 0){//case that event doesn't contain no selected jets at all and there are no jets remaining to be looped over
2947 fh1NJ->Fill(1.);//for normalisation by number of NJ events
2949 for(Int_t it=0; it<fListK0s->GetSize(); ++it){ // loop all K0s
2951 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListK0s->At(it));
2954 Double_t invMK0s =0;
2956 CalculateInvMass(v0, kK0, invMK0s, trackPt);
2957 Double_t fEta = v0->Eta();
2959 Double_t vNJK0[3] = {invMK0s,trackPt,fEta}; //fill all K0s in events wo selected jets
2960 fhnNJK0->Fill(vNJK0);
2964 for(Int_t it=0; it<fListLa->GetSize(); ++it){ // loop all La
2966 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListLa->At(it));
2971 CalculateInvMass(v0, kLambda, invMLa, trackPt);
2972 Double_t fEta = v0->Eta();
2974 Double_t vNJLa[3] = {invMLa,trackPt,fEta}; //fill all K0s in events wo selected jets
2975 fhnNJLa->Fill(vNJLa);
2979 for(Int_t it=0; it<fListALa->GetSize(); ++it){ // loop all ALa
2981 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListALa->At(it));
2984 Double_t invMALa =0;
2986 CalculateInvMass(v0, kAntiLambda, invMALa, trackPt);
2988 Double_t fEta = v0->Eta();
2990 Double_t vNJALa[3] = {invMALa,trackPt,fEta}; //fill all K0s in events wo selected jets
2991 fhnNJALa->Fill(vNJALa);
2997 continue;//rejection of current jet
2998 } // rejects jets in which no track has a track pt higher than 5 GeV/c (see AddTask macro)
3000 if(IsOCEvt == kFALSE){IsOCEvt = kTRUE;fh1OC->Fill(1.);}//the first found jet triggers an OC event and is filled only once into normalisation histo
3002 //Float_t fJetAreaMin = 0.6*TMath::Pi()*GetFFRadius()*GetFFRadius(); // minimum jet area cut, already applied in JetListOfJets() in FF Task
3004 //if(fDebug > 2) {if (jet->EffectiveAreaCharged() < fJetAreaMin) {std::cout<<" fCutjetArea cut removed a jet!!!!! Should not have to be done again!!"<<std::endl;}}// cut on jet area, already done by jet selection in FF task
3006 Double_t dAreaExcluded = TMath::Pi()*dRadiusExcludeCone*dRadiusExcludeCone; // area of the cone
3007 dAreaExcluded -= AreaCircSegment(dRadiusExcludeCone,fCutjetEta-jet->Eta()); // positive eta overhang
3008 dAreaExcluded -= AreaCircSegment(dRadiusExcludeCone,fCutjetEta+jet->Eta()); // negative eta overhang
3009 fh1AreaExcluded->Fill(dAreaExcluded);//histo contains all areas that are jet related and have to be excluded concerning OC UE pt spectrum normalisation by area
3011 fh1JetEta->Fill(jetEta);
3012 fh1JetPhi->Fill(jetPhi);
3013 fh2JetEtaPhi->Fill(jetEta,jetPhi);
3015 // printf("pT = %f, eta = %f, phi = %f, leadtr pt = %f\n, ",jetPt,jetEta,jetphi,leadtrack);
3017 for(Int_t it=0; it<jettracklist->GetSize(); ++it){//loop over all particles in jet
3019 AliVParticle* trackVP = dynamic_cast<AliVParticle*>(jettracklist->At(it));//all tracks in jet cone
3020 if(!trackVP)continue;
3022 Float_t trackPt = trackVP->Pt();//transversal momentum of jet particle
3023 Float_t trackEta = trackVP->Eta();
3025 Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
3027 fFFHistosRecCuts->FillFF(trackPt, jetPt, incrementJetPt);//histo with tracks/jets after cut selection, for all events
3028 if(nK0s>0) fFFHistosRecCutsK0Evt->FillFF(trackPt, jetPt, incrementJetPt);//only for K0s events
3029 fh2FFJetTrackEta->Fill(trackEta,jetPt);
3034 njetTracks = jettracklist->GetSize();
3036 //____________________________________________________________________________________________________________________
3037 //strangeness constribution to jet cone
3041 TList *list = fAOD->GetList();
3042 AliAODMCHeader *mcHeadr=(AliAODMCHeader*)list->FindObject(AliAODMCHeader::StdBranchName());
3043 if(!mcHeadr)continue;
3045 Double_t mcXv=0., mcYv=0., mcZv=0.;//MC primary vertex position
3047 mcXv=mcHeadr->GetVtxX(); mcYv=mcHeadr->GetVtxY(); mcZv=mcHeadr->GetVtxZ(); // position of the MC primary vertex
3049 for(Int_t it=0; it<jettracklist->GetSize(); ++it){//loop over all tracks in the jet
3051 AliVParticle* trackVP = dynamic_cast<AliVParticle*>(jettracklist->At(it));//track in jet cone
3052 if(!trackVP)continue;
3053 AliAODTrack *tr = dynamic_cast<AliAODTrack*> (trackVP); //fetch one jet track from the TList
3056 //get MC label information
3057 TList *mclist = fAOD->GetList();
3059 //fetch the MC stack
3060 TClonesArray* stackMC = (TClonesArray*)mclist->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
3061 if (!stackMC) {Printf("ERROR: stack not available");}
3065 Int_t trackLabel = TMath::Abs(tr->GetLabel()); //fetch jet track label in MC stack
3067 AliAODMCParticle *part = dynamic_cast<AliAODMCParticle*>(stackMC->At(trackLabel)); //fetch MC gen. particle for rec. jet track
3069 if(!part)continue; //skip non-existing objects
3072 //Bool_t IsPhysicalPrimary = part->IsPhysicalPrimary();//not recommended to check, better use distance between primary vertex and secondary vertex
3074 Float_t fDistPrimaryMax = 0.01;
3075 // Get the distance between production point of the MC mother particle and the primary vertex
3077 Double_t dx = mcXv-part->Xv();//mc primary vertex - mc gen. v0 vertex
3078 Double_t dy = mcYv-part->Yv();
3079 Double_t dz = mcZv-part->Zv();
3081 Float_t fDistPrimary = TMath::Sqrt(dx*dx + dy*dy + dz*dz);
3082 Bool_t fPhysicalPrimary = (fDistPrimary < fDistPrimaryMax);
3084 // std::cout<<"fDistPrimary"<<fDistPrimary<<std::endl;
3085 // std::cout<<"fPhysicalPrimary"<<fPhysicalPrimary<<std::endl;
3087 if(!fPhysicalPrimary)continue;//rejects Kstar and other strong decaying particles from Secondary Contamination
3089 Bool_t isFromStrange = kFALSE;// flag to check whether particle has strange mother
3091 Int_t iMother = part->GetMother(); //get mother MC gen. particle label
3094 AliAODMCParticle *partM = dynamic_cast<AliAODMCParticle*>(stackMC->At(iMother)); //fetch mother of MC gen. particle
3095 if(!partM) continue;
3097 Int_t codeM = TMath::Abs(partM->GetPdgCode()); //mothers pdg code
3099 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..)
3101 if (mfl == 3 && codeM != 3) isFromStrange = kTRUE;
3104 if(isFromStrange == kTRUE){
3106 Double_t trackPt = part->Pt();
3107 Double_t trackEta = part->Eta();
3108 //fh3StrContinCone->Fill(jetPt, trackPt, trackEta);//MC gen. particle parameters, but rec. jet pt
3110 }//isFromStrange is kTRUE
3112 }//end loop over jet tracks
3117 fh1TrackMultCone->Fill(njetTracks);
3118 fh2TrackMultCone->Fill(njetTracks,jetPt);
3122 // fQAJetHistosRecCutsLeading->FillJetQA( jet->Eta(), TVector2::Phi_0_2pi(jet->Phi()), jet->Pt() );
3124 for(Int_t it=0; it<fListK0s->GetSize(); ++it){ // loop all K0s
3126 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListK0s->At(it));
3127 if(!v0) continue;//rejection of events with no V0 vertex
3131 TVector3 v0MomVect(v0Mom);
3133 Double_t dPhiJetK0 = (jet->MomentumVector()->Vect()).DeltaPhi(v0MomVect);
3134 // Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
3136 // if(incrementJetPt){fh1V0JetPt->Fill(jetPt);}
3138 Double_t invMK0s =0;
3140 CalculateInvMass(v0, kK0, invMK0s, trackPt); //function to calculate invMass with TLorentzVector class
3142 // fFFHistosIMK0Jet->FillFF(trackPt, invMK0s, jetPt, incrementJetPt);
3145 if(dPhiJetK0<fh1dPhiJetK0->GetXaxis()->GetXmin()) dPhiJetK0 += 2*TMath::Pi();
3146 fh1dPhiJetK0->Fill(dPhiJetK0);
3150 // if(fListK0s->GetSize() == 0){ // no K0: increment jet pt spectrum
3152 // Bool_t incrementJetPt = kTRUE;
3153 // fFFHistosIMK0Jet->FillFF(-1, -1, jetPt, incrementJetPt);
3156 //____fetch reconstructed K0s in cone around jet axis:_______________________________________________________________________________
3158 jetConeK0list->Clear();
3160 Double_t sumPtK0 = 0.;
3162 Bool_t isBadJetK0 = kFALSE; // dummy, do not use
3164 GetTracksInCone(fListK0s, jetConeK0list, jet, GetFFRadius(), sumPtK0, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetK0); //reconstructed K0s in cone around jet axis
3166 if(fDebug>2)Printf("%s:%d nK0s total: %d, in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nK0s,jetConeK0list->GetEntries(),GetFFRadius());
3169 for(Int_t it=0; it<jetConeK0list->GetSize(); ++it){ // loop for K0s in jet cone
3171 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetConeK0list->At(it));
3174 Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
3175 Double_t invMK0s =0;
3180 CalculateInvMass(v0, kK0, invMK0s, trackPt); //function to calculate invMass with TLorentzVector class
3184 Double_t jetPtSmear = -1;
3185 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
3186 if(incrementJetPt == kTRUE){fh1IMK0ConeSmear->Fill(jetPtSmear);} //fill TH1F for normalization purposes
3189 if(incrementJetPt==kTRUE){
3190 fh1IMK0Cone->Fill(jetPt);}//normalisation by number of selected jets
3192 //fFFHistosIMK0Cone->FillFF(trackPt, invMK0s, jetPt, incrementJetPt);
3194 Double_t vK0sCone[4] = {jetPt, invMK0s,trackPt,fEta};
3195 fhnK0sCone->Fill(vK0sCone);
3199 if(jetConeK0list->GetSize() == 0){ // no K0: increment jet pt spectrum
3202 Bool_t incrementJetPt = kTRUE;//jets without K0s will be only filled in TH1F only once, so no increment needed
3203 //fFFHistosIMK0Cone->FillFF(-1, -1, jetPt, incrementJetPt);
3204 Double_t vK0sCone[4] = {jetPt, -1, -1, -1};
3205 fhnK0sCone->Fill(vK0sCone);
3207 if(incrementJetPt==kTRUE){
3208 fh1IMK0Cone->Fill(jetPt);}//normalisation by number of selected jets
3211 Double_t jetPtSmear = -1;
3212 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
3213 if(incrementJetPt == kTRUE){fh1IMK0ConeSmear->Fill(jetPtSmear);} //fill TH1F for normalization purposes
3217 //Random cones________________________________________________________________________
3220 if(IsRCEvt == kFALSE){//fetch random cone V0s only once per event
3223 IsRCEvt = kTRUE;//set boolean to kTRUE once a random cone is placed per event
3225 AliAODJet* jetRC = 0;
3226 jetRC = GetRandomCone(fJetsRecCuts, fCutjetEta, 2*GetFFRadius());//fetch one random cone for each event
3228 fListK0sRC->Clear();//list for K0s in random cone (RC), one RC per event
3230 fListALaRC->Clear();
3232 Double_t sumPtK0sRC = 0;
3233 Double_t sumPtLaRC = 0;
3234 Double_t sumPtALaRC = 0;
3235 Bool_t isBadJetK0sRC = kFALSE;
3236 Bool_t isBadJetLaRC = kFALSE;
3237 Bool_t isBadJetALaRC = kFALSE;
3240 if(jetRC != 0) {//if random cone was selected properly and fullfilling all the requirements
3243 fh1RC->Fill(1.);//for normalisation purposes
3245 GetTracksInCone(fListK0s, fListK0sRC, jetRC, GetFFRadius(), sumPtK0sRC, 0, 0, isBadJetK0sRC);
3247 //________________fill RC with all V0s__________________
3248 for(Int_t it=0; it<fListK0sRC->GetSize(); ++it){ // loop for K0s in random cone
3250 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListK0sRC->At(it));
3253 Double_t invMK0s =0;
3258 CalculateInvMass(v0, kK0, invMK0s, trackPt); //function to calculate invMass with TLorentzVector class
3260 Double_t vK0sRC[3] = {invMK0s,trackPt,fEta};
3261 fhnK0sRC->Fill(vK0sRC);
3266 GetTracksInCone(fListLa, fListLaRC, jetRC, GetFFRadius(), sumPtLaRC, 0, 0, isBadJetLaRC);
3268 for(Int_t it=0; it<fListLaRC->GetSize(); ++it){ // loop for Lambdas in random cone
3270 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListLaRC->At(it));
3278 CalculateInvMass(v0, kLambda, invMLa, trackPt); //function to calculate invMass with TLorentzVector class
3280 Double_t vLaRC[3] = {invMLa,trackPt,fEta};
3281 fhnLaRC->Fill(vLaRC);
3286 GetTracksInCone(fListALa, fListALaRC, jetRC, GetFFRadius(), sumPtALaRC, 0, 0, isBadJetALaRC);
3288 for(Int_t it=0; it<fListALaRC->GetSize(); ++it){ // loop for Lambdas in random cone
3290 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListALaRC->At(it));
3293 Double_t invMALa =0;
3298 CalculateInvMass(v0, kAntiLambda, invMALa, trackPt); //function to calculate invMass with TLorentzVector class
3300 Double_t vALaRC[3] = {invMALa,trackPt,fEta};
3301 fhnALaRC->Fill(vALaRC);
3305 if(isBadJetK0sRC == kFALSE){ //in case RC contains at least one K0s with minimum pT
3306 fh1RCBiasK0->Fill(1.);//for normalisation purposes
3308 //________________fill RC (with trigger particle bias)_____________
3309 for(Int_t it=0; it<fListK0sRC->GetSize(); ++it){ // loop for K0s in random cone
3311 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListK0sRC->At(it));
3314 Double_t invMK0s =0;
3319 CalculateInvMass(v0, kK0, invMK0s, trackPt); //function to calculate invMass with TLorentzVector class
3321 //Double_t vK0sRC[3] = {invMK0s,trackPt,fEta};
3322 //fhnK0sRCBias->Fill(vK0sRC);
3327 if(isBadJetLaRC == kFALSE){ //in case RC contains at least one Lambda with minimum pT
3328 fh1RCBiasLa->Fill(1.);//for normalisation purposes
3329 for(Int_t it=0; it<fListLaRC->GetSize(); ++it){ // loop for Lambdas in random cone
3331 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListLaRC->At(it));
3339 CalculateInvMass(v0, kLambda, invMLa, trackPt); //function to calculate invMass with TLorentzVector class
3341 //Double_t vLaRC[3] = {invMLa,trackPt,fEta};
3342 //fhnLaRCBias->Fill(vLaRC);
3348 if(isBadJetALaRC == kFALSE){ //in case RC contains at least one Antilambda with minimum pT
3349 fh1RCBiasALa->Fill(1.);//for normalisation purposes
3350 for(Int_t it=0; it<fListALaRC->GetSize(); ++it){ // loop for Lambdas in random cone
3352 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListALaRC->At(it));
3355 Double_t invMALa =0;
3360 CalculateInvMass(v0, kAntiLambda, invMALa, trackPt); //function to calculate invMass with TLorentzVector class
3362 //Double_t vALaRC[3] = {invMALa,trackPt,fEta};
3363 //fhnALaRCBias->Fill(vALaRC);
3370 fListK0sRC->Clear();
3372 fListALaRC->Clear();
3376 //fetch particles in perpendicular cone to estimate UE event contribution to particle spectrum
3377 //these perpendicular cone particle spectra serve to subtract the particles in jet cones, that are stemming from the Underlying event, on a statistical basis
3378 //for normalization the common jet pT spectrum is used: fh1IMK0Cone, fh1IMLaCone and fh1IMALaCone
3380 //____fetch reconstructed K0s in cone perpendicular to jet axis:_______________________________________________________________________________
3383 jetPerpConeK0list->Clear();
3384 Double_t sumPerpPtK0 = 0.;
3386 GetTracksInPerpCone(fListK0s, jetPerpConeK0list, jet, GetFFRadius(), sumPerpPtK0); //reconstructed K0s in cone around jet axis
3388 if(fDebug>2)Printf("%s:%d nK0s total: %d, in perp jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nK0s,jetPerpConeK0list->GetEntries(),GetFFRadius());
3390 for(Int_t it=0; it<jetPerpConeK0list->GetSize(); ++it){ // loop for K0s in perpendicular cone
3392 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetPerpConeK0list->At(it));
3395 Double_t invMPerpK0s =0;
3400 CalculateInvMass(v0, kK0, invMPerpK0s, trackPt); //function to calculate invMass with TLorentzVector class
3401 Double_t vK0sPC[4] = {jetPt, invMPerpK0s,trackPt,fEta};
3403 fhnK0sPC->Fill(vK0sPC); //(x,y,z) //pay attention, this histogram contains the V0 content of both (+/- 90 degrees) perp. cones!!
3408 if(jetPerpConeK0list->GetSize() == 0){ // no K0s in jet cone
3410 Double_t vK0sPC[4] = {jetPt, -1, -1 , -999};//default values for case: no K0s is found in PC
3411 fhnK0sPC->Fill(vK0sPC);
3416 if(IsMCCEvt == kFALSE){//median cluster only once for event
3422 AliAODJet* medianCluster = GetMedianCluster();
3425 // ____ rec K0s in median cluster___________________________________________________________________________________________________________
3428 jetMedianConeK0list->Clear();
3429 jetMedianConeLalist->Clear();
3430 jetMedianConeALalist->Clear();
3432 Double_t medianEta = medianCluster->Eta();
3434 if(TMath::Abs(medianEta)<=fCutjetEta){
3436 fh1MedianEta->Fill(medianEta);
3437 fh1JetPtMedian->Fill(jetPt);
3438 fh1MCC->Fill(1.);//for normalisation by total number of median cluster jets
3439 Double_t sumMedianPtK0 = 0.;
3441 Bool_t isBadJetK0Median = kFALSE; // dummy, do not use
3443 GetTracksInCone(fListK0s, jetMedianConeK0list, medianCluster, GetFFRadius(), sumMedianPtK0, 0., 0., isBadJetK0Median); //reconstructed K0s in median cone around jet axis
3444 //GetTracksInCone(fListK0s, jetConeK0list, jet, GetFFRadius(), sumPtK0, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetK0); //original use of function
3446 //cut parameters from Fragmentation Function task:
3447 //Float_t fFFMinLTrackPt; // reject jets with leading track with pt smaller than this value, use GetFFMinLTrackPt()
3448 //Float_t fFFMaxTrackPt; // reject jetscontaining any track with pt larger than this value, use GetFFMaxTrackPt()
3450 for(Int_t it=0; it<jetMedianConeK0list->GetSize(); ++it){ // loop for K0s in median cone
3452 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetMedianConeK0list->At(it));
3455 Double_t invMMedianK0s =0;
3460 CalculateInvMass(v0, kK0, invMMedianK0s, trackPt); //function to calculate invMass with TLorentzVector class
3461 Double_t vK0sMCC[3] = {invMMedianK0s,trackPt,fEta};
3462 fhnK0sMCC->Fill(vK0sMCC);
3466 if(jetMedianConeK0list->GetSize() == 0){ // no K0s in median cluster cone
3468 Double_t vK0sMCC[3] = {-1, -1, -999};
3469 fhnK0sMCC->Fill(vK0sMCC);
3473 //__________________________________________________________________________________________________________________________________________
3474 // ____ rec Lambdas in median cluster___________________________________________________________________________________________________________
3476 Double_t sumMedianPtLa = 0.;
3477 Bool_t isBadJetLaMedian = kFALSE; // dummy, do not use
3479 GetTracksInCone(fListLa, jetMedianConeLalist, medianCluster, GetFFRadius(), sumMedianPtLa, 0, 0, isBadJetLaMedian); //reconstructed Lambdas in median cone around jet axis
3481 //cut parameters from Fragmentation Function task:
3482 //Float_t fFFMinLTrackPt; // reject jets with leading track with pt smaller than this value, use GetFFMinLTrackPt()
3483 //Float_t fFFMaxTrackPt; // reject jets containing any track with pt larger than this value, use GetFFMaxTrackPt()
3485 for(Int_t it=0; it<jetMedianConeLalist->GetSize(); ++it){ // loop for Lambdas in perpendicular cone
3487 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetMedianConeLalist->At(it));
3490 Double_t invMMedianLa =0;
3495 CalculateInvMass(v0, kLambda, invMMedianLa, trackPt); //function to calculate invMass with TLorentzVector class
3497 Double_t vLaMCC[3] = {invMMedianLa,trackPt,fEta};
3498 fhnLaMCC->Fill(vLaMCC);
3501 if(jetMedianConeLalist->GetSize() == 0){ // no Lambdas in median cluster cone
3503 Double_t vLaMCC[4] = {jetPt, -1, -1, -999};
3504 fhnLaMCC->Fill(vLaMCC);
3509 // ____ rec Antilambdas in median cluster___________________________________________________________________________________________________________
3512 Double_t sumMedianPtALa = 0.;
3514 Bool_t isBadJetALaMedian = kFALSE; // dummy, do not use
3516 GetTracksInCone(fListALa, jetMedianConeALalist, medianCluster, GetFFRadius(), sumMedianPtALa, 0, 0, isBadJetALaMedian); //reconstructed Antilambdas in median cone around jet axis
3519 //cut parameters from Fragmentation Function task:
3520 //Float_t fFFMinLTrackPt; // reject jets with leading track with pt smaller than this value, use GetFFMinLTrackPt()
3521 //Float_t fFFMaxTrackPt; // reject jets containing any track with pt larger than this value, use GetFFMaxTrackPt()
3523 for(Int_t it=0; it<jetMedianConeALalist->GetSize(); ++it){ // loop for Antilambdas in median cluster cone
3525 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetMedianConeALalist->At(it));
3528 Double_t invMMedianALa =0;
3534 CalculateInvMass(v0, kAntiLambda, invMMedianALa, trackPt); //function to calculate invMass with TLorentzVector class
3535 Double_t vALaMCC[3] = {invMMedianALa,trackPt,fEta};
3536 fhnALaMCC->Fill(vALaMCC);
3540 if(jetMedianConeALalist->GetSize() == 0){ // no Antilambdas in median cluster cone
3542 Double_t vALaMCC[4] = {jetPt, -1, -1, -999};
3543 fhnALaMCC->Fill(vALaMCC);
3546 }//median cluster eta cut
3548 jetMedianConeK0list->Clear();
3549 jetMedianConeLalist->Clear();
3550 jetMedianConeALalist->Clear();
3552 }//if mediancluster is existing
3553 }//end (IsMCCEvt == kFALSE)
3554 //_________________________________________________________________________________________________________________________________________
3556 //____fetch reconstructed Lambdas in cone perpendicular to jet axis:__________________________________________________________________________
3558 jetPerpConeLalist->Clear();
3559 Double_t sumPerpPtLa = 0.;
3561 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!!
3563 if(fDebug>2)Printf("%s:%d nLa total: %d, in perp jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nLa,jetPerpConeLalist->GetEntries(),GetFFRadius());
3565 for(Int_t it=0; it<jetPerpConeLalist->GetSize(); ++it){ // loop for Lambdas in perpendicular cone
3567 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetPerpConeLalist->At(it));
3570 Double_t invMPerpLa =0;
3575 CalculateInvMass(v0, kLambda, invMPerpLa, trackPt); //function to calculate invMass with TLorentzVector class
3576 Double_t vLaPC[4] = {jetPt, invMPerpLa,trackPt,fEta};
3577 fhnLaPC->Fill(vLaPC); //(x,y,z) //pay attention, this histogram contains the V0 content of both (+/- 90 degrees) perp. cones!!
3582 if(jetPerpConeLalist->GetSize() == 0){ // no Lambdas in jet
3584 Double_t vLaPC[4] = {jetPt, -1, -1 , -999};//default values for case: no K0s is found in PC
3585 fhnLaPC->Fill(vLaPC);
3591 //____fetch reconstructed Antilambdas in cone perpendicular to jet axis:___________________________________________________________________
3593 jetPerpConeALalist->Clear();
3594 Double_t sumPerpPtALa = 0.;
3596 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!!
3598 if(fDebug>2)Printf("%s:%d nALa total: %d, in perp jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nALa,jetPerpConeALalist->GetEntries(),GetFFRadius());
3600 for(Int_t it=0; it<jetPerpConeALalist->GetSize(); ++it){ // loop for ALa in perpendicular cone
3602 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetPerpConeALalist->At(it));
3605 Double_t invMPerpALa =0;
3610 CalculateInvMass(v0, kAntiLambda, invMPerpALa, trackPt); //function to calculate invMass with TLorentzVector class
3611 Double_t vALaPC[4] = {jetPt, invMPerpALa,trackPt,fEta};
3612 fhnALaPC->Fill(vALaPC);
3617 if(jetPerpConeALalist->GetSize() == 0){ // no Antilambda
3619 Double_t vALaPC[4] = {jetPt, -1, -1, -999};
3620 fhnALaPC->Fill(vALaPC);
3626 //###########################################################################################################
3628 //__________________________________________________________________________________________________________________________________________
3632 //fill feeddown candidates from TList
3633 //std::cout<<"fListFeeddownLaCand entries: "<<fListFeeddownLaCand->GetSize()<<std::endl;
3635 Double_t sumPtFDLa = 0.;
3636 Bool_t isBadJetFDLa = kFALSE; // dummy, do not use
3638 GetTracksInCone(fListFeeddownLaCand, jetConeFDLalist, jet, GetFFRadius(), sumPtFDLa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetFDLa);
3640 Double_t sumPtFDALa = 0.;
3641 Bool_t isBadJetFDALa = kFALSE; // dummy, do not use
3643 GetTracksInCone(fListFeeddownALaCand, jetConeFDALalist, jet, GetFFRadius(), sumPtFDALa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetFDALa);
3645 //_________________________________________________________________
3646 for(Int_t it=0; it<fListFeeddownLaCand->GetSize(); ++it){
3648 AliAODv0* mcfd = dynamic_cast<AliAODv0*>(fListFeeddownLaCand->At(it));
3651 Double_t invMLaFDcand = 0;
3652 Double_t trackPt = 0;//pt of ass. particle, not used for the histos
3654 CalculateInvMass(mcfd, kLambda, invMLaFDcand, trackPt);
3656 //Get MC gen. Lambda transverse momentum
3657 TClonesArray *st = 0x0;
3660 TList *lt = fAOD->GetList();
3663 st = (TClonesArray*)lt->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
3666 AliAODTrack *daughtertrack = (AliAODTrack *) (mcfd->GetSecondaryVtx()->GetDaughter(0));//fetch the first of the two daughter tracks
3667 Int_t AssLabel = TMath::Abs(daughtertrack->GetLabel());
3669 AliAODMCParticle *mcDaughterPart =(AliAODMCParticle*)st->UncheckedAt(AssLabel);
3671 Int_t v0lab = mcDaughterPart->GetMother();
3673 // Int_t v0lab= TMath::Abs(mcfd->GetLabel());//GetLabel doesn't work for AliAODv0 class!!! Only for AliAODtrack
3675 if((!v0lab) || (v0lab<0) || (v0lab > st->GetEntriesFast()))continue;//validity checks
3677 AliAODMCParticle *mcp=(AliAODMCParticle*)st->UncheckedAt(v0lab);
3679 Double_t genLaPt = mcp->Pt();
3681 //std::cout<<"Incl FD, genLaPt:"<<genLaPt<<std::endl;
3683 Double_t vFeedDownLa[3] = {5., invMLaFDcand, genLaPt};
3684 fhnFeedDownLa->Fill(vFeedDownLa);
3687 }//end loop over feeddown candidates for Lambda particles in jet cone
3688 //fetch MC truth in jet cones, denominator of rec. efficiency in jet cones
3689 //_________________________________________________________________
3690 for(Int_t it=0; it<jetConeFDLalist->GetSize(); ++it){
3692 AliAODv0* mcfd = dynamic_cast<AliAODv0*>(jetConeFDLalist->At(it));
3695 //std::cout<<"Cone, recLaPt:"<<mcfd->Pt()<<std::endl;
3697 Double_t invMLaFDcand = 0;
3698 Double_t trackPt = mcfd->Pt();//pt of ass. particle, not used for the histos
3700 CalculateInvMass(mcfd, kLambda, invMLaFDcand, trackPt);
3702 //Get MC gen. Lambda transverse momentum
3703 TClonesArray *st = 0x0;
3705 TList *lt = fAOD->GetList();
3708 st = (TClonesArray*)lt->FindObject(AliAODMCParticle::StdBranchName());
3710 AliAODTrack *daughtertrack = (AliAODTrack *) (mcfd->GetSecondaryVtx()->GetDaughter(0));//fetch the first of the two daughter tracks
3711 Int_t AssLabel = TMath::Abs(daughtertrack->GetLabel());
3713 AliAODMCParticle *mcDaughterPart =(AliAODMCParticle*)st->UncheckedAt(AssLabel);
3715 Int_t v0lab = mcDaughterPart->GetMother();
3717 //std::cout<<"v0lab: "<<v0lab<<std::endl;
3719 if((!v0lab) || (v0lab<0) || (v0lab > st->GetEntriesFast()))continue;//validity checks
3721 AliAODMCParticle *mcp=(AliAODMCParticle*)st->UncheckedAt(v0lab);
3723 Double_t genLaPt = mcp->Pt();
3726 //std::cout<<"Cone FD, genLaPt:"<<genLaPt<<std::endl;
3728 Double_t vFeedDownLaCone[3] = {jetPt, invMLaFDcand, genLaPt};
3729 fhnFeedDownLaCone->Fill(vFeedDownLaCone);
3732 }//end loop over feeddown candidates for Lambda particles in jet cone
3734 //_________________________________________________________________
3735 for(Int_t it=0; it<fListFeeddownALaCand->GetSize(); ++it){
3737 AliAODv0* mcfd = dynamic_cast<AliAODv0*>(fListFeeddownALaCand->At(it));
3740 Double_t invMALaFDcand = 0;
3741 Double_t trackPt = 0;//pt of ass. particle, not used for the histos
3743 CalculateInvMass(mcfd, kAntiLambda, invMALaFDcand, trackPt);
3745 //Get MC gen. Antilambda transverse momentum
3746 TClonesArray *st = 0x0;
3748 TList *lt = fAOD->GetList();
3751 st = (TClonesArray*)lt->FindObject(AliAODMCParticle::StdBranchName());
3753 AliAODTrack *daughtertrack = (AliAODTrack *) (mcfd->GetSecondaryVtx()->GetDaughter(0));//fetch the first of the two daughter tracks
3754 Int_t AssLabel = TMath::Abs(daughtertrack->GetLabel());
3756 AliAODMCParticle *mcDaughterPart =(AliAODMCParticle*)st->UncheckedAt(AssLabel);
3758 Int_t v0lab = mcDaughterPart->GetMother();
3761 if((!v0lab) || (v0lab<0) || (v0lab > st->GetEntriesFast()))continue;//validity checks
3763 AliAODMCParticle *mcp=(AliAODMCParticle*)st->UncheckedAt(v0lab);
3765 Double_t genALaPt = mcp->Pt();
3767 Double_t vFeedDownALa[3] = {5., invMALaFDcand, genALaPt};
3768 fhnFeedDownALa->Fill(vFeedDownALa);
3771 }//end loop over feeddown candidates for Antilambda particles
3773 //_________________________________________________________________
3774 //feeddown for Antilambdas from Xi(bar)+ and Xi(bar)0 in jet cone:
3776 for(Int_t it=0; it<jetConeFDALalist->GetSize(); ++it){
3778 AliAODv0* mcfd = dynamic_cast<AliAODv0*>(jetConeFDALalist->At(it));
3781 Double_t invMALaFDcand = 0;
3782 Double_t trackPt = 0;//pt of ass. particle, not used for the histos
3784 CalculateInvMass(mcfd, kAntiLambda, invMALaFDcand, trackPt);
3786 //Get MC gen. Antilambda transverse momentum
3787 TClonesArray *st = 0x0;
3789 TList *lt = fAOD->GetList();
3792 st = (TClonesArray*)lt->FindObject(AliAODMCParticle::StdBranchName());
3794 AliAODTrack *daughtertrack = (AliAODTrack *) (mcfd->GetSecondaryVtx()->GetDaughter(0));//fetch the first of the two daughter tracks
3795 Int_t AssLabel = TMath::Abs(daughtertrack->GetLabel());
3797 AliAODMCParticle *mcDaughterPart =(AliAODMCParticle*)st->UncheckedAt(AssLabel);
3799 Int_t v0lab = mcDaughterPart->GetMother();
3801 if((!v0lab) || (v0lab<0) || (v0lab > st->GetEntriesFast()))continue;//validity checks
3803 AliAODMCParticle *mcp=(AliAODMCParticle*)st->UncheckedAt(v0lab);
3805 Double_t genALaPt = mcp->Pt();
3807 Double_t vFeedDownALaCone[3] = {jetPt, invMALaFDcand, genALaPt};
3808 fhnFeedDownALaCone->Fill(vFeedDownALaCone);
3811 }//end loop over feeddown candidates for Antilambda particles in jet cone
3815 //____fetch MC generated K0s in cone around jet axis__(note: particles can stem from fragmentation but also from underlying event)________
3817 Double_t sumPtMCgenK0s = 0.;
3818 Bool_t isBadJetMCgenK0s = kFALSE; // dummy, do not use
3821 fListMCgenK0sCone->Clear(); //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!!)
3823 //first: sampling MC gen K0s
3825 GetTracksInCone(fListMCgenK0s, fListMCgenK0sCone, jet, GetFFRadius(), sumPtMCgenK0s, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetMCgenK0s); //MC generated K0s in cone around jet axis
3827 if(fDebug>2)Printf("%s:%d nMCgenK0s in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,fListMCgenK0sCone->GetEntries(),GetFFRadius());
3830 /* for(Int_t it=0; it<fListMCgenK0sCone->GetSize(); ++it){ // loop MC generated K0s in cone around jet axis
3832 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenK0sCone->At(it));
3835 //Double_t fRapMCgenK0s = MyRapidity(mcp0->E(),mcp0->Pz());//get rec. particle in cone information
3836 Double_t fEtaMCgenK0s = mcp0->Eta();
3837 Double_t fPtMCgenK0s = mcp0->Pt();
3839 //fh2MCgenK0Cone->Fill(jetPt,fPtMCgenK0s);
3840 // fh2MCEtagenK0Cone->Fill(jetPt,fEtaMCgenK0s);
3844 //check whether the reconstructed K0s in jet cone are stemming from MC gen K0s (on MCgenK0s list):__________________________________________________
3846 for(Int_t ic=0; ic<jetConeK0list->GetSize(); ++ic){ //loop over all reconstructed K0s in jet cone
3848 //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
3850 Int_t negDaughterpdg;
3851 Int_t posDaughterpdg;
3854 Double_t fPtMCrecK0Match;
3855 Double_t invMK0Match;
3859 Bool_t fPhysicalPrimary = -1;
3860 Int_t MCv0PDGCode =0;
3861 Double_t jetPtSmear = -1;
3863 AliAODv0* v0c = dynamic_cast<AliAODv0*>(jetConeK0list->At(ic));//pointer to reconstructed K0s inside jet cone (cone is placed around reconstructed jet axis)
3865 //AliAODv0* v0c = dynamic_cast<AliAODv0*>(fListK0s->At(ic));//pointer to reconstructed K0s
3868 Bool_t daughtercheck = DaughterTrackCheck(v0c, nnum, pnum);//check daughter tracks have proper sign
3869 if(daughtercheck == kFALSE)continue;
3871 const AliAODTrack *trackMCNeg=(AliAODTrack *)(v0c->GetDaughter(nnum));
3872 const AliAODTrack *trackMCPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
3874 TString generatorName;
3875 TList *listmc = fAOD->GetList();
3877 Bool_t mclabelcheck = MCLabelCheck(v0c, kK0, trackMCNeg, trackMCPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PDGCode, generatorName, isinjected);
3879 if(mclabelcheck == kFALSE)continue;
3880 if(fPhysicalPrimary == kFALSE)continue; //requirements for rec. V0 associated to MC true primary particle
3882 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
3884 //for(Int_t it=0; it<fListMCgenK0sCone->GetSize(); ++it){//belongs to previous definition of rec. eff. of V0s within jet cone
3886 //Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
3887 //AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenK0sCone->At(it));
3888 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenK0s->At(it));
3891 Bool_t particleMatching = IsParticleMatching(mcp0, v0Label);
3893 if(particleMatching == kFALSE)continue; //if reconstructed V0 particle doesn't match to the associated MC particle go to next stack entry
3894 CalculateInvMass(v0c, kK0, invMK0Match, fPtMCrecK0Match);
3895 Double_t fEta = v0c->Eta();
3896 Double_t fPtMCgenK0s = mcp0->Pt();//pt has to be always MC truth value!
3898 Double_t vMCrecK0Cone[4] = {jetPt, invMK0Match,fPtMCgenK0s,fEta};
3899 fhnMCrecK0Cone->Fill(vMCrecK0Cone); //fill matching rec. K0s in 3D histogram
3901 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear); //jetPt, cent, jetRadius, ptmintrack, &jetPtSmear
3903 Double_t vMCrecK0ConeSmear[4] = {jetPtSmear, invMK0Match,fPtMCgenK0s,fEta};
3904 fhnMCrecK0ConeSmear->Fill(vMCrecK0ConeSmear);
3906 //fill matching rec. K0s in 3D histogram, jet pT smeared according to deltaptjet distribution width
3909 } // end MCgenK0s / MCgenK0sCone loop
3912 //check the K0s daughters contamination of the jet tracks:
3914 TClonesArray *stackMC = 0x0;
3916 for(Int_t it=0; it<jettracklist->GetSize(); ++it){//loop over all particles in the jet
3918 AliVParticle* trackVP = dynamic_cast<AliVParticle*>(jettracklist->At(it));//all tracks in jet cone
3919 if(!trackVP)continue;
3920 AliAODTrack *tr = dynamic_cast<AliAODTrack*> (trackVP); //fetch one jet track from the TList
3923 //get MC label information
3924 TList *mclist = fAOD->GetList(); //fetch the MC stack
3925 if(!mclist)continue;
3927 stackMC = (TClonesArray*)mclist->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
3928 if (!stackMC) {Printf("ERROR: stack not available");}
3931 Int_t particleLabel = TMath::Abs(tr->GetLabel()); //fetch jet track label in MC stack
3933 //v0c is pointer to K0s candidate, is fetched already above, here it is just checked again whether daughters are properly ordered by their charge
3935 Bool_t daughterchecks = DaughterTrackCheck(v0c, nnum, pnum);
3937 if(daughterchecks == kFALSE)continue; //make sure that daughters are properly ordered
3939 const AliAODTrack *trackNeg=(AliAODTrack *)(v0c->GetDaughter(nnum)); //fetch v0 daughters of reconstructed K0s
3940 const AliAODTrack *trackPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
3942 if(!trackNeg)continue;
3943 if(!trackPos)continue;
3945 Int_t negAssLabel = TMath::Abs(trackNeg->GetLabel()); //negative (reconstructed) charged track label in MC stack
3946 Int_t posAssLabel = TMath::Abs(trackPos->GetLabel()); //positive (reconstructed) charged track label in MC stack
3949 if(particleLabel == posAssLabel){ //check whether jet track and each of the rec. K0s daughters have same MC stack label -> are identical
3950 AliAODMCParticle* mctrackPos = dynamic_cast<AliAODMCParticle*>(stackMC->At(posAssLabel));
3951 if(!mctrackPos) continue;
3952 Double_t trackPosPt = mctrackPos->Pt();
3953 Double_t trackPosEta = mctrackPos->Eta();
3955 Double_t vK0sSecContinCone[3] = {jetPt, trackPosPt, trackPosEta};
3956 fhnK0sSecContinCone->Fill(vK0sSecContinCone);} //if it's the case, fill jet pt, daughter track pt and track eta in histo
3958 if(particleLabel == negAssLabel){
3959 AliAODMCParticle* mctrackNeg = dynamic_cast<AliAODMCParticle*>(stackMC->At(negAssLabel));
3960 if(!mctrackNeg) continue;
3961 Double_t trackNegPt = mctrackNeg->Pt();
3962 Double_t trackNegEta = mctrackNeg->Eta();
3964 Double_t vK0sSecContinCone[3] = {jetPt, trackNegPt, trackNegEta};
3965 fhnK0sSecContinCone->Fill(vK0sSecContinCone);} //if it's the case, fill jet pt, daughter track pt and track eta in histo
3973 } //end rec-K0-in-cone loop
3975 //________________________________________________________________________________________________________________________________________________________
3977 fListMCgenK0sCone->Clear();
3982 jetConeK0list->Clear();
3983 jetPerpConeK0list->Clear();
3984 jetPerpConeLalist->Clear();
3985 jetPerpConeALalist->Clear();
3988 //---------------La--------------------------------------------------------------------------------------------------------------------------------------------
3990 // fQAJetHistosRecCutsLeading->FillJetQA( jet->Eta(), TVector2::Phi_0_2pi(jet->Phi()), jet->Pt() );
3992 for(Int_t it=0; it<fListLa->GetSize(); ++it){ // loop all La
3994 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListLa->At(it));
3999 TVector3 v0MomVect(v0Mom);
4001 Double_t dPhiJetLa = (jet->MomentumVector()->Vect()).DeltaPhi(v0MomVect);
4006 CalculateInvMass(v0, kLambda, invMLa, trackPt); //function to calculate invMass with TLorentzVector class
4007 // Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
4009 //if(incrementJetPt){fh1V0JetPt->Fill(jetPt);}
4011 //fFFHistosIMLaJet->FillFF(trackPt, invMLa, jetPt, incrementJetPt);
4013 if(dPhiJetLa<fh1dPhiJetLa->GetXaxis()->GetXmin()) dPhiJetLa += 2*TMath::Pi();
4014 fh1dPhiJetLa->Fill(dPhiJetLa);
4017 /* if(fListLa->GetSize() == 0){ // no La: increment jet pt spectrum
4019 Bool_t incrementJetPt = kTRUE;
4020 fFFHistosIMLaJet->FillFF(-1, -1, jetPt, incrementJetPt);
4024 // ____fetch rec. Lambdas in cone around jet axis_______________________________________________________________________________________
4026 jetConeLalist->Clear();
4027 Double_t sumPtLa = 0.;
4028 Bool_t isBadJetLa = kFALSE; // dummy, do not use
4030 GetTracksInCone(fListLa, jetConeLalist, jet, GetFFRadius(), sumPtLa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetLa);//method inherited from FF
4032 if(fDebug>2)Printf("%s:%d nLa total: %d, in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nLa,jetConeLalist->GetEntries(),GetFFRadius());
4034 for(Int_t it=0; it<jetConeLalist->GetSize(); ++it){ // loop La in jet cone
4036 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetConeLalist->At(it));
4042 Bool_t daughtercheck = DaughterTrackCheck(v0, nnum, pnum);
4043 if(daughtercheck == kFALSE)continue;
4050 CalculateInvMass(v0, kLambda, invMLa, trackPt); //function to calculate invMass with TLorentzVector class
4052 Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;//needed for all histos, which serve for normalisation
4056 Int_t negDaughterpdg;
4057 Int_t posDaughterpdg;
4060 Double_t jetPtSmear = -1;
4062 Bool_t fPhysicalPrimary = -1;
4063 Int_t MCv0PDGCode =0;
4064 TString generatorName;
4066 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
4067 if(incrementJetPt == kTRUE){fh1IMLaConeSmear->Fill(jetPtSmear);
4069 const AliAODTrack *trackNeg=(AliAODTrack *)(v0->GetDaughter(nnum));
4070 const AliAODTrack *trackPos=(AliAODTrack *)(v0->GetDaughter(pnum));
4072 TList *listmc = fAOD->GetList();
4074 Bool_t mclabelcheck = MCLabelCheck(v0, kLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PDGCode, generatorName, isinjected);
4075 if(mclabelcheck == kFALSE)continue;
4077 //std::cout<<"generatorName: "<<generatorName<<std::endl;
4079 if(generatorName == "Hijing"){
4080 Double_t vrecMCHijingLaCone[4] = {jetPt, invMLa,trackPt,fEta};
4081 fhnrecMCHijingLaCone->Fill(vrecMCHijingLaCone);
4084 if(isinjected == kTRUE){
4085 Double_t vrecMCInjectLaCone[4] = {jetPt, invMLa,trackPt,fEta};
4086 fhnrecMCInjectLaCone->Fill(vrecMCInjectLaCone);
4089 }//fill TH1F for normalization purposes
4090 }//end MC analysis part
4092 if(incrementJetPt==kTRUE){
4093 fh1IMLaCone->Fill(jetPt);}//normalisation by number of selected jets
4095 //fFFHistosIMLaCone->FillFF(trackPt, invMLa, jetPt, incrementJetPt);
4096 Double_t vLaCone[4] = {jetPt, invMLa,trackPt,fEta};
4097 fhnLaCone->Fill(vLaCone);
4100 if(jetConeLalist->GetSize() == 0){ // no La: increment jet pt spectrum
4102 Bool_t incrementJetPt = kTRUE;
4103 // fFFHistosIMLaCone->FillFF(-1, -1, jetPt, incrementJetPt);
4104 Double_t vLaCone[4] = {jetPt, -1, -1, -1};
4105 fhnLaCone->Fill(vLaCone);
4107 if(incrementJetPt==kTRUE){
4108 fh1IMLaCone->Fill(jetPt);}//normalisation by number of selected jets
4111 Double_t jetPtSmear;
4112 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
4113 if(incrementJetPt == kTRUE){
4114 fh1IMLaConeSmear->Fill(jetPtSmear);
4123 //____fetch MC generated Lambdas in cone around jet axis__(particles can stem from fragmentation but also from underlying event)_____________
4125 Double_t sumPtMCgenLa = 0.;
4126 Bool_t isBadJetMCgenLa = kFALSE; // dummy, do not use
4128 //sampling MC gen. Lambdas in cone around reconstructed jet axis
4130 fListMCgenLaCone->Clear();
4131 GetTracksInCone(fListMCgenLa, fListMCgenLaCone, jet, GetFFRadius(), sumPtMCgenLa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetMCgenLa);//fetch MC generated Lambdas in cone of resolution parameter R around jet axis
4133 if(fDebug>2)Printf("%s:%d nMCgenLa in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,fListMCgenLaCone->GetEntries(),GetFFRadius());
4135 /* for(Int_t it=0; it<fListMCgenLaCone->GetSize(); ++it){ // loop MC generated La in cone around jet axis
4137 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenLaCone->At(it));
4140 //Double_t fRapMCgenLa = MyRapidity(mcp0->E(),mcp0->Pz());
4141 Double_t fEtaMCgenLa = mcp0->Eta();
4142 Double_t fPtMCgenLa = mcp0->Pt();
4144 // fh2MCgenLaCone->Fill(jetPt,fPtMCgenLa);
4145 //fh2MCEtagenLaCone->Fill(jetPt,fEtaMCgenLa);
4149 //check whether the reconstructed La are stemming from MC gen La on fListMCgenLa List:__________________________________________________
4151 for(Int_t ic=0; ic<jetConeLalist->GetSize(); ++ic){//loop over all reconstructed La within jet cone, new definition
4153 Int_t negDaughterpdg;
4154 Int_t posDaughterpdg;
4157 Double_t fPtMCrecLaMatch;
4158 Double_t invMLaMatch;
4162 Bool_t fPhysicalPrimary = -1;
4163 Int_t MCv0PDGCode =0;
4164 Double_t jetPtSmear = -1;
4165 TString generatorName;
4167 AliAODv0* v0c = dynamic_cast<AliAODv0*>(jetConeLalist->At(ic));//new definition
4172 Bool_t daughtercheck = DaughterTrackCheck(v0c, nnum, pnum);
4173 if(daughtercheck == kFALSE)continue;
4175 const AliAODTrack *trackMCNeg=(AliAODTrack *)(v0c->GetDaughter(nnum));
4176 const AliAODTrack *trackMCPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
4178 TList *listmc = fAOD->GetList();
4180 Bool_t mclabelcheck = MCLabelCheck(v0c, kLambda, trackMCNeg, trackMCPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PDGCode, generatorName, isinjected);
4182 if(mclabelcheck == kFALSE)continue;
4183 if(fPhysicalPrimary == kFALSE)continue;
4185 for(Int_t it=0; it<fListMCgenLa->GetSize(); ++it){//new definition // loop over MC generated K0s in cone around jet axis
4188 //Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
4190 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenLa->At(it));//new definition
4191 //AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenLaCone->At(it));//old definition
4195 Bool_t particleMatching = IsParticleMatching(mcp0, v0Label);
4198 if(particleMatching == kFALSE)continue; //particle doesn't match on any associated MC gen particle in cone around rec jet axis
4200 CalculateInvMass(v0c, kLambda, invMLaMatch, fPtMCrecLaMatch);
4202 Double_t fPtMCgenLa = mcp0->Pt();
4203 Double_t fEta = v0c->Eta();//rec. MC particle
4204 Double_t vMCrecLaCone[4] = {jetPt, invMLaMatch,fPtMCgenLa,fEta};
4205 fhnMCrecLaCone->Fill(vMCrecLaCone);
4207 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
4209 Double_t vMCrecLaConeSmear[4] = {jetPtSmear, invMLaMatch,fPtMCgenLa,fEta};
4210 fhnMCrecLaConeSmear->Fill(vMCrecLaConeSmear); //fill matching rec. Lambdas in 3D histogram, jet pT smeared according to deltaptjet distribution width
4213 } // end MCgenLa loop
4215 //check the Lambda daughters contamination of the jet tracks://///////////////////////////////////////////////////////////////////////////////////////////
4217 TClonesArray *stackMC = 0x0;
4219 for(Int_t it=0; it<jettracklist->GetSize(); ++it){//loop over all particles in the jet
4221 AliVParticle* trackVP = dynamic_cast<AliVParticle*>(jettracklist->At(it));//all tracks in jet cone
4222 if(!trackVP)continue;
4223 AliAODTrack *tr = dynamic_cast<AliAODTrack*> (trackVP); //fetch one jet track from the TList
4226 //get MC label information
4227 TList *mclist = fAOD->GetList(); //fetch the MC stack
4229 stackMC = (TClonesArray*)mclist->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
4230 if (!stackMC) {Printf("ERROR: stack not available");}
4233 Int_t particleLabel = TMath::Abs(tr->GetLabel()); //fetch jet track label in MC stack
4235 Bool_t daughterchecks = DaughterTrackCheck(v0c, nnum, pnum);
4237 if(daughterchecks == kFALSE)continue; //make sure that daughters are properly ordered
4239 const AliAODTrack *trackNeg=(AliAODTrack *)(v0c->GetDaughter(nnum)); //fetch v0 daughters of reconstructed K0s
4240 const AliAODTrack *trackPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
4242 Int_t negAssLabel = TMath::Abs(trackNeg->GetLabel()); //negative (reconstructed) charged track label in MC stack
4243 Int_t posAssLabel = TMath::Abs(trackPos->GetLabel()); //positive (reconstructed) charged track label in MC stack
4246 if(particleLabel == posAssLabel){ //check whether jet track and each of the rec. K0s daughters have same MC stack label -> are identical
4248 AliAODMCParticle* mctrackPos = dynamic_cast<AliAODMCParticle*>(stackMC->At(posAssLabel));
4249 if(!mctrackPos) continue;
4251 Double_t trackPosPt = trackPos->Pt();
4252 Double_t trackPosEta = trackPos->Eta();
4253 Double_t vLaSecContinCone[3] = {jetPt, trackPosPt, trackPosEta};
4254 fhnLaSecContinCone->Fill(vLaSecContinCone);
4256 } //if it's the case, fill jet pt, daughter track pt and track eta in histo
4259 if(particleLabel == negAssLabel){
4261 AliAODMCParticle* mctrackNeg = dynamic_cast<AliAODMCParticle*>(stackMC->At(negAssLabel));
4262 if(!mctrackNeg) continue;
4264 Double_t trackNegPt = trackNeg->Pt();
4265 Double_t trackNegEta = trackNeg->Eta();
4267 Double_t vLaSecContinCone[3] = {jetPt, trackNegPt, trackNegEta};
4268 fhnLaSecContinCone->Fill(vLaSecContinCone);
4271 } //if it's the case, fill jet pt, daughter track pt and track eta in histo
4276 } //end rec-La-in-cone loop
4277 //________________________________________________________________________________________________________________________________________________________
4279 fListMCgenLaCone->Clear();
4283 jetConeLalist->Clear();
4287 //---------------ALa-----------
4290 // fQAJetHistosRecCutsLeading->FillJetQA( jet->Eta(), TVector2::Phi_0_2pi(jet->Phi()), jet->Pt() );
4292 for(Int_t it=0; it<fListALa->GetSize(); ++it){ // loop all ALa
4294 AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListALa->At(it));
4299 TVector3 v0MomVect(v0Mom);
4301 Double_t dPhiJetALa = (jet->MomentumVector()->Vect()).DeltaPhi(v0MomVect);
4303 Double_t invMALa =0;
4306 CalculateInvMass(v0, kAntiLambda, invMALa, trackPt); //function to calculate invMass with TLorentzVector class
4307 //Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
4309 //if(incrementJetPt){fh1V0JetPt->Fill(jetPt);}
4311 //fFFHistosIMALaJet->FillFF(trackPt, invMALa, jetPt, incrementJetPt);
4313 if(dPhiJetALa<fh1dPhiJetALa->GetXaxis()->GetXmin()) dPhiJetALa += 2*TMath::Pi();
4314 fh1dPhiJetALa->Fill(dPhiJetALa);
4317 // if(fListALa->GetSize() == 0){ // no ALa: increment jet pt spectrum
4319 // Bool_t incrementJetPt = kTRUE;
4320 //fFFHistosIMALaJet->FillFF(-1, -1, jetPt, incrementJetPt);
4324 // ____fetch rec. Antilambdas in cone around jet axis_______________________________________________________________________________________
4326 jetConeALalist->Clear();
4327 Double_t sumPtALa = 0.;
4328 Bool_t isBadJetALa = kFALSE; // dummy, do not use
4330 GetTracksInCone(fListALa, jetConeALalist, jet, GetFFRadius(), sumPtALa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetALa);//method inherited from FF
4332 if(fDebug>2)Printf("%s:%d nALa total: %d, in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nALa,jetConeALalist->GetEntries(),GetFFRadius());
4334 for(Int_t it=0; it<jetConeALalist->GetSize(); ++it){ // loop ALa in jet cone
4336 AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetConeALalist->At(it));
4343 Bool_t daughtercheck = DaughterTrackCheck(v0, nnum, pnum);
4344 if(daughtercheck == kFALSE)continue;
4347 Double_t invMALa =0;
4353 CalculateInvMass(v0, kAntiLambda, invMALa, trackPt); //function to calculate invMass with TLorentzVector class
4355 Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
4357 if(fAnalysisMC){ //jet pt smearing study for Antilambdas
4359 Int_t negDaughterpdg;
4360 Int_t posDaughterpdg;
4363 Double_t jetPtSmear = -1;
4365 Bool_t fPhysicalPrimary = -1;
4366 Int_t MCv0PDGCode =0;
4367 TString generatorName;
4369 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
4370 const AliAODTrack *trackNeg=(AliAODTrack *)(v0->GetDaughter(nnum));
4371 const AliAODTrack *trackPos=(AliAODTrack *)(v0->GetDaughter(pnum));
4373 TList *listmc = fAOD->GetList();
4375 Bool_t mclabelcheck = MCLabelCheck(v0, kAntiLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PDGCode, generatorName, isinjected);
4376 if(mclabelcheck == kFALSE)continue;
4378 //std::cout<<"generatorName: "<<generatorName<<std::endl;
4380 if(generatorName == "Hijing"){
4381 Double_t vrecMCHijingALaCone[4] = {jetPt, invMALa,trackPt,fEta};
4382 fhnrecMCHijingALaCone->Fill(vrecMCHijingALaCone);
4385 if(isinjected == kTRUE){
4386 Double_t vrecMCInjectALaCone[4] = {jetPt, invMALa,trackPt,fEta};
4387 fhnrecMCInjectALaCone->Fill(vrecMCInjectALaCone);
4390 if(incrementJetPt == kTRUE){fh1IMALaConeSmear->Fill(jetPtSmear);} //fill TH1F for normalization purposes
4393 if(incrementJetPt==kTRUE){
4394 fh1IMALaCone->Fill(jetPt);}//normalisation by number of selected jets
4396 //fFFHistosIMALaCone->FillFF(trackPt, invMALa, jetPt, incrementJetPt);
4397 Double_t vALaCone[4] = {jetPt, invMALa,trackPt,fEta};
4398 fhnALaCone->Fill(vALaCone);
4401 if(jetConeALalist->GetSize() == 0){ // no ALa: increment jet pt spectrum
4403 Bool_t incrementJetPt = kTRUE;
4405 if(incrementJetPt==kTRUE){
4406 fh1IMALaCone->Fill(jetPt);}//normalisation by number of selected jets
4408 //fFFHistosIMALaCone->FillFF(-1, -1, jetPt, incrementJetPt);
4409 Double_t vALaCone[4] = {jetPt, -1, -1, -1};
4410 fhnALaCone->Fill(vALaCone);
4413 Double_t jetPtSmear;
4414 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
4415 if(incrementJetPt == kTRUE)fh1IMALaConeSmear->Fill(jetPtSmear);}
4421 //____fetch MC generated Antilambdas in cone around jet axis__(particles can stem from fragmentation but also from underlying event)_____________
4423 Double_t sumPtMCgenALa = 0.;
4424 Bool_t isBadJetMCgenALa = kFALSE; // dummy, do not use
4426 //sampling MC gen Antilambdas in cone around reconstructed jet axis
4427 fListMCgenALaCone->Clear();
4429 GetTracksInCone(fListMCgenALa, fListMCgenALaCone, jet, GetFFRadius(), sumPtMCgenALa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetMCgenALa);//MC generated K0s in cone around jet axis
4431 if(fDebug>2)Printf("%s:%d nMCgenALa in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,fListMCgenALaCone->GetEntries(),GetFFRadius());
4433 /* for(Int_t it=0; it<fListMCgenALaCone->GetSize(); ++it){ // loop MC generated La in cone around jet axis
4435 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenALaCone->At(it));
4438 //Double_t fRapMCgenALa = MyRapidity(mcp0->E(),mcp0->Pz());
4439 Double_t fEtaMCgenALa = mcp0->Eta();
4440 Double_t fPtMCgenALa = mcp0->Pt();
4442 //fh2MCgenALaCone->Fill(jetPt,fPtMCgenALa);
4443 //fh2MCEtagenALaCone->Fill(jetPt,fEtaMCgenALa);
4447 //check whether the reconstructed ALa are stemming from MC gen ALa on MCgenALa List:__________________________________________________
4449 for(Int_t ic=0; ic<jetConeALalist->GetSize(); ++ic){//loop over all reconstructed ALa
4451 Int_t negDaughterpdg;
4452 Int_t posDaughterpdg;
4455 Double_t fPtMCrecALaMatch;
4456 Double_t invMALaMatch;
4460 Bool_t fPhysicalPrimary = -1;
4461 Int_t MCv0PDGCode =0;
4462 Double_t jetPtSmear = -1;
4463 TString generatorName;
4465 AliAODv0* v0c = dynamic_cast<AliAODv0*>(jetConeALalist->At(ic));
4468 Bool_t daughtercheck = DaughterTrackCheck(v0c, nnum, pnum);
4469 if(daughtercheck == kFALSE)continue;
4471 const AliAODTrack *trackMCNeg=(AliAODTrack *)(v0c->GetDaughter(nnum));
4472 const AliAODTrack *trackMCPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
4474 TList *listmc = fAOD->GetList();
4475 if(!listmc)continue;
4477 Bool_t mclabelcheck = MCLabelCheck(v0c, kAntiLambda, trackMCNeg, trackMCPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PDGCode, generatorName, isinjected);
4479 if(mclabelcheck == kFALSE)continue;
4480 if(fPhysicalPrimary == kFALSE)continue;
4482 for(Int_t it=0; it<fListMCgenALa->GetSize(); ++it){ // loop over MC generated Antilambdas in cone around jet axis
4484 //Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
4486 AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenALa->At(it));
4489 Bool_t particleMatching = IsParticleMatching(mcp0, v0Label);
4491 if(particleMatching == kFALSE)continue; //particle doesn't match on any associated MC gen particle in cone around rec jet axis
4493 CalculateInvMass(v0c, kAntiLambda, invMALaMatch, fPtMCrecALaMatch);
4495 Double_t fPtMCgenALa = mcp0->Pt();
4496 Double_t fEta = v0c->Eta();
4497 Double_t vMCrecALaCone[4] = {jetPt, invMALaMatch,fPtMCgenALa,fEta};
4498 fhnMCrecALaCone->Fill(vMCrecALaCone); //fill matching rec. Antilambda in 3D histogram
4500 SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
4502 Double_t vMCrecALaConeSmear[4] = {jetPtSmear, invMALaMatch,fPtMCgenALa,fEta};
4503 fhnMCrecALaConeSmear->Fill(vMCrecALaConeSmear); //fill matching rec. Antilambda in 3D histogram
4505 } // end MCgenALa loop
4509 //check the Antilambda daughters contamination of the jet tracks:
4511 TClonesArray *stackMC = 0x0;
4513 for(Int_t it=0; it<jettracklist->GetSize(); ++it){//loop over all particles in the jet
4515 AliVParticle* trackVP = dynamic_cast<AliVParticle*>(jettracklist->At(it));//all tracks in jet cone
4516 if(!trackVP)continue;
4517 AliAODTrack *tr = dynamic_cast<AliAODTrack*> (trackVP); //fetch one jet track from the TList
4520 //get MC label information
4521 TList *mclist = fAOD->GetList(); //fetch the MC stack
4522 if(!mclist)continue;
4524 stackMC = (TClonesArray*)mclist->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
4525 if (!stackMC) {Printf("ERROR: stack not available");}
4528 Int_t particleLabel = TMath::Abs(tr->GetLabel()); //fetch jet track label in MC stack
4530 Bool_t daughterchecks = DaughterTrackCheck(v0c, nnum, pnum);
4532 if(daughterchecks == kFALSE)continue; //make sure that daughters are properly ordered
4534 const AliAODTrack *trackNeg=(AliAODTrack *)(v0c->GetDaughter(nnum)); //fetch v0 daughters of reconstructed K0s
4535 const AliAODTrack *trackPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
4536 if(!trackPos)continue;
4537 if(!trackNeg)continue;
4539 Int_t negAssLabel = TMath::Abs(trackNeg->GetLabel()); //negative (reconstructed) charged track label in MC stack
4540 Int_t posAssLabel = TMath::Abs(trackPos->GetLabel()); //positive (reconstructed) charged track label in MC stack
4542 if(!negAssLabel)continue;
4543 if(!posAssLabel)continue;
4545 if(particleLabel == posAssLabel){ //check whether jet track and each of the rec. K0s daughters have same MC stack label -> are identical
4546 AliAODMCParticle* mctrackPos = dynamic_cast<AliAODMCParticle*>(stackMC->At(posAssLabel));
4547 if(!mctrackPos) continue;
4549 Double_t trackPosPt = trackPos->Pt();
4550 Double_t trackPosEta = trackPos->Eta();
4551 if(!trackPosPt)continue;
4552 if(!trackPosEta)continue;
4554 Double_t vLaSecContinCone[3] = {jetPt, trackPosPt, trackPosEta};
4555 fhnLaSecContinCone->Fill(vLaSecContinCone);
4559 //fh3SecContinCone->Fill(jetPt, trackPosPt, trackPosEta);
4560 } //if it's the case, fill jet pt, daughter track pt and track eta in histo
4562 if(particleLabel == negAssLabel){
4564 AliAODMCParticle* mctrackNeg = dynamic_cast<AliAODMCParticle*>(stackMC->At(negAssLabel));
4565 if(!mctrackNeg) continue;
4567 Double_t trackNegPt = trackNeg->Pt();
4568 Double_t trackNegEta = trackNeg->Eta();
4570 if(!trackNegPt)continue;
4571 if(!trackNegEta)continue;
4573 Double_t vLaSecContinCone[3] = {jetPt, trackNegPt, trackNegEta};
4574 fhnLaSecContinCone->Fill(vLaSecContinCone);
4576 //fh3SecContinCone->Fill(jetPt, trackNegPt, trackNegEta);
4577 } //if it's the case, fill jet pt, daughter track pt and track eta in histo
4581 } //end rec-ALa-in-cone loop
4582 //________________________________________________________________________________________________________________________________________________________
4585 fListMCgenALaCone->Clear();
4589 jetConeALalist->Clear();
4590 jettracklist->Clear();
4591 }//end of if 'leading' or 'all jet' requirement
4594 jettracklist->Clear();
4595 jetConeK0list->Clear();
4596 jetConeLalist->Clear();
4597 jetConeALalist->Clear();
4598 jetPerpConeK0list->Clear();
4599 jetPerpConeLalist->Clear();
4600 jetPerpConeALalist->Clear();
4601 jetMedianConeK0list->Clear();
4602 jetMedianConeLalist->Clear();
4603 jetMedianConeALalist->Clear();
4604 fListK0sRC->Clear();
4606 fListALaRC->Clear();
4607 fTracksRecCuts->Clear();
4608 fJetsRecCuts->Clear();
4609 fBckgJetsRec->Clear();
4613 fListFeeddownLaCand->Clear();
4614 fListFeeddownALaCand->Clear();
4615 jetConeFDLalist->Clear();
4616 jetConeFDALalist->Clear();
4617 fListMCgenK0s->Clear();
4618 fListMCgenLa->Clear();
4619 fListMCgenALa->Clear();
4620 fListMCgenK0sCone->Clear();
4621 fListMCgenLaCone->Clear();
4622 fListMCgenALaCone->Clear();
4625 PostData(1, fCommonHistList);
4630 // ____________________________________________________________________________________________
4631 void AliAnalysisTaskJetChem::SetProperties(TH3F* h,const char* x, const char* y, const char* z)
4633 //Set properties of histos (x,y and z title)
4638 h->GetXaxis()->SetTitleColor(1);
4639 h->GetYaxis()->SetTitleColor(1);
4640 h->GetZaxis()->SetTitleColor(1);
4644 //________________________________________________________________________________________________________________________________________
4645 Bool_t AliAnalysisTaskJetChem::AcceptBetheBloch(AliAODv0 *v0, AliPIDResponse *PIDResponse, const Int_t particletype) //dont use for MC Analysis
4651 const AliAODTrack *ntracktest=(AliAODTrack *)v0->GetDaughter(nnum);
4652 if(ntracktest->Charge() > 0){nnum = 0; pnum = 1;}
4654 const AliAODTrack *trackNeg=(AliAODTrack *)(v0->GetDaughter(nnum));
4655 const AliAODTrack *trackPos=(AliAODTrack *)(v0->GetDaughter(pnum));
4657 //Check if both tracks are available
4658 if (!trackPos || !trackNeg) {
4659 Printf("strange analysis::UserExec:: Error:Could not retrieve one of the daughter tracks\n");
4663 //remove like sign V0s
4664 if ( trackPos->Charge() == trackNeg->Charge() ){
4665 //if(fDebug>1) Printf("%s:%d found like-sign V0", (char*)__FILE__,__LINE__);
4670 Double_t nsig_p = 0; //number of sigmas that positive daughter track has got in TPC pid information
4671 Double_t nsig_n = 0;
4673 const AliAODPid *pid_p=trackPos->GetDetPid(); // returns fDetPID, more detailed or detector specific pid information
4674 const AliAODPid *pid_n=trackNeg->GetDetPid();
4676 if(!pid_p)return kFALSE;
4677 if(!pid_n)return kFALSE;
4681 if(particletype == 1) //PID cut on positive charged Lambda daughters (only those with pt < 1 GeV/c)
4684 nsig_p=PIDResponse->NumberOfSigmasTPC(trackPos,AliPID::kProton);
4685 Double_t protonPt = trackPos->Pt();
4686 if ((TMath::Abs(nsig_p) >= fCutBetheBloch) && (fCutBetheBloch >0) && (protonPt < 1)) return kFALSE;
4695 if(particletype == 2)
4697 nsig_n=PIDResponse->NumberOfSigmasTPC(trackNeg,AliPID::kProton);
4698 Double_t antiprotonPt = trackNeg->Pt();
4699 if ((TMath::Abs(nsig_n) >= fCutBetheBloch) && (fCutBetheBloch >0) && (antiprotonPt < 1)) return kFALSE;
4707 //___________________________________________________________________
4708 Bool_t AliAnalysisTaskJetChem::IsK0InvMass(const Double_t mass) const
4710 // K0 mass ? Use FF histo limits
4712 if(fFFIMInvMMin <= mass && mass < fFFIMInvMMax) return kTRUE;
4716 //___________________________________________________________________
4717 Bool_t AliAnalysisTaskJetChem::IsLaInvMass(const Double_t mass) const
4719 // La mass ? Use FF histo limits
4722 if(fFFIMLaInvMMin <= mass && mass < fFFIMLaInvMMax) return kTRUE;
4727 //_____________________________________________________________________________________
4728 Int_t AliAnalysisTaskJetChem::GetListOfV0s(TList *list, const Int_t type, const Int_t particletype, AliAODVertex* primVertex, AliAODEvent* aod)
4730 // fill list of V0s selected according to type
4733 if(fDebug>1) Printf("%s:%d no input list", (char*)__FILE__,__LINE__);
4738 if(fDebug>5){std::cout<<"AliAnalysisTaskJetChem::GetListOfV0s(): type: "<<type<<" particletype: "<<particletype<<"aod: "<<aod<<std::endl;
4739 if(type==kTrackUndef){std::cout<<"AliAnalysisTaskJetChem::GetListOfV0s(): kTrackUndef!! "<<std::endl;}
4743 if(type==kTrackUndef) return 0;
4745 if(!primVertex) return 0;
4747 Double_t lPrimaryVtxPosition[3];
4748 Double_t lV0Position[3];
4749 lPrimaryVtxPosition[0] = primVertex->GetX();
4750 lPrimaryVtxPosition[1] = primVertex->GetY();
4751 lPrimaryVtxPosition[2] = primVertex->GetZ();
4753 if(fDebug>5){ std::cout<<"AliAnalysisTaskJetChem::GetListOfV0s(): aod->GetNumberOfV0s: "<<aod->GetNumberOfV0s()<<std::endl; }
4756 for(int i=0; i<aod->GetNumberOfV0s(); i++){ // loop over V0s
4759 AliAODv0* v0 = aod->GetV0(i);
4763 std::cout << std::endl
4764 << "Warning in AliAnalysisTaskJetChem::GetListOfV0s:" << std::endl
4765 << "v0 = " << v0 << std::endl;
4769 Bool_t isOnFly = v0->GetOnFlyStatus();
4771 if(!isOnFly && (type == kOnFly || type == kOnFlyPID || type == kOnFlydEdx || type == kOnFlyPrim)) continue;
4772 if( isOnFly && (type == kOffl || type == kOfflPID || type == kOffldEdx || type == kOfflPrim)) continue;
4774 Int_t motherType = -1;
4775 //Double_t v0CalcMass = 0; //mass of MC v0
4776 Double_t MCPt = 0; //pt of MC v0
4778 Double_t pp[3]={0,0,0}; //3-momentum positive charged track
4779 Double_t pm[3]={0,0,0}; //3-momentum negative charged track
4780 Double_t v0mom[3]={0,0,0};
4791 Bool_t daughtercheck = DaughterTrackCheck(v0, nnum, pnum);
4793 if(daughtercheck == kFALSE)continue;
4795 const AliAODTrack *trackNeg=(AliAODTrack *)(v0->GetDaughter(nnum));
4796 const AliAODTrack *trackPos=(AliAODTrack *)(v0->GetDaughter(pnum));
4799 ///////////////////////////////////////////////////////////////////////////////////
4801 //calculate InvMass for every V0 particle assumption (Kaon=1,Lambda=2,Antilambda=3)
4802 switch(particletype){
4804 CalculateInvMass(v0, kK0, invM, trackPt); //function to calculate invMass with TLorentzVector class
4808 CalculateInvMass(v0, kLambda, invM, trackPt);
4812 CalculateInvMass(v0, kAntiLambda, invM, trackPt);
4816 std::cout<<"***NO VALID PARTICLETYPE***"<<std::endl;
4821 /////////////////////////////////////////////////////////////
4822 //V0 and track Cuts:
4825 if(fDebug>7){if(!(IsK0InvMass(invMK0s)) && !(IsLaInvMass(invMLa)) && !(IsLaInvMass(invMALa))){std::cout<<"AliAnalysisTaskJetChem::GetListOfV0s: invM not in selected mass window "<<std::endl;}}
4827 if(!(IsK0InvMass(invMK0s)) && !(IsLaInvMass(invMLa)) && !(IsLaInvMass(invMALa)))continue;
4829 // Double_t PosEta = trackPos->AliAODTrack::Eta();//daughter track charge is sometimes wrong here, account for that!!!
4830 // Double_t NegEta = trackNeg->AliAODTrack::Eta();
4832 Double_t PosEta = trackPos->Eta();//daughter track charge is sometimes wrong here, account for that!!!
4833 Double_t NegEta = trackNeg->Eta();
4835 Double_t PosCharge = trackPos->Charge();
4836 Double_t NegCharge = trackNeg->Charge();
4838 if((trackPos->Charge() == 1) && (trackNeg->Charge() == -1)) //Fill daughters charge into histo to check if they are symmetric distributed
4839 { fh1PosDaughterCharge->Fill(PosCharge);
4840 fh1NegDaughterCharge->Fill(NegCharge);
4843 //DistOverTotMom_in_2D___________
4845 Float_t fMassK0s = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass();
4846 Float_t fMassLambda = TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass();
4849 AliAODVertex* primVtx = fAOD->GetPrimaryVertex(); // get the primary vertex
4850 Double_t dPrimVtxPos[3]; // primary vertex position {x,y,z}
4851 primVtx->GetXYZ(dPrimVtxPos);
4853 Float_t fPtV0 = TMath::Sqrt(v0->Pt2V0()); // transverse momentum of V0
4854 Double_t dSecVtxPos[3]; // V0 vertex position {x,y,z}
4855 v0->GetSecondaryVtx(dSecVtxPos);
4856 Double_t dDecayPath[3];
4857 for (Int_t iPos = 0; iPos < 3; iPos++)
4858 dDecayPath[iPos] = dSecVtxPos[iPos]-dPrimVtxPos[iPos]; // vector of the V0 path
4859 Float_t fDecLen2D = TMath::Sqrt(dDecayPath[0]*dDecayPath[0]+dDecayPath[1]*dDecayPath[1]); //transverse path length R
4860 Float_t fROverPt = fDecLen2D/fPtV0; // R/pT
4862 Float_t fMROverPtK0s = fMassK0s*fROverPt; // m*R/pT
4863 Float_t fMROverPtLambda = fMassLambda*fROverPt; // m*R/pT
4865 //___________________
4866 //Double_t fRap = -999;//init values
4867 Double_t fEta = -999;
4868 Double_t fV0cosPointAngle = -999;
4869 Double_t fV0DecayLength = v0->DecayLengthV0(lPrimaryVtxPosition);
4873 fV0mom[0]=v0->MomV0X();
4874 fV0mom[1]=v0->MomV0Y();
4875 fV0mom[2]=v0->MomV0Z();
4877 Double_t fV0TotalMomentum = TMath::Sqrt(fV0mom[0]*fV0mom[0]+fV0mom[1]*fV0mom[1]+fV0mom[2]*fV0mom[2]);
4878 // const Double_t K0sPDGmass = 0.497614;
4879 // const Double_t LambdaPDGmass = 1.115683;
4881 const Double_t K0sPDGmass = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass();
4882 const Double_t LambdaPDGmass = TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass();
4884 Double_t fDistOverTotMomK0s = 0;
4885 Double_t fDistOverTotMomLa = 0;
4887 //calculate proper lifetime of particles in 3D (not recommended anymore)
4889 if(particletype == kK0){
4891 fDistOverTotMomK0s = fV0DecayLength * K0sPDGmass;
4892 fDistOverTotMomK0s /= (fV0TotalMomentum+1e-10);
4895 if((particletype == kLambda)||(particletype == kAntiLambda)){
4897 fDistOverTotMomLa = fV0DecayLength * LambdaPDGmass;
4898 fDistOverTotMomLa /= (fV0TotalMomentum+1e-10);
4901 //TPC cluster (not used anymore) and TPCRefit cuts
4903 //Double_t trackPosNcls = trackPos->GetTPCNcls();//Get number of clusters for positive charged tracks
4904 //Double_t trackNegNcls = trackNeg->GetTPCNcls();//Get number of clusters for negative charged tracks
4906 if(fRequireTPCRefit==kTRUE){//if kTRUE: accept only if daughter track is refitted in TPC!!
4907 Bool_t isPosTPCRefit = (trackPos->AliAODTrack::IsOn(AliESDtrack::kTPCrefit));
4908 Bool_t isNegTPCRefit = (trackNeg->AliAODTrack::IsOn(AliESDtrack::kTPCrefit));
4909 if (!isPosTPCRefit)continue;
4910 if (!isNegTPCRefit)continue;
4913 if(fKinkDaughters==kFALSE){//if kFALSE: no acceptance of kink daughters
4914 AliAODVertex* ProdVtxDaughtersPos = (AliAODVertex*) (trackPos->AliAODTrack::GetProdVertex());
4915 Char_t isAcceptKinkDaughtersPos = ProdVtxDaughtersPos->GetType();
4916 if(isAcceptKinkDaughtersPos==AliAODVertex::kKink)continue;
4918 AliAODVertex* ProdVtxDaughtersNeg = (AliAODVertex*) (trackNeg->AliAODTrack::GetProdVertex());
4919 Char_t isAcceptKinkDaughtersNeg = ProdVtxDaughtersNeg->GetType();
4920 if(isAcceptKinkDaughtersNeg==AliAODVertex::kKink)continue;
4924 Double_t fV0Radius = -999;
4925 Double_t fDcaV0Daughters = v0->DcaV0Daughters();
4926 Double_t fDcaPosToPrimVertex = v0->DcaPosToPrimVertex();//IP of positive charged daughter
4927 Double_t fDcaNegToPrimVertex = v0->DcaNegToPrimVertex();//IP of negative charged daughter
4928 Double_t avDecayLengthK0s = 2.6844;
4929 Double_t avDecayLengthLa = 7.89;
4931 //Float_t fCTauK0s = 2.6844; // [cm] c tau of K0S
4932 //Float_t fCTauLambda = 7.89; // [cm] c tau of Lambda and Antilambda
4934 fV0cosPointAngle = v0->CosPointingAngle(lPrimaryVtxPosition);
4935 lV0Position[0]= v0->DecayVertexV0X();
4936 lV0Position[1]= v0->DecayVertexV0Y();
4937 lV0Position[2]= v0->DecayVertexV0Z();
4939 fV0Radius = TMath::Sqrt(lV0Position[0]*lV0Position[0]+lV0Position[1]*lV0Position[1]);
4941 if(particletype == kK0) {//fRap = v0->RapK0Short();
4942 fEta = v0->PseudoRapV0();}
4943 if(particletype == kLambda) {//fRap = v0->RapLambda();
4944 fEta = v0->PseudoRapV0();}
4945 if(particletype == kAntiLambda) {//fRap = v0->Y(-3122);
4946 fEta = v0->PseudoRapV0();}
4949 //cut on 3D DistOverTotMom: (not used anymore)
4950 //if((particletype == kLambda)||(particletype == kAntiLambda)){if(fDistOverTotMomLa >= (fCutV0DecayMax * avDecayLengthLa)) continue;}
4952 //cut on K0s applied below after all other cuts for histo fill purposes..
4954 //cut on 2D DistOverTransMom: (recommended from Iouri)
4955 if((particletype == kLambda)||(particletype == kAntiLambda)){if(fMROverPtLambda > (fCutV0DecayMax * avDecayLengthLa))continue;}//fCutV0DecayMax set to 5 in AddTask macro
4957 //Armenteros Podolanski Plot for K0s:////////////////////////////
4959 Double_t ArmenterosAlpha=-999;
4960 Double_t ArmenterosPt=-999;
4966 if(particletype == kK0){
4968 pp[0]=v0->MomPosX();
4969 pp[1]=v0->MomPosY();
4970 pp[2]=v0->MomPosZ();
4972 pm[0]=v0->MomNegX();
4973 pm[1]=v0->MomNegY();
4974 pm[2]=v0->MomNegZ();
4977 v0mom[0]=v0->MomV0X();
4978 v0mom[1]=v0->MomV0Y();
4979 v0mom[2]=v0->MomV0Z();
4981 TVector3 v0Pos(pp[0],pp[1],pp[2]);
4982 TVector3 v0Neg(pm[0],pm[1],pm[2]);
4983 TVector3 v0totMom(v0mom[0], v0mom[1], v0mom[2]); //vector for tot v0 momentum
4985 //PosPt = v0Pos.Perp(v0totMom); //longitudinal momentum of positive charged daughter track
4986 PosPl = v0Pos.Dot(v0totMom)/v0totMom.Mag(); //transversal momentum of positive charged daughter track
4988 //NegPt = v0Neg.Perp(v0totMom); //longitudinal momentum of negative charged daughter track
4989 NegPl = v0Neg.Dot(v0totMom)/v0totMom.Mag(); //transversal momentum of nergative charged daughter track
4991 ArmenterosAlpha = 1.-2./(1+(PosPl/NegPl));
4992 ArmenterosPt= v0->PtArmV0();
4996 if(particletype == kK0){//only cut on K0s histos
4997 if(IsArmenterosSelected == 1){// Armenteros Cut to reject Lambdas contamination in K0s inv. massspectrum
4998 fh2ArmenterosBeforeCuts->Fill(ArmenterosAlpha,ArmenterosPt);
5002 //some more cuts on v0s and daughter tracks:
5005 if((TMath::Abs(PosEta)>fCutPostrackEta) || (TMath::Abs(NegEta)>fCutNegtrackEta))continue; //Daughters pseudorapidity cut
5006 if (fV0cosPointAngle < fCutV0cosPointAngle) continue; //cospointangle cut
5008 //if(TMath::Abs(fRap) > fCutRap)continue; //V0 Rapidity Cut
5009 if(TMath::Abs(fEta) > fCutEta) continue; //V0 Eta Cut
5010 if (fDcaV0Daughters > fCutDcaV0Daughters)continue;
5011 if ((fDcaPosToPrimVertex < fCutDcaPosToPrimVertex) || (fDcaNegToPrimVertex < fCutDcaNegToPrimVertex))continue;
5012 if ((fV0Radius < fCutV0RadiusMin) || (fV0Radius > fCutV0RadiusMax))continue;
5014 const AliAODPid *pid_p1=trackPos->GetDetPid();
5015 const AliAODPid *pid_n1=trackNeg->GetDetPid();
5018 if(particletype == kLambda){
5019 // if(AcceptBetheBloch(v0, fPIDResponse, 1) == kFALSE){std::cout<<"******PID cut rejects Lambda!!!************"<<std::endl;}
5020 if(AcceptBetheBloch(v0, fPIDResponse, 1) == kFALSE)continue;
5021 fh2BBLaPos->Fill(pid_p1->GetTPCmomentum(),pid_p1->GetTPCsignal());//positive lambda daughter
5022 fh2BBLaNeg->Fill(pid_n1->GetTPCmomentum(),pid_n1->GetTPCsignal());//negative lambda daughter
5024 //Double_t phi = v0->Phi();
5025 //Double_t massLa = v0->MassLambda();
5027 //printf("La: i = %d, m = %f, pT = %f, eta = %f, phi = %f\n, ",i,massLa,trackPt,fEta,phi);
5031 if(particletype == kAntiLambda){
5033 if(AcceptBetheBloch(v0, fPIDResponse, 2) == kFALSE)continue;
5034 fh2BBLaPos->Fill(pid_p1->GetTPCmomentum(),pid_p1->GetTPCsignal());//positive antilambda daughter
5035 fh2BBLaNeg->Fill(pid_n1->GetTPCmomentum(),pid_n1->GetTPCsignal());//negative antilambda daughter
5040 //Armenteros cut on K0s:
5041 if(particletype == kK0){
5042 if(IsArmenterosSelected == 1){// Armenteros Cut to reject Lambdas contamination in K0s inv. massspectrum
5044 if((ArmenterosPt<=(TMath::Abs(fCutArmenteros*ArmenterosAlpha))) && (fCutArmenteros!=-999))continue; //Cuts out Lambda contamination in K0s histos
5045 fh2ArmenterosAfterCuts->Fill(ArmenterosAlpha,ArmenterosPt);
5049 //not used anymore in 3D, z component of total momentum has bad resolution, cut instead in 2D and use pT
5050 //Proper Lifetime Cut: DecayLength3D * PDGmass / |p_tot| < 3*2.68cm (ctau(betagamma=1)) ; |p|/mass = beta*gamma
5051 //////////////////////////////////////////////
5054 //cut on 2D DistOverTransMom
5055 if(particletype == kK0){//the cut on Lambdas you can find above
5057 fh2ProperLifetimeK0sVsPtBeforeCut->Fill(trackPt,fMROverPtK0s); //fill these histos after all other cuts
5058 if(fMROverPtK0s > (fCutV0DecayMax * avDecayLengthK0s))continue;
5059 fh2ProperLifetimeK0sVsPtAfterCut->Fill(trackPt,fMROverPtK0s);
5061 //Double_t phi = v0->Phi();
5062 // Double_t massK0s = v0->MassK0Short();
5063 //printf("K0S: i = %d, m = %f, pT = %f, eta = %f, phi = %f\n",i,invMK0s,trackPt,fEta,phi);
5065 //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;
5068 //MC Associated V0 particles: (reconstructed particles associated with MC truth (MC truth: true primary MC generated particle))
5071 if(fAnalysisMC){// begin MC part
5073 Int_t negDaughterpdg = 0;
5074 Int_t posDaughterpdg = 0;
5076 Bool_t fPhysicalPrimary = -1; //v0 physical primary check
5077 Int_t MCv0PdgCode = 0;
5078 Bool_t mclabelcheck = kFALSE;
5080 TList *listmc = aod->GetList(); //AliAODEvent* is inherited from AliVEvent*, listmc is pointer to reconstructed event in MC list, member of AliAODEvent
5082 if(!listmc)continue;
5084 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
5086 //feeddown-correction for Lambda/Antilambda particles
5087 //feedddown comes mainly from charged and neutral Xi particles
5088 //feeddown from Sigma decays so quickly that it's not possible to distinguish from primary Lambdas with detector
5089 //feeddown for K0s from phi decays is neglectible
5090 //TH2F* fh2FeedDownMatrix = 0x0; //histo for feeddown already decleared above
5093 //first for all Lambda and Antilambda candidates____________________________________________________________________
5094 TString generatorName;
5096 if(particletype == kLambda){
5098 mclabelcheck = MCLabelCheck(v0, kLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode, generatorName, isinjected);
5101 if((motherType == 3312)||(motherType == 3322)){//mother of v0 is neutral or negative Xi
5103 fListFeeddownLaCand->Add(v0); //fill TList with ass. particles, stemming from feeddown from Xi(bar) decays
5107 if(particletype == kAntiLambda){
5109 mclabelcheck = MCLabelCheck(v0, kAntiLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode, generatorName, isinjected);
5111 if((motherType == -3312)||(motherType == -3322)){
5112 fListFeeddownALaCand->Add(v0); //fill TList with ass. particles, stemming from feeddown from Xi(bar) decays
5118 //_only true primary particles survive the following checks_______________________________________________________________________________________________
5119 TString generatorName;
5121 if(particletype == kK0){
5123 mclabelcheck = MCLabelCheck(v0, kK0, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode, generatorName, isinjected);
5124 if(mclabelcheck == kFALSE)continue;
5126 if(particletype == kLambda){
5128 mclabelcheck = MCLabelCheck(v0, kLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode, generatorName, isinjected);
5129 if(mclabelcheck == kFALSE)continue;
5131 if(particletype == kAntiLambda){
5133 mclabelcheck = MCLabelCheck(v0, kAntiLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode, generatorName, isinjected);
5134 if(mclabelcheck == kFALSE)continue;
5137 if(fPhysicalPrimary != 1)continue; //V0 candidate (K0s, Lambda or Antilambda) must be physical primary, this means there is no mother particle existing
5146 Int_t nPart=list->GetSize();
5149 } // end GetListOfV0s()
5151 // -------------------------------------------------------------------------------------------------------
5153 void AliAnalysisTaskJetChem::CalculateInvMass(AliAODv0* v0vtx, const Int_t particletype, Double_t& invM, Double_t& trackPt){
5163 Double_t pp[3]={0,0,0}; //3-momentum positive charged track
5164 Double_t pm[3]={0,0,0}; //3-momentum negative charged track
5166 const Double_t massPi = 0.13957018; //better use PDG code at this point
5167 const Double_t massP = 0.93827203;
5172 TLorentzVector vector; //lorentzvector V0 particle
5173 TLorentzVector fourmom1;//lorentzvector positive daughter
5174 TLorentzVector fourmom2;//lorentzvector negative daughter
5176 //--------------------------------------------------------------
5178 AliAODTrack *trackPos = (AliAODTrack *) (v0vtx->GetSecondaryVtx()->GetDaughter(0));//index 0 defined as positive charged track in AliESDFilter
5180 if( trackPos->Charge() == 1 ){
5182 pp[0]=v0vtx->MomPosX();
5183 pp[1]=v0vtx->MomPosY();
5184 pp[2]=v0vtx->MomPosZ();
5186 pm[0]=v0vtx->MomNegX();
5187 pm[1]=v0vtx->MomNegY();
5188 pm[2]=v0vtx->MomNegZ();
5191 if( trackPos->Charge() == -1 ){
5193 pm[0]=v0vtx->MomPosX();
5194 pm[1]=v0vtx->MomPosY();
5195 pm[2]=v0vtx->MomPosZ();
5197 pp[0]=v0vtx->MomNegX();
5198 pp[1]=v0vtx->MomNegY();
5199 pp[2]=v0vtx->MomNegZ();
5202 if (particletype == kK0){ // case K0s
5203 mass1 = massPi;//positive particle
5204 mass2 = massPi;//negative particle
5205 } else if (particletype == kLambda){ // case Lambda
5206 mass1 = massP;//positive particle
5207 mass2 = massPi;//negative particle
5208 } else if (particletype == kAntiLambda){ //case AntiLambda
5209 mass1 = massPi;//positive particle
5210 mass2 = massP; //negative particle
5213 fourmom1.SetXYZM(pp[0],pp[1],pp[2],mass1);//positive track
5214 fourmom2.SetXYZM(pm[0],pm[1],pm[2],mass2);//negative track
5215 vector=fourmom1 + fourmom2;
5218 trackPt = vector.Pt();
5220 /*// 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
5222 if(particletype == kK0){
5223 std::cout << "invMK0s: " << invM <<std::endl;
5224 std::cout << "v0vtx->MassK0Short(): " << v0vtx->MassK0Short() << std::endl;
5225 std::cout << " " <<std::endl;
5226 //invM = v0vtx->MassK0Short();
5229 if(particletype == kLambda){
5230 std::cout << "invMLambda: " << invM <<std::endl;
5231 std::cout << "v0vtx->MassMassLambda(): " << v0vtx->MassLambda() << std::endl;
5232 std::cout << " " <<std::endl;
5233 //invM = v0vtx->MassLambda();
5236 if(particletype == kAntiLambda){
5237 std::cout << "invMAntiLambda: " << invM <<std::endl;
5238 std::cout << "v0vtx->MassAntiLambda(): " << v0vtx->MassAntiLambda() << std::endl;
5239 std::cout << " " <<std::endl;
5240 //invM = v0vtx->MassAntiLambda();
5248 //_____________________________________________________________________________________
5249 Int_t AliAnalysisTaskJetChem::GetListOfMCParticles(TList *outputlist, const Int_t particletype, AliAODEvent *mcaodevent) //(list to fill here e.g. fListMCgenK0s, particle species to search for)
5252 outputlist->Clear();
5254 TClonesArray *stack = 0x0;
5255 Double_t mcXv=0., mcYv=0., mcZv=0.;//MC vertex position
5258 // get MC generated particles
5260 Int_t fPdgcodeCurrentPart = 0; //pdg code current particle
5261 //Double_t fRapCurrentPart = 0; //get rapidity
5262 //Double_t fPtCurrentPart = 0; //get transverse momentum
5263 Double_t fEtaCurrentPart = 0; //get pseudorapidity
5265 //variable for check: physical primary particle
5266 //Bool_t IsPhysicalPrimary = -1;
5267 //Int_t index = 0; //check number of injected particles
5268 //****************************
5269 // Start loop over MC particles
5271 TList *lst = mcaodevent->GetList();
5274 if(fDebug>1) Printf("%s:%d no input list", (char*)__FILE__,__LINE__);
5278 stack = (TClonesArray*)lst->FindObject(AliAODMCParticle::StdBranchName());
5280 Printf("ERROR: stack not available");
5284 AliAODMCHeader *mcHdr=(AliAODMCHeader*)lst->FindObject(AliAODMCHeader::StdBranchName());
5285 if(!mcHdr)return -1;
5287 mcXv=mcHdr->GetVtxX(); mcYv=mcHdr->GetVtxY(); mcZv=mcHdr->GetVtxZ(); // position of the MC primary vertex
5290 ntrk=stack->GetEntriesFast();
5292 //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...
5295 for (Int_t iMc = 0; iMc < ntrk; iMc++) { //loop over mc generated particles
5298 AliAODMCParticle *p0=(AliAODMCParticle*)stack->UncheckedAt(iMc);
5300 //Printf("ERROR: particle with label %d not found in stack (mc loop)", iMc);
5303 fPdgcodeCurrentPart = p0->GetPdgCode();
5305 // Keep only K0s, Lambda and AntiLambda, Xi and Phi:
5306 //if ( (fPdgcodeCurrentPart != 310 ) && (fPdgcodeCurrentPart != 3122 ) && (fPdgcodeCurrentPart != -3122 ) && (fPdgcodeCurrentPart != 3312 ) && (fPdgcodeCurrentPart != -3312) && (fPdgcodeCurrentPart != -333) ) continue;
5310 //Rejection of Pythia injected particles with David Chinellatos method - not the latest method, better Method with TString from MC generator in IsInjected() function below!
5312 /* if( (p0->GetStatus()==21) ||
5313 ((p0->GetPdgCode() == 443) &&
5314 (p0->GetMother() == -1) &&
5315 (p0->GetDaughter(0) == (iMc))) ){ index++; }
5317 if(p0->GetStatus()==21){std::cout<< "hello !!!!" <<std::endl;}
5319 std::cout<< "MC particle status: " << p0->GetStatus() <<std::endl;
5323 //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
5326 //injected particles could be from GenBox (single high pt tracks) or jet related tracks, both generated from PYTHIA MC generator
5328 //Check: MC particle mother
5330 //for feed-down checks
5331 /* //MC gen particles
5332 Int_t iMother = p0->GetMother(); //Motherparticle of V0 candidate (e.g. phi particle,..)
5334 AliAODMCParticle *partM = (AliAODMCParticle*)stack->UncheckedAt(iMother);
5336 if(partM) codeM = TMath::Abs(partM->GetPdgCode());
5339 3312 Xi- -3312 Xibar+
5340 3322 Xi0 -3322 Xibar0
5343 if((codeM == 3312)||(codeM == 3322))// feeddown for Lambda coming from Xi- and Xi0
5349 /* //Check: MC gen. particle decays via 2-pion decay? -> only to be done for the rec. particles !! (-> branching ratio ~ 70 % for K0s -> pi+ pi-)
5351 Int_t daughter0Label = p0->GetDaughter(0);
5352 AliAODMCParticle *mcDaughter0 = (AliAODMCParticle *)stack->UncheckedAt(daughter0Label);
5353 if(daughter0Label >= 0)
5354 {daughter0Type = mcDaughter0->GetPdgCode();}
5356 Int_t daughter1Label = p0->GetDaughter(1);
5357 AliAODMCParticle *mcDaughter1 = (AliAODMCParticle *)stack->UncheckedAt(daughter1Label);
5359 if(daughter1Label >= 1)
5360 {daughter1Type = mcDaughter1->GetPdgCode();} //requirement that daughters are pions is only done for the reconstructed V0s in GetListofV0s() below
5365 // Keep only K0s, Lambda and AntiLambda:
5366 if ( (fPdgcodeCurrentPart != 310 ) && (fPdgcodeCurrentPart != 3122 ) && (fPdgcodeCurrentPart != -3122 )) continue;
5367 // Check: Is physical primary
5369 //do not use anymore: //IsPhysicalPrimary = p0->IsPhysicalPrimary();
5370 //if(!IsPhysicalPrimary)continue;
5372 Float_t fDistPrimaryMax = 0.01; // [cm] max distance of production point to the primary vertex (criterion for choice of MC particles considered as primary)
5374 // Get the distance between production point of the MC mother particle and the primary vertex
5376 Double_t dx = mcXv-p0->Xv();//mc primary vertex - mc gen. v0 vertex
5377 Double_t dy = mcYv-p0->Yv();
5378 Double_t dz = mcZv-p0->Zv();
5380 Double_t fDistPrimary = TMath::Sqrt(dx*dx + dy*dy + dz*dz);
5381 Bool_t fPhysicalPrimary = (fDistPrimary < fDistPrimaryMax);
5383 if(!fPhysicalPrimary)continue;
5385 //if(fPhysicalPrimary){std::cout<<"hello**********************"<<std::endl;}
5387 /* std::cout<<"dx: "<<dx<<std::endl;
5388 std::cout<<"dy: "<<dy<<std::endl;
5389 std::cout<<"dz: "<<dz<<std::endl;
5391 std::cout<<"start: "<<std::endl;
5392 std::cout<<"mcXv: "<<mcXv<<std::endl;
5393 std::cout<<"mcYv: "<<mcYv<<std::endl;
5394 std::cout<<"mcZv: "<<mcZv<<std::endl;
5396 std::cout<<"p0->Xv(): "<<p0->Xv()<<std::endl;
5397 std::cout<<"p0->Yv(): "<<p0->Yv()<<std::endl;
5398 std::cout<<"p0->Zv(): "<<p0->Zv()<<std::endl;
5399 std::cout<<" "<<std::endl;
5400 std::cout<<"fDistPrimary"<<fDistPrimary<<std::endl;
5401 std::cout<<"fPhysicalPrimary"<<fPhysicalPrimary<<std::endl;
5404 //Is close enough to primary vertex to be considered as primary-like?
5406 //fRapCurrentPart = MyRapidity(p0->E(),p0->Pz());
5407 fEtaCurrentPart = p0->Eta();
5408 //fPtCurrentPart = p0->Pt();
5410 if (TMath::Abs(fEtaCurrentPart) < fCutEta){
5411 // if (TMath::Abs(fRapCurrentPart) > fCutRap)continue; //rap cut for crosschecks
5413 if(particletype == kK0){ //MC gen. K0s
5414 if (fPdgcodeCurrentPart==310){
5415 outputlist->Add(p0);
5419 if(particletype == kLambda){ //MC gen. Lambdas
5420 if (fPdgcodeCurrentPart==3122) {
5421 outputlist->Add(p0);
5425 if(particletype == kAntiLambda){
5426 if (fPdgcodeCurrentPart==-3122) { //MC gen. Antilambdas
5427 outputlist->Add(p0);
5432 }//end loop over MC generated particle
5434 Int_t nMCPart=outputlist->GetSize();
5441 //---------------------------------------------------------------------------
5443 Bool_t AliAnalysisTaskJetChem::FillFeeddownMatrix(TList* fListFeeddownCand, Int_t particletype)
5446 // Define Feeddown matrix
5447 Double_t lFeedDownMatrix [100][100];
5448 // FeedDownMatrix [Lambda Bin][Xi Bin];
5450 //Initialize entries of matrix:
5451 for(Int_t ilb = 0; ilb<100; ilb++){
5452 for(Int_t ixb = 0; ixb<100; ixb++){
5453 lFeedDownMatrix[ilb][ixb]=0; //first lambda bins, xi bins
5458 //----------------------------------------------------------------------------
5460 Double_t AliAnalysisTaskJetChem::MyRapidity(Double_t rE, Double_t rPz) const
5462 // Local calculation for rapidity
5463 return 0.5*TMath::Log((rE+rPz)/(rE-rPz+1.e-13));
5465 //----------------------------------------------------------------------------
5468 void AliAnalysisTaskJetChem::GetTracksInCone(TList* inputlist, TList* outputlist, const AliAODJet* jet,
5469 const Double_t radius, Double_t& sumPt, const Double_t minPt, const Double_t maxPt, Bool_t& isBadPt)
5471 // fill list of V0 tracks in cone around jet axis
5474 Bool_t isBadMaxPt = kFALSE;
5475 Bool_t isBadMinPt = kTRUE;
5479 jet->PxPyPz(jetMom);
5480 TVector3 jet3mom(jetMom);
5482 //if(jetets < jetetscutr)continue;
5484 for (Int_t itrack=0; itrack<inputlist->GetSize(); itrack++){//loop over all K0s found in event
5486 AliVParticle* track = dynamic_cast<AliVParticle*>(inputlist->At(itrack));
5488 Double_t trackMom[3];
5489 track->PxPyPz(trackMom);
5490 TVector3 track3mom(trackMom);
5492 Double_t dR = jet3mom.DeltaR(track3mom);
5494 if(dR<radius){//fill all the V0s inside cone into outputlist, radius is reutrn value of GetFFRadius()
5496 outputlist->Add(track);
5498 sumPt += track->Pt();
5500 if(maxPt>0 && track->Pt()>maxPt) isBadMaxPt = kTRUE; // reject jets containing any track with pt larger than this value, use GetFFMaxTrackPt()
5501 if(minPt>0 && track->Pt()>minPt) isBadMinPt = kFALSE; // reject jets with leading track with pt smaller than this value, use GetFFMinLTrackPt()
5507 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)
5508 if(maxPt>0 && isBadMaxPt) isBadPt = kTRUE; //..or because of leading track with too high pt (could be fake track)
5514 //____________________________________________________________________________________________________________________
5517 void AliAnalysisTaskJetChem::GetTracksInPerpCone(TList* inputlist, TList* outputlist, const AliAODJet* jet,
5518 const Double_t radius, Double_t& sumPerpPt)
5520 // fill list of tracks in two cones around jet axis rotated in phi +/- 90 degrees
5522 Double_t jetMom[3]; //array for entries in TVector3
5523 Double_t perpjetplusMom[3]; //array for entries in TVector3
5524 Double_t perpjetnegMom[3];
5528 jet->PxPyPz(jetMom); //get 3D jet momentum
5529 Double_t jetPerpPt = jet->Pt(); //original jet pt, invariant under rotations
5530 Double_t jetPhi = jet->Phi(); //original jet phi
5532 Double_t jetPerpposPhi = jetPhi + ((TMath::Pi())*0.5);//get new perp. jet axis phi clockwise
5533 Double_t jetPerpnegPhi = jetPhi - ((TMath::Pi())*0.5);//get new perp. jet axis phi counterclockwise
5535 TVector3 jet3mom(jetMom); //3-Vector for original rec. jet axis
5537 //Double_t phitest = jet3mom.Phi();
5539 perpjetplusMom[0]=(TMath::Cos(jetPerpposPhi)*jetPerpPt); //x coordinate (sidewards - when looking in beam direction)
5540 perpjetplusMom[1]=(TMath::Sin(jetPerpposPhi)*jetPerpPt); //y coordinate (upwards - when looking in beam direction)
5541 perpjetplusMom[2]=jetMom[2]; //z coordinate (along beam axis), invariant under azimuthal rotation
5543 perpjetnegMom[0]=(TMath::Cos(jetPerpnegPhi)*jetPerpPt); //x coordinate (sidewards - when looking in beam direction)
5544 perpjetnegMom[1]=(TMath::Sin(jetPerpnegPhi)*jetPerpPt); //y coordinate (upwards - when looking in beam direction)
5545 perpjetnegMom[2]=jetMom[2]; //z coordinate (along beam axis), invariant under azimuthal rotation
5548 TVector3 perpjetplus3mom(perpjetplusMom); //3-Vector for new perp. jet axis, clockwise rotated
5549 TVector3 perpjetneg3mom(perpjetnegMom); //3-Vector for new perp. jet axis, counterclockwise rotated
5551 //for crosscheck TVector3 rotation method
5553 //Double_t jetMomplusTest[3];
5554 //Double_t jetMomminusTest[3];
5556 //jet3mom.RotateZ(TMath::Pi()*0.5);//rotate original jet axis around +90 degrees in phi
5558 //perpjetminus3momTest = jet3mom.RotateZ((-1)*TMath::Pi()*0.5);
5560 // jet3mom.RotateZ(TMath::Pi()*0.5);
5561 // jet3mom.RotateZ((-1)*TMath::Pi()*0.5);
5563 //jetMomplusTest[0] = jet3mom.X(); //fetching perp. axis coordinates
5564 //jetMomplusTest[1] = jet3mom.Y();
5565 //jetMomplusTest[2] = jet3mom.Z();
5567 //TVector3 perpjetplus3momTest(jetMomplusTest); //new TVector3 for +90deg rotated jet axis with rotation method from ROOT
5568 //TVector3 perpjetminus3momTest(jetMomminusTest); //new TVector3 for -90deg rotated jet axis with rotation method from ROOT
5571 for (Int_t itrack=0; itrack<inputlist->GetSize(); itrack++){ //collect V0 content in perp cone, rotated clockwise
5573 AliVParticle* track = dynamic_cast<AliVParticle*>(inputlist->At(itrack)); //inputlist is fListK0s, all reconstructed K0s in event
5574 if(!track){std::cout<<"K0s track not found!!!"<<std::endl; continue;}
5576 Double_t trackMom[3];//3-mom of V0 particle
5577 track->PxPyPz(trackMom);
5578 TVector3 track3mom(trackMom);
5580 Double_t dR = perpjetplus3mom.DeltaR(track3mom);
5584 outputlist->Add(track); // output list is jetPerpConeK0list
5586 sumPerpPt += track->Pt();
5593 for (Int_t itrack=0; itrack<inputlist->GetSize(); itrack++){//collect V0 content in perp cone, rotated counterclockwise
5595 AliVParticle* track = dynamic_cast<AliVParticle*>(inputlist->At(itrack)); //inputlist is fListK0s, all reconstructed K0s in event
5596 if(!track){std::cout<<"K0s track not found!!!"<<std::endl; continue;}
5598 Double_t trackMom[3];//3-mom of V0 particle
5599 track->PxPyPz(trackMom);
5600 TVector3 track3mom(trackMom);
5602 Double_t dR = perpjetneg3mom.DeltaR(track3mom);
5606 outputlist->Add(track); // output list is jetPerpConeK0list
5608 sumPerpPt += track->Pt();
5614 // pay attention: this list contains the double amount of V0s, found in both cones
5615 // before using it, devide spectra by 2!!!
5616 sumPerpPt = sumPerpPt*0.5; //correct to do this?
5624 // _______________________________________________________________________________________________________________________________________________________
5626 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, TString& generatorName, Bool_t& isinjected){
5628 if(!v0)return kFALSE;
5630 TClonesArray *stackmc = 0x0;
5631 stackmc = (TClonesArray*)listmc->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
5634 Printf("ERROR: stack not available");
5639 Int_t negAssLabel = TMath::Abs(trackNeg->GetLabel()); //negative (reconstructed) charged track label in MC stack
5640 Int_t posAssLabel = TMath::Abs(trackPos->GetLabel()); //positive (reconstructed) charged track label in MC stack
5642 //injected particle checks
5648 AliAODMCHeader *header=(AliAODMCHeader*)listmc->FindObject(AliAODMCHeader::StdBranchName());
5649 if(!header)return kFALSE;
5651 mcXv=header->GetVtxX(); mcYv=header->GetVtxY(); mcZv=header->GetVtxZ();
5657 if(negAssLabel>=0 && negAssLabel < stackmc->GetEntriesFast() && posAssLabel>=0 && posAssLabel < stackmc->GetEntriesFast()){//safety check if label has valid value of stack
5659 AliAODMCParticle *mcNegPart =(AliAODMCParticle*)stackmc->UncheckedAt(negAssLabel);//fetch the, with one MC truth track associated (reconstructed), negative charged track
5660 v0Label = mcNegPart->GetMother();// mother of negative charged particle is v0, get v0 label here
5661 negDaughterpdg = mcNegPart->GetPdgCode();
5662 AliAODMCParticle *mcPosPart =(AliAODMCParticle*)stackmc->UncheckedAt(posAssLabel);//fetch the, with one MC truth track associated (reconstructed), positive charged track
5663 Int_t v0PosLabel = mcPosPart->GetMother(); //get mother label of positive charged track label
5664 posDaughterpdg = mcPosPart->GetPdgCode();
5666 if(v0Label >= 0 && v0Label < stackmc->GetEntriesFast() && v0Label == v0PosLabel){//first v0 mc label check, then: check if both daughters are stemming from same particle
5668 AliAODMCParticle *mcv0 = (AliAODMCParticle *)stackmc->UncheckedAt(v0Label); //fetch MC ass. particle to v0 (mother of the both charged daughter tracks)
5670 Float_t fDistPrimaryMax = 0.01; // [cm] max distance of production point to the primary vertex (criterion for choice of MC particles considered as primary)
5672 // Get the distance between production point of the MC mother particle and the primary vertex
5674 Double_t dx = mcXv-mcv0->Xv();//mc primary vertex - mc particle production vertex
5675 Double_t dy = mcYv-mcv0->Yv();
5676 Double_t dz = mcZv-mcv0->Zv();
5678 Float_t fDistPrimary = TMath::Sqrt(dx*dx + dy*dy + dz*dz);
5679 fPhysicalPrimary = kFALSE;//init
5681 fPhysicalPrimary = (fDistPrimary < fDistPrimaryMax);
5682 MCv0PDGCode = mcv0->GetPdgCode();
5684 //if(fPhysicalPrimary == kTRUE){//look only at physical primary particles
5686 isinjected = IsTrackInjected(v0Label, header, stackmc, generatorName);
5688 //trackinjected is kFALSE if it is either Hijing or has no generator name
5689 // std::cout<<" "<<std::endl;
5690 // std::cout<<"#### next particle: ####"<<std::endl;
5691 //std::cout<<"Is track injected: "<< trackinjected <<std::endl;
5692 // std::cout<<"pdg code: "<<MCv0PDGCode<<std::endl;
5693 // std::cout<<"v0Label: "<<v0Label<<std::endl;
5695 MCPt = mcv0->Pt();//for MC data, always use MC gen. pt for any pt distributions, also for the spectra, used for normalisation
5696 //for feed-down checks later
5698 Int_t motherLabel = mcv0->GetMother(); //get mother particle label of v0 particle
5699 // std::cout<<"motherLabel: "<<motherLabel<<std::endl;
5701 if(motherLabel >= 0 && v0Label < stackmc->GetEntriesFast()) //do safety check for mother label
5703 AliAODMCParticle *mcMother = (AliAODMCParticle *)stackmc->UncheckedAt(motherLabel); //get mother particle
5704 motherType = mcMother->GetPdgCode(); //get PDG code of mother
5707 Double_t XibarPt = 0.;
5709 if(particletype == kLambda){
5710 if((motherType == 3312)||(motherType == 3322)){ //if v0 mother is Xi0 or Xi- fill MC gen. pt in FD La histogram
5711 XiPt = mcMother->Pt();
5712 fh1MCXiPt->Fill(XiPt);
5715 if(particletype == kAntiLambda){
5716 if((motherType == -3312)||(motherType == -3322)){ //if v0 mother is Xibar0 or Xibar+ fill MC gen. pt in FD ALa histogram
5717 XibarPt = mcMother->Pt();
5718 fh1MCXibarPt->Fill(XibarPt);
5724 //pdg code checks etc..
5726 if(particletype == kK0){
5728 if(TMath::Abs(posDaughterpdg) != 211){return kFALSE;}//one or both of the daughters are not a pion
5729 if(TMath::Abs(negDaughterpdg) != 211){return kFALSE;}
5731 if(MCv0PDGCode != 310) {return kFALSE;}
5734 if(particletype == kLambda){
5735 if(MCv0PDGCode != 3122)return kFALSE;//if particle is not Antilambda, v0 is rejected
5736 if(posDaughterpdg != 2212)return kFALSE;
5737 if(negDaughterpdg != -211)return kFALSE; //pdg code check for Lambda daughters
5739 //{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 //}
5742 if(particletype == kAntiLambda){
5743 if(MCv0PDGCode != -3122)return kFALSE;
5744 if(posDaughterpdg != 211)return kFALSE;
5745 if(negDaughterpdg !=-2212)return kFALSE; //pdg code check for Antilambda daughters
5748 //{if((motherType == -3312)||(motherType == -3322)){continue;}//if bar{Xi0} and Xi+ is motherparticle of Antilambda, particle is rejected
5752 return kTRUE; //check was successful
5753 }//end mc v0 label check
5754 }// end of stack label check
5759 return kFALSE; //check wasn't successful
5761 //________________________________________________________________________________________________________________________________________________________
5764 Bool_t AliAnalysisTaskJetChem::IsParticleMatching(const AliAODMCParticle* mcp0, const Int_t v0Label){
5766 const Int_t mcp0label = mcp0->GetLabel();
5768 if(v0Label == mcp0label)return kTRUE;
5773 //_______________________________________________________________________________________________________________________________________________________
5775 Bool_t AliAnalysisTaskJetChem::DaughterTrackCheck(AliAODv0* v0, Int_t& nnum, Int_t& pnum){
5778 if(v0->GetNDaughters() != 2) return kFALSE;//case v0 has more or less than 2 daughters, avoids seg. break at some AOD files //reason?
5781 // safety check of input parameters
5784 if(fDebug > 1){std::cout << std::endl
5785 << "Warning in AliAnalysisTaskJetChem::DaughterTrackCheck:" << std::endl
5786 << "v0 = " << v0 << std::endl;}
5792 //Daughters track check: its Luke Hanrattys method to check daughters charge
5798 AliAODTrack *ntracktest =(AliAODTrack*)(v0->GetDaughter(nnum));
5800 if(ntracktest == NULL)
5802 if(fDebug > 1){std::cout << std::endl
5803 << "Warning in AliAnalysisTaskJetChem::DaughterTrackCheck:" << std::endl
5804 << "ntracktest = " << ntracktest << std::endl;}
5809 if(ntracktest->Charge() > 0)
5815 const AliAODTrack *trackNeg=(AliAODTrack *)(v0->GetDaughter(nnum));
5816 const AliAODTrack *trackPos=(AliAODTrack *)(v0->GetDaughter(pnum));
5818 //Check if both tracks are available
5819 if (!trackPos || !trackNeg) {
5820 if(fDebug > 1) Printf("strange analysis::UserExec:: Error:Could not retrieve one of the daughter tracks\n");
5825 //remove like sign V0s
5826 if ( trackPos->Charge() == trackNeg->Charge() ){
5827 //if(fDebug>1) Printf("%s:%d found like-sign V0", (char*)__FILE__,__LINE__);
5835 //______________________________________________________________________
5836 TString AliAnalysisTaskJetChem::GetGenerator(Int_t label, AliAODMCHeader* header){
5837 Int_t nsumpart=0;//number of particles
5838 TList *lh=header->GetCocktailHeaders();//TList with all generator headers
5839 Int_t nh=lh->GetEntries();//number of entries in TList with all headers
5841 for(Int_t i=0;i<nh;i++){
5842 AliGenEventHeader* gh=(AliGenEventHeader*)lh->At(i);
5843 TString genname=gh->GetName();//name of particle generator
5844 Int_t npart=gh->NProduced();//number of stable or undecayed particles in MC stack block (?)
5845 if(label>=nsumpart && label<(nsumpart+npart)) return genname;
5852 //_____________________________________________________________________
5853 void AliAnalysisTaskJetChem::GetTrackPrimaryGenerator(Int_t lab, AliAODMCHeader *header,TClonesArray *arrayMC,TString &nameGen){
5855 // method to check if a particle is stemming from a given generator
5857 nameGen=GetGenerator(lab,header);
5859 // Int_t countControl=0;
5861 while(nameGen.IsWhitespace()){
5862 AliAODMCParticle *mcpart= (AliAODMCParticle*)arrayMC->At(lab);//get MC generated particle for particle MC label
5864 printf("AliAnalysisTaskJetChem::IsTrackInjected - BREAK: No valid AliAODMCParticle at label %i\n",lab);
5867 Int_t mother = mcpart->GetMother();
5870 printf("AliAnalysisTaskJetChem::IsTrackInjected - BREAK: Reached primary particle without valid mother\n");
5874 nameGen=GetGenerator(mother,header);
5877 // if(countControl>=10){ // 10 = arbitrary number; protection from infinite loops
5878 // printf("AliVertexingHFUtils::IsTrackInjected - BREAK: Protection from infinite loop active\n");
5888 //---------------------------------------------------------------------------------------------------------------------
5889 Bool_t AliAnalysisTaskJetChem::IsTrackInjected(Int_t lab, AliAODMCHeader *header,TClonesArray *arrayMC, TString& nameGen){
5890 // method to check if a v0 particle comes from the signal event or from the underlying Hijing event
5893 GetTrackPrimaryGenerator(lab, header, arrayMC, nameGen);
5895 if(nameGen.IsWhitespace() || nameGen.Contains("ijing")) return kFALSE;//particle has either no info about generator or is Hijing particle, so it is not injected
5897 //std::cout<<"generator name: "<<nameGen<<std::endl;
5902 //_________________________________________________________________________________________________________________________________________
5903 Double_t AliAnalysisTaskJetChem::SmearJetPt(Double_t jetPt, Int_t /*cent*/, Double_t /*jetRadius*/, Double_t /*ptmintrack*/, Double_t& jetPtSmear){
5905 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
5909 /* if(cent>10) cl = 2;
5914 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
5915 //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
5917 //fsmear->SetParameters(1,0,4.472208);// for 2010 PbPb jets, R=0.2, ptmintrack = 0.15 GeV/c, cent 00-10%
5919 /* //delta-pt width for anti-kt jet finder:
5922 if((cl == 1)&&(jetRadius == 0.4)&&(ptmintrack == 0.15)){
5923 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
5925 if((cl == 2)&&(jetRadius == 0.4)&&(ptmintrack == 0.15)){
5926 fsmear->SetParameters(1,0,8.536195);
5928 if((cl == 3)&&(jetRadius == 0.4)&&(ptmintrack == 0.15)){
5929 fsmear->SetParameters(1,0,?);
5931 if((cl == 4)&&(jetRadius == 0.4)&&(ptmintrack == 0.15)){
5932 fsmear->SetParameters(1,0,5.229839);
5936 if((cl == 1)&&(jetRadius == 0.3)&&(ptmintrack == 0.15)){
5937 fsmear->SetParameters(1,0,7.145967);
5939 if((cl == 2)&&(jetRadius == 0.3)&&(ptmintrack == 0.15)){
5940 fsmear->SetParameters(1,0,5.844796);
5942 if((cl == 3)&&(jetRadius == 0.3)&&(ptmintrack == 0.15)){
5943 fsmear->SetParameters(1,0,?);
5945 if((cl == 4)&&(jetRadius == 0.3)&&(ptmintrack == 0.15)){
5946 fsmear->SetParameters(1,0,3.630751);
5950 if((cl == 1)&&(jetRadius == 0.2)&&(ptmintrack == 0.15)){
5951 fsmear->SetParameters(1,0,4.472208);
5953 if((cl == 2)&&(jetRadius == 0.2)&&(ptmintrack == 0.15)){
5954 fsmear->SetParameters(1,0,3.543938);
5956 if((cl == 3)&&(jetRadius == 0.2)&&(ptmintrack == 0.15)){
5957 fsmear->SetParameters(1,0,?);
5959 if((cl == 4)&&(jetRadius == 0.2)&&(ptmintrack == 0.15)){
5960 fsmear->SetParameters(1,0,1.037476);
5965 Double_t r = fsmear.GetRandom();
5966 jetPtSmear = jetPt + r;
5968 // std::cout<<"jetPt: "<<jetPt<<std::endl;
5969 // std::cout<<"jetPtSmear: "<<jetPtSmear<<std::endl;
5970 // std::cout<<"r: "<<r<<std::endl;
5977 //______________________________________________________________________________________________________________________
5978 //____________________________________________________________________________________________________________________
5980 Bool_t AliAnalysisTaskJetChem::IsParticleInCone(const AliVParticle* part1, const AliVParticle* part2, Double_t dRMax) const
5982 // decides whether a particle is inside a jet cone
5983 if (!part1 || !part2)
5986 TVector3 vecMom2(part2->Px(),part2->Py(),part2->Pz());
5987 TVector3 vecMom1(part1->Px(),part1->Py(),part1->Pz());
5988 Double_t dR = vecMom2.DeltaR(vecMom1); // = sqrt(dEta*dEta+dPhi*dPhi)
5989 if(dR<dRMax) // momentum vectors of part1 and part2 are closer than dRMax
5993 //__________________________________________________________________________________________________________________
5996 Bool_t AliAnalysisTaskJetChem::IsRCJCOverlap(TList* recjetlist, const AliVParticle* part, Double_t dDistance) const{
5998 if(!recjetlist) return kFALSE;
5999 if(!part) return kFALSE;
6000 if(!dDistance) return kFALSE;
6001 Int_t nRecJetsCuts = fJetsRecCuts->GetEntries();
6003 for(Int_t i=0; i<nRecJetsCuts; ++i){ //loop over all reconstructed jets in events
6004 AliAODJet* jet = (AliAODJet*) (recjetlist->At(i));
6005 if(!jet){if(fDebug>2)std::cout<<"AliAnalysisTaskJetChem::IsRCJCOverlap jet pointer invalid!"<<std::endl;continue;}
6006 if(IsParticleInCone(jet, part, dDistance) == kTRUE)return kTRUE;//RC and JC are overlapping
6008 }//end loop testing RC-JC overlap
6009 return kFALSE;//RC and JC are not overlapping -> good!
6012 //_______________________________________________________________________________________________________________________
6013 AliAODJet* AliAnalysisTaskJetChem::GetRandomCone(TList* jetlist, Double_t dEtaConeMax, Double_t dDistance) const
6015 TLorentzVector vecRdCone;
6016 AliAODJet* jetRC = 0;//random cone candidate
6017 Double_t dEta, dPhi; //random eta and phi value for RC
6018 Bool_t IsRCoutJC = kFALSE;//check whether RC is not overlapping with any selected jet cone in event
6019 Int_t iRCTrials = 10;//search at maximum 10 times for random cone that doesn't overlap with jet cone
6021 for(Int_t i=0; i<iRCTrials; iRCTrials++){
6023 dEta = dEtaConeMax*(2*fRandom->Rndm()-1.); //random eta value in range: [-dEtaConeMax,+dEtaConeMax]
6024 dPhi = TMath::TwoPi()*fRandom->Rndm(); //random phi value in range: [0,2*Pi]
6025 vecRdCone.SetPtEtaPhiM(1.,dEta,dPhi,0.);
6026 jetRC = new AliAODJet(vecRdCone);//new RC candidate
6028 if (!IsRCJCOverlap(jetlist,jetRC,dDistance))
6030 IsRCoutJC = kTRUE; //std::cout<<"RC and JC are not overlapping!!!"<<std::endl;
6034 delete jetRC; //RC is overlapping with JC, delete this RC candidate
6037 if(!IsRCoutJC) {jetRC = 0;}//in case no random cone was selected
6043 // _______________________________________________________________________________________________________________________
6044 AliAODJet* AliAnalysisTaskJetChem::GetMedianCluster()
6046 // fill tracks from bckgCluster branch,
6047 // using cluster with median density (odd number of clusters)
6048 // or picking randomly one of the two closest to median (even number)
6050 Int_t nBckgClusters = fBckgJetsRec->GetEntries(); // not 'recCuts': use all clusters in full eta range
6052 if(nBckgClusters<3) return 0; // need at least 3 clusters (skipping 2 highest)
6054 Double_t* bgrDensity = new Double_t[nBckgClusters];
6055 Int_t* indices = new Int_t[nBckgClusters];
6057 for(Int_t ij=0; ij<nBckgClusters; ++ij){
6059 AliAODJet* bgrCluster = (AliAODJet*)(fBckgJetsRec->At(ij));
6060 Double_t clusterPt = bgrCluster->Pt();
6061 Double_t area = bgrCluster->EffectiveAreaCharged();
6063 Double_t density = 0;
6064 if(area>0) density = clusterPt/area;
6066 bgrDensity[ij] = density;
6071 TMath::Sort(nBckgClusters, bgrDensity, indices);
6073 // get median cluster
6075 AliAODJet* medianCluster = 0;
6077 if(TMath::Odd(nBckgClusters)){
6079 Int_t medianIndex = indices[(Int_t) (0.5*(nBckgClusters+1))];
6081 medianCluster = (AliAODJet*)(fBckgJetsRec->At(medianIndex));
6083 //Double_t clusterPt = medianCluster->Pt();
6084 //Double_t area = medianCluster->EffectiveAreaCharged();
6088 Int_t medianIndex1 = indices[(Int_t) (0.5*nBckgClusters)];
6089 Int_t medianIndex2 = indices[(Int_t) (0.5*nBckgClusters+1)];
6091 AliAODJet* medianCluster1 = (AliAODJet*)(fBckgJetsRec->At(medianIndex1));
6092 AliAODJet* medianCluster2 = (AliAODJet*)(fBckgJetsRec->At(medianIndex2));
6094 // Double_t density1 = 0;
6095 //Double_t clusterPt1 = medianCluster1->Pt();
6096 //Double_t area1 = medianCluster1->EffectiveAreaCharged();
6097 //if(area1>0) Double_t density1 = clusterPt1/area1;
6099 // Double_t density2 = 0;
6100 //Double_t clusterPt2 = medianCluster2->Pt();
6101 //Double_t area2 = medianCluster2->EffectiveAreaCharged();
6102 // if(area2>0) Double_t density2 = clusterPt2/area2;
6104 medianCluster = ( (gRandom->Rndm()>0.5) ? medianCluster1 : medianCluster2 ); // select one randomly to avoid adding areas
6107 delete[] bgrDensity;
6110 return medianCluster;
6113 //____________________________________________________________________________________________
6115 Double_t AliAnalysisTaskJetChem::AreaCircSegment(Double_t dRadius, Double_t dDistance) const
6117 // calculate area of a circular segment defined by the circle radius and the (oriented) distance between the secant line and the circle centre
6118 Double_t dEpsilon = 1e-2;
6119 Double_t dR = dRadius;
6120 Double_t dD = dDistance;
6121 if (TMath::Abs(dR)<dEpsilon)
6123 if(fDebug>0) printf("AliAnalysisTaskJetChem::AreaCircSegment: Error: Too small radius: %f < %f\n",dR,dEpsilon);
6129 return TMath::Pi()*dR*dR;
6130 return dR*dR*TMath::ACos(dD/dR)-dD*TMath::Sqrt(dR*dR-dD*dD);