]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTriggerGUI.cxx
Small bug fix (which should have no influence online)
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerGUI.cxx
index c7f83fd4e838185eac07a2b841c87d9643dd809d..b03bd3e1aa90dfc5d075f3eefb3f46f65500a139 100644 (file)
@@ -32,7 +32,7 @@
 #include "AliMpSegmentation.h"
 #include "AliMpVSegmentation.h"
 #include "AliMpTriggerSegmentation.h"
-#include "AliMpIntPair.h"
+#include "AliMpEncodePair.h"
 #include "AliMpCDB.h"
 #include "AliMpDEManager.h"
 #include "AliMpDEIterator.h"
@@ -144,7 +144,7 @@ AliMUONTriggerGUI::AliMUONTriggerGUI(Int_t runNumber)
   fRawTriggerStore->Create();
 
   fCDBManager = AliCDBManager::Instance();
-  fCDBManager->SetDefaultStorage("local://$ALICE_ROOT");
+  fCDBManager->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
   fCDBManager->SetRun(runNumber);
   AliMpCDB::LoadDDLStore();
   fCalibrationData = new AliMUONCalibrationData(runNumber);
@@ -535,14 +535,20 @@ void AliMUONTriggerGUI::HandleMenu(Int_t id)
     if (fDiMap == 0) {
       fDiMap = new AliMUONTriggerGUIdimap(fBoards,gClient->GetRoot(), fMain, 400, 200);
       fDiMap->SetLoader(fLoader);
-      fDiMap->SetMCDataInterface(fMCDataInterface);
-      fDiMap->SetRawDigitStore(fRawDigitStore);
+      if (fRUNRAW) {
+       fDiMap->SetRawDigitStore(fRawDigitStore);
+      } else {
+       fDiMap->SetMCDataInterface(fMCDataInterface);
+      }
       fDiMap->DrawAllMaps();
     } else if (!fDiMap->IsOn()) {
       fDiMap = new AliMUONTriggerGUIdimap(fBoards,gClient->GetRoot(), fMain, 400, 200);
       fDiMap->SetLoader(fLoader);
-      fDiMap->SetMCDataInterface(fMCDataInterface);
-      fDiMap->SetRawDigitStore(fRawDigitStore);
+      if (fRUNRAW) {
+       fDiMap->SetRawDigitStore(fRawDigitStore);
+      } else {
+       fDiMap->SetMCDataInterface(fMCDataInterface);
+      }
       fDiMap->DrawAllMaps();
     }
 
@@ -1389,9 +1395,12 @@ void AliMUONTriggerGUI::OpenBoard(Int_t id)
   bf->SetBoard(Boards(),id);
   bf->SetLoader(fLoader);
   bf->SetCrateManager(fCrateManager);
-  bf->SetMCDataInterface(fMCDataInterface);
-  bf->SetRawDigitStore(fRawDigitStore);
-  bf->SetRawTriggerStore(fRawTriggerStore);
+  if (fRUNRAW) {
+    bf->SetRawDigitStore(fRawDigitStore);
+    bf->SetRawTriggerStore(fRawTriggerStore);
+  } else {
+    bf->SetMCDataInterface(fMCDataInterface);
+  }
   bf->Init();
 
   bf->Show();
@@ -1463,11 +1472,9 @@ void AliMUONTriggerGUI::InitBoards()
       manuIdPrev = 0;
       for (Int_t ix = 0; ix <= seg0->MaxPadIndexX(); ix++) {
        for (Int_t iy = 0; iy <= seg0->MaxPadIndexY(); iy++) {
-         AliMpIntPair indices(ix,iy);
-         AliMpPad pad = seg0->PadByIndices(indices,kFALSE);
+         AliMpPad pad = seg0->PadByIndices(ix,iy,kFALSE);
          if (pad.IsValid()) {
-           AliMpIntPair loc = pad.GetLocation(0);
-           Int_t manuId = loc.GetFirst();
+           Int_t manuId = pad.GetLocalBoardId(0);
            if (manuId != manuIdPrev) {
              AliMpLocalBoard *mpboard = AliMpDDLStore::Instance()->GetLocalBoard(manuId);
              manuIdPrev = manuId;
@@ -1494,13 +1501,11 @@ void AliMUONTriggerGUI::InitBoards()
       manuIdPrev = 0;
       for (Int_t ix = 0; ix <= seg1->MaxPadIndexX(); ix++) {
        for (Int_t iy = 0; iy <= seg1->MaxPadIndexY(); iy++) {
-         AliMpIntPair indices(ix,iy);
-         AliMpPad pad = seg1->PadByIndices(indices,kFALSE);
+         AliMpPad pad = seg1->PadByIndices(ix,iy,kFALSE);
          if (pad.IsValid()) {
            Int_t nloc = pad.GetNofLocations();
            for (Int_t iloc = 0; iloc < nloc; iloc++) {
-             AliMpIntPair loc = pad.GetLocation(iloc);
-             Int_t manuId = loc.GetFirst();
+             Int_t manuId = pad.GetLocalBoardId(iloc);
              if (manuId != manuIdPrev) {
                manuIdPrev = manuId;
                boardIdTmp = cIdtobId[manuId];
@@ -1637,15 +1642,15 @@ void AliMUONTriggerGUI::SetStripBoxes(AliMUONTriggerGUIboard *board)
       for (Int_t ix = 0; ix <= maxX; ix++) {
        for (Int_t iy = 0; iy <= maxY; iy++) {
          
-         pad = seg->PadByIndices(AliMpIntPair(ix,iy),kFALSE);
+         pad = seg->PadByIndices(ix,iy,kFALSE);
          
          if (!pad.IsValid()) continue;
          
          // get the pad position and dimensions
-         xlocal1 = pad.Position().X();
-         ylocal1 = pad.Position().Y();
-         xlocal2 = pad.Dimensions().X();
-         ylocal2 = pad.Dimensions().Y();
+         xlocal1 = pad.GetPositionX();
+         ylocal1 = pad.GetPositionY();
+         xlocal2 = pad.GetDimensionX();
+         ylocal2 = pad.GetDimensionY();
          
          transformer.Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1);
          // (no transformation for pad dimensions)
@@ -1693,15 +1698,15 @@ void AliMUONTriggerGUI::SetStripBoxes(AliMUONTriggerGUIboard *board)
       for (Int_t ix = 0; ix <= maxX; ix++) {
        for (Int_t iy = 0; iy <= maxY; iy++) {
          
-         pad = seg->PadByIndices(AliMpIntPair(ix,iy),kFALSE);
+         pad = seg->PadByIndices(ix,iy,kFALSE);
          
          if (!pad.IsValid()) continue;
          
          // get the pad position and dimensions
-         xlocal1 = pad.Position().X();
-         ylocal1 = pad.Position().Y();
-         xlocal2 = pad.Dimensions().X();
-         ylocal2 = pad.Dimensions().Y();
+         xlocal1 = pad.GetPositionX();
+         ylocal1 = pad.GetPositionY();
+         xlocal2 = pad.GetDimensionX();
+         ylocal2 = pad.GetDimensionY();
          
          transformer.Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1);
          // (no transformation for pad dimensions)
@@ -1779,9 +1784,9 @@ void AliMUONTriggerGUI::CreateDigitStore()
        maxY = seg->MaxPadIndexY();
        if (ix > maxX) printf("Index x > maximum!\n");
        if (iy > maxY) printf("Index y > maximum!\n");
-        pad = seg->PadByIndices(AliMpIntPair(ix,iy),kTRUE);
-       manuId = pad.GetLocation(0).GetFirst();
-       manuChannel = pad.GetLocation(0).GetSecond();
+        pad = seg->PadByIndices(ix,iy,kTRUE);
+       manuId = pad.GetLocalBoardId(0);
+       manuChannel = pad.GetLocalBoardChannel(0);
 
        dig = fDigitStore->Add(detElemId,manuId,manuChannel,cathode,AliMUONVDigitStore::kAllow);
        dig->SetCharge(charge);
@@ -1804,9 +1809,9 @@ void AliMUONTriggerGUI::CreateDigitStore()
        maxY = seg->MaxPadIndexY();
        if (ix > maxX) printf("Index x > maximum!\n");
        if (iy > maxY) printf("Index y > maximum!\n");
-        pad = seg->PadByIndices(AliMpIntPair(ix,iy),kTRUE);
-       manuId = pad.GetLocation(0).GetFirst();
-       manuChannel = pad.GetLocation(0).GetSecond();
+        pad = seg->PadByIndices(ix,iy,kTRUE);
+       manuId = pad.GetLocalBoardId(0);
+       manuChannel = pad.GetLocalBoardChannel(0);
 
        dig = fDigitStore->Add(detElemId,manuId,manuChannel,cathode,AliMUONVDigitStore::kAllow);
        dig->SetCharge(charge);
@@ -1835,8 +1840,8 @@ void AliMUONTriggerGUI::PrintDigitStore() const
 
     chamber = 11+i;
 
-    AliMpIntPair deRange = AliMpDEManager::GetDetElemIdRange(chamber-1);
-    TIter next(fDigitStore->CreateIterator(deRange.GetFirst(),deRange.GetSecond()));
+    MpPair_t deRange = AliMpDEManager::GetDetElemIdRange(chamber-1);
+    TIter next(fDigitStore->CreateIterator(AliMp::PairFirst(deRange),AliMp::PairSecond(deRange)));
     AliMUONVDigit *mdig;
 
     while ( ( mdig = static_cast<AliMUONVDigit*>(next())) )
@@ -1849,9 +1854,8 @@ void AliMUONTriggerGUI::PrintDigitStore() const
       charge = (Int_t)mdig->Charge();
 
       seg = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, AliMp::GetCathodType(cathode));  
-      pad = seg->PadByIndices(AliMpIntPair(ix,iy),kTRUE);
-      AliMpIntPair ind = pad.GetIndices();
-
+      pad = seg->PadByIndices(ix,iy,kTRUE);
       printf("Digit: detElemId %4d cath %1d ix %2d iy %3d charge %1d \n",detElemId,cathode,ix,iy,charge);
       
     }