]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEpidBase.cxx
Major update of the HFE package (comments inside the code
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEpidBase.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 // Abstract PID base class for Detector PID classes 
17 // Supplies detector PID classes with basic informations (i.e. Debug 
18 // Level)
19 //  
20 // Authors: 
21 //   Markus Fasel <M.Fasel@gsi.de> 
22 // 
23
24 #include "AliAODpidUtil.h"
25 #include "AliESDpid.h"
26 #include "AliHFEpidBase.h"
27 #include "AliHFEtools.h"
28
29 ClassImp(AliHFEpidBase)
30
31 //___________________________________________________________________
32 AliHFEpidBase::AliHFEpidBase():
33   TNamed(),
34   fESDpid(NULL),
35   fAODpid(NULL)
36 {
37   //
38   // Default constructor
39   //
40 }
41
42 //___________________________________________________________________
43 AliHFEpidBase::AliHFEpidBase(const Char_t *name):
44   TNamed(name, ""),
45   fESDpid(NULL),
46   fAODpid(NULL)
47 {
48   //
49   // Default constructor
50   //
51 }
52
53 //___________________________________________________________________
54 AliHFEpidBase::AliHFEpidBase(const AliHFEpidBase &c):
55   TNamed(),
56   fESDpid(NULL),
57   fAODpid(NULL)
58 {
59   //
60   //Copy constructor
61   //
62   c.Copy(*this);
63 }
64
65 //___________________________________________________________________
66 AliHFEpidBase &AliHFEpidBase::operator=(const AliHFEpidBase &ref){
67   //
68   // Assignment operator
69   //
70   if(this != &ref){
71     ref.Copy(*this);
72   }
73
74   return *this;
75 }
76
77 //___________________________________________________________________
78 void AliHFEpidBase::Copy(TObject &ref) const {
79   //
80   // Copy function for assignment operator
81   //
82   AliHFEpidBase &target = dynamic_cast<AliHFEpidBase &>(ref);
83
84   target.fESDpid = fESDpid;
85   target.fAODpid = fAODpid;
86
87   TNamed::Copy(ref);
88 }
89
90 //___________________________________________________________________
91 AliHFEpidObject &AliHFEpidObject::operator=(const AliHFEpidObject &ref){
92   //
93   // Assignment operator
94   //
95   if(&ref != this){
96     fkRecTrack = ref.fkRecTrack;
97     fAnalysisType = ref.fAnalysisType;
98     fAbInitioPID = ref.fAbInitioPID;
99     fCentrality = ref.fCentrality;
100   }
101   return *this;
102 }
103
104 //___________________________________________________________________
105 void AliHFEpidObject::SetMCTrack(const AliVParticle *mctrack){
106   //
107   // Set the aprioriPID information coming from the MC truth
108   //
109   if(mctrack) fAbInitioPID = AliHFEtools::PDG2AliPID(AliHFEtools::GetPdg(mctrack));
110 }
111