Added class AliFlowEvent, inherits from AliFlowEventSimple.
[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
ec653946 15class AliKFParticle;
16
3244eeed 17class AliAODRecoDecayHF : public AliAODRecoDecay {
18
19 public:
20
21 AliAODRecoDecayHF();
22 AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
23 Double_t *px,Double_t *py,Double_t *pz,
24 Double_t *d0,Double_t *d0err);
25 AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
26 Double_t *d0,Double_t *d0err);
b39168f9 27 AliAODRecoDecayHF(Double_t vtx1[3],Double_t vtx2[3],
28 Int_t nprongs,Short_t charge,
29 Double_t *px,Double_t *py,Double_t *pz,Double_t *d0);
3244eeed 30 virtual ~AliAODRecoDecayHF();
31
32 AliAODRecoDecayHF(const AliAODRecoDecayHF& source);
33 AliAODRecoDecayHF& operator=(const AliAODRecoDecayHF& source);
34
35
36 // primary vertex
460cd990 37 void SetPrimaryVtxRef(TObject *vtx) { fEventPrimaryVtx = vtx; }
38 AliAODVertex* GetPrimaryVtxRef() const { return (AliAODVertex*)(fEventPrimaryVtx.GetObject()); }
39 void SetOwnPrimaryVtx(const AliAODVertex *vtx) { UnsetOwnPrimaryVtx(); fOwnPrimaryVtx = new AliAODVertex(*vtx);}
3244eeed 40 void CheckOwnPrimaryVtx() const
41 {if(!fOwnPrimaryVtx) printf("fOwnPrimaryVtx not set"); return;}
42 AliAODVertex* GetOwnPrimaryVtx() const {return fOwnPrimaryVtx;}
43 void GetOwnPrimaryVtx(Double_t vtx[3]) const
44 {CheckOwnPrimaryVtx();fOwnPrimaryVtx->GetPosition(vtx);}
0a65d33f 45 void UnsetOwnPrimaryVtx() {if(fOwnPrimaryVtx) {delete fOwnPrimaryVtx; fOwnPrimaryVtx=0;} return;}
460cd990 46 AliAODVertex* GetPrimaryVtx() const { return (GetOwnPrimaryVtx() ? GetOwnPrimaryVtx() : GetPrimaryVtxRef()); }
3244eeed 47
48 // kinematics & topology
49 Double_t DecayLength() const
460cd990 50 { return AliAODRecoDecay::DecayLength(GetPrimaryVtx());}
3244eeed 51 Double_t DecayLengthError() const
460cd990 52 { return AliAODRecoDecay::DecayLengthError(GetPrimaryVtx());}
3244eeed 53 Double_t NormalizedDecayLength() const
460cd990 54 { return AliAODRecoDecay::NormalizedDecayLength(GetPrimaryVtx());}
3244eeed 55 Double_t DecayLengthXY() const
460cd990 56 { return AliAODRecoDecay::DecayLengthXY(GetPrimaryVtx());}
3244eeed 57 Double_t DecayLengthXYError() const
460cd990 58 { return AliAODRecoDecay::DecayLengthXYError(GetPrimaryVtx());}
3244eeed 59 Double_t NormalizedDecayLengthXY() const
460cd990 60 { return AliAODRecoDecay::NormalizedDecayLengthXY(GetPrimaryVtx());}
3244eeed 61 Double_t Ct(UInt_t pdg) const
460cd990 62 { return AliAODRecoDecay::Ct(pdg,GetPrimaryVtx());}
3244eeed 63 Double_t CosPointingAngle() const
460cd990 64 { return AliAODRecoDecay::CosPointingAngle(GetPrimaryVtx());}
3244eeed 65 Double_t CosPointingAngleXY() const
460cd990 66 { return AliAODRecoDecay::CosPointingAngleXY(GetPrimaryVtx());}
3244eeed 67 Double_t ImpParXY() const
460cd990 68 { return AliAODRecoDecay::ImpParXY(GetPrimaryVtx());}
3244eeed 69 Double_t QtProngFlightLine(Int_t ip) const
460cd990 70 { return AliAODRecoDecay::QtProngFlightLine(ip,GetPrimaryVtx());}
3244eeed 71 Double_t QlProngFlightLine(Int_t ip) const
460cd990 72 { return AliAODRecoDecay::QlProngFlightLine(ip,GetPrimaryVtx());}
3244eeed 73
74 // prongs
75 Double_t Getd0errProng(Int_t ip) const {return fd0err[ip];}
76 Double_t Normalizedd0Prong(Int_t ip) const
77 {return Getd0Prong(ip)/Getd0errProng(ip);}
78
6185d025 79 void SetProngIDs(Int_t nIDs,UShort_t *id);
80 UShort_t GetProngID(Int_t ip) const
dcb444c9 81 {if(fProngID) {return fProngID[ip];} else {return 9999;}}
6185d025 82
27917274 83 // check if it is like-sign
84 Bool_t IsLikeSign() const;
3244eeed 85
ec653946 86
87 // vertexing KF:
88 AliKFParticle *ApplyVertexingKF(Int_t *iprongs,Int_t nprongs,Int_t *pdgs,
89 Bool_t topoCostraint,Double_t bzkG,
90 Double_t *mass) const;
91
3244eeed 92 protected:
93
94 AliAODVertex *fOwnPrimaryVtx; // primary vertex for this candidate
460cd990 95 TRef fEventPrimaryVtx; // ref to primary vertex of the event
6185d025 96 Double_t *fd0err; //[fNProngs] error on prongs rphi impact param [cm]
97 UShort_t *fProngID; //[fNProngs] track ID of daughters
3244eeed 98
460cd990 99 ClassDef(AliAODRecoDecayHF,3) // base class for AOD reconstructed
3244eeed 100 // heavy-flavour decays
101};
102
6185d025 103inline void AliAODRecoDecayHF::SetProngIDs(Int_t nIDs,UShort_t *id)
104{
105 if(nIDs!=GetNProngs()) {
106 printf("Wrong number of IDs, must be nProngs\n");
107 return;
108 }
109 if(fProngID) delete [] fProngID;
110 fProngID = new UShort_t[nIDs];
111 for(Int_t i=0;i<nIDs;i++)
112 fProngID[i] = id[i];
113 return;
114}
115
27917274 116inline Bool_t AliAODRecoDecayHF::IsLikeSign() const
117{
118 // check if it is like-sign
119
120 Int_t ndg=GetNDaughters();
121 if(!ndg) {
122 printf("Daughters not available\n");
123 return kFALSE;
124 }
125 Int_t chargeDg0 = ((AliAODTrack*)GetDaughter(0))->Charge();
126
127 for(Int_t i=1; i<ndg; i++) {
128 if(chargeDg0!=((AliAODTrack*)GetDaughter(i))->Charge()) return kFALSE;
129 }
130
131 return kTRUE;
132}
133
3244eeed 134#endif
27917274 135