Changeset 3572 for trunk/MagicSoft/Mars/mdata
- Timestamp:
- 03/22/04 14:25:56 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mdata
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mdata/MData.cc
r2173 r3572 18 18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 220 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 53 53 // (s.MReadTree) 54 54 // 55 // - void SetVariables(const TArrayD &arr) 56 // is used to distribute variable numbers through lists holding 57 // MDatas to its counterpart (mainly to MDataValue) 58 // 55 59 // The 'must' ist represented by the =0 in the class header. In the C++ 56 60 // language this is called an abstract member function. Because the -
trunk/MagicSoft/Mars/mdata/MDataArray.cc
r2206 r3572 18 18 ! Author(s): Thomas Bretz 08/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 220 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 208 208 v(ncols) = (*this)(ncols); 209 209 } 210 211 void MDataArray::SetVariables(const TArrayD &arr) 212 { 213 fList.ForEach(MData, SetVariables)(arr); 214 } -
trunk/MagicSoft/Mars/mdata/MDataArray.h
r2114 r3572 56 56 void Delete(Option_t *option="") { fList.Delete(option); } 57 57 58 void SetVariables(const TArrayD &arr); 59 58 60 ClassDef(MDataArray, 1) // An array of MData containers 59 61 }; -
trunk/MagicSoft/Mars/mdata/MDataChain.cc
r2928 r3572 18 18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 320 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 108 108 // kRadToDeg for static Double_t TMath::RadToDeg(); 109 109 // kDegToRad for static Double_t TMath::DegToRad(); 110 // 110 111 // Remark: In older root versions only Pi() and E() are implemented in 111 112 // TMath. 112 113 // 114 // If you want to use variables, eg for fits you can use [0], [1], ... 115 // These values are initialized with 0 and set by calling 116 // SetVariables(). 113 117 // 114 118 // REMARK: … … 439 443 case '8': 440 444 case '9': 445 case '[': 446 case ']': 441 447 if ((txt[0]!='-' && txt[0]!='+') || isdigit(txt[1]) || txt[1]=='.') 442 448 { 449 if (!txt.IsNull() && txt[0]=='[') 450 { 451 Int_t first = GetBracket(txt, '[', ']'); 452 TString op = txt(1, first-1); 453 txt.Remove(0, first+1); 454 455 newmember = new MDataValue(0, atoi(op)); 456 break; 457 } 458 443 459 char *end; 444 460 Double_t num = strtod(txt.Data(), &end); … … 706 722 } 707 723 724 void MDataChain::SetVariables(const TArrayD &arr) 725 { 726 return fMember->SetVariables(arr); 727 } -
trunk/MagicSoft/Mars/mdata/MDataChain.h
r2521 r3572 64 64 TString GetDataMember() const; 65 65 66 void SetVariables(const TArrayD &arr); 67 66 68 ClassDef(MDataChain, 1) // A chain/concatenation of MData objects 67 69 }; -
trunk/MagicSoft/Mars/mdata/MDataElement.cc
r2173 r3572 18 18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 220 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! -
trunk/MagicSoft/Mars/mdata/MDataElement.h
r1524 r3572 36 36 Double_t operator()() { return GetValue(); } 37 37 38 void SetVariables(const TArrayD &arr) { } 39 38 40 ClassDef(MDataElement, 1) // MData object corresponding to a element of an MHMatrix 39 41 }; -
trunk/MagicSoft/Mars/mdata/MDataList.cc
r2557 r3572 18 18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 220 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 372 372 return str; 373 373 } 374 375 void MDataList::SetVariables(const TArrayD &arr) 376 { 377 fMembers.ForEach(MData, SetVariables)(arr); 378 } -
trunk/MagicSoft/Mars/mdata/MDataList.h
r2557 r3572 51 51 TString GetDataMember() const; 52 52 53 void SetVariables(const TArrayD &arr); 54 53 55 ClassDef(MDataList, 1) // A concatenation of MData objects by one operator 54 56 }; -
trunk/MagicSoft/Mars/mdata/MDataMember.cc
r2710 r3572 18 18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 220 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! -
trunk/MagicSoft/Mars/mdata/MDataMember.h
r2710 r3572 43 43 Bool_t IsInt() const { return TestBit(kIsInt); } 44 44 45 void SetVariables(const TArrayD &arr) { } 46 45 47 ClassDef(MDataMember, 1) // MData object corresponding to a single data member of a Mars container 46 48 }; -
trunk/MagicSoft/Mars/mdata/MDataValue.cc
r2173 r3572 18 18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 220 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 28 28 // 29 29 // An MData object which corresponds to a simple value like 5.5, or 7.9 30 // it can be set as variable object by giving it an index in the 31 // constructor, only in this case SetVariables takes action 30 32 // 31 33 ///////////////////////////////////////////////////////////////////////////// 34 #include "MDataValue.h" 32 35 33 #include "MDataValue.h"36 #include <TArrayD.h> 34 37 35 38 #include "MLog.h" … … 46 49 TString MDataValue::GetRule() const 47 50 { 51 if (fIndex>=0) 52 { 53 TString str("["); 54 str += fIndex; 55 str += "]"; 56 return str; 57 } 58 48 59 TString str; 49 60 str += fValue; … … 51 62 } 52 63 64 void MDataValue::SetVariables(const TArrayD &arr) 65 { 66 if (fIndex>=0 && fIndex<arr.GetSize()) 67 fValue = arr[fIndex]; 68 } -
trunk/MagicSoft/Mars/mdata/MDataValue.h
r1896 r3572 1 1 #ifndef MARS_MDataValue 2 2 #define MARS_MDataValue 3 4 /////////////////////////////////////////////////////////////////////////////5 // //6 // MDataValue //7 // //8 /////////////////////////////////////////////////////////////////////////////9 3 10 4 #ifndef MARS_MData … … 12 6 #endif 13 7 8 class TArrayD; 9 14 10 class MDataValue : public MData 15 11 { 16 12 private: 17 13 Double_t fValue; 14 Int_t fIndex; 18 15 19 16 public: 20 MDataValue(Double_t v = 0 ) : fValue(v)17 MDataValue(Double_t v = 0, Int_t idx=-1) : fValue(v), fIndex(idx) 21 18 { 22 19 } … … 28 25 Bool_t IsReadyToSave() const { return kFALSE; } 29 26 30 //void Print(Option_t *opt = "") const;31 27 TString GetRule() const; 28 29 void SetVariables(const TArrayD &arr); 32 30 33 31 ClassDef(MDataValue, 1) // MData object corresponding to a single value
Note:
See TracChangeset
for help on using the changeset viewer.