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