From af2872dac8feebeb0d14508794faac4e2875fdfd Mon Sep 17 00:00:00 2001 From: skowron Date: Sat, 16 Oct 2004 07:04:59 +0000 Subject: [PATCH] methods needed by stavisky mixing method (HBT)" --- ANALYSIS/AliAODPair.cxx | 15 +++++++++++++++ ANALYSIS/AliAODPair.h | 6 ++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ANALYSIS/AliAODPair.cxx b/ANALYSIS/AliAODPair.cxx index 436c8d9aeb7..f08d4be9e2c 100644 --- a/ANALYSIS/AliAODPair.cxx +++ b/ANALYSIS/AliAODPair.cxx @@ -606,3 +606,18 @@ Double_t AliAODPair::GetRStar() return rstar; } + +void AliAODPair::MirrorSecond() +{ +//makes local copy of the second particle and mirrors their momenta +//for its deletion is responsible who calls this method + fPart2 = (AliVAODParticle*)fPart2->Clone(); + fPart2->SetMomentum(-fPart2->Px(),-fPart2->Py(),-fPart2->Pz(),fPart2->E()); +} + +void AliAODPair::DeleteSecond() +{ +//Deletes second particle + delete fPart2; + fPart2 = 0x0; +} diff --git a/ANALYSIS/AliAODPair.h b/ANALYSIS/AliAODPair.h index 0eca8a7f03a..a928c62a9a5 100644 --- a/ANALYSIS/AliAODPair.h +++ b/ANALYSIS/AliAODPair.h @@ -72,6 +72,8 @@ class AliAODPair: public TObject virtual Double_t GetRStar() ; virtual Double_t GetR() ;//returns distance between particle production points + void MirrorSecond(); + void DeleteSecond(); protected: AliVAODParticle* fPart1; //pointer to first particle AliVAODParticle* fPart2; //pointer to second particle @@ -170,10 +172,10 @@ void AliAODPair::SetParticles(AliVAODParticle* p1,AliVAODParticle* p2) { //sets the particle to the pair - fPart1 = p1; + fPart1 = p1; fPart2 = p2; if (fSwappedPair) //if we have Swapped (so we are not) - fSwappedPair->SetParticles(p2,p1); //set particles for him too + fSwappedPair->SetParticles(fPart2,p1); //set particles for him too Changed(); //and do nothing until will be asked for } -- 2.39.3