Changeset 1304
- Timestamp:
- 04/26/02 12:54:38 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1303 r1304 9 9 - removed some unnecessary StrDup calls 10 10 - changed binning (Thanks to Abelardo) 11 12 * mdata/MData.[h,cc]: 13 - documentation added 14 - implemented a new abstract member function: IsValid 15 16 * mdata/MDataChain.cc, mdata/MDataList.cc: 17 - changed logging output 18 19 * mdata/MDataList.h, mdata/MDataMember.h, mdata/MDataValue.h: 20 - implemented IsValid 21 22 * mdata/MDataMember.cc: 23 - Don't preprocess if fCall is already available 24 - documentation added 25 26 * mdata/MDataValue.cc: 27 - documentation added 11 28 12 29 -
trunk/MagicSoft/Mars/mdata/MData.cc
r1287 r1304 27 27 // MData 28 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 // 29 46 ///////////////////////////////////////////////////////////////////////////// 30 47 -
trunk/MagicSoft/Mars/mdata/MData.h
r1287 r1304 4 4 ///////////////////////////////////////////////////////////////////////////// 5 5 // // 6 // MData List//6 // MData // 7 7 // // 8 8 ///////////////////////////////////////////////////////////////////////////// … … 18 18 public: 19 19 virtual Double_t GetValue() const = 0; 20 virtual Bool_t IsValid() const = 0; 20 21 virtual Bool_t PreProcess(const MParList *plist) = 0; 21 22 22 ClassDef(MData, 0) // A Filter for cuts in any data member23 ClassDef(MData, 0) // A Base class for a generalized value 23 24 }; 24 25 -
trunk/MagicSoft/Mars/mdata/MDataChain.cc
r1299 r1304 48 48 fTitle = title ? title : rule; 49 49 50 *fLog << inf << "Trying to resolve rule... " << endl;50 *fLog << inf << "Trying to resolve rule... " << flush; 51 51 if (!(fMember=ParseString(rule, 1))) 52 52 { … … 54 54 return; 55 55 } 56 57 *fLog << inf << endl; 58 *fLog << "Using Filter rule " << fMember->GetName(); 59 *fLog << " for " << fName << ":" << endl; 56 *fLog << inf << "found: " << flush; 60 57 fMember->Print(); 61 *fLog << endl << endl;58 *fLog << endl; 62 59 63 60 } … … 267 264 return fMember ? fMember->GetValue() : 0; 268 265 } 266 267 void MDataChain::Print(Option_t *opt = "") const 268 { 269 fMember->Print(); 270 } -
trunk/MagicSoft/Mars/mdata/MDataChain.h
r1287 r1304 32 32 Bool_t IsValid() const { return fMember ? kTRUE : kFALSE; } 33 33 34 void Print(Option_t *opt = "") const; 35 34 36 ClassDef(MDataChain, 0) // A Filter for cuts in any data member 35 37 }; -
trunk/MagicSoft/Mars/mdata/MDataList.cc
r1287 r1304 158 158 fMembers.Add(member); 159 159 160 *fLog << "Done." << endl;161 162 160 return kTRUE; 163 161 } -
trunk/MagicSoft/Mars/mdata/MDataList.h
r1287 r1304 40 40 void SetOwner(Bool_t enable=kTRUE) { enable ? SetBit(kIsOwner) : ResetBit(kIsOwner); } 41 41 42 Bool_t IsValid() const { return fMembers.GetSize() ? kTRUE : kFALSE; } 43 42 44 Double_t GetValue() const; 43 45 Bool_t PreProcess(const MParList *plist); -
trunk/MagicSoft/Mars/mdata/MDataMember.cc
r1287 r1304 25 25 ///////////////////////////////////////////////////////////////////////////// 26 26 // 27 // MDataList 28 // Chain, catenation ? 27 // MDataMember 28 // 29 // This objects corresponds to the data member of another object. 30 // You can either specify the object as a string, eg "MHillas.fWidth" 31 // where MHillas is the name of the container in the parameterlist 32 // and fWidth is it's data member, or you can specify it by giving 33 // the pointer corresponding to the instance of your object and 34 // a TMethodCall pointer corresponding to the Member function returning 35 // the requested value. 29 36 // 30 37 ///////////////////////////////////////////////////////////////////////////// … … 41 48 ClassImp(MDataMember); 42 49 50 // -------------------------------------------------------------------------- 51 // 52 // obj is a pointer to the instance of your class from which the data 53 // should be requested. TMethodCall (s. root dox) is a pointer 54 // to a TMethodCall object which should be the getter function for 55 // the data you want to get. 56 // 43 57 MDataMember::MDataMember(MParContainer *obj, TMethodCall *call) 44 58 { … … 47 61 } 48 62 63 // -------------------------------------------------------------------------- 64 // 65 // returns the value you requested 66 // 49 67 Double_t MDataMember::GetValue() const 50 68 { … … 71 89 } 72 90 91 // -------------------------------------------------------------------------- 92 // 93 // If a string was given PreProcess try to resolv the object name and 94 // tries to get it from the parlist. And also tries to resolve 95 // the data member (variable) name you requested and tries to get a 96 // corresponding TMethodCall from the root Dictionary. 97 // Remark: If your Data Member is called fDataMember the corresponding 98 // getter Method in your class must be calles fDataMember 99 // 73 100 Bool_t MDataMember::PreProcess(const MParList *plist) 74 101 { 102 if (fCall) 103 return kTRUE; 104 75 105 TString cname(fName); 76 106 TString mname(fName); … … 98 128 } 99 129 130 // -------------------------------------------------------------------------- 131 // 132 // Print the name of the data member without an CR. 133 // 100 134 void MDataMember::Print(Option_t *opt = "") const 101 135 { -
trunk/MagicSoft/Mars/mdata/MDataMember.h
r1287 r1304 28 28 Bool_t PreProcess(const MParList *plist); 29 29 30 Bool_t IsValid() const { return fCall ? kTRUE : kFALSE; } 31 30 32 void Print(Option_t *opt = "") const; 31 33 -
trunk/MagicSoft/Mars/mdata/MDataValue.cc
r1287 r1304 26 26 // 27 27 // MDataValue 28 // Chain, catenation ? 28 // 29 // An MData object which corresponds to a simple value like 5.5, or 7.9 29 30 // 30 31 ///////////////////////////////////////////////////////////////////////////// -
trunk/MagicSoft/Mars/mdata/MDataValue.h
r1287 r1304 25 25 Bool_t PreProcess(const MParList *plist) { return kTRUE; } 26 26 27 Bool_t IsValid() const { return kTRUE; } 28 27 29 void Print(Option_t *opt = "") const; 28 30
Note:
See TracChangeset
for help on using the changeset viewer.