]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/vertexingHF/AliAODRecoDecayHF.cxx
In Mapping/macros:
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAODRecoDecayHF.cxx
CommitLineData
3244eeed 1/**************************************************************************
2 * Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/////////////////////////////////////////////////////////////
17//
18// Base class for AOD reconstructed heavy-flavour decay
19//
20// Author: A.Dainese, andrea.dainese@lnl.infn.it
21/////////////////////////////////////////////////////////////
22
23#include <TDatabasePDG.h>
24#include <TVector3.h>
25#include "AliAODRecoDecay.h"
26#include "AliAODRecoDecayHF.h"
27
28ClassImp(AliAODRecoDecayHF)
29
30//--------------------------------------------------------------------------
31AliAODRecoDecayHF::AliAODRecoDecayHF() :
32 AliAODRecoDecay(),
33 fOwnPrimaryVtx(0x0),
6185d025 34 fd0err(0x0),
35 fProngID(0x0)
3244eeed 36{
37 //
38 // Default Constructor
39 //
40}
41//--------------------------------------------------------------------------
42AliAODRecoDecayHF::AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
43 Double_t *px,Double_t *py,Double_t *pz,
44 Double_t *d0,Double_t *d0err) :
45 AliAODRecoDecay(vtx2,nprongs,charge,px,py,pz,d0),
46 fOwnPrimaryVtx(0x0),
6185d025 47 fd0err(0x0),
48 fProngID(0x0)
3244eeed 49{
50 //
51 // Constructor with AliAODVertex for decay vertex
52 //
53 fd0err = new Double_t[GetNProngs()];
54 for(Int_t i=0; i<GetNProngs(); i++) fd0err[i] = d0err[i];
55}
56//--------------------------------------------------------------------------
57AliAODRecoDecayHF::AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
58 Double_t *d0,Double_t *d0err) :
59 AliAODRecoDecay(vtx2,nprongs,charge,d0),
60 fOwnPrimaryVtx(0x0),
6185d025 61 fd0err(0x0),
62 fProngID(0x0)
3244eeed 63{
64 //
65 // Constructor with AliAODVertex for decay vertex and without prongs momenta
66 //
67 fd0err = new Double_t[GetNProngs()];
68 for(Int_t i=0; i<GetNProngs(); i++) fd0err[i] = d0err[i];
69}
70//--------------------------------------------------------------------------
b39168f9 71AliAODRecoDecayHF::AliAODRecoDecayHF(Double_t vtx1[3],Double_t vtx2[3],
72 Int_t nprongs,Short_t charge,
73 Double_t *px,Double_t *py,Double_t *pz,
74 Double_t *d0) :
75 AliAODRecoDecay(0x0,nprongs,charge,px,py,pz,d0),
76 fOwnPrimaryVtx(0x0),
77 fd0err(0x0),
78 fProngID(0x0)
79{
80 //
81 // Constructor that can used for a "MC" object
82 //
83
84 fOwnPrimaryVtx = new AliAODVertex(vtx1);
85
86 AliAODVertex *vtx = new AliAODVertex(vtx2);
87 SetOwnSecondaryVtx(vtx);
88
89}
90//--------------------------------------------------------------------------
3244eeed 91AliAODRecoDecayHF::AliAODRecoDecayHF(const AliAODRecoDecayHF &source) :
92 AliAODRecoDecay(source),
93 fOwnPrimaryVtx(source.fOwnPrimaryVtx),
6185d025 94 fd0err(0x0),
95 fProngID(0x0)
3244eeed 96{
97 //
98 // Copy constructor
99 //
100 if(source.GetNProngs()>0) {
101 fd0err = new Double_t[GetNProngs()];
102 memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
6185d025 103 if(source.fProngID) {
104 fProngID = new UShort_t[GetNProngs()];
105 memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
106 }
3244eeed 107 }
108}
109//--------------------------------------------------------------------------
110AliAODRecoDecayHF &AliAODRecoDecayHF::operator=(const AliAODRecoDecayHF &source)
111{
112 //
113 // assignment operator
114 //
115 if(&source == this) return *this;
dcb444c9 116
117 AliAODRecoDecay::operator=(source);
118
3244eeed 119 fOwnPrimaryVtx = source.fOwnPrimaryVtx;
3244eeed 120 if(source.GetNProngs()>0) {
3244eeed 121 fd0err = new Double_t[GetNProngs()];
3244eeed 122 memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
6185d025 123 if(source.fProngID) {
124 fProngID = new UShort_t[GetNProngs()];
125 memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
126 }
3244eeed 127 }
128 return *this;
129}
130//--------------------------------------------------------------------------
131AliAODRecoDecayHF::~AliAODRecoDecayHF() {
132 //
133 // Default Destructor
134 //
135 if(fOwnPrimaryVtx) delete fOwnPrimaryVtx;
136 if(fd0err) delete [] fd0err;
6185d025 137 if(fProngID) delete [] fProngID;
3244eeed 138}
139//---------------------------------------------------------------------------