Changeset 5692 for trunk/MagicSoft/Mars/mdata
- Timestamp:
- 01/03/05 12:02:16 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mdata
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mdata/MDataArray.cc
r5100 r5692 18 18 ! Author(s): Thomas Bretz 08/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 420 ! Copyright: MAGIC Software Development, 2000-2005 21 21 ! 22 22 ! … … 86 86 // -------------------------------------------------------------------------- 87 87 // 88 // Try to find a MData which has the same rule (GetRule()). 89 // Be carefull: This may already fail if the rule is A*B and you are 90 // searching for B*A - FIXME: A more intelligent comaparton (based on 91 // IsEqual()) should be developed. 92 // 93 // Returns the index in the array, -1 if rule was not found. 94 // 95 Int_t MDataArray::FindRule(const char *rule) const 96 { 97 const MDataChain data(rule); 98 if (!data.IsValid()) 99 return -1; 100 101 const TString r(data.GetRule()); 102 103 TIter Next(&fList); 104 const MData *d = NULL; 105 while ((d=(MData*)Next())) 106 if (d->GetRule()==r) 107 return fList.IndexOf(d); 108 109 return -1; 110 } 111 112 // -------------------------------------------------------------------------- 113 // 88 114 // Return the i-th entry 89 115 // … … 131 157 Int_t n=0; 132 158 133 TIter Next(&fList); 134 MData *data = NULL; 135 while ((data=(MData*)Next())) 136 { 137 *fLog << all << " " << fName << "[" << setw(3) << n++ << "] = " << flush; 159 const Int_t w = 1+(Int_t)TMath::Log10(fList.GetEntries()); 160 161 TIter Next(&fList); 162 MData *data = NULL; 163 while ((data=(MData*)Next())) 164 { 165 *fLog << all << " " << fName << "[" << setw(w) << n++ << "] = " << flush; 138 166 data->Print(); 139 167 *fLog << endl; -
trunk/MagicSoft/Mars/mdata/MDataArray.h
r3572 r5692 32 32 void AddEntry(MData *data); 33 33 34 Int_t FindRule(const char *rule) const; 35 34 36 MData &operator[](Int_t i) const; 35 37 Double_t operator()(Int_t i) const; -
trunk/MagicSoft/Mars/mdata/MDataChain.cc
r3788 r5692 18 18 ! Author(s): Thomas Bretz 04/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 420 ! Copyright: MAGIC Software Development, 2000-2005 21 21 ! 22 22 ! … … 211 211 return; 212 212 213 *fLog << inf << " Trying to resolverule... " << flush;213 *fLog << inf << "Parsing rule... " << flush; 214 214 if (!(fMember=ParseString(rule, 1))) 215 215 {
Note:
See TracChangeset
for help on using the changeset viewer.