Changeset 2604 for trunk/MagicSoft/Mars/mfileio
- Timestamp:
- 12/05/03 11:34:19 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mfileio
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mfileio/FileIOLinkDef.h
r2556 r2604 10 10 #pragma link C++ class MReadReports+; 11 11 #pragma link C++ class MReadMarsFile+; 12 #pragma link C++ class MReadCurrents+;13 12 #pragma link C++ class MReadRflFile+; 14 13 -
trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc
r2461 r2604 905 905 // int isecs_since_midday; // seconds passed since midday before sunset (JD of run start) 906 906 // int isecfrac_200ns; // fractional part of isecs_since_midday 907 fTime->SetCT1Time(event.isecfrac_200ns, event.isecs_since_midday); 908 fTime->SetDuration((Int_t)fRawRunHeader->GetMJD()); 907 fTime->SetCT1Time((UInt_t)fRawRunHeader->GetMJD(), event.isecfrac_200ns, event.isecs_since_midday); 909 908 fTime->SetReadyToSave(); 910 909 -
trunk/MagicSoft/Mars/mfileio/MReadCurrents.cc
r2377 r2604 223 223 Int_t h, m, s, ms; 224 224 *fIn >> h >> m >> s >> ms; 225 fTime->Set Time(h, m, s, ms*1000000);225 fTime->Set(0, 0, 0, h, m, s, ms); 226 226 227 227 for (int i=0; i<fNumPixel; i++) -
trunk/MagicSoft/Mars/mfileio/MReadReports.cc
r2590 r2604 82 82 // Call SetOwner for fTrees and fChains 83 83 // 84 MReadReports::MReadReports() 84 MReadReports::MReadReports() : fEnableAutoScheme(kFALSE) 85 85 { 86 86 fName = "MRead"; … … 140 140 t->SetTitle(time?time:""); 141 141 142 if (!fEnableAutoScheme) 143 t->DisableAutoScheme(); 144 142 145 //FIXME! 143 146 //t->DisableAutoScheme(); … … 257 260 MTime &t = **GetTime(c); 258 261 259 if (t.GetHour()<12)260 t.SetTime((Byte_t)(t.GetHour()+24), t.GetMin(), t.GetSec(), t.GetNanoSec());261 262 262 if (i==0) 263 263 tmin = t; … … 276 276 277 277 // FIXME: Use Stream ID and call CallProcess() ? 278 if (((MTask*)fTrees->GetList()->At(nmin))->CallProcess()) 278 Bool_t rc = ((MTask*)fTrees->GetList()->At(nmin))->CallProcess(); 279 if (rc) 279 280 { 280 /*281 *fLog << dbg << ((MReadTree*)fTrees->At(nmin))->GetTreeName() << " " << flush;282 283 if (tmin.GetHour()>=24)284 tmin.SetTime((Byte_t)(tmin.GetHour()-24), tmin.GetMin(), tmin.GetSec(), tmin.GetNanoSec());285 tmin.Print();286 */287 288 281 fList->SetStreamId(fTrees->GetList()->At(nmin)->GetName()); 289 282 return kTRUE; … … 292 285 delete *GetTime(chain); 293 286 delete GetTime(chain); 294 // FIXME: Is it really deleted? 295 fChains->Remove(chain); 287 delete fChains->Remove(chain); 296 288 } 297 289 -
trunk/MagicSoft/Mars/mfileio/MReadReports.h
r2590 r2604 24 24 MTask *fList; // pointer to the task list to set the stream id 25 25 26 Bool_t fEnableAutoScheme; 27 26 28 MTime** GetTime(TChain *c) const; 27 29 … … 42 44 void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE) const; 43 45 46 void EnableAutoScheme(Bool_t e=kTRUE) { fEnableAutoScheme = e; } 47 44 48 ClassDef(MReadReports, 0) // Reads events and reports from a root file ordered in time 45 49 }; -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
r2556 r2604 192 192 // is the name of the tree. 193 193 // 194 void MWriteRootFile::AddContainer(const char *cname, const char *tname, const char *ttitle)194 void MWriteRootFile::AddContainer(const char *cname, const char *tname, Bool_t must) 195 195 { 196 196 // … … 198 198 // add the entry to the list. 199 199 // 200 MRootFileBranch *entry = new MRootFileBranch(cname, tname, ttitle);200 MRootFileBranch *entry = new MRootFileBranch(cname, tname, must); 201 201 fBranches.AddLast(entry); 202 202 … … 216 216 // 217 217 void MWriteRootFile::AddContainer(MParContainer *cont, const char *tname, 218 const char *ttitle)218 Bool_t must) 219 219 { 220 220 // … … 222 222 // add the entry to the list. 223 223 // 224 MRootFileBranch *entry = new MRootFileBranch(cont, tname, ttitle);224 MRootFileBranch *entry = new MRootFileBranch(cont, tname, must); 225 225 fBranches.AddLast(entry); 226 226 } … … 264 264 // No corresponding container is found 265 265 // 266 *fLog << err << "Cannot find parameter container '" << cname << "'." << endl; 267 return kFALSE; 266 if (entry->MustHave()) 267 { 268 *fLog << err << "Cannot find parameter container '" << cname << "'." << endl; 269 return kFALSE; 270 } 271 272 *fLog << inf << "Unnecessary parameter container '" << cname << "' not found..." << endl; 273 delete fBranches.Remove(entry); 274 continue; 268 275 } 276 269 277 // 270 278 // The container is found. Put the pointer into the entry. … … 276 284 // Get container name, tree name and tree title of this entry. 277 285 // 278 const char *cname 279 const char *tname 280 const char *ttitle = entry->GetTitle();286 const char *cname = cont->GetName(); 287 const char *tname = entry->GetName(); 288 const TString ttitle(Form("Tree containing %s", cont->GetDescriptor())); 281 289 282 290 // … … 301 309 fOut->cd(); 302 310 303 tree = new TTree(tname, ttitle ? ttitle : tname);311 tree = new TTree(tname, ttitle); 304 312 fTrees.AddLast(tree); 305 313 … … 494 502 495 503 out << ", \"" << entry->GetName() << "\""; 496 if ( (TString)entry->GetTitle()!="")497 out << ", \"" << entry->GetTitle() << "\"";504 if (!entry->MustHave()) 505 out << ", kFALSE"; 498 506 499 507 out <<");" << endl; -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h
r2470 r2604 22 22 TString fContName; 23 23 24 void Init(const char *name, const char *title) 24 Bool_t fMust; 25 26 void Init(const char *name, Bool_t must) 25 27 { 26 28 SetName(name?name:""); 27 SetTitle(title?title:"");29 fMust = must; 28 30 } 29 31 30 32 public: 31 MRootFileBranch() : fTree(NULL), fBranch(NULL), fContainer(NULL) 33 MRootFileBranch() : fTree(NULL), fBranch(NULL), fContainer(NULL), fMust(0) 32 34 { 33 Init(NULL, NULL);35 Init(NULL, kFALSE); 34 36 fContName = ""; 35 37 } 36 38 37 MRootFileBranch(const char *cname, const char *tname=NULL, const char *ttitle=NULL)38 : fTree(NULL), fBranch(NULL), fContainer(NULL) 39 MRootFileBranch(const char *cname, const char *tname=NULL, Bool_t must=kFALSE) 40 : fTree(NULL), fBranch(NULL), fContainer(NULL), fMust(0) 39 41 { 40 Init(tname, ttitle);42 Init(tname, must); 41 43 fContName = cname; 42 44 } 43 45 44 MRootFileBranch(MParContainer *cont, const char *tname=NULL, const char *ttitle=NULL)45 : fTree(NULL), fBranch(NULL), fContName("") 46 MRootFileBranch(MParContainer *cont, const char *tname=NULL, Bool_t must=kFALSE) 47 : fTree(NULL), fBranch(NULL), fContName(""), fMust(0) 46 48 { 47 Init(tname, ttitle);49 Init(tname, must); 48 50 fContainer = cont; 49 51 } … … 54 56 TBranch *GetBranch() const { return fBranch; } 55 57 const char *GetContName() const { return fContName; } 58 Bool_t MustHave() const { return fMust; } 56 59 57 60 void SetContainer(MParContainer *cont) { fContainer = cont; } … … 98 101 99 102 100 void AddContainer(const char *cname, 101 const char *tname=NULL, const char *ttitle=NULL); 102 void AddContainer(MParContainer *cont, 103 const char *tname=NULL, const char *ttitle=NULL); 103 void AddContainer(const char *cname, const char *tname=NULL, Bool_t must=kTRUE); 104 void AddContainer(MParContainer *cont, const char *tname=NULL, Bool_t must=kTRUE); 104 105 105 106 -
trunk/MagicSoft/Mars/mfileio/Makefile
r2556 r2604 36 36 MReadTree.cc \ 37 37 MReadReports.cc \ 38 MReadCurrents.cc \39 38 MReadMarsFile.cc \ 40 39 MReadRflFile.cc \
Note:
See TracChangeset
for help on using the changeset viewer.