]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fix bug in WriteLocalMasks, use same iteration as in ReadLocalMasks
authorvulpescu <vulpescu@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 22 Jan 2010 08:49:29 +0000 (08:49 +0000)
committervulpescu <vulpescu@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 22 Jan 2010 08:49:29 +0000 (08:49 +0000)
MUON/AliMUONTriggerIO.cxx

index bc6a4cf0360b8dba9e481fba15043b47b1285794..86184b0ee52c6c1e6ce4e3dfaaa044ac1fe5eaa7 100644 (file)
@@ -686,32 +686,23 @@ AliMUONTriggerIO::WriteLocalMasks(const char* localFile, AliMUONVStore& localMas
     }   
 
     UShort_t maskBuffer[8];
+    Int_t localBoardIndex(0);
+    while (localBoardIndex < NofLocalBoards()) {
 
-    TIter next(regionalConfig->CreateCrateIterator());
-    AliMUONTriggerCrateConfig* crate;
-    
-    while ( ( crate = static_cast<AliMUONTriggerCrateConfig*>(next()) ) )
-    {      
-      UShort_t mask = crate->GetMask(); // getting mask from current config
+      Int_t localBoardId = fRegionalTrigger.LocalBoardId(localBoardIndex);
 
-      for (Int_t iLocal = 0; iLocal < crate->GetNofLocalBoards(); ++iLocal) 
-      {
-       Int_t localBoardId = crate->GetLocalBoardId(iLocal);
+      AliMUONVCalibParam* localMask = 
+       static_cast<AliMUONVCalibParam*>(localMasks.FindObject(localBoardId));
 
-       if ( (mask >> iLocal ) & 0x1 
+      for (Int_t index = 0; index < 8; ++index
        {
-         AliMUONVCalibParam* localMask = 
-             static_cast<AliMUONVCalibParam*>(localMasks.FindObject(localBoardId));
-
-         for (Int_t index = 0; index < 8; ++index) 
-         {
-           maskBuffer[index] = localMask->ValueAsInt(index,0); 
-         }
-
-         fwrite ( maskBuffer, 2, 8, fp); 
+         maskBuffer[index] = localMask->ValueAsInt(index,0); 
        }
+      
+      fwrite ( maskBuffer, 2, 8, fp); 
+
+      ++localBoardIndex;
 
-      }
     }
 
     fclose(fp);