+Short_t AliTRDdigitsManager::GetDigitAmp(Int_t row, Int_t col,Int_t time
+ , Int_t det) const
+{
+ //
+ // Returns the amplitude of a digit
+ //
+
+ return ((Short_t) GetDigits(det)->GetData(row,col,time));
+
+}
+
+//_____________________________________________________________________________
+Bool_t AliTRDdigitsManager::Open(const Char_t *file)
+{
+ //
+ // Opens the file for the TRD digits
+ //
+
+ fFile = (TFile*) gROOT->GetListOfFiles()->FindObject(file);
+ if (!fFile) {
+ if (fDebug > 0) {
+ printf("<AliTRDdigitsManager::Open> ");
+ printf("Open the AliROOT-file %s.\n",file);
+ }
+ fFile = new TFile(file,"UPDATE");
+ if (!fFile) return kFALSE;
+ }
+ else {
+ if (fDebug > 0) {
+ printf("<AliTRDdigitsManager::Open> ");
+ printf("%s is already open.\n",file);
+ }
+ }
+
+ return kTRUE;
+
+}
+
+//_____________________________________________________________________________
+Bool_t AliTRDdigitsManager::MakeBranch(const Char_t *file)
+{
+ //
+ // Creates the tree and branches for the digits and the dictionary
+ //
+
+ // Create the TRD digits tree
+ TTree *tree;
+ Char_t treeName[12];
+ if (fSDigits) {
+ sprintf(treeName,"TreeS%d_TRD",fEvent);
+ tree = new TTree(treeName,"TRD SDigits");
+ }
+ else {
+ sprintf(treeName,"TreeD%d_TRD",fEvent);
+ tree = new TTree(treeName,"TRD Digits");
+ }
+
+ if (fDebug > 0) {
+ printf("<AliTRDdigitsManager::MakeBranch> ");
+ printf("Creating tree %s\n",treeName);
+ }
+
+ return MakeBranch(tree,file);
+
+}
+
+//_____________________________________________________________________________
+Bool_t AliTRDdigitsManager::MakeBranch(TTree *tree, const Char_t *file)