| 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 <mailto:tbretz@uni-sw.gwdg.de>
|
|---|
| 19 | ! Author(s): Rudolf Bock 10/2001 <mailto:Rudolf.Bock@cern.ch>
|
|---|
| 20 | !
|
|---|
| 21 | ! Copyright: MAGIC Software Development, 2000-2002
|
|---|
| 22 | !
|
|---|
| 23 | !
|
|---|
| 24 | \* ======================================================================== */
|
|---|
| 25 |
|
|---|
| 26 | //////////////////////////////////////////////////////////////////////////////
|
|---|
| 27 | //
|
|---|
| 28 | // MSrcPosCam
|
|---|
| 29 | //
|
|---|
| 30 | // Storage Container to hold the current position of the source (or
|
|---|
| 31 | // anti/false source) in the camera plain
|
|---|
| 32 | //
|
|---|
| 33 | //////////////////////////////////////////////////////////////////////////////
|
|---|
| 34 | #include "MSrcPosCam.h"
|
|---|
| 35 |
|
|---|
| 36 | #include <fstream.h>
|
|---|
| 37 |
|
|---|
| 38 | #include "MLog.h"
|
|---|
| 39 | #include "MLogManip.h"
|
|---|
| 40 |
|
|---|
| 41 | ClassImp(MSrcPosCam);
|
|---|
| 42 |
|
|---|
| 43 | // --------------------------------------------------------------------------
|
|---|
| 44 | //
|
|---|
| 45 | // Default constructor.
|
|---|
| 46 | //
|
|---|
| 47 | MSrcPosCam::MSrcPosCam(const char *name, const char *title) : fX(0), fY(0)
|
|---|
| 48 | {
|
|---|
| 49 | fName = name ? name : "MSrcPosCam";
|
|---|
| 50 | fTitle = title ? title : "Source position in the camera";
|
|---|
| 51 | }
|
|---|
| 52 |
|
|---|
| 53 | // -----------------------------------------------------------------------
|
|---|
| 54 | //
|
|---|
| 55 | void MSrcPosCam::Print(Option_t *) const
|
|---|
| 56 | {
|
|---|
| 57 | *fLog << all;
|
|---|
| 58 | *fLog << "Source position in the camera plain (" << GetName() << ")" << endl;
|
|---|
| 59 | *fLog << " - x [mm] = " << fX << endl;
|
|---|
| 60 | *fLog << " - y [mm] = " << fY << endl;
|
|---|
| 61 | }
|
|---|
| 62 |
|
|---|
| 63 | // -----------------------------------------------------------------------
|
|---|
| 64 | //
|
|---|
| 65 | // overloaded MParContainer to read MSrcPosCam from an ascii file
|
|---|
| 66 | //
|
|---|
| 67 | void MSrcPosCam::AsciiRead(ifstream &fin)
|
|---|
| 68 | {
|
|---|
| 69 | fin >> fX;
|
|---|
| 70 | fin >> fY;
|
|---|
| 71 | }
|
|---|
| 72 |
|
|---|
| 73 | // -----------------------------------------------------------------------
|
|---|
| 74 | //
|
|---|
| 75 | // overloaded MParContainer to write MSrcPosCam to an ascii file
|
|---|
| 76 | //
|
|---|
| 77 | void MSrcPosCam::AsciiWrite(ofstream &fout) const
|
|---|
| 78 | {
|
|---|
| 79 | fout << fX << " " << fY;
|
|---|
| 80 | }
|
|---|