]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/hfe/AliHFEreducedMCParticle.cxx
Merge branch master into TRDdev
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFEreducedMCParticle.cxx
1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 // Debug MC particle
17 // the tree is represented as reduced events
18 // 
19 // Authors:
20 //   M.Fasel <M.Fasel@gsi.de>
21 //
22 #include "TObjArray.h"
23 #include <cstring>
24
25 #include "AliHFEreducedMCParticle.h"
26
27 ClassImp(AliHFEreducedMCParticle)
28
29 //_______________________________________
30 AliHFEreducedMCParticle::AliHFEreducedMCParticle():
31 TObject(),
32   fSignedPt(0.),
33   fP(0.),
34   fEta(0.),
35   fPhi(0.),
36   fPdg(0),
37   fMotherPdg(0),
38   fSource(5),
39   fSignal(kFALSE),
40   fEleSource(0)
41 {
42   //
43   // Default constructor
44   //
45   memset(fProductionVertex, 0, sizeof(Double_t) *3);      // Initialise production vertex array
46   memset(fMotherProductionVertex, 0, sizeof(Double_t) *3);      // Initialise mother production vertex array
47 }
48
49 //_______________________________________
50 AliHFEreducedMCParticle::AliHFEreducedMCParticle(const AliHFEreducedMCParticle &ref):
51   TObject(ref),
52   fSignedPt(ref.fSignedPt),
53   fP(ref.fP),
54   fEta(ref.fEta),
55   fPhi(ref.fPhi),
56   fPdg(ref.fPdg),
57   fMotherPdg(ref.fMotherPdg),
58   fSource(ref.fSource),
59   fSignal(ref.fSignal),
60   fEleSource(ref.fEleSource)
61 {
62   //
63   // Copy constructor
64   //
65   memcpy(fProductionVertex, ref.fProductionVertex, sizeof(Double_t) *3);      // Port production vertex array
66   memcpy(fMotherProductionVertex, ref.fMotherProductionVertex, sizeof(Double_t) *3);      // Port mother production vertex array
67 }
68
69 //_______________________________________
70 AliHFEreducedMCParticle &AliHFEreducedMCParticle::operator=(const AliHFEreducedMCParticle &ref){
71   // 
72   // Assignment operator
73   //
74   if(&ref != this){
75     TObject::operator=(ref);
76     fSignedPt = ref.fSignedPt;
77     fP= ref.fP;
78     fEta = ref.fEta;
79     fPhi = ref.fPhi;
80     fPdg = ref.fPdg;
81     fMotherPdg = ref.fMotherPdg;
82     fSource = ref.fSource;
83     fSignal = ref.fSignal;
84     fEleSource = ref.fEleSource;
85     memcpy(fProductionVertex, ref.fProductionVertex, sizeof(Double_t) *3); 
86     memcpy(fMotherProductionVertex, ref.fMotherProductionVertex, sizeof(Double_t) *3); 
87   }
88   return *this;
89 }
90