]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTriggerElectronics.cxx
Disabling TOF (all) and TPC (Gain calibration) if B=0
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerElectronics.cxx
index 13fc26cc12a883baa82ce9884f2b1546cd7610b3..9104af8f87ebe7d6d98132fcc22d3d137c7e2018 100644 (file)
@@ -79,12 +79,6 @@ AliMUONTriggerElectronics::AliMUONTriggerElectronics(AliMUONCalibrationData* cal
  /// CONSTRUCTOR
 ///
 
-  for (Int_t i = 0; i < 2; ++i) {
-    fCopyXInput[i] = new TList();
-    fCopyXInput[i]->SetOwner();
-    fCopyYInput[i] = new TList();
-    fCopyYInput[i]->SetOwner();
-  }
 
   // force loading of mapping if not already done
   if ( !AliMpDDLStore::Instance(kFALSE) )
@@ -92,7 +86,6 @@ AliMUONTriggerElectronics::AliMUONTriggerElectronics(AliMUONCalibrationData* cal
     AliMpCDB::LoadDDLStore();
   }
   
-  SetCopyInput();
   
   Factory(calibData);
   LoadMasks(calibData); 
@@ -105,61 +98,7 @@ AliMUONTriggerElectronics::~AliMUONTriggerElectronics()
 ///
   delete fGlobalTriggerBoard;
   delete fCrates;
-  for (Int_t i = 0; i < 2; ++i) {
-    delete fCopyXInput[i];
-    delete fCopyYInput[i];
-  }
-
-}
-
-//___________________________________________
-void AliMUONTriggerElectronics::SetCopyInput()
-{  
-  /// set list of copy input
-  
-    for (Int_t iDDL = 0; iDDL < 2; ++iDDL) { 
     
-      for(Int_t iReg = 0; iReg < 8; ++iReg){   //reg loop
-      
-       AliMpTriggerCrate* crateMapping = AliMpDDLStore::Instance()->GetTriggerCrate(iDDL, iReg);
-      
-       for(Int_t iLocal = 0; iLocal < crateMapping->GetNofLocalBoards(); ++iLocal) { 
-        
-         Int_t localBoardFromId = crateMapping->GetLocalBoardId(iLocal);
-         if (!localBoardFromId) continue; //empty slot, should not happen
-        
-          AliMpLocalBoard* localBoardFrom = AliMpDDLStore::Instance()->GetLocalBoard(localBoardFromId);
-         Int_t localBoardToId;
-         if ((localBoardToId = localBoardFrom->GetInputXto())) {
-             AliMpLocalBoard* localBoardTo = AliMpDDLStore::Instance()->GetLocalBoard(localBoardToId);
-             TString crateFrom = localBoardFrom->GetCrate();
-             Int_t   slotFrom  = localBoardFrom->GetSlot();
-             TString crateTo   = localBoardTo->GetCrate();
-             Int_t   slotTo    = localBoardTo->GetSlot();
-          
-             fCopyXInput[0]->Add(new AliMpIntPair(AliMpExMap::GetIndex(crateFrom), slotFrom));
-             fCopyXInput[1]->Add(new AliMpIntPair(AliMpExMap::GetIndex(crateTo), slotTo));
-             AliDebug(3, Form("copy xInputs from local  %s_%d to %s_%d\n", crateFrom.Data(), slotFrom, 
-                              crateTo.Data(), slotTo));
-         }
-        
-         if ((localBoardToId = localBoardFrom->GetInputYto())) {
-             AliMpLocalBoard* localBoardTo = AliMpDDLStore::Instance()->GetLocalBoard(localBoardToId);
-             TString crateFrom = localBoardFrom->GetCrate();
-             Int_t   slotFrom  = localBoardFrom->GetSlot();
-             TString crateTo   = localBoardTo->GetCrate();
-             Int_t   slotTo    = localBoardTo->GetSlot();
-          
-             fCopyYInput[0]->Add(new AliMpIntPair(AliMpExMap::GetIndex(crateFrom), slotFrom));
-             fCopyYInput[1]->Add(new AliMpIntPair(AliMpExMap::GetIndex(crateTo), slotTo));
-             AliDebug(3, Form("copy yInputs from local  %s_%d to %s_%d\n", crateFrom.Data(), slotFrom, 
-                              crateTo.Data(), slotTo));
-          
-         }
-       }
-      }
-    }
 }
 
 //___________________________________________
@@ -220,6 +159,17 @@ void AliMUONTriggerElectronics::Feed(const AliMUONVDigitStore& digitStore)
           if (cathode && b->GetSwitch(AliMpLocalBoard::kZeroAllYLSB)) ibitxy += 8;
           
           b->SetbitM(ibitxy,cathode,ichamber-10);
