]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONDigitizer.cxx
Cosmetics (Chrsitian)
[u/mrichter/AliRoot.git] / MUON / AliMUONDigitizer.cxx
index 1a9f407a7878ae423a09627c22bbb8b420421b05..1bd07a1db823c537e57164e8a90c7b5ae328d453 100644 (file)
 #include "AliMUONHitMapA1.h"
 #include "AliMUON.h"
 #include "AliMUONLoader.h"
-#include "AliMUONChamber.h"
 #include "AliMUONConstants.h"
-#include "AliMUONDigitizer.h"
 #include "AliMUONTransientDigit.h"
-#include "AliMUONHitMapA1.h"
 #include "AliMUONTriggerDecision.h"
 #include "AliLog.h"
 
@@ -493,27 +490,47 @@ void AliMUONDigitizer::InitArrays()
 //
 // Note: the fTDList and fHitMap arrays must be NULL before calling this method.
 
-       AliDebug(2, "Initialising internal arrays.");
-       AliDebug(4, "Creating transient digits list.");
-       fTDList = new TObjArray;
+    AliDebug(2, "Initialising internal arrays.");
+    AliDebug(4, "Creating transient digits list.");
+    fTDList = new TObjArray;
        
-       // Array of pointer of the AliMUONHitMapA1:
-       //  two HitMaps per chamber, or one HitMap per cahtode plane
-       fHitMap = new AliMUONHitMapA1* [2*AliMUONConstants::NCh()];
-
-       // Loop over chambers for the definition AliMUONHitMap
-       for (Int_t i = 0; i < AliMUONConstants::NCh(); i++) 
-       {
-               AliDebug(4,Form( "Creating hit map for chamber %d, cathode 1.", i+1));
-               AliMUONChamber* chamber = &(fMUON->Chamber(i));
-               AliSegmentation* c1Segmentation = chamber->SegmentationModel(1); // Cathode plane 1
-               fHitMap[i] = new AliMUONHitMapA1(c1Segmentation, fTDList);
-               AliDebug(4,Form( "Creating hit map for chamber %d, cathode 2.", i+1));
-               AliSegmentation* c2Segmentation = chamber->SegmentationModel(2); // Cathode plane 2
-               fHitMap[i+AliMUONConstants::NCh()] = new AliMUONHitMapA1(c2Segmentation, fTDList);
-       }
+    // Array of pointer of the AliMUONHitMapA1:
+    //  two HitMaps per chamber, or one HitMap per cahtode plane
+    fHitMap = new AliMUONHitMapA1* [2*AliMUONConstants::NCh()];
+
+    if (fMUON->WhichSegmentation() == 1) {
+      // Loop over chambers for the definition AliMUONHitMap
+      for (Int_t i = 0; i < AliMUONConstants::NCh(); i++)  {
+
+       AliDebug(4,Form( "Creating hit map for chamber %d, cathode 1.", i+1));
+       AliMUONChamber* chamber = &(fMUON->Chamber(i));
+       AliSegmentation* c1Segmentation = chamber->SegmentationModel(1); // Cathode plane 1
+       fHitMap[i] = new AliMUONHitMapA1(c1Segmentation, fTDList);
+       AliDebug(4,Form( "Creating hit map for chamber %d, cathode 2.", i+1));
+       AliSegmentation* c2Segmentation = chamber->SegmentationModel(2); // Cathode plane 2
+       fHitMap[i+AliMUONConstants::NCh()] = new AliMUONHitMapA1(c2Segmentation, fTDList);
+      }
+
+    } else {
+      for (Int_t i = 0; i < AliMUONConstants::NCh(); i++) {
+
+       Int_t idDE = 100*(i+1);// central DE = max # of pads ?
+       if (i == 4 || i == 5) //St3
+         idDE += 4;
+
+       if (i > 5)
+         idDE += 5;// DE for max # of pads in St45 and Trigger Station
+
+       AliDebug(4,Form( "Creating hit map for chamber %d, cathode 1.", i+1));
+       AliMUONChamber* chamber = &(fMUON->Chamber(i));
+       AliMUONGeometrySegmentation* c1Segmentation = chamber->SegmentationModel2(1); // Cathode plane 1
+       fHitMap[i] = new AliMUONHitMapA1(idDE,c1Segmentation, fTDList); 
+       AliDebug(4,Form( "Creating hit map for chamber %d, cathode 2.", i+1));
+       AliMUONGeometrySegmentation* c2Segmentation = chamber->SegmentationModel2(2); // Cathode plane 2
+       fHitMap[i+AliMUONConstants::NCh()] = new AliMUONHitMapA1(idDE,c2Segmentation, fTDList);
+      }
+    }
 }
-
 //------------------------------------------------------------------------
 void AliMUONDigitizer::CleanupArrays()
 {