]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONDigitizer.cxx
From Artur:
[u/mrichter/AliRoot.git] / MUON / AliMUONDigitizer.cxx
index 462c012e9b28faccec8af0437a44bb02da9c7504..95d24d58f949c180089296a0af62f619197e7a7e 100644 (file)
@@ -54,8 +54,7 @@ AliMUONDigitizer::AliMUONDigitizer() :
        fTDList(0),
        fTDCounter(0),
        fMask(0),
-       fSignal(0),
-       fDebug(0)
+       fSignal(0)
 {
 // Default constructor.
 // Initializes all pointers to NULL.
@@ -74,8 +73,7 @@ AliMUONDigitizer::AliMUONDigitizer(AliRunDigitizer* manager) :
        fTDList(0),
        fTDCounter(0),
        fMask(0),
-       fSignal(0),
-       fDebug(0)
+       fSignal(0)
 {
 // Constructor which should be used rather than the default constructor.
 // Initializes all pointers to NULL.
@@ -119,16 +117,6 @@ AliMUONDigitizer::operator=(const AliMUONDigitizer& rhs)
     
   return *this;  
 }    
-
-//------------------------------------------------------------------------
-void AliMUONDigitizer::CheckSegmentation()
-{
-  if (fMUON->WhichSegmentation()==1) {
-      AliFatal("Old Segmentation no more supported.");
-      return;
-  }
-
-}
          
 //------------------------------------------------------------------------
 Bool_t AliMUONDigitizer::Init()
@@ -138,7 +126,7 @@ Bool_t AliMUONDigitizer::Init()
 }
 
 //------------------------------------------------------------------------
-void AliMUONDigitizer::Exec(Option_t* option)
+void AliMUONDigitizer::Exec(Option_t* /*option*/)
 {
 // The main work loop starts here. 
 // The digitization process is broken up into two steps: 
@@ -148,7 +136,6 @@ void AliMUONDigitizer::Exec(Option_t* option)
 //    stream. Done in CreateDigits()
 
        AliDebug(1, "Running digitiser.");
-       ParseOptions(option);
 
        if (fManager->GetNinputs() == 0)
        {
@@ -259,8 +246,10 @@ void AliMUONDigitizer::AddTransientDigit(AliMUONTransientDigit* mTD)
        Int_t iNchCpl= fNDetElemId[detElemId] + (mTD->Cathode()-1) * AliMUONConstants::NDetElem();
 
        fTDList->AddAtAndExpand(mTD, fTDCounter);
-       fHitMap[iNchCpl]->SetHit( mTD->PadX(), mTD->PadY(), fTDCounter);
-       fTDCounter++;
+       if (iNchCpl>-1 && iNchCpl<2*AliMUONConstants::NDetElem()) {
+         fHitMap[iNchCpl]->SetHit( mTD->PadX(), mTD->PadY(), fTDCounter);
+         fTDCounter++;
+       }
 }
 
 //------------------------------------------------------------------------
@@ -276,7 +265,9 @@ Bool_t AliMUONDigitizer::ExistTransientDigit(AliMUONTransientDigit* mTD)
        Int_t iNchCpl= fNDetElemId[detElemId] + (mTD->Cathode()-1) *AliMUONConstants::NDetElem() ;
 
        //      Int_t iNchCpl= mTD->Chamber() + (mTD->Cathode()-1) * AliMUONConstants::NCh();
-       return( fHitMap[iNchCpl]->TestHit(mTD->PadX(), mTD->PadY()) );
+       if (iNchCpl>-1 && iNchCpl<2*AliMUONConstants::NDetElem())
+         return( fHitMap[iNchCpl]->TestHit(mTD->PadX(), mTD->PadY()) );
+       else return kFALSE;
 }
 
 //-----------------------------------------------------------------------
@@ -475,26 +466,6 @@ Bool_t  AliMUONDigitizer::FetchTriggerPointer(AliMUONLoader* loader)
   
   return kTRUE;
 }
-//------------------------------------------------------------------------
-void AliMUONDigitizer::ParseOptions(Option_t* options)
-{
-// Called by the Exec method. ParseOptions should parse the option string given to the Exec method.
-// 
-// The following options are defined:
-//     "debug" - Sets the debug level to 99, which will show all debug messages.
-//     "deb"   - Same as "debug", implemented for backward comparability.
-//
-// If an invalid option is specified it is simply ignored.
-
-       TString optionString = options;
-       if (optionString.Data() == "debug" || 
-               optionString.Data() == "deb"   // maintained for compatability.
-          )
-       {
-               AliInfo("Called with option \"debug\".");
-               SetDebug(99);
-       }
-}
 
 //------------------------------------------------------------------------
 void AliMUONDigitizer::InitArrays()
@@ -506,12 +477,6 @@ void AliMUONDigitizer::InitArrays()
 //
 // Note: the fTDList and fHitMap arrays must be NULL before calling this method.
 
-    AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON");
-    if (!muon) {
-      AliFatal("MUON detector not defined.");
-      return;
-    }  
-
     AliDebug(2, "Initialising internal arrays.");
     AliDebug(4, "Creating transient digits list.");
     fTDList = new TObjArray;
@@ -519,7 +484,7 @@ void AliMUONDigitizer::InitArrays()
     // Array of pointer of the AliMUONHitMapA1:
     //  two HitMaps per chamber, or one HitMap per cahtode plane
     fHitMap = new AliMUONHitMapA1* [2*AliMUONConstants::NDetElem()];
-    CheckSegmentation(); // check it one for all
+    for (Int_t i=0; i<2*AliMUONConstants::NDetElem(); i++) fHitMap[i] = 0x0;
 
     Int_t k = 0;
     Int_t idDE;
@@ -533,7 +498,7 @@ void AliMUONDigitizer::InitArrays()
       AliDebug(4,Form( "Creating hit map for chamber %d, cathode 2.", i+1));
       AliMUONGeometrySegmentation* c2Segmentation = chamber->SegmentationModel2(2); // Cathode plane 2
 
-      AliMUONGeometryModule* geometry    = muon->Chamber(i).GetGeometry();
+      AliMUONGeometryModule* geometry    = fMUON->Chamber(i).GetGeometry();
       AliMUONGeometryStore*  detElements = geometry->GetDetElementStore();