]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSpList.cxx
messages moved to debug stream
[u/mrichter/AliRoot.git] / ITS / AliITSpList.cxx
index 61b9ba599c0138bbe79e29d932955e8fa9d4aaa6..837552a5a1d55c5ea39b5c5165a60dfd772025d0 100644 (file)
 
 ClassImp(AliITSpList)
 //______________________________________________________________________
-AliITSpList::AliITSpList(){
+AliITSpList::AliITSpList():
+fNi(0),
+fNj(0),
+fa(0),
+fEntries(0){
     // Default constructor
     // Inputs:
     //    none.
@@ -41,12 +45,13 @@ AliITSpList::AliITSpList(){
     // Return:
     //    A zeroed/empty AliITSpList class.
 
-    fNi = 0;
-    fNj = 0;
-    fa  = 0;
 }
 //______________________________________________________________________
-AliITSpList::AliITSpList(Int_t imax,Int_t jmax){
+AliITSpList::AliITSpList(Int_t imax,Int_t jmax):
+fNi(imax),
+fNj(jmax),
+fa(0),
+fEntries(0){
     // Standard constructor
     // Inputs:
     //    none.
@@ -55,9 +60,6 @@ AliITSpList::AliITSpList(Int_t imax,Int_t jmax){
     // Return:
     //    A setup AliITSpList class.
 
-    fNi = imax;
-    fNj = jmax;
-    fEntries = 0;
     fa = new TClonesArray("AliITSpListItem",fNi*fNj);
 }
 //______________________________________________________________________
@@ -121,28 +123,16 @@ AliITSpList& AliITSpList::operator=(const AliITSpList &source){
     // Return:
     //    A copied AliITSpList object.
 
-    if(this == &source) return *this;
-
-    if(this->fa!=0){ // if this->fa exists delete it first.
-      fa->Delete();
-      delete fa;
-      fa = 0;
-    } // end if this->fa!=0
-    this->fNi = source.fNi;
-    this->fNj = source.fNj;
-    this->fa = new TClonesArray(*(source.fa));
-    this->fEntries = source.fEntries;
-
-    return *this;
+  this->~AliITSpList();
+  new(this) AliITSpList(source);
+  return *this;
 }
 //______________________________________________________________________
-AliITSpList::AliITSpList(const AliITSpList &source) : AliITSMap(source){
+AliITSpList::AliITSpList(const AliITSpList &source) : AliITSMap(source),
+fNi(source.fNi),fNj(source.fNj),fa(0),fEntries(source.fEntries){
     // Copy constructor
 
-  fNi = source.fNi;
-  fNj = source.fNj;
   fa = new TClonesArray(*(source.fa));
-  fEntries = source.fEntries;
 }
 //______________________________________________________________________
 void AliITSpList::AddItemTo(Int_t fileIndex, AliITSpListItem *pl) {
@@ -183,6 +173,7 @@ void AliITSpList::AddSignal(Int_t i,Int_t j,Int_t trk,Int_t ht,Int_t mod,
     // Return:
     //    none.
     Int_t index = GetIndex(i,j);
+    if (index<0) return;
     TClonesArray &rfa = *fa;
     if(GetpListItem(index)==0){ // must create AliITSpListItem
       new(rfa[index])AliITSpListItem(trk,ht,mod,index,signal);