56 #include "AliRunLoader.h"
57 #include "AliCDBManager.h"
58 #include "AliRawDataHeaderSim.h"
59 #include "AliRawReader.h"
64 #include <TApplication.h>
65 #include <TGDimension.h>
68 #include <TGTextEntry.h>
71 #include <TGImageMap.h>
72 #include <TGTextBuffer.h>
112 fTriggerProcessor(0),
119 fCurrentRawEvent(-1),
132 fFileName =
new TString(
"");
133 fEvString =
new TString(
"");
134 fPath =
new TString(
"");
146 fRawTriggerStore->
Create();
148 fCDBManager = AliCDBManager::Instance();
149 fCDBManager->SetDefaultStorage(
"local://$ALICE_ROOT/OCDB");
150 fCDBManager->SetRun(runNumber);
158 fMain =
new TGMainFrame(gClient->GetRoot(), 750, 420);
159 fMain->Connect(
"CloseWindow()",
"AliMUONTriggerGUI",
this,
"CloseWindow()");
163 TGMenuBar *menuBar =
new TGMenuBar(fMain);
167 TGPopupMenu *menuFile =
new TGPopupMenu(gClient->GetRoot());
170 menuFile->AddEntry(
"Run input", kMFILERUN);
171 menuFile->AddEntry(
"Control", kMFILECNTRL);
172 menuFile->AddEntry(
"Exit", kMFILEEXIT);
174 menuFile->Connect(
"Activated(Int_t)",
"AliMUONTriggerGUI",
this,
"HandleMenu(Int_t)");
178 TGPopupMenu *menuCircuit =
new TGPopupMenu(gClient->GetRoot());
181 menuCircuit->AddEntry(
"Open", kMCIRCUITOPEN);
183 menuCircuit->Connect(
"Activated(Int_t)",
"AliMUONTriggerGUI",
this,
"HandleMenu(Int_t)");
187 TGPopupMenu *menuMap =
new TGPopupMenu(gClient->GetRoot());
190 menuMap->AddEntry(
"Digits map", kMMAPDIGITS);
191 menuMap->AddEntry(
"Reset digits", kMRESETDIGITS);
193 menuMap->Connect(
"Activated(Int_t)",
"AliMUONTriggerGUI",
this,
194 "HandleMenu(Int_t)");
198 TGPopupMenu *menuTrigger =
new TGPopupMenu(gClient->GetRoot());
200 TGPopupMenu *menuTriggerD =
new TGPopupMenu(gClient->GetRoot());
201 TGPopupMenu *menuTriggerT =
new TGPopupMenu(gClient->GetRoot());
202 TGPopupMenu *menuTriggerF =
new TGPopupMenu(gClient->GetRoot());
204 menuTrigger->AddPopup(
"Digit store", menuTriggerD);
205 menuTrigger->AddSeparator();
206 menuTrigger->AddPopup(
"Trigger store",menuTriggerT);
207 menuTrigger->AddSeparator();
208 menuTrigger->AddPopup(
"Front End Test", menuTriggerF);
209 menuTrigger->AddSeparator();
211 menuTriggerD->AddEntry(
"Create", kMDSTORE);
212 menuTriggerD->AddEntry(
"Print", kMDSTOREP);
213 menuTriggerD->AddEntry(
"Clear", kMDSTORECL);
214 menuTriggerT->AddEntry(
"Create", kMTSTORE);
215 menuTriggerT->AddEntry(
"Print", kMTSTOREP);
216 menuTriggerT->AddEntry(
"Clear", kMTSTORECL);
217 menuTriggerF->AddEntry(
"On", kMFETON);
218 menuTriggerF->AddEntry(
"Off", kMFETOFF);
219 menuTriggerF->AddEntry(
"Reg On", kMFETREGON);
220 menuTriggerF->AddEntry(
"Reg Off",kMFETREGOFF);
221 menuTrigger->AddEntry(
"Write raw data", kMTRAWDATA);
223 menuTrigger->Connect(
"Activated(Int_t)",
"AliMUONTriggerGUI",
this,
"HandleMenu(Int_t)");
227 menuBar->AddPopup(
"File", menuFile,
228 new TGLayoutHints(kLHintsTop | kLHintsLeft, 5,5,2,2)
231 menuBar->AddPopup(
"Maps", menuMap,
232 new TGLayoutHints(kLHintsTop | kLHintsLeft, 5,5,2,2)
235 menuBar->AddPopup(
"Circuit", menuCircuit,
236 new TGLayoutHints(kLHintsTop | kLHintsLeft, 5,5,2,2)
239 menuBar->AddPopup(
"TriggerDSET", menuTrigger,
240 new TGLayoutHints(kLHintsTop | kLHintsLeft, 5,5,2,2)
245 fMain->AddFrame(menuBar,
246 new TGLayoutHints(kLHintsTop |
254 fImageMap =
new TGImageMap(fMain,
"$ALICE_ROOT/MUON/data/guimap.gif");
256 fImageMap->Connect(
"RegionClicked(Int_t)",
"AliMUONTriggerGUI",
this,
"OpenBoard(Int_t)");
258 fImageMap->SetToolTipText(
"Map of the local boards as seen from the I.P.");
262 fMain->AddFrame(fImageMap);
263 fMain->SetWindowName(
"Map of the local boards as seen from the I.P.");
267 TGDimension size = fMain->GetDefaultSize();
270 fMain->MapSubwindows();
274 fBoardsInit = kFALSE;
285 TGCompositeFrame *runInput1, *runInput2, *runInput3;
286 TGCompositeFrame *control1, *control2, *circuit1, *circuit2;
287 TGCompositeFrame *fetregon1, *fetregon2;
288 TGCompositeFrame *fetregoff1, *fetregoff2;
289 TGLabel *runL1, *runL2, *circuitL1, *fetregonL1, *fetregoffL1;
290 TGTextEntry *runText1, *runText2, *circuitText1;
291 TGTextEntry *fetregonText1, *fetregoffText1;
292 TGTextButton *runApply1, *runApply2, *runCancel;
293 TGTextButton *controlClose, *nextEvent, *previousEvent, *skipToEvent;
294 TGTextButton *circuitCancel, *circuitOpen;
295 TGTextButton *fetregonCancel, *fetregoffCancel;
296 TGTextButton *fetregonRun, *fetregoffRun;
310 fRunInput =
new TGTransientFrame(gClient->GetRoot(),
fMain, 400, 200);
311 fRunInput->Connect(
"CloseWindow()",
"AliMUONTriggerGUI",
this,
"CloseRunInput()");
317 fRunInput->SetWindowName(
"Input file and event number");
321 runInput1 =
new TGCompositeFrame(
fRunInput, 400, 200, kHorizontalFrame);
322 runInput2 =
new TGCompositeFrame(
fRunInput, 400, 200, kHorizontalFrame);
326 runL1 =
new TGLabel(runInput1,
new TGString(
"Full file path:"));
327 runL2 =
new TGLabel(runInput2,
new TGString(
"Event number:"));
331 runText1 =
new TGTextEntry(runInput1,
fTxtBuffer1 =
new TGTextBuffer(100));
333 runText1->SetToolTipText(
"Enter the path to galice.root or the raw data file (root)");
334 runText1->Resize(300, runText1->GetDefaultHeight());
338 runText2 =
new TGTextEntry(runInput2,
fTxtBuffer2 =
new TGTextBuffer(5));
343 runText2->SetToolTipText(
"Enter the first event number to start with");
344 runText2->Resize(300, runText2->GetDefaultHeight());
348 runInput1->AddFrame(runL1,
349 new TGLayoutHints(kLHintsLeft |
354 runInput1->AddFrame(runText1,
355 new TGLayoutHints(kLHintsRight |
362 runInput2->AddFrame(runL2,
363 new TGLayoutHints(kLHintsLeft |
368 runInput2->AddFrame(runText2,
369 new TGLayoutHints(kLHintsRight |
377 new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 3, 0));
380 new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 3, 0));
384 runInput3 =
new TGCompositeFrame(
fRunInput, 400, 200, kHorizontalFrame);
388 runApply1 =
new TGTextButton(runInput3,
"Apply (galice)", 1);
389 runApply1->Connect(
"Clicked()",
"AliMUONTriggerGUI",
this,
"DoRunGalApply()");
390 runApply1->SetToolTipText(
"Apply changes (galice input)");
392 runApply2 =
new TGTextButton(runInput3,
"Apply (raw)", 1);
393 runApply2->Connect(
"Clicked()",
"AliMUONTriggerGUI",
this,
"DoRunRawApply()");
394 runApply2->SetToolTipText(
"Apply changes (raw data input)");
396 runCancel =
new TGTextButton(runInput3,
"Cancel", 2);
397 runCancel->Connect(
"Clicked()",
"AliMUONTriggerGUI",
this,
"DoRunCancel()");
398 runCancel->SetToolTipText(
"Cancel changes");
402 runInput3->AddFrame(runApply1,
403 new TGLayoutHints(kLHintsTop |
408 runInput3->AddFrame(runApply2,
409 new TGLayoutHints(kLHintsTop |
414 runInput3->AddFrame(runCancel,
415 new TGLayoutHints(kLHintsTop |
423 new TGLayoutHints(kLHintsTop |
438 fControl =
new TGTransientFrame(gClient->GetRoot(),
fMain, 50, 50);
439 fControl->Connect(
"CloseWindow()",
"AliMUONTriggerGUI",
this,
"CloseControl()");
445 fControl->SetWindowName(
"Run controls");
449 control1 =
new TGCompositeFrame(
fControl, 50, 50, kVerticalFrame);
453 controlClose =
new TGTextButton(control1,
"Close", 1);
454 controlClose->Connect(
"Clicked()",
"AliMUONTriggerGUI",
this,
"DoControlClose()");
457 nextEvent =
new TGTextButton(control1,
"Next event", 2);
458 nextEvent->Connect(
"Clicked()",
"AliMUONTriggerGUI",
this,
"DoNextEvent()");
460 previousEvent =
new TGTextButton(control1,
"Previous event", 3);
461 previousEvent->Connect(
"Clicked()",
"AliMUONTriggerGUI",
this,
"DoPreviousEvent()");
465 control2 =
new TGCompositeFrame(
fControl, 50, 50, kHorizontalFrame);
475 skipToEvent =
new TGTextButton(control2,
"Skip to event", 1);
476 skipToEvent->Connect(
"Clicked()",
"AliMUONTriggerGUI",
this,
"DoSkipToEvent()");
481 new TGLayoutHints(kLHintsTop |
486 control2->AddFrame(skipToEvent,
487 new TGLayoutHints(kLHintsTop |
494 control1->AddFrame(controlClose,
495 new TGLayoutHints(kLHintsBottom |
500 control1->AddFrame(nextEvent,
501 new TGLayoutHints(kLHintsBottom |
506 control1->AddFrame(previousEvent,
507 new TGLayoutHints(kLHintsBottom |
515 new TGLayoutHints(kLHintsBottom |
522 new TGLayoutHints(kLHintsTop |
561 Int_t number, over, pos;
562 for (Int_t ib = 0; ib <
kNBoards; ib++) {
570 for (Int_t io = 1; io <= over; io++) {
571 if (io == pos)
continue;
581 fCircuit =
new TGTransientFrame(gClient->GetRoot(),
fMain, 50, 50);
582 fCircuit->Connect(
"CloseWindow()",
"AliMUONTriggerGUI",
this,
"CloseCircuit()");
588 fCircuit->SetWindowName(
"Board circuit");
592 circuit1 =
new TGCompositeFrame(
fCircuit, 400, 200, kHorizontalFrame);
593 circuit2 =
new TGCompositeFrame(
fCircuit, 400, 200, kHorizontalFrame);
597 circuitL1 =
new TGLabel(circuit1,
new TGString(
"Circuit number:"));
601 circuitText1 =
new TGTextEntry(circuit1,
fTxtCircuit =
new TGTextBuffer(10));
604 circuitCancel =
new TGTextButton(circuit2,
"Cancel", 1);
605 circuitCancel->Connect(
"Clicked()",
"AliMUONTriggerGUI",
this,
"DoCircuitCancel()");
608 circuitOpen =
new TGTextButton(circuit2,
"Open", 2);
609 circuitOpen->Connect(
"Clicked()",
"AliMUONTriggerGUI",
this,
"DoCircuitOpen()");
614 circuit1->AddFrame(circuitL1,
615 new TGLayoutHints(kLHintsLeft |
620 circuit1->AddFrame(circuitText1,
621 new TGLayoutHints(kLHintsRight |
626 circuit2->AddFrame(circuitCancel,
627 new TGLayoutHints(kLHintsBottom |
632 circuit2->AddFrame(circuitOpen,
633 new TGLayoutHints(kLHintsBottom |
639 new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 3, 0));
642 new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 3, 0));
688 fFETRegOn =
new TGTransientFrame(gClient->GetRoot(),
fMain, 50, 50);
689 fFETRegOn->Connect(
"CloseWindow()",
"AliMUONTriggerGUI",
this,
"CloseFETRegOn()");
695 fFETRegOn->SetWindowName(
"FET ON regional crate");
699 fetregon1 =
new TGCompositeFrame(
fFETRegOn, 400, 200, kHorizontalFrame);
700 fetregon2 =
new TGCompositeFrame(
fFETRegOn, 400, 200, kHorizontalFrame);
704 fetregonL1 =
new TGLabel(fetregon1,
new TGString(
"Regional crate name:"));
708 fetregonText1 =
new TGTextEntry(fetregon1,
fTxtFETRegOn =
new TGTextBuffer(10));
711 fetregonCancel =
new TGTextButton(fetregon2,
"Cancel", 1);
712 fetregonCancel->Connect(
"Clicked()",
"AliMUONTriggerGUI",
this,
"DoFETRegOnCancel()");
715 fetregonRun =
new TGTextButton(fetregon2,
"Run FET", 2);
716 fetregonRun->Connect(
"Clicked()",
"AliMUONTriggerGUI",
this,
"DoFETRegOnRun()");
721 fetregon1->AddFrame(fetregonL1,
722 new TGLayoutHints(kLHintsLeft |
727 fetregon1->AddFrame(fetregonText1,
728 new TGLayoutHints(kLHintsRight |
733 fetregon2->AddFrame(fetregonCancel,
734 new TGLayoutHints(kLHintsBottom |
739 fetregon2->AddFrame(fetregonRun,
740 new TGLayoutHints(kLHintsBottom |
746 new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 3, 0));
749 new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 3, 0));
760 fFETRegOff->Connect(
"CloseWindow()",
"AliMUONTriggerGUI",
this,
"CloseFETRegOff()");
766 fFETRegOff->SetWindowName(
"FET OFF regional crate");
770 fetregoff1 =
new TGCompositeFrame(
fFETRegOff, 400, 200, kHorizontalFrame);
771 fetregoff2 =
new TGCompositeFrame(
fFETRegOff, 400, 200, kHorizontalFrame);
775 fetregoffL1 =
new TGLabel(fetregoff1,
new TGString(
"Regional crate name:"));
779 fetregoffText1 =
new TGTextEntry(fetregoff1,
fTxtFETRegOff =
new TGTextBuffer(10));
782 fetregoffCancel =
new TGTextButton(fetregoff2,
"Cancel", 1);
783 fetregoffCancel->Connect(
"Clicked()",
"AliMUONTriggerGUI",
this,
"DoFETRegOffCancel()");
786 fetregoffRun =
new TGTextButton(fetregoff2,
"Run FET", 2);
787 fetregoffRun->Connect(
"Clicked()",
"AliMUONTriggerGUI",
this,
"DoFETRegOffRun()");
792 fetregoff1->AddFrame(fetregoffL1,
793 new TGLayoutHints(kLHintsLeft |
798 fetregoff1->AddFrame(fetregoffText1,
799 new TGLayoutHints(kLHintsRight |
804 fetregoff2->AddFrame(fetregoffCancel,
805 new TGLayoutHints(kLHintsBottom |
810 fetregoff2->AddFrame(fetregoffRun,
811 new TGLayoutHints(kLHintsBottom |
817 new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 3, 0));
820 new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 3, 0));
829 printf(
"Menu item %d selected\n",
id);
900 gApplication->Terminate();
910 printf(
"This is a run with raw data input.\n");
919 TString error = TString(
"");;
926 error.Append(
"No galice file: ");
932 TFile *ftest =
new TFile(
fFileName->Data(),
"READ");
933 AliRun *galice = (AliRun*)ftest->Get(
"gAlice");
939 error.Append(
"No gAlice in file: ");
965 fEventsPerRun = AliRunLoader::Instance()->GetNumberOfEvents();
999 printf(
"This is a run with galice input.\n");
1008 TString error = TString(
"");;
1015 error.Append(
"No raw data file: ");
1028 error.Append(
"Not a valid raw data file: ");
1073 fError =
new TGTransientFrame(gClient->GetRoot(),
fMain, 50, 50);
1074 fError->Connect(
"CloseWindow()",
"AliMUONTriggerGUI",
this,
"CloseError()");
1078 fError->SetCleanup(kDeepCleanup);
1080 fError->SetWindowName(
"Error !");
1082 TGCompositeFrame *fW =
new TGCompositeFrame(
fError, 50, 50, kVerticalFrame);
1084 TGTextButton *fErrorOK =
new TGTextButton(fW,
"&Ok", 1);
1085 fErrorOK->Connect(
"Clicked()",
"AliMUONTriggerGUI",
this,
"DoErrorOK()");
1087 fW->AddFrame(fErrorOK,
1088 new TGLayoutHints(kLHintsBottom |
1093 TGLabel *fWL =
new TGLabel(fW,
new TGString(wt));
1096 new TGLayoutHints(kLHintsTop |
1102 new TGLayoutHints(kLHintsLeft |
1118 TString error = TString(
"");
1158 TString error = TString(
"");
1171 error.Form(
"Already at event 0 !");
1199 TString error = TString(
"");
1206 error.Form(
"Event number out of range !");
1234 fError->SendCloseMessage();
1289 for (Int_t ib = 0; ib <
kNBoards; ib++) {
1291 if (strcmp(board->GetCrateName(),crateName.Data()) != 0)
continue;
1323 Int_t icirc = cs.Atoi();
1327 for (Int_t ib = 0; ib <
kNBoards; ib++) {
1355 void * b =
fBoards->UncheckedAt(
id);
1356 if (b == 0)
return 0;
1376 if (status &
kGood) {
1377 snprintf(text,200,
"%s (Circuit %4d) status : working",
1382 snprintf(text,200,
"%s (Circuit %4d) status : has problems...",
1387 snprintf(text,200,
"%s (Circuit %4d) status : not working",
1392 snprintf(text,200,
"%s (Circuit %4d) status : unknown",
1451 for (Int_t ib = 0; ib <
kNBoards; ib++) {
1456 Int_t cIdtobId[235];
1457 for (Int_t i = 0; i < 235; i++) cIdtobId[i] = -1;
1461 Int_t manuIdPrev, ich, idet, boardIdTmp = -1;
1462 for (Int_t chamber = 0; chamber <
kNMT; chamber++) {
1468 if (ich != chamber)
continue;
1481 if (manuId != manuIdPrev) {
1483 manuIdPrev = manuId;
1487 boardId = cIdtobId[manuId];
1496 cIdtobId[manuId] = boardId;
1510 for (Int_t iloc = 0; iloc < nloc; iloc++) {
1512 if (manuId != manuIdPrev) {
1513 manuIdPrev = manuId;
1514 boardIdTmp = cIdtobId[manuId];
1525 for (Int_t ib = 0; ib <
kNBoards; ib++) {
1534 Int_t nPixelX = 700;
1535 Int_t nPixelY = 676;
1537 Int_t nPixelBorderX = 40;
1538 Int_t nPixelBorderY = 40;
1541 Float_t boardsX = 2*257.00;
1542 Float_t boardsY = 2*306.61;
1544 UShort_t status = 1;
1545 Float_t xc, yc, xw, yw;
1556 for (Int_t ib = 0; ib <
kNBoards; ib++) {
1568 x = (Int_t)(nPixelX/2 + xc * (nPixelX - 2*nPixelBorderX)/boardsX);
1569 y = (Int_t)(nPixelY/2 - yc * (nPixelY - 2*nPixelBorderY)/boardsY);
1574 w = (UInt_t)(xw*(nPixelX-2*nPixelBorderX)/boardsX);
1575 h = (UInt_t)(yw*(nPixelY-2*nPixelBorderY)/boardsY);
1589 reg =
new TGRegion(5,xp,yp);
1617 Int_t chamber, detElemId, maxX, maxY;
1618 Float_t xpmin, xpmax, ypmin, ypmax;
1619 Float_t xg1, xg2, yg1, yg2, zg1;
1620 Float_t xlocal1, xlocal2, ylocal1, ylocal2;
1621 Float_t xCenter, yCenter, xWidth, yWidth;
1623 for (Int_t i = 0; i <
kNMT; i++) {
1645 for (Int_t ix = 0; ix <= maxX; ix++) {
1646 for (Int_t iy = 0; iy <= maxY; iy++) {
1658 transformer.
Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1);
1675 Int_t iX1, iX2, iY, ixDig;
1679 if (ix >= iX1 && ix <= iX2 && iy == iY) {
1681 ypmin = -0.5*yWidth;
1682 ypmax = +0.5*yWidth;
1686 board->
SetYDigBox(i,ixDig,(Double_t)xpmin,(Double_t)ypmin,
1687 (Double_t)xpmax,(Double_t)ypmax);
1701 for (Int_t ix = 0; ix <= maxX; ix++) {
1702 for (Int_t iy = 0; iy <= maxY; iy++) {
1714 transformer.
Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1);
1731 Int_t iX, iY1, iY2, iyDig;
1735 if (ix == iX && iy >= iY1 && iy <= iY2) {
1739 board->
SetXDigBox(i,iyDig,(Double_t)xpmin,(Double_t)ypmin,
1740 (Double_t)xpmax,(Double_t)ypmax);
1758 Int_t nstripX, nstripY, detElemId, charge, ix, iy, iX1, iY1;
1759 Int_t cathode, maxX, maxY;
1760 Int_t manuId, manuChannel;
1766 for (Int_t ib = 0; ib <
kNBoards; ib++) {
1769 if (board == 0)
continue;
1773 for (Int_t ichamber = 11; ichamber <= 14; ichamber++) {
1778 for (Int_t isx = 0; isx < nstripX; isx++) {
1780 charge = (Int_t)board->
GetXDig(ichamber-11,isx);
1781 if (charge == 0)
continue;
1788 if (ix > maxX)
printf(
"Index x > maximum!\n");
1789 if (iy > maxY)
printf(
"Index y > maximum!\n");
1803 for (Int_t isy = 0; isy < nstripY; isy++) {
1805 charge = board->
GetYDig(ichamber-11,isy);
1806 if (charge == 0)
continue;
1813 if (ix > maxX)
printf(
"Index x > maximum!\n");
1814 if (iy > maxY)
printf(
"Index y > maximum!\n");
1839 Int_t ix, iy, charge, detElemId, cathode;
1842 for (Int_t i = 0; i <
kNMT; i++) {
1850 while ( ( mdig = static_cast<AliMUONVDigit*>(next())) )
1856 detElemId = mdig->DetElemId();
1857 charge = (Int_t)mdig->Charge();
1862 printf(
"Digit: detElemId %4d cath %1d ix %2d iy %3d charge %1d \n",detElemId,cathode,ix,iy,charge);
1876 printf(
"The digit store is empty...\n");
1896 UShort_t x2m, x2u, x2d;
1897 Int_t loStripX, loStripY, loDev, loCircuit, iStripX, iStripY, loLpt, loHpt;
1899 while ( ( mlt = static_cast<AliMUONLocalTrigger*>(next()) ) )
1910 loDev = mlt->
LoDev();
1911 loLpt = mlt->
LoLpt();
1912 loHpt = mlt->
LoHpt();
1914 iStripX = loStripX/2;
1915 if ((x2u == 1 || x2m == 1 || x2d == 1) && x2m == 1) {
1916 iStripY = loStripY/2;
1921 printf(
"Circ %3d Xs %2d (%2d) Ys %2d (%2d) Dev %2d Lpt %1d Hpt %1d \n",loCircuit,loStripX,iStripX,loStripY,iStripY,loDev,loLpt,loHpt);
1924 globalTrigger->
Print();
1937 printf(
"The trigger store is empty... \n");
1944 AliRawDataHeaderSim header;
1954 char dateFileName[256];
1955 snprintf(dateFileName,256,
"TriggerGUI.date");
1956 snprintf(command, 256,
"dateStream -c -s -D -o %s -# %d -C -run %d",
1957 dateFileName, 1, 0);
1958 FILE* pipe = gSystem->OpenPipe(command,
"w");
1960 UInt_t detectorPattern = 0;
1961 fprintf(pipe,
"GDC DetectorPattern %u\n", detectorPattern);
1966 for (Int_t iDet = 0; iDet < AliDAQ::kNDetectors; iDet++) {
1967 for (Int_t iDDL = 0; iDDL < AliDAQ::NumberOfDdls(iDet); iDDL++) {
1969 Int_t ddlID = AliDAQ::DdlID(iDet,iDDL);
1970 Int_t ldcID = Int_t(ldc + 0.0001);
1971 ldc += AliDAQ::NumberOfLdcs(iDet) / AliDAQ::NumberOfDdls(iDet);
1973 char rawFileName[256];
1974 snprintf(rawFileName, 256,
"%s",AliDAQ::DdlFileName(iDet,iDDL));
1976 FILE* file = fopen(rawFileName,
"rb");
1977 if (!file)
continue;
1978 fseek(file, 0, SEEK_END);
1979 unsigned long size = ftell(file);
1981 if (!size)
continue;
1983 if (ldcID != prevLDC) {
1984 fprintf(pipe,
" LDC Id %d\n", ldcID);
1987 fprintf(pipe,
" Equipment Id %d Payload %s\n", ddlID, rawFileName);
1990 Int_t result = gSystem->ClosePipe(pipe);
1991 printf(
"ClosePipe: %d \n",result);
1996 char rootFileName[256];
1997 snprintf(rootFileName,256,
"TriggerGUI.root");
2000 const Int_t kDBSize = 2000000000;
2001 const Int_t kTagDBSize = 1000000000;
2002 const Bool_t kFilter = kFALSE;
2003 const Int_t kCompression = 1;
2005 char* path = gSystem->Which(gSystem->Getenv(
"PATH"),
"alimdc");
2007 printf(
"the program alimdc was not found\n");
2013 printf(
"converting DATE file %s to root file %s \n",
2014 dateFileName, rootFileName);
2016 const char* rawDBFS[2] = {
"/tmp/mdc1",
"/tmp/mdc2" };
2017 const char* tagDBFS =
"/tmp/mdc1/tags";
2020 if (gSystem->Getenv(
"ALIMDC_RAWDB1"))
2021 rawDBFS[0] = gSystem->Getenv(
"ALIMDC_RAWDB1");
2022 if (gSystem->Getenv(
"ALIMDC_RAWDB2"))
2023 rawDBFS[1] = gSystem->Getenv(
"ALIMDC_RAWDB2");
2024 if (gSystem->Getenv(
"ALIMDC_TAGDB"))
2025 tagDBFS = gSystem->Getenv(
"ALIMDC_TAGDB");
2027 gSystem->Exec(Form(
"rm -rf %s",rawDBFS[0]));
2028 gSystem->Exec(Form(
"rm -rf %s",rawDBFS[1]));
2029 gSystem->Exec(Form(
"rm -rf %s",tagDBFS));
2031 gSystem->Exec(Form(
"mkdir %s",rawDBFS[0]));
2032 gSystem->Exec(Form(
"mkdir %s",rawDBFS[1]));
2033 gSystem->Exec(Form(
"mkdir %s",tagDBFS));
2035 result = gSystem->Exec(Form(
"alimdc %d %d %d %d %s",
2036 kDBSize, kTagDBSize, kFilter, kCompression,
2038 gSystem->Exec(Form(
"mv %s/*.root %s", rawDBFS[0], rootFileName));
2040 gSystem->Exec(Form(
"rm -rf %s",rawDBFS[0]));
2041 gSystem->Exec(Form(
"rm -rf %s",rawDBFS[1]));
2042 gSystem->Exec(Form(
"rm -rf %s",tagDBFS));
2054 Int_t pos, over, number, nStripX, nStripY;
2057 if (board == 0)
return;
2066 for (Int_t imt = 0; imt <
kNMT; imt++) {
2068 for (Int_t ix = 0; ix < nStripX; ix++) {
2072 for (Int_t iy = 0; iy < nStripY; iy++) {
2076 for (Int_t io = 1; io <= over; io++) {
2077 if (io == pos)
continue;
2096 for (Int_t ib = 0; ib <
kNBoards; ib++) {
Int_t GetNofLocations() const
AliMUONMCDataInterface * fMCDataInterface
MC data interface.
void SetName(const Char_t *name)
set the name of the board gui window
UChar_t GetYOver() const
get neighbouring boards with common y strips
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
Reading Raw data class for trigger and tracker chambers.
void SetMakeTriggerDigits(Bool_t flag=kFALSE)
Set flag whether or not we should generate digits for the trigger.
TFile * Open(const char *filename, Long64_t &nevents)
void ReadFromFile(AliMUONCalibrationData *calibData)
The iterator over detection elements.
virtual Int_t GetSize() const
Number of digits we store.
Int_t GetYSix1() const
get first x-index in detector element for a y-strip
const AliMpVSegmentation * GetMpSegmentation(Int_t detElemId, AliMp::CathodType cath, Bool_t warn=true) const
Int_t GetNumber() const
get the number of this board
UChar_t GetPosition() const
get the board position inside the detector element in y direction
AliMpLocalBoard * GetLocalBoard(Int_t localBoardId, Bool_t warn=true) const
virtual AliMUONVDigitStore * Create() const
Create an (empty) object of the same concrete class as *this.
Interface for a digit container.
Int_t GetYDig(Int_t imt, Int_t is) const
get the digit amplitude for a y-strip in a given chamber
Int_t fCurrentRawEvent
Current event for raw data input.
Int_t GetXSix() const
get x-index in detector element for an x-strip
Implementation of AliMUONVTriggerStore.
static AliMpSegmentation * Instance(Bool_t warn=true)
Concrete implementation of AliMUONVDigitStore for real digits.
void MakeGeometry()
create the display geometry from the mapping pads
void SetNumber(Int_t id)
set the number of this board
TObjArray * Boards()
Access the array of trigger boards.
void SetLoader(AliLoader *const loader)
set the current muon loader
AliMUONTriggerCrateStore * fCrateManager
trigger boards manager
void CloseControl() const
Char_t * GetBoardName() const
get the standard name of this board
Float_t GetYCenter(Int_t imt) const
get y-center of the board in chamber imt
static MpPair_t GetDetElemIdRange(Int_t chamberId)
virtual void Print(Option_t *opt="") const
Int_t LoLpt() const
Return Low pt.
static Bool_t LoadDDLStore(Bool_t warn=false)
void SetRawDigitStore(AliMUONDigitStoreV1 *const ds)
set the digit store from raw data
Int_t GetYSix2() const
get last x-index in detector element for a y-strip
virtual void Clear(Option_t *opt="")
Clear ourselves (i.e. Reset)
void AddPadY(const AliMpPad &pad, Int_t ich)
add a mapping y-pad
void SetRawTriggerStore(AliMUONTriggerStoreV1 *const ts)
set the trigger store from raw data
virtual void InitBoards()
void SetBoardName(const Char_t *name)
set the standard name of this board
Int_t CurrentDEId() const
Graphical User Interface utility class for the MUON trigger detector.
Int_t fEvent
Current event number.
void SetCrateName(const Char_t *name)
set the name of the crate containing this board
AliMUONCalibrationData * fCalibrationData
Calibration data for MUON.
void SetStatus(UShort_t s)
set the working status of this board
Class that manages the properties of the local board.
virtual void SetCharge(Float_t q)=0
Set the charge of this digit.
Int_t GetIdCircuit() const
get the id of the circuit
AliMUONTriggerElectronics * fTriggerProcessor
The GUI trigger processor.
TGTextBuffer * fTxtFETRegOff
Regional crate to FET OFF.
AliMUONLocalTriggerBoard * LocalBoard(Int_t boardNumber) const
void SetLoader(AliLoader *const loader)
set the current muon loader
virtual AliMpPad PadByIndices(Int_t ix, Int_t iy, Bool_t warning=true) const =0
Find pad by indices.
Int_t LoHpt() const
Return High p.
(Legacy) implementation of AliMUONVDigitStore
Int_t LoStripY() const
Return Y strip in MT11.
void CloseFETRegOn() const
A container for AliMUONTriggerCrate objects.
AliLoader * fLoader
The MUON loader.
virtual UShort_t GetSwitch(Int_t i) const
Return i-th Switch value.
Int_t Raw2Digits(AliRawReader *rawReader, AliMUONVDigitStore *digitContainer=0, AliMUONVTriggerStore *triggerStore=0)
TGTransientFrame * fControl
Run control window.
void SetYDigBox(Int_t imt, Int_t is, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
set y-strip box for display
void AddPadX(const AliMpPad &pad, Int_t ich)
add a mapping x-pad
Manager class for muon trigger electronics.
Bool_t IsOn() const
return info if the map is open
TGMainFrame * fMain
The main frame.
virtual AliMUONVDigit * Add(const AliMUONVDigit &digit, EReplacePolicy replace)
AliMUONTriggerStoreV1 * fRawTriggerStore
Trigger store from raw data.
AliMUONDigitStoreV2R * fDigitStore
GUI digit store (DSET)
void ClearYDigits()
delete the set y-digits
Bool_t fBoardsInit
Control the InitBoards only once.
TGTransientFrame * fFETRegOn
FET ON for a regional card.
static AliMpDDLStore * Instance(Bool_t warn=true)
void SetXDigBox(Int_t imt, Int_t is, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
set x-strip box for display
void SetMCDataInterface(AliMUONMCDataInterface *const mc)
set the MC data interface
Int_t LoStripX() const
Return X strip in MT11.
void SetBoard(AliMUONTriggerGUIboard *const b)
set the board associated to this instance
Int_t Digits2Raw(const AliMUONVDigitStore *digitStore, const AliMUONVTriggerStore *triggerStore)
UShort_t GetStatus() const
get the working status of this board
Reconstructed Local Trigger object.
void SetDigitY(Int_t imt, Int_t is, Int_t amp)
set a y-strip digit in a chamber with amplitude = amp
Float_t GetXWidth(Int_t imt) const
get x-width of the board in chamber imt
Implementation of local trigger board objects.
TString * fEvString
Event number string.
void SetOpen(Bool_t open)
set true if this board has a gui active
Char_t * GetCrateName() const
get the name of the crate containing this board
void PrintDigitStore() const
void SetCrateManager(AliMUONTriggerCrateStore *const crates)
set the trigger boards manager
virtual Int_t MaxPadIndexY() const =0
Return maximum pad index in Y direction.
TGTextBuffer * fTxtBuffer1
Path to the data (galice.root)
Bool_t fControlOn
If the control frame is open.
Int_t GetXSiy2() const
get last y-index in detector element for an x-strip
void HandleMenu(Int_t id)
void CloseCircuit() const
virtual Int_t Cathode() const =0
Cathode number this digit is on (0 or 1)
AliRawReader * fRawReader
Reader for raw data input.
virtual TIterator * CreateLocalIterator() const
Create iterator on local trigger.
Double_t GetPositionY() const
Return the pad x position (in cm)
Int_t GetDetElemId() const
get the id of the detector element
virtual TIterator * CreateIterator() const
Create an iterator to loop over all our digits.
void FETboard(Int_t ib, Int_t amp)
virtual AliMUONGlobalTrigger * Global() const
Return global trigger.
TGTransientFrame * fCircuit
Circuit window.
Int_t GetYSiy() const
get y-index in detector element for a y-strip
virtual TString GetCrate() const
Return Crate name.
TGImageMap * fImageMap
The image map of the main frame.
void ClearXDigits()
delete the set x-digits
void PrintTriggerStore() const
Trigger GUI utility class: digits maps of the trigger chambers.
virtual void SetPadXY(Int_t padx, Int_t pady)=0
Set the ix and iy of this digit.
Float_t GetYWidth(Int_t imt) const
get y-width of the board in chamber imt
Bool_t fRUNRAW
True if run with raw data (root)
AliMp::CathodType GetCathodType(Int_t cathodNumber)
Convert integer number in enum;.
Float_t GetXCenter(Int_t imt) const
get x-center of the board in chamber imt
Int_t LoDev() const
Return Deviation.
TGTextBuffer * fTxtCircuit
Circuit to open.
Int_t GetLocalBoardId(Int_t i) const
TGTransientFrame * fError
Error window.
Raw data class for trigger and tracker chambers.
void WriteTriggerRawData()
void CreateTriggerStore()
Int_t GetXSiy1() const
get first y-index in detector element for an x-strip
void CloseFETRegOff() const
Trigger GUI utility class: single board object.
TGTextEntry * fSkipToEventTxt
Control field shows current event number.
TObjArray * fBoards
The array of trigger boards.
Bool_t IsValid() const
Return validity.
Single entry point to access MUON calibration data.
AliRunLoader * fRunLoader
The run loader.
Easy to use data access to MC information.
The abstract base class for the segmentation.
Double_t GetDimensionY() const
Return the y pad dimension - half length (in cm)
virtual AliMUONVDigitStore * Create() const
Create an (empty) object of the same concrete class as *this.
void SetHeader(AliRawDataHeaderSim &header)
Set the header of DDL.
Int_t PairFirst(MpPair_t pair)
Decode the first integer from encoded pair.
virtual AliMUONTriggerStoreV1 * Create() const
Whether the Connect(TTree&) method is implemented.
virtual Int_t MaxPadIndexX() const =0
Return maximum pad index in X direction.
TGTransientFrame * fRunInput
Run input window.
TString * fPath
Path string to galice.
void SetStripBoxes(AliMUONTriggerGUIboard *board)
void SetDetElemId(Int_t id)
set the number of the detector element containing this board
Trigger GUI utility class: single board map of the strips/digits.
Class which encapsuate all information about a pad.
void CloseRunInput() const
TGTextBuffer * fTxtBuffer2
Current event number.
TGTransientFrame * fFETRegOff
FET OFF for a regional card.
TString * fFileName
Full galice file name.
Bool_t fTStoreOn
True if DSET trigger store has data.
Int_t GetNStripX() const
get number of x strips
Double_t GetPositionX() const
Return the pad x position (in cm)
AliMUONTriggerGUIdimap * fDiMap
Digits map.
void DoFETRegRun(Int_t onoff)
Int_t fEventsPerRun
Number of events per file (run)
AliMUONTriggerGUIboard * GetBoard(Int_t id) const
Int_t PairSecond(MpPair_t pair)
Decode the second integer from encoded pair.
virtual void Clear(Option_t *opt="")
Clear ourselves (i.e. Reset)
TGTextBuffer * fTxtFETRegOn
Regional crate to FET ON.
Int_t GetNStripY() const
get number of y strips
virtual void Digits2Trigger(const AliMUONVDigitStore &digitStore, AliMUONVTriggerStore &triggerStore)
void SetMCDataInterface(AliMUONMCDataInterface *const mc)
set the MC data interface
Int_t GetLocalBoardChannel(Int_t i) const
Double_t GetDimensionX() const
Return the x pad dimension - half length (in cm)
Int_t LoCircuit() const
Return Circuit number.
AliMUONTriggerStoreV1 * fTriggerStore
Trigger store with GUI digit store.
void DoErrorGUI(const Char_t *wt)
void SetRawDigitStore(AliMUONDigitStoreV1 *const ds)
set the digit store from raw data
Int_t GetXDig(Int_t imt, Int_t is) const
get the digit amplitude for an x-strip in a given chamber
void SetDigitX(Int_t imt, Int_t is, Int_t amp)
set an x-strip digit in a chamber with amplitude = amp
void SelectBoard(Int_t ib)
AliMUONDigitStoreV1 * fRawDigitStore
Digit store from raw data.