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 |
|
---|
34 | ClassImp(MJCalib);
|
---|
35 |
|
---|
36 | using namespace std;
|
---|
37 |
|
---|
38 | const Int_t MJCalib::fgCheckedPixId = 100;
|
---|
39 |
|
---|
40 | // --------------------------------------------------------------------------
|
---|
41 | //
|
---|
42 | // Default constructor.
|
---|
43 | //
|
---|
44 | // Sets:
|
---|
45 | // - fDataFlag to kIsUseRootData
|
---|
46 | // - fCheckedPixId to fgCheckedPixId
|
---|
47 | // - fPixelCheck to kFALSE
|
---|
48 | // - fPulsePosCheck to kFALSE
|
---|
49 | //
|
---|
50 | MJCalib::MJCalib() : fDataFlag(kIsUseRootData), fStorage(0),
|
---|
51 | fIsPixelCheck(kFALSE), fIsPulsePosCheck(kFALSE),
|
---|
52 | fIsHiLoCalibration(kFALSE)
|
---|
53 | {
|
---|
54 | SetUseBlindPixel(kFALSE);
|
---|
55 | SetUsePINDiode(kFALSE);
|
---|
56 |
|
---|
57 | SetCheckedPixId();
|
---|
58 | }
|
---|
59 |
|
---|
60 | Bool_t MJCalib::CheckEnvLocal()
|
---|
61 | {
|
---|
62 | if (HasEnv("PixelCheck"))
|
---|
63 | SetPixelCheck(GetEnv("PixelCheck", fIsPixelCheck));
|
---|
64 |
|
---|
65 | if (HasEnv("PulsePosCheck"))
|
---|
66 | SetPulsePosCheck(GetEnv("PulsePosCheck", fIsPulsePosCheck));
|
---|
67 |
|
---|
68 | if (HasEnv("CheckedPixId"))
|
---|
69 | SetCheckedPixId(GetEnv("CheckedPixId",fCheckedPixId));
|
---|
70 |
|
---|
71 | if (HasEnv("HiLoCalibration"))
|
---|
72 | SetHiLoCalibration(GetEnv("HiLoCalibration", fIsHiLoCalibration));
|
---|
73 |
|
---|
74 | if (HasEnv("StorageType"))
|
---|
75 | {
|
---|
76 | TString type = GetEnv("StorageType", "");
|
---|
77 | type = type.Strip(TString::kBoth);
|
---|
78 | type.ToLower();
|
---|
79 |
|
---|
80 | if (type == (TString)"hists")
|
---|
81 | SetHistsStorage();
|
---|
82 |
|
---|
83 | if (type == (TString)"no" || type == (TString)"nostorage")
|
---|
84 | SetNoStorage();
|
---|
85 | }
|
---|
86 |
|
---|
87 | if (!HasEnv("DataType"))
|
---|
88 | return kTRUE;
|
---|
89 |
|
---|
90 | TString dat = GetEnv("DataType", "");
|
---|
91 | dat = dat.Strip(TString::kBoth);
|
---|
92 | dat.ToLower();
|
---|
93 |
|
---|
94 | if (dat == (TString)"raw")
|
---|
95 | SetUseRawData();
|
---|
96 |
|
---|
97 | if (dat == (TString)"mc" || dat == (TString)"montecarlo")
|
---|
98 | SetUseMC();
|
---|
99 |
|
---|
100 | if (dat == (TString)"root")
|
---|
101 | SetUseRootData();
|
---|
102 |
|
---|
103 | return kTRUE;
|
---|
104 | }
|
---|