source: trunk/MagicSoft/Mars/mmain/MEventDisplay.cc@ 4722

Last change on this file since 4722 was 4722, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 21.2 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz, 10/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2003
21!
22!
23\* ======================================================================== */
24#include "MEventDisplay.h"
25
26//
27// C-lib
28//
29#include <stdlib.h> // atoi
30
31//
32// root
33//
34#include <TFile.h> // TFile
35#include <TTree.h> // TTree
36#include <TList.h> // TList::Add
37#include <TStyle.h> // gStyle->SetOptStat
38#include <TCanvas.h> // TCanvas::cd
39
40//
41// root GUI
42//
43#include <TGLabel.h> // TGLabel
44#include <TGButton.h> // TGPictureButton
45#include <TG3DLine.h> // TGHorizontal3DLine
46#include <TGTextEntry.h> // TGTextEntry
47#include <TGButtonGroup.h> // TGVButtonGroup
48#include <TRootEmbeddedCanvas.h> // TRootEmbeddedCanvas
49
50//
51// General
52//
53#include "MGList.h" // MGList
54
55#include "MLog.h"
56#include "MLogManip.h"
57
58#include "MParList.h" // MParList::AddToList
59#include "MEvtLoop.h" // MEvtLoop::GetParList
60#include "MTaskList.h" // MTaskList::AddToList
61
62//
63// Tasks
64//
65#include "MReadMarsFile.h" // MReadMarsFile
66#include "MGeomApply.h" // MGeomApply
67#include "MFDataMember.h" // MFDataMember
68#include "MMcPedestalCopy.h" // MMcPedestalCopy
69#include "MMcPedestalNSBAdd.h" // MMcPedestalNSBAdd
70
71#include "MCerPhotAnal2.h" // MCerPhotAnal2
72#include "MImgCleanStd.h" // MImgCleanStd
73#include "MHillasCalc.h" // MHillasCalc
74#include "MHillasSrcCalc.h" // MHillasSrcCalc
75//#include "MBlindPixelCalc.h" // MBlindPixelCalc
76#include "MArrivalTimeCalc.h" // MArrivalTimeCalc
77#include "MFillH.h" // MFillH
78#include "MExtractSignal.h" // MExtractsignal
79#include "MMcCalibrationUpdate.h" // MMcCalibrationUpdate
80#include "MCalibrate.h" // MCalibrate
81#include "MMcTriggerLvl2Calc.h" // MMcTriggerLvl2Calc
82
83//
84// Container
85//
86#include "MHillas.h" // MHillas::Print(const MGeomCam&)
87#include "MHillasExt.h" // MHillasExt::Print(const MGeomCam&)
88#include "MHillasSrc.h" // MHillasSrc::Print(const MGeomCam&)
89#include "MNewImagePar.h" // MNewImagePar::Print(const MGeomCam&)
90#include "MHEvent.h" // MHEvent
91#include "MHCamera.h" // MHCamera
92#include "MRawEvtData.h" // MRawEvtData
93#include "MArrivalTimeCam.h" // MArrivalTimeCam
94#include "MBadPixelsCam.h" // MBadPixelsCam
95#include "MPedPhotCam.h" // MPedPhotCam
96#include "MCalibrationChargeCam.h" // MCalibrationChargeCam
97#include "MMcTriggerLvl2.h" // MMcTriggerLvl2
98
99using namespace std;
100
101ClassImp(MEventDisplay);
102
103// --------------------------------------------------------------------------
104//
105// Constructor.
106//
107MEventDisplay::MEventDisplay(const char *fname, const char *pname, const char *cname) : MStatusDisplay()
108{
109 //
110 // Setup Task list for hillas calculation
111 //
112 SetupTaskList("Events", fname, pname, cname);
113
114 //
115 // Add MEventDisplay GUI elements to the display
116 //
117 AddUserFrame(fname);
118
119 //
120 // Show new part of the window, resize to correct aspect ratio
121 //
122 // FIXME: This should be done by MStatusDisplay automatically
123 Resize(GetWidth(), GetHeight() + fUserFrame->GetDefaultHeight());
124 SetWindowName("Event Display");
125 MapSubwindows();
126
127 //
128 // Readin first event and display it
129 //
130 ReadFirstEvent();
131}
132
133// --------------------------------------------------------------------------
134//
135// Destructor: PostProcess eventloop, delete eventloop with all containers
136//
137MEventDisplay::~MEventDisplay()
138{
139 fEvtLoop->PostProcess();
140 delete fEvtLoop;
141}
142
143Int_t MEventDisplay::GetFileType(const char *tree, const char *fname) const
144{
145 TFile f(fname, "READ");
146 TTree *t = (TTree*)f.Get(tree);
147 if (!t)
148 return -1;
149
150 if (t->FindBranch("MCerPhotEvt."))
151 return 1;
152
153 if (t->FindBranch("MRawEvtData."))
154 return 2;
155
156 return -2;
157}
158
159// --------------------------------------------------------------------------
160//
161// Setup Task and parameter list for hillas calculation,
162// preprocess tasks and read in first event (process)
163//
164void MEventDisplay::SetupTaskList(const char *tname, const char *fname,
165 const char *pname, const char *cname)
166{
167 MCalibrationChargeCam *ccam=0;
168 MPedPhotCam *pcam=0;
169
170 MBadPixelsCam *badpix = new MBadPixelsCam;
171
172 const Int_t type = GetFileType(tname, fname);
173 switch (type)
174 {
175 case 1: gLog << all << "Calibrated Data File detected..." << endl; break;
176 case 2: gLog << all << "Raw Data File detected..." << endl; break;
177 case -2: gLog << err << "File type unknown... abort." << endl; return;
178 case -1: gLog << err << "Tree " << tname << " not found... abort." << endl; return;
179 }
180
181 if (type==2)
182 {
183 TFile file(pname, "READ");
184 if (!file.IsZombie())
185 pcam = new MPedPhotCam;
186 if (pcam)
187 {
188 if (pcam->Read()<=0)
189 {
190 delete pcam;
191 pcam = NULL;
192 }
193
194 if (file.FindKey("MBadPixelsCam"))
195 {
196 MBadPixelsCam bad;
197 if (bad.Read()>0)
198 badpix->Merge(bad);
199 }
200 }
201 file.Close();
202 file.Open(cname, "READ");
203 if (!file.IsZombie())
204 ccam = new MCalibrationChargeCam;
205 if (ccam)
206 {
207 if (ccam->Read()<=0)
208 {
209 delete ccam;
210 ccam = NULL;
211 }
212
213 if (file.FindKey("MBadPixelsCam"))
214 {
215 MBadPixelsCam bad;
216 if (bad.Read()>0)
217 badpix->Merge(bad);
218 }
219 }
220 file.Close();
221 }
222
223 //
224 // Setup an empty job, with a reader task only.
225 // All tasks and parameter containers are deleted automatically
226 // (via SetOwner())
227 //
228 MTaskList *tlist = new MTaskList;
229 tlist->SetOwner();
230
231 MReadMarsFile *read = new MReadMarsFile(tname, fname);
232 read->DisableAutoScheme();
233 tlist->AddToList(read);
234
235 MGeomApply *apl = new MGeomApply;
236 tlist->AddToList(apl);
237
238 MParList *plist = new MParList;
239 plist->SetOwner();
240 plist->AddToList(tlist);
241 plist->AddToList(badpix);
242 if (pcam)
243 plist->AddToList(pcam);
244 if (ccam)
245 plist->AddToList(ccam);
246
247 fEvtLoop = new MEvtLoop;
248 fEvtLoop->SetOwner();
249 fEvtLoop->SetParList(plist);
250 fEvtLoop->ReadEnv("mars.rc");
251
252 MHEvent *evt01 = new MHEvent(MHEvent::kEvtSignalRaw);
253 MHEvent *evt02 = new MHEvent(MHEvent::kEvtSignalRaw);
254 MHEvent *evt03 = new MHEvent(MHEvent::kEvtPedestal);
255 MHEvent *evt04 = new MHEvent(MHEvent::kEvtPedestalRMS);
256 MHEvent *evt05 = new MHEvent(MHEvent::kEvtRelativeSignal);
257 MHEvent *evt06a= new MHEvent(MHEvent::kEvtCleaningData);
258 MHEvent *evt06b= new MHEvent(MHEvent::kEvtCleaningLevels);
259 MHEvent *evt07 = new MHEvent(MHEvent::kEvtIdxMax);
260 MHEvent *evt08 = new MHEvent(MHEvent::kEvtArrTime);
261 MHEvent *evt09 = new MHEvent(MHEvent::kEvtTrigPix);
262 MHEvent *evt10 = new MHEvent(MHEvent::kEvtIslandIndex);
263
264 evt01->SetName("Signal");
265 evt02->SetName("Cleaned");
266 evt03->SetName("Pedestal");
267 evt04->SetName("PedRMS");
268 evt05->SetName("Signal/PedRMS");
269 evt06a->SetName("CleanData");
270 evt06b->SetName("CleanLevels");
271 evt07->SetName("Max Slice Idx");
272 evt08->SetName("Arrival Time");
273 evt09->SetName("Trigger");
274 evt10->SetName("Islands");
275
276 // This makes sure, that the containers are deleted...
277 plist->AddToList(evt01);
278 plist->AddToList(evt02);
279 plist->AddToList(evt03);
280 plist->AddToList(evt04);
281 plist->AddToList(evt05);
282 plist->AddToList(evt06a);
283 plist->AddToList(evt06b);
284 plist->AddToList(evt07);
285 plist->AddToList(evt08);
286 plist->AddToList(evt09);
287 plist->AddToList(evt10);
288
289 MCerPhotAnal2 *nanal = new MCerPhotAnal2;
290 MFillH *fill01 = new MFillH(evt01, "MCerPhotEvt", "MFillH01");
291 MImgCleanStd *clean = new MImgCleanStd;
292 MFillH *fill02 = new MFillH(evt02, "MCerPhotEvt", "MFillH02");
293 MFillH *fill03 = new MFillH(evt03, "MPedPhotCam", "MFillH03");
294 MFillH *fill04 = new MFillH(evt04, "MPedPhotCam", "MFillH04");
295 MFillH *fill05 = new MFillH(evt05, "MCameraData", "MFillH05");
296 MFillH *fill06a= new MFillH(evt06a, "MCameraData", "MFillH06");
297 MFillH *fill06b= new MFillH(evt06b, "MCameraData", "MFillH06");
298// MBlindPixelCalc *blind = new MBlindPixelCalc;
299 MHillasCalc *hcalc = new MHillasCalc;
300 MHillasSrcCalc *scalc = new MHillasSrcCalc;
301 MMcTriggerLvl2Calc *trcal = new MMcTriggerLvl2Calc;
302 MFillH *fill09 = new MFillH(evt09, "MMcTriggerLvl2", "MFillH09");
303 MFillH *fill10 = new MFillH(evt10, "MCerPhotEvt", "MFillH10");
304
305 // If no pedestal or no calibration file is availble
306 if (type==2)
307 {
308 if (!pcam || !ccam)
309 {
310 MFilter *f1=new MFDataMember("MRawRunHeader.fRunType", '>', 255.5);
311 MFilter *f2=new MFDataMember("MRawRunHeader.fRunType", '<', 255.5);
312 f1->SetName("MFMonteCarlo");
313 f2->SetName("MFRealData");
314
315 MMcPedestalCopy *pcopy = new MMcPedestalCopy;
316 MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd;
317
318 MExtractSignal* extra = new MExtractSignal();
319 extra->SetRange(0, 14, 0, 14);
320 extra->SetSaturationLimit(240);
321
322 MMcCalibrationUpdate* mcupd = new MMcCalibrationUpdate;
323 mcupd->SetOuterPixelsGainScaling(kFALSE);
324
325 MCalibrate* mccal = new MCalibrate;
326 mccal->SetCalibrationMode(MCalibrate::kFfactor);
327
328 // MC
329 extra->SetFilter(f1);
330 mcupd->SetFilter(f1);
331 mccal->SetFilter(f1);
332 trcal->SetFilter(f1);
333 //fill09->SetFilter(f1);
334
335 // Data
336 nanal->SetFilter(f2);
337
338 // TaskList
339 tlist->AddToList(f1);
340 tlist->AddToList(f2);
341 tlist->AddToList(pcopy);
342 tlist->AddToList(pdnsb);
343
344 tlist->AddToList(extra);
345 tlist->AddToList(mcupd);
346 tlist->AddToList(mccal);
347
348
349 tlist->AddToList(nanal);
350 }
351 else
352 {
353 MCalibrate* calib = new MCalibrate;
354 tlist->AddToList(calib);
355 }
356 }
357
358 tlist->AddToList(fill01);
359 tlist->AddToList(clean);
360 tlist->AddToList(fill02);
361 tlist->AddToList(fill03);
362 tlist->AddToList(fill04);
363 tlist->AddToList(fill05);
364 tlist->AddToList(fill06a);
365 tlist->AddToList(fill06b);
366// tlist->AddToList(blind);
367 tlist->AddToList(hcalc);
368 tlist->AddToList(scalc);
369 tlist->AddToList(fill10);
370
371 if ((!pcam || !ccam) && type==2)
372 {
373 MArrivalTimeCalc *tcalc = new MArrivalTimeCalc;
374 MFillH *fill07 = new MFillH(evt07, "MRawEvtData", "MFillH7");
375 MFillH *fill08 = new MFillH(evt08, "MArrivalTimeCam", "MFillH8");
376 tlist->AddToList(tcalc);
377 tlist->AddToList(fill07);
378 tlist->AddToList(fill08);
379
380 tlist->AddToList(trcal);
381 tlist->AddToList(fill09);
382 }
383
384 if (type==1)
385 {
386 MFillH *fill08 = new MFillH(evt08, "MArrivalTime", "MFillH8");
387 tlist->AddToList(fill08);
388 }
389
390 //
391 // Now distribute Display to all tasks
392 //
393 tlist->SetDisplay(this);
394}
395
396// --------------------------------------------------------------------------
397//
398// Add the top part of the frame: This is filename and treename display
399//
400void MEventDisplay::AddTopFramePart1(TGCompositeFrame *frame,
401 const char *filename,
402 const char *treename)
403{
404 //
405 // --- the top1 part of the window ---
406 //
407 TGHorizontalFrame *top1 = new TGHorizontalFrame(frame, 1, 1);
408 fList->Add(top1);
409
410 //
411 // create gui elements
412 //
413 TGLabel *file = new TGLabel(top1, new TGString(Form("%s#%s", filename, treename)));
414 fList->Add(file);
415
416 //
417 // layout and add gui elements in/to frame
418 //
419 TGLayoutHints *laystd = new TGLayoutHints(kLHintsCenterX, 5, 5);
420 fList->Add(laystd);
421
422 top1->AddFrame(file, laystd);
423
424 //
425 // --- the top1 part of the window ---
426 //
427 TGHorizontalFrame *top2 = new TGHorizontalFrame(frame, 1, 1);
428 fList->Add(top2);
429
430 //
431 // layout and add frames
432 //
433 TGLayoutHints *laytop1 = new TGLayoutHints(kLHintsCenterX, 5, 5, 5);
434 fList->Add(laytop1);
435 frame->AddFrame(top1, laytop1);
436 frame->AddFrame(top2, laytop1);
437}
438
439// --------------------------------------------------------------------------
440//
441// Add the second part of the top frame: This are the event number controls
442//
443void MEventDisplay::AddTopFramePart2(TGCompositeFrame *frame)
444{
445 //
446 // --- the top2 part of the window ---
447 //
448 TGHorizontalFrame *top2 = new TGHorizontalFrame(frame, 1, 1);
449 fList->Add(top2);
450
451 //
452 // Create the gui elements
453 //
454 TGTextButton *prevevt = new TGTextButton(top2, " << ", kEvtPrev);
455 prevevt->Associate(this);
456
457 TGLabel *evtnr = new TGLabel(top2, new TGString("Event:"));
458
459 TGTextEntry *entry=new TGTextEntry(top2, new TGTextBuffer(100), kEvtNumber);
460 entry->Resize(60, entry->GetDefaultHeight());
461 entry->Associate(this);
462
463 fNumOfEvts = new TGLabel(top2, "of .");
464
465 TGTextButton *nextevt = new TGTextButton (top2, " >> ", kEvtNext);
466 nextevt->Associate(this);
467
468 //
469 // Add gui elements to 'atotodel'
470 //
471 fList->Add(prevevt);
472 fList->Add(evtnr);
473 fList->Add(entry);
474 fList->Add(fNumOfEvts);
475 fList->Add(nextevt);
476
477 //
478 // add the gui elements to the frame
479 //
480 TGLayoutHints *laystd = new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 5, 5);
481 fList->Add(laystd);
482
483 top2->AddFrame(prevevt, laystd);
484 top2->AddFrame(evtnr, laystd);
485 top2->AddFrame(entry, laystd);
486 top2->AddFrame(fNumOfEvts, laystd);
487 top2->AddFrame(nextevt, laystd);
488
489 TGLayoutHints *laystd2 = new TGLayoutHints(kLHintsCenterX, 5, 5, 5, 5);
490 fList->Add(laystd2);
491 frame->AddFrame(top2, laystd2);
492
493 //
494 // Add trailing line...
495 //
496 TGHorizontal3DLine *line = new TGHorizontal3DLine(frame);
497 TGLayoutHints *layline = new TGLayoutHints(kLHintsExpandX);
498 fList->Add(line);
499 fList->Add(layline);
500 frame->AddFrame(line, layline);
501}
502
503// --------------------------------------------------------------------------
504//
505// Add the user frame part of the display
506//
507void MEventDisplay::AddUserFrame(const char* filename)
508{
509 fUserFrame->ChangeOptions(kHorizontalFrame);
510
511 TGCompositeFrame *vf1 = new TGVerticalFrame(fUserFrame, 1, 1);
512 TGCompositeFrame *vf2 = new TGVerticalFrame(fUserFrame, 1, 1);
513
514 AddTopFramePart1(vf1, filename, "Events");
515 AddTopFramePart2(vf1);
516
517 // create root embedded canvas and add it to the tab
518 TRootEmbeddedCanvas *ec = new TRootEmbeddedCanvas("Slices", vf2, vf1->GetDefaultHeight()*3/2, vf1->GetDefaultHeight(), 0);
519 vf2->AddFrame(ec);
520 fList->Add(ec);
521
522 // set background and border mode of the canvas
523 fCanvas = ec->GetCanvas();
524 fCanvas->SetBorderMode(0);
525 gROOT->GetListOfCanvases()->Add(fCanvas);
526 //fCanvas->SetBorderSize(1);
527 //fCanvas->SetBit(kNoContextMenu);
528 //fCanvas->SetFillColor(16);
529
530 TGLayoutHints *lay = new TGLayoutHints(kLHintsExpandX);
531 fUserFrame->AddFrame(vf1, lay);
532 fUserFrame->AddFrame(vf2);
533}
534
535// --------------------------------------------------------------------------
536//
537// Checks if the event number is valid, and if so reads the new event
538// and updates the display
539//
540void MEventDisplay::ReadinEvent(Int_t dir)
541{
542 MParList *plist = (MParList*) fEvtLoop->GetParList();
543 MTaskList *tlist = (MTaskList*) fEvtLoop->GetTaskList();
544 MGeomCam *geom = (MGeomCam*) plist->FindObject("MGeomCam");
545 MRawEvtData *raw = (MRawEvtData*)plist->FindObject("MRawEvtData");
546
547 //
548 // Read first event.
549 //
550 MReadTree *reader = (MReadTree*)fEvtLoop->FindTask("MRead");
551
552 const Int_t num = reader->GetNumEntry();
553
554 do
555 {
556 if (dir<0 && !reader->DecEventNum())
557 {
558 reader->SetEventNum(num);
559 return;
560 }
561 if (dir>0 && !reader->IncEventNum())
562 {
563 reader->SetEventNum(num);
564 return;
565 }
566
567 if (!tlist->Process())
568 return;
569
570 reader->DecEventNum();
571
572 } while (raw && raw->GetNumPixels()<1 && dir!=0);
573
574 //
575 // Cleare the 'FADC canvas'
576 //
577 fCanvas->Clear();
578 fCanvas->Modified();
579 fCanvas->Update();
580
581 //
582 // Print parameters
583 //
584 ((MHillas*) plist->FindObject("MHillas"))->Print(*geom);
585 ((MHillasExt*) plist->FindObject("MHillasExt"))->Print(*geom);
586 ((MHillasSrc*) plist->FindObject("MHillasSrc"))->Print(*geom);
587 ((MNewImagePar*)plist->FindObject("MNewImagePar"))->Print(*geom);
588
589 //
590 // UpdateDisplay
591 //
592 gStyle->SetOptStat(1101);
593 Update();
594
595 TGTextEntry *entry = (TGTextEntry*)fList->FindWidget(kEvtNumber);
596 entry->SetText(Form("%d", reader->GetNumEntry()+1));
597}
598
599// --------------------------------------------------------------------------
600//
601// Read first event to get display booted
602//
603void MEventDisplay::ReadFirstEvent()
604{
605 if (!fEvtLoop->PreProcess())
606 return;
607
608 //
609 // Get parlist
610 //
611 MParList *plist = (MParList*)fEvtLoop->GetParList();
612
613 //
614 // Add Geometry tab
615 //
616 AddGeometryTabs();
617
618 //
619 // Now read event...
620 //
621 ReadinEvent();
622
623 MReadTree *reader = (MReadTree*)fEvtLoop->FindTask("MRead");
624 TGString *txt = new TGString(Form("of %d", reader->GetEntries()));
625 fNumOfEvts->SetText(txt);
626
627 //
628 // Draw ellipse on top of all pads
629 //
630 TObject *hillas = plist->FindObject("MHillas");
631 for (int i=1; i<7;i++)
632 {
633 TCanvas *c = GetCanvas(i);
634 c->GetPad(1)->cd(1);
635 hillas->Draw();
636 }
637}
638
639// --------------------------------------------------------------------------
640//
641// Adds the geometry tab
642//
643void MEventDisplay::AddGeometryTabs()
644{
645 MGeomCam *geom = (MGeomCam*)fEvtLoop->GetParList()->FindObject("MGeomCam");
646 if (!geom)
647 return;
648
649 TCanvas &c1=AddTab("Geometry");
650
651 MHCamera *cam = new MHCamera(*geom);
652 cam->SetBit(TH1::kNoStats|MHCamera::kNoLegend|kCanDelete);
653 cam->Draw("pixelindex");
654
655 c1.Modified();
656 c1.Update();
657
658 TCanvas &c2=AddTab("Sectors");
659
660 cam = new MHCamera(*geom);
661 cam->SetBit(TH1::kNoStats|MHCamera::kNoLegend|kCanDelete);
662 cam->Draw("sectorindex");
663
664 c2.Modified();
665 c2.Update();
666}
667
668// --------------------------------------------------------------------------
669//
670// ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
671//
672// Processes information from all GUI items.
673// Selecting an item usually generates an event with 4 parameters.
674// The first two are packed into msg (first and second bytes).
675// The other two are parm1 and parm2.
676//
677Bool_t MEventDisplay::ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2)
678{
679 switch (GET_MSG(msg))
680 {
681 case kC_TEXTENTRY:
682 switch(GET_SUBMSG(msg))
683 {
684 case kTE_ENTER:
685 switch(GET_SUBMSG(msg))
686 {
687 case kTE_ENTER:
688 {
689 TGTextEntry *entry = (TGTextEntry*)fList->FindWidget(kEvtNumber);
690 MReadTree *reader = (MReadTree*)fEvtLoop->FindTask("MRead");
691 if (reader->SetEventNum(atoi(entry->GetText())-1))
692 ReadinEvent();
693 }
694 return kTRUE;
695 }
696 return kTRUE;
697 }
698 break;
699
700 case kC_COMMAND:
701 switch (GET_SUBMSG(msg))
702 {
703 case kCM_TAB:
704 {
705 //
706 // Set name for 'FADC canvas'. The name is the anchor for MHCamera.
707 // and clear the canvas
708 TCanvas *c = GetCanvas(mp1);
709 if (!c)
710 break;
711 MHEvent *o = (MHEvent*)fEvtLoop->GetParList()->FindObject(c->GetName());
712 if (!o)
713 break;
714 fCanvas->SetName(Form("%p;%p;PixelContent", o->GetHist(), c->GetPad(1)));
715 }
716 break;
717
718 case kCM_BUTTON:
719 switch (mp1)
720 {
721 case kEvtPrev:
722 ReadinEvent(-1);
723 return kTRUE;
724
725 case kEvtNext:
726 ReadinEvent(+1);
727 return kTRUE;
728 }
729 return kTRUE;
730 }
731 break;
732 }
733
734 return MStatusDisplay::ProcessMessage(msg, mp1, mp2);
735}
Note: See TracBrowser for help on using the repository browser.