source: trunk/MagicSoft/Mars/mjobs/MJCalib.cc@ 6913

Last change on this file since 6913 was 6913, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 2.9 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 Gaug, 2/2005 <mailto:markus@ifae.es>
19!
20! Copyright: MAGIC Software Development, 2000-2005
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// MJCalib
28//
29// A base class for the calibration jobs
30//
31/////////////////////////////////////////////////////////////////////////////
32#include "MJCalib.h"
33
34ClassImp(MJCalib);
35
36using namespace std;
37
38const Int_t MJCalib::fgCheckedPixId = 100;
39
40// --------------------------------------------------------------------------
41//
42// Default constructor.
43//
44// Sets:
45// - fDataFlag to kIsUseRootData
46// - fRuns to NULL
47// - fCheckedPixId to fgCheckedPixId
48// - fPixelCheck to kFALSE
49// - fPulsePosCheck to kFALSE
50//
51MJCalib::MJCalib() : fDataFlag(kIsUseRootData), fStorage(0),
52 fIsPixelCheck(kFALSE), fIsPulsePosCheck(kFALSE),
53 fIsHiLoCalibration(kFALSE),
54 fRuns(NULL)
55{
56 SetUseBlindPixel(kFALSE);
57 SetUsePINDiode(kFALSE);
58
59 SetCheckedPixId();
60}
61
62Bool_t MJCalib::CheckEnvLocal()
63{
64 if (HasEnv("PixelCheck"))
65 SetPixelCheck(GetEnv("PixelCheck", fIsPixelCheck));
66
67 if (HasEnv("PulsePosCheck"))
68 SetPulsePosCheck(GetEnv("PulsePosCheck", fIsPulsePosCheck));
69
70 if (HasEnv("CheckedPixId"))
71 SetCheckedPixId(GetEnv("CheckedPixId",fCheckedPixId));
72
73 if (HasEnv("HiLoCalibration"))
74 SetHiLoCalibration(GetEnv("HiLoCalibration", fIsHiLoCalibration));
75
76 if (HasEnv("StorageType"))
77 {
78 TString type = GetEnv("StorageType", "");
79 type = type.Strip(TString::kBoth);
80 type.ToLower();
81
82 if (type == (TString)"hists")
83 SetHistsStorage();
84
85 if (type == (TString)"no" || type == (TString)"nostorage")
86 SetNoStorage();
87 }
88
89 if (!HasEnv("DataType"))
90 return kTRUE;
91
92 TString dat = GetEnv("DataType", "");
93 dat = dat.Strip(TString::kBoth);
94 dat.ToLower();
95
96 if (dat == (TString)"raw")
97 SetUseRawData();
98
99 if (dat == (TString)"mc" || dat == (TString)"montecarlo")
100 SetUseMC();
101
102 if (dat == (TString)"root")
103 SetUseRootData();
104
105 return kTRUE;
106}
Note: See TracBrowser for help on using the repository browser.