#include "AliMpSegmentation.h"
#include "AliMpVSegmentation.h"
#include "AliMpTriggerSegmentation.h"
-#include "AliMpIntPair.h"
+#include "AliMpEncodePair.h"
#include "AliMpCDB.h"
#include "AliMpDEManager.h"
#include "AliMpDEIterator.h"
#include <TGImageMap.h>
#include <TGTextBuffer.h>
+#include <cstdio>
+
/// \cond CLASSIMP
ClassImp(AliMUONTriggerGUI)
/// \endcond
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();
}
bf = new AliMUONTriggerGUIbdmap(gClient->GetRoot(), fMain, 400, 200);
if (status & kGood) {
- sprintf(text,"%s (Circuit %4d) status : working",
+ snprintf(text,200,"%s (Circuit %4d) status : working",
board->GetBoardName(),board->GetIdCircuit());
}
if (status & kWithProblems) {
- sprintf(text,"%s (Circuit %4d) status : has problems...",
+ snprintf(text,200,"%s (Circuit %4d) status : has problems...",
board->GetBoardName(),board->GetIdCircuit());
}
if (status & kNotWorking) {
- sprintf(text,"%s (Circuit %4d) status : not working",
+ snprintf(text,200,"%s (Circuit %4d) status : not working",
board->GetBoardName(),board->GetIdCircuit());
}
if (status & kUnknown) {
- sprintf(text,"%s (Circuit %4d) status : unknown",
+ snprintf(text,200,"%s (Circuit %4d) status : unknown",
board->GetBoardName(),board->GetIdCircuit());
}
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();
// circuit number to board number in array
Int_t cIdtobId[235];
+ for (Int_t i = 0; i < 235; i++) cIdtobId[i] = -1;
AliMpDEIterator it;
Int_t boardId = -1;
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;
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];
reg = new TGRegion(5,xp,yp);
fImageMap->AddRegion(*reg, ib);
- sprintf(text,"%s (crate %s circuit %3d, number %3d)",board->GetBoardName(),board->GetCrateName(),board->GetIdCircuit(),board->GetNumber());
+ snprintf(text,256,"%s (crate %s circuit %3d, number %3d)",board->GetBoardName(),board->GetCrateName(),board->GetIdCircuit(),board->GetNumber());
fImageMap->SetToolTipText(ib, text);
// Set coordinates of strips boxes
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)
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)
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);
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);
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())) )
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);
}
char command[256];
char dateFileName[256];
- sprintf(dateFileName,"TriggerGUI.date");
- sprintf(command, "dateStream -c -s -D -o %s -# %d -C -run %d",
+ snprintf(dateFileName,256,"TriggerGUI.date");
+ snprintf(command, 256,"dateStream -c -s -D -o %s -# %d -C -run %d",
dateFileName, 1, 0);
FILE* pipe = gSystem->OpenPipe(command, "w");
ldc += AliDAQ::NumberOfLdcs(iDet) / AliDAQ::NumberOfDdls(iDet);
char rawFileName[256];
- sprintf(rawFileName, "%s",AliDAQ::DdlFileName(iDet,iDDL));
+ snprintf(rawFileName, 256,"%s",AliDAQ::DdlFileName(iDet,iDDL));
// check existence and size of raw data file
FILE* file = fopen(rawFileName, "rb");
if (!file) continue;
// AliSimulation::ConvertDateToRoot
char rootFileName[256];
- sprintf(rootFileName,"TriggerGUI.root");
+ snprintf(rootFileName,256,"TriggerGUI.root");
// ALIMDC setup
const Int_t kDBSize = 2000000000;