]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONDataInterface.cxx
Take into account new class AliAODTracklets.
[u/mrichter/AliRoot.git] / MUON / AliMUONDataInterface.cxx
index ba8a7bb3fd16a1f4be4dfc36068edf9cb9b88a92..89a9b296adaf0c2b3734bc02487b43a447ff6464 100644 (file)
-
-// Author: Artur Szostak
-//  email: artur@alice.phy.uct.ac.za
-
-#include <TError.h>
-#include <TParticle.h>
-
-#include "AliRunLoader.h"
-#include "AliLoader.h"
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+/* $Id$ */
 
 #include "AliMUONDataInterface.h"
-#include "AliMUONLocalTrigger.h"
-#include "AliMUONHit.h"
 #include "AliMUONDigit.h"
+#include "AliMUONGeometryTransformer.h"
+#include "AliMUONGlobalTrigger.h"
+#include "AliMUONHit.h"
+#include "AliMUONLocalTrigger.h"
 #include "AliMUONRawCluster.h"
-#include "AliLog.h"
+#include "AliMUONTrack.h"
+#include "AliMUONTriggerCircuit.h"
+#include "AliMUONVClusterStore.h"
+#include "AliMUONVDigitStore.h"
+#include "AliMUONVTrackStore.h"
+#include "AliMUONVTriggerStore.h"
+#include "AliMUONVTriggerTrackStore.h"
 
+#include "AliLoader.h"
+#include "AliLog.h"
+#include "AliLog.h"
+#include "AliRunLoader.h"
 
+#include <TError.h>
+#include <TParticle.h>
+#include <Riostream.h>
+#include <TFile.h>
+#include <TList.h>
+#include <TNtuple.h>
+#include <TSystem.h>
+
+///
+/// \class AliMUONDataInterface
+///
+/// An easy to use interface to the MUON data data stored in
+/// TreeS, TreeD, TreeR and TreeT.
+///
+/// For MC related information (i.e. TreeH, TreeK, TreeTR), see
+/// AliMUONMCDataInterface.
+///
+///
+/// This interface in not necessarily the fastest way to fetch the data but
+/// it is the easiest.
+///
+/// \author Laurent Aphecetche, Subatech
+
+/// \cond CLASSIMP
 ClassImp(AliMUONDataInterface)
+/// \endcond
+
+//AliLoader* fLoader; //!< Tree accessor
+//AliMUONVDigitStore* fDigitStore; //!< current digit store (owner)
+//AliMUONVTriggerStore* fTriggerStore; //!< current trigger store (owner)
+//AliMUONVClusterStore* fClusterStore; //!< current cluster store (owner)
+//AliMUONVTrackStore* fTrackStore; //!< current track store (owner)
+//AliMUONVTriggerTrackStore* fTriggerTrackStore; //!< current trigger track store (owner)
+//Int_t fCurrentEvent; //!< Current event we've read in
+//Bool_t fIsValid; //!< whether we were initialized properly or not
+
+Int_t AliMUONDataInterface::fgInstanceCounter(0);
+
+//______________________________________________________________________________
+AliMUONDataInterface::AliMUONDataInterface(const char* filename)
+: TObject(), 
+fLoader(0x0),
+fDigitStore(0x0),
+fTriggerStore(0x0),
+fClusterStore(0x0),
+fTrackStore(0x0),
+fTriggerTrackStore(0x0),
+fCurrentEvent(-1),
+fIsValid(kFALSE)
+{
+  /// ctor
+  /// @param filename should be the full path to a valid galice.root file
+  
+  ++fgInstanceCounter;
+  
+  Open(filename);
+}
+
+//______________________________________________________________________________
+AliMUONDataInterface::~AliMUONDataInterface()
+{
+  /// dtor
+  if ( fLoader ) 
+  {
+    delete fLoader->GetRunLoader();
+  }
+  --fgInstanceCounter;  
+}
+
+//______________________________________________________________________________
+AliMUONVClusterStore*
+AliMUONDataInterface::ClusterStore(Int_t event)
+{
+  /// Return clusterStore for a given event.
+  /// Return 0x0 if event not found.
+  /// Returned pointer should not be deleted
+  
+  if ( LoadEvent(event) ) return 0x0;
+  
+  fLoader->LoadRecPoints();
+  
+  TTree* treeR = fLoader->TreeR();
+  
+  if (!treeR)
+  {
+    AliError("Could not get treeR");
+    return 0x0;
+  }
+  
+  if (!fClusterStore)
+  {
+    fClusterStore = AliMUONVClusterStore::Create(*treeR);
+  }
+  
+  if ( fClusterStore ) 
+  {
+    fClusterStore->Clear();
+    fClusterStore->Connect(*treeR);
+    treeR->GetEvent(0);
+  }
+  
+  fLoader->UnloadRecPoints();
+  
+  return fClusterStore;
+}
+
+//______________________________________________________________________________
+AliMUONVDigitStore*
+AliMUONDataInterface::DigitStore(Int_t event)
+{
+  /// Return digitStore for a given event.
+  /// Return 0x0 if event not found.
+  /// Returned pointer should not be deleted
+  
+  if ( LoadEvent(event) ) return 0x0;
+  
+  fLoader->LoadDigits();
+  
+  TTree* treeD = fLoader->TreeD();
+  
+  if (!treeD)
+  {
+    AliError("Could not get treeD");
+    return 0x0;
+  }
+  
+  if (!fDigitStore)
+  {
+    fDigitStore = AliMUONVDigitStore::Create(*treeD);
+  }
+  
+  if ( fDigitStore ) 
+  {
+    fDigitStore->Clear();
+    fDigitStore->Connect(*treeD);
+    treeD->GetEvent(0);
+  }
+  
+  fLoader->UnloadDigits();
+  
+  return fDigitStore;
+}
+
+//______________________________________________________________________________
+void
+AliMUONDataInterface::DumpDigits(Int_t event, Bool_t sorted)
+{
+  /// Dump the digits for a given event, sorted if so required
+  DigitStore(event);
+  if ( fDigitStore ) 
+  {
+    if ( sorted ) 
+    {
+      DumpSorted(*fDigitStore);
+    }
+    else
+    {
+      fDigitStore->Print();
+    }
+  }
+}
+
+//______________________________________________________________________________
+void
+AliMUONDataInterface::DumpRecPoints(Int_t event, Bool_t sorted)
+{
+  /// Dump the recpoints for a given event, sorted if so required
+  ClusterStore(event);
+  if ( fClusterStore ) 
+  {
+    if ( sorted ) 
+    {
+      DumpSorted(*fClusterStore);
+    }
+    else
+    {
+      fClusterStore->Print();
+    }
+  }
+}
+
+//_____________________________________________________________________________
+void
+AliMUONDataInterface::DumpSorted(const AliMUONVStore& store) const
+{
+  /// Dump the given store, in sorted order
+  
+  TIter next(store.CreateIterator());
+  TObject* object;
+  TList list;
+  list.SetOwner(kFALSE);
+  
+  while ( ( object = next() ) )
+  {
+    list.Add(object);
+  }
+  
+  list.Sort();
+  
+  list.Print();
+}
+
+//______________________________________________________________________________
+void
+AliMUONDataInterface::DumpTracks(Int_t event, Bool_t sorted)
+{
+  /// Dump tracks for a given event, sorted if requested
+  
+  TrackStore(event);
+  
+  if ( fTrackStore ) 
+  {
+    if ( sorted ) 
+    {
+      DumpSorted(*fTrackStore);
+    }
+    else
+    {
+      fTrackStore->Print();
+    }
+  }
+}
+
+//______________________________________________________________________________
+void
+AliMUONDataInterface::DumpTriggerTracks(Int_t event, Bool_t sorted)
+{
+  /// Dump trigger tracks for a given event, sorted if requested
+
+  TriggerTrackStore(event);
+  
+  if ( fTriggerTrackStore ) 
+  {
+    if ( sorted ) 
+    {
+      DumpSorted(*fTriggerTrackStore);
+    }
+    else
+    {
+      fTriggerTrackStore->Print();
+    }
+  }
+}
+
+//_____________________________________________________________________________
+void
+AliMUONDataInterface::DumpTrigger(Int_t event, const char* treeLetter)
+{
+  /// Dump trigger for a given event from a given tree (if event>=0)
+  /// or loop over all events and build a trigger ntuple if event<0
+  /// treeLetter can be R or D to tell from which tree to read the information
+  
+  if ( event < 0 ) 
+  {
+    NtupleTrigger(treeLetter);
+  }
+  else
+  {
+    TriggerStore(event,treeLetter);
+  
+    if ( fTriggerStore ) 
+    {
+      fTriggerStore->Print();
+    }
+  }
+}
+
+//_____________________________________________________________________________
+void
+AliMUONDataInterface::NtupleTrigger(const char* treeLetter)
+{
+  //// Loop over events to build trigger ntuples
+  ///
+  
+  TString sTreeLetter(treeLetter);
+  sTreeLetter.ToUpper();
+  
+  if ( sTreeLetter != "R" && sTreeLetter != "D" ) 
+  {
+    AliError(Form("Cannot handle tree%s. Use D or R",treeLetter));
+    return;
+  }
+  
+  // book ntuples
+  TNtuple tupleGlo("TgtupleGlo","Global Trigger Ntuple",
+                   "ev:slpt:shpt:uplpt:uphpt:lplpt:lplpt");
+  TNtuple tupleLoc("TgtupleLoc","Local Trigger Ntuple",
+                   "ev:LoCircuit:LoStripX:LoDev:StripY:LoLpt:LoHpt:y11:y21:x11");
+  
+  // initialize counters
+  Int_t sLowpt=0;
+  Int_t sHighpt=0;
+  Int_t uSLowpt=0;
+  Int_t uSHighpt=0;
+  Int_t lSLowpt=0;
+  Int_t lSHighpt=0;
+  
+  AliMUONGeometryTransformer transformer;
+  transformer.LoadGeometryData(Form("%s/geometry.root",
+                                    gSystem->DirName(fLoader->GetRunLoader()->GetFileName())));
+  
+  AliMUONTriggerCircuit triggerCircuit(&transformer);
+
+  // select output file name from selected Tree
+  Char_t fileNameOut[30];
+  if (sTreeLetter == "D") 
+  {
+    AliInfo(Form("reading from Digits\n"));
+    sprintf(fileNameOut,"TriggerCheckFromDigits.root");
+  } 
+  else if (sTreeLetter == "R") 
+  {
+    AliInfo(Form("reading from RecPoints\n"));
+    sprintf(fileNameOut,"TriggerCheckFromRP.root");
+  }
+  
+  // loop on events
+  Int_t nevents = NumberOfEvents();
+
+  for (Int_t ievent=0; ievent<nevents; ++ievent) 
+  {
+    if (ievent%100==0) AliInfo(Form("Processing event %d\n",ievent));
+    
+    AliMUONVTriggerStore* triggerStore = TriggerStore(ievent);
+    
+    if (!triggerStore)
+    {
+      AliError(Form("Could not read %s from tree%s","Trigger",treeLetter));
+      return;
+    }
+    
+    // get global trigger info
+    AliMUONGlobalTrigger* gloTrg = triggerStore->Global();     
+    sLowpt+=gloTrg->SingleLpt();
+    sHighpt+=gloTrg->SingleHpt();
+    uSLowpt+=gloTrg->PairUnlikeLpt(); 
+    uSHighpt+=gloTrg->PairUnlikeHpt();
+    lSLowpt+=gloTrg->PairLikeLpt(); 
+    lSHighpt+=gloTrg->PairLikeHpt();
+    
+    // loop on local triggers  
+    TIter next(triggerStore->CreateIterator());
+    AliMUONLocalTrigger* locTrg(0x0);
+    while ( ( locTrg = static_cast<AliMUONLocalTrigger*>(next()) ) )
+    {
+      Bool_t xTrig=kFALSE;
+      Bool_t yTrig=kFALSE;
+      
+      if ( locTrg->LoSdev()==1 && locTrg->LoDev()==0 && 
+           locTrg->LoStripX()==0) xTrig=kFALSE; // no trigger in X
+      else xTrig=kTRUE;                         // trigger in X
+      if (locTrg->LoTrigY()==1 && 
+          locTrg->LoStripY()==15 ) yTrig = kFALSE; // no trigger in Y
+      else yTrig = kTRUE;                          // trigger in Y
+      
+      if (xTrig && yTrig) 
+      { // fill ntuple if trigger in X and Y                   
+        tupleLoc.Fill(ievent,locTrg->LoCircuit(),
+                       locTrg->LoStripX(),
+                       locTrg->LoDev(),
+                       locTrg->LoStripY(),
+                       locTrg->LoLpt(),
+                       locTrg->LoHpt(),
+                       triggerCircuit.GetY11Pos(locTrg->LoCircuit(),locTrg->LoStripX()),
+                       triggerCircuit.GetY21Pos(locTrg->LoCircuit(),locTrg->LoStripX()+locTrg->LoDev()+1),
+                       triggerCircuit.GetX11Pos(locTrg->LoCircuit(),locTrg->LoStripY()));
+      }
+      tupleGlo.Fill(ievent,gloTrg->SingleLpt(),gloTrg->SingleHpt(),
+                     gloTrg->PairUnlikeLpt(),gloTrg->PairUnlikeHpt(),
+                     gloTrg->PairLikeLpt(),gloTrg->PairLikeHpt());
+    } // end of loop on local triggers
+  } // end of loop on events
+  
+  // print info and store ntuples
+  printf("\n");
+  printf("=============================================\n");
+  printf("================  SUMMARY  ==================\n");
+  printf("\n");
+  printf("Total number of events processed %d \n",nevents);
+  printf("\n");
+  printf(" Global Trigger output       Low pt  High pt\n");
+  printf(" number of Single           :\t");
+  printf("%i\t%i\t",sLowpt,sHighpt);
+  printf("\n");
+  printf(" number of UnlikeSign pair  :\t"); 
+  printf("%i\t%i\t",uSLowpt,uSHighpt);
+  printf("\n");
+  printf(" number of LikeSign pair    :\t");  
+  printf("%i\t%i\t",lSLowpt,lSHighpt);
+  printf("\n");
+  printf("=============================================\n");
+  fflush(stdout);    
+  
+  TFile myFile(fileNameOut, "RECREATE");
+  tupleGlo.Write();
+  tupleLoc.Write();
+  myFile.Close();
+}
+
+//______________________________________________________________________________
+Bool_t
+AliMUONDataInterface::IsValid() const
+{
+  /// Whether we were properly initialized from a valid galice.root file
+  return fIsValid;
+}
+
+//_____________________________________________________________________________
+Int_t
+AliMUONDataInterface::LoadEvent(Int_t event)
+{
+  /// Load event if different from the current one.
+  if ( event != fCurrentEvent ) 
+  {
+    fCurrentEvent = event;
+    AliDebug(1,Form("Loading event %d using runLoader %p",event,fLoader->GetRunLoader()));
+    if ( event < NumberOfEvents() )
+    {
+      return fLoader->GetRunLoader()->GetEvent(event);
+    }
+    else
+    {
+      return 1;
+    }
+  }
+  return 0;
+}
+
+//______________________________________________________________________________
+Int_t
+AliMUONDataInterface::NumberOfEvents() const
+{
+  /// Number of events in the current galice.root file we're attached to 
+  if (!IsValid()) return 0;
+  return fLoader->GetRunLoader()->GetNumberOfEvents();
+}
+
+//_____________________________________________________________________________
+void
+AliMUONDataInterface::Open(const char* filename)
+{
+  /// Connect to a given galice.root file
+  
+  delete fDigitStore;
+  fDigitStore=0x0;
+  delete fTriggerStore;
+  fTriggerStore=0x0;
+  delete fClusterStore;
+  fClusterStore=0x0;
+  delete fTrackStore;
+  fTrackStore=0x0;
+  delete fTriggerTrackStore;
+  fTriggerTrackStore=0x0;
+  
+  fCurrentEvent=-1;
+  
+  if ( fLoader ) 
+  {
+    delete fLoader->GetRunLoader();
+  }
+  
+  fLoader = 0x0;
+  
+  fIsValid = kTRUE;
+  
+  TString foldername(Form("%s-%d",ClassName(),fgInstanceCounter));
+  
+  while (AliRunLoader::GetRunLoader(foldername)) 
+  {
+    delete AliRunLoader::GetRunLoader(foldername);
+  }
+  
+  AliRunLoader* runLoader = AliRunLoader::Open(filename,foldername);
+  if (!runLoader) 
+  {
+    AliError(Form("Cannot open file %s",filename));    
+    fIsValid = kFALSE;
+  }
+  fLoader = runLoader->GetDetectorLoader("MUON");
+  if (!fLoader) 
+  {
+    AliError("Cannot get AliMUONLoader");
+    fIsValid = kFALSE;
+  }
+  
+  if (!IsValid())
+  {
+    AliError(Form("Could not access %s filename. Object is unuseable",filename));
+  }
+}
+
+//______________________________________________________________________________
+AliMUONVTrackStore* 
+AliMUONDataInterface::TrackStore(Int_t event)
+{
+  /// Return the trackStore for a given event.
+  /// Return 0x0 if event not found.
+  /// Returned pointer should not be deleted
+  
+  if ( LoadEvent(event) ) return 0x0;
+  
+  fLoader->LoadTracks();
+  
+  TTree* treeT = fLoader->TreeT();
+  
+  if (!treeT)
+  {
+    AliError("Could not get treeT");
+    return 0x0;
+  }
+  
+  if (!fTrackStore)
+  {
+    fTrackStore = AliMUONVTrackStore::Create(*treeT);
+  }
+  
+  if ( fTrackStore ) 
+  {
+    fTrackStore->Clear();
+    fTrackStore->Connect(*treeT);
+    treeT->GetEvent(0);
+  }
+  
+  fLoader->UnloadTracks();
+  
+  return fTrackStore;
+}
+
+//______________________________________________________________________________
+AliMUONVTriggerTrackStore* 
+AliMUONDataInterface::TriggerTrackStore(Int_t event)
+{
+  /// Return the triggerTrackStore for a given event.
+  /// Return 0x0 if event not found.
+  /// Returned pointer should not be deleted
+  
+  if ( LoadEvent(event) ) return 0x0;
+  
+  fLoader->LoadTracks();
+  
+  TTree* treeT = fLoader->TreeT();
+  
+  if (!treeT)
+  {
+    AliError("Could not get treeT");
+    return 0x0;
+  }
+  
+  if (!fTriggerTrackStore)
+  {
+    fTriggerTrackStore = AliMUONVTriggerTrackStore::Create(*treeT);
+  }
+  
+  if ( fTriggerTrackStore ) 
+  {
+    fTriggerTrackStore->Clear();
+    fTriggerTrackStore->Connect(*treeT);
+    treeT->GetEvent(0);
+  }
+  
+  fLoader->UnloadTracks();
+  
+  return fTriggerTrackStore;  
+}
+
+//_____________________________________________________________________________
+AliMUONVTriggerStore*
+AliMUONDataInterface::TriggerStore(Int_t event, const char* treeLetter)
+{
+  /// Return the triggerStore for a given event.
+  /// Return 0x0 if event not found.
+  /// Returned pointer should not be deleted
+  /// treeLetter can be R or D to tell from which tree to read the information
+  
+  if ( LoadEvent(event) ) return 0x0;
+  
+  TTree* tree(0x0);
+  
+  TString stree(treeLetter);
+  stree.ToUpper();
+  
+  if ( stree == "D" )
+  {
+    fLoader->LoadDigits();    
+    tree = fLoader->TreeD();
+  }
+  else if ( stree == "R" )
+  {
+    fLoader->LoadRecPoints();
+    tree = fLoader->TreeR();
+  }
+  
+  if ( !tree ) 
+  {
+    AliError(Form("Could not get tree%s",treeLetter));
+    return 0x0;
+  }
+  
+  if (!fTriggerStore)
+  {
+    fTriggerStore = AliMUONVTriggerStore::Create(*tree);
+  }
+  
+  if ( fTriggerStore ) 
+  {
+    fTriggerStore->Clear();
+    fTriggerStore->Connect(*tree);
+    tree->GetEvent(0);
+  }
+  
+  if ( stree == "D" )
+  {
+    fLoader->UnloadDigits();    
+  }
+  else if ( stree == "R" )
+  {
+    fLoader->UnloadRecPoints();
+  }
+  
+  return fTriggerStore;
+}
+
+//______________________________________________________________________________
+//______________________________________________________________________________
+//______________________________________________________________________________
+//______________________________________________________________________________
 
-
-AliMUONDataInterface::AliMUONDataInterface()
-       : TObject(), fData(NULL, "MUON", "MUON")
+void AliMUONDataInterface::Reset()
 {
-// Set all internal pointers to NULL and indices to -1.
+/// \deprecated Method is going to be removed
 
-       Reset();
+  AliFatal("Deprecated");
 }
 
-AliMUONDataInterface::AliMUONDataInterface(const AliMUONDataInterface& rhs)
-  : TObject(rhs)
+Bool_t AliMUONDataInterface::UseCurrentRunLoader()
 {
-// Protected copy constructor
+/// \deprecated Method is going to be removed
 
-  AliFatal("Not implemented.");
+  AliFatal("Deprecated");
+  return kFALSE;
 }
-
-AliMUONDataInterface::~AliMUONDataInterface()
+  
+Int_t AliMUONDataInterface::NumberOfEvents(TString , TString )
 {
-// Delete the runloader when done.
-// If the runloader is not to be deleted then call Reset just before 
-// the destructor is called.
+/// \deprecated Method is going to be removed
 
-       if (fRunloader != NULL)
-               delete fRunloader;
+  AliFatal("Deprecated");
+  return 0;
 }
 
-AliMUONDataInterface&  
-AliMUONDataInterface::operator=(const AliMUONDataInterface& rhs)
+
+Int_t AliMUONDataInterface::NumberOfParticles(TString , TString , Int_t )
 {
-// Protected assignement operator
+/// \deprecated Method is going to be removed
 
-  if (this == &rhs) return *this;
+  AliFatal("Deprecated");
+  return 0;
+}
 
-  AliFatal("Not implemented.");
-    
-  return *this;  
-}    
-          
 
-void AliMUONDataInterface::Reset()
+TParticle* AliMUONDataInterface::Particle(
+               TString , TString , Int_t , Int_t 
+       )
 {
-// Sets all internal pointers to NULL and indices to -1.
-// Note: No resources are released!
-// Specificaly AliRunLoader is not deleted.
-
-       fRunloader = NULL;
-       fMuonloader = NULL;
-       fEventnumber = -1;
-       fTrack = -1;
-       fSCathode = -1;
-       fCathode = -1;
-       fHitAddressSet = kFALSE;
-       fSDigitAddressSet = kFALSE;
-       fDigitAddressSet = kFALSE;
-       fClusterAddressSet = kFALSE;
-       fTriggerAddressSet = kFALSE;
-}
-
-
-Bool_t AliMUONDataInterface::LoadLoaders(TString filename, TString foldername)
-{
-// Load the run and muon loaders from the specified file and folder.
-// kTRUE is returned on success and kFALSE on failure.
-
-       fRunloader = AliRunLoader::Open(filename, foldername, "READ");
-       if (fRunloader == NULL)
-       {
-               AliError(Form("Could not find or load the run loader for the file: %s and folder: %s", 
-                       (const char*)filename, (const char*)foldername));
-               return kFALSE;
-       }
-       fMuonloader = fRunloader->GetLoader("MUONLoader");
-       if (fMuonloader == NULL)
-       {
-               AliError(Form("Could not find the MUON loader in file: %s and folder: %s", 
-                       (const char*)filename, (const char*)foldername));
-               fRunloader = NULL;
-               return kFALSE;
-       }
-       
-       // Need to connect the muon loader to the AliMUONData object,
-       // else class to fData will return NULL.
-       fData.SetLoader(fMuonloader);
-       
-       fFilename = filename;
-       fFoldername = foldername;
-       fEventnumber = -1;  // Reset the event number to force the event to be loaded.
-       return kTRUE;
-}
-
-
-Bool_t AliMUONDataInterface::FetchLoaders(TString filename, TString foldername)
-{
-// Fetch the run loader and muon loader objects from memory if they already exist,
-// or from memory if they do not. 
-// If the currently loaded run loader (if any) is not refering to the file and folder
-// we are interested in then it is deleted and reopened with the required file and
-// folder names.
-
-       if (fRunloader == NULL)
-       {
-               fRunloader = AliRunLoader::GetRunLoader();
-               if (fRunloader == NULL)
-                       return LoadLoaders(filename, foldername);
-               
-               // Fetch the current file and folder names.
-               fFilename = fRunloader->GetFileName();
-               fFoldername = fRunloader->GetEventFolder()->GetName();
-       }
-
-       // If filename or foldername are not the same as the ones currently selected then
-       // reopen the file.
-       if ( filename.CompareTo(fFilename) != 0 || foldername.CompareTo(fFoldername) != 0 )
-       {
-               delete fRunloader;
-               return LoadLoaders(filename, foldername);
-       }
-       return kTRUE;
-}
-
-
-Bool_t AliMUONDataInterface::FetchEvent(Int_t event)
-{
-// Fetch the specified event from the runloader and reset all the track, cathode
-// and address flags to force them to be reloaded.
-
-       if (fEventnumber < 0)
-       {
-               fEventnumber = fRunloader->GetEventNumber();
-               fTrack = -1;
-               fSCathode = -1;
-               fCathode = -1;
-               fHitAddressSet = kFALSE;
-               fSDigitAddressSet = kFALSE;
-               fDigitAddressSet = kFALSE;
-               fClusterAddressSet = kFALSE;
-               fTriggerAddressSet = kFALSE;
-       }
-       if ( event != fEventnumber )
-       {
-               if ( fRunloader->GetEvent(event) < 0 ) return kFALSE;
-               fEventnumber = event;
-               fTrack = -1;
-               fSCathode = -1;
-               fCathode = -1;
-               fHitAddressSet = kFALSE;
-               fSDigitAddressSet = kFALSE;
-               fDigitAddressSet = kFALSE;
-               fClusterAddressSet = kFALSE;
-               fTriggerAddressSet = kFALSE;
-       }
-       return kTRUE;
-}
-
-
-Bool_t AliMUONDataInterface::FetchTreeK()
-{
-// Fetch the Kine tree from the current run loader.
-
-       if (fRunloader->TreeK() == NULL)
-       {
-               fRunloader->LoadKinematics("READ");
-               if (fRunloader->TreeK() == NULL)
-               {
-                       AliError("Could not load TreeK.");
-                       return kFALSE;
-               }
-       }
-       return kTRUE;
-}
-
-
-Bool_t AliMUONDataInterface::FetchTreeH()
-{
-// Fetch the Hits tree from the current muon loader.
-// Set all the required addresses etc...
-
-       if (fMuonloader->TreeH() == NULL)
-       {
-               fMuonloader->LoadHits("READ");
-               if (fMuonloader->TreeH() == NULL)
-               {
-                       AliError("Could not load TreeH.");
-                       return kFALSE;
-               }
-               fData.SetTreeAddress("H");
-               fHitAddressSet = kTRUE;
-       }
-       else if ( ! fHitAddressSet )
-       {
-               fData.SetTreeAddress("H");
-               fHitAddressSet = kTRUE;
-       }
-       return kTRUE;
-}
-
-
-Bool_t AliMUONDataInterface::FetchTreeS()
-{
-// Fetch the S-Digits tree from the current muon loader.
-// Set all the required addresses etc...
-
-       if (fMuonloader->TreeS() == NULL)
-       {
-               fMuonloader->LoadSDigits("READ");
-               if (fMuonloader->TreeS() == NULL)
-               {
-                       AliError("Could not load TreeS.");
-                       return kFALSE;
-               }
-               fData.SetTreeAddress("S");
-               fSDigitAddressSet = kTRUE;
-       }
-       else if ( ! fSDigitAddressSet )
-       {
-               fData.SetTreeAddress("S");
-               fSDigitAddressSet = kTRUE;
-       }
-       return kTRUE;
+/// \deprecated Method is going to be removed
+
+  AliFatal("Deprecated");
+  return 0;
 }
-
-
-Bool_t AliMUONDataInterface::FetchTreeD()
-{
-// Fetch the digits tree from the current muon loader.
-// Set all the required addresses etc...
-
-       if (fMuonloader->TreeD() == NULL)
-       {
-               fMuonloader->LoadDigits("READ");
-               if (fMuonloader->TreeD() == NULL)
-               {
-                       AliError("Could not load TreeD.");
-                       return kFALSE;
-               }
-               fData.SetTreeAddress("D");
-               fDigitAddressSet = kTRUE;
-       }
-       else if ( ! fDigitAddressSet )
-       {
-               fData.SetTreeAddress("D");
-               fDigitAddressSet = kTRUE;
-       }
-       return kTRUE;
+
+
+Int_t AliMUONDataInterface::NumberOfTracks(TString , TString , Int_t )
+{
+/// \deprecated Method is going to be removed
+
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-Bool_t AliMUONDataInterface::FetchTreeR()
+Int_t AliMUONDataInterface::NumberOfHits(
+               TString , TString , Int_t , Int_t 
+       )
 {
-// Fetch the reconstructed objects tree from the current muon loader.
-// Nore: The addresses must still be set. 
+/// \deprecated Method is going to be removed
 
-       if (fMuonloader->TreeR() == NULL)
-       {
-               fMuonloader->LoadRecPoints("READ");
-               if (fMuonloader->TreeR() == NULL)
-               {
-                       AliError("Could not load TreeR.");
-                       return kFALSE;
-               }
-               
-               // Need to reset these flags so that the cluster and trigger address
-               // gets reset after this method. 
-               fClusterAddressSet = kFALSE;
-               fTriggerAddressSet = kFALSE;
-       }
-       return kTRUE;
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-Int_t AliMUONDataInterface::NumberOfEvents(TString filename, TString foldername)
+AliMUONHit* AliMUONDataInterface::Hit(
+               TString , TString , Int_t ,
+               Int_t , Int_t 
+       )
 {
-// Returns the number of events in the specified file/folder, and -1 on error.
+/// \deprecated Method is going to be removed
 
-       if ( ! FetchLoaders(filename, foldername) ) return -1;
-       return fRunloader->GetNumberOfEvents();
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-Int_t AliMUONDataInterface::NumberOfParticles(TString filename, TString foldername, Int_t event)
+Int_t AliMUONDataInterface::NumberOfSDigits(
+               TString , TString , Int_t ,
+               Int_t , Int_t 
+       )
 {
-// Returns the number of events in the specified file/folder, and -1 on error.
+/// \deprecated Method is going to be removed
 
-       if ( ! FetchLoaders(filename, foldername) ) return -1;
-       if ( ! FetchEvent(event) ) return -1;
-       if ( ! FetchTreeK() ) return -1;
-       return (Int_t) fRunloader->TreeK()->GetEntriesFast();
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-TParticle* AliMUONDataInterface::Particle(
-               TString filename, TString foldername, Int_t event, Int_t particle
+AliMUONDigit* AliMUONDataInterface::SDigit(
+               TString , TString , Int_t ,
+               Int_t , Int_t , Int_t 
        )
 {
-// Returns the specified particle in the given file, folder and event.
-// NULL is returned on error.
+/// \deprecated Method is going to be removed
 
-       if ( ! FetchLoaders(filename, foldername) ) return NULL;
-       if ( ! FetchEvent(event) ) return NULL;
-       if ( ! FetchTreeK() ) return NULL;
-       
-       TTree* treeK = fRunloader->TreeK();
-       TParticle* p = NULL;
-       treeK->GetBranch("Particles")->SetAddress(&p);
-       treeK->GetEvent(particle);
-       return p;
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-Int_t AliMUONDataInterface::NumberOfTracks(TString filename, TString foldername, Int_t event)
+Int_t AliMUONDataInterface::NumberOfDigits(
+               TString , TString , Int_t ,
+               Int_t , Int_t 
+       )
 {
-// Returns the number of tracks in the specified file/folder and event.
-// -1 is returned on error.
+/// \deprecated Method is going to be removed
 
-       if ( ! FetchLoaders(filename, foldername) ) return -1;
-       if ( ! FetchEvent(event) ) return -1;
-       if ( ! FetchTreeH() ) return -1;
-       return fData.GetNtracks();
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-Int_t AliMUONDataInterface::NumberOfHits(
-               TString filename, TString foldername, Int_t event, Int_t track
+AliMUONDigit* AliMUONDataInterface::Digit(
+               TString , TString , Int_t ,
+               Int_t , Int_t , Int_t 
        )
 {
-// Returns the number of hits in the specified file/folder, event and track.
-// -1 is returned on error.
+/// \deprecated Method is going to be removed
 
-       if ( ! FetchLoaders(filename, foldername) ) return -1;
-       if ( ! FetchEvent(event) ) return -1;
-       if ( ! FetchTreeH() ) return -1;
+  AliFatal("Deprecated");
+  return 0;
+}
 
-       if (fTrack < 0 || fTrack != track)
-       {
-               fData.ResetHits();
-               fData.GetTrack(track);
-               fTrack = track;
-       }
-       return fData.Hits()->GetEntriesFast();
+
+Int_t AliMUONDataInterface::NumberOfRawClusters(
+               TString , TString , Int_t , Int_t 
+       )
+{
+/// \deprecated Method is going to be removed
+
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-AliMUONHit* AliMUONDataInterface::Hit(
-               TString filename, TString foldername, Int_t event,
-               Int_t track, Int_t hit
+AliMUONRawCluster* AliMUONDataInterface::RawCluster(
+               TString , TString , Int_t ,
+               Int_t , Int_t 
        )
 {
-// Returns the specified hit in the given file, folder, event and track.
-// NULL is returned on error.
+/// \deprecated Method is going to be removed
 
-       if ( ! FetchLoaders(filename, foldername) ) return NULL;
-       if ( ! FetchEvent(event) ) return NULL;
-       if ( ! FetchTreeH() ) return NULL;
+  AliFatal("Deprecated");
+  return 0;
+}
+
+
+Int_t AliMUONDataInterface::NumberOfLocalTriggers(TString , TString , Int_t )
+{
+/// \deprecated Method is going to be removed
 
-       if (fTrack < 0 || fTrack != track)
-       {
-               fData.ResetHits();
-               fData.GetTrack(track);
-               fTrack = track;
-       }
-       return static_cast<AliMUONHit*>( fData.Hits()->At(hit) );
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-Int_t AliMUONDataInterface::NumberOfSDigits(
-               TString filename, TString foldername, Int_t event,
-               Int_t chamber, Int_t cathode
+AliMUONLocalTrigger* AliMUONDataInterface::LocalTrigger(
+               TString , TString , Int_t , Int_t 
        )
 {
-// Returns the number of s-digits in the given file, folder, event,
-// chamber and cathode. -1 is returned on error.
+/// \deprecated Method is going to be removed
 
-       Assert( 0 <= chamber && chamber <= 13 );
-       Assert( 0 <= cathode && cathode <= 1 );
-       
-       if ( ! FetchLoaders(filename, foldername) ) return -1;
-       if ( ! FetchEvent(event) ) return -1;
-       if ( ! FetchTreeS() ) return -1;
+  AliFatal("Deprecated");
+  return 0;
+}
+
+Bool_t AliMUONDataInterface::SetFile(TString , TString )
+{
+/// \deprecated Method is going to be removed
 
-       if ( fSCathode != cathode )
-       {
-               fData.ResetSDigits();
-               fData.GetCathodeS(cathode);
-               fSCathode = cathode;
-       }
-       return fData.SDigits(chamber)->GetEntriesFast();
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-AliMUONDigit* AliMUONDataInterface::SDigit(
-               TString filename, TString foldername, Int_t event,
-               Int_t chamber, Int_t cathode, Int_t sdigit
-       )
+Bool_t AliMUONDataInterface::GetEvent(Int_t )
 {
-// Returns the specified s-digit in the given file, folder, event,
-// chamber and cathode. NULL is returned on error.
+/// \deprecated Method is going to be removed
 
-       Assert( 0 <= chamber && chamber <= 13 );
-       Assert( 0 <= cathode && cathode <= 1 );
-       
-       if ( ! FetchLoaders(filename, foldername) ) return NULL;
-       if ( ! FetchEvent(event) ) return NULL;
-       if ( ! FetchTreeS() ) return NULL;
+  AliFatal("Deprecated");
+  return 0;
+}
 
-       if ( fSCathode != cathode )
-       {
-               fData.ResetSDigits();
-               fData.GetCathodeS(cathode);
-               fSCathode = cathode;
-       }
-       return static_cast<AliMUONDigit*>( fData.SDigits(chamber)->At(sdigit) );
+Int_t AliMUONDataInterface::NumberOfParticles()
+{
+/// \deprecated Method is going to be removed
+
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-Int_t AliMUONDataInterface::NumberOfDigits(
-               TString filename, TString foldername, Int_t event,
-               Int_t chamber, Int_t cathode
-       )
+TParticle* AliMUONDataInterface::Particle(Int_t )
 {
-// Returns the number of digits in the given file, folder, event,
-// chamber and cathode. -1 is returned on error.
-       Assert( 0 <= chamber && chamber <= 13 );
-       Assert( 0 <= cathode && cathode <= 1 );
-       
-       if ( ! FetchLoaders(filename, foldername) ) return -1;
-       if ( ! FetchEvent(event) ) return -1;
-       if ( ! FetchTreeD() ) return -1;
+/// \deprecated Method is going to be removed
 
-       if ( fCathode != cathode )
-       {
-               fData.ResetDigits();
-               fData.GetCathode(cathode);
-               fCathode = cathode;
-       }
-       return fData.Digits(chamber)->GetEntriesFast();
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-AliMUONDigit* AliMUONDataInterface::Digit(
-               TString filename, TString foldername, Int_t event,
-               Int_t chamber, Int_t cathode, Int_t digit
-       )
+Int_t AliMUONDataInterface::NumberOfTracks()
 {
-// Returns the specified digit in the given file, folder, event,
-// chamber and cathode. NULL is returned on error.
+/// \deprecated Method is going to be removed
+
+  AliFatal("Deprecated");
+  return 0;
+}
 
-       Assert( 0 <= chamber && chamber <= 13 );
-       Assert( 0 <= cathode && cathode <= 1 );
-       
-       if ( ! FetchLoaders(filename, foldername) ) return NULL;
-       if ( ! FetchEvent(event) ) return NULL;
-       if ( ! FetchTreeD() ) return NULL;
 
-       if ( fCathode != cathode )
-       {
-               fData.ResetDigits();
-               fData.GetCathode(cathode);
-               fCathode = cathode;
-       }
-       return static_cast<AliMUONDigit*>( fData.Digits(chamber)->At(digit) );
+Int_t AliMUONDataInterface::NumberOfHits(Int_t )
+{
+/// \deprecated Method is going to be removed
+
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-Int_t AliMUONDataInterface::NumberOfRawClusters(
-               TString filename, TString foldername, Int_t event, Int_t chamber
-       )
+AliMUONHit* 
+AliMUONDataInterface::Hit(Int_t , Int_t )
 {
-// Returns the number of raw clusters in the specified file, folder, event and chamber.
-// -1 is returned or error.
+/// \deprecated Method is going to be removed
 
-       Assert( 0 <= chamber && chamber <= 13 );
-       if ( ! FetchLoaders(filename, foldername) ) return -1;
-       if ( ! FetchEvent(event) ) return -1;
-       if ( ! FetchTreeR() ) return -1;
-       if ( ! fClusterAddressSet )
-       {
-               // If the raw cluster address in TreeR is not set yet then set it now.
-               fData.SetTreeAddress("RC");
-               fData.ResetRawClusters();
-               fData.GetRawClusters();
-               fClusterAddressSet = kTRUE;
-       }
-       return fData.RawClusters(chamber)->GetEntriesFast();
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-AliMUONRawCluster* AliMUONDataInterface::RawCluster(
-               TString filename, TString foldername, Int_t event,
-               Int_t chamber, Int_t cluster
-       )
+Int_t AliMUONDataInterface::NumberOfSDigits(Int_t , Int_t )
 {
-// Fetch the specified raw cluster from the given file, folder, event and chamber number.
-// NULL is returned on error.
+/// \deprecated Method is going to be removed
 
-       Assert( 0 <= chamber && chamber <= 13 );
-       if ( ! FetchLoaders(filename, foldername) ) return NULL;
-       if ( ! FetchEvent(event) ) return NULL;
-       if ( ! FetchTreeR() ) return NULL;
-       if ( ! fClusterAddressSet )
-       {
-               // If the raw cluster address in TreeR is not set yet then set it now.
-               fData.SetTreeAddress("RC");
-               fData.ResetRawClusters();
-               fData.GetRawClusters();
-               fClusterAddressSet = kTRUE;
-       }
-       return static_cast<AliMUONRawCluster*>( fData.RawClusters(chamber)->At(cluster) );
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-Int_t AliMUONDataInterface::NumberOfLocalTriggers(TString filename, TString foldername, Int_t event)
+AliMUONDigit* AliMUONDataInterface::SDigit(Int_t , Int_t , Int_t )
 {
-// Return the number of local trigger objects in the specified file, folder and
-// event number. -1 is returned on error.
+/// \deprecated Method is going to be removed
+
+  AliFatal("Deprecated");
+  return 0;
 
-       if ( ! FetchLoaders(filename, foldername) ) return -1;
-       if ( ! FetchEvent(event) ) return -1;
-       if ( ! FetchTreeR() ) return -1;
-       if ( ! fTriggerAddressSet )
-       {
-               // If the local trigger address in TreeR is not set yet then set it now.
-               fData.SetTreeAddress("GLT");
-               fData.ResetTrigger();
-               fData.GetTrigger();
-               fTriggerAddressSet = kTRUE;
-       }
-       return fData.LocalTrigger()->GetEntriesFast();
 }
 
 
-AliMUONLocalTrigger* AliMUONDataInterface::LocalTrigger(
-               TString filename, TString foldername, Int_t event, Int_t trigger
-       )
+Int_t AliMUONDataInterface::NumberOfDigits(Int_t , Int_t )
 {
-// Fetch the specified local trigger object from the given file, folder and event number.
-// NULL is returned on error.
+/// \deprecated Method is going to be removed
+
+  AliFatal("Deprecated");
+  return 0;
 
-       if ( ! FetchLoaders(filename, foldername) ) return NULL;
-       if ( ! FetchEvent(event) ) return NULL;
-       if ( ! FetchTreeR() ) return NULL;
-       if ( ! fTriggerAddressSet )
-       {
-               // If the local trigger address in TreeR is not set yet then set it now.
-               fData.SetTreeAddress("GLT");
-               fData.ResetTrigger();
-               fData.GetTrigger();
-               fTriggerAddressSet = kTRUE;
-       }
-       return static_cast<AliMUONLocalTrigger*>( fData.LocalTrigger()->At(trigger) );
 }
 
 
-Bool_t AliMUONDataInterface::SetFile(TString filename, TString foldername)
+AliMUONDigit* AliMUONDataInterface::Digit(Int_t , Int_t , Int_t )
 {
-// Set the current file and folder from which to fetch data.
-// kTRUE is returned if the run and muon loaders were found, else kFALSE. 
+/// \deprecated Method is going to be removed
 
-       return FetchLoaders(filename, foldername);
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-Bool_t AliMUONDataInterface::GetEvent(Int_t event)
+Int_t AliMUONDataInterface::NumberOfRawClusters(Int_t )
 {
-// Select the current event from which to fetch data.
-// kTRUE is returned if the event was found, else kFALSE is returned.
+/// \deprecated Method is going to be removed
 
-       return FetchEvent(event);
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-Int_t AliMUONDataInterface::NumberOfEvents()
+AliMUONRawCluster* AliMUONDataInterface::RawCluster(Int_t , Int_t )
 {
-// Get the number of events in the currently selected file.
-// -1 is returned on error.
+/// \deprecated Method is going to be removed
 
-       if (fRunloader == NULL)
-       {
-               AliError("File not set.");
-               return -1;
-       }
-       return fRunloader->GetNumberOfEvents();
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-Int_t AliMUONDataInterface::NumberOfParticles()
+Int_t AliMUONDataInterface::NumberOfLocalTriggers()
 {
-// Get the number of particles in the current event.
-// -1 is returned on error.
+/// \deprecated Method is going to be removed
 
-       if (fRunloader == NULL)
-       {
-               AliError("File not set.");
-               return -1;
-       }
-       if ( ! FetchTreeK() ) return -1;
-       return (Int_t) fRunloader->TreeK()->GetEntriesFast();
+  AliFatal("Deprecated");
+  return 0;
 }
 
 
-TParticle* AliMUONDataInterface::Particle(Int_t particle)
+AliMUONLocalTrigger* AliMUONDataInterface::LocalTrigger(Int_t )
 {
-// Fetch the specified particle from the current event.
-// NULL is returned on error.
+/// \deprecated Method is going to be removed
 
-       if (fRunloader == NULL)
-       {
-               AliError("File not set.");
-               return NULL;
-       }
-       if (fEventnumber < 0)
-       {
-               AliError("Event not chosen.");
-               return NULL;
-       }
-       if ( ! FetchTreeK() ) return NULL;
-       TTree* treeK = fRunloader->TreeK();
-       TParticle* p = NULL;
-       treeK->GetBranch("Particles")->SetAddress(&p);
-       treeK->GetEvent(particle);
-       return p;
+  AliFatal("Deprecated");
+  return 0;
 }
 
+Int_t AliMUONDataInterface::NumberOfGlobalTriggers()
+{
+/// \deprecated Method is going to be removed
+
+  AliFatal("Deprecated");
+  return 0;
+}
 
-Int_t AliMUONDataInterface::NumberOfTracks()
+AliMUONGlobalTrigger* AliMUONDataInterface::GlobalTrigger(Int_t )
 {
-// Get the number of tracks in the current event.
-// -1 is returned on error.
-
-       if (fRunloader == NULL)
-       {
-               AliError("File not set.");
-               return -1;
-       }
-       if (fEventnumber < 0)
-       {
-               AliError( "Event not chosen.");
-               return -1;
-       }
-       if ( ! FetchTreeH() ) return -1;
-       return fData.GetNtracks();
-}
-
-
-Int_t AliMUONDataInterface::NumberOfHits(Int_t track)
-{
-// Get the number of hits for the given track in the current event.
-// -1 is returned on error.
-
-       if (fRunloader == NULL)
-       {
-               AliError("File not set.");
-               return -1;
-       }
-       if (fEventnumber < 0)
-       {
-               AliError("Event not chosen.");
-               return -1;
-       }
-       if ( ! FetchTreeH() ) return -1;
-       if (fTrack < 0 || fTrack != track)
-       {
-               fData.ResetHits();
-               fData.GetTrack(track);
-               fTrack = track;
-       }
-       return fData.Hits()->GetEntriesFast();
-}
-
-
-AliMUONHit* AliMUONDataInterface::Hit(Int_t track, Int_t hit)
-{
-// Fetch the specified hit from the current event.
-// NULL is returned on error.
-
-       if (fRunloader == NULL)
-       {
-               AliError("File not set.");
-               return NULL;
-       }
-       if (fEventnumber < 0)
-       {
-               AliError("Event not chosen.");
-               return NULL;
-       }
-       if ( ! FetchTreeH() ) return NULL;
-       if (fTrack < 0 || fTrack != track)
-       {
-               fData.ResetHits();
-               fData.GetTrack(track);
-               fTrack = track;
-       }
-       return static_cast<AliMUONHit*>( fData.Hits()->At(hit) );
-}
-
-
-Int_t AliMUONDataInterface::NumberOfSDigits(Int_t chamber, Int_t cathode)
-{
-// Get the number of s-digits on the chamber, cathode in the current event.
-// -1 is returned on error.
-
-       Assert( 0 <= chamber && chamber <= 13 );
-       Assert( 0 <= cathode && cathode <= 1 );
-       
-       if (fRunloader == NULL)
-       {
-               AliError("File not set.");
-               return -1;
-       }
-       if (fEventnumber < 0)
-       {
-               AliError("Event not chosen.");
-               return -1;
-       }
-
-       if ( ! FetchTreeS() ) return -1;
-       if ( fSCathode != cathode )
-       {
-               fData.ResetSDigits();
-               fData.GetCathodeS(cathode);
-               fSCathode = cathode;
-       }
-       return fData.SDigits(chamber)->GetEntriesFast();
-}
-
-
-AliMUONDigit* AliMUONDataInterface::SDigit(Int_t chamber, Int_t cathode, Int_t sdigit)
-{
-// Fetch the specified s-digits on the chamber, cathode from the current event.
-// NULL is returned on error.
-
-       Assert( 0 <= chamber && chamber <= 13 );
-       Assert( 0 <= cathode && cathode <= 1 );
-       
-       if (fRunloader == NULL)
-       {
-               AliError("File not set.");
-               return NULL;
-       }
-       if (fEventnumber < 0)
-       {
-               AliError("Event not chosen.");
-               return NULL;
-       }
-
-       if ( ! FetchTreeS() ) return NULL;
-       if ( fSCathode != cathode )
-       {
-               fData.ResetSDigits();
-               fData.GetCathodeS(cathode);
-               fSCathode = cathode;
-       }
-       return static_cast<AliMUONDigit*>( fData.SDigits(chamber)->At(sdigit) );
-}
-
-
-Int_t AliMUONDataInterface::NumberOfDigits(Int_t chamber, Int_t cathode)
-{
-// Get the number of digits on the chamber, cathode in the current event.
-// -1 is returned on error.
-
-       Assert( 0 <= chamber && chamber <= 13 );
-       Assert( 0 <= cathode && cathode <= 1 );
-       
-       if (fRunloader == NULL)
-       {
-               AliError("File not set.");
-               return -1;
-       }
-       if (fEventnumber < 0)
-       {
-               AliError("Event not chosen.");
-               return -1;
-       }
-       
-       if ( ! FetchTreeD() ) return -1;
-       if ( fCathode != cathode )
-       {
-               fData.ResetDigits();
-               fData.GetCathode(cathode);
-               fCathode = cathode;
-       }
-       return fData.Digits(chamber)->GetEntriesFast();
-}
-
-
-AliMUONDigit* AliMUONDataInterface::Digit(Int_t chamber, Int_t cathode, Int_t digit)
-{
-// Fetch the specified digits on the chamber, cathode from the current event.
-// NULL is returned on error.
-
-       Assert( 0 <= chamber && chamber <= 13 );
-       Assert( 0 <= cathode && cathode <= 1 );
-       
-       if (fRunloader == NULL)
-       {
-               AliError("File not set.");
-               return NULL;
-       }
-       if (fEventnumber < 0)
-       {
-               AliError("Event not chosen.");
-               return NULL;
-       }
-
-       if ( ! FetchTreeD() ) return NULL;
-       if ( fCathode != cathode )
-       {
-               fData.ResetDigits();
-               fData.GetCathode(cathode);
-               fCathode = cathode;
-       }
-       return static_cast<AliMUONDigit*>( fData.Digits(chamber)->At(digit) );
-}
-
-
-Int_t AliMUONDataInterface::NumberOfRawClusters(Int_t chamber)
-{
-// Get the number of raw clusters on the given chamber in the current event.
-// -1 is returned on error.
-
-       Assert( 0 <= chamber && chamber <= 13 );
-
-       if (fRunloader == NULL)
-       {
-               AliError("File not set.");
-               return -1;
-       }
-       if (fEventnumber < 0)
-       {
-               AliError("Event not chosen.");
-               return -1;
-       }
-
-       if ( ! FetchTreeR() ) return -1;
-       if ( ! fClusterAddressSet )
-       {
-               fData.SetTreeAddress("RC");
-               fData.ResetRawClusters();
-               fData.GetRawClusters();
-               fClusterAddressSet = kTRUE;
-       }
-       return fData.RawClusters(chamber)->GetEntriesFast();
-}
-
-
-AliMUONRawCluster* AliMUONDataInterface::RawCluster(Int_t chamber, Int_t cluster)
-{
-// Fetch the specified raw cluster on the given chamber from the current event.
-// NULL is returned on error.
-
-       Assert( 0 <= chamber && chamber <= 13 );
-
-       if (fRunloader == NULL)
-       {
-               AliError("File not set.");
-               return NULL;
-       }
-       if (fEventnumber < 0)
-       {
-               AliError("Event not chosen.");
-               return NULL;
-       }
-
-       if ( ! FetchTreeR() ) return NULL;
-       if ( ! fClusterAddressSet )
-       {
-               fData.SetTreeAddress("RC");
-               fData.ResetRawClusters();
-               fData.GetRawClusters();
-               fClusterAddressSet = kTRUE;
-       }
-       return static_cast<AliMUONRawCluster*>( fData.RawClusters(chamber)->At(cluster) );
+/// \deprecated Method is going to be removed
+
+  AliFatal("Deprecated");
+  return 0;
 }
 
+Int_t AliMUONDataInterface::NumberOfRecTracks()
+{
+/// \deprecated Method is going to be removed
 
-Int_t AliMUONDataInterface::NumberOfLocalTriggers()
+  AliFatal("Deprecated");
+  return 0;
+}
+
+AliMUONTrack* AliMUONDataInterface::RecTrack(Int_t )
 {
-// Get the number of local trigger objects in the current event.
-// -1 is returned on error.
-
-       if (fRunloader == NULL)
-       {
-               AliError("File not set.");
-               return -1;
-       }
-       if (fEventnumber < 0)
-       {
-               AliError("Event not chosen.");
-               return -1;
-       }
-
-       if ( ! FetchTreeR() ) return -1;
-       if ( ! fTriggerAddressSet )
-       {
-               fData.SetTreeAddress("GLT");
-               fData.ResetTrigger();
-               fData.GetTrigger();
-               fTriggerAddressSet = kTRUE;
-       }
-       return fData.LocalTrigger()->GetEntriesFast();
-}
-
-
-AliMUONLocalTrigger* AliMUONDataInterface::LocalTrigger(Int_t trigger)
-{
-// Fetch the specified local trigger object from the current event.
-// NULL is returned on error.
-
-       if (fRunloader == NULL)
-       {
-               AliError("File not set.");
-               return NULL;
-       }
-       if (fEventnumber < 0)
-       {
-               AliError( "Event not chosen.");
-               return NULL;
-       }
-
-       if ( ! FetchTreeR() ) return NULL;
-       if ( ! fTriggerAddressSet )
-       {
-               fData.SetTreeAddress("GLT");
-               fData.ResetTrigger();
-               fData.GetTrigger();
-               fTriggerAddressSet = kTRUE;
-       }
-       return static_cast<AliMUONLocalTrigger*>( fData.LocalTrigger()->At(trigger) );
+/// \deprecated Method is going to be removed
+
+  AliFatal("Deprecated");
+  return 0;
 }