Changeset 1203 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 01/21/02 20:52:12 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r1080 r1203 37 37 #include "MParContainer.h" 38 38 39 #include <fstream.h> // ofstream, AsciiWrite 40 39 41 #include <TClass.h> // IsA 40 42 #include <TROOT.h> // TROOT::Identlevel 43 #include <TMethodCall.h> // TMethodCall, AsciiWrite 44 #include <TDataMember.h> // TDataMember, AsciiWrite 41 45 #include <TVirtualPad.h> // gPad 42 46 … … 211 215 // 212 216 // If you want to use Ascii-Input/-Output (eg. MWriteAsciiFile) of a 213 // container, overload this function. 217 // container, you may overload this function. If you don't overload it 218 // the data member of a class are written to the file in the order of 219 // appearance in the class header (be more specfic: root dictionary) 220 // Only data members which are of integer (Bool_t, Int_t, ...) or 221 // floating point (Float_t, Double_t, ...) type are written. 214 222 // 215 223 void MParContainer::AsciiWrite(ofstream &fout) const 216 224 { 217 *fLog << warn << "To use the the ascii output of " << GetName(); 218 *fLog << " you have to overload " << ClassName() << "::AsciiWrite." << endl; 219 } 225 // *fLog << warn << "To use the the ascii output of " << GetName(); 226 // *fLog << " you have to overload " << ClassName() << "::AsciiWrite." << endl; 227 228 TDataMember *data = NULL; 229 230 TIter Next(IsA()->GetListOfDataMembers()); 231 while ((data=(TDataMember*)Next())) 232 { 233 if (!data->IsPersistent()) 234 continue; 235 236 /*const*/ TMethodCall *call = data->GetterMethod(); //FIXME: Root 237 if (!call) 238 continue; 239 240 switch (call->ReturnType()) 241 { 242 case TMethodCall::kLong: 243 Long_t l; 244 call->Execute((void*)this, l); // FIXME: const, root 245 fout << l << " "; 246 continue; 247 248 case TMethodCall::kDouble: 249 Double_t d; 250 call->Execute((void*)this, d); // FIXME: const, root 251 fout << d << " "; 252 continue; 253 254 case TMethodCall::kOther: 255 /* someone may want to enhance this? */ 256 continue; 257 } 258 } 259 } -
trunk/MagicSoft/Mars/mbase/MReadMarsFile.cc
r1172 r1203 114 114 if (fRun->Process()) 115 115 { 116 TString name(GetFileName()); 117 name.Remove(0, name.Last('/')+1); 118 119 *fLog << inf << "MReadMarsFile: Switching to '" << name << "' "; 116 *fLog << inf << "MReadMarsFile: Switching to '" << GetFileName() << "' "; 120 117 *fLog << "(before event #" << GetEventNum()-1 << ")" << endl; 121 118 -
trunk/MagicSoft/Mars/mbase/MReadTree.cc
r1192 r1203 407 407 if (!fNumEntries) 408 408 { 409 *fLog << warn << dbginf << "No entries found in file(s) ." << endl;409 *fLog << warn << dbginf << "No entries found in file(s)" << endl; 410 410 return kFALSE; 411 411 } … … 692 692 // Return the name of the file we are actually reading from. 693 693 // 694 const char *MReadTree::GetFileName() const 695 { 696 return fChain->GetFile()->GetName(); 694 TString MReadTree::GetFileName() const 695 { 696 const TFile *file = fChain->GetFile(); 697 698 if (!file) 699 return TString("<unknown>"); 700 701 TString name(file->GetName()); 702 name.Remove(0, name.Last('/')+1); 703 return name; 697 704 } 698 705 -
trunk/MagicSoft/Mars/mbase/MReadTree.h
r1114 r1203 58 58 UInt_t GetEntries() const { return fNumEntries; } 59 59 60 const char *GetFileName() const;60 TString GetFileName() const; 61 61 62 62 virtual void AddNotify(TObject *obj);
Note:
See TracChangeset
for help on using the changeset viewer.