]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/vertexingHF/AliAODRecoDecayHF.cxx
Wrong header file names.
[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(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 //--------------------------------------------------------------------------
91 AliAODRecoDecayHF::AliAODRecoDecayHF(const AliAODRecoDecayHF &source) :
92   AliAODRecoDecay(source),
93   fOwnPrimaryVtx(0x0),
94   fd0err(0x0),
95   fProngID(0x0)
96 {
97   //
98   // Copy constructor
99   //
100   if(source.GetOwnPrimaryVtx()) fOwnPrimaryVtx = new AliAODVertex(*(source.GetOwnPrimaryVtx()));
101
102   if(source.GetNProngs()>0) {
103     fd0err = new Double_t[GetNProngs()];
104     memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
105     if(source.fProngID) {
106       fProngID = new UShort_t[GetNProngs()];
107       memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
108     }
109   }
110 }
111 //--------------------------------------------------------------------------
112 AliAODRecoDecayHF &AliAODRecoDecayHF::operator=(const AliAODRecoDecayHF &source)
113 {
114   //
115   // assignment operator
116   //
117   if(&source == this) return *this;
118
119   AliAODRecoDecay::operator=(source);
120
121   if(source.GetOwnPrimaryVtx()) fOwnPrimaryVtx = new AliAODVertex(*(source.GetOwnPrimaryVtx()));
122
123   if(source.GetNProngs()>0) {
124     fd0err = new Double_t[GetNProngs()];
125     memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
126     if(source.fProngID) {
127       fProngID = new UShort_t[GetNProngs()];
128       memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
129     }
130   }
131   return *this;
132 }
133 //--------------------------------------------------------------------------
134 AliAODRecoDecayHF::~AliAODRecoDecayHF() {
135   //  
136   // Default Destructor
137   //
138   if(fOwnPrimaryVtx) delete fOwnPrimaryVtx;
139   if(fd0err) delete [] fd0err;
140   if(fProngID) delete [] fProngID;
141 }
142 //---------------------------------------------------------------------------