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 04/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
|
---|
19 | !
|
---|
20 | ! Copyright: MAGIC Software Development, 2000-2002
|
---|
21 | !
|
---|
22 | !
|
---|
23 | \* ======================================================================== */
|
---|
24 |
|
---|
25 | /////////////////////////////////////////////////////////////////////////////
|
---|
26 | //
|
---|
27 | // MData
|
---|
28 | //
|
---|
29 | // This base class defines an interface to a generalized value.
|
---|
30 | // This value can be a simple number, it can also be a data member
|
---|
31 | // of a class or some kind of concatenation of MData objects.
|
---|
32 | //
|
---|
33 | // A class inheriting from MData must implement:
|
---|
34 | //
|
---|
35 | // - Double_t GetValue() const
|
---|
36 | // which return the value corresponding to the object
|
---|
37 | //
|
---|
38 | // - Bool_t IsValid() const
|
---|
39 | // should tell whether the object is valid (eg if the object parses
|
---|
40 | // a string the result might be invalid)
|
---|
41 | //
|
---|
42 | // - Bool_t PreProcess(const MParList *plist)
|
---|
43 | // which can be used to get some necessary data (befor processing)
|
---|
44 | // from the parlist.
|
---|
45 | //
|
---|
46 | // - TString GetRule()
|
---|
47 | // returns the rule as a text which would recreate the same structure
|
---|
48 | // when used in a MDataChain
|
---|
49 | //
|
---|
50 | // - TString GetDataMember()
|
---|
51 | // returns the names (seperated by a comma) used by this class. This
|
---|
52 | // is mainly used for the AutoScheme when reading data from a file.
|
---|
53 | // (s.MReadTree)
|
---|
54 | //
|
---|
55 | // The 'must' ist represented by the =0 in the class header. In the C++
|
---|
56 | // language this is called an abstract member function. Because the
|
---|
57 | // class contains abstract member function which makes it impossible
|
---|
58 | // to create an instance of this class one calls it also:
|
---|
59 | // abstract base class
|
---|
60 | //
|
---|
61 | /////////////////////////////////////////////////////////////////////////////
|
---|
62 |
|
---|
63 | #include "MData.h"
|
---|
64 |
|
---|
65 | #include <fstream.h>
|
---|
66 |
|
---|
67 | #include "MLog.h"
|
---|
68 |
|
---|
69 | ClassImp(MData);
|
---|
70 |
|
---|
71 | Bool_t MData::AsciiWrite(ostream &out) const
|
---|
72 | {
|
---|
73 | out << GetValue() << " ";
|
---|
74 | return kTRUE;
|
---|
75 | }
|
---|
76 |
|
---|
77 | void MData::Print(Option_t *opt) const
|
---|
78 | {
|
---|
79 | *fLog << GetRule() << flush;
|
---|
80 | }
|
---|