]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/vertexingHF/AliAODRecoDecayHF.cxx
avoiding gcc 4.3 warnings by defining void function pointers instead of void pointers...
[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//--------------------------------------------------------------------------
71AliAODRecoDecayHF::AliAODRecoDecayHF(const AliAODRecoDecayHF &source) :
72 AliAODRecoDecay(source),
73 fOwnPrimaryVtx(source.fOwnPrimaryVtx),
6185d025 74 fd0err(0x0),
75 fProngID(0x0)
3244eeed 76{
77 //
78 // Copy constructor
79 //
80 if(source.GetNProngs()>0) {
81 fd0err = new Double_t[GetNProngs()];
82 memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
6185d025 83 if(source.fProngID) {
84 fProngID = new UShort_t[GetNProngs()];
85 memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
86 }
3244eeed 87 }
88}
89//--------------------------------------------------------------------------
90AliAODRecoDecayHF &AliAODRecoDecayHF::operator=(const AliAODRecoDecayHF &source)
91{
92 //
93 // assignment operator
94 //
95 if(&source == this) return *this;
96 fOwnPrimaryVtx = source.fOwnPrimaryVtx;
97 fSecondaryVtx = source.fSecondaryVtx;
98 fNProngs = source.fNProngs;
99 fNDCA = source.fNDCA;
100 fNPID = source.fNPID;
101 fEventNumber = source.fEventNumber;
102 fRunNumber = source.fRunNumber;
103 if(source.GetNProngs()>0) {
104 fd0 = new Double_t[GetNProngs()];
105 fd0err = new Double_t[GetNProngs()];
106 memcpy(fd0,source.fd0,GetNProngs()*sizeof(Double_t));
107 memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
108 if(source.fPx) {
109 fPx = new Double_t[GetNProngs()];
110 fPy = new Double_t[GetNProngs()];
111 fPz = new Double_t[GetNProngs()];
112 memcpy(fPx,source.fPx,GetNProngs()*sizeof(Double_t));
113 memcpy(fPy,source.fPy,GetNProngs()*sizeof(Double_t));
114 memcpy(fPz,source.fPz,GetNProngs()*sizeof(Double_t));
115 }
116 if(source.fPID) {
117 fPID = new Double_t[5*GetNProngs()];
118 memcpy(fPID,source.fPID,GetNProngs()*sizeof(Double_t));
119 }
120 if(source.fDCA) {
057c80d4 121 fDCA = new Double32_t[GetNProngs()*(GetNProngs()-1)/2];
3244eeed 122 memcpy(fDCA,source.fDCA,(GetNProngs()*(GetNProngs()-1)/2)*sizeof(Float_t));
123 }
6185d025 124 if(source.fProngID) {
125 fProngID = new UShort_t[GetNProngs()];
126 memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
127 }
3244eeed 128 }
129 return *this;
130}
131//--------------------------------------------------------------------------
132AliAODRecoDecayHF::~AliAODRecoDecayHF() {
133 //
134 // Default Destructor
135 //
136 if(fOwnPrimaryVtx) delete fOwnPrimaryVtx;
137 if(fd0err) delete [] fd0err;
6185d025 138 if(fProngID) delete [] fProngID;
3244eeed 139}
140//---------------------------------------------------------------------------