29 #include <TRootEmbeddedCanvas.h>
32 #include <TPaveText.h>
34 #include <TObjArray.h>
36 #include "AliLoader.h"
37 #include "AliRunLoader.h"
71 gStyle->SetPadLeftMargin(0.05);
72 gStyle->SetPadRightMargin(0.05);
73 gStyle->SetPadTopMargin(0.05);
74 gStyle->SetPadBottomMargin(0.05);
80 fMain =
new TGTransientFrame(p, main, w, h, kVerticalFrame);
81 fMain->Connect(
"CloseWindow()",
"AliMUONTriggerGUIdimap",
this,
"DoClose()");
82 fMain->DontCallClose();
85 fMain->SetCleanup(kDeepCleanup);
87 TGHorizontalFrame *hframe =
new TGHorizontalFrame(fMain, 60, 20, kFixedWidth);
89 TGTextButton *closeButton =
new TGTextButton(hframe,
"Close", 1);
90 closeButton->Connect(
"Clicked()",
"AliMUONTriggerGUIdimap",
this,
"DoClose()");
92 hframe->AddFrame(closeButton,
93 new TGLayoutHints(kLHintsTop |
98 hframe->Resize(150, closeButton->GetDefaultHeight());
100 TGTextButton *updateButton =
new TGTextButton(hframe,
"Update", 2);
101 updateButton->Connect(
"Clicked()",
"AliMUONTriggerGUIdimap",
this,
"DoUpdate()");
102 updateButton->SetToolTipText(
"Read the digits for the current event");
104 hframe->AddFrame(updateButton,
105 new TGLayoutHints(kLHintsTop |
110 hframe->Resize(150, updateButton->GetDefaultHeight());
124 fMain->AddFrame(hframe,
125 new TGLayoutHints(kLHintsBottom |
130 TGTab *tab =
new TGTab(fMain, 300, 300);
134 TGLayoutHints *lot =
new TGLayoutHints(kLHintsTop |
140 TGCompositeFrame *tf = 0;
143 tf = tab->AddTab(
"MT11");
145 TGCompositeFrame *cf1 =
new TGCompositeFrame(tf, 60, 60, kHorizontalFrame);
146 fEc[0] =
new TRootEmbeddedCanvas(
"ec1", cf1, 500, 500);
147 cf1->AddFrame(fEc[0], lot);
149 tf->AddFrame(cf1, lot);
150 fEc[0]->GetCanvas()->SetBorderMode(0);
151 fEc[0]->GetCanvas()->SetBit(kNoContextMenu);
154 tf = tab->AddTab(
"MT12");
156 TGCompositeFrame *cf2 =
new TGCompositeFrame(tf, 60, 60, kHorizontalFrame);
157 fEc[1] =
new TRootEmbeddedCanvas(
"ec2", cf2, 500, 500);
158 cf2->AddFrame(fEc[1], lot);
160 tf->AddFrame(cf2, lot);
161 fEc[1]->GetCanvas()->SetBorderMode(0);
162 fEc[1]->GetCanvas()->SetBit(kNoContextMenu);
165 tf = tab->AddTab(
"MT21");
167 TGCompositeFrame *cf3 =
new TGCompositeFrame(tf, 60, 60, kHorizontalFrame);
168 fEc[2] =
new TRootEmbeddedCanvas(
"ec3", cf3, 500, 500);
169 cf3->AddFrame(fEc[2], lot);
171 tf->AddFrame(cf3, lot);
172 fEc[2]->GetCanvas()->SetBorderMode(0);
173 fEc[2]->GetCanvas()->SetBit(kNoContextMenu);
176 tf = tab->AddTab(
"MT22");
178 TGCompositeFrame *cf4 =
new TGCompositeFrame(tf, 60, 60, kHorizontalFrame);
179 fEc[3] =
new TRootEmbeddedCanvas(
"ec4", cf4, 500, 500);
180 cf4->AddFrame(fEc[3], lot);
182 tf->AddFrame(cf4, lot);
183 fEc[3]->GetCanvas()->SetBorderMode(0);
184 fEc[3]->GetCanvas()->SetBit(kNoContextMenu);
187 new TGLayoutHints(kLHintsBottom |
193 fMain->MapSubwindows();
196 fMain->CenterOnParent();
198 fMain->SetWindowName(
"Chambers digit maps");
209 for (Int_t it = 0; it <
kNMT; it++) {
210 for (Int_t ib = 0; ib <
kNBoards; ib++) {
215 fMain->DeleteWindow();
243 Bool_t drawDigits = kTRUE;
244 Bool_t drawDigitsRaw = kTRUE;
249 drawDigitsRaw = kFALSE;
254 TCanvas *canvas =
fEc[chamber-11]->GetCanvas();
262 Int_t detElemId, cathode, ix, iy, charge, color;
263 Int_t holdS, holdL, holdC;
264 Float_t xCenter, yCenter, xWidth, yWidth, holdXC, holdYC;
265 Float_t xMin, xMax, yMin, yMax;
266 Float_t ptx1, ptx2, pty1, pty2;
267 Float_t xpmin, xpmax, ypmin, ypmax;
268 Float_t xg1, xg2, yg1, yg2, zg1;
270 Float_t frameXmax = 0., frameYmax = 0.;
300 for (Int_t ib = 0; ib <
kNBoards; ib++) {
316 xMin = xCenter - xWidth/2;
317 xMax = xCenter + xWidth/2;
318 yMin = yCenter - yWidth/2;
319 yMax = yCenter + yWidth/2;
321 fPaveBoard[chamber-11][ib] =
new TPave(xMin,yMin,xMax,yMax,1);
322 fPaveBoard[chamber-11][ib]->SetBit(kCannotPick);
326 Float_t lWidth = 12.0;
330 snprintf(cln,4,
"C%1d",holdC);
332 ptx1 = holdXC - lWidth;
333 ptx2 = holdXC + lWidth;
334 pty1 = +1.065*frameYmax - lWidth;
335 pty2 = +1.065*frameYmax + lWidth;
337 label =
new TPaveText(ptx1,pty1,ptx2,pty2,cln);
339 label->SetBorderSize(0);
340 label->SetBit(kCannotPick);
345 snprintf(cln,4,
"C%1d",holdC);
347 ptx1 = holdXC - lWidth;
348 ptx2 = holdXC + lWidth;
349 pty1 = -1.065*frameYmax - lWidth;
350 pty2 = -1.065*frameYmax + lWidth;
352 label =
new TPaveText(ptx1,pty1,ptx2,pty2,cln);
354 label->SetBorderSize(0);
355 label->SetBit(kCannotPick);
358 if (holdS == 0 && holdC == 7) {
360 snprintf(cln,4,
"L%1d",holdL);
362 ptx1 = -1.07*frameXmax - lWidth;
363 ptx2 = -1.07*frameXmax + lWidth;
364 pty1 = holdYC - lWidth;
365 pty2 = holdYC + lWidth;
367 label =
new TPaveText(ptx1,pty1,ptx2,pty2,cln);
369 label->SetBorderSize(0);
370 label->SetBit(kCannotPick);
373 if (holdS == 1 && holdC == 7) {
375 snprintf(cln,4,
"L%1d",holdL);
377 ptx1 = +1.07*frameXmax - lWidth;
378 ptx2 = +1.07*frameXmax + lWidth;
379 pty1 = holdYC - lWidth;
380 pty2 = holdYC + lWidth;
382 label =
new TPaveText(ptx1,pty1,ptx2,pty2,cln);
384 label->SetBorderSize(0);
385 label->SetBit(kCannotPick);
393 Int_t imt = chamber -11;
394 Int_t nStripX, nStripY;
396 for (Int_t ib = 0; ib <
kNBoards; ib++) {
406 for (Int_t is = 0; is < nStripX; is++) {
408 if (board->
GetXDig(imt,is) == 0)
continue;
412 xpmin = box->GetX1();
413 xpmax = box->GetX2();
414 ypmin = box->GetY1();
415 ypmax = box->GetY2();
422 box->DrawBox(xpmin,ypmin,xpmax,ypmax);
426 for (Int_t is = 0; is < nStripY; is++) {
428 if (board->
GetYDig(imt,is) == 0)
continue;
432 xpmin = box->GetX1();
433 xpmax = box->GetX2();
434 ypmin = box->GetY1();
435 ypmax = box->GetY2();
442 box->DrawBox(xpmin,ypmin,xpmax,ypmax);
450 if (drawDigits || drawDigitsRaw) {
458 AliRunLoader *runLoader =
fLoader->GetRunLoader();
468 while ( ( mdig = static_cast<AliMUONVDigit*>(next()) ) ) {
474 detElemId=mdig->DetElemId();
475 charge = (Int_t)mdig->Charge();
476 color = 261+5*(charge-1);
477 if (color > 282) color = 282;
479 if (detElemId/100 != chamber)
continue;
491 transformer.
Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1);
503 boxd =
new TBox(xpmin,ypmin,xpmax,ypmax);
504 boxd->SetBit(kCannotPick);
505 boxd->SetFillStyle(1001);
506 boxd->SetFillColor(2);
553 for (Int_t it = 0; it <
kNMT; it++) {
554 for (Int_t ib = 0; ib <
kNBoards; ib++) {
565 for (Int_t ib = 0; ib <
kNBoards; ib++) {
577 for (Int_t it = 0; it <
kNMT; it++) {
579 TCanvas *canvas =
fEc[it]->GetCanvas();
582 for (Int_t ib = 0; ib <
kNBoards; ib++) {
598 for (Int_t it = 0; it <
kNMT; it++) {
600 TCanvas *canvas =
fEc[it]->GetCanvas();
618 fMain->CloseWindow();
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 GetSide() const
get detector side (Left=0 , Right=1)
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
static AliMpSegmentation * Instance(Bool_t warn=true)
Int_t GetCol() const
get column
TBox * GetXDigBox(Int_t imt, Int_t is) const
get x-strip box for display
Float_t GetYCenter(Int_t imt) const
get y-center of the board in chamber imt
Bool_t fIsOn
True if the map is open.
TObjArray * fBoards
Array of boards.
Int_t GetYSix2() const
get last x-index in detector element for a y-strip
void DoTab(Int_t id) const
virtual AliMpPad PadByIndices(Int_t ix, Int_t iy, Bool_t warning=true) const =0
Find pad by indices.
virtual TIterator * CreateIterator() const =0
Create an iterator to loop over all our digits.
AliMUONVDigitStore * DigitStore(Int_t event)
TGTransientFrame * fMain
Main frame.
Int_t GetLine() const
get line
Float_t GetXWidth(Int_t imt) const
get x-width of the board in chamber imt
Int_t GetXSiy2() const
get last y-index in detector element for an x-strip
virtual Int_t Cathode() const =0
Cathode number this digit is on (0 or 1)
Double_t GetPositionY() const
Return the pad x position (in cm)
AliMUONMCDataInterface * fMCDataInterface
MC data interface.
Trigger GUI utility class: digits maps of the trigger chambers.
Float_t GetYWidth(Int_t imt) const
get y-width of the board in chamber imt
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
TBox * GetYDigBox(Int_t imt, Int_t is) const
get y-strip box for display
virtual ~AliMUONTriggerGUIdimap()
Int_t GetXSiy1() const
get first y-index in detector element for an x-strip
Trigger GUI utility class: single board object.
AliMUONDigitStoreV1 * fRawDigitStore
Raw data digit store.
The abstract base class for the segmentation.
Bool_t IsOpen() const
true if this board has a gui active
Double_t GetDimensionY() const
Return the y pad dimension - half length (in cm)
Class which encapsuate all information about a pad.
Double_t GetPositionX() const
Return the pad x position (in cm)
void DrawMaps(Int_t chamber)
TPave * fPaveBoard[kNMT][kNBoards]
Drawing of the board.
AliLoader * fLoader
The MUON loader.
int main(int argc, char **argv)
Double_t GetDimensionX() const
Return the x pad dimension - half length (in cm)
TRootEmbeddedCanvas * fEc[kNMT]
Canvases for drawing the digits.
Int_t GetXDig(Int_t imt, Int_t is) const
get the digit amplitude for an x-strip in a given chamber
void SelectBoard(Int_t ib)