]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUON.cxx
Coding rule violations fixed.
[u/mrichter/AliRoot.git] / MUON / AliMUON.cxx
index e02164ecfb68e17d21bbc93c5c2babbf5d006603..3cf30d3cd866acbb6d6484ce3f66925168cb4cbc 100644 (file)
 
 /* $Id$ */
 
-
-///////////////////////////////////////////////
-//  Manager and hits classes for set:MUON     //
-////////////////////////////////////////////////
+//-----------------------------------------------------------------------------
+// Class AliMUON
+// ------------------
+// AliDetector class for MUON subsystem 
+// providing simulation data management 
+//-----------------------------------------------------------------------------
 
 #include "Riostream.h"
 
 
 //#include "AliHeader.h"
 #include "AliLoader.h"
+#include "AliCDBManager.h"
 #include "AliRunDigitizer.h"
 #include "AliMC.h"
-#include "AliRun.h"    
+#include "AliRun.h"
+#include "AliRawDataHeaderSim.h"
 #include "AliMUON.h"
 #include "AliMUONChamberTrigger.h"
 #include "AliMUONConstants.h"
 #include "AliMUONHit.h"        
-#include "AliMUONRawCluster.h"
-#include "AliMUONTransientDigit.h"
-#include "AliMUONTriggerCircuit.h"
 #include "AliMUONGeometry.h"
 #include "AliMUONGeometryTransformer.h"
 #include "AliMUONGeometryBuilder.h"
 #include "AliMUONCommonGeometryBuilder.h"
 #include "AliMUONVGeometryBuilder.h"   
-#include "AliMUONGeometrySegmentation.h"
-#include "AliMUONDigitizerv2.h"
-#include "AliMUONSDigitizerv1.h"
 #include "AliMUONRawWriter.h"
-#include "AliMUONSegmentation.h"
 #include "AliLog.h"
 
 #include "AliMUONSDigitizerV2.h"
 #include "AliMUONDigitizerV3.h"
+#include "AliMUONDigitMaker.h"
+#include "AliMUONCalibrationData.h"
+
+#include "AliMUONSt1GeometryBuilderV2.h"
+#include "AliMUONSt2GeometryBuilderV2.h"
+#include "AliMUONSlatGeometryBuilder.h"
+#include "AliMUONTriggerGeometryBuilder.h"
+
+#include "AliMUONDigitStoreV1.h"
+#include "AliMUONVTriggerStore.h"
+#include "AliMUONHitStoreV1.h"
 
 // Defaults parameters for Z positions of chambers
 // taken from values for "stations" in AliMUON::AliMUON
 //          according to (Z1 = zch) and  (Z2 = zch + DTPLANES)
 //          for the first and second chambers in the station, respectively
 
-ClassImp(AliMUON)
+/// \cond CLASSIMP
+ClassImp(AliMUON)  
+/// \endcond
 
 //__________________________________________________________________
 AliMUON::AliMUON()
   : AliDetector(),
     fNCh(0),
     fNTrackingCh(0),
-    fMUONData(0),
     fSplitLevel(0),
     fChambers(0),
-    fTriggerCircuits(0),
     fGeometryBuilder(0),
-    fSegmentation(0),
     fAccCut(kFALSE),
     fAccMin(0.),
     fAccMax(0.),   
@@ -109,28 +116,31 @@ AliMUON::AliMUON()
     fMaxIterPad(0),
     fCurIterPad(0),
     fTriggerScalerEvent(kFALSE),
-    fSDigitizerType(""),
-    fDigitizerType("")
-{
-// Default Constructor
-//
-       AliDebug(1,Form("default (empty) ctor this=%p",this));
+    fTriggerResponseV1(kFALSE),
+    fTriggerCoinc44(0),
+    fTriggerEffCells(0),
+    fDigitizerWithNoise(1),
+    fIsTailEffect(kTRUE),
+    fRawWriter(0x0),
+    fDigitMaker(0x0),
+    fHitStore(0x0),
+    fDigitStoreConcreteClassName(),
+    fCalibrationData(0x0)
+{
+/// Default Constructor
+    
+    AliDebug(1,Form("default (empty) ctor this=%p",this));
     fIshunt          = 0;
 }
 
 //__________________________________________________________________
-AliMUON::AliMUON(const char *name, const char *title,
-                 const char* sDigitizerClassName,
-                 const char* digitizerClassName)
-  : AliDetector(name,title),
+AliMUON::AliMUON(const char *name, const char* title)
+  : AliDetector(name, title),
     fNCh(AliMUONConstants::NCh()),
     fNTrackingCh(AliMUONConstants::NTrackingCh()),
-    fMUONData(0),
     fSplitLevel(0),
     fChambers(0),
-    fTriggerCircuits(0),
     fGeometryBuilder(0),
-    fSegmentation(0),
     fAccCut(kFALSE),
     fAccMin(0.),
     fAccMax(0.),   
@@ -140,14 +150,25 @@ AliMUON::AliMUON(const char *name, const char *title,
     fMaxDestepAlu(-1), // in the calculation of the tracking parameters
     fMaxIterPad(0),
     fCurIterPad(0),
-         fTriggerScalerEvent(kFALSE),
-    fSDigitizerType(sDigitizerClassName),
-    fDigitizerType(digitizerClassName)
-{
-       AliDebug(1,Form("ctor this=%p",this));
+    fTriggerScalerEvent(kFALSE),
+    fTriggerResponseV1(kFALSE),
+    fTriggerCoinc44(0),
+    fTriggerEffCells(0),
+    fDigitizerWithNoise(1),
+    fIsTailEffect(kTRUE),
+    fRawWriter(0x0),
+    fDigitMaker(new AliMUONDigitMaker),
+    fHitStore(0x0),
+    fDigitStoreConcreteClassName("AliMUONDigitStoreV2S"),
+    fCalibrationData()
+
+{
+  /// Standard constructor  
+  
+  AliDebug(1,Form("ctor this=%p",this));
   fIshunt =  0;
-
-  SetMarkerColor(kRed);//
+  
+  //PH SetMarkerColor(kRed);//
     
   // Geometry builder
   fGeometryBuilder = new AliMUONGeometryBuilder(this);
@@ -155,12 +176,22 @@ AliMUON::AliMUON(const char *name, const char *title,
   // Common geometry definitions
   fGeometryBuilder
     ->AddBuilder(new AliMUONCommonGeometryBuilder(this));
-
-//
-// Creating List of Chambers
+  
+  // By default, add also all the needed geometry builders.
+  // If you want to change this from outside, please use ResetGeometryBuilder
+  // method, followed by AddGeometryBuilder ones.
+  
+  AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(this));
+  AddGeometryBuilder(new AliMUONSt2GeometryBuilderV2(this));
+  AddGeometryBuilder(new AliMUONSlatGeometryBuilder(this));
+  AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(this));
+  
+  //
+  // Creating List of Chambers
     Int_t ch;
     fChambers = new TObjArray(AliMUONConstants::NCh());
-
+    fChambers->SetOwner(kTRUE);
+    
     // Loop over stations
     for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) {
       // Loop over 2 chambers in the station
@@ -176,60 +207,30 @@ AliMUON::AliMUON(const char *name, const char *title,
        }
       } // Chamber stCH (0, 1) in 
     }     // Station st (0...)
-    
-    // cp new design of AliMUONTriggerDecision
-    fTriggerCircuits = new TObjArray(AliMUONConstants::NTriggerCircuit());
-    for (Int_t circ=0; circ<AliMUONConstants::NTriggerCircuit(); circ++) {
-      fTriggerCircuits->AddAt(new AliMUONTriggerCircuit(),circ);          
-    }
-}
-
-//____________________________________________________________________
-AliMUON::AliMUON(const AliMUON& rMUON)
- : AliDetector(rMUON)
-{
-// Protected copy constructor
-
-  AliFatal("Not implemented.");
+  
+  Int_t runnumber = AliCDBManager::Instance()->GetRun();
+  
+  fCalibrationData = new AliMUONCalibrationData(runnumber);
 }
 
 //____________________________________________________________________
 AliMUON::~AliMUON()
 {
-// Destructor
-  AliDebug(1,Form("dtor this=%p",this));
-  fIshunt  = 0;
+/// Destructor
 
-  if (fChambers){
-    fChambers->Delete();
-    delete fChambers;
-  }
-  if (fTriggerCircuits){
-    fTriggerCircuits->Delete();
-    delete fTriggerCircuits;
-  }
-  delete fMUONData;
+  AliDebug(1,Form("dtor this=%p",this));
+  delete fChambers;
   delete fGeometryBuilder;
-  delete fSegmentation;
-}
-
-//________________________________________________________________________
-AliMUON& AliMUON::operator = (const AliMUON& rhs)
-{
-// Protected assignement operator
-
-  if (this == &rhs) return *this;
-
-  AliFatal("Not implemented.");
-    
-  return *this;  
+  delete fRawWriter;
+  delete fDigitMaker;
+  delete fHitStore;
+  delete fCalibrationData;
 }
 
 //_____________________________________________________________________________
 void AliMUON::AddGeometryBuilder(AliMUONVGeometryBuilder* geomBuilder)
 {
-// Adds the geometry builder to the list
-// ---
+/// Add the geometry builder to the list
 
   fGeometryBuilder->AddBuilder(geomBuilder);
 }
@@ -237,7 +238,7 @@ void AliMUON::AddGeometryBuilder(AliMUONVGeometryBuilder* geomBuilder)
 //____________________________________________________________________
 void AliMUON::BuildGeometry()
 {
-// Geometry for event display
+/// Geometry for event display
 
 
 //     for (Int_t i = 0; i < AliMUONConstants::NCh(); i++)     
@@ -249,7 +250,7 @@ void AliMUON::BuildGeometry()
 //____________________________________________________________________
 const AliMUONGeometry*  AliMUON::GetGeometry() const
 {
-// Return geometry parametrisation
+/// Return geometry parametrisation
 
   if ( !fGeometryBuilder) {
     AliWarningStream() << "GeometryBuilder not defined." << std::endl;
@@ -262,7 +263,7 @@ const AliMUONGeometry*  AliMUON::GetGeometry() const
 //____________________________________________________________________
 const AliMUONGeometryTransformer*  AliMUON::GetGeometryTransformer() const
 {
-// Return geometry parametrisation
+/// Return geometry parametrisation
 
   const AliMUONGeometry* kGeometry = GetGeometry();
   
@@ -272,26 +273,75 @@ const AliMUONGeometryTransformer*  AliMUON::GetGeometryTransformer() const
 }   
 
 //__________________________________________________________________
-void  AliMUON::SetTreeAddress()
+void 
+AliMUON::MakeBranch(Option_t* opt)
 {
-  GetMUONData()->SetLoader(fLoader); 
-  //  GetMUONData()->MakeBranch("D,S,RC");
-  //  GetMUONData()->SetTreeAddress("H,D,S,RC");
-  GetMUONData()->SetTreeAddress("H");
-  if (fHits !=  GetMUONData()->Hits())  {
+  /// Create branche(s) to hold MUON hits
+  AliDebug(1,"");
+  
+  TString sopt(opt);
+  if ( sopt != "H" ) return;
+    
+  if (!fHitStore)
+  {
+    fHitStore = new AliMUONHitStoreV1;
     if ( gAlice->GetMCApp() )
-      if ( gAlice->GetMCApp()->GetHitLists() ) {
-       fHits = GetMUONData()->Hits();
-       gAlice->GetMCApp()->AddHitList(fHits); // For purifyKine, only necessary when Hit list is created in AliMUONData
+    {
+      if ( gAlice->GetMCApp()->GetHitLists() ) 
+      {
+        // AliStack::PurifyKine needs to be able to loop on our hits
+        // to remap the track numbers.
+        gAlice->GetMCApp()->AddHitList(fHitStore->Collection()); 
       }  
+    }
   }
-  fHits = GetMUONData()->Hits(); // Added by Ivana to use the methods FisrtHit, NextHit of AliDetector    
+
+  TTree* treeH = fLoader->TreeH();
+  
+  if (!treeH)
+  {
+    AliFatal("No TreeH");
+  }
+  
+  fHitStore->Connect(*treeH);
+}
+
+//__________________________________________________________________
+void  
+AliMUON::SetTreeAddress()
+{
+  /// Set Hits tree address  
+//  if ( gAlice->GetMCApp() && fHitStore )
+//  {
+//    TList* l = gAlice->GetMCApp()->GetHitLists();
+//    if ( l )
+//    {
+//      TObject* o = l->First();
+//      if (o!=fHitStore->HitCollection())
+//      {
+//        AliError(Form("Something is strange hitcollection=%x",fHitStore->HitCollection()));
+//        l->Print();        
+//      }
+//    }  
+//  }  
+}
+
+//_________________________________________________________________
+void
+AliMUON::ResetHits()
+{
+  /// Reset hits
+  
+  AliDebug(1,"");
+  if (fHitStore) fHitStore->Clear();
 }
 
 //_________________________________________________________________
 void AliMUON::SetChargeSlope(Int_t id, Float_t p1)
 {
-// Set the inverse charge slope for chamber id
+/// Set the inverse charge slope for chamber id
+
     Int_t i=2*(id-1);    //PH    ((AliMUONChamber*) (*fChambers)[i])->SetSigmaIntegration(p1);
     //PH    ((AliMUONChamber*) (*fChambers)[i+1])->SetSigmaIntegration(p1);
     ((AliMUONChamber*) fChambers->At(i))->SetChargeSlope(p1);
@@ -300,7 +350,8 @@ void AliMUON::SetChargeSlope(Int_t id, Float_t p1)
 //__________________________________________________________________
 void AliMUON::SetChargeSpread(Int_t id, Float_t p1, Float_t p2)
 {
-// Set sigma of charge spread for chamber id
+/// Set sigma of charge spread for chamber id
+
     Int_t i=2*(id-1);
     ((AliMUONChamber*) fChambers->At(i))->SetChargeSpread(p1,p2);
     ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSpread(p1,p2);
@@ -308,7 +359,7 @@ void AliMUON::SetChargeSpread(Int_t id, Float_t p1, Float_t p2)
 //___________________________________________________________________
 void AliMUON::SetSigmaIntegration(Int_t id, Float_t p1)
 {
-// Set integration limits for charge spread
+/// Set integration limits for charge spread
     Int_t i=2*(id-1);
     ((AliMUONChamber*) fChambers->At(i))->SetSigmaIntegration(p1);
     ((AliMUONChamber*) fChambers->At(i+1))->SetSigmaIntegration(p1);
@@ -317,7 +368,8 @@ void AliMUON::SetSigmaIntegration(Int_t id, Float_t p1)
 //__________________________________________________________________
 void AliMUON::SetMaxAdc(Int_t id, Int_t p1)
 {
-// Set maximum number for ADCcounts (saturation)
+/// Set maximum number for ADCcounts (saturation)
+
     Int_t i=2*(id-1);
     ((AliMUONChamber*) fChambers->At(i))->SetMaxAdc(p1);
     ((AliMUONChamber*) fChambers->At(i+1))->SetMaxAdc(p1);
@@ -326,32 +378,36 @@ void AliMUON::SetMaxAdc(Int_t id, Int_t p1)
 //__________________________________________________________________
 void AliMUON::SetMaxStepGas(Float_t p1)
 {
-// Set stepsize in gas
+/// Set stepsize in gas
+
   fMaxStepGas=p1;
 }
 //__________________________________________________________________
 void AliMUON::SetMaxStepAlu(Float_t p1)
 {
-// Set step size in Alu
+/// Set step size in Alu
+
     fMaxStepAlu=p1;
 }
 //__________________________________________________________________
 void AliMUON::SetMaxDestepGas(Float_t p1)
 {
-// Set maximum step size in Gas
+/// Set maximum step size in Gas
+
     fMaxDestepGas=p1;
 }
 //__________________________________________________________________
 void AliMUON::SetMaxDestepAlu(Float_t p1)
 {
-// Set maximum step size in Alu
+/// Set maximum step size in Alu
+
   fMaxDestepAlu=p1;
 }
 
 //____________________________________________________________________
 Float_t  AliMUON::GetMaxStepGas() const
 {
-// Return stepsize in gas
+/// Return stepsize in gas
   
   return fMaxStepGas;
 }  
@@ -359,7 +415,7 @@ Float_t  AliMUON::GetMaxStepGas() const
 //____________________________________________________________________
 Float_t  AliMUON::GetMaxStepAlu() const
 {
-// Return step size in Alu
+/// Return step size in Alu
   
   return fMaxStepAlu;
 }
@@ -367,7 +423,7 @@ Float_t  AliMUON::GetMaxStepAlu() const
 //____________________________________________________________________
 Float_t  AliMUON::GetMaxDestepGas() const
 {
-// Return maximum step size in Gas
+/// Return maximum step size in Gas
   
   return fMaxDestepGas;
 }
@@ -375,7 +431,7 @@ Float_t  AliMUON::GetMaxDestepGas() const
 //____________________________________________________________________
 Float_t  AliMUON::GetMaxDestepAlu() const
 {
-// Return maximum step size in Gas
+/// Return maximum step size in Gas
   
   return fMaxDestepAlu;
 }
@@ -383,7 +439,7 @@ Float_t  AliMUON::GetMaxDestepAlu() const
 //____________________________________________________________________
  void  AliMUON::SetAlign(Bool_t align)
 {
- // Sets option for alignement to geometry builder
+/// Set option for alignement to geometry builder
  
    fGeometryBuilder->SetAlign(align);
 }   
@@ -391,56 +447,32 @@ Float_t  AliMUON::GetMaxDestepAlu() const
 //____________________________________________________________________
  void  AliMUON::SetAlign(const TString& fileName, Bool_t align)
 {
- // Sets option for alignement to geometry builder
+/// Set option for alignement to geometry builder
  
    fGeometryBuilder->SetAlign(fileName, align);
 }   
 
 //____________________________________________________________________
-void   AliMUON::SetResponseModel(Int_t id, AliMUONResponse *response)
+void   AliMUON::SetResponseModel(Int_t id, const AliMUONResponse& response)
 {
-// Set the response for chamber id
+/// Set the response for chamber id
     ((AliMUONChamber*) fChambers->At(id))->SetResponseModel(response);
 }
+
 //____________________________________________________________________
 AliDigitizer* AliMUON::CreateDigitizer(AliRunDigitizer* manager) const
 {
-  // FIXME: the selection of the class should be done through a factory
-  // mechanism. (see also Hits2SDigits()).
+/// Return digitizer
   
-  AliInfo(Form("Digitizer used : %s",fDigitizerType.Data()));
-  
-  if ( fDigitizerType == "digitizer:default" )
-  {
-    return new AliMUONDigitizerv2(manager);
-  }
-  else if ( fDigitizerType == "digitizer:NewDigitizerNewTrigger" ) 
-  {
-    return new AliMUONDigitizerV3(manager,AliMUONDigitizerV3::kTriggerElectronics);
-  }
-  else if ( fDigitizerType == "digitizer:NewDigitizerOldTrigger" )
-  {
-    return new AliMUONDigitizerV3(manager,AliMUONDigitizerV3::kTriggerDecision);
-  }
-  else
-  {
-    AliFatal(Form("Unknown digitizer type : %s",fDigitizerType.Data()));
-  }
-  return 0x0;
-}
-
-//_____________________________________________________________________
-TString
-AliMUON::SDigitizerType() const
-{
-  return fSDigitizerType;
+  AliMUONDigitizerV3* digitizer = new AliMUONDigitizerV3(manager, fDigitizerWithNoise);
+  digitizer->SetCalibrationData(fCalibrationData);
+  return digitizer;
 }
 
 //_____________________________________________________________________
 void AliMUON::SDigits2Digits()
 {
-
-// write TreeD here 
+/// Write TreeD here only 
 
     char hname[30];
     //    sprintf(hname,"TreeD%d",fLoader->GetHeader()->GetEvent());
@@ -451,86 +483,201 @@ void AliMUON::SDigits2Digits()
 //_____________________________________________________________________
 void AliMUON::Hits2SDigits()
 {
-  // FIXME: the selection of the sdigitizer should be done through a
-  // factory mechanism.
+/// Perform Hits2Digits using SDigitizerV2
   
-  AliInfo(Form("SDigitizer used : %s",fSDigitizerType.Data()));
+  AliMUONSDigitizerV2 sdigitizer;
+  sdigitizer.ExecuteTask();
+}
+
+//_____________________________________________________________________
+void AliMUON::Digits2Raw()
+{
+/// Convert digits of the current event to raw data
+
+  AliRawDataHeaderSim header;
 
-  if ( fSDigitizerType == "sdigitizer:default" )
+  if (!fRawWriter)
   {
-    // Adaption of AliMUONSDigitizerv1 to be excuted by the AliSimulation framework
-    AliRunLoader* runLoader = fLoader->GetRunLoader();
-    AliRunDigitizer   * manager = new AliRunDigitizer(1,1);
-    manager->SetInputStream(0,runLoader->GetFileName(),AliConfig::GetDefaultEventFolderName());
-    AliMUONDigitizer * dMUON   = new AliMUONSDigitizerv1(manager);
-    fLoader->LoadHits("READ");
-    for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++) {
-      runLoader->GetEvent(iEvent);
-      dMUON->Exec("");
+    fRawWriter = new AliMUONRawWriter;
+    AliDebug(1,Form("Creating %s",fRawWriter->ClassName()));
+    if (fTriggerScalerEvent == kTRUE) 
+    {
+      fRawWriter->SetScalersNumbers();
     }
-    fLoader->UnloadHits();
   }
-  else if ( fSDigitizerType == "sdigitizer:AliMUONSDigitizerV2" )
+  
+  fLoader->LoadDigits("READ");
+  
+  TTree* treeD = fLoader->TreeD();
+  
+  if (!treeD)
   {
-    TTask* sdigitizer = new AliMUONSDigitizerV2;
-    sdigitizer->ExecuteTask();
+    AliError("Could not get TreeD");
+    return;
   }
-  else
+  
+  AliMUONVTriggerStore*  triggerStore = AliMUONVTriggerStore::Create(*treeD);
+  AliMUONVDigitStore* digitStore = AliMUONVDigitStore::Create(*treeD);
+
+  triggerStore->Connect(*treeD,kFALSE);
+  digitStore->Connect(*treeD,kFALSE);
+  
+  treeD->GetEvent(0);
+  
+  fRawWriter->SetHeader(header);
+  if (!fRawWriter->Digits2Raw(digitStore,triggerStore))
   {
-    AliFatal(Form("Unknown sdigitizer classname : %s",fSDigitizerType.Data()));
+    AliError("pb writting raw data");
   }
+  
+  delete triggerStore;
+  delete digitStore;
+  
+  fLoader->UnloadDigits();
 }
 
 //_____________________________________________________________________
-TString
-AliMUON::DigitizerType() const
+Bool_t AliMUON::Raw2SDigits(AliRawReader* rawReader)
 {
-  return fDigitizerType;
-}
+/// Convert  raw data to SDigit
 
-//_____________________________________________________________________
-void AliMUON::Digits2Raw()
-{
-  // convert digits of the current event to raw data
-  AliMUONRawWriter rawData(fLoader,fMUONData);
+  fLoader->LoadDigits("READ");
+  if (!fLoader->TreeS()) fLoader->MakeSDigitsContainer();
+
+  TTree* treeS = fLoader->TreeS();
+  
+  AliMUONVDigitStore* sDigitStore = new AliMUONDigitStoreV1;
+  sDigitStore->Connect(*treeS);
+  
+  fDigitMaker->Raw2Digits(rawReader,sDigitStore,0x0);
+
+  fLoader->WriteSDigits("OVERWRITE");
 
-  if (fTriggerScalerEvent == kTRUE) rawData.SetScalerEvent();
-  if (!rawData.Digits2Raw()) AliInfo("pb writting raw data");
+  fLoader->UnloadSDigits();
+
+  delete sDigitStore;
+  
+  return kTRUE;
 }
 
 //_______________________________________________________________________
 AliLoader* AliMUON::MakeLoader(const char* topfoldername)
 { 
-//builds standard getter (AliLoader type)
-//if detector wants to use castomized getter, it must overload this method
-
+/// Build standard getter (AliLoader type);
+/// if detector wants to use castomized getter, it must overload this method
  
  AliDebug(1,Form("Creating standard getter for detector %s. Top folder is %s.",
          GetName(),topfoldername));
  fLoader   = new AliLoader(GetName(),topfoldername);
- fMUONData = new AliMUONData(fLoader,GetName(),GetName()); 
- fMUONData->SetSplitLevel(fSplitLevel);
+
  return fLoader;
 }
-//_______________________________________________________________________
 
-AliMUONRawCluster *AliMUON::RawCluster(Int_t ichamber, Int_t icathod, Int_t icluster)
-{
-//
-//  Return rawcluster (icluster) for chamber ichamber and cathode icathod
-//  Obsolete ??
-    TClonesArray *muonRawCluster  = GetMUONData()->RawClusters(ichamber);
-    ResetRawClusters();
-    TTree *treeR = fLoader->TreeR();
-    Int_t nent=(Int_t)treeR->GetEntries();
-    treeR->GetEvent(nent-2+icathod-1);
-    //treeR->GetEvent(icathod);
-    //Int_t nrawcl = (Int_t)muonRawCluster->GetEntriesFast();
-
-    AliMUONRawCluster * mRaw = (AliMUONRawCluster*)muonRawCluster->UncheckedAt(icluster);
-    //printf("RawCluster _ nent nrawcl icluster mRaw %d %d %d%p\n",nent,nrawcl,icluster,mRaw);
+//________________________________________________________________________
+void
+AliMUON::ResetGeometryBuilder()
+{
+/// Only to be used by "experts" wanting to change the geometry builders
+/// to be used. 
+/// As the ctor of AliMUON now defines a default geometrybuilder, this
+/// ResetGeometryBuilder() must be called prior to call the 
+/// AddGeometryBuilder()
+
+  delete fGeometryBuilder;
+  fGeometryBuilder = new AliMUONGeometryBuilder(this);
+  fGeometryBuilder
+    ->AddBuilder(new AliMUONCommonGeometryBuilder(this));
+}
+
+//____________________________________________________________________
+Bool_t  AliMUON::GetTriggerResponseV1() const
+{
+///
+/// Returns fTriggerResponseV1
+///  
+    return fTriggerResponseV1;
+    
+}  
+
+//____________________________________________________________________
+Int_t  AliMUON::GetTriggerCoinc44() const
+{
+///
+/// Returns fTriggerCoinc44
+///  
+    return fTriggerCoinc44;
+    
+}
+
+//____________________________________________________________________
+Bool_t  AliMUON::GetTriggerEffCells() const
+{
+///
+/// Returns fTriggerEffCells
+///  
+    return fTriggerEffCells;
+    
+}  
+
+//____________________________________________________________________
+Int_t  AliMUON::GetDigitizerWithNoise() const
+{
+///
+/// Returns fDigitizerWithNoise
+///  
+    return fDigitizerWithNoise;
     
-    return  mRaw;
+}  
+
+//____________________________________________________________________
+Bool_t AliMUON::UsingFastTrackerDecoder() const
+{
+/// Checks to see if we are using the fast decoder for tracker DDL streams.
+
+  if ( ! fDigitMaker ) {
+    AliError("Digit maker is not instantiated.");
+    return kFALSE;
+  }
+  
+  return fDigitMaker->UsingFastTrackerDecoder();
+}
+
+//____________________________________________________________________
+Bool_t AliMUON::UsingFastTriggerDecoder() const
+{
+/// Checks to see if we are using the fast decoder for trigger DDL streams.
+
+  if ( ! fDigitMaker ) {
+    AliError("Digit maker is not instantiated.");
+    return kFALSE;
+  }
+  
+  return fDigitMaker->UsingFastTriggerDecoder();
+}
+
+//____________________________________________________________________
+void AliMUON::SetFastTrackerDecoder(Bool_t useFastDecoder)
+{
+/// Set fast raw data decoder 
+
+  if ( ! fDigitMaker ) {
+    AliError("Digit maker is not instantiated.");
+    return;
+  }
+
+  fDigitMaker->SetFastTrackerDecoder(useFastDecoder);
+}
+
+//____________________________________________________________________
+void AliMUON::SetFastTriggerDecoder(Bool_t useFastDecoder)
+{
+/// Set fast raw data decoder 
+
+  if ( ! fDigitMaker ) {
+    AliError("Digit maker is not instantiated.");
+    return;
+  }
+
+  fDigitMaker->SetFastTriggerDecoder(useFastDecoder);
 }
-//________________________________________________________________________