Little change to run on CAF
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAODRecoDecayHF.h
CommitLineData
3244eeed 1#ifndef ALIAODRECODECAYHF_H
2#define ALIAODRECODECAYHF_H
3/* Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6//***********************************************************
7// Class AliAODRecoDecayHF
8// base class for AOD reconstructed heavy-flavour decays
9// Author: A.Dainese, andrea.dainese@lnl.infn.it
10//***********************************************************
11
460cd990 12#include <TRef.h>
3244eeed 13#include "AliAODRecoDecay.h"
14
15class AliAODRecoDecayHF : public AliAODRecoDecay {
16
17 public:
18
19 AliAODRecoDecayHF();
20 AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
21 Double_t *px,Double_t *py,Double_t *pz,
22 Double_t *d0,Double_t *d0err);
23 AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
24 Double_t *d0,Double_t *d0err);
b39168f9 25 AliAODRecoDecayHF(Double_t vtx1[3],Double_t vtx2[3],
26 Int_t nprongs,Short_t charge,
27 Double_t *px,Double_t *py,Double_t *pz,Double_t *d0);
3244eeed 28 virtual ~AliAODRecoDecayHF();
29
30 AliAODRecoDecayHF(const AliAODRecoDecayHF& source);
31 AliAODRecoDecayHF& operator=(const AliAODRecoDecayHF& source);
32
33
34 // primary vertex
460cd990 35 void SetPrimaryVtxRef(TObject *vtx) { fEventPrimaryVtx = vtx; }
36 AliAODVertex* GetPrimaryVtxRef() const { return (AliAODVertex*)(fEventPrimaryVtx.GetObject()); }
37 void SetOwnPrimaryVtx(const AliAODVertex *vtx) { UnsetOwnPrimaryVtx(); fOwnPrimaryVtx = new AliAODVertex(*vtx);}
3244eeed 38 void CheckOwnPrimaryVtx() const
39 {if(!fOwnPrimaryVtx) printf("fOwnPrimaryVtx not set"); return;}
40 AliAODVertex* GetOwnPrimaryVtx() const {return fOwnPrimaryVtx;}
41 void GetOwnPrimaryVtx(Double_t vtx[3]) const
42 {CheckOwnPrimaryVtx();fOwnPrimaryVtx->GetPosition(vtx);}
0a65d33f 43 void UnsetOwnPrimaryVtx() {if(fOwnPrimaryVtx) {delete fOwnPrimaryVtx; fOwnPrimaryVtx=0;} return;}
460cd990 44 AliAODVertex* GetPrimaryVtx() const { return (GetOwnPrimaryVtx() ? GetOwnPrimaryVtx() : GetPrimaryVtxRef()); }
3244eeed 45
46 // kinematics & topology
47 Double_t DecayLength() const
460cd990 48 { return AliAODRecoDecay::DecayLength(GetPrimaryVtx());}
3244eeed 49 Double_t DecayLengthError() const
460cd990 50 { return AliAODRecoDecay::DecayLengthError(GetPrimaryVtx());}
3244eeed 51 Double_t NormalizedDecayLength() const
460cd990 52 { return AliAODRecoDecay::NormalizedDecayLength(GetPrimaryVtx());}
3244eeed 53 Double_t DecayLengthXY() const
460cd990 54 { return AliAODRecoDecay::DecayLengthXY(GetPrimaryVtx());}
3244eeed 55 Double_t DecayLengthXYError() const
460cd990 56 { return AliAODRecoDecay::DecayLengthXYError(GetPrimaryVtx());}
3244eeed 57 Double_t NormalizedDecayLengthXY() const
460cd990 58 { return AliAODRecoDecay::NormalizedDecayLengthXY(GetPrimaryVtx());}
3244eeed 59 Double_t Ct(UInt_t pdg) const
460cd990 60 { return AliAODRecoDecay::Ct(pdg,GetPrimaryVtx());}
3244eeed 61 Double_t CosPointingAngle() const
460cd990 62 { return AliAODRecoDecay::CosPointingAngle(GetPrimaryVtx());}
3244eeed 63 Double_t CosPointingAngleXY() const
460cd990 64 { return AliAODRecoDecay::CosPointingAngleXY(GetPrimaryVtx());}
3244eeed 65 Double_t ImpParXY() const
460cd990 66 { return AliAODRecoDecay::ImpParXY(GetPrimaryVtx());}
3244eeed 67 Double_t QtProngFlightLine(Int_t ip) const
460cd990 68 { return AliAODRecoDecay::QtProngFlightLine(ip,GetPrimaryVtx());}
3244eeed 69 Double_t QlProngFlightLine(Int_t ip) const
460cd990 70 { return AliAODRecoDecay::QlProngFlightLine(ip,GetPrimaryVtx());}
3244eeed 71
72 // prongs
73 Double_t Getd0errProng(Int_t ip) const {return fd0err[ip];}
74 Double_t Normalizedd0Prong(Int_t ip) const
75 {return Getd0Prong(ip)/Getd0errProng(ip);}
76
6185d025 77 void SetProngIDs(Int_t nIDs,UShort_t *id);
78 UShort_t GetProngID(Int_t ip) const
dcb444c9 79 {if(fProngID) {return fProngID[ip];} else {return 9999;}}
6185d025 80
3244eeed 81
82 protected:
83
84 AliAODVertex *fOwnPrimaryVtx; // primary vertex for this candidate
460cd990 85 TRef fEventPrimaryVtx; // ref to primary vertex of the event
6185d025 86 Double_t *fd0err; //[fNProngs] error on prongs rphi impact param [cm]
87 UShort_t *fProngID; //[fNProngs] track ID of daughters
3244eeed 88
460cd990 89 ClassDef(AliAODRecoDecayHF,3) // base class for AOD reconstructed
3244eeed 90 // heavy-flavour decays
91};
92
6185d025 93inline void AliAODRecoDecayHF::SetProngIDs(Int_t nIDs,UShort_t *id)
94{
95 if(nIDs!=GetNProngs()) {
96 printf("Wrong number of IDs, must be nProngs\n");
97 return;
98 }
99 if(fProngID) delete [] fProngID;
100 fProngID = new UShort_t[nIDs];
101 for(Int_t i=0;i<nIDs;i++)
102 fProngID[i] = id[i];
103 return;
104}
105
3244eeed 106#endif