| 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 12/2000 (tbretz@uni-sw.gwdg.de)
|
|---|
| 19 | !
|
|---|
| 20 | ! Copyright: MAGIC Software Development, 2000-2001
|
|---|
| 21 | !
|
|---|
| 22 | !
|
|---|
| 23 | \* ======================================================================== */
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 | void readMagic()
|
|---|
| 27 | {
|
|---|
| 28 | MParList plist;
|
|---|
| 29 |
|
|---|
| 30 | MGeomCamMagic geomcam;
|
|---|
| 31 | MPedestalCam pedest;
|
|---|
| 32 | MHillas hillas;
|
|---|
| 33 | MTaskList tlist;
|
|---|
| 34 |
|
|---|
| 35 | plist.AddToList(&geomcam);
|
|---|
| 36 | plist.AddToList(&pedest);
|
|---|
| 37 | plist.AddToList(&hillas);
|
|---|
| 38 | plist.AddToList(&tlist);
|
|---|
| 39 |
|
|---|
| 40 | MReadTree read("Events", "~/data/camera.root");
|
|---|
| 41 | MCerPhotCalc ncalc;
|
|---|
| 42 | MImgCleanStd clean;
|
|---|
| 43 | MHillasCalc hcalc;
|
|---|
| 44 |
|
|---|
| 45 | tlist.AddToList(&read);
|
|---|
| 46 | tlist.AddToList(&ncalc);
|
|---|
| 47 | tlist.AddToList(&clean);
|
|---|
| 48 | tlist.AddToList(&hcalc);
|
|---|
| 49 |
|
|---|
| 50 | MEvtLoop evtloop;
|
|---|
| 51 | evtloop.SetParList(&plist);
|
|---|
| 52 |
|
|---|
| 53 | if (!evtloop.PreProcess())
|
|---|
| 54 | return;
|
|---|
| 55 |
|
|---|
| 56 | MCerPhotEvt &phevt = *(MCerPhotEvt*)plist.FindObject("MCerPhotEvt");
|
|---|
| 57 |
|
|---|
| 58 | MCamDisplay display(&geomcam);
|
|---|
| 59 | display.Draw();
|
|---|
| 60 |
|
|---|
| 61 | while (read.Process())
|
|---|
| 62 | {
|
|---|
| 63 | cout << "Event #" << read.GetEventNum() ":" << endl;
|
|---|
| 64 | hillas.Reset();
|
|---|
| 65 | phevt.Reset();
|
|---|
| 66 |
|
|---|
| 67 | ncalc.Process();
|
|---|
| 68 |
|
|---|
| 69 | display.DrawPhotNum(&phevt);
|
|---|
| 70 | gClient->HandleInput();
|
|---|
| 71 | if(getchar()=='q')
|
|---|
| 72 | break;
|
|---|
| 73 |
|
|---|
| 74 | clean.Process();
|
|---|
| 75 | hcalc.Process();
|
|---|
| 76 |
|
|---|
| 77 | hillas.Print();
|
|---|
| 78 | hillas.Draw();
|
|---|
| 79 |
|
|---|
| 80 | display.DrawPhotNum(&phevt);
|
|---|
| 81 |
|
|---|
| 82 | gClient->HandleInput();
|
|---|
| 83 | if(getchar()=='q')
|
|---|
| 84 | break;
|
|---|
| 85 | }
|
|---|
| 86 |
|
|---|
| 87 | evtloop.PostProcess();
|
|---|
| 88 | }
|
|---|