source: branches/Mars_MC/mreport/MReportHumidity.cc@ 17357

Last change on this file since 17357 was 14935, checked in by tbretz, 12 years ago
Add changes necessary to remove fits completely from namespace std in MARS.
File size: 2.1 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 express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz, 02/2012 <mailto:thomas.bretz@epfl.ch>
19!
20! Copyright: MAGIC Software Development, 2000-2012
21!
22!
23\* ======================================================================== */
24
25//////////////////////////////////////////////////////////////////////////////
26//
27// MReportHumidity
28//
29//////////////////////////////////////////////////////////////////////////////
30#include "MReportHumidity.h"
31
32#include "fits.h"
33
34#include "MLogManip.h"
35
36ClassImp(MReportHumidity);
37
38using namespace std;
39
40// --------------------------------------------------------------------------
41//
42// Default construtor. Initialize identifier to "DRIVE-REPORT"
43//
44MReportHumidity::MReportHumidity() : MReport("TEMPERATURES-REPORT"),
45 fTimeStamp(0)
46{
47 fName = "MReportHumidity";
48 fTitle = "Class for DRIVE-REPORT information (raw telescope position)";
49
50 memset(fHumidity, 0, sizeof(Float_t)*4);
51}
52
53Bool_t MReportHumidity::SetupReadingFits(fits &file)
54{
55 return
56 file.SetRefAddress("t", fTimeStamp) &&
57 file.SetPtrAddress("H", fHumidity, 4);
58}
59
60Int_t MReportHumidity::InterpreteFits(const fits &fits)
61{
62 return kTRUE;
63}
64
65Float_t MReportHumidity::GetMean() const
66{
67 Double_t avg = 0;
68 for (int i=0; i<4; i++)
69 avg += fHumidity[i];
70
71 return avg/4;
72}
73
74void MReportHumidity::Print(Option_t *o) const
75{
76 *fLog << GetDescriptor() << ": Time=" << fTimeStamp << " Hum=" << GetMean() << "%" << endl;
77}
Note: See TracBrowser for help on using the repository browser.