| 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): Eva Domingo 02/2004 <mailto:domingo@ifae.es>
|
|---|
| 19 | ! Author(s): Josep Flix 02/2004 <mailto:jflix@ifae.es>
|
|---|
| 20 | !
|
|---|
| 21 | ! Copyright: MAGIC Software Development, 2004
|
|---|
| 22 | !
|
|---|
| 23 | !
|
|---|
| 24 | \* ======================================================================== */
|
|---|
| 25 |
|
|---|
| 26 | /////////////////////////////////////////////////////////////////////////////
|
|---|
| 27 | //
|
|---|
| 28 | // MDisp
|
|---|
| 29 | //
|
|---|
| 30 | // Storage Container for image parameters
|
|---|
| 31 | //
|
|---|
| 32 | // Disp method for extended sources analysis related image parameters
|
|---|
| 33 | //
|
|---|
| 34 | //
|
|---|
| 35 | // Version 1:
|
|---|
| 36 | // ----------
|
|---|
| 37 | // fDisp Distance along the major axis from the centroid to the suspected position of the source
|
|---|
| 38 | // fPosDisp1 Position of Disp evaluated point 1 in the camera in [mm]
|
|---|
| 39 | // fPosDisp2 Position of Disp evaluated point 2 in the camera in [mm]
|
|---|
| 40 | //
|
|---|
| 41 | //
|
|---|
| 42 | /////////////////////////////////////////////////////////////////////////////
|
|---|
| 43 |
|
|---|
| 44 | #include "MDisp.h"
|
|---|
| 45 |
|
|---|
| 46 | #include <iostream>
|
|---|
| 47 | //#include <TArrayF.h>
|
|---|
| 48 |
|
|---|
| 49 | #include "MLog.h"
|
|---|
| 50 | #include "MLogManip.h"
|
|---|
| 51 |
|
|---|
| 52 | using namespace std;
|
|---|
| 53 | ClassImp(MDisp);
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 | // --------------------------------------------------------------------------
|
|---|
| 57 | //
|
|---|
| 58 | // Default constructor.
|
|---|
| 59 | //
|
|---|
| 60 | MDisp::MDisp(const char *name, const char *title)
|
|---|
| 61 | {
|
|---|
| 62 | fName = name ? name : "MDisp";
|
|---|
| 63 | fTitle = title ? title : "Parameter related to Disp method for extended sources analysis";
|
|---|
| 64 |
|
|---|
| 65 | }
|
|---|
| 66 |
|
|---|
| 67 | void MDisp::SetPosDisp(char *var, Float_t value)
|
|---|
| 68 | {
|
|---|
| 69 |
|
|---|
| 70 | if ( !strcmp(var,"X1") )
|
|---|
| 71 | fX1 = value;
|
|---|
| 72 | else if ( !strcmp(var,"Y1") )
|
|---|
| 73 | fY1 = value;
|
|---|
| 74 | else if ( !strcmp(var,"X2") )
|
|---|
| 75 | fX2 = value;
|
|---|
| 76 | else if ( !strcmp(var,"Y2") )
|
|---|
| 77 | fY2 = value;
|
|---|
| 78 | else
|
|---|
| 79 | cout << "SetPosDisp:: Coordinate argument WRONG!" << endl;
|
|---|
| 80 |
|
|---|
| 81 | };
|
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 | Float_t MDisp::GetPosDisp(char *var)
|
|---|
| 85 | {
|
|---|
| 86 |
|
|---|
| 87 | if ( !strcmp(var,"X1") )
|
|---|
| 88 | return fX1;
|
|---|
| 89 | else if ( !strcmp(var,"Y1") )
|
|---|
| 90 | return fY1;
|
|---|
| 91 | else if ( !strcmp(var,"X2") )
|
|---|
| 92 | return fX2;
|
|---|
| 93 | else if ( !strcmp(var,"Y2") )
|
|---|
| 94 | return fY2;
|
|---|
| 95 | else
|
|---|
| 96 | {
|
|---|
| 97 | cout << "GetPosDisp:: Coordinate argument WRONG!" << endl;
|
|---|
| 98 | return -9999.;
|
|---|
| 99 | }
|
|---|
| 100 | };
|
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 | void MDisp::Print(Option_t *opt) const
|
|---|
| 104 | {
|
|---|
| 105 | *fLog << all << GetDescriptor() << ":" << endl;
|
|---|
| 106 | *fLog << "Disp [mm] = " << fDisp << ": ";
|
|---|
| 107 | *fLog << "DX1 [mm] = " << fX1 << ": ";
|
|---|
| 108 | *fLog << "DY1 [mm] = " << fY1 << ": ";
|
|---|
| 109 | *fLog << "DX2 [mm] = " << fX2 << ": ";
|
|---|
| 110 | *fLog << "DY2 [mm] = " << fY2 << ": ";
|
|---|
| 111 | *fLog << "PsiEvent[mm] =" << fPsiEvent << ": " << endl;
|
|---|
| 112 | };
|
|---|