]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONDigitMaker.cxx
Update From Debojit
[u/mrichter/AliRoot.git] / MUON / AliMUONDigitMaker.cxx
index 19806ac24e768f6268ff1fa5f11eeceef675a8c8..0d78f303138698642c9e227a3a536b9fbd7d134a 100644 (file)
@@ -71,6 +71,8 @@
 #include "AliRawReader.h"
 #include <TArrayS.h>
 
+using std::endl;
+using std::cout;
 /// \cond CLASSIMP
 ClassImp(AliMUONDigitMaker) // Class implementation in ROOT context
 /// \endcond
@@ -173,9 +175,8 @@ AliMUONDigitMaker::Print(Option_t*) const
 //____________________________________________________________________
 Int_t
 AliMUONDigitMaker::Raw2Digits(AliRawReader* rawReader, 
-                              AliMUONVDigitStore* digitStore,
-                              AliMUONVTriggerStore* triggerStore,
-                              Bool_t sdigit)
+                                        AliMUONVDigitStore* digitStore,
+                                        AliMUONVTriggerStore* triggerStore)
 {
   /// Main method to creates digit
   /// for tracker 
@@ -199,7 +200,7 @@ AliMUONDigitMaker::Raw2Digits(AliRawReader* rawReader,
   if ( fDigitStore ) 
   {
     fDigitStore->Clear(); // insure we start with an empty container
-    tracker = ReadTrackerDDL(rawReader,sdigit);
+    tracker = ReadTrackerDDL(rawReader);
   }
   
   if ( fTriggerStore || fMakeTriggerDigits ) 
@@ -220,7 +221,7 @@ AliMUONDigitMaker::Raw2Digits(AliRawReader* rawReader,
 
 //____________________________________________________________________
 Int_t
-AliMUONDigitMaker::ReadTrackerDDL(AliRawReader* rawReader, Bool_t sdigit)
+AliMUONDigitMaker::ReadTrackerDDL(AliRawReader* rawReader)
 {
   /// Reading tracker DDL
   /// filling the fDigitStore container, which must not be null
@@ -290,14 +291,8 @@ AliMUONDigitMaker::ReadTrackerDDL(AliRawReader* rawReader, Bool_t sdigit)
     
     digit->SetPadXY(pad.GetIx(),pad.GetIy());
     
-    if ( sdigit ) 
-    {
-      digit->SetCharge(charge);
-    }
-    else
-    {
-      digit->SetADC(charge);
-    }
+    digit->SetADC(charge);
+
   }
   
   if ( fRawStreamTracker->IsErrorMessage() ) 
@@ -365,21 +360,16 @@ AliMUONDigitMaker::ReadTriggerDDL(AliRawReader* rawReader)
         // if card exist
         if (localStruct) {
           
-         loCircuit = crate->GetLocalBoardId(localStruct->GetId());
-
-         if ( !loCircuit ) continue; // empty slot
-
-         AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(loCircuit, kTRUE);
-
-         // skip copy cards
-         if( !localBoard->IsNotified()) 
-            continue;
+          loCircuit = crate->GetLocalBoardId(localStruct->GetId());
+          
+          if ( !loCircuit ) continue; // empty slot
+          
           
           if (fTriggerStore)
           {
             // fill local trigger
             AliMUONLocalTrigger localTrigger;
-           localTrigger.SetLocalStruct(loCircuit, *localStruct);
+            localTrigger.SetLocalStruct(loCircuit, *localStruct);
             fTriggerStore->Add(localTrigger);
           }
           
@@ -388,8 +378,8 @@ AliMUONDigitMaker::ReadTriggerDDL(AliRawReader* rawReader)
             //FIXEME should find something better than a TArray
             TArrayS xyPattern[2];
             
-           localStruct->GetXPattern(xyPattern[0]);
-           localStruct->GetYPattern(xyPattern[1]);
+            localStruct->GetXPattern(xyPattern[0]);
+            localStruct->GetYPattern(xyPattern[1]);
             
             TriggerDigits(loCircuit, xyPattern, *fDigitStore);
           }
@@ -404,7 +394,7 @@ AliMUONDigitMaker::ReadTriggerDDL(AliRawReader* rawReader)
 //____________________________________________________________________
 Int_t AliMUONDigitMaker::TriggerDigits(Int_t nBoard, 
                                        const TArrayS* xyPattern,
-                                       AliMUONVDigitStore& digitStore) const
+                                       AliMUONVDigitStore& digitStore, Bool_t warn) const
 {
   /// make digits for trigger from pattern, and add them to digitStore
 
@@ -413,6 +403,13 @@ Int_t AliMUONDigitMaker::TriggerDigits(Int_t nBoard,
   Int_t detElemId;
 
   AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(nBoard);
+  
+  if ( ! localBoard->IsNotified() ) {
+    // Copy board
+    // The mapping is not correct for copy boards
+    // Use the one of corresponding phyiscal board
+    nBoard = localBoard->GetInputXfrom();
+  }
 
   Int_t n,b;
 
@@ -440,7 +437,7 @@ Int_t AliMUONDigitMaker::TriggerDigits(Int_t nBoard,
             Int_t offset = 0;
             if (iCath && localBoard->GetSwitch(AliMpLocalBoard::kZeroAllYLSB)) offset = -8;
             
-            AliMpPad pad = seg->PadByLocation(nBoard,ibitxy+offset,kTRUE);
+            AliMpPad pad = seg->PadByLocation(nBoard,ibitxy+offset,warn);
                         
             if (!pad.IsValid()) 
             {