source: trunk/MagicSoft/Mars/mastro/MVector3.cc@ 6724

Last change on this file since 6724 was 4977, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 1.7 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 expressed
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz, 03/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2002-2004
21!
22!
23\* ======================================================================== */
24
25//////////////////////////////////////////////////////////////////////////////
26//
27// MVector3
28// ========
29//
30//////////////////////////////////////////////////////////////////////////////
31#include "MVector3.h"
32
33#include <iostream>
34
35#include "MLog.h"
36#include "MLogManip.h"
37
38ClassImp(MVector3);
39
40using namespace std;
41
42void MVector3::WriteBinary(ostream &out) const
43{
44 const Double_t t = Theta();
45 const Double_t p = Phi();
46 const Float_t m = Mag();
47 out.write((char*)&t, 8);
48 out.write((char*)&p, 8);
49 out.write((char*)&m, 4);
50 out << fName << endl;
51}
52
53void MVector3::ReadBinary(istream &in)
54{
55 Double_t t, p;
56 Float_t m;
57
58 in.read((char*)&t, 8);
59 in.read((char*)&p, 8);
60 in.read((char*)&m, 4);
61 fName.ReadLine(in);
62
63 SetMagThetaPhi(m, t, p);
64}
Note: See TracBrowser for help on using the repository browser.