1 /**************************************************************************
2 * Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /////////////////////////////////////////////////////////////
18 // Base class for AOD reconstructed heavy-flavour decay
20 // Author: A.Dainese, andrea.dainese@lnl.infn.it
21 /////////////////////////////////////////////////////////////
23 #include <TDatabasePDG.h>
25 #include "AliAODRecoDecay.h"
26 #include "AliAODRecoDecayHF.h"
28 ClassImp(AliAODRecoDecayHF)
30 //--------------------------------------------------------------------------
31 AliAODRecoDecayHF::AliAODRecoDecayHF() :
39 // Default Constructor
42 //--------------------------------------------------------------------------
43 AliAODRecoDecayHF::AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
44 Double_t *px,Double_t *py,Double_t *pz,
45 Double_t *d0,Double_t *d0err) :
46 AliAODRecoDecay(vtx2,nprongs,charge,px,py,pz,d0),
53 // Constructor with AliAODVertex for decay vertex
55 fd0err = new Double_t[GetNProngs()];
56 for(Int_t i=0; i<GetNProngs(); i++) fd0err[i] = d0err[i];
58 //--------------------------------------------------------------------------
59 AliAODRecoDecayHF::AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
60 Double_t *d0,Double_t *d0err) :
61 AliAODRecoDecay(vtx2,nprongs,charge,d0),
68 // Constructor with AliAODVertex for decay vertex and without prongs momenta
70 fd0err = new Double_t[GetNProngs()];
71 for(Int_t i=0; i<GetNProngs(); i++) fd0err[i] = d0err[i];
73 //--------------------------------------------------------------------------
74 AliAODRecoDecayHF::AliAODRecoDecayHF(Double_t vtx1[3],Double_t vtx2[3],
75 Int_t nprongs,Short_t charge,
76 Double_t *px,Double_t *py,Double_t *pz,
78 AliAODRecoDecay(0x0,nprongs,charge,px,py,pz,d0),
85 // Constructor that can used for a "MC" object
88 fOwnPrimaryVtx = new AliAODVertex(vtx1);
90 AliAODVertex *vtx = new AliAODVertex(vtx2);
91 SetOwnSecondaryVtx(vtx);
94 //--------------------------------------------------------------------------
95 AliAODRecoDecayHF::AliAODRecoDecayHF(const AliAODRecoDecayHF &source) :
96 AliAODRecoDecay(source),
98 fEventPrimaryVtx(source.fEventPrimaryVtx),
105 if(source.GetOwnPrimaryVtx()) fOwnPrimaryVtx = new AliAODVertex(*(source.GetOwnPrimaryVtx()));
107 if(source.GetNProngs()>0) {
108 fd0err = new Double_t[GetNProngs()];
109 memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
110 if(source.fProngID) {
111 fProngID = new UShort_t[GetNProngs()];
112 memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
116 //--------------------------------------------------------------------------
117 AliAODRecoDecayHF &AliAODRecoDecayHF::operator=(const AliAODRecoDecayHF &source)
120 // assignment operator
122 if(&source == this) return *this;
124 AliAODRecoDecay::operator=(source);
126 fEventPrimaryVtx = source.fEventPrimaryVtx;
128 if(source.GetOwnPrimaryVtx()) fOwnPrimaryVtx = new AliAODVertex(*(source.GetOwnPrimaryVtx()));
130 if(source.GetNProngs()>0) {
131 fd0err = new Double_t[GetNProngs()];
132 memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
133 if(source.fProngID) {
134 fProngID = new UShort_t[GetNProngs()];
135 memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
140 //--------------------------------------------------------------------------
141 AliAODRecoDecayHF::~AliAODRecoDecayHF() {
143 // Default Destructor
145 if(fOwnPrimaryVtx) delete fOwnPrimaryVtx;
146 if(fd0err) delete [] fd0err;
147 if(fProngID) delete [] fProngID;
149 //---------------------------------------------------------------------------