Changeset 4828
- Timestamp:
- 09/02/04 14:32:50 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4826 r4828 19 19 20 20 -*-*- END OF LINE -*-*- 21 22 2004/09/1: Thomas Bretz 21 2004/09/02: Thomas Bretz 22 23 * star.cc: 24 - fixed treatment of batch-mode 25 26 * mbase/MParContainer.h: 27 - added a comment 28 29 * mbase/MParList.[h,cc]: 30 - added FindTaskListWithTask 31 32 * mbase/MTaskList.[h,cc]: 33 - added sanity checks in AddToList 34 - added FindTaskList 35 36 * mhbase/MH3.[h,cc]: 37 - moved some drawing code from Draw to Paint 38 - added possibility to set logarithmic axis manually 39 40 * mhist/MHAlpha.cc: 41 - paint significance 42 43 * mhvstime/MHVsTime.[h,cc]: 44 - added option to average data 45 46 * mjobs/MJCalibrateSignal.cc: 47 - added MPointingPosCalc for "Drive" 48 49 * mmain/MEventDisplay.cc: 50 - fixed some problems with the display 51 52 * msignal/MArrivalTime.[h,cc]: 53 - added Print() 54 55 56 57 2004/09/01: Thomas Bretz 23 58 24 59 * mfileio/MWriteRootFile.[h,cc]: -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r4710 r4828 101 101 virtual void SetDisplay(MStatusDisplay *d) { fDisplay = d; } 102 102 103 // FIXME: Change to ostream! 103 // FIXME: Change to ostream! Seems to be difficult, because 104 // MTaskListStreamPrimitive calls SavePrimitive(ofstream&). 105 // Maybe with a cast? 104 106 virtual void StreamPrimitive(ofstream &out) const; 105 107 -
trunk/MagicSoft/Mars/mbase/MParList.cc
r4694 r4828 51 51 52 52 #include "MIter.h" 53 #include "MTaskList.h" 53 54 54 55 ClassImp(MParList); … … 376 377 TObject *l = FindObject(tlist, "MTaskList"); 377 378 return (MTask*)(l ? l->FindObject(name) : NULL); 379 } 380 381 // -------------------------------------------------------------------------- 382 // 383 // Find a tasklist which contains a task with name name 384 // 385 MTaskList *MParList::FindTaskListWithTask(const char *name) const 386 { 387 TIter Next(fContainer); 388 TObject *o=0; 389 while ((o=Next())) 390 { 391 MTaskList *l1 = dynamic_cast<MTaskList*>(o); 392 if (!l1) 393 continue; 394 395 MTaskList *l2 = l1->FindTaskList(name); 396 if (l2) 397 return l2; 398 } 399 return 0; 400 } 401 402 // -------------------------------------------------------------------------- 403 // 404 // Find a tasklist which contains a task task 405 // 406 MTaskList *MParList::FindTaskListWithTask(const MTask *task) const 407 { 408 TIter Next(fContainer); 409 TObject *o=0; 410 while ((o=Next())) 411 { 412 MTaskList *l1 = dynamic_cast<MTaskList*>(o); 413 if (!l1) 414 continue; 415 416 MTaskList *l2 = l1->FindTaskList(task); 417 if (l2) 418 return l2; 419 } 420 return 0; 378 421 } 379 422 -
trunk/MagicSoft/Mars/mbase/MParList.h
r4694 r4828 22 22 class MLog; 23 23 class MTask; 24 class MTaskList; 24 25 25 26 class MParList : public MParContainer … … 53 54 void SetDisplay(MStatusDisplay *d); 54 55 55 TObject *FindObject(const char *name) const;56 TObject *FindObject(const TObject *obj) const;56 TObject *FindObject(const char *name) const; 57 TObject *FindObject(const TObject *obj) const; 57 58 58 TObject *FindObject(const char *name, const char *classname) const;59 TObject *FindObject(const TObject *obj, const char *classname) const;59 TObject *FindObject(const char *name, const char *classname) const; 60 TObject *FindObject(const TObject *obj, const char *classname) const; 60 61 61 MTask *FindTask(const char *name, const char *tlist="MTaskList") const; 62 MTask *FindTask(const char *name, const char *tlist="MTaskList") const; 63 MTaskList *FindTaskListWithTask(const char *name) const; 64 MTaskList *FindTaskListWithTask(const MTask *task) const; 62 65 63 66 MParContainer *FindCreateObj(const char *classname, const char *objname=NULL); -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r4601 r4828 229 229 Bool_t MTaskList::AddToListBefore(MTask *task, const MTask *where, const char *type) 230 230 { 231 if (task==this) 232 { 233 *fLog << warn << "WARNING - You cannot add a tasklist to itself. This" << endl; 234 *fLog << " would create infinite recursions...ignored." << endl; 235 return kFALSE; 236 237 } 238 231 239 // FIXME: We agreed to put the task into list in an ordered way. 232 240 if (!CheckAddToList(task, type, where)) … … 249 257 Bool_t MTaskList::AddToListAfter(MTask *task, const MTask *where, const char *type) 250 258 { 259 if (task==this) 260 { 261 *fLog << warn << "WARNING - You cannot add a tasklist to itself. This" << endl; 262 *fLog << " would create infinite recursions...ignored." << endl; 263 return kFALSE; 264 265 } 266 251 267 // FIXME: We agreed to put the task into list in an ordered way. 252 253 268 if (!CheckAddToList(task, type, where)) 254 269 return kFALSE; … … 270 285 Bool_t MTaskList::AddToList(MTask *task, const char *type) 271 286 { 287 if (task==this) 288 { 289 *fLog << warn << "WARNING - You cannot add a tasklist to itself. This" << endl; 290 *fLog << " would create infinite recursions...ignored." << endl; 291 return kFALSE; 292 293 } 294 272 295 // FIXME: We agreed to put the task into list in an ordered way. 273 274 296 if (!CheckAddToList(task, type)) 275 297 return kFALSE; … … 301 323 { 302 324 return fTasks->FindObject(obj); 325 } 326 327 // -------------------------------------------------------------------------- 328 // 329 // find recursively a tasklist which contains a task with name task 330 // 331 MTaskList *MTaskList::FindTaskList(const char *task) 332 { 333 if (FindObject(task)) 334 return this; 335 336 TIter Next(fTasks); 337 TObject *o = 0; 338 while ((o=Next())) 339 { 340 MTaskList *l = dynamic_cast<MTaskList*>(o); 341 if (!l) 342 continue; 343 344 if (l->FindObject(task)) 345 return l; 346 } 347 return 0; 348 } 349 350 // -------------------------------------------------------------------------- 351 // 352 // find recursively a tasklist which contains a task task 353 // 354 MTaskList *MTaskList::FindTaskList(const MTask *task) 355 { 356 if (FindObject(task)) 357 return this; 358 359 TIter Next(fTasks); 360 TObject *o = 0; 361 while ((o=Next())) 362 { 363 MTaskList *l = dynamic_cast<MTaskList*>(o); 364 if (!l) 365 continue; 366 367 if (l->FindObject(task)) 368 return l; 369 } 370 371 return 0; 303 372 } 304 373 -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r4601 r4828 62 62 return (MTask*)FindObject(obj); 63 63 } 64 MTaskList *FindTaskList(const char *task); 65 MTaskList *FindTaskList(const MTask *task); 64 66 65 67 Bool_t ReInit(MParList *pList=NULL); -
trunk/MagicSoft/Mars/mhbase/MH3.cc
r2737 r4828 113 113 114 114 fName = gsDefName; 115 fTitle = Form(gsDefTitle.Data(), 1);115 fTitle = Form(gsDefTitle.Data(), fDimension); 116 116 117 117 if (fHist) … … 514 514 */ 515 515 516 /* 517 void MH3::Paint(Option_t *opt) 518 { 519 if (fHist->TestBit(kIsLogx)) pad->SetLogx(); 520 if (fHist->TestBit(kIsLogy)) pad->SetLogy(); 521 if (fHist->TestBit(kIsLogz)) pad->SetLogz(); 522 } 523 */ 524 525 void MH3::Paint(Option_t *o) 526 { 527 TString str(o); 528 529 // FIXME: Do it in Paint() 530 if (str.Contains("COL", TString::kIgnoreCase)) 531 SetColors(); 532 533 if (fHist->TestBit(kIsLogx) && fHist->GetEntries()>0) gPad->SetLogx(); 534 if (fHist->TestBit(kIsLogy) && fHist->GetEntries()>0) gPad->SetLogy(); 535 if (fHist->TestBit(kIsLogz) && fHist->GetEntries()>0) gPad->SetLogz(); 536 537 // Set pretty color palette 538 gStyle->SetPalette(1, 0); 539 540 TVirtualPad *padsave = gPad; 541 542 TProfile* h0; 543 if ((h0 = (TProfile*)gPad->FindObject("_pfx"))) 544 { 545 // Get projection for range 546 TProfile *p = ((TH2*)fHist)->ProfileX("_pfx", -1, 9999, "s"); 547 548 // Move contents from projection to h3 549 h0->Reset(); 550 h0->Add(p); 551 delete p; 552 553 // Set Minimum as minimum value Greater Than 0 554 //h0->SetMinimum(GetMinimumGT(*h0)); 555 } 556 if ((h0 = (TProfile*)gPad->FindObject("_pfy"))) 557 { 558 // Get projection for range 559 TProfile *p = ((TH2*)fHist)->ProfileY("_pfy", -1, 9999, "s"); 560 561 // Move contents from projection to h3 562 h0->Reset(); 563 h0->Add(p); 564 delete p; 565 566 // Set Minimum as minimum value Greater Than 0 567 //h0->SetMinimum(GetMinimumGT(*h0)); 568 } 569 570 gPad = padsave; 571 } 572 516 573 // -------------------------------------------------------------------------- 517 574 // … … 534 591 pad->SetBorderMode(0); 535 592 536 AppendPad("");593 fHist->SetFillStyle(4000); 537 594 538 595 TString str(opt); 539 540 // FIXME: Do it in Paint()541 if (str.Contains("COL", TString::kIgnoreCase))542 SetColors();543 544 fHist->SetFillStyle(4000);545 596 546 597 Bool_t only = str.Contains("ONLY", TString::kIgnoreCase) && fDimension==2; … … 565 616 } 566 617 618 AppendPad(""); 619 /* 567 620 if (fHist->TestBit(kIsLogx)) pad->SetLogx(); 568 621 if (fHist->TestBit(kIsLogy)) pad->SetLogy(); 569 622 if (fHist->TestBit(kIsLogz)) pad->SetLogz(); 570 571 pad->Modified();572 pad->Update();623 */ 624 //pad->Modified(); 625 //pad->Update(); 573 626 } 574 627 -
trunk/MagicSoft/Mars/mhbase/MH3.h
r2737 r4828 41 41 void SetScaleZ(Double_t scale) { fScale[2] = scale; } 42 42 43 void SetLogx(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogx) : fHist->ResetBit(kIsLogx); } 44 void SetLogy(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogy) : fHist->ResetBit(kIsLogy); } 45 void SetLogz(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogz) : fHist->ResetBit(kIsLogz); } 46 43 47 Int_t GetDimension() const { return fDimension; } 44 48 Int_t GetNbins() const; … … 61 65 void SetColors() const; 62 66 void Draw(Option_t *opt=NULL); 67 void Paint(Option_t *opt=""); 63 68 64 69 MParContainer *New() const; -
trunk/MagicSoft/Mars/mhist/MHAlpha.cc
r4826 r4828 43 43 #include <TGraph.h> 44 44 #include <TStyle.h> 45 #include <TLatex.h> 45 46 #include <TCanvas.h> 46 #include <TPaveText.h>47 47 #include <TStopwatch.h> 48 48 … … 58 58 #include "MHMatrix.h" 59 59 60 #include "MMath.h" 60 61 #include "MBinning.h" 61 62 #include "MParList.h" … … 220 221 func.SetLineColor(kGreen); 221 222 func.Paint("same"); 223 224 const Double_t w=fHist.GetXaxis()->GetBinWidth(1); 225 226 const Double_t s = func.Integral(0, sigint)/w; 227 func.SetParameter(0, 0); 228 func.SetParameter(2, 1); 229 const Double_t b = func.Integral(0, sigint)/w; 230 const Double_t sig = MMath::SignificanceLiMaSigned(s, b); 231 232 TLatex text; 233 text.PaintLatex(35, fHist.GetMaximum()*1.1, 0, 0.05, Form("\\sigma=%.1f E=%d", sig, (int)(s-b))); 222 234 } 223 235 -
trunk/MagicSoft/Mars/mhvstime/MHVsTime.cc
r4703 r4828 82 82 fGraph = new TGraph; 83 83 fData = new MDataChain(rule); 84 85 fGraph->SetMarkerStyle(kFullDotMedium); 84 86 } 85 87 … … 131 133 132 134 fGraph->SetNameTitle(fName, title); 135 136 fMean = 0; 137 fN = 0; 133 138 134 139 return kTRUE; … … 186 191 fGraph->RemovePoint(0); 187 192 188 fGraph->SetPoint(fGraph->GetN(), t, v); 193 fMean += v; 194 fN++; 195 196 if (fN==fNumEvents) 197 { 198 fGraph->SetPoint(fGraph->GetN(), t, fMean/fN); 199 fMean = 0; 200 fN = 0; 201 } 189 202 190 203 return kTRUE; -
trunk/MagicSoft/Mars/mhvstime/MHVsTime.h
r4703 r4828 13 13 protected: 14 14 // Could be const but root < 3.02/06 doesn't like this... 15 TGraph *fGraph; // Histogram to fill 16 MDataChain *fData; // Object from which the data is filled 17 Double_t fScale; // Scale for axis (eg unit) 18 Int_t fMaxPts; // Maximum number of data points 15 TGraph *fGraph; // Histogram to fill 16 MDataChain *fData; // Object from which the data is filled 17 Double_t fScale; // Scale for axis (eg unit) 18 Int_t fMaxPts; // Maximum number of data points 19 20 Int_t fNumEvents; // Number of events to average 21 Double_t fMean; //! Mean value 22 Int_t fN; 23 19 24 20 25 enum { … … 51 56 52 57 void SetUseEventNumber(Bool_t use = kTRUE) { fUseEventNumber = use; } 58 void SetNumEvents(Int_t n) { fNumEvents=n; } 53 59 54 60 void Draw(Option_t *opt=NULL); -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r4760 r4828 59 59 #include "MReadReports.h" 60 60 #include "MGeomApply.h" 61 #include "MPointingPosCalc.h" 61 62 #include "MPedCalcFromLoGain.h" 62 63 #include "MExtractor.h" … … 345 346 write.AddContainer("MTimeTrigger", "Trigger", kFALSE); 346 347 // Slow-Control: Drive 348 write.AddContainer("MPointingPos", "Drive", kFALSE); 347 349 write.AddContainer("MReportDrive", "Drive", kFALSE); 348 350 write.AddContainer("MTimeDrive", "Drive", kFALSE); … … 371 373 tlist2.AddToList(&fill5); 372 374 375 // Setup List for Drive-tree 376 MPointingPosCalc pcalc; 377 373 378 // Now setup main tasklist 374 379 tlist.AddToList(&read); 375 380 tlist.AddToList(&tlist2, "Events"); 381 tlist.AddToList(&pcalc, "Drive"); 376 382 tlist.AddToList(&write); 377 383 -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r4823 r4828 73 73 #include "MImgCleanStd.h" // MImgCleanStd 74 74 #include "MHillasCalc.h" // MHillasCalc 75 #include "MHillasSrcCalc.h" // MHillasSrcCalc75 //#include "MHillasSrcCalc.h" // MHillasSrcCalc 76 76 //#include "MBlindPixelCalc.h" // MBlindPixelCalc 77 77 #include "MArrivalTimeCalc.h" // MArrivalTimeCalc … … 88 88 #include "MHillasExt.h" // MHillasExt::Print(const MGeomCam&) 89 89 #include "MHillasSrc.h" // MHillasSrc::Print(const MGeomCam&) 90 #include "MImagePar.h" // MImagePar::Print(const MGeomCam&) 90 91 #include "MNewImagePar.h" // MNewImagePar::Print(const MGeomCam&) 91 92 #include "MHEvent.h" // MHEvent … … 292 293 MFillH *fill04 = new MFillH(evt04, "MPedPhotCam", "MFillH04"); 293 294 MFillH *fill05 = new MFillH(evt05, "MCameraData", "MFillH05"); 294 MFillH *fill06a= new MFillH(evt06a, "MCameraData", "MFillH06 ");295 MFillH *fill06b= new MFillH(evt06b, "MCameraData", "MFillH06 ");296 //MBlindPixelCalc *blind = new MBlindPixelCalc;295 MFillH *fill06a= new MFillH(evt06a, "MCameraData", "MFillH06a"); 296 MFillH *fill06b= new MFillH(evt06b, "MCameraData", "MFillH06b"); 297 //MBlindPixelCalc *blind = new MBlindPixelCalc; 297 298 MHillasCalc *hcalc = new MHillasCalc; 298 MHillasSrcCalc *scalc = new MHillasSrcCalc;299 299 MMcTriggerLvl2Calc *trcal = new MMcTriggerLvl2Calc; 300 300 MFillH *fill09 = new MFillH(evt09, "MMcTriggerLvl2", "MFillH09"); … … 362 362 tlist->AddToList(fill06a); 363 363 tlist->AddToList(fill06b); 364 // tlist->AddToList(blind); 364 //tlist->AddToList(blind); 365 tlist->AddToList(fill10); 365 366 tlist->AddToList(hcalc); 366 tlist->AddToList(scalc);367 tlist->AddToList(fill10);368 369 367 if ((!pcam || !ccam) && type==2) 370 368 { … … 379 377 tlist->AddToList(fill09); 380 378 } 381 382 379 if (type==1) 383 380 { … … 588 585 ((MHillasExt*) plist->FindObject("MHillasExt"))->Print(*geom); 589 586 ((MHillasSrc*) plist->FindObject("MHillasSrc"))->Print(*geom); 587 plist->FindObject("MImagePar")->Print(); 590 588 ((MNewImagePar*)plist->FindObject("MNewImagePar"))->Print(*geom); 591 589 592 590 // 593 591 // UpdateDisplay … … 635 633 { 636 634 TCanvas *c = GetCanvas(i); 637 c-> GetPad(1)->cd(1);635 c->cd(1); 638 636 hillas->Draw(); 639 637 } -
trunk/MagicSoft/Mars/msignal/MArrivalTime.cc
r4577 r4828 91 91 fDataErr[i] = t; 92 92 } 93 93 94 void MArrivalTime::Print(Option_t *o) const 95 { 96 *fLog << all << GetDescriptor() << ":" << endl; 97 for (int i=0; i<fData.GetSize(); i++) 98 *fLog << fData[i] << " "; 99 *fLog << endl; 100 } 101 94 102 // -------------------------------------------------------------------------- 95 103 // -
trunk/MagicSoft/Mars/msignal/MArrivalTime.h
r4716 r4828 43 43 Double_t operator[](int i) const { return fData[i]; } 44 44 45 void Print(Option_t *o="") const; 46 45 47 // Do not do such things! It is highly dangerous to use two very similar operators 46 48 // to do completely different things! People won't recognize it... -
trunk/MagicSoft/Mars/star.cc
r4817 r4828 72 72 // Evaluate arguments 73 73 // 74 MArgs arg(argc, argv );74 MArgs arg(argc, argv, kFALSE); 75 75 76 76 if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
Note:
See TracChangeset
for help on using the changeset viewer.