]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSDetType.cxx
Patch problem with destructor
[u/mrichter/AliRoot.git] / ITS / AliITSDetType.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 /*
17  $Log$
18  Revision 1.4  2001/05/01 14:47:45  nilsen
19  Fixed destructor so that it destroyes the pointers fSegmentation, fResponse,
20  fSimulation, and fReconst if they have been allocated. The two TStrings
21  fDigClassName and fClustClassName shoud be destroyed automaticaly. This should
22  fix a small memory leak associated with digitization and reconstruction.
23
24 */
25
26 #include "AliITSDetType.h"
27 #include "AliITSClusterFinder.h"
28 #include "AliITSsimulation.h"
29
30 ClassImp(AliITSDetType)  
31
32 AliITSDetType::AliITSDetType(){
33     // constructor
34
35     fSegmentation = 0;
36     fResponse     = 0;
37     fSimulation   = 0;
38     fReconst      = 0;
39 }
40 //----------------------------------------------------------------------
41 AliITSDetType::~AliITSDetType(){
42     // destructor
43
44     if(fSegmentation!=0) delete fSegmentation; fSegmentation = 0;
45     //    if(fResponse!=0)     delete fResponse;     fResponse     = 0;
46     if(fSimulation!=0)   delete fSimulation;   fSimulation   = 0;
47     if(fReconst!=0)      delete fReconst;      fReconst      = 0;
48 }
49 //______________________________________________________________________
50 AliITSDetType::AliITSDetType(const AliITSDetType &source){
51   //     Copy Constructor 
52
53   if(&source == this) return;
54   this->fReconst        = source.fReconst;
55   this->fSimulation     = source.fSimulation;
56   this->fResponse       = source.fResponse;
57   this->fSegmentation   = source.fSegmentation;
58   this->fDigClassName   = source.fDigClassName;
59   this->fClustClassName = source.fClustClassName;
60   return;
61 }
62 //______________________________________________________________________
63 AliITSDetType& AliITSDetType::operator=(const AliITSDetType &source){
64   //    Assignment operator
65
66   if(&source == this) return *this;
67   this->fReconst        = source.fReconst;
68   this->fSimulation     = source.fSimulation;
69   this->fResponse       = source.fResponse;
70   this->fSegmentation   = source.fSegmentation;
71   this->fDigClassName   = source.fDigClassName;
72   this->fClustClassName = source.fClustClassName;
73   return *this;  
74 }