* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.3 2000/06/08 18:32:58 cblume
-Make code compliant to coding conventions
+/* $Id$ */
-Revision 1.2 2000/05/08 16:17:27 cblume
-Merge TRD-develop
+////////////////////////////////////////////////////////////////////////////
+// //
+// Alice segment manager class //
+// //
+////////////////////////////////////////////////////////////////////////////
-Revision 1.1.4.1 2000/05/08 14:55:03 cblume
-Bug fixes
+#include <TTree.h>
-Revision 1.1 2000/02/28 19:02:32 cblume
-Add new TRD classes
+#include "AliLog.h"
-*/
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// Alice segment manager class //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-#include "AliTRD.h"
#include "AliTRDgeometry.h"
#include "AliTRDsegmentArray.h"
+#include "AliTRDdataArray.h"
ClassImp(AliTRDsegmentArray)
//_____________________________________________________________________________
-AliTRDsegmentArray::AliTRDsegmentArray():AliTRDsegmentArrayBase()
+AliTRDsegmentArray::AliTRDsegmentArray()
+ :AliTRDsegmentArrayBase()
{
//
// Default constructor
}
//_____________________________________________________________________________
-AliTRDsegmentArray::AliTRDsegmentArray(Text_t *classname, Int_t n)
- :AliTRDsegmentArrayBase(classname,n)
+AliTRDsegmentArray::AliTRDsegmentArray(const char *classname, Int_t n)
+ :AliTRDsegmentArrayBase(classname,n)
{
//
// Constructor creating an array of AliTRDdataArray of size <n>
//_____________________________________________________________________________
AliTRDsegmentArray::AliTRDsegmentArray(AliTRDsegmentArray &a)
+ :AliTRDsegmentArrayBase(a)
{
//
// AliTRDsegmentArray copy constructor
//
// AliTRDsegmentArray destructor
//
+
+ Delete();
+
}
//_____________________________________________________________________________
-void AliTRDsegmentArray::Copy(TObject &a)
+void AliTRDsegmentArray::Copy(TObject &a) const
{
//
// Copy function
}
//_____________________________________________________________________________
-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;
+
+ if (!fTree) {
+ AliError("Digits tree is not defined\n");
+ return kFALSE;
+ }
// Get the branch
fBranch = fTree->GetBranch(branchname);
- if (!fBranch) return kFALSE;
+ if (!fBranch) {
+ AliError(Form("Branch %s is not defined\n",branchname));
+ return kFALSE;
+ }
// Loop through all segments and read them from the tree
Bool_t status = kTRUE;
}
//_____________________________________________________________________________
-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;
+
+ if (!fTree) {
+ AliError("Digits tree is not defined\n");
+ return kFALSE;
+ }
// Get the branch
fBranch = fTree->GetBranch(branchname);
- if (!fBranch) return kFALSE;
+ if (!fBranch) {
+ AliError(Form("Branch %s is not defined\n",branchname));
+ return kFALSE;
+ }
// Loop through all segments and fill them into the tree
Bool_t status = kTRUE;
}
//_____________________________________________________________________________
-AliTRDdataArray *AliTRDsegmentArray::GetDataArray(Int_t det)
+AliTRDdataArray *AliTRDsegmentArray::GetDataArray(Int_t det) const
{
//
// Returns the data array for a given detector
}
//_____________________________________________________________________________
-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
//
- if (gAlice) {
-
- AliTRDgeometry *geo = ((AliTRD*) gAlice->GetDetector("TRD"))->GetGeometry();
- Int_t det = geo->GetDetector(pla,cha,sec);
- return GetDataArray(det);
-
- }
- else {
-
- printf("AliTRDsegmentArray::GetDigits -- ");
- printf("gAlice is not defined\n");
- return NULL;
-
- }
+ Int_t det = AliTRDgeometry::GetDetector(pla,cha,sec);
+ return GetDataArray(det);
}