Changeset 1574 for trunk/MagicSoft/Mars/mdata
- Timestamp:
- 11/04/02 10:06:08 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mdata
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mdata/MData.cc
r1476 r1574 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@ uni-sw.gwdg.de>18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 20 ! Copyright: MAGIC Software Development, 2000-2002 … … 44 44 // from the parlist. 45 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 // 46 61 ///////////////////////////////////////////////////////////////////////////// 47 62 -
trunk/MagicSoft/Mars/mdata/MData.h
r1474 r1574 21 21 virtual Bool_t PreProcess(const MParList *plist) = 0; 22 22 virtual TString GetRule() const = 0; 23 virtual TString GetDataMember() const { return ""; } 23 24 24 25 Double_t operator()() { return GetValue(); } -
trunk/MagicSoft/Mars/mdata/MDataArray.cc
r1499 r1574 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 08/2002 <mailto:tbretz@ uni-sw.gwdg.de>18 ! Author(s): Thomas Bretz 08/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 20 ! Copyright: MAGIC Software Development, 2000-2002 … … 26 26 // 27 27 // MDataArray 28 // 29 // An Array of MData derived classes. 30 // It can be used, eg, in MHMatrix for description of the columns. 28 31 // 29 32 ///////////////////////////////////////////////////////////////////////////// … … 42 45 static const TString gsDefTitle = "Array to store MData cntainers"; 43 46 47 // -------------------------------------------------------------------------- 48 // 49 // Constructor 50 // 44 51 MDataArray::MDataArray(const char *name, const char *title) 45 52 { … … 48 55 } 49 56 57 // -------------------------------------------------------------------------- 58 // 59 // Add a new data rule as a new entry (MDataChain) 60 // 50 61 void MDataArray::AddEntry(const TString rule) 51 62 { … … 55 66 } 56 67 68 // -------------------------------------------------------------------------- 69 // 70 // Add a new data as a new entry (MData). If the destructor of MDataArray 71 // should delete the object set its bit kCanDelete 72 // 73 void MDataArray::AddEntry(MData *data) 74 { 75 fList.Add(data); 76 } 77 78 // -------------------------------------------------------------------------- 79 // 80 // Return the i-th entry 81 // 57 82 MData &MDataArray::operator[](Int_t i) const 58 83 { … … 60 85 } 61 86 87 // -------------------------------------------------------------------------- 88 // 89 // Return the data value of the i-th entry 90 // 62 91 Double_t MDataArray::operator()(Int_t i) 63 92 { … … 65 94 } 66 95 96 // -------------------------------------------------------------------------- 97 // 98 // PreProcesses all members in the list 99 // 67 100 Bool_t MDataArray::PreProcess(const MParList *plist) 68 101 { … … 82 115 } 83 116 117 // -------------------------------------------------------------------------- 118 // 119 // Print the rules for all entries of the array 120 // 84 121 void MDataArray::Print(Option_t *opt) const 85 122 { … … 102 139 } 103 140 141 // -------------------------------------------------------------------------- 142 // 143 // Implementation of SavePrimitive. Used to write the call to a constructor 144 // to a macro. In the original root implementation it is used to write 145 // gui elements to a macro-file. 146 // 104 147 void MDataArray::StreamPrimitive(ofstream &out) const 105 148 { … … 119 162 out << " " << GetUniqueName() << ".AddEntry(\"" << data->GetRule() << "\");" << endl; 120 163 } 164 165 // -------------------------------------------------------------------------- 166 // 167 // Return the data members existing in this array in a comma-seperated list 168 // (This is mainly used for MTask::AddToBranchList) 169 // 170 TString MDataArray::GetDataMember() const 171 { 172 TString str; 173 174 TIter Next(&fList); 175 MData *data = NULL; 176 while ((data=(MData*)Next())) 177 { 178 if (data->GetDataMember().IsNull()) 179 continue; 180 181 str += ","; 182 str += data->GetDataMember(); 183 } 184 return str; 185 } -
trunk/MagicSoft/Mars/mdata/MDataArray.h
r1488 r1574 28 28 29 29 void AddEntry(const TString rule); 30 void AddEntry(MData *data); 30 31 31 32 MData &operator[](Int_t i) const; … … 33 34 34 35 Bool_t PreProcess(const MParList *plist); 36 37 TString GetDataMember() const; 35 38 36 39 void Print(Option_t *opt = "") const; -
trunk/MagicSoft/Mars/mdata/MDataChain.cc
r1524 r1574 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@ uni-sw.gwdg.de>18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 20 ! Copyright: MAGIC Software Development, 2000-2002 … … 95 95 ClassImp(MDataChain); 96 96 97 // -------------------------------------------------------------------------- 98 // 99 // Constructor which takes a rule and a surrounding operator as argument 100 // 97 101 MDataChain::MDataChain(const char *rule, OperatorType_t op) 98 102 : fOperatorType(op) … … 104 108 } 105 109 110 // -------------------------------------------------------------------------- 111 // 112 // Default constructor 113 // 106 114 MDataChain::MDataChain() 107 115 : fMember(NULL), fOperatorType(kENoop) … … 109 117 } 110 118 119 // -------------------------------------------------------------------------- 120 // 121 // Constructor taking a rule as an argument. For more details see 122 // class description 123 // 111 124 MDataChain::MDataChain(const char *rule, const char *name, const char *title) 112 125 : fOperatorType(kENoop) … … 220 233 } 221 234 235 // -------------------------------------------------------------------------- 236 // 237 // Core of the data chain. Here the chain is constructed out of the rule. 238 // 222 239 MData *MDataChain::ParseString(TString txt, Int_t level) 223 240 { … … 420 437 } 421 438 439 // -------------------------------------------------------------------------- 440 // 441 // Returns the value described by the rule 442 // 422 443 Double_t MDataChain::GetValue() const 423 444 { … … 498 519 */ 499 520 521 // -------------------------------------------------------------------------- 522 // 523 // Builds a rule from all the chain members. This is a rule which could 524 // be used to rebuild the chain. 525 // 500 526 TString MDataChain::GetRule() const 501 527 { … … 541 567 return str; 542 568 } 569 570 // -------------------------------------------------------------------------- 571 // 572 // Return a comma seperated list of all data members used in the chain. 573 // This is mainly used in MTask::AddToBranchList 574 // 575 TString MDataChain::GetDataMember() const 576 { 577 return fMember->GetDataMember(); 578 } -
trunk/MagicSoft/Mars/mdata/MDataChain.h
r1524 r1574 66 66 67 67 TString GetRule() const; 68 TString GetDataMember() const; 68 69 69 70 ClassDef(MDataChain, 1) // A chain/concatenation of MData objects -
trunk/MagicSoft/Mars/mdata/MDataElement.cc
r1524 r1574 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@ uni-sw.gwdg.de>18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 20 ! Copyright: MAGIC Software Development, 2000-2002 -
trunk/MagicSoft/Mars/mdata/MDataList.cc
r1481 r1574 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@ uni-sw.gwdg.de>18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 20 ! Copyright: MAGIC Software Development, 2000-2002 … … 182 182 } 183 183 184 // -------------------------------------------------------------------------- 185 // 186 // PreProcesses all members in the list 187 // 184 188 Bool_t MDataList::PreProcess(const MParList *plist) 185 189 { … … 259 263 */ 260 264 265 // -------------------------------------------------------------------------- 266 // 267 // Builds a rule from all the list members. This is a rule which could 268 // be used to rebuild the list using the constructor of a MDataChain 269 // 261 270 TString MDataList::GetRule() const 262 271 { … … 306 315 return str; 307 316 } 317 318 // -------------------------------------------------------------------------- 319 // 320 // Return a comma seperated list of all data members used in the chain. 321 // This is mainly used in MTask::AddToBranchList 322 // 323 TString MDataList::GetDataMember() const 324 { 325 TString str; 326 327 TIter Next(&fMembers); 328 329 MData *member=(MData*)Next(); 330 331 if (!member->GetDataMember().IsNull()) 332 str += member->GetDataMember(); 333 334 while ((member=(MData*)Next())) 335 { 336 if (!member->GetDataMember().IsNull()) 337 { 338 str += ","; 339 str += member->GetDataMember(); 340 } 341 } 342 343 return str; 344 } -
trunk/MagicSoft/Mars/mdata/MDataList.h
r1481 r1574 49 49 // void Print(Option_t *opt = "") const; 50 50 TString GetRule() const; 51 TString GetDataMember() const; 51 52 52 53 ClassDef(MDataList, 1) // A concatenation of MData objects by one operator -
trunk/MagicSoft/Mars/mdata/MDataMember.cc
r1481 r1574 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@ uni-sw.gwdg.de>18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 20 ! Copyright: MAGIC Software Development, 2000-2002 … … 170 170 */ 171 171 172 // -------------------------------------------------------------------------- 173 // 174 // Builds a rule which cn be used in a MDataChain to describe this object 175 // 172 176 TString MDataMember::GetRule() const 173 177 { 174 178 return fDataMember; 175 179 } 180 181 // -------------------------------------------------------------------------- 182 // 183 // Returns the data member. 184 // This is mainly used in MTask::AddToBranchList 185 // 186 TString MDataMember::GetDataMember() const 187 { 188 return fDataMember; 189 } -
trunk/MagicSoft/Mars/mdata/MDataMember.h
r1481 r1574 37 37 //void Print(Option_t *opt = "") const; 38 38 TString GetRule() const; 39 TString GetDataMember() const; 39 40 40 41 ClassDef(MDataMember, 1) // MData object corresponding to a single data member of a Mars container
Note:
See TracChangeset
for help on using the changeset viewer.