X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TRD%2FAliTRDsegmentArray.cxx;h=9c40402dc04c363d42d11f961b235677c91cceeb;hb=000000926fa1964f4e9ac441ed8e4b9ee1c1f77e;hp=7d86b3283f855d67dd0774ae2323cffc31fa9b40;hpb=bdbb05bb7ec7474aa9a07ec884d702e042cb7001;p=u%2Fmrichter%2FAliRoot.git diff --git a/TRD/AliTRDsegmentArray.cxx b/TRD/AliTRDsegmentArray.cxx index 7d86b3283f8..9c40402dc04 100644 --- a/TRD/AliTRDsegmentArray.cxx +++ b/TRD/AliTRDsegmentArray.cxx @@ -15,15 +15,15 @@ /* $Id$ */ -/////////////////////////////////////////////////////////////////////////////// -// // -// Alice segment manager class // -// // -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// +// // +// Alice segment manager class // +// // +//////////////////////////////////////////////////////////////////////////// #include -#include "AliRun.h" +#include "AliLog.h" #include "AliTRDgeometry.h" #include "AliTRDsegmentArray.h" @@ -32,7 +32,8 @@ ClassImp(AliTRDsegmentArray) //_____________________________________________________________________________ -AliTRDsegmentArray::AliTRDsegmentArray():AliTRDsegmentArrayBase() +AliTRDsegmentArray::AliTRDsegmentArray() + :AliTRDsegmentArrayBase() { // // Default constructor @@ -42,7 +43,7 @@ AliTRDsegmentArray::AliTRDsegmentArray():AliTRDsegmentArrayBase() //_____________________________________________________________________________ AliTRDsegmentArray::AliTRDsegmentArray(const char *classname, Int_t n) - :AliTRDsegmentArrayBase(classname,n) + :AliTRDsegmentArrayBase(classname,n) { // // Constructor creating an array of AliTRDdataArray of size @@ -58,7 +59,7 @@ AliTRDsegmentArray::AliTRDsegmentArray(const char *classname, Int_t n) //_____________________________________________________________________________ AliTRDsegmentArray::AliTRDsegmentArray(AliTRDsegmentArray &a) -:AliTRDsegmentArrayBase(a) + :AliTRDsegmentArrayBase(a) { // // AliTRDsegmentArray copy constructor @@ -80,7 +81,7 @@ AliTRDsegmentArray::~AliTRDsegmentArray() } //_____________________________________________________________________________ -void AliTRDsegmentArray::Copy(TObject &a) +void AliTRDsegmentArray::Copy(TObject &a) const { // // Copy function @@ -113,17 +114,17 @@ Bool_t AliTRDsegmentArray::LoadArray(const Char_t *branchname, TTree *tree) 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; @@ -151,17 +152,17 @@ Bool_t AliTRDsegmentArray::StoreArray(const Char_t *branchname, TTree *tree) 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; @@ -193,25 +194,14 @@ AliTRDdataArray *AliTRDsegmentArray::GetDataArray(Int_t det) const //_____________________________________________________________________________ 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); }