]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/vertexingHF/AliAODRecoDecayHF.cxx
Bug fix
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAODRecoDecayHF.cxx
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
28 ClassImp(AliAODRecoDecayHF)
29
30 //--------------------------------------------------------------------------
31 AliAODRecoDecayHF::AliAODRecoDecayHF() :
32   AliAODRecoDecay(),
33   fOwnPrimaryVtx(0x0),
34   fd0err(0x0), 
35   fProngID(0x0) 
36 {
37   //
38   // Default Constructor
39   //
40 }
41 //--------------------------------------------------------------------------
42 AliAODRecoDecayHF::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),
47   fd0err(0x0),
48   fProngID(0x0) 
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 //--------------------------------------------------------------------------
57 AliAODRecoDecayHF::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),
61   fd0err(0x0),
62   fProngID(0x0) 
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 //--------------------------------------------------------------------------
71 AliAODRecoDecayHF::AliAODRecoDecayHF(const AliAODRecoDecayHF &source) :
72   AliAODRecoDecay(source),
73   fOwnPrimaryVtx(source.fOwnPrimaryVtx),
74   fd0err(0x0),
75   fProngID(0x0)
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));
83     if(source.fProngID) {
84       fProngID = new UShort_t[GetNProngs()];
85       memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
86     }
87   }
88 }
89 //--------------------------------------------------------------------------
90 AliAODRecoDecayHF &AliAODRecoDecayHF::operator=(const AliAODRecoDecayHF &source)
91 {
92   //
93   // assignment operator
94   //
95   if(&source == this) return *this;
96
97   AliAODRecoDecay::operator=(source);
98
99   fOwnPrimaryVtx = source.fOwnPrimaryVtx;
100   if(source.GetNProngs()>0) {
101     fd0err = new Double_t[GetNProngs()];
102     memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
103     if(source.fProngID) {
104       fProngID = new UShort_t[GetNProngs()];
105       memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
106     }
107   }
108   return *this;
109 }
110 //--------------------------------------------------------------------------
111 AliAODRecoDecayHF::~AliAODRecoDecayHF() {
112   //  
113   // Default Destructor
114   //
115   if(fOwnPrimaryVtx) delete fOwnPrimaryVtx;
116   if(fd0err) delete [] fd0err;
117   if(fProngID) delete [] fProngID;
118 }
119 //---------------------------------------------------------------------------