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