X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=ANALYSIS%2FAliAOD.cxx;h=25eb40bb3e5bed7cadc0fa038ba0e38584432f64;hp=18f92254e3315171061677a15dd76d45598d4bd4;hb=0d8a4589812f0849a7297116c2a305015cc4ecb6;hpb=81fa5b79ac8cfc20003df34d5f959905ea774946 diff --git a/ANALYSIS/AliAOD.cxx b/ANALYSIS/AliAOD.cxx index 18f92254e33..25eb40bb3e5 100644 --- a/ANALYSIS/AliAOD.cxx +++ b/ANALYSIS/AliAOD.cxx @@ -23,11 +23,22 @@ #include #include "AliAOD.h" - #include "AliAODParticle.h" +#include "AliTrackPoints.h" ClassImp(AliAOD) +AliAOD::AliAOD(): + fParticles(10), + fIsRandomized(kFALSE), + fPrimaryVertexX(0.0), + fPrimaryVertexY(0.0), + fPrimaryVertexZ(0.0) +{ + //ctor + SetOwner(kTRUE); +} + /**************************************************************************/ void AliAOD::AddParticle(TParticle* part, Int_t idx) @@ -74,3 +85,60 @@ void AliAOD::Reset() } // fRandomized = kFALSE; } +/**************************************************************************/ + +void AliAOD::GetPrimaryVertex(Double_t&x, Double_t&y, Double_t&z) +{ +//returns positions of the primary vertex + x = fPrimaryVertexX; + y = fPrimaryVertexY; + z = fPrimaryVertexZ; +} +/**************************************************************************/ + +void AliAOD::SetPrimaryVertex(Double_t x, Double_t y, Double_t z) +{ +//Sets positions of the primary vertex + fPrimaryVertexX = x; + fPrimaryVertexY = y; + fPrimaryVertexZ = z; +} +/**************************************************************************/ + +Int_t AliAOD::GetNumberOfCharged(Double_t etamin, Double_t etamax) const +{ + //reurns number of charged particles within given pseudorapidity range + Int_t n; + Int_t npart = fParticles.GetEntries(); + for (Int_t i = 0; i < npart; i++) + { + AliVAODParticle* p = (AliVAODParticle*)fParticles.At(i); + Double_t eta = p->Eta(); + if ( (eta < etamin) || (eta > etamax) ) continue; + if (p->Charge() != 0.0) n++; + } + return 0; +} +/**************************************************************************/ + +void AliAOD::Move(Double_t x, Double_t y, Double_t z) +{ + //moves all spacial coordinates about this vector + // vertex + // track points + // and whatever will be added to AOD and AOD particles that is a space coordinate + + fPrimaryVertexX += x; + fPrimaryVertexY += y; + fPrimaryVertexZ += z; + + Int_t npart = fParticles.GetEntries(); + for (Int_t i = 0; i < npart; i++) + { + AliVAODParticle* p = (AliVAODParticle*)fParticles.At(i); + AliTrackPoints* tp = p->GetTPCTrackPoints(); + if (tp) tp->Move(x,y,z); + tp = p->GetITSTrackPoints(); + if (tp) tp->Move(x,y,z); + } +}