source: trunk/MagicSoft/Mars/mmuon/MMuonSetup.cc@ 6987

Last change on this file since 6987 was 6986, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 2.5 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): Markus Meyer 04/2005 <mailto:meyer@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2005
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// MMuonSetup
28//
29// Storage Container for setup parameter for the muon analysis
30//
31/////////////////////////////////////////////////////////////////////////////
32#include "MMuonSetup.h"
33
34#include <fstream>
35
36#include "MLog.h"
37
38using namespace std;
39
40ClassImp(MMuonSetup);
41
42// --------------------------------------------------------------------------
43//
44// Default constructor.
45//
46MMuonSetup::MMuonSetup(const char *name, const char *title)
47 : fMargin(0.2), fThresholdArcPhi(30), fThresholdArcWidth(30)
48{
49 fName = name ? name : "MMuonSetup";
50 fTitle = title ? title : "Muon calibration setup parameters";
51}
52
53// --------------------------------------------------------------------------
54//
55// Read the setup from a TEnv, eg:
56// MMuonSetup.Margin: 0.2
57// MMuonSetup.ThresholdArcPhi: 30
58// MMuonSetup.ThresholdArcWidth: 30
59//
60Int_t MMuonSetup::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
61{
62 Bool_t rc = kFALSE;
63 if (IsEnvDefined(env, prefix, "Margin", print))
64 {
65 rc = kTRUE;
66 fMargin = GetEnvValue(env, prefix, "Margin", fMargin);
67 }
68 if (IsEnvDefined(env, prefix, "ThresholdArcPhi", print))
69 {
70 rc = kTRUE;
71 fThresholdArcPhi = GetEnvValue(env, prefix, "ThresholdArcPhi", fThresholdArcPhi);
72 }
73 if (IsEnvDefined(env, prefix, "ThresholdArcWidth", print))
74 {
75 rc = kTRUE;
76 fThresholdArcWidth = GetEnvValue(env, prefix, "ThresholdArcWidth", fThresholdArcWidth);
77 }
78
79 return rc;
80}
Note: See TracBrowser for help on using the repository browser.