]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDsegmentArray.cxx
Added the position in global coordinate system of the particle in PHOS
[u/mrichter/AliRoot.git] / TRD / AliTRDsegmentArray.cxx
index 4c6973b910a4758317d6abe5429259ff24273f34..385ca7d7c0ac5df050ed2a90ea28bc48cfa35e26 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.4  2000/06/27 13:08:50  cblume
-Changed to Copy(TObject &A) to appease the HP-compiler
-
-Revision 1.3  2000/06/08 18:32:58  cblume
-Make code compliant to coding conventions
-
-Revision 1.2  2000/05/08 16:17:27  cblume
-Merge TRD-develop
-
-Revision 1.1.4.1  2000/05/08 14:55:03  cblume
-Bug fixes
-
-Revision 1.1  2000/02/28 19:02:32  cblume
-Add new TRD classes
-
-*/
+/* $Id$ */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
@@ -40,9 +23,12 @@ Add new TRD classes
 
 #include <TTree.h>
 
+#include "AliRun.h"
+
 #include "AliTRD.h"
 #include "AliTRDgeometry.h"
 #include "AliTRDsegmentArray.h"
+#include "AliTRDdataArray.h"
 
 ClassImp(AliTRDsegmentArray)
 
@@ -56,7 +42,7 @@ AliTRDsegmentArray::AliTRDsegmentArray():AliTRDsegmentArrayBase()
 }
 
 //_____________________________________________________________________________
-AliTRDsegmentArray::AliTRDsegmentArray(Text_t *classname, Int_t n)
+AliTRDsegmentArray::AliTRDsegmentArray(const char *classname, Int_t n)
                    :AliTRDsegmentArrayBase(classname,n)
 {
   //
@@ -73,6 +59,7 @@ AliTRDsegmentArray::AliTRDsegmentArray(Text_t *classname, Int_t n)
 
 //_____________________________________________________________________________
 AliTRDsegmentArray::AliTRDsegmentArray(AliTRDsegmentArray &a)
+:AliTRDsegmentArrayBase(a)
 {
   //
   // AliTRDsegmentArray copy constructor
@@ -88,6 +75,9 @@ AliTRDsegmentArray::~AliTRDsegmentArray()
   //
   // AliTRDsegmentArray destructor
   //
+
+  Delete();
+
 }
 
 //_____________________________________________________________________________
@@ -115,16 +105,22 @@ void AliTRDsegmentArray::Delete()
 }
 
 //_____________________________________________________________________________
-Bool_t AliTRDsegmentArray::LoadArray(const Char_t *branchname)
+Bool_t AliTRDsegmentArray::LoadArray(const Char_t *branchname, TTree *tree)
 {
   //
   // Loads all segments of the array from the branch <branchname> of
-  // the digits tree
+  // the digits tree <tree>
   //
 
-  // Connect the digits tree
-  fTree = gAlice->TreeD();
-  if (!fTree) return kFALSE;
+  fTree = tree;
+
+  // Connect the digits tree as default
+  if (!fTree) {
+    printf("AliTRDsegmentArray::LoadArray -- ");
+    printf("Use default TreeD\n");
+    fTree = gAlice->TreeD();
+    if (!fTree) return kFALSE;
+  }
 
   // Get the branch
   fBranch = fTree->GetBranch(branchname);
@@ -147,16 +143,22 @@ Bool_t AliTRDsegmentArray::LoadArray(const Char_t *branchname)
 }
 
 //_____________________________________________________________________________
-Bool_t AliTRDsegmentArray::StoreArray(const Char_t *branchname)
+Bool_t AliTRDsegmentArray::StoreArray(const Char_t *branchname, TTree *tree)
 {
   //
   // Stores all segments of the array in the branch <branchname> of 
-  // the digits tree
+  // the digits tree <tree>
   //
 
-  // Connect the digits tree
-  fTree = gAlice->TreeD();
-  if (!fTree) return kFALSE;
+  fTree = tree;
+
+  // Connect the digits tree as default
+  if (!fTree) {
+    printf("AliTRDsegmentArray::StoreArray -- ");
+    printf("Use default TreeD\n");
+    fTree = gAlice->TreeD();
+    if (!fTree) return kFALSE;
+  }
 
   // Get the branch
   fBranch = fTree->GetBranch(branchname);
@@ -180,7 +182,7 @@ Bool_t AliTRDsegmentArray::StoreArray(const Char_t *branchname)
 }
 
 //_____________________________________________________________________________
-AliTRDdataArray *AliTRDsegmentArray::GetDataArray(Int_t det)
+AliTRDdataArray *AliTRDsegmentArray::GetDataArray(Int_t det) const
 {
   //
   // Returns the data array for a given detector
@@ -191,7 +193,8 @@ AliTRDdataArray *AliTRDsegmentArray::GetDataArray(Int_t det)
 }
 
 //_____________________________________________________________________________
-AliTRDdataArray *AliTRDsegmentArray::GetDataArray(Int_t pla, Int_t cha, Int_t sec)
+AliTRDdataArray *AliTRDsegmentArray::GetDataArray(Int_t pla
+                                                , Int_t cha, Int_t sec) const
 {
   //
   // Returns the data array for a given detector