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() :
37 // Default Constructor
40 //--------------------------------------------------------------------------
41 AliAODRecoDecayHF::AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
42 Double_t *px,Double_t *py,Double_t *pz,
43 Double_t *d0,Double_t *d0err) :
44 AliAODRecoDecay(vtx2,nprongs,charge,px,py,pz,d0),
49 // Constructor with AliAODVertex for decay vertex
51 fd0err = new Double_t[GetNProngs()];
52 for(Int_t i=0; i<GetNProngs(); i++) fd0err[i] = d0err[i];
54 //--------------------------------------------------------------------------
55 AliAODRecoDecayHF::AliAODRecoDecayHF(AliAODVertex *vtx2,Int_t nprongs,Short_t charge,
56 Double_t *d0,Double_t *d0err) :
57 AliAODRecoDecay(vtx2,nprongs,charge,d0),
62 // Constructor with AliAODVertex for decay vertex and without prongs momenta
64 fd0err = new Double_t[GetNProngs()];
65 for(Int_t i=0; i<GetNProngs(); i++) fd0err[i] = d0err[i];
67 //--------------------------------------------------------------------------
68 AliAODRecoDecayHF::AliAODRecoDecayHF(const AliAODRecoDecayHF &source) :
69 AliAODRecoDecay(source),
70 fOwnPrimaryVtx(source.fOwnPrimaryVtx),
76 if(source.GetNProngs()>0) {
77 fd0err = new Double_t[GetNProngs()];
78 memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
81 //--------------------------------------------------------------------------
82 AliAODRecoDecayHF &AliAODRecoDecayHF::operator=(const AliAODRecoDecayHF &source)
85 // assignment operator
87 if(&source == this) return *this;
88 fOwnPrimaryVtx = source.fOwnPrimaryVtx;
89 fSecondaryVtx = source.fSecondaryVtx;
90 fNProngs = source.fNProngs;
93 fEventNumber = source.fEventNumber;
94 fRunNumber = source.fRunNumber;
95 if(source.GetNProngs()>0) {
96 fd0 = new Double_t[GetNProngs()];
97 fd0err = new Double_t[GetNProngs()];
98 memcpy(fd0,source.fd0,GetNProngs()*sizeof(Double_t));
99 memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
101 fPx = new Double_t[GetNProngs()];
102 fPy = new Double_t[GetNProngs()];
103 fPz = new Double_t[GetNProngs()];
104 memcpy(fPx,source.fPx,GetNProngs()*sizeof(Double_t));
105 memcpy(fPy,source.fPy,GetNProngs()*sizeof(Double_t));
106 memcpy(fPz,source.fPz,GetNProngs()*sizeof(Double_t));
109 fPID = new Double_t[5*GetNProngs()];
110 memcpy(fPID,source.fPID,GetNProngs()*sizeof(Double_t));
113 fDCA = new Float_t[GetNProngs()*(GetNProngs()-1)/2];
114 memcpy(fDCA,source.fDCA,(GetNProngs()*(GetNProngs()-1)/2)*sizeof(Float_t));
119 //--------------------------------------------------------------------------
120 AliAODRecoDecayHF::~AliAODRecoDecayHF() {
122 // Default Destructor
124 if(fOwnPrimaryVtx) delete fOwnPrimaryVtx;
125 if(fd0err) delete [] fd0err;
127 //---------------------------------------------------------------------------