| 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, 1/2004 <mailto:tbretz@astro.uni-wuerzburg.de> | 
|---|
| 19 | !              Markus Gaug, 02/2004 <mailto:markus@ifae.es> | 
|---|
| 20 | ! | 
|---|
| 21 | !   Copyright: MAGIC Software Development, 2000-2004 | 
|---|
| 22 | ! | 
|---|
| 23 | ! | 
|---|
| 24 | \* ======================================================================== */ | 
|---|
| 25 | ///////////////////////////////////////////////////////////////////////////// | 
|---|
| 26 | // | 
|---|
| 27 | //  MGCamDisplays | 
|---|
| 28 | // | 
|---|
| 29 | //  Graphical interfaces to display the camera with fits and projections | 
|---|
| 30 | // | 
|---|
| 31 | ///////////////////////////////////////////////////////////////////////////// | 
|---|
| 32 | #include "MGCamDisplays.h" | 
|---|
| 33 |  | 
|---|
| 34 | #include <TStyle.h> | 
|---|
| 35 | #include <TCanvas.h> | 
|---|
| 36 |  | 
|---|
| 37 | #include "MH.h" | 
|---|
| 38 | #include "MHCamera.h" | 
|---|
| 39 | #include "MGeomCam.h" | 
|---|
| 40 | #include "TVirtualPad.h" | 
|---|
| 41 |  | 
|---|
| 42 | #include "MLog.h" | 
|---|
| 43 | #include "MLogManip.h" | 
|---|
| 44 |  | 
|---|
| 45 | #include "MStatusDisplay.h" | 
|---|
| 46 |  | 
|---|
| 47 | ClassImp(MGCamDisplays); | 
|---|
| 48 |  | 
|---|
| 49 | using namespace std; | 
|---|
| 50 |  | 
|---|
| 51 | // -------------------------------------------------------------------------- | 
|---|
| 52 | // | 
|---|
| 53 | // Default constructor. | 
|---|
| 54 | // | 
|---|
| 55 | MGCamDisplays::MGCamDisplays() | 
|---|
| 56 | { | 
|---|
| 57 | } | 
|---|
| 58 |  | 
|---|
| 59 | // -------------------------------------------------------------------------- | 
|---|
| 60 | // | 
|---|
| 61 | // Draw the MHCamera into the MStatusDisplay: | 
|---|
| 62 | // | 
|---|
| 63 | // 1) Draw it as histogram (MHCamera::DrawCopy("hist") | 
|---|
| 64 | // 2) Draw it as a camera, with MHCamera::SetPrettyPalette() set. | 
|---|
| 65 | // 3) If "rad" is not zero, draw its values vs. the radius from the camera center. | 
|---|
| 66 | //    (DrawRadialProfile()) | 
|---|
| 67 | // 4) Depending on the variable "fit", draw the values projection on the y-axis | 
|---|
| 68 | //    (DrawProjection()): | 
|---|
| 69 | //    0: don't draw | 
|---|
| 70 | //    1: Draw fit to Single Gauss (for distributions flat-fielded over the whole camera) | 
|---|
| 71 | //    2: Draw and fit to Double Gauss (for distributions different for inner and outer pixels) | 
|---|
| 72 | //    3: Draw and fit to Triple Gauss (for distributions with inner, outer pixels and outliers) | 
|---|
| 73 | //    4: Draw and fit to Polynomial grade 0: (for the probability distributions) | 
|---|
| 74 | //    >4: Draw and don;t fit. | 
|---|
| 75 | // | 
|---|
| 76 | void MGCamDisplays::CamDraw(TCanvas &c, const Int_t x, const Int_t y, const MHCamera &cam1, | 
|---|
| 77 | const Int_t fit, const Int_t rad, TObject *notify) | 
|---|
| 78 | { | 
|---|
| 79 |  | 
|---|
| 80 | c.cd(x); | 
|---|
| 81 | gPad->SetBorderMode(0); | 
|---|
| 82 | gPad->SetTicks(); | 
|---|
| 83 | MHCamera *obj1=(MHCamera*)cam1.DrawCopy("hist"); | 
|---|
| 84 | obj1->SetDirectory(NULL); | 
|---|
| 85 |  | 
|---|
| 86 | if (notify) | 
|---|
| 87 | obj1->AddNotify(notify); | 
|---|
| 88 |  | 
|---|
| 89 | c.cd(x+y); | 
|---|
| 90 | gPad->SetBorderMode(0); | 
|---|
| 91 | obj1->SetPrettyPalette(); | 
|---|
| 92 | obj1->Draw(); | 
|---|
| 93 |  | 
|---|
| 94 | if (rad) | 
|---|
| 95 | { | 
|---|
| 96 | c.cd(x+2*y); | 
|---|
| 97 | gPad->SetBorderMode(0); | 
|---|
| 98 | gPad->SetTicks(); | 
|---|
| 99 | obj1->DrawRadialProfile(); | 
|---|
| 100 | } | 
|---|
| 101 |  | 
|---|
| 102 |  | 
|---|
| 103 | if (!fit) | 
|---|
| 104 | return; | 
|---|
| 105 |  | 
|---|
| 106 | c.cd(rad ? x+3*y : x+2*y); | 
|---|
| 107 | gPad->SetBorderMode(0); | 
|---|
| 108 | gPad->SetTicks(); | 
|---|
| 109 | obj1->DrawProjection(fit); | 
|---|
| 110 | } | 
|---|
| 111 |  | 
|---|
| 112 |  | 
|---|