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

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