Changeset 2416
- Timestamp:
- 10/20/03 21:32:30 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
r2410 r2416 412 412 } 413 413 414 void MCerPhotEvt::DrawPixelContent(Int_t num , TVirtualPad *pad=NULL) const414 void MCerPhotEvt::DrawPixelContent(Int_t num) const 415 415 { 416 416 *fLog << warn << "MCerPhotEvt::DrawPixelContent - not available." << endl; -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
r2410 r2416 74 74 75 75 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 76 void DrawPixelContent(Int_t num , TVirtualPad *pad=NULL) const;76 void DrawPixelContent(Int_t num) const; 77 77 78 78 ClassDef(MCerPhotEvt, 2) // class for an event containing cerenkov photons -
trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
r2410 r2416 195 195 } 196 196 197 void MPedestalCam::DrawPixelContent(Int_t num , TVirtualPad *pad) const197 void MPedestalCam::DrawPixelContent(Int_t num) const 198 198 { 199 199 *fLog << warn << "MPedestalCam::DrawPixelContent - not available." << endl; -
trunk/MagicSoft/Mars/manalysis/MPedestalCam.h
r2410 r2416 36 36 37 37 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 38 void DrawPixelContent(Int_t num , TVirtualPad *pad=NULL) const;38 void DrawPixelContent(Int_t num) const; 39 39 40 40 ClassDef(MPedestalCam, 1) // Storage Container for all pedestal information of the camera -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r2386 r2416 72 72 #include <fstream> // ofstream, SavePrimitive 73 73 74 #include <TRint.h> // gApplication, TRint::Class() 74 75 #include <TTime.h> // TTime 75 76 #include <TFile.h> // gFile … … 370 371 gSystem->ProcessEvents(); 371 372 #else 372 if (fDisplay) 373 gSystem->ProcessEvents(); 374 else 375 if (fProgress) 376 gClient->ProcessEventsFor(fProgress); 373 // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents 374 if (gApplication->InheritsFrom(TRint::Class())) 375 { 376 if (fDisplay) 377 gSystem->ProcessEvents(); 378 else 379 if (fProgress) 380 gClient->ProcessEventsFor(fProgress); 381 } 377 382 #endif 378 383 … … 469 474 { 470 475 fProgress->SetPosition(maxcnt>0 ? TMath::Min(maxcnt, entries) : entries); 476 // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents 477 if (gApplication->InheritsFrom(TRint::Class())) 478 { 471 479 #if ROOT_VERSION_CODE < ROOT_VERSION(3,02,06) 472 gSystem->ProcessEvents();480 gSystem->ProcessEvents(); 473 481 #else 474 gClient->ProcessEventsFor(fDisplay ? fDisplay->GetBar() : fProgress);482 gClient->ProcessEventsFor(fDisplay ? fDisplay->GetBar() : fProgress); 475 483 #endif 484 } 476 485 } 477 486 -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r2411 r2416 114 114 TObject *MParContainer::Clone(const char *newname) const 115 115 { 116 116 117 MParContainer *named = (MParContainer*)TObject::Clone(); 117 118 if (newname && strlen(newname)) named->SetName(newname); … … 583 584 return ((TEnv&)env).GetValue(prefix, dflt); 584 585 } 585 586 // --------------------------------------------------------------------------587 //588 // DrawTS which is a thread safe version of Draw. Draw589 // are also overwritten to call DrawTS. Please overwrite590 // the TS version of the member function if you want to implement591 // Draw for your class. Classes which overwrites Draw instead592 // should work well, too, except in multithreaded environments like Mona.593 //594 // The static version maybe called dor any TObject. For you class it is595 // called with a pointer to 'this' object.596 //597 void MParContainer::DrawTS(TObject *obj, TVirtualPad *pad, Option_t *option)598 {599 if (!obj)600 {601 gLog << warn << "MParContainer::DrawTS: obj==NULL" << endl;602 return;603 }604 605 if (!pad)606 pad = gPad;607 608 // FIXME: Move MH to mbase609 //if (!pad)610 // pad = MakeDefCanvas(this);611 612 if (!pad)613 {614 if (!gROOT->GetMakeDefCanvas())615 return;616 (gROOT->GetMakeDefCanvas())();617 pad = gPad;618 }619 620 if (!pad->IsEditable())621 return;622 623 obj->SetBit(kMustCleanup);624 625 pad->GetListOfPrimitives()->Add(obj, option);626 pad->Modified(kTRUE);627 }628 629 // --------------------------------------------------------------------------630 //631 // DrawCloneTS which is a thread safe version of DrawClone. DrawClone632 // are also overwritten to call DrawCloneTS. Please overwrite633 // the TS version of the member function if you want to implement634 // DrawClone for your class. Classes which overwrites DrawClone instead635 // should work well, too, except in multithreaded environments like Mona636 //637 // The static version maybe called dor any TObject. For you class it is638 // called with a pointer to 'this' object.639 //640 TObject *MParContainer::DrawCloneTS(const TObject *obj, TVirtualPad *pad, Option_t *option)641 {642 // Draw a clone of this object in the current pad643 if (!obj)644 return 0;645 646 TObject *newobj = obj->Clone();647 if (!newobj)648 return 0;649 650 /*651 gLog << dbg << "MParConatiner::DrawCloneTS - ";652 gLog << (int)newobj->InheritsFrom(MParContainer::Class()) << " ";653 gLog << pad << endl;654 */655 if (newobj->InheritsFrom(MParContainer::Class()))656 ((MParContainer*)newobj)->DrawTS(pad, strlen(option) ? option : obj->GetDrawOption());657 else658 DrawTS(newobj, pad, strlen(option) ? option : obj->GetDrawOption());659 660 return newobj;661 } -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r2411 r2416 129 129 const char *GetEnvValue(const TEnv &env, TString prefix, const char *dflt) const; 130 130 131 static void DrawTS(TObject *obj, TVirtualPad *pad=NULL, Option_t *option="");132 virtual void DrawTS(TVirtualPad *pad=NULL, Option_t *option="")133 {134 DrawTS(this, pad, option);135 }136 void Draw(Option_t *option="") { DrawTS(NULL, option); }137 138 static TObject *DrawCloneTS(const TObject *obj, TVirtualPad *pad=NULL, Option_t *option="");139 virtual TObject *DrawCloneTS(TVirtualPad *pad=NULL, Option_t *option="") const140 {141 return DrawCloneTS(this, pad, option);142 }143 TObject *DrawClone(Option_t *option="") const144 {145 return DrawCloneTS(NULL, option);146 }147 148 131 ClassDef(MParContainer, 0) //The basis for all parameter containers 149 132 }; -
trunk/MagicSoft/Mars/mhist/MFillH.cc
r2414 r2416 324 324 const Ssiz_t length = last-first-1; 325 325 326 //327 // Make a copy before stripping leading and trailing White Spaces.328 //329 326 TString strip = fHName(first+1, length); 330 327 return strip.Strip(TString::kBoth); … … 343 340 return kTRUE; 344 341 342 if (!fH->OverwritesDraw()) 343 return kTRUE; 344 345 345 if (TestBit(kDoNotDisplay)) 346 346 return kTRUE; 347 347 348 const Bool_t dr = fH->OverwritesDraw();349 const Bool_t ts = fH->OverwritesDraw(NULL, "TS");350 if (!dr && !ts)351 return kTRUE;352 353 if (!ts)354 {355 *fLog << warn << "You overwrote " << fH->ClassName() << "::";356 *fLog << "Draw instead of " << fH->ClassName() << "::DrawTS" << endl;357 *fLog << "This is not thread safe and might result in trouble using" << endl;358 *fLog << "multithreaded programs like MONA." << endl;359 *fLog << "" << endl;360 return kTRUE;361 }362 363 348 fCanvas = &fDisplay->AddTab(fH->GetName()); 364 fH->DrawTS(fCanvas); 365 366 return kTRUE; 367 } 368 369 // -------------------------------------------------------------------------- 370 // 371 // 372 Bool_t MFillH::DrawCloneToDisplay() 373 { 374 fH->DrawCloneTS(fCanvas); 375 fCanvas->Modified(); 376 fCanvas->Update(); 349 fH->Draw(); 377 350 378 351 return kTRUE; … … 533 506 // 534 507 if (fDisplay && fDisplay->HasCanvas(fCanvas)) 535 DrawCloneToDisplay(); 508 { 509 fCanvas->cd(); 510 fH->DrawClone("nonew"); 511 fCanvas->Modified(); 512 fCanvas->Update(); 513 } 536 514 537 515 return kTRUE; -
trunk/MagicSoft/Mars/mhist/MFillH.h
r2414 r2416 44 44 45 45 Bool_t DrawToDisplay(); 46 Bool_t DrawCloneToDisplay();47 46 48 47 public: … … 64 63 Int_t PostProcess(); 65 64 66 MH *GetH() { return fH; }67 65 TCanvas *GetCanvas() { return fCanvas; } 68 66 -
trunk/MagicSoft/Mars/mhist/MH.cc
r2413 r2416 700 700 // Also layout the two statistic boxes and a legend. 701 701 // 702 void MH::DrawSame(TH1 &hist1, TH1 &hist2, const TString title , TVirtualPad *pad)702 void MH::DrawSame(TH1 &hist1, TH1 &hist2, const TString title) 703 703 { 704 704 // 705 705 // Draw first histogram 706 706 // 707 if (!pad) 708 pad = gPad; 709 710 MParContainer::DrawTS(&hist1, pad); 711 pad->SetBorderMode(0); 712 pad->Update(); 707 hist1.Draw(); 708 gPad->SetBorderMode(0); 709 gPad->Update(); 713 710 714 711 if (hist1.GetEntries()>0 && hist2.GetEntries()>0) … … 729 726 } 730 727 731 TPaveText *t = (TPaveText*) pad->FindObject("title");728 TPaveText *t = (TPaveText*)gPad->FindObject("title"); 732 729 if (t) 733 730 { … … 741 738 // (see THistPainter::PaintTitle) title 742 739 // 743 pad->Modified(); // indicates a change744 pad->Update(); // recreates the original title740 gPad->Modified(); // indicates a change 741 gPad->Update(); // recreates the original title 745 742 t->Pop(); // bring our title on top 746 743 } … … 750 747 // 751 748 // Where to get the TPaveStats depends on the root version 752 TPaveStats *s1 = (TPaveStats*) pad->FindObject("stats");749 TPaveStats *s1 = (TPaveStats*)gPad->FindObject("stats"); 753 750 if (!s1) 754 751 s1 = (TPaveStats*)hist1.GetListOfFunctions()->FindObject("stats"); … … 766 763 // Draw second histogram 767 764 // 768 MParContainer::DrawTS(&hist2, pad,"sames");769 pad->Update();765 hist2.Draw("sames"); 766 gPad->Update(); 770 767 771 768 // … … 773 770 // 774 771 // Where to get the TPaveStats depends on the root version 775 TPaveStats *s2 = (TPaveStats*) pad->FindObject("stats");772 TPaveStats *s2 = (TPaveStats*)gPad->FindObject("stats"); 776 773 if (!s2) 777 774 s2 = (TPaveStats*)hist2.GetListOfFunctions()->FindObject("stats"); … … 790 787 l.SetBorderSize(s2->GetBorderSize()); 791 788 l.SetBit(kCanDelete); 792 MParContainer::DrawTS(&l, pad);789 l.Draw(); 793 790 } 794 791 } … … 833 830 // to the present pad. The kCanDelete bit is set for the clone. 834 831 // 835 TObject *MH::DrawClone TS(TVirtualPad *pad,Option_t *opt, Int_t w, Int_t h) const832 TObject *MH::DrawClone(Option_t *opt, Int_t w, Int_t h) const 836 833 { 837 834 TString option(opt); 838 835 839 //gLog << dbg << "DrawCloneTS: Arg=" << pad << " " << gPad << endl; 840 841 TVirtualPad *p = GetNewPad(option) || pad ? pad : NULL; 842 //gLog << dbg << "DrawCloneTS: nonew&&gpad=" << p << " " << opt << endl; 843 if (!p) 844 p = MakeDefCanvas(this, w, h); 845 else 846 /*{ 847 gLog << dbg << "--> Clear" << endl;*/ 848 p->Clear(); 849 //} 850 //gLog << dbg << "DrawCloneTS: " << p << endl; 851 852 TObject *o = MParContainer::DrawCloneTS(pad, option); 853 o->SetBit(kCanDelete); 854 return o; 855 } 856 857 /* 858 // -------------------------------------------------------------------------- 859 // 860 // If the opt string contains 'nonew' or gPad is not given a new canvas 861 // with size w/h is created. Otherwise the object is cloned and drawn 862 // to the present pad. The kCanDelete bit is set for the clone. 863 // 864 TObject *MH::DrawClone(Option_t *opt, Int_t w, Int_t h) const 865 { 866 TString option(opt); 867 868 gLog << dbg << "DrawCloneTS: Arg=" << gPad << endl; 869 870 TVirtualPad *p = GetNewPad(option) ? gPad : NULL; 871 gLog << dbg << "DrawCloneTS: nonew&&gpad=" << p << " " << opt << endl; 836 TVirtualPad *p = GetNewPad(option); 872 837 if (!p) 873 838 p = MakeDefCanvas(this, w, h); 874 839 else 875 840 p->Clear(); 876 gLog << dbg << "DrawCloneTS: " << p << endl; 877 878 TObject *o = Clone(option); 841 842 gROOT->SetSelectedPad(NULL); 843 844 TObject *o = MParContainer::DrawClone(option); 879 845 o->SetBit(kCanDelete); 880 846 return o; 881 847 } 882 */883 848 884 849 // -------------------------------------------------------------------------- … … 886 851 // Check whether a class inheriting from MH overwrites the Draw function 887 852 // 888 Bool_t MH::OverwritesDraw(TClass *cls , const char *ext) const853 Bool_t MH::OverwritesDraw(TClass *cls) const 889 854 { 890 855 if (!cls) … … 900 865 // Check whether the class cls overwrites Draw 901 866 // 902 TString name("Draw"); 903 name += ext; 904 if (cls->GetMethodAny(name)) 867 if (cls->GetMethodAny("Draw")) 905 868 return kTRUE; 906 869 … … 912 875 while ((base=(TBaseClass*)NextBase())) 913 876 { 914 if (OverwritesDraw(base->GetClassPointer() , ext))877 if (OverwritesDraw(base->GetClassPointer())) 915 878 return kTRUE; 916 879 } -
trunk/MagicSoft/Mars/mhist/MH.h
r2413 r2416 22 22 MH(const char *name=NULL, const char *title=NULL); 23 23 24 Bool_t OverwritesDraw(TClass *cls=NULL , const char *ext="") const;24 Bool_t OverwritesDraw(TClass *cls=NULL) const; 25 25 26 26 virtual Bool_t SetupFill(const MParList *pList) { return kTRUE; } … … 64 64 65 65 static void DrawSameCopy(const TH1 &hist1, const TH1 &hist2, const TString title); 66 static void DrawSame(TH1 &hist1, TH1 &hist2, const TString title , TVirtualPad *pad=NULL);66 static void DrawSame(TH1 &hist1, TH1 &hist2, const TString title); 67 67 68 68 TObject *Clone(const char *name="") const; 69 69 70 TObject *DrawClone(Option_t *opt, Int_t w, Int_t h) const 71 { 72 return MH::DrawCloneTS(NULL, opt, 625, 440); 73 } 70 TObject *DrawClone(Option_t *opt, Int_t w, Int_t h) const; 74 71 TObject *DrawClone(Option_t *opt="") const 75 72 { 76 return MH::DrawCloneTS(NULL, opt, 625, 440); 77 } 78 TObject *DrawCloneTS(TVirtualPad *pad, Option_t *opt, Int_t w, Int_t h) const; 79 TObject *DrawCloneTS(TVirtualPad *pad=NULL, Option_t *opt="") const 80 { 81 return MH::DrawCloneTS(pad, opt, 625, 440); 73 return MH::DrawClone(opt, 625, 440); 82 74 } 83 75 -
trunk/MagicSoft/Mars/mhist/MHCamEvent.cc
r2415 r2416 137 137 } 138 138 139 // -------------------------------------------------------------------------- 140 // 141 // Print pixel indices which value is higher than mean+sigma*rms 142 // 143 void MHCamEvent::PrintOutliers(Float_t sigma) const 139 void MHCamEvent::PrintOutliers(Float_t s) const 144 140 { 145 141 const Double_t mean = fSum->GetMean(); … … 153 149 continue; 154 150 155 if ((*fSum)[i+1]>mean+s igma*rms)156 *fLog << "Contents of Pixel-Index #" << i << ": " << (*fSum)[i+1] << " > " << s igma<< "*rms" << endl;151 if ((*fSum)[i+1]>mean+s*rms) 152 *fLog << "Contents of Pixel-Index #" << i << ": " << (*fSum)[i+1] << " > " << s << "*rms" << endl; 157 153 // if ((*fSum)[i+1]==0) 158 154 // *fLog << "Contents of Pixel-Index #" << i << ": " << (*fSum)[i+1] << " == 0" << endl; … … 171 167 } 172 168 173 void MHCamEvent::Draw TS(TVirtualPad *p,Option_t *)169 void MHCamEvent::Draw(Option_t *) 174 170 { 175 if (!fSum) 176 { 177 *fLog << warn << "MHCamEvent::Draw - fSum==NULL not initialized." << endl; 178 return; 179 } 180 181 TVirtualPad *pad = p ? p : MakeDefCanvas(this); 171 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 182 172 pad->SetBorderMode(0); 183 173 184 174 pad->Divide(1,2); 185 175 186 p = pad->GetPad(1); 187 p->SetBorderMode(0); 176 pad->cd(1); 177 gPad->SetBorderMode(0); 178 gPad->Divide(1,1); 179 gPad->cd(1); 180 gPad->SetBorderMode(0); 181 fSum->Draw(); 188 182 189 // fSum doesn't derive from MParContainer 190 MParContainer::DrawTS(fSum, p); 191 192 p = pad->GetPad(2); 193 p->SetBorderMode(0); 194 195 // fSum doesn't derive from MParContainer 196 MParContainer::DrawTS(fSum, p, "EPhist"); 197 198 // fSum doesn't derive from MParContainer 199 //MParContainer::DrawTS(fSum, pad); 183 pad->cd(2); 184 gPad->SetBorderMode(0); 185 fSum->Draw("EPhist"); 200 186 } -
trunk/MagicSoft/Mars/mhist/MHCamEvent.h
r2415 r2416 32 32 TH1 *GetHistByName(const TString name=""); 33 33 34 void Draw TS(TVirtualPad *pad=NULL,Option_t *o="");34 void Draw(Option_t *o=""); 35 35 36 void PrintOutliers(Float_t s igma) const;36 void PrintOutliers(Float_t s) const; 37 37 38 38 ClassDef(MHCamEvent, 1) // Histogram to sum camera events -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r2409 r2416 1135 1135 if (fNotify && fNotify->GetSize()>0) 1136 1136 { 1137 TCanvas *c=new TCanvas;1138 fNotify->ForEach(MCamEvent, DrawPixelContent)(idx , c);1137 new TCanvas; 1138 fNotify->ForEach(MCamEvent, DrawPixelContent)(idx); 1139 1139 } 1140 1140 } … … 1148 1148 { 1149 1149 gPad=NULL; 1150 return TH1D::DrawCopy( );1150 return TH1D::DrawCopy(fName+";cpy"); 1151 1151 } -
trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.cc
r2414 r2416 171 171 } 172 172 173 void MHTriggerLvl0::Draw TS(TVirtualPad *p=NULL, Option_t * ="")173 void MHTriggerLvl0::Draw(Option_t *) 174 174 { 175 TVirtualPad *pad = p ? p: MakeDefCanvas(this);175 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 176 176 pad->SetBorderMode(0); 177 177 178 //-----------------------------179 178 pad->Divide(1,2); 180 179 181 p = pad->GetPad(1); 182 p->SetBorderMode(0); 183 p->Divide(1,1); 184 p->cd(1); 185 p->SetBorderMode(0); 186 // fSum does not derive from MParContainer 187 MParContainer::DrawTS(fSum, p); 180 pad->cd(1); 181 gPad->SetBorderMode(0); 182 gPad->Divide(1,1); 183 gPad->cd(1); 184 gPad->SetBorderMode(0); 185 fSum->Draw(); 188 186 189 p = pad->GetPad(2); 190 p->SetBorderMode(0); 191 // fSum does not derive from MParContainer 192 MParContainer::DrawTS(fSum, p, "EPhist"); 193 //----------------------------- 194 195 //MParContainer::DrawTS(fSum, p); 187 pad->cd(2); 188 gPad->SetBorderMode(0); 189 fSum->Draw("EPhist"); 196 190 } -
trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.h
r2414 r2416 34 34 TH1 *GetHistByName(const TString name=""); 35 35 36 //void Draw(Option_t * =""); 37 void DrawTS(TVirtualPad *pad=NULL, Option_t * =""); 36 void Draw(Option_t * =""); 38 37 39 38 void PrintOutlayers(Float_t s) const; -
trunk/MagicSoft/Mars/mimage/MHHillas.cc
r2414 r2416 278 278 gStyle->SetPalette(50, c); 279 279 } 280 /* 280 281 281 // -------------------------------------------------------------------------- 282 282 // … … 296 296 pad->cd(1); 297 297 gPad->SetBorderMode(0); 298 MH::Draw (*fWidth, *fLength, "Width'n'Length");298 MH::DrawSame(*fWidth, *fLength, "Width'n'Length"); 299 299 300 300 pad->cd(2); … … 323 323 pad->Update(); 324 324 } 325 */326 327 // --------------------------------------------------------------------------328 //329 // Creates a new canvas and draws the four histograms into it.330 // Be careful: The histograms belongs to this object and won't get deleted331 // together with the canvas.332 //333 void MHHillas::DrawTS(TVirtualPad *p, Option_t *)334 {335 TVirtualPad *pad = p ? p : MakeDefCanvas(this);336 pad->SetBorderMode(0);337 338 MParContainer::DrawTS(pad);339 340 pad->Divide(2,3);341 342 p = pad->GetPad(1);343 p->SetBorderMode(0);344 MH::DrawSame(*fWidth, *fLength, "Width'n'Length", p);345 346 p = pad->GetPad(2);347 p->SetBorderMode(0);348 MParContainer::DrawTS(fDistC, p);349 350 p = pad->GetPad(3);351 p->SetBorderMode(0);352 p->SetLogx();353 MParContainer::DrawTS(fSize, p);354 355 p = pad->GetPad(4);356 p->SetBorderMode(0);357 p->SetPad(0.51, 0.01, 0.99, 0.65);358 SetColors();359 MParContainer::DrawTS(fCenter, p, "colz");360 361 p = pad->GetPad(5);362 p->SetBorderMode(0);363 MParContainer::DrawTS(fDelta, p);364 365 delete pad->GetPad(6);366 367 pad->Modified();368 pad->Update();369 }370 371 325 372 326 TH1 *MHHillas::GetHistByName(const TString name) -
trunk/MagicSoft/Mars/mimage/MHHillas.h
r2414 r2416 51 51 TH2F *GetHistCenter() { return fCenter; } 52 52 53 //void Draw(Option_t *opt=NULL); 54 void DrawTS(TVirtualPad *pad=NULL, Option_t *opt=NULL); 53 void Draw(Option_t *opt=NULL); 55 54 56 55 //Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; } -
trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc
r2414 r2416 198 198 // together with the canvas. 199 199 // 200 void MHHillasSrc::Draw TS(TVirtualPad *p,Option_t *)201 { 202 TVirtualPad *pad = p ? p: MakeDefCanvas(this);200 void MHHillasSrc::Draw(Option_t *) 201 { 202 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 203 203 pad->SetBorderMode(0); 204 204 205 // 206 // Add this object to the given pad 207 // 208 MParContainer::DrawTS(pad); 205 AppendPad(""); 209 206 210 207 // FIXME: Display Source position 211 208 212 //213 // Fill the pad with histograms214 //215 209 pad->Divide(2, 2); 216 210 217 p = pad->GetPad(1); 218 p->SetBorderMode(0); 219 MParContainer::DrawTS(fAlpha, p); 220 221 p = pad->GetPad(2); 222 p->SetBorderMode(0); 223 MParContainer::DrawTS(fDist, p); 224 225 delete pad->GetPad(3); 226 227 p = pad->GetPad(4); 228 p->SetBorderMode(0); 229 MParContainer::DrawTS(fCosDA, p); 211 pad->cd(1); 212 gPad->SetBorderMode(0); 213 fAlpha->Draw(); 214 215 pad->cd(2); 216 gPad->SetBorderMode(0); 217 fDist->Draw(); 218 219 pad->cd(4); 220 gPad->SetBorderMode(0); 221 //gPad->SetLogy(); 222 fCosDA->Draw(); 230 223 231 224 pad->Modified(); -
trunk/MagicSoft/Mars/mimage/MHHillasSrc.h
r2414 r2416 35 35 TH1F *GetHistCosDeltaAlpha() { return fCosDA; } 36 36 37 //void Draw(Option_t *opt=NULL); 38 void DrawTS(TVirtualPad *pad=NULL, Option_t *opt=NULL); 37 void Draw(Option_t *opt=NULL); 39 38 void Paint(Option_t *opt); 40 39 -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
r2386 r2416 75 75 #include <TObjArray.h> // TObjArray 76 76 #include <TPostScript.h> // TPostScript 77 78 #include <TRint.h> // gApplication, TRint::Class() 77 79 #include <TInterpreter.h> // gInterpreter 78 80 … … 374 376 375 377 // make it visible 376 gClient->ProcessEventsFor(fTab); 378 // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents 379 if (gApplication->InheritsFrom(TRint::Class())) 380 gClient->ProcessEventsFor(fTab); 377 381 } 378 382 … … 470 474 return; 471 475 fStatusBar->SetText(txt, 0); 472 gClient->ProcessEventsFor(fStatusBar); 476 // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents 477 if (gApplication->InheritsFrom(TRint::Class())) 478 gClient->ProcessEventsFor(fStatusBar); 473 479 } 474 480 … … 482 488 return; 483 489 fStatusBar->SetText(txt, 1); 484 gClient->ProcessEventsFor(fStatusBar); 490 // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents 491 if (gApplication->InheritsFrom(TRint::Class())) 492 gClient->ProcessEventsFor(fStatusBar); 485 493 } 486 494 … … 567 575 MapWindow(); 568 576 569 gSystem->ProcessEvents(); 577 // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents 578 if (gApplication->InheritsFrom(TRint::Class())) 579 gSystem->ProcessEvents(); 570 580 } 571 581 … … 732 742 733 743 // display new tab in the main frame 734 gClient->ProcessEventsFor(fTab); 744 // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents 745 if (gApplication->InheritsFrom(TRint::Class())) 746 gClient->ProcessEventsFor(fTab); 735 747 736 748 *fLog << inf << "Adding Raw Tab '" << name << "' (" << f->GetWidth() << "x"; … … 784 796 785 797 // display new tab in the main frame 786 gClient->ProcessEventsFor(fTab); 798 // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents 799 if (gApplication->InheritsFrom(TRint::Class())) 800 gClient->ProcessEventsFor(fTab); 787 801 788 802 *fLog << inf << "Adding Tab '" << name << "' (" << f->GetWidth() << "x"; … … 910 924 911 925 // display new tab in the main frame 912 gClient->ProcessEventsFor(fTab); 926 // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents 927 if (gApplication->InheritsFrom(TRint::Class())) 928 gClient->ProcessEventsFor(fTab); 913 929 914 930 *fLog << inf << "Removed Tab #" << i << " '" << name << "'" << endl; -
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r2414 r2416 215 215 // <index> The pixel with the given index is drawn 216 216 // 217 // Rem: DrawTS is the thread-safe version of Draw. In most cases 218 // you can use Draw instead 219 // 220 void MRawEvtData::DrawTS(TVirtualPad *pad=NULL, Option_t *opt="") 217 void MRawEvtData::Draw(Option_t *opt) 221 218 { 222 219 if (GetNumPixels()==0) 223 220 { 224 221 *fLog << warn << "Sorry, no pixel to draw!" << endl; 225 return;226 }227 if (!pad)228 {229 *fLog << warn << "MRawEvtData::DrawTS - No pad available..." << endl;230 222 return; 231 223 } … … 246 238 if (!pix.Jump(id)) 247 239 { 248 *fLog << warn << "Pixel Idx #" << dec<< id << " doesn't exist!" << endl;240 *fLog << warn << dec << "Pixel Idx #" << id << " doesn't exist!" << endl; 249 241 return; 250 242 } … … 275 267 276 268 graphhi->SetBit(kCanDelete); 277 MParContainer::DrawTS(graphhi, pad,same ? "C*" : "AC*");269 graphhi->Draw(same ? "C*" : "AC*"); 278 270 279 271 TH1F *histhi = graphhi->GetHistogram(); … … 294 286 295 287 graphlo->SetBit(kCanDelete); 296 MParContainer::DrawTS(graphlo, pad,"C*");288 graphlo->Draw("C*"); 297 289 298 290 TH1F *histlo = graphlo->GetHistogram(); … … 308 300 { 309 301 // FIXME: Add Legend 310 *fLog << inf << "Drawing Histogram of Pixel with Idx #"; 311 *fLog << dec << pix.GetPixelId() << endl; 302 *fLog << inf << "Drawing Histogram of Pixel with Idx #" << dec << pix.GetPixelId() << endl; 312 303 313 304 TH1F *histh = new TH1F(name, "FADC Samples", nh, -0.5, nh-.5); … … 318 309 histh->Fill(i, higains[i]); 319 310 histh->SetBit(kCanDelete); 320 MParContainer::DrawTS(histh, pad,same ? "same" : "");311 histh->Draw(same ? "same" : ""); 321 312 322 313 if (nl>0) … … 328 319 histl->Fill(i, logains[i]); 329 320 histl->SetBit(kCanDelete); 330 MParContainer::DrawTS(histl, pad,"same");321 histl->Draw("same"); 331 322 } 332 323 return; … … 543 534 evt.fArraySize = fArraySize; 544 535 } 545 -
trunk/MagicSoft/Mars/mraw/MRawEvtData.h
r2414 r2416 52 52 void Clear(Option_t * = NULL); 53 53 void Print(Option_t * = NULL) const; 54 void DrawTS(TVirtualPad *pad=NULL, Option_t *option=""); 55 void Copy(TObject &named) 56 #if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01) 57 const 58 #endif 59 ; 54 void Draw (Option_t * = NULL); 60 55 61 56 void DeletePixels(Bool_t flag=kFALSE); … … 70 65 71 66 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 72 void DrawPixelContent(Int_t num , TVirtualPad *pad=NULL) const67 void DrawPixelContent(Int_t num) const 73 68 { 74 69 TString s("HIST"); 75 70 s += num; 76 const_cast<MRawEvtData*>(this)->DrawTS(pad, s); 77 //const_cast<MRawEvtData*>(this)->Draw(s); 71 const_cast<MRawEvtData*>(this)->Draw(s); 78 72 } 73 74 void Copy(TObject &named) 75 #if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01) 76 const 77 #endif 78 ; 79 79 80 80 ClassDef(MRawEvtData, 2) //Container to store the raw Event Data
Note:
See TracChangeset
for help on using the changeset viewer.