]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/AliAODRecoDecayHF.cxx
corrections for z placement in survey
[u/mrichter/AliRoot.git] / PWG3 / 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 {
36   //
37   // Default Constructor
38   //
39 }
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),
45   fOwnPrimaryVtx(0x0),
46   fd0err(0x0)
47 {
48   //
49   // Constructor with AliAODVertex for decay vertex
50   //
51   fd0err = new Double_t[GetNProngs()];
52   for(Int_t i=0; i<GetNProngs(); i++) fd0err[i] = d0err[i];
53 }
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),
58   fOwnPrimaryVtx(0x0),
59   fd0err(0x0)
60 {
61   //
62   // Constructor with AliAODVertex for decay vertex and without prongs momenta
63   //
64   fd0err = new Double_t[GetNProngs()];
65   for(Int_t i=0; i<GetNProngs(); i++) fd0err[i] = d0err[i];
66 }
67 //--------------------------------------------------------------------------
68 AliAODRecoDecayHF::AliAODRecoDecayHF(const AliAODRecoDecayHF &source) :
69   AliAODRecoDecay(source),
70   fOwnPrimaryVtx(source.fOwnPrimaryVtx),
71   fd0err(0x0)
72 {
73   //
74   // Copy constructor
75   //
76   if(source.GetNProngs()>0) {
77     fd0err = new Double_t[GetNProngs()];
78     memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
79   }
80 }
81 //--------------------------------------------------------------------------
82 AliAODRecoDecayHF &AliAODRecoDecayHF::operator=(const AliAODRecoDecayHF &source)
83 {
84   //
85   // assignment operator
86   //
87   if(&source == this) return *this;
88   fOwnPrimaryVtx = source.fOwnPrimaryVtx;
89   fSecondaryVtx = source.fSecondaryVtx;
90   fNProngs = source.fNProngs;
91   fNDCA = source.fNDCA;
92   fNPID = source.fNPID;
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));
100     if(source.fPx) {
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));
107     }
108     if(source.fPID) {
109       fPID = new Double_t[5*GetNProngs()];
110       memcpy(fPID,source.fPID,GetNProngs()*sizeof(Double_t));
111     }
112     if(source.fDCA) {
113       fDCA = new Double32_t[GetNProngs()*(GetNProngs()-1)/2];
114       memcpy(fDCA,source.fDCA,(GetNProngs()*(GetNProngs()-1)/2)*sizeof(Float_t));
115     }
116   }
117   return *this;
118 }
119 //--------------------------------------------------------------------------
120 AliAODRecoDecayHF::~AliAODRecoDecayHF() {
121   //  
122   // Default Destructor
123   //
124   if(fOwnPrimaryVtx) delete fOwnPrimaryVtx;
125   if(fd0err) delete [] fd0err;
126 }
127 //---------------------------------------------------------------------------