/* $Id$ */
-///////////////////////////////////////////////////////////////////////////////
-// //
-// Alice segment manager class //
-// //
-///////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+// //
+// Alice segment manager class //
+// //
+////////////////////////////////////////////////////////////////////////////
#include <TTree.h>
-#include "AliRun.h"
+#include "AliLog.h"
#include "AliTRDgeometry.h"
#include "AliTRDsegmentArray.h"
ClassImp(AliTRDsegmentArray)
//_____________________________________________________________________________
-AliTRDsegmentArray::AliTRDsegmentArray():AliTRDsegmentArrayBase()
+AliTRDsegmentArray::AliTRDsegmentArray()
+ :AliTRDsegmentArrayBase()
{
//
// Default constructor
//_____________________________________________________________________________
AliTRDsegmentArray::AliTRDsegmentArray(const char *classname, Int_t n)
- :AliTRDsegmentArrayBase(classname,n)
+ :AliTRDsegmentArrayBase(classname,n)
{
//
// Constructor creating an array of AliTRDdataArray of size <n>
//_____________________________________________________________________________
AliTRDsegmentArray::AliTRDsegmentArray(AliTRDsegmentArray &a)
-:AliTRDsegmentArrayBase(a)
+ :AliTRDsegmentArrayBase(a)
{
//
// AliTRDsegmentArray copy constructor
}
//_____________________________________________________________________________
-void AliTRDsegmentArray::Copy(TObject &a)
+void AliTRDsegmentArray::Copy(TObject &a) const
{
//
// Copy function
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;
+ 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;
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;
+ 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 pla
- , Int_t cha, Int_t sec) const
+ , Int_t cha
+ , Int_t sec) const
{
//
// Returns the data array for a given detector
//
- if (gAlice) {
-
- AliTRDgeometry *geo = AliTRDgeometry::GetGeometry(gAlice->GetRunLoader());
- 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);
}