+          
+          if ( cathode == 0 ) {
+            // Particular case of the columns with 22 local boards (2R(L) 3R(L))
+            // Fill copy boards
+            AliMpLocalBoard* mpLocalBoard = AliMpDDLStore::Instance()->GetLocalBoard(nboard);
+            Int_t nboardCopy = mpLocalBoard->GetInputXto();
+            if ( nboardCopy > 0 ) {
+              AliMUONLocalTriggerBoard* copyBoard = fCrates->LocalBoard(nboardCopy);
+              copyBoard->SetbitM(ibitxy,cathode,ichamber-10);
+            }
+          }
         }
         else
         {
@@ -240,58 +190,6 @@ void AliMUONTriggerElectronics::FeedCopyNeighbours()
   /// Feed the local copies
   /// and complete the feed with the information of neighbours
   //
-
-  // Particular case of the columns with 22 local boards (2R(L) 3R(L))   
-  // fill copy input from mapping instead of hardcoded valued (Ch.F)
-  AliMUONTriggerCrate *crate = 0x0; TObjArray *bs = 0x0;
-
-  for (Int_t i = 0; i < fCopyXInput[0]->GetEntries(); ++i) 
-  {
-    AliMpIntPair* pair = (AliMpIntPair*)fCopyXInput[0]->At(i);
-    TString crateFrom  =  AliMpExMap::GetString(pair->GetFirst());
-    Int_t   slotFrom   =  pair->GetSecond();
-
-    pair = (AliMpIntPair*)fCopyXInput[1]->At(i);
-    TString crateTo  =  AliMpExMap::GetString(pair->GetFirst());
-    Int_t   slotTo   =  pair->GetSecond();
-
-    AliDebug(3, Form("copy xInputs from local  %s_%d to %s_%d\n", crateFrom.Data(), slotFrom, 
-                    crateTo.Data(), slotTo));
-
-    UShort_t cX[2];
-    crate = fCrates->Crate(crateFrom); 
-    bs = crate->Boards();
-    AliMUONLocalTriggerBoard *fromxb = (AliMUONLocalTriggerBoard*)bs->At(slotFrom);
-    crate = fCrates->Crate(crateTo); 
-    bs = crate->Boards();
-    AliMUONLocalTriggerBoard *desxb = (AliMUONLocalTriggerBoard*)bs->At(slotTo);
-    fromxb->GetX34(cX); desxb->SetX34(cX);
-
-
-  }
-
-  for (Int_t i = 0; i < fCopyYInput[0]->GetEntries(); ++i) 
-  {
-    AliMpIntPair* pair = (AliMpIntPair*)fCopyYInput[0]->At(i);
-    TString crateFrom  =  AliMpExMap::GetString(pair->GetFirst());
-    Int_t   slotFrom   =  pair->GetSecond();
-
-    pair = (AliMpIntPair*)fCopyYInput[1]->At(i);
-    TString crateTo  =  AliMpExMap::GetString(pair->GetFirst());
-    Int_t   slotTo   =  pair->GetSecond();
-
-    AliDebug(3, Form("copy yInputs from local  %s_%d to %s_%d\n", crateFrom.Data(), slotFrom, 
-                    crateTo.Data(), slotTo));
-
-    UShort_t cY[4];
-    crate = fCrates->Crate(crateFrom); 
-    bs = crate->Boards();
-    AliMUONLocalTriggerBoard *fromyb = (AliMUONLocalTriggerBoard*)bs->At(slotFrom);
-    crate = fCrates->Crate(crateTo); 
-    bs = crate->Boards();
-    AliMUONLocalTriggerBoard *desyb = (AliMUONLocalTriggerBoard*)bs->At(slotTo);
-    fromyb->GetY(cY); desyb->SetY(cY);
-  }
   
   // FILL UP/DOWN OF CURRENT BOARD (DONE VIA J3 BUS IN REAL LIFE)
   AliMUONTriggerCrate* cr;
@@ -467,7 +365,7 @@ void AliMUONTriggerElectronics::LoadMasks(AliMUONCalibrationData* calibData)
       
       Int_t cardNumber = b->GetNumber();
       
-      if (cardNumber) // interface board are not interested
+      if (cardNumber) // skip empty slots
       {
         AliMUONVCalibParam* localBoardMasks = calibData->LocalTriggerBoardMasks(cardNumber);
         for ( Int_t i = 0; i < localBoardMasks->Size(); ++i )
@@ -527,7 +425,7 @@ void AliMUONTriggerElectronics::LocalResponse()
        UShort_t response = board->GetResponse();            
         
        // CRATE CONTAINING INTERFACE BOARD
-       if (board->GetNumber() == 0) // copy boards
+  if (!board->IsNotified()) // copy boards
        {
          if ( response != 0 ) 
            AliWarning(Form("Interface board %s in slot %d of crate %s has a non zero response",
@@ -657,8 +555,6 @@ void AliMUONTriggerElectronics::Digits2Trigger(const AliMUONVDigitStore& digitSt
           //     {
           
           Int_t icirc = board->GetNumber();
-          if (icirc != 0) { // pcrochet 181206: MOOD needs ALL boards
-            
             localTrigger.SetLoCircuit(icirc);
             localTrigger.SetLoStripX(board->GetStripX11());
             localTrigger.SetLoDev(board->GetDev());
@@ -696,7 +592,6 @@ void AliMUONTriggerElectronics::Digits2Trigger(const AliMUONVDigitStore& digitSt
             triggerStore.Add(localTrigger);  
             
           }
-          }
         }
       pRegTrig.SetId(iReg + 8*iSide);
       pRegTrig.SetLocalOutput(regInpLpt, 0);