From d77fd7b39508ff337c8408f9ea8c758bb3b55f89 Mon Sep 17 00:00:00 2001 From: hristov Date: Tue, 22 Feb 2005 05:01:40 +0000 Subject: [PATCH] AOD class for V0 analysis (B.Hippolyte) --- ANALYSIS/ANALYSISLinkDef.h | 2 +- ANALYSIS/AliAODv0.cxx | 124 +++++++++++++++++++++++++++++ ANALYSIS/AliAODv0.h | 159 +++++++++++++++++++++++++++++++++++++ ANALYSIS/libANALYSIS.pkg | 4 +- 4 files changed, 286 insertions(+), 3 deletions(-) create mode 100644 ANALYSIS/AliAODv0.cxx create mode 100644 ANALYSIS/AliAODv0.h diff --git a/ANALYSIS/ANALYSISLinkDef.h b/ANALYSIS/ANALYSISLinkDef.h index accfef2ea8a..f632c2a6a87 100644 --- a/ANALYSIS/ANALYSISLinkDef.h +++ b/ANALYSIS/ANALYSISLinkDef.h @@ -91,6 +91,6 @@ #pragma link C++ class AliAODOrPairCut+; #pragma link C++ class AliAODAndPairCut+; - +#pragma link C++ class AliAODv0+; #endif diff --git a/ANALYSIS/AliAODv0.cxx b/ANALYSIS/AliAODv0.cxx new file mode 100644 index 00000000000..4779889df25 --- /dev/null +++ b/ANALYSIS/AliAODv0.cxx @@ -0,0 +1,124 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +//------------------------------------------------------------------------- +// Implementation of the Analysis Oriented Data (AOD) V0 vertex class +// +// Origin: B.Hippolyte, IReS, hippolyt@in2p3.fr +// G.Van Buren, BNL, gene@bnl.gov (original STAR MuDsts) +//------------------------------------------------------------------------- +#include +#include +#include + +#include "AliESD.h" + +#include "AliAODv0.h" + +ClassImp(AliAODv0) + +AliAODv0::AliAODv0() : TObject() { + //-------------------------------------------------------------------- + // Default constructor + //-------------------------------------------------------------------- + fDecayVertexV0X = 999; + fDecayVertexV0Y = 999; + fDecayVertexV0Z = 999; + fDcaV0Daughters = 999; + fDcaV0ToPrimVertex = 999; + fDcaPosToPrimVertex = 999; + fDcaNegToPrimVertex = 999; + fMomPosX = 999; + fMomPosY = 999; + fMomPosZ = 999; + fMomNegX = 999; + fMomNegY = 999; + fMomNegZ = 999; + + fKeyPos = 999; + fKeyNeg = 999; + + fChi2 = 999; + fEvent = 0; +} + +AliAODv0::AliAODv0(AliESDv0* rV0Vertex ,AliESD* rEvent){ + this->Fill(rV0Vertex,rEvent); +} + +// AliAODv0::~AliAODv0(){ +// } + +void AliAODv0::Fill(AliESDv0* rV0Vertex ,AliESD* rEvent){ + fEvent=rEvent; + Double_t tDecayVertexV0[3]; rV0Vertex->GetXYZ(tDecayVertexV0[0],tDecayVertexV0[1],tDecayVertexV0[2]); + fDecayVertexV0X = tDecayVertexV0[0]; + fDecayVertexV0Y = tDecayVertexV0[1]; + fDecayVertexV0Z = tDecayVertexV0[2]; + + fDcaV0Daughters = rV0Vertex->GetDcaDaughters(); + + fDcaV0ToPrimVertex = rV0Vertex->GetD(); + + + Double_t tMomPos[3]; rV0Vertex->GetPPxPyPz(tMomPos[0],tMomPos[1],tMomPos[2]); + fMomPosX = tMomPos[0]; + fMomPosY = tMomPos[1]; + fMomPosZ = tMomPos[2]; + + Double_t tMomNeg[3]; rV0Vertex->GetNPxPyPz(tMomNeg[0],tMomNeg[1],tMomNeg[2]); + fMomNegX = tMomNeg[0]; + fMomNegY = tMomNeg[1]; + fMomNegZ = tMomNeg[2]; + + fKeyPos = TMath::Abs(rV0Vertex->GetPindex());// need to ask why Abs + fKeyNeg = TMath::Abs(rV0Vertex->GetNindex()); + + AliESDtrack *pTrack=fEvent->GetTrack(fKeyPos); + AliESDtrack *nTrack=fEvent->GetTrack(fKeyNeg); + + Float_t tDcaPosToPrimVertex[2]; + if(pTrack) pTrack->GetImpactParameters(tDcaPosToPrimVertex[0],tDcaPosToPrimVertex[1]); + else { tDcaPosToPrimVertex[0]=999.; tDcaPosToPrimVertex[1]=999.;} + + fDcaPosToPrimVertex = TMath::Sqrt(tDcaPosToPrimVertex[0]*tDcaPosToPrimVertex[0]+tDcaPosToPrimVertex[1]*tDcaPosToPrimVertex[1]); + + Float_t tDcaNegToPrimVertex[2]; + if(nTrack) nTrack->GetImpactParameters(tDcaNegToPrimVertex[0],tDcaNegToPrimVertex[1]); + else { tDcaNegToPrimVertex[0]=999.; tDcaNegToPrimVertex[1]=999.;} + + fDcaNegToPrimVertex = TMath::Sqrt(tDcaNegToPrimVertex[0]*tDcaNegToPrimVertex[0]+tDcaNegToPrimVertex[1]*tDcaPosToPrimVertex[1]); +} + +void AliAODv0::ResetV0(){ + fDecayVertexV0X = 999; + fDecayVertexV0Y = 999; + fDecayVertexV0Z = 999; + fDcaV0Daughters = 999; + fDcaV0ToPrimVertex = 999; + fDcaPosToPrimVertex = 999; + fDcaNegToPrimVertex = 999; + fMomPosX = 999; + fMomPosY = 999; + fMomPosZ = 999; + fMomNegX = 999; + fMomNegY = 999; + fMomNegZ = 999; + + fKeyPos = 999; + fKeyNeg = 999; + + fChi2 = 999; +} diff --git a/ANALYSIS/AliAODv0.h b/ANALYSIS/AliAODv0.h new file mode 100644 index 00000000000..a17e1c9ab75 --- /dev/null +++ b/ANALYSIS/AliAODv0.h @@ -0,0 +1,159 @@ +#ifndef ALIAODV0_H +#define ALIAODV0_H + +/* Copyright(c) 2004-2005, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +//------------------------------------------------------------------------- +// Implementation of the Analysis Oriented Data (AOD) V0 vertex class +// +// Origin: B.Hippolyte, IReS, hippolyt@in2p3.fr +// G.Van Buren, BNL, gene@bnl.gov (original STAR MuDsts) +//------------------------------------------------------------------------- + +#include +#include + +class AliESD; +class AliESDVertex; +class AliESDv0; +class AliESDtrack; + + +class AliAODv0 : public TObject { + +public: + AliAODv0(); + AliAODv0(AliESDv0*,AliESD*); + void Fill(AliESDv0*,AliESD*); + void ResetV0(); + + Double_t decayVertexV0X() const; + Double_t decayVertexV0Y() const; + Double_t decayVertexV0Z() const; + + Double_t dcaV0Daughters() const; + Double_t dcaV0ToPrimVertex() const; + Double_t dcaPosToPrimVertex() const; + Double_t dcaNegToPrimVertex() const; + + Double_t momPosX() const; + Double_t momPosY() const; + Double_t momPosZ() const; + Double_t momNegX() const; + Double_t momNegY() const; + Double_t momNegZ() const; + + Int_t keyPos() const; + Int_t keyNeg() const; + + Double_t chi2V0() const; + + // Following Need to be moved to Base Class + Double_t momV0X(); + Double_t momV0Y(); + Double_t momV0Z(); + + Double_t Ptot2Pos(); + Double_t Ptot2Neg(); + Double_t Ptot2V0(); + Double_t Pt2V0(); + Double_t MomPosAlongV0(); + Double_t MomNegAlongV0(); + Double_t alphaV0(); + Double_t ptArmV0(); + // Above Need to be moved to Base Class + + +protected: + Double_t fDecayVertexV0X; + Double_t fDecayVertexV0Y; + Double_t fDecayVertexV0Z; + Double_t fDcaV0Daughters; + Double_t fDcaV0ToPrimVertex; + Double_t fDcaPosToPrimVertex; + Double_t fDcaNegToPrimVertex; + Double_t fMomPosX; + Double_t fMomPosY; + Double_t fMomPosZ; + Double_t fMomNegX; + Double_t fMomNegY; + Double_t fMomNegZ; + + Int_t fKeyPos; + Int_t fKeyNeg; + + Double_t fChi2; + AliESD *fEvent; + + ClassDef(AliAODv0,1) // AOD V0 vertex +}; + +inline Double_t AliAODv0::decayVertexV0X() const {return fDecayVertexV0X;} +inline Double_t AliAODv0::decayVertexV0Y() const {return fDecayVertexV0Y;} +inline Double_t AliAODv0::decayVertexV0Z() const {return fDecayVertexV0Z;} + +inline Double_t AliAODv0::dcaV0Daughters() const {return fDcaV0Daughters;} +inline Double_t AliAODv0::dcaV0ToPrimVertex() const {return fDcaV0ToPrimVertex;} +inline Double_t AliAODv0::dcaPosToPrimVertex() const {return fDcaPosToPrimVertex;} +inline Double_t AliAODv0::dcaNegToPrimVertex() const {return fDcaNegToPrimVertex;} + +inline Double_t AliAODv0::momPosX() const {return fMomPosX;} +inline Double_t AliAODv0::momPosY() const {return fMomPosY;} +inline Double_t AliAODv0::momPosZ() const {return fMomPosZ;} +inline Double_t AliAODv0::momNegX() const {return fMomNegX;} +inline Double_t AliAODv0::momNegY() const {return fMomNegY;} +inline Double_t AliAODv0::momNegZ() const {return fMomNegZ;} + +inline Int_t AliAODv0::keyPos() const {return fKeyPos;} +inline Int_t AliAODv0::keyNeg() const {return fKeyNeg;} + +inline Double_t AliAODv0::chi2V0() const {return fChi2;} + +// Following Need to be moved to Base Class +inline Double_t AliAODv0::momV0X(){return momPosX()+momNegX();} +inline Double_t AliAODv0::momV0Y(){return momPosY()+momNegY();} +inline Double_t AliAODv0::momV0Z(){return momPosZ()+momNegZ();} + +inline Double_t AliAODv0::Ptot2Pos(){ + return (::pow(momPosX(),2) + ::pow(momPosY(),2) + ::pow(momPosZ(),2) ); +} +inline Double_t AliAODv0::Ptot2Neg(){ + return (::pow(momNegX(),2) + ::pow(momNegY(),2) + ::pow(momNegZ(),2) ); +} +inline Double_t AliAODv0::Pt2V0(){ + return (::pow(momV0X(),2) + ::pow(momV0Y(),2) ); +} + +inline Double_t AliAODv0::Ptot2V0(){return ( Pt2V0() + ::pow(momV0Z(),2) );} + +inline Double_t AliAODv0::MomPosAlongV0(){ + Double_t mPtot2V0 = Ptot2V0(); + if (mPtot2V0) + return (momPosX()*momV0X() + + momPosY()*momV0Y() + + momPosZ()*momV0Z()) / ::sqrt(mPtot2V0); + return 0.; +} + +inline Double_t AliAODv0::MomNegAlongV0(){ + Double_t mPtot2V0 = Ptot2V0(); + if (mPtot2V0) + return (momNegX()*momV0X() + + momNegY()*momV0Y() + + momNegZ()*momV0Z()) / ::sqrt(mPtot2V0); + return 0.; +} + +inline Double_t AliAODv0::alphaV0(){ + return 1.-(2./(1.+(MomPosAlongV0()/MomNegAlongV0()))); +} +inline Double_t AliAODv0::ptArmV0(){ + return ::sqrt(Ptot2Pos()-MomPosAlongV0()*MomPosAlongV0()); +} + +// Above Need to be moved to Base Class + +#endif + + diff --git a/ANALYSIS/libANALYSIS.pkg b/ANALYSIS/libANALYSIS.pkg index d8c20fbd7fb..b95f5ab1417 100644 --- a/ANALYSIS/libANALYSIS.pkg +++ b/ANALYSIS/libANALYSIS.pkg @@ -10,7 +10,7 @@ SRCS= TGliteXmlEventlist.cxx\ AliReaderESD.cxx AliReaderESDTree.cxx \ AliTrackPoints.cxx AliClusterMap.cxx \ AliD0toKpi.cxx AliD0toKpiAnalysis.cxx AliFlowAnalysis.cxx \ - AliMuonAnalysis.cxx \ + AliMuonAnalysis.cxx AliAODv0.cxx HDRS= $(SRCS:.cxx=.h) @@ -26,6 +26,6 @@ EXPORT:=AliAOD.h AliEventBuffer.h\ AliReader.h AliReaderESD.h \ AliTrackPoints.h AliClusterMap.h \ AliFlowAnalysis.h AliReaderESDTree.h \ - AliMuonAnalysis.h + AliMuonAnalysis.h AliAODv0.h EINCLUDE:= TPC CONTAINERS ITS -- 2.31.1