Changeset 1965 for trunk/MagicSoft
- Timestamp:
- 04/19/03 18:39:05 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 1 added
- 56 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1964 r1965 1 1 -*-*- END OF LINE -*-*- 2 3 * Makefile: 4 - exchanged mbase and mmain 5 6 * Makefile.conf.general: 7 - added MARSVER 8 9 * mars.cc: 10 - use MARSVER 11 12 * macros/readMagic.C: 13 - updated to work with the new MH-stuff 14 15 * macros/status.C: 16 - added 17 18 * manalysis/MBlindPixelCalc.cc, manalysis/MCerPhotCalc.cc, 19 manalysis/MMcPedestalCopy.ccm, manalysis/MMcPedestalNSBAdd.cc, 20 mfileio/MReadMarsFile.cc, mimage/MHillasCalc.cc, 21 mimage/MImgCleanStd.cc: 22 - changed def. title 23 24 * manalysis/MCT1PointingCorrCalc.h: 25 - minor change 26 27 * manalysis/MCerPhotEvt.[h,cc]: 28 - don't use unused pixels for calculation of min/max 29 - added Scale member function 30 31 * manalysis/MCerPhotPix.h: 32 - added Scale inline function 33 34 * mbase/MEvtLoop.[h,cc], mbase/MParContainer.[h,cc], 35 mbase/MParList.[h,cc], mbase/MTaskList.[h,cc], 36 mfileio/MReadMarsFile.cc, mhist/MFillH.[h,cc]: 37 - implemented use of fDisplay 38 39 * mbase/MParContainer.h: 40 - Don't display name and class name if it is the same (GetDescriptor) 41 42 * meventdisp/MGCamDisplay.[h,cc]: 43 - made working with new MH-stuff 44 45 * mfileio/Makefile: 46 - added -I../mmain 47 48 * mgeom/MGeomCam.[h,cc]: 49 - added Clone function 50 51 * mgeom/MGeomCamCT1.cc, mgeom/MGeomCamMagic.cc: 52 - commented out informal output at constructor 53 54 * mgui/MCamDisplay.[h,cc], mhist/MHStarMap.[h,cc], 55 mimage/MHH*.[h,cc]: 56 - changed to be more root oriented 57 58 * mgui/MHexagon.cc: 59 - small changes 60 61 * mgui/Makefile: 62 - added mhist 63 64 * mhist/MH.[h,cc]: 65 - changed to be more root oriented 66 - removed border 67 - added DrawClone 68 - GetNewPad 69 70 * mhist/MH3.cc: 71 - removed some strange debug output 72 73 * mhist/MHCerPhotEvt.[h,cc]: 74 - fixed some bug 75 - made working with fDisplay 76 77 * mhist/Makefile: 78 - added mmain 79 80 * mmain/MProgressBar.cc: 81 - fixed a typo 82 83 * mmain/MStatusDisplay.[h,cc]: 84 - new implementation 85 86 * mmain/MainLinkDef.h, mmain/Makefile: 87 - added MStatusDisplay 88 - added MGMenu 89 90 * mmain/MGMenu.[h,cc]: 91 - added 92 93 2 94 3 95 2003/04/19: Abelardo Moralejo … … 8 100 9 101 * mmontecarlo/MMcEnergyMigration.[h,cc] 10 -Added. Task to fill the energy migration matrix histograms 11 contained in class MHMcEnergyMigration. 102 - Added. Task to fill the energy migration matrix histograms 103 contained in class MHMcEnergyMigration. 104 105 12 106 13 107 2003/04/17: Wolfgang Wittek … … 37 131 - add plot of Id of blind pixel 38 132 39 MHMcCT1CollectionArea.c40 133 41 134 … … 46 139 - MNewImagePar and MNewImageParCalc removed 47 140 141 48 142 49 143 -
trunk/MagicSoft/Mars/Makefile
r1940 r1965 35 35 # ----->>> mars libraries 36 36 # 37 SUBDIRS = m main\38 m base\37 SUBDIRS = mbase \ 38 mmain \ 39 39 mfileio \ 40 40 mfilter \ -
trunk/MagicSoft/Mars/Makefile.conf.general
r1438 r1965 12 12 # 13 13 14 DEFINES = -D__MARS__ -D ROOTVER=\"$(ROOTVER)\" $(ARCHDEF)14 DEFINES = -D__MARS__ -DMARSVER=\"\<cvs\>\" -DROOTVER=\"$(ROOTVER)\" $(ARCHDEF) 15 15 16 16 CXXFLAGS = $(ROOTCFLAGS) $(INCLUDES) $(OPTIM) $(DEBUG) $(DEFINES) -
trunk/MagicSoft/Mars/macros/readMagic.C
r1947 r1965 100 100 cout << "Event #" << read.GetNumEntry() ":" << endl; 101 101 102 display.DrawPhotNum((MCerPhotEvt*)clone.GetClone()); 102 display.FillPhotNum(*(MCerPhotEvt*)clone.GetClone()); 103 gPad->Modified(); 104 gPad->Update(); 103 105 104 106 if (!HandleInput()) … … 108 110 hillas.Draw(); 109 111 110 display.DrawPhotNum((MCerPhotEvt*)plist.FindObject("MCerPhotEvt")); 112 display.FillPhotNum(*(MCerPhotEvt*)plist.FindObject("MCerPhotEvt")); 113 gPad->Modified(); 114 gPad->Update(); 111 115 112 116 if (!HandleInput()) -
trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc
r1574 r1965 71 71 72 72 static const TString gsDefName = "MBlindPixelCalc"; 73 static const TString gsDefTitle = " Task to deal withhot spots (star, broken pixels, etc)";73 static const TString gsDefTitle = "Find hot spots (star, broken pixels, etc)"; 74 74 75 75 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.h
r1952 r1965 27 27 MParameterD *fHourAngle; 28 28 29 Float_t fMm2Deg;29 Float_t fMm2Deg; 30 30 31 31 public: -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
r1715 r1965 64 64 { 65 65 fName = name ? name : "MCerPhotCalc"; 66 fTitle = title ? title : " Task to calculate pixel signal from rawdata";66 fTitle = title ? title : "Calculate pixel signal from FADC data"; 67 67 68 68 AddToBranchList("MRawEvtData.fHiGainPixId"); -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
r1715 r1965 27 27 28 28 #include <math.h> 29 #include <limits.h> 29 30 #include <fstream.h> 30 31 … … 120 121 { 121 122 const MCerPhotPix &pix = (*this)[i]; 123 if (!pix.IsPixelUsed()) 124 continue; 122 125 123 126 if (id == pix.GetPixId() && pix.IsPixelUsed()) … … 139 142 { 140 143 const MCerPhotPix &pix = (*this)[i]; 144 if (!pix.IsPixelUsed()) 145 continue; 141 146 142 147 if (id == pix.GetPixId() && pix.IsPixelCore()) … … 160 165 const UInt_t n = geom->GetNumPixels(); 161 166 162 Float_t minval = (*this)[0].GetNumPhotons(); 163 164 for (UInt_t i=1; i<fNumPixels; i++) 165 { 166 const MCerPhotPix &pix = (*this)[i]; 167 Float_t minval = FLT_MAX; 168 169 for (UInt_t i=1; i<fNumPixels; i++) 170 { 171 const MCerPhotPix &pix = (*this)[i]; 172 if (!pix.IsPixelUsed()) 173 continue; 167 174 168 175 const UInt_t id = pix.GetPixId(); … … 195 202 const UInt_t n = geom->GetNumPixels(); 196 203 197 Float_t maxval = (*this)[0].GetNumPhotons(); 198 199 for (UInt_t i=1; i<fNumPixels; i++) 200 { 201 const MCerPhotPix &pix = (*this)[i]; 204 Float_t maxval = -FLT_MAX; 205 206 for (UInt_t i=1; i<fNumPixels; i++) 207 { 208 const MCerPhotPix &pix = (*this)[i]; 209 if (!pix.IsPixelUsed()) 210 continue; 202 211 203 212 const UInt_t id = pix.GetPixId(); … … 229 238 { 230 239 const MCerPhotPix &pix = (*this)[i]; 240 if (!pix.IsPixelUsed()) 241 continue; 231 242 232 243 Float_t testval = pix.GetNumPhotons()/pix.GetErrorPhot(); … … 247 258 return -5.; 248 259 249 Float_t maxval = (*this)[0].GetNumPhotons()/(*this)[0].GetErrorPhot(); 250 251 for (UInt_t i=1; i<fNumPixels; i++) 252 { 253 const MCerPhotPix &pix = (*this)[i]; 260 Float_t maxval = -FLT_MAX; 261 262 for (UInt_t i=1; i<fNumPixels; i++) 263 { 264 const MCerPhotPix &pix = (*this)[i]; 265 if (!pix.IsPixelUsed()) 266 continue; 254 267 255 268 Float_t testval = pix.GetNumPhotons()/pix.GetErrorPhot(); … … 272 285 return 50.; 273 286 274 Float_t minval = (*this)[0].GetErrorPhot(); 275 276 for (UInt_t i=1; i<fNumPixels; i++) 277 { 278 const MCerPhotPix &pix = (*this)[i]; 287 Float_t minval = FLT_MAX; 288 289 for (UInt_t i=1; i<fNumPixels; i++) 290 { 291 const MCerPhotPix &pix = (*this)[i]; 292 if (!pix.IsPixelUsed()) 293 continue; 279 294 280 295 Float_t testval = pix.GetErrorPhot(); … … 300 315 return 50.; 301 316 302 Float_t maxval = (*this)[0].GetErrorPhot(); 303 304 for (UInt_t i=1; i<fNumPixels; i++) 305 { 306 const MCerPhotPix &pix = (*this)[i]; 317 Float_t maxval = -FLT_MAX; 318 319 for (UInt_t i=1; i<fNumPixels; i++) 320 { 321 const MCerPhotPix &pix = (*this)[i]; 322 if (!pix.IsPixelUsed()) 323 continue; 307 324 308 325 Float_t testval = pix.GetErrorPhot(); … … 368 385 } 369 386 */ 387 388 void MCerPhotEvt::Scale(Double_t f) 389 { 390 fPixels->ForEach(MCerPhotPix, Scale)(f); 391 } -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
r1715 r1965 48 48 MCerPhotPix &operator[](int i) const { return *(MCerPhotPix*)(fPixels->UncheckedAt(i)); } 49 49 50 void Scale(Double_t f); 51 50 52 MCerPhotPix *GetPixById(int id) const; 51 53 -
trunk/MagicSoft/Mars/manalysis/MCerPhotPix.h
r1951 r1965 48 48 void AddNumPhotons(Float_t f) { fPhot += f; } 49 49 50 void Scale(Float_t f) { fPhot/=f; } 51 50 52 void Print(Option_t *opt = NULL) const; 51 53 -
trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc
r1540 r1965 57 57 { 58 58 fName = name ? name : "MMcPedestalCopy"; 59 fTitle = title ? title : " Task to copy monte carlopedestals into MPedestal Container";59 fTitle = title ? title : "Copy MC pedestals into MPedestal Container"; 60 60 61 61 // -
trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc
r1540 r1965 79 79 { 80 80 fName = name ? name : "MMcPedestalNSBAdd"; 81 fTitle = title ? title : " Task to copy monte carlo pedestals into MPedestal Container";81 fTitle = title ? title : "Add diffuse NSB to the pedestal signal"; 82 82 83 83 // -
trunk/MagicSoft/Mars/mars.cc
r1330 r1965 47 47 // 12345678901234567890123456789012345678901234567890 48 48 gLog << "==================================================" << endl; 49 gLog << " MARS V 0.8" << endl;49 gLog << " MARS V" << MARSVER << " " << endl; 50 50 gLog << " Magic Analysis and Reconstruction Software " << endl; 51 51 gLog << " Compiled on <" << __DATE__ << ">" << endl; -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r1902 r1965 46 46 // Afterwards the PostProcess functions are executed. // 47 47 // // 48 // // 49 // Maybe we can add a TProgressMeter sometimes later to be able to show // 50 // the progress graphically... // 51 // // 48 // If you want to display the progress in a gui you can use SetProgressBar // 49 // and a TGProgressBar or a MProgressBar. If you set a MStatusDisplay // 50 // using SetDisplay, the Progress bar from this display is used. // 52 51 // // 53 52 // You can create a macro from a completely setup eventloop by: // … … 74 73 #include <iostream.h> 75 74 75 #include <TTime.h> // TTime 76 76 #include <TFile.h> // gFile 77 77 #include <TSystem.h> // gSystem … … 87 87 #include "MRead.h" // for setting progress bar 88 88 #include "MProgressBar.h" // MProgressBar::GetBar 89 #include "MStatusDisplay.h" // MStatusDisplay::GetBar 89 90 #endif 90 91 … … 101 102 // -------------------------------------------------------------------------- 102 103 // 103 // default constructor - emty104 // default constructor 104 105 // 105 106 MEvtLoop::MEvtLoop(const char *name) : fParList(NULL), fProgress(NULL) … … 112 113 // -------------------------------------------------------------------------- 113 114 // 114 // de fault destructor - emty115 // destructor 115 116 // 116 117 MEvtLoop::~MEvtLoop() … … 171 172 if (fLog != &gLog) 172 173 fParList->SetLogStream(fLog); 174 175 #ifdef __MARS__ 176 // 177 // Check whether display is still existing 178 // 179 if (fDisplay && !gROOT->GetListOfSpecials()->FindObject(fDisplay)) 180 fDisplay = NULL; 181 if (fDisplay) 182 { 183 // Lock display to prevent user from deleting it 184 fDisplay->Lock(); 185 // Get pointer to update Progress bar 186 fProgress = fDisplay->GetBar(); 187 // Don't display context menus 188 fDisplay->SetNoContextMenu(); 189 // Set window and icon name 190 fDisplay->SetWindowName(TString("Status Display: ")+fName); 191 fDisplay->SetIconName(fName); 192 // Set status lines 193 fDisplay->SetStatusLine1("PreProcessing..."); 194 fDisplay->SetStatusLine2(""); 195 // Start automatic update 196 fDisplay->StartUpdate(); 197 // Cascade display through childs 198 fParList->SetDisplay(fDisplay); 199 } 200 #endif 173 201 174 202 // … … 188 216 } 189 217 218 Bool_t MEvtLoop::ProcessGuiEvents(Int_t num) 219 { 220 if (!fProgress) 221 return kTRUE; 222 223 // 224 // Check status of display 225 // 226 Bool_t rc = kTRUE; 227 228 if (fDisplay) 229 switch (fDisplay->CheckStatus()) 230 { 231 case MStatusDisplay::kLoopNone: 232 break; 233 case MStatusDisplay::kLoopStop: 234 rc = kFALSE; 235 fDisplay->ClearStatus(); 236 break; 237 case MStatusDisplay::kFileExit: 238 fParList->SetDisplay(NULL); 239 delete fDisplay; 240 SetDisplay(NULL); 241 fProgress = NULL; 242 gSystem->ProcessEvents(); 243 return kTRUE; 244 default: 245 fDisplay->ClearStatus(); 246 *fLog << warn << "Display shows unknown status... cleared." << endl; 247 break; 248 } 249 250 // 251 // Check System time (don't loose too much time by updates) 252 // 253 static TTime t0 = gSystem->Now(); 254 255 const TTime t1 = gSystem->Now(); 256 if (t1-t0 < (TTime)20) 257 return rc; 258 259 t0 = t1; 260 261 // 262 // Set new progress bar position 263 // 264 fProgress->SetPosition(num); 265 266 // 267 // Handle GUI events (display changes) 268 // 269 #if ROOT_VERSION_CODE < ROOT_VERSION(3,02,06) 270 gSystem->ProcessEvents(); 271 #else 272 if (fDisplay) 273 gSystem->ProcessEvents(); 274 else 275 gClient->ProcessEventsFor(fProgress); 276 #endif 277 278 return rc; 279 } 280 190 281 // -------------------------------------------------------------------------- 191 282 // … … 193 284 // for developers or use in special jobs only! 194 285 // 195 Bool_t MEvtLoop::Process(Int_t maxcnt) const286 Bool_t MEvtLoop::Process(Int_t maxcnt) 196 287 { 197 288 // … … 208 299 *fLog << " events)..." << flush; 209 300 301 Int_t entries = INT_MAX; 302 210 303 if (fProgress) 211 304 { 212 305 fProgress->Reset(); 213 214 Int_t entries = INT_MAX;215 216 306 #ifdef __MARS__ 217 307 // limits.h … … 228 318 } 229 319 320 if (fDisplay) 321 { 322 fDisplay->SetStatusLine1("Processing..."); 323 fDisplay->SetStatusLine2(""); 324 } 325 230 326 Int_t dummy = maxcnt<0 ? 0 : maxcnt; 231 327 … … 246 342 if (maxcnt<0) 247 343 // process first and increment if sucessfull 248 if (fProgress) 249 while ((rc=fTaskList->Process())==kTRUE) 250 { 251 fProgress->SetPosition(++dummy); 252 #if ROOT_VERSION_CODE < ROOT_VERSION(3,02,06) 253 gSystem->ProcessEvents(); 254 #else 255 gClient->ProcessEventsFor(fProgress); 256 #endif 257 numcnts++; 258 } 259 else 260 while ((rc=fTaskList->Process())==kTRUE) numcnts++; 344 while ((rc=fTaskList->Process())==kTRUE) 345 { 346 numcnts++; 347 if (!ProcessGuiEvents(++dummy)) 348 break; 349 } 261 350 else 262 351 // check for number and break if unsuccessfull 263 if (fProgress) 264 while (dummy-- && (rc=fTaskList->Process())==kTRUE) 265 { 266 fProgress->SetPosition(maxcnt - dummy); 352 while (dummy-- && (rc=fTaskList->Process())==kTRUE) 353 { 354 numcnts++; 355 if (!ProcessGuiEvents(maxcnt - dummy)) 356 break; 357 } 358 359 // 360 // stop stop-watch, print results 361 // 362 clock.Stop(); 363 364 if (fProgress) 365 { 366 fProgress->SetPosition(maxcnt>0 ? TMath::Min(maxcnt, entries) : entries); 267 367 #if ROOT_VERSION_CODE < ROOT_VERSION(3,02,06) 268 368 gSystem->ProcessEvents(); 269 369 #else 270 gClient->ProcessEventsFor(fProgress);370 gClient->ProcessEventsFor(fDisplay ? fDisplay : fProgress); 271 371 #endif 272 numcnts++; 273 } 274 else 275 while (dummy-- && (rc=fTaskList->Process())==kTRUE) numcnts++; 276 277 // 278 // stop stop-watch, print results 279 // 280 clock.Stop(); 372 } 281 373 282 374 *fLog << all << "Ready!" << endl << endl; … … 306 398 // execute the post process of all tasks 307 399 // 400 if (fDisplay) 401 { 402 // Set status lines 403 fDisplay->SetStatusLine1("PostProcessing..."); 404 fDisplay->SetStatusLine2(""); 405 } 308 406 return fTaskList->PostProcess(); 309 407 } … … 329 427 if (!PostProcess()) 330 428 return kFALSE; 429 430 if (!fDisplay) 431 return rc; 432 433 // Set status lines 434 fDisplay->SetStatusLine1(fName); 435 fDisplay->SetStatusLine2(rc ? "Done." : "ERROR"); 436 // Stop automatic update 437 fDisplay->StopUpdate(); 438 // Reallow context menus 439 fDisplay->SetNoContextMenu(kFALSE); 440 // Reallow user to exit window by File menu 441 fDisplay->UnLock(); 331 442 332 443 // -
trunk/MagicSoft/Mars/mbase/MEvtLoop.h
r1880 r1965 27 27 MTaskList *fTaskList; //! 28 28 29 TGProgressBar *fProgress; //!29 TGProgressBar *fProgress; //! 30 30 31 31 enum { kIsOwner = BIT(14) }; … … 35 35 36 36 void StreamPrimitive(ofstream &out) const; 37 38 Bool_t ProcessGuiEvents(Int_t num); 37 39 38 40 public: … … 44 46 MTaskList *GetTaskList() const { return fTaskList; } 45 47 48 MStatusDisplay *GetDisplay() { return fDisplay; } 49 46 50 void SetOwner(Bool_t enable=kTRUE); 47 51 … … 52 56 53 57 Bool_t PreProcess(const char *tlist="MTaskList"); 54 Bool_t Process(Int_t maxcnt) const;58 Bool_t Process(Int_t maxcnt); 55 59 Bool_t PostProcess() const; 56 60 -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r1902 r1965 37 37 #include "MParContainer.h" 38 38 39 #include <ctype.h> // isdigit40 #include <fstream.h> // ofstream, AsciiWrite41 42 #include <TEnv.h> // Env::Lookup43 #include <TClass.h> // IsA44 #include <TObjArray.h> // TObjArray45 #include <TBaseClass.h> // GetClassPointer46 #include <TMethodCall.h> // TMethodCall, AsciiWrite47 #include <TDataMember.h> // TDataMember, AsciiWrite48 #include <TVirtualPad.h> // gPad39 #include <ctype.h> // isdigit 40 #include <fstream.h> // ofstream, AsciiWrite 41 42 #include <TEnv.h> // Env::Lookup 43 #include <TClass.h> // IsA 44 #include <TObjArray.h> // TObjArray 45 #include <TBaseClass.h> // GetClassPointer 46 #include <TMethodCall.h> // TMethodCall, AsciiWrite 47 #include <TDataMember.h> // TDataMember, AsciiWrite 48 #include <TVirtualPad.h> // gPad 49 49 50 50 #include "MLog.h" … … 52 52 53 53 #ifndef __COSY__ 54 #include "MEvtLoop.h" // gListOfPrimitives54 #include "MEvtLoop.h" // gListOfPrimitives 55 55 #else 56 56 TList *gListOfPrimitives; // forard declaration in MParContainer.h … … 71 71 72 72 fReadyToSave = named.fReadyToSave; 73 74 fDisplay = named.fDisplay; 73 75 } 74 76 -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r1902 r1965 26 26 class TDataMember; 27 27 class TMethodCall; 28 class MStatusDisplay; 28 29 29 30 class MParContainer : public TObject … … 34 35 35 36 MLog *fLog; // The general log facility for this object, initialized with the global object 37 38 MStatusDisplay *fDisplay; 36 39 37 40 private: … … 49 52 }; 50 53 51 MParContainer(const char *name="", const char *title="") : fName(name), fTitle(title), fLog(&gLog), f ReadyToSave(kFALSE) { }52 MParContainer(const TString &name, const TString &title) : fName(name), fTitle(title), fLog(&gLog), f ReadyToSave(kFALSE) { }54 MParContainer(const char *name="", const char *title="") : fName(name), fTitle(title), fLog(&gLog), fDisplay(NULL), fReadyToSave(kFALSE) { } 55 MParContainer(const TString &name, const TString &title) : fName(name), fTitle(title), fLog(&gLog), fDisplay(NULL), fReadyToSave(kFALSE) { } 53 56 MParContainer(const MParContainer &named); 54 57 MParContainer& operator=(const MParContainer& rhs); … … 64 67 virtual void FillBuffer(char *&buffer); 65 68 66 virtual const char *GetDescriptor() const { return Form("%s [%s]", fName.Data(), ClassName()); }69 virtual const char *GetDescriptor() const { return fName==ClassName() ? ClassName() : Form("%s [%s]", fName.Data(), ClassName()); } 67 70 virtual const TString GetUniqueName() const; 68 71 virtual const char *GetName() const { return fName.Data(); } … … 87 90 virtual void EnableGraphicalOutput(Bool_t flag=kTRUE) { flag ? SetBit(kEnableGraphicalOutput) : ResetBit(kEnableGraphicalOutput);} 88 91 virtual Bool_t IsGraphicalOutputEnabled() const { return TestBit(kEnableGraphicalOutput); } 92 93 virtual void SetDisplay(MStatusDisplay *d) { fDisplay = d; } 89 94 90 95 TMethodCall *GetterMethod(const char *name) const; -
trunk/MagicSoft/Mars/mbase/MParList.cc
r1902 r1965 138 138 } 139 139 140 void MParList::SetDisplay(MStatusDisplay *d) 141 { 142 fContainer->ForEach(MParContainer, SetDisplay)(d); 143 MParContainer::SetDisplay(d); 144 } 145 140 146 // -------------------------------------------------------------------------- 141 147 // … … 149 155 // check if the object (you want to add) exists 150 156 // 151 152 157 if (!cont) 153 158 return kFALSE; -
trunk/MagicSoft/Mars/mbase/MParList.h
r1880 r1965 50 50 51 51 void SetLogStream(MLog *log); 52 void SetDisplay(MStatusDisplay *d); 52 53 53 54 TObject *FindObject(const char *name) const; -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r1935 r1965 57 57 #include "MTaskList.h" 58 58 59 #include <fstream.h> // ofstream, SavePrimitive59 #include <fstream.h> // ofstream, SavePrimitive 60 60 61 61 #include <TClass.h> … … 70 70 #include "MInputStreamID.h" 71 71 72 #include "MStatusDisplay.h" 73 72 74 ClassImp(MTaskList); 73 75 … … 133 135 fTasks->ForEach(MTask, SetLogStream)(log); 134 136 MParContainer::SetLogStream(log); 137 } 138 139 void MTaskList::SetDisplay(MStatusDisplay *d) 140 { 141 fTasks->ForEach(MTask, SetDisplay)(d); 142 MParContainer::SetDisplay(d); 135 143 } 136 144 … … 350 358 // 351 359 Bool_t MTaskList::PreProcess(MParList *pList) 352 { 360 { 353 361 *fLog << all << "Preprocessing... " << flush; 354 362 … … 370 378 { 371 379 *fLog << all << task->GetName() << "... " << flush; 380 if (fDisplay) 381 fDisplay->SetStatusLine2(*task); 372 382 373 383 // … … 539 549 { 540 550 *fLog << all << task->GetName() << "... " << flush; 551 if (fDisplay) 552 fDisplay->SetStatusLine2(*task); 541 553 542 554 if (!task->CallPostProcess()) -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r1935 r1965 44 44 45 45 void SetLogStream(MLog *log); 46 void SetDisplay(MStatusDisplay *d); 46 47 47 48 Bool_t AddToListBefore(MTask *task, const MTask *where, const char *tType="All"); -
trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.cc
r1668 r1965 162 162 AddSetupElements(); 163 163 164 TCanvas *canv2 = AddTab("Errors");165 TCanvas *canv3 = AddTab("Phot/Err");166 TCanvas *canv4 = AddTab("Levels");167 TCanvas *canv5 = AddTab("Pedestals");164 fCanvas2 = AddTab("Errors"); 165 fCanvas3 = AddTab("Phot/Err"); 166 fCanvas4 = AddTab("Levels"); 167 fCanvas5 = AddTab("Pedestals"); 168 168 169 169 // … … 184 184 fCanvas->cd(); 185 185 fDisplay->Draw(); 186 canv2->cd();186 fCanvas2->cd(); 187 187 fDisplay2->Draw(); 188 canv3->cd();188 fCanvas3->cd(); 189 189 fDisplay3->Draw(); 190 canv4->cd();190 fCanvas4->cd(); 191 191 fDisplay4->Draw(); 192 canv5->cd();192 fCanvas5->cd(); 193 193 fDisplay5->Draw(); 194 194 … … 239 239 // Display the requested event. This does a Canvas update, too. 240 240 // 241 MCerPhotEvt 241 MCerPhotEvt *evt = NULL; 242 242 if (fDisplayRaw) 243 243 { … … 259 259 const MPedestalCam *ped = (MPedestalCam*)plist->FindObject("MPedestalCam"); 260 260 261 fDisplay->DrawPhotNum(evt); 262 fDisplay2->DrawErrorPhot(evt); 263 fDisplay3->DrawRatio(evt); 264 fDisplay4->DrawLevels(evt, *clean); 265 fDisplay5->DrawPedestals(ped); 261 fDisplay->FillPhotNum(*evt); 262 fCanvas->Modified(); 263 fCanvas->Update(); 264 fDisplay2->FillErrorPhot(*evt); 265 fCanvas2->Modified(); 266 fCanvas2->Update(); 267 fDisplay3->FillRatio(*evt); 268 fCanvas3->Modified(); 269 fCanvas3->Update(); 270 fDisplay4->FillLevels(*evt, *clean); 271 fCanvas4->Modified(); 272 fCanvas4->Update(); 273 fDisplay5->FillPedestals(*ped); 274 fCanvas5->Modified(); 275 fCanvas5->Update(); 266 276 } 267 277 -
trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.h
r1668 r1965 25 25 MCamDisplay *fDisplay5; 26 26 27 TCanvas *fCanvas2; 28 TCanvas *fCanvas3; 29 TCanvas *fCanvas4; 30 TCanvas *fCanvas5; 31 27 32 void AddSetupElements(); 28 33 void UpdateDisplay(); -
trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc
r1836 r1965 43 43 44 44 #include "MRawRunHeader.h" 45 #include "MStatusDisplay.h" 45 46 46 47 #include "MMcRunHeader.hxx" … … 55 56 { 56 57 fName = "MRead"; 57 fTitle = " Task to loop over all events in a tree of aMars file.";58 fTitle = "Read tree and run headers from Mars file."; 58 59 } 59 60 … … 68 69 { 69 70 fName = name ? name : "MRead"; 70 fTitle = title ? title : " Task to loop over all events in a tree of aMars file.";71 fTitle = title ? title : "Read tree and run headers from Mars file."; 71 72 72 73 // … … 144 145 *fLog << " '" << GetFileName() << "' (before event #"; 145 146 *fLog << GetNumEntry()-1 << ")" << endl; 147 148 if (fDisplay) 149 { 150 TString txt = GetFileName(); 151 txt += " @ "; 152 txt += GetNumEntry()-1; 153 fDisplay->SetStatusLine2(txt); 154 } 146 155 147 156 if (rawheader) -
trunk/MagicSoft/Mars/mfileio/Makefile
r1888 r1965 20 20 # @endcode 21 21 22 INCLUDES = -I. -I../mbase -I../mraw -I../mmc -I../mdata -I../manalysis -I../mgeom -I../mhist 22 INCLUDES = -I. -I../mbase -I../mraw -I../mmc -I../mdata -I../manalysis \ 23 -I../mgeom -I../mhist -I../mmain 23 24 24 25 # @code … … 35 36 MReadTree.cc \ 36 37 MReadMarsFile.cc \ 38 MRunHeader.cc \ 37 39 MWriteFile.cc \ 38 40 MWriteAsciiFile.cc \ -
trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
r1747 r1965 33 33 // 34 34 /////////////////////////////////////////////////////////////////////// 35 #include "MGeomCam.h" 35 36 36 #include "MGeomCam.h"37 #include <TClass.h> 37 38 38 39 #include "MLog.h" … … 138 139 } 139 140 141 TObject *MGeomCam::Clone(const char *newname) const 142 { 143 return (TObject*)IsA()->New(); 144 } -
trunk/MagicSoft/Mars/mgeom/MGeomCam.h
r1747 r1965 28 28 public: 29 29 MGeomCam(UInt_t npix, Float_t dist, const char *name=NULL, const char *title=NULL); 30 virtual ~MGeomCam(); 30 31 31 virtual ~MGeomCam();32 virtual TObject *Clone(const char *newname=NULL) const; 32 33 33 34 Float_t GetCameraDist() const { return fCamDist; } -
trunk/MagicSoft/Mars/mgeom/MGeomCamCT1.cc
r1600 r1965 214 214 // fill the geometry class with the coordinates of the CT1 camera 215 215 // 216 *fLog << inf << " Create CT1 geometry " << endl;216 //*fLog << inf << " Create CT1 geometry " << endl; 217 217 218 218 // -
trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc
r1458 r1965 66 66 // fill the geometry class with the coordinates of the MAGIC camera 67 67 // 68 *fLog << inf << " Creating Magic geometry " << endl ;68 //*fLog << inf << " Creating Magic geometry " << endl ; 69 69 70 70 // -
trunk/MagicSoft/Mars/mgui/MCamDisplay.cc
r1906 r1965 38 38 39 39 #include <TBox.h> 40 #include <TText.h>41 40 #include <TArrow.h> 41 #include <TLatex.h> 42 42 #include <TStyle.h> 43 43 #include <TCanvas.h> 44 //#include <TButton.h>45 44 #include <TClonesArray.h> 46 45 46 #include "MH.h" 47 47 #include "MHexagon.h" 48 48 … … 63 63 // ------------------------------------------------------------------------ 64 64 // 65 // default constructor 65 // Default Constructor. To be used by the root system ONLY. 66 // 67 MCamDisplay::MCamDisplay() 68 : fGeomCam(NULL), fAutoScale(kTRUE), fW(0), fH(0) 69 { 70 fNumPixels = 0; 71 fRange = 0; 72 73 fPixels = NULL; 74 fLegend = NULL; 75 fLegText = NULL; 76 fArrowX = NULL; 77 fArrowY = NULL; 78 fLegRadius = NULL; 79 fLegDegree = NULL; 80 } 81 82 // ------------------------------------------------------------------------ 83 // 84 // Constructor. Makes a clone of MGeomCam. 66 85 // 67 86 MCamDisplay::MCamDisplay(MGeomCam *geom) 68 : f AutoScale(kTRUE), fW(0), fH(0), fDrawingPad(NULL), fIsAllocated(kFALSE)69 { 70 fGeomCam = (MGeomCam*)geom ; // FIXME: Clone doesn't work! (MGeomCam*)geom->Clone();87 : fGeomCam(NULL), fAutoScale(kTRUE), fW(0), fH(0) 88 { 89 fGeomCam = (MGeomCam*)geom->Clone(); 71 90 72 91 // 73 92 // create the hexagons of the display 74 93 // 75 fNumPixels = geom->GetNumPixels(); 76 fRange = geom->GetMaxRadius(); 77 78 // 79 // Construct all hexagons. Use new-operator with placement 80 // 94 fNumPixels = fGeomCam->GetNumPixels(); 95 fRange = fGeomCam->GetMaxRadius(); 81 96 82 97 // root 3.02 … … 85 100 // not get an automatic context menu when clicked with the right mouse button. 86 101 102 // 103 // Construct all hexagons. Use new-operator with placement 104 // 87 105 fPixels = new TClonesArray("MHexagon", fNumPixels); 88 106 for (UInt_t i=0; i<fNumPixels; i++) 89 new ((*fPixels)[i]) MHexagon((*geom)[i]); 90 91 // 92 // set the color palette for the TBox elements 93 // 107 { 108 MHexagon &pix = *new ((*fPixels)[i]) MHexagon((*fGeomCam)[i]); 109 #if ROOT_VERSION_CODE > ROOT_VERSION(3,01,06) 110 pix.SetBit(/*kNoContextMenu|*/kCannotPick); 111 #endif 112 pix.SetFillColor(16); 113 } 114 115 // 116 // set up the Legend 117 // 118 const Float_t H = 0.9*fRange; 119 const Float_t h = 2./kItemsLegend; 120 121 const Float_t w = fRange/sqrt(fNumPixels); 122 123 fLegend = new TClonesArray("TBox", kItemsLegend); 124 fLegText = new TClonesArray("TText", kItemsLegend); 125 126 for (Int_t i = 0; i<kItemsLegend; i++) 127 { 128 TBox &newbox = *new ((*fLegend)[i]) TBox; 129 TText &newtxt = *new ((*fLegText)[i]) TText; 130 131 newbox.SetX1(fRange); 132 newbox.SetX2(fRange+w); 133 newbox.SetY1(H*( i *h - 1.)); 134 newbox.SetY2(H*((i+1)*h - 1.)); 135 newbox.SetFillColor(16); 136 #if ROOT_VERSION_CODE > ROOT_VERSION(3,01,06) 137 newbox.SetBit(/*kNoContextMenu|*/kCannotPick); 138 #endif 139 140 newtxt.SetTextSize(0.025); 141 newtxt.SetTextAlign(12); 142 newtxt.SetX(fRange+1.5*w); 143 newtxt.SetY(H*((i+0.5)*h - 1.)); 144 #if ROOT_VERSION_CODE > ROOT_VERSION(3,01,06) 145 newtxt.SetBit(/*kNoContextMenu|*/kCannotPick); 146 #endif 147 } 148 149 fArrowX = new TArrow(-fRange*.9, -fRange*.9, -fRange*.6, -fRange*.9, 0.025); 150 fArrowY = new TArrow(-fRange*.9, -fRange*.9, -fRange*.9, -fRange*.6, 0.025); 151 152 TString text; 153 text += (int)(fRange*.3); 154 text += "mm"; 155 156 fLegRadius = new TText(-fRange*.85, -fRange*.85, text); 157 text = ""; 158 text += (float)((int)(fRange*.3*fGeomCam->GetConvMm2Deg()*10))/10; 159 text += "\\circ"; 160 text = text.Strip(TString::kLeading); 161 fLegDegree = new TLatex(-fRange*.85, -fRange*.75, text); 162 fLegRadius->SetTextSize(0.04); 163 fLegDegree->SetTextSize(0.04); 164 94 165 #if ROOT_VERSION_CODE < ROOT_VERSION(3,01,06) 95 166 SetPalette(1, 0); … … 98 169 #endif 99 170 100 //101 // set up the Legend102 //103 fLegend = new TClonesArray("TBox", kItemsLegend);104 fLegText = new TClonesArray("TText", kItemsLegend);105 106 for (Int_t i = 0; i<kItemsLegend; i++)107 {108 TBox *newbox = new ((*fLegend)[i]) TBox;109 TText *newtxt = new ((*fLegText)[i]) TText;110 111 newbox->SetFillColor(fColors[i]);112 113 newtxt->SetTextSize(0.025);114 newtxt->SetTextAlign(12);115 }116 117 fArrowX = new TArrow(-fRange*.9, -fRange*.9, -fRange*.6, -fRange*.9, 0.025);118 fArrowY = new TArrow(-fRange*.9, -fRange*.9, -fRange*.9, -fRange*.6, 0.025);119 120 TString text;121 text += (int)(fRange*.3);122 text += "mm";123 124 fLegRadius = new TText(-fRange*.85, -fRange*.85, text);125 text = "";126 text += (float)((int)(fRange*.3*geom->GetConvMm2Deg()*10))/10;127 text += "°";128 text = text.Strip(TString::kLeading);129 fLegDegree = new TText(-fRange*.85, -fRange*.75, text);130 fLegRadius->SetTextSize(0.04);131 fLegDegree->SetTextSize(0.04);132 171 } 133 172 … … 152 191 delete fLegDegree; 153 192 154 // delete fGeomCam; 155 156 // Not allocated by MCamDisplay or already deleted by the user 157 if (!fIsAllocated || !gROOT->GetListOfCanvases()->FindObject(fDrawingPad)) 158 return; 159 160 // If it is not already removed make sure that nothing of this object 161 // maybe be deleted automatically by the canvas destructor 162 if (!fDrawingPad->GetListOfPrimitives()->FindObject(this)) 163 return; 164 165 fDrawingPad->RecursiveRemove(this); 166 delete fDrawingPad; 193 delete fGeomCam; 167 194 } 168 195 … … 237 264 // ------------------------------------------------------------------------ 238 265 // 266 // Call this function to draw the camera layout into your canvas. 267 // Setup a drawing canvas. Add this object and all child objects 268 // (hexagons, etc) to the current pad. If no pad exists a new one is 269 // created. 270 // 271 void MCamDisplay::Draw(Option_t *option) 272 { 273 // root 3.02: 274 // gPad->SetFixedAspectRatio() 275 276 TVirtualPad *pad = gPad ? gPad : MH::MakeDefCanvas("CamDisplay", "Mars Camera Display", 750, 600); 277 pad->SetBorderMode(0); 278 pad->SetFillColor(16); 279 280 // 281 // All this is necessary to get the background in the correct color 282 // 283 pad->Divide(1,1); 284 pad->cd(1); 285 286 gPad->SetBorderMode(0); 287 gPad->SetFillColor(16); 288 289 // 290 // set the color palette for the TBox elements 291 // 292 AppendPad(""); 293 294 // 295 // Necessary to visualize the background color (FIXME?) 296 // 297 gPad->Modified(); 298 gPad->Update(); 299 } 300 301 302 void MCamDisplay::SetRange() 303 { 304 // 305 // Maintain aspect ratio 306 // 307 const float ratio = 1.15; 308 309 const float w = gPad->GetWw(); 310 const float h = gPad->GetWh()*ratio; 311 312 if (h<w) 313 gPad->SetPad((1.-h/w)/2, 0, (h/w+1)/2, 0.9999999); 314 else 315 gPad->SetPad(0, (1.-w/h)/2, 1, (w/h+1)/2); 316 317 gPad->Range(-fRange, -fRange, (2*ratio-1)*fRange, fRange); 318 } 319 320 // ------------------------------------------------------------------------ 321 // 239 322 // This is called at any time the canvas should get repainted. 240 // Here we maintain an aspect ratio of 5/4=1.15. This makes sure,323 // Here we maintain an aspect ratio of 1.15. This makes sure, 241 324 // that the camera image doesn't get distorted by resizing the canvas. 242 325 // 243 326 void MCamDisplay::Paint(Option_t *opt) 244 327 { 245 const UInt_t w = (UInt_t)(gPad->GetWw()*gPad->GetAbsWNDC()); 246 const UInt_t h = (UInt_t)(gPad->GetWh()*gPad->GetAbsHNDC()); 247 248 // 249 // Check for a change in width or height, and make sure, that the 250 // first call also sets the range 251 // 252 if (w*fH == h*fW && fW && fH) 328 if (!fPixels) 253 329 return; 254 330 255 331 // 256 // Calculate aspect ratio (5/4=1.25 recommended) 257 // 258 const Double_t ratio = (Double_t)w/h; 259 260 Float_t x; 261 Float_t y; 262 263 if (ratio>1.25) 264 { 265 x = (ratio*2-1)*fRange; 266 y = fRange; 267 } 268 else 269 { 270 x = fRange*1.5; 271 y = fRange*1.25/ratio; 272 } 273 274 fH = h; 275 fW = w; 276 277 // 278 // Set new range 279 // 280 gPad->Range(-fRange, -y, x, y); 281 282 // 283 // Make sure, that the correct aspect is always displayed also 284 // if - by chance - there is not update for the pad after the 285 // Paint function was called. 286 // 287 gPad->Update(); 332 // Maintain aspect ratio 333 // 334 SetRange(); 335 336 // 337 // Maintain colors 338 // 339 SetPalette(); 340 341 // 342 // Paint primitives 343 // 344 for (UInt_t i=0; i<fNumPixels; i++) 345 (*this)[i].Paint(); 346 347 for (Int_t i=0; i<kItemsLegend; i++) 348 { 349 GetBox(i)->Paint(); 350 GetText(i)->Paint(); 351 } 352 353 fArrowX->Paint(">"); 354 fArrowY->Paint(">"); 355 356 fLegRadius->Paint(); 357 fLegDegree->Paint(); 288 358 } 289 359 … … 321 391 gStyle->SetPalette(ncolors, colors); 322 392 323 if (fDrawingPad) 393 // 394 // Change the colors of the pixels 395 // 396 for (unsigned int i=0; i<fNumPixels; i++) 324 397 { 325 398 // 326 // Set the colors of the legend 399 // Get the old color index and check whether it is 400 // background or transparent 327 401 // 328 for (int i=0; i<kItemsLegend; i++) 402 Int_t col = (*this)[i].GetFillColor(); 403 if (col==10 || col==16) 404 continue; 405 406 // 407 // Search for the color index (level) in the color table 408 // 409 int idx; 410 for (idx=0; idx<kItemsLegend; idx++) 411 if (col==fColors[idx]) 412 break; 413 414 // 415 // Should not happen 416 // 417 if (idx==kItemsLegend) 329 418 { 330 Int_t col = GetBox(i)->GetFillColor(); 331 332 // 333 // Make sure, that the legend is already colored 334 // 335 if (col==10 || col==22) 336 continue; 337 GetBox(i)->SetFillColor(gStyle->GetColorPalette(i)); 419 cout << "MCamDisplay::SetPalette: Strange... FIXME!" << endl; 420 continue; 338 421 } 339 422 340 423 // 341 // C hange the colors of the pixels424 // Convert the old color index (level) into the new one 342 425 // 343 for (unsigned int i=0; i<fNumPixels; i++) 344 { 345 // 346 // Get the old color index and check whether it is 347 // background or transparent 348 // 349 Int_t col = (*this)[i].GetFillColor(); 350 if (col==10 || col==22) 351 continue; 352 353 // 354 // Search for the color index (level) in the color table 355 // 356 int idx; 357 for (idx=0; idx<kItemsLegend; idx++) 358 if (col==fColors[idx]) 359 break; 360 // 361 // Should not happen 362 // 363 if (idx==kItemsLegend) 364 { 365 cout << "MCamDisplay::SetPalette: Strange... FIXME!" << endl; 366 continue; 367 } 368 369 // 370 // Convert the old color index (level) into the new one 371 // 372 (*this)[i].SetFillColor(gStyle->GetColorPalette(idx)); 373 } 374 375 // 376 // Update the pad on the screen 377 // 378 fDrawingPad->Modified(); 379 fDrawingPad->Update(); 426 (*this)[i].SetFillColor(gStyle->GetColorPalette(idx)); 380 427 } 381 428 … … 384 431 // 385 432 for (int i=0; i<kItemsLegend; i++) 433 { 386 434 fColors[i] = gStyle->GetColorPalette(i); 435 GetBox(i)->SetFillColor(fColors[i]); 436 } 387 437 } 388 438 … … 402 452 } 403 453 404 // ------------------------------------------------------------------------ 405 // 406 // Call this function to draw the camera layout into your canvas. 407 // Setup a drawing canvas. Add this object and all child objects 408 // (hexagons, etc) to the current pad. If no pad exists a new one is 409 // created. 410 // 411 void MCamDisplay::Draw(Option_t *option) 412 { 413 // root 3.02: 414 // gPad->SetFixedAspectRatio() 415 416 if (fDrawingPad) 417 return; 418 419 // 420 // if no canvas is yet existing to draw into, create a new one 421 // 454 void MCamDisplay::SetPalette() 455 { 456 for (int i=0; i<kItemsLegend; i++) 457 GetBox(i)->SetFillColor(fColors[i]); 458 } 459 460 void MCamDisplay::DrawPixelNumbers() 461 { 462 for (int i=0; i<kItemsLegend; i++) 463 fColors[i] = 16; 464 422 465 if (!gPad) 423 {424 fDrawingPad = new TCanvas("CamDisplay", "Magic Camera Display", 0, 0, 750, 600);425 fIsAllocated = kTRUE;426 }427 else428 {429 fDrawingPad = gPad;430 fIsAllocated = kFALSE;431 }432 433 //434 // Setup the correct environment435 //436 fDrawingPad->SetBorderMode(0);437 fDrawingPad->SetFillColor(22);438 439 //440 // Set the initial coordinate range441 //442 Paint();443 444 /*445 //446 // Create and draw the buttons which allows changing the447 // color palette of the display448 //449 TButton *but;450 char txt[100];451 sprintf(txt, "((MCamDisplay*)0x%lx)->SetPalette(1,0);", this);452 but = new TButton("Pretty", txt, 0.01, 0.95, 0.15, 0.99);453 but->Draw();454 sprintf(txt, "((MCamDisplay*)0x%lx)->SetPalette(51,0);", this);455 but = new TButton("Deap Sea", txt, 0.16, 0.95, 0.30, 0.99);456 but->Draw();457 sprintf(txt, "((MCamDisplay*)0x%lx)->SetPalette(52,0);", this);458 but = new TButton("Blue Inv", txt, 0.31, 0.95, 0.45, 0.99);459 but->Draw();460 */461 462 //463 // Draw all pixels of the camera464 // (means apend all pixelobjects to the current pad)465 //466 for (UInt_t i=0; i<fNumPixels; i++)467 {468 #if ROOT_VERSION_CODE > ROOT_VERSION(3,01,06)469 (*this)[i].SetBit(/*kNoContextMenu|*/kCannotPick);470 #endif471 (*this)[i].SetFillColor(22);472 (*this)[i].Draw();473 }474 475 fArrowX->Draw();476 fArrowY->Draw();477 478 fLegRadius->Draw();479 fLegDegree->Draw();480 481 //482 // initialize and draw legend483 //484 const Float_t H = 0.9*fRange;485 const Float_t h = 2./kItemsLegend;486 487 const Float_t w = fRange/sqrt(fNumPixels);488 489 for (Int_t i=0; i<kItemsLegend; i++)490 {491 TBox *box = GetBox(i);492 box->SetX1(fRange);493 box->SetX2(fRange+w);494 box->SetY1(H*( i *h - 1.));495 box->SetY2(H*((i+1)*h - 1.));496 box->SetFillColor(22);497 #if ROOT_VERSION_CODE > ROOT_VERSION(3,01,06)498 box->SetBit(/*kNoContextMenu|*/kCannotPick);499 #endif500 box->Draw();501 502 TText *txt = GetText(i);503 txt->SetX(fRange+1.5*w);504 txt->SetY(H*((i+0.5)*h - 1.));505 #if ROOT_VERSION_CODE > ROOT_VERSION(3,01,06)506 txt->SetBit(/*kNoContextMenu|*/kCannotPick);507 #endif508 txt->Draw();509 }510 511 //512 // Append this object, so that the aspect ratio is maintained513 // (Paint-function is called)514 // Add it here so that root will have it first in the internal list:515 // This means, that root 'sees' the whole camera instead of all the516 // single hexagons.517 //518 AppendPad(option);519 520 //fDrawingPad->SetEditable(kFALSE);521 }522 523 void MCamDisplay::DrawPixelNumbers()524 {525 if (!fDrawingPad)526 466 Draw(); 527 528 fDrawingPad->cd();529 467 530 468 TText txt; … … 545 483 // ------------------------------------------------------------------------ 546 484 // 547 // Call this function to drawthe number of photo electron into the485 // Call this function to fill the number of photo electron into the 548 486 // camera. 549 487 // 550 void MCamDisplay::DrawPhotNum(const MCerPhotEvt *event) 551 { 552 if (!event) 553 return; 554 555 Draw(); 556 557 fDrawingPad->cd(); 558 559 for (int i=0; i<kItemsLegend; i++) 560 GetBox(i)->SetFillColor(fColors[i]); 561 488 void MCamDisplay::FillPhotNum(const MCerPhotEvt &event) 489 { 562 490 // 563 491 // Reset pixel colors to default value … … 573 501 if (fAutoScale) 574 502 { 575 min = event ->GetNumPhotonsMin(fGeomCam);576 max = event ->GetNumPhotonsMax(fGeomCam);577 578 if (max < 20.)579 max = 20.;503 min = event.GetNumPhotonsMin(fGeomCam); 504 max = event.GetNumPhotonsMax(fGeomCam); 505 506 if (max < 1.) 507 max = 1.; 580 508 581 509 UpdateLegend(min, max); … … 585 513 // update the colors in the picture 586 514 // 587 const Int_t entries = event ->GetNumPixels();515 const Int_t entries = event.GetNumPixels(); 588 516 589 517 for (Int_t i=0; i<entries; i++) 590 518 { 591 const MCerPhotPix &pix = (*event)[i];519 const MCerPhotPix &pix = event[i]; 592 520 593 521 if (!pix.IsPixelUsed()) … … 596 524 SetPixColor(pix, i, min, max); 597 525 } 598 599 // 600 // Update display physically 601 // 602 fDrawingPad->Modified(); 603 fDrawingPad->Update(); 604 } 605 606 // ------------------------------------------------------------------------ 607 // 608 // Call this function to draw the number of photo electron into the 526 } 527 528 // ------------------------------------------------------------------------ 529 // 530 // Call this function to fill the number of photo electron into the 609 531 // camera. 610 532 // 611 void MCamDisplay::DrawPedestals(const MPedestalCam *event) 612 { 613 if (!event) 614 return; 615 616 Draw(); 617 618 fDrawingPad->cd(); 619 620 for (int i=0; i<kItemsLegend; i++) 621 GetBox(i)->SetFillColor(fColors[i]); 622 533 void MCamDisplay::FillPedestals(const MPedestalCam &event) 534 { 623 535 // 624 536 // Reset pixel colors to default value … … 634 546 if (fAutoScale) 635 547 { 636 min = event ->GetMeanMin(fGeomCam);637 max = event ->GetMeanMax(fGeomCam);548 min = event.GetMeanMin(fGeomCam); 549 max = event.GetMeanMax(fGeomCam); 638 550 639 551 if (max < 20.) … … 646 558 // update the colors in the picture 647 559 // 648 const Int_t entries = event ->GetSize();560 const Int_t entries = event.GetSize(); 649 561 650 562 for (Int_t i=0; i<entries; i++) 651 SetPixColorPedestal((*event)[i], i, min, max); 652 653 // 654 // Update display physically 655 // 656 fDrawingPad->Modified(); 657 fDrawingPad->Update(); 658 } 659 660 // ------------------------------------------------------------------------ 661 // 662 // Call this function to draw the error of number of photo electron 563 SetPixColorPedestal(event[i], i, min, max); 564 } 565 566 // ------------------------------------------------------------------------ 567 // 568 // Call this function to fill the error of number of photo electron 663 569 // into the camera. 664 570 // 665 void MCamDisplay::DrawErrorPhot(const MCerPhotEvt *event) 666 { 667 if (!event) 668 return; 669 670 if (!fDrawingPad) 671 Draw(); 672 673 fDrawingPad->cd(); 674 675 for (int i=0; i<kItemsLegend; i++) 676 GetBox(i)->SetFillColor(fColors[i]); 677 571 void MCamDisplay::FillErrorPhot(const MCerPhotEvt &event) 572 { 678 573 // 679 574 // Reset pixel colors to default value … … 689 584 if (fAutoScale) 690 585 { 691 min = event ->GetErrorPhotMin(fGeomCam);692 max = event ->GetErrorPhotMax(fGeomCam);586 min = event.GetErrorPhotMin(fGeomCam); 587 max = event.GetErrorPhotMax(fGeomCam); 693 588 694 589 if (max < 20.) … … 701 596 // update the colors in the picture 702 597 // 703 const Int_t entries = event ->GetNumPixels();598 const Int_t entries = event.GetNumPixels(); 704 599 705 600 for (Int_t i=0; i<entries; i++) 706 601 { 707 const MCerPhotPix &pix = (*event)[i];602 const MCerPhotPix &pix = event[i]; 708 603 709 604 if (!pix.IsPixelUsed()) … … 712 607 SetPixColorError(pix, i, min, max); 713 608 } 714 715 // 716 // Update display physically 717 // 718 fDrawingPad->Modified(); 719 fDrawingPad->Update(); 720 } 721 722 // ------------------------------------------------------------------------ 723 // 724 // Call this function to draw the ratio of the number of photons 609 } 610 611 // ------------------------------------------------------------------------ 612 // 613 // Call this function to fill the ratio of the number of photons 725 614 // divided by its error 726 615 // 727 void MCamDisplay::DrawRatio(const MCerPhotEvt *event) 728 { 729 if (!event) 730 return; 731 732 if (!fDrawingPad) 733 Draw(); 734 735 fDrawingPad->cd(); 736 737 for (int i=0; i<kItemsLegend; i++) 738 GetBox(i)->SetFillColor(fColors[i]); 739 616 void MCamDisplay::FillRatio(const MCerPhotEvt &event) 617 { 740 618 // 741 619 // Reset pixel colors to default value … … 751 629 if (fAutoScale) 752 630 { 753 min = event ->GetRatioMin();754 max = event ->GetRatioMax();631 min = event.GetRatioMin(); 632 max = event.GetRatioMax(); 755 633 756 634 UpdateLegend(min, max); … … 760 638 // update the colors in the picture 761 639 // 762 const Int_t entries = event ->GetNumPixels();640 const Int_t entries = event.GetNumPixels(); 763 641 764 642 for (Int_t i=0; i<entries; i++) 765 643 { 766 const MCerPhotPix &pix = (*event)[i];644 const MCerPhotPix &pix = event[i]; 767 645 768 646 if (!pix.IsPixelUsed()) … … 771 649 SetPixColorRatio(pix, min, max); 772 650 } 773 774 // 775 // Update display physically 776 // 777 fDrawingPad->Modified(); 778 fDrawingPad->Update(); 779 } 780 781 // ------------------------------------------------------------------------ 782 // 783 // Draw the colors in respect to the cleaning levels 784 // 785 void MCamDisplay::DrawLevels(const MCerPhotEvt *event, Float_t lvl1, Float_t lvl2) 786 { 787 if (!event) 788 return; 789 790 if (!fDrawingPad) 791 Draw(); 792 793 fDrawingPad->cd(); 794 795 for (int i=0; i<kItemsLegend; i++) 796 GetBox(i)->SetFillColor(fColors[i]); 797 651 } 652 653 // ------------------------------------------------------------------------ 654 // 655 // Fill the colors in respect to the cleaning levels 656 // 657 void MCamDisplay::FillLevels(const MCerPhotEvt &event, Float_t lvl1, Float_t lvl2) 658 { 798 659 // 799 660 // Reset pixel colors to default value … … 804 665 // update the colors in the picture 805 666 // 806 const Int_t entries = event ->GetNumPixels();667 const Int_t entries = event.GetNumPixels(); 807 668 808 669 for (Int_t i=0; i<entries; i++) 809 670 { 810 const MCerPhotPix &pix = (*event)[i];671 const MCerPhotPix &pix = event[i]; 811 672 812 673 if (!pix.IsPixelUsed()) … … 815 676 SetPixColorLevel(pix, lvl1, lvl2); 816 677 } 817 818 // 819 // Update display physically 820 // 821 fDrawingPad->Modified(); 822 fDrawingPad->Update(); 823 } 824 825 // ------------------------------------------------------------------------ 826 // 827 // Draw the colors in respect to the cleaning levels 828 // 829 void MCamDisplay::DrawLevels(const MCerPhotEvt *event, const MImgCleanStd &clean) 830 { 831 DrawLevels(event, clean.GetCleanLvl1(), clean.GetCleanLvl2()); 832 } 833 834 // ------------------------------------------------------------------------ 835 // 836 // reset the all pixel colors to a default value 678 } 679 680 // ------------------------------------------------------------------------ 681 // 682 // Fill the colors in respect to the cleaning levels 683 // 684 void MCamDisplay::FillLevels(const MCerPhotEvt &event, const MImgCleanStd &clean) 685 { 686 FillLevels(event, clean.GetCleanLvl1(), clean.GetCleanLvl2()); 687 } 688 689 // ------------------------------------------------------------------------ 690 // 691 // Reset the all pixel colors to a default value 837 692 // 838 693 void MCamDisplay::Reset() … … 844 699 // ------------------------------------------------------------------------ 845 700 // 846 // 847 // 848 // 849 // 850 // 851 // 852 // 853 // 701 // Here we calculate the color index for the current value. 702 // The color index is defined with the class TStyle and the 703 // Color palette inside. We use the command gStyle->SetPalette(1,0) 704 // for the display. So we have to convert the value "wert" into 705 // a color index that fits the color palette. 706 // The range of the color palette is defined by the values fMinPhe 707 // and fMaxRange. Between this values we have 50 color index, starting 708 // with 0 up to 49. 854 709 // 855 710 Int_t MCamDisplay::GetColor(Float_t val, Float_t min, Float_t max) … … 877 732 // ------------------------------------------------------------------------ 878 733 // 879 // change the text on the legend according to the range of the 880 // Display 734 // Change the text on the legend according to the range of the Display 881 735 // 882 736 void MCamDisplay::UpdateLegend(Float_t minphe, Float_t maxphe) 883 737 { 884 char text[10];885 886 738 for (Int_t i=0; i<kItemsLegend; i+=3) 887 739 { 888 740 const Float_t val = minphe + (Float_t)i/kItemsLegend * (maxphe-minphe) ; 889 741 890 sprintf(text, "%5.1f", val);891 892 742 TText &txt = *GetText(i); 893 894 txt.SetText(txt.GetX(), txt.GetY(), text); 743 txt.SetText(txt.GetX(), txt.GetY(), Form("%5.1f", val)); 895 744 } 896 745 } … … 902 751 void MCamDisplay::SavePrimitive(ofstream &out, Option_t *opt) 903 752 { 753 cout << "MCamDisplay::SavePrimitive: Must be rewritten!" << endl; 754 /* 904 755 if (!gROOT->ClassSaved(TCanvas::Class())) 905 756 fDrawingPad->SavePrimitive(out, opt); … … 907 758 out << " " << fDrawingPad->GetName() << "->SetWindowSize("; 908 759 out << fDrawingPad->GetWw() << "," << fDrawingPad->GetWh() << ");" << endl; 760 */ 909 761 } 910 762 … … 951 803 { 952 804 (*this)[pixnum].SetFillColor(GetColor(color, min, max)); 953 954 } 805 } 806 -
trunk/MagicSoft/Mars/mgui/MCamDisplay.h
r1904 r1965 12 12 class TText; 13 13 class TArrow; 14 class TVirtualPad;15 14 16 15 class MGeomCam; … … 46 45 UInt_t fW; // Width of canvas 47 46 UInt_t fH; // Height of canvas 48 TVirtualPad *fDrawingPad; // pad in which we are drawing49 Bool_t fIsAllocated;50 47 51 48 TBox *GetBox(Int_t i) { return (TBox*) fLegend->At(i); } … … 62 59 63 60 void UpdateLegend(Float_t min, Float_t max); 64 void Paint(Option_t *option=""); 61 void SetRange(); 62 void SetPalette(); 65 63 66 64 public: 65 MCamDisplay(); 67 66 MCamDisplay(MGeomCam *geom); 68 67 ~MCamDisplay(); 69 68 70 69 void SetAutoScale(Bool_t input=kTRUE) { fAutoScale = input; } 71 void DrawPhotNum(const MCerPhotEvt *event);72 void DrawRatio(const MCerPhotEvt *event);73 void DrawLevels(const MCerPhotEvt *event, Float_t lvl1, Float_t lvl2);74 void DrawErrorPhot(const MCerPhotEvt *event);75 void DrawLevels(const MCerPhotEvt *event, const MImgCleanStd &clean);76 void DrawPedestals(const MPedestalCam *event);70 void FillPhotNum(const MCerPhotEvt &event); 71 void FillRatio(const MCerPhotEvt &event); 72 void FillLevels(const MCerPhotEvt &event, Float_t lvl1, Float_t lvl2); 73 void FillErrorPhot(const MCerPhotEvt &event); 74 void FillLevels(const MCerPhotEvt &event, const MImgCleanStd &clean); 75 void FillPedestals(const MPedestalCam &event); 77 76 78 77 void DrawPixelNumbers(); 79 78 80 virtual void Reset(); 81 virtual void Draw(Option_t *option=""); 82 virtual void SavePrimitive(ofstream &out, Option_t *); 83 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); 79 void Paint(Option_t *option=""); 80 void Reset(); 81 void Draw(Option_t *option=""); 82 void SavePrimitive(ofstream &out, Option_t *); 83 Int_t DistancetoPrimitive(Int_t px, Int_t py); 84 84 //virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py); 85 85 -
trunk/MagicSoft/Mars/mgui/MHexagon.cc
r1880 r1965 224 224 void MHexagon::PaintHexagon(Float_t inX, Float_t inY, Float_t inD) 225 225 { 226 227 226 const Int_t np = 6; 228 227 … … 230 229 const Float_t dy[np+1] = { .2886, .5772, .2886, -.2886, -.5772, -.2886, .2886 }; 231 230 232 static Float_t x[np+1], y[np+1];233 234 231 TAttLine::Modify(); // Change line attributes only if neccessary 235 232 TAttFill::Modify(); // Change fill attributes only if neccessary 236 233 234 // 237 235 // calculate the positions of the pixel corners 238 239 for (Int_t i=0; i<=np; i++) 236 // 237 Float_t x[np+1], y[np+1]; 238 for (Int_t i=0; i<np+1; i++) 240 239 { 241 x[i] = inX + dx[i]* 242 y[i] = inY + dy[i]* 240 x[i] = inX + dx[i]*inD; 241 y[i] = inY + dy[i]*inD; 243 242 } 244 243 245 // paint the pixel (hopefully) 246 244 // 245 // paint the pixel 246 // 247 247 if (GetFillColor()) 248 248 gPad->PaintFillArea(np, x, y); … … 250 250 if (GetLineStyle()) 251 251 gPad->PaintPolyLine(np+1, x, y); 252 253 252 } 254 253 -
trunk/MagicSoft/Mars/mgui/Makefile
r1946 r1965 22 22 # connect the include files defined in the config.mk file 23 23 # 24 INCLUDES = -I. -I../mbase -I../mgeom -I../manalysis -I../mimage 24 INCLUDES = -I. -I../mbase -I../mgeom -I../manalysis -I../mimage -I../mhist 25 25 26 26 #------------------------------------------------------------------------------ -
trunk/MagicSoft/Mars/mhist/MFillH.cc
r1715 r1965 72 72 73 73 #include <TClass.h> 74 #include <TCanvas.h> 74 75 75 76 #include "MDataChain.h" … … 82 83 83 84 #include "MParList.h" 85 #include "MStatusDisplay.h" 84 86 85 87 ClassImp(MFillH); … … 99 101 100 102 fIndex = NULL; 103 fCanvas = NULL; 101 104 } 102 105 … … 143 146 144 147 fTitle = "Fill " + fHName; 145 if ( !par)148 if (fParContainerName.IsNull()) 146 149 return; 147 150 … … 313 316 } 314 317 318 Bool_t MFillH::DrawToDisplay() 319 { 320 if (!fDisplay) 321 return kTRUE; 322 323 fCanvas = &fDisplay->AddTab(fH->GetName()); 324 fH->Draw(); 325 326 return kTRUE; 327 } 328 315 329 // -------------------------------------------------------------------------- 316 330 // … … 353 367 if (!obj) 354 368 { 369 /* 355 370 if (cls==name) 356 *fLog << inf << "Object '" << fHName << "' not found in parlist... creating." << endl; 371 *fLog << inf << "Object '" << fHName << "' not found in parlist... creating." << endl; 372 */ 357 373 obj = pList->FindCreateObj(cls, name); 358 374 } … … 369 385 if (!obj->InheritsFrom(tcls)) 370 386 { 371 *fLog << err << dbginf <<obj->GetName() << " doesn't inherit ";387 *fLog << err << obj->GetName() << " doesn't inherit "; 372 388 *fLog << "from " << tcls->GetName() << " - cannot be used for MFillH..."; 373 389 *fLog << "aborting." << endl; … … 383 399 if (!fH->SetupFill(pList)) 384 400 { 385 *fLog << err << dbginf << "Error: calling SetupFill for ";401 *fLog << err << "ERROR - Calling SetupFill for "; 386 402 *fLog << fH->GetDescriptor() << "... aborting." << endl; 387 403 return kFALSE; … … 392 408 // 393 409 if (fParContainer) 394 return kTRUE;395 396 // 397 // If a name is given try to find the input container in the398 // list. If it could not be found we cannot proceed.410 return DrawToDisplay(); 411 412 // 413 // This case means, that the MH sets up its container to be filled 414 // by itself. Check there if it has something to be filled with! 399 415 // 400 416 if (fParContainerName.IsNull()) 401 417 { 402 fParContainer = NULL; 403 return kTRUE;418 fParContainer = NULL; 419 return DrawToDisplay(); 404 420 } 405 421 406 422 fParContainer = (MParContainer*)pList->FindObject(fParContainerName); 407 408 423 if (fParContainer) 409 return kTRUE;410 411 *fLog << err << dbginf << "'" << fParContainerName << "'[MParContainer] not found... aborting." << endl;424 return DrawToDisplay(); 425 426 *fLog << err << fParContainerName << " [MParContainer] not found... aborting." << endl; 412 427 return kFALSE; 413 428 } … … 443 458 if (!fH->Finalize()) 444 459 { 445 *fLog << err << dbginf << "Error: calling Finalize for ";460 *fLog << err << "ERROR - Calling Finalize for "; 446 461 *fLog << fH->GetDescriptor() << "... aborting." << endl; 447 462 return kFALSE; … … 449 464 450 465 fH->SetReadyToSave(); 466 467 if (fDisplay) 468 { 469 fCanvas->cd(); 470 fH->DrawClone("nonew"); 471 } 472 451 473 return kTRUE; 452 474 } -
trunk/MagicSoft/Mars/mhist/MFillH.h
r1574 r1965 7 7 8 8 class MH; 9 class MMap; 9 10 class MData; 10 11 class MParList; 11 12 12 class MMap;13 class TCanvas; 13 14 14 15 class MFillH : public MTask … … 24 25 MMap *fMapIdx; //! Map to map key-index-pair for an MHArray (MMap see MFillH.cc) 25 26 27 TCanvas *fCanvas; 28 26 29 TString ExtractName(const char *name) const; 27 30 TString ExtractClass(const char *name) const; … … 30 33 31 34 void StreamPrimitive(ofstream &out) const; 35 36 Bool_t DrawToDisplay(); 32 37 33 38 public: -
trunk/MagicSoft/Mars/mhist/MH.cc
r1880 r1965 585 585 // 586 586 TH1 *h1 = (TH1*)((TH1&)hist1).DrawCopy(); 587 gPad->SetBorderMode(0); 587 588 gPad->Update(); 588 589 … … 653 654 // 654 655 hist1.Draw(); 656 gPad->SetBorderMode(0); 655 657 gPad->Update(); 656 658 … … 710 712 } 711 713 714 // -------------------------------------------------------------------------- 715 // 716 // If the opt string contains 'nonew' or gPad is not given NULL is returned. 717 // Other wise the present gPad is cleared and returned. 718 // 719 TVirtualPad *MH::GetNewPad(Option_t *opt) 720 { 721 TString str(opt); 722 723 if (!str.Contains("nonew", TString::kIgnoreCase) || !gPad) 724 return NULL; 725 726 gPad->Clear(); 727 return gPad; 728 } 729 730 // -------------------------------------------------------------------------- 731 // 732 // The object is cloned and drawn to the present pad. The kCanDelete 733 // bit is set for the clone. 734 // 735 TObject *MH::DrawClone(Option_t *opt="") const 736 { 737 gROOT->SetSelectedPad(NULL); 738 739 TObject *o = MParContainer::DrawClone(opt); 740 o->SetBit(kCanDelete); 741 return o; 742 } 743 744 // -------------------------------------------------------------------------- 745 // 746 // If the opt string contains 'nonew' or gPad is not given a new canvas 747 // with size w/h is created. Otherwise the object is cloned and drawn 748 // to the present pad. The kCanDelete bit is set for the clone. 749 // 750 TObject *MH::DrawClone(Option_t *opt, Int_t w, Int_t h) const 751 { 752 TVirtualPad *p = GetNewPad(opt); 753 if (!p) 754 p = MakeDefCanvas(this, w, h); 755 756 return MH::DrawClone(opt); 757 } -
trunk/MagicSoft/Mars/mhist/MH.h
r1879 r1965 15 15 class MBinning; 16 16 class MParList; 17 17 #include <iostream.h> 18 #include <TClass.h> 18 19 class MH : public MParContainer 19 20 { 21 private: 22 /* 23 void Draw(Option_t *opt="") 24 { 25 cout << "MH::Draw" << endl; 26 MParContainer::Draw(opt); 27 } 28 */ 29 20 30 public: 21 31 MH(const char *name=NULL, const char *title=NULL); … … 59 69 static void Draw(TH1 &hist1, TH1 &hist2, const TString title); 60 70 71 void Draw(Option_t *o="") { MParContainer::Draw(o); } 72 TObject *DrawClone(Option_t *opt="") const; 73 TObject *DrawClone(Option_t *opt, Int_t w, Int_t h) const; 74 75 static TVirtualPad *GetNewPad(Option_t *opt); 76 61 77 static void FindGoodLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger); 62 78 static Double_t GetMinimumGT(const TH1 &h, Double_t gt=0); 79 80 63 81 64 82 ClassDef(MH, 1) //A histogram base class for Mars histograms -
trunk/MagicSoft/Mars/mhist/MH3.cc
r1838 r1965 600 600 MParContainer *MH3::New() const 601 601 { 602 cout << "1" <<endl;603 602 MH3 *h = NULL; 604 cout << "1a" <<endl; 605 606 if (fData[0] == NULL) 607 { 608 h=new MH3(fDimension); 609 } 610 else 611 switch (fDimension) 612 { 613 case 1: 614 h=new MH3(fData[0]->GetRule()); 615 break; 616 case 2: 617 h=new MH3(fData[0]->GetRule(), fData[1]->GetRule()); 618 break; 619 case 3: 620 h=new MH3(fData[0]->GetRule(), fData[1]->GetRule(), fData[2]->GetRule()); 621 break; 622 } 603 604 if (fData[0] == NULL) 605 h=new MH3(fDimension); 606 else 607 switch (fDimension) 608 { 609 case 1: 610 h=new MH3(fData[0]->GetRule()); 611 break; 612 case 2: 613 h=new MH3(fData[0]->GetRule(), fData[1]->GetRule()); 614 break; 615 case 3: 616 h=new MH3(fData[0]->GetRule(), fData[1]->GetRule(), fData[2]->GetRule()); 617 break; 618 } 623 619 switch (fDimension) 624 620 { -
trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc
r1715 r1965 30 30 #include "MHCerPhotEvt.h" 31 31 32 #include <TCanvas.h> 33 32 34 #include "MLog.h" 33 35 #include "MLogManip.h" … … 35 37 #include "MParList.h" 36 38 #include "MCerPhotEvt.h" 39 #include "MCamDisplay.h" 40 41 #include "MGeomCam.h" 42 #include "MGeomPix.h" 37 43 38 44 ClassImp(MHCerPhotEvt); … … 40 46 // -------------------------------------------------------------------------- 41 47 // 42 // Setup four histograms for Width, Length 43 // 44 MHCerPhotEvt::MHCerPhotEvt(const char *name, const char *title) 45 : fEvt(NULL) 46 { 47 // 48 // set the name and title of this object 49 // 50 fName = name ? name : "MHCerPhotEvt"; 51 fTitle = title ? title : "Sum up camera events"; 52 48 // Reset all pixels to 0 and reset fEntries to 0. 49 // 50 void MHCerPhotEvt::Clear() 51 { 52 fSum.Reset(); 53 53 fSum.InitSize(577); 54 54 for (int i=0; i<577; i++) 55 { 55 56 fSum.AddPixel(i, 0, 0); 57 fSum[i].SetPixelUnused(); 58 } 59 60 fEntries = 0; 61 } 62 63 // -------------------------------------------------------------------------- 64 // 65 // Setup four histograms for Width, Length 66 // 67 MHCerPhotEvt::MHCerPhotEvt(const char *name, const char *title) 68 : fEvt(NULL), fCam(NULL), fDispl(NULL) 69 { 70 // 71 // set the name and title of this object 72 // 73 fName = name ? name : "MHCerPhotEvt"; 74 fTitle = title ? title : "Average of MCerPhotEvts"; 75 76 Clear(); 77 } 78 79 MHCerPhotEvt::~MHCerPhotEvt() 80 { 81 if (fDispl) 82 delete fDispl; 56 83 } 57 84 … … 72 99 *fLog << warn << GetDescriptor() << ": No MCerPhotEvt available..." << endl; 73 100 101 fCam = (MGeomCam*)plist->FindObject("MGeomCam"); 102 if (!fCam) 103 *fLog << warn << GetDescriptor() << ": No MGeomCam found." << endl; 104 105 Clear(); 106 74 107 return kTRUE; 75 108 } … … 95 128 const MCerPhotPix &pix = (*evt)[i]; 96 129 97 fSum[pix.GetPixId()].AddNumPhotons(pix.GetNumPhotons()); 98 } 130 const Int_t id = pix.GetPixId(); 131 132 const Double_t ratio = fCam ? fCam->GetPixRatio(id) : 1; 133 134 const Double_t val = pix.GetNumPhotons()/ratio; 135 136 fSum[id].SetPixelUsed(); 137 fSum[id].AddNumPhotons(val); 138 } 139 140 fEntries++; 141 99 142 return kTRUE; 100 143 } 101 144 145 Bool_t MHCerPhotEvt::Finalize() 146 { 147 fSum.Scale(fEntries); 148 return kTRUE; 149 } 150 151 TObject *MHCerPhotEvt::DrawClone(Option_t *opt) const 152 { 153 return MH::DrawClone(opt, 750, 600); 154 } 155 156 void MHCerPhotEvt::Draw(Option_t *) 157 { 158 if (!fCam) 159 { 160 *fLog << warn << "WARNING - Cannot draw " << GetDescriptor() << ": No Camera Geometry available." << endl; 161 return; 162 } 163 164 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this, 750, 600); 165 pad->SetBorderMode(0); 166 167 // 168 // All this is necessary to get the background in the correct color 169 // 170 pad->Divide(1,1); 171 pad->cd(1); 172 173 gPad->SetBorderMode(0); 174 gPad->SetFillColor(gPad->GetFillColor()); 175 176 // 177 // set the color palette for the TBox elements 178 // 179 AppendPad(""); 180 181 // 182 // Necessary to visualize the background color (FIXME?) 183 // 184 gPad->Modified(); 185 gPad->Update(); 186 } 187 188 void MHCerPhotEvt::Paint(Option_t *option="") 189 { 190 if (!fCam) 191 { 192 *fLog << warn << "WARNING - Cannot paint " << GetDescriptor() << ": No Camera Geometry available." << endl; 193 return; 194 } 195 196 if (!fDispl) 197 fDispl = new MCamDisplay(fCam); 198 199 fDispl->FillPhotNum(fSum); 200 fDispl->Paint(); 201 } -
trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.h
r1715 r1965 11 11 12 12 class TH1D; 13 class MGeamCam; 14 class MCamDisplay; 13 15 14 16 class MHCerPhotEvt : public MH … … 16 18 private: 17 19 MCerPhotEvt fSum; 18 MCerPhotEvt *fEvt; //! 20 Int_t fEntries; 21 MCerPhotEvt *fEvt; //! 22 MGeomCam *fCam; 23 MCamDisplay *fDispl; //! 19 24 20 25 public: 21 26 MHCerPhotEvt(const char *name=NULL, const char *title=NULL); 27 ~MHCerPhotEvt(); 28 29 // TObject *Clone(const char *newname="") const; 30 31 void Clear(); 22 32 23 33 Bool_t SetupFill(const MParList *pList); 24 34 Bool_t Fill(const MParContainer *par); 35 Bool_t Finalize(); 25 36 26 37 TH1 *GetHistByName(const TString name) { return NULL; } … … 28 39 const MCerPhotEvt &GetSum() const { return fSum; } 29 40 30 ClassDef(MHCerPhotEvt, 1) // Container which holds histograms for the source independent image parameters 41 TObject *DrawClone(Option_t *opt) const; 42 void Draw(Option_t *); 43 void Paint(Option_t *option=""); 44 45 ClassDef(MHCerPhotEvt, 1) // Histogram to sum camera events 31 46 }; 32 47 -
trunk/MagicSoft/Mars/mhist/MHStarMap.cc
r1956 r1965 68 68 fTitle = title ? title : "Container for a Star Map" ; 69 69 70 *fLog << warn << "WARNING - Using MHStarMap doesn't take care of the Source Position!" << endl;71 72 70 // 73 71 // loop over all Pixels and create two histograms … … 137 135 return kTRUE; 138 136 } 137 138 *fLog << warn << "WARNING - Using MHStarMap doesn't take care of the Source Position!" << endl; 139 139 140 140 return kTRUE; … … 293 293 } 294 294 295 296 295 // -------------------------------------------------------------------------- 297 296 // … … 304 303 TObject *MHStarMap::DrawClone(Option_t *opt) const 305 304 { 306 TCanvas *c=MakeDefCanvas(fStarMap, 500, 500); 307 308 // 309 // This is necessary to get the expected bahviour of DrawClone 310 // 311 gROOT->SetSelectedPad(NULL); 312 313 PrepareDrawing(); 314 315 fStarMap->DrawCopy("colz"); 316 317 c->Modified(); 318 c->Update(); 319 320 return c; 305 return MH::DrawClone(opt, 500, 500); 321 306 } 322 307 … … 329 314 void MHStarMap::Draw(Option_t *) 330 315 { 331 if (!gPad) 332 MakeDefCanvas(fStarMap, 500, 500); 333 316 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this, 500, 500); 317 pad->SetBorderMode(0); 318 319 pad->Divide(1,1); 320 321 pad->cd(1); 322 gPad->SetBorderMode(0); 323 324 AppendPad(""); 325 } 326 327 void MHStarMap::Paint(Option_t *opt="") 328 { 329 // 330 // Maintain aspect ratio 331 // 332 const float w = gPad->GetWw(); 333 const float h = gPad->GetWh(); 334 335 if (h<w) 336 gPad->SetPad((1.-h/w)/2, 0, (h/w+1)/2, 1); 337 else 338 gPad->SetPad(0, (1.-w/h)/2, 1, (w/h+1)/2); 339 340 // 341 // Maintain colors 342 // 334 343 PrepareDrawing(); 335 344 336 fStarMap->Draw("colz");337 338 gPad->Modified();339 gPad->Update();340 } 345 // 346 // Paint Histogram 347 // 348 fStarMap->Paint("colz"); 349 } -
trunk/MagicSoft/Mars/mhist/MHStarMap.h
r1574 r1965 15 15 { 16 16 private: 17 TH2F *fStarMap; 17 TH2F *fStarMap; //-> 18 18 19 19 Float_t fMm2Deg; … … 22 22 23 23 void PrepareDrawing() const; 24 25 void Paint(Option_t *opt=""); 24 26 25 27 public: -
trunk/MagicSoft/Mars/mhist/Makefile
r1940 r1965 23 23 # 24 24 INCLUDES = -I. -I../mbase -I../mraw -I../manalysis -I../mmc \ 25 -I../mgui -I../mgeom -I../mdata -I../mfilter -I../mimage 25 -I../mgui -I../mgeom -I../mdata -I../mfilter -I../mimage \ 26 -I../mmain 26 27 27 28 #------------------------------------------------------------------------------ -
trunk/MagicSoft/Mars/mimage/MHHillas.cc
r1940 r1965 31 31 // 32 32 ///////////////////////////////////////////////////////////////////////////// 33 34 33 #include "MHHillas.h" 35 34 … … 110 109 fSize->GetXaxis()->SetTitleOffset(1.2); 111 110 fSize->GetXaxis()->SetLabelOffset(-0.015); 111 fSize->SetFillStyle(4000); 112 112 113 113 bins.Apply(*fSize); … … 280 280 void MHHillas::SetColors() const 281 281 { 282 // FIXME: This must be redone each time the canvas is repainted....283 282 gStyle->SetPalette(51, NULL); 284 283 Int_t c[50]; … … 298 297 TObject *MHHillas::DrawClone(Option_t *opt) const 299 298 { 300 TCanvas *c = MakeDefCanvas(this, 720, 810); 301 c->Divide(2,3); 302 303 gROOT->SetSelectedPad(NULL); 304 305 c->cd(1); 306 DrawCopy(*fWidth, *fLength, "Width / Length"); 307 308 c->cd(2); 309 gPad->SetLogx(); 310 fSize->DrawCopy(); 311 312 c->cd(3); 313 DrawCopy(*fCorePix, *fUsedPix, "Number of core/used Pixels"); 314 315 c->cd(4); 316 fDelta->DrawCopy(); 317 318 c->cd(5); 319 fDistC->DrawCopy(); 320 321 c->cd(6); 322 SetColors(); 323 fCenter->DrawCopy("colz"); 324 325 c->Modified(); 326 c->Update(); 327 328 return c; 299 return MH::DrawClone(opt, 720, 810); 329 300 } 330 301 … … 337 308 void MHHillas::Draw(Option_t *) 338 309 { 339 if (!gPad) 340 MakeDefCanvas(this, 720, 810); 341 342 gPad->Divide(2,3); 343 344 gPad->cd(1); 345 MH::Draw(*fWidth, *fLength, "Width / Length"); 346 347 gPad->cd(2); 310 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this, 720, 810); 311 pad->SetBorderMode(0); 312 313 AppendPad(""); 314 315 pad->Divide(2,3); 316 317 pad->cd(1); 318 MH::Draw(*fWidth, *fLength, "Width'n'Length"); 319 320 pad->cd(2); 321 gPad->SetBorderMode(0); 348 322 gPad->SetLogx(); 349 323 fSize->Draw(); 350 324 351 gPad->cd(3); 325 pad->cd(3); 326 gPad->SetBorderMode(0); 352 327 MH::Draw(*fCorePix, *fUsedPix, "Number of core/used Pixels"); 353 328 354 gPad->cd(4); 329 pad->cd(4); 330 gPad->SetBorderMode(0); 355 331 fDelta->Draw(); 356 332 357 gPad->cd(5); 333 pad->cd(5); 334 gPad->SetBorderMode(0); 358 335 fDistC->Draw(); 359 336 360 gPad->cd(6); 337 pad->cd(6); 338 gPad->SetBorderMode(0); 361 339 SetColors(); 362 340 fCenter->Draw("colz"); 363 341 364 gPad->Modified();365 gPad->Update();342 pad->Modified(); 343 pad->Update(); 366 344 } 367 345 … … 387 365 return NULL; 388 366 } 367 368 void MHHillas::Paint(Option_t *opt="") 369 { 370 SetColors(); 371 MH::Paint(); 372 } -
trunk/MagicSoft/Mars/mimage/MHHillas.h
r1940 r1965 14 14 private: 15 15 16 TH1F *fLength; //->17 TH1F *fWidth; //->16 TH1F *fLength; //-> Length 17 TH1F *fWidth; //-> Width 18 18 19 TH1F *fDistC; //->20 TH1F *fDelta; //->19 TH1F *fDistC; //-> Distance to Camera Center 20 TH1F *fDelta; //-> Angle between Length axis and x-axis 21 21 22 TH1F *fSize; //->23 TH2F *fCenter; //->22 TH1F *fSize; //-> Sum of used pixels 23 TH2F *fCenter; //-> Center 24 24 25 TH1F *fUsedPix; //-> 26 TH1F *fCorePix; //-> 25 TH1F *fUsedPix; //-> Number of used pixels 26 TH1F *fCorePix; //-> Number of core pixels 27 27 28 28 void SetColors() const; … … 30 30 Float_t fMm2Deg; 31 31 Bool_t fUseMmScale; 32 33 void Paint(Option_t *opt=""); 32 34 33 35 public: … … 55 57 TObject *DrawClone(Option_t *opt=NULL) const; 56 58 59 //Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; } 60 57 61 ClassDef(MHHillas, 1) // Container which holds histograms for the source independent image parameters 58 62 }; -
trunk/MagicSoft/Mars/mimage/MHHillasExt.cc
r1945 r1965 30 30 // 31 31 ///////////////////////////////////////////////////////////////////////////// 32 33 32 #include "MHHillasExt.h" 34 33 … … 57 56 // Setup four histograms for Width, Length 58 57 // 59 MHHillasExt::MHHillasExt(const char *name, const char *title, 60 const char *hil) 61 : fMm2Deg(1), fUseMmScale(kTRUE) 58 MHHillasExt::MHHillasExt(const char *name, const char *title) 59 : fMm2Deg(1), fUseMmScale(kTRUE), fHilName("MHillas") 62 60 { 63 61 // … … 66 64 fName = name ? name : "MHHillasExt"; 67 65 fTitle = title ? title : "Container for extended Hillas histograms"; 68 69 fHilName = hil;70 //*fLog << "MHHillasExt : fHilName = " << fHilName << endl;71 66 72 67 // … … 108 103 fHM3Trans.SetYTitle("Counts"); 109 104 105 fHConc.SetFillStyle(4000); 106 fHConc1.SetFillStyle(4000); 107 fHAsym.SetFillStyle(4000); 108 fHM3Long.SetFillStyle(4000); 109 fHM3Trans.SetFillStyle(4000); 110 110 111 111 MBinning bins; … … 121 121 bins.SetEdges(101, -593, 593); 122 122 bins.Apply(fHAsym); 123 }124 125 // --------------------------------------------------------------------------126 //127 // Delete the four histograms128 //129 MHHillasExt::~MHHillasExt()130 {131 123 } 132 124 … … 143 135 Bool_t MHHillasExt::SetupFill(const MParList *plist) 144 136 { 145 TObject *obj = plist->FindObject(fHilName, "MHillas"); 146 if (!obj) 147 { 148 *fLog << err << dbginf << "Sorry '" << fHilName 149 << "' not found in parameter list... aborting." << endl; 137 fHillasExt = (MHillasExt*)plist->FindObject(fHilName, "MHillasExt"); 138 if (!fHillasExt) 139 { 140 *fLog << err << fHilName << "[MHillasExt] not found in parameter list... aborting." << endl; 150 141 return kFALSE; 151 142 } 152 if (!obj->InheritsFrom(MHillasExt::Class()))153 {154 *fLog << err << dbginf << "Sorry 'MHillas' doesn't inherit from MHillasExt... aborting." << endl;155 return kFALSE;156 }157 fHillasExt = (MHillasExt*)obj;158 143 159 144 const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam"); … … 184 169 const MHillasSrc *src = (MHillasSrc*)par; 185 170 186 const Double_t scale = TMath::Sign(fUseMmScale?1:fMm2Deg, src ? src->GetCosDeltaAlpha() : 1);171 const Double_t scale = TMath::Sign(fUseMmScale?1:fMm2Deg, (src ? src->GetCosDeltaAlpha() : 1)); 187 172 188 173 fHConc.Fill(fHillasExt->GetConc()); … … 266 251 TObject *MHHillasExt::DrawClone(Option_t *opt) const 267 252 { 268 TCanvas &c = *MakeDefCanvas(this, 720, 540); 269 c.Divide(2, 2); 270 271 gROOT->SetSelectedPad(NULL); 272 273 c.cd(1); 274 DrawCopy(fHConc1, fHConc, "Concentrations"); 275 276 c.cd(2); 277 ((TH1&)fHAsym).DrawCopy(); 278 279 c.cd(3); 280 ((TH1&)fHM3Long).DrawCopy(); 281 282 c.cd(4); 283 ((TH1&)fHM3Trans).DrawCopy(); 284 285 c.Modified(); 286 c.Update(); 287 288 return &c; 253 return MH::DrawClone(opt, 720, 540); 289 254 } 290 255 … … 297 262 void MHHillasExt::Draw(Option_t *) 298 263 { 299 if (!gPad) 300 MakeDefCanvas(this, 720, 540); 301 302 gPad->Divide(2, 2); 303 304 gPad->cd(1); 264 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this, 720, 540); 265 pad->SetBorderMode(0); 266 267 AppendPad(""); 268 269 pad->Divide(2, 2); 270 271 pad->cd(1); 272 gPad->SetBorderMode(0); 305 273 MH::Draw(fHConc1, fHConc, "Concentrations"); 306 274 307 gPad->cd(2); 275 pad->cd(2); 276 gPad->SetBorderMode(0); 308 277 fHAsym.Draw(); 309 278 310 gPad->cd(3); 279 pad->cd(3); 280 gPad->SetBorderMode(0); 311 281 fHM3Long.Draw(); 312 282 313 gPad->cd(4); 283 pad->cd(4); 284 gPad->SetBorderMode(0); 314 285 fHM3Trans.Draw(); 315 286 316 gPad->Modified();317 gPad->Update();287 pad->Modified(); 288 pad->Update(); 318 289 } 319 290 -
trunk/MagicSoft/Mars/mimage/MHHillasExt.h
r1940 r1965 28 28 29 29 public: 30 //MHHillasExt(const char *name=NULL, const char *title=NULL); 31 MHHillasExt(const char *name=NULL, const char *title=NULL, 32 const char *hil="MHillas"); 30 MHHillasExt(const char *name=NULL, const char *title=NULL); 33 31 34 ~MHHillasExt();32 void SetHillasName(const char *name) { fHilName = name; } 35 33 36 34 void SetMmScale(Bool_t mmscale=kTRUE); -
trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc
r1940 r1965 211 211 TObject *MHHillasSrc::DrawClone(Option_t *opt) const 212 212 { 213 TCanvas *c = MakeDefCanvas(this, 700, 500); 214 c->Divide(2, 2); 215 216 // FIXME: Display Source position 217 218 gROOT->SetSelectedPad(NULL); 219 220 // 221 // This is necessary to get the expected bahviour of DrawClone 222 // 223 c->cd(1); 224 fAlpha->DrawCopy(); 225 226 c->cd(2); 227 fDist->DrawCopy(); 228 229 c->cd(3); 230 fHeadTail->DrawCopy(); 231 232 c->cd(4); 233 gPad->SetLogy(); 234 fCosDA->DrawCopy(); 235 236 c->Modified(); 237 c->Update(); 238 239 return c; 213 return MH::DrawClone(opt, 700, 500); 240 214 } 241 215 … … 248 222 void MHHillasSrc::Draw(Option_t *) 249 223 { 250 if (!gPad) 251 MakeDefCanvas(this, 700, 500); 224 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this, 700, 500); 225 pad->SetBorderMode(0); 226 227 AppendPad(""); 252 228 253 229 // FIXME: Display Source position 254 230 255 gPad->Divide(2, 2); 256 257 gPad->cd(1); 231 pad->Divide(2, 2); 232 233 pad->cd(1); 234 gPad->SetBorderMode(0); 258 235 fAlpha->Draw(); 259 236 260 gPad->cd(2); 237 pad->cd(2); 238 gPad->SetBorderMode(0); 261 239 fDist->Draw(); 262 240 263 gPad->cd(1); 241 pad->cd(3); 242 gPad->SetBorderMode(0); 264 243 fHeadTail->Draw(); 265 244 266 gPad->cd(2); 245 pad->cd(4); 246 gPad->SetBorderMode(0); 267 247 gPad->SetLogy(); 268 248 fCosDA->Draw(); 269 249 270 gPad->Modified();271 gPad->Update();250 pad->Modified(); 251 pad->Update(); 272 252 } 273 253 -
trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc
r1940 r1965 188 188 TObject *MHNewImagePar::DrawClone(Option_t *opt) const 189 189 { 190 TCanvas *c = MakeDefCanvas(this, 300, 600); 191 c->Divide(1, 2); 192 193 gROOT->SetSelectedPad(NULL); 194 195 c->cd(1); 196 fLeakage1->DrawCopy(); 197 198 c->cd(2); 199 fLeakage2->DrawCopy(); 200 201 c->Modified(); 202 c->Update(); 203 204 return c; 190 return MH::DrawClone(opt, 300, 600); 205 191 } 206 192 … … 213 199 void MHNewImagePar::Draw(Option_t *) 214 200 { 215 if (!gPad) 216 MakeDefCanvas(this, 300, 600); 217 218 gPad->Divide(2, 2); 219 220 gPad->cd(1); 201 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this, 300, 600); 202 pad->SetBorderMode(0); 203 204 AppendPad(""); 205 206 pad->Divide(1, 2); 207 208 pad->cd(1); 209 pad->SetBorderMode(0); 221 210 fLeakage1->Draw(); 222 211 223 gPad->cd(2); 212 pad->cd(2); 213 pad->SetBorderMode(0); 224 214 fLeakage2->Draw(); 225 215 226 gPad->Modified();227 gPad->Update();216 pad->Modified(); 217 pad->Update(); 228 218 } 229 219 -
trunk/MagicSoft/Mars/mimage/MHillasCalc.cc
r1940 r1965 57 57 { 58 58 fName = name ? name : "MHillasCalc"; 59 fTitle = title ? title : " Task to calculate Hillas parameters";59 fTitle = title ? title : "Calculate Hillas parameters"; 60 60 61 61 fHilName = hil; -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r1940 r1965 69 69 70 70 static const TString gsDefName = "MImgCleanStd"; 71 static const TString gsDefTitle = " Task to perform astandard image cleaning";71 static const TString gsDefTitle = "Perform standard image cleaning"; 72 72 73 73 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mmain/MProgressBar.cc
r1540 r1965 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 18 ! Author(s): Thomas Bretz, 9/2002 <mailto:tbretz@astro-uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 220 ! Copyright: MAGIC Software Development, 2000-2003 21 21 ! 22 22 ! … … 25 25 ///////////////////////////////////////////////////////////////////////////// 26 26 // 27 // MHillasSrc 27 // MProgressBar 28 // 29 // Simple window with progress bar. Can be used in an eventloop. 28 30 // 29 31 ///////////////////////////////////////////////////////////////////////////// -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
r1957 r1965 27 27 // MStatusDisplay 28 28 // 29 // upon an idea of Robert Wagner 29 // This status display can be used (and is used) to display results in 30 // a tabbed window. The window can be written to and read from a root file 31 // (see Read and Write) or printed as a postscript file (see SaveAsPS). 32 // 33 // It has also to half status lines which can be used to display the status 34 // or something going on. Together with the status lines it has a progress 35 // bar which can display the progress of a job or loop. 36 // Access the progress bar by GetProgressBar() 37 // 38 // To add a new tab and get a pointer to the newly created TCanvas 39 // use AddTab. 40 // 41 // If you have a MStatusDisplay and you are not sure whether it was 42 // destroyed by the user meanwhile use: 43 // gROOT->GetListOfSpecials()->FindObject(pointer); 44 // Each MStatusDisplay is added to list list by its constructor and 45 // removed from the list by the destructor. 46 // 47 // You can redirect an output to a MLog-logstream by calling SetLogStream(). 48 // To disable redirction call SetLogStream(NULL) 49 // 50 // Because updates to the tabs are only done/displayed if a tab is active 51 // using the gui doesn't make things slower (<1%) if the first (legend 52 // tab) is displayed. This gives you the possibility to look into 53 // the current progress of a loop without loosing more time than the 54 // single update of the tab. 30 55 // 31 56 ///////////////////////////////////////////////////////////////////////////// … … 34 59 #include <iostream.h> 35 60 36 #include <TCanvas.h> // TCanvas 37 #include <TSystem.h> // gSystem 38 39 #include <TGTab.h> // TGTab 40 #include <TGLabel.h> // TGLabel 41 #include <TGButton.h> // TGPictureButton 42 #include <TGProgressBar.h> // TGHProgressBar 61 #include <TLine.h> // TLine 62 #include <TText.h> // TText 63 #include <TFile.h> // gFile 64 #include <TFrame.h> // TFrame 65 #include <TStyle.h> // gStyle 66 #include <TCanvas.h> // TCanvas 67 #include <TSystem.h> // gSystem 68 #include <TDatime.h> // TDatime 69 #include <TRandom.h> // TRandom 70 #include <TObjArray.h> // TObjArray 71 #include <TPostScript.h> // TPostScript 72 73 #include <TGTab.h> // TGTab 74 #include <TGLabel.h> // TGLabel 75 #include <TG3DLine.h> // TGHorizontal3DLine 76 #include <TGButton.h> // TGPictureButton 77 #include <TGListBox.h> // TGListBox 78 #include <TGProgressBar.h> // TGHProgressBar 43 79 44 80 #include <TRootEmbeddedCanvas.h> // TRootEmbeddedCanvas 45 81 46 #include "MGList.h" 82 #include "MLog.h" // MLog 83 #include "MLogManip.h" // inf, warn, err 84 85 #include "MGList.h" // MGList 86 #include "MGMenu.h" // MGMenu, TGMenu 87 #include "MParContainer.h" // MParContainer::GetDescriptor 47 88 48 89 ClassImp(MStatusDisplay); 49 90 91 // -------------------------------------------------------------------------- 92 // 93 // Add menu bar to the GUI 94 // 95 void MStatusDisplay::AddMenuBar() 96 { 97 // 98 // File Menu 99 // 100 MGPopupMenu *filemenu = new MGPopupMenu(gClient->GetRoot()); 101 // filemenu->AddEntry("S&ave [F2]", kFileSave); 102 // filemenu->AddEntry("Save &As... [Shift-F2]", kFileSaveAs); 103 filemenu->AddEntry("Save As status.&ps", kFileSaveAsPS); 104 // filemenu->AddEntry("Save As status.&gif", kFileSaveAsGIF); 105 // filemenu->AddEntry("Save As status.&C", kFileSaveAsC); 106 filemenu->AddEntry("Save As status.&root", kFileSaveAsRoot); 107 filemenu->AddSeparator(); 108 filemenu->AddEntry("Print with &lpr", kFilePrint); 109 filemenu->AddEntry("Set printer &name", kFilePrinterName); 110 filemenu->AddSeparator(); 111 filemenu->AddEntry("E&xit", kFileExit); 112 filemenu->Associate(this); 113 114 // 115 // Tab Menu 116 // 117 MGPopupMenu *tabmenu = new MGPopupMenu(gClient->GetRoot()); 118 // tabmenu->AddEntry("S&ave [F2]", kFileSave); 119 // tabmenu->AddEntry("Save &As... [Shift-F2]", kFileSaveAs); 120 tabmenu->AddEntry("Save As tab-i.&ps", kTabSaveAsPS); 121 // tabmenu->AddEntry("Save As tab-i.&gif", kTabSaveAsGIF); 122 // tabmenu->AddEntry("Save As tab-i.&C", kTabSaveAsC); 123 tabmenu->AddEntry("Save As tab-i.&root", kTabSaveAsRoot); 124 tabmenu->AddSeparator(); 125 tabmenu->AddEntry("Print with &lpr", kFilePrint); 126 tabmenu->AddSeparator(); 127 tabmenu->AddEntry("Next [&+]", kTabNext); 128 tabmenu->AddEntry("Previous [&-]", kTabPrevious); 129 tabmenu->Associate(this); 130 131 // 132 // Loop Menu 133 // 134 MGPopupMenu *loopmenu = new MGPopupMenu(gClient->GetRoot()); 135 loopmenu->AddEntry("&Stop", kLoopStop); 136 loopmenu->Associate(this); 137 138 // 139 // Menu Bar 140 // 141 MGMenuBar *menubar = new MGMenuBar(this, 1, 1, kHorizontalFrame); 142 menubar->AddPopup("&File", filemenu, NULL); 143 menubar->AddPopup("&Tab", tabmenu, NULL); 144 menubar->AddPopup("&Loop", loopmenu, NULL); 145 menubar->BindKeys(this); 146 AddFrame(menubar); 147 148 // 149 // Line below menu bar 150 // 151 TGLayoutHints *laylinesep = new TGLayoutHints(kLHintsTop|kLHintsExpandX); 152 fList->Add(laylinesep); 153 154 TGHorizontal3DLine *linesep = new TGHorizontal3DLine(this); 155 AddFrame(linesep, laylinesep); 156 157 // 158 // Add everything to autodel list 159 // 160 fList->Add(filemenu); 161 fList->Add(loopmenu); 162 fList->Add(menubar); 163 fList->Add(tabmenu); 164 fList->Add(linesep); 165 } 166 167 // -------------------------------------------------------------------------- 168 // 169 // Add the title tab 170 // 171 void MStatusDisplay::AddMarsTab() 172 { 173 // Create Tab1 174 TGCompositeFrame *f = fTab->AddTab("-=MARS=-"); 175 176 // Add MARS version 177 TString txt = "Official Release: V"; 178 TGLabel *l = new TGLabel(f, txt+MARSVER); 179 fList->Add(l); 180 181 TGLayoutHints *layb = new TGLayoutHints(kLHintsCenterX|kLHintsTop, 10, 10, 10, 10); 182 fList->Add(layb); 183 f->AddFrame(l, layb); 184 185 // Add root version 186 txt = "Using ROOT v"; 187 l = new TGLabel(f, txt+ROOTVER); 188 fList->Add(l); 189 190 TGLayoutHints *lay = new TGLayoutHints(kLHintsCenterX|kLHintsTop); 191 fList->Add(lay); 192 f->AddFrame(l, lay); 193 194 // Add Mars logo picture 195 const TGPicture *pic2 = fList->GetPicture("marslogo.xpm"); 196 if (pic2) 197 { 198 TGPictureButton *mars = new TGPictureButton(f, pic2, kPicMars); 199 fList->Add(mars); 200 mars->Associate(this); 201 202 TGLayoutHints *lay2 = new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 10, 10, 10, 10); 203 fList->Add(lay2); 204 f->AddFrame(mars, lay2); 205 } 206 207 // Add date and time 208 TDatime d; 209 l = new TGLabel(f, d.AsString()); 210 fList->Add(l); 211 f->AddFrame(l, lay); 212 213 // Add copyright notice 214 l = new TGLabel(f, "(c) MAGIC Software Development, 2000-2003"); 215 fList->Add(l); 216 f->AddFrame(l, layb); 217 } 218 219 // -------------------------------------------------------------------------- 220 // 221 // Adds the logbook tab to the GUI if it was not added previously. 222 // 223 // The logbook is updated four times a second only if the tab is visible. 224 // 225 // You can redirect an output to a MLog-logstream by calling SetLogStream(). 226 // To disable redirction call SetLogStream(NULL) 227 // 228 void MStatusDisplay::SetLogStream(MLog *log) 229 { 230 if (log && fLogBox==NULL) 231 { 232 fLogIdx = fTab->GetNumberOfTabs(); 233 234 // Create Tab1 235 TGCompositeFrame *f = fTab->AddTab("-Logbook-"); 236 237 // Create TGListBox for logging contents 238 fLogBox = new TGListBox(f, 1, 1); 239 fLogBox->ChangeBackground(TGFrame::GetBlackPixel()); 240 241 // Add List box to the tab 242 TGLayoutHints *lay = new TGLayoutHints(kLHintsNormal|kLHintsExpandX|kLHintsExpandY);//, 5, 6, 5); 243 f->AddFrame(fLogBox, lay); 244 245 // layout and map tab 246 Layout(); 247 MapSubwindows(); 248 249 // make it visible 250 gClient->ProcessEventsFor(fTab); 251 } 252 253 if (log) 254 { 255 fLog = log; 256 257 log->SetOutputGui(fLogBox, kTRUE); 258 log->DisableOutputDevice(MLog::eStdout); 259 log->EnableOutputDevice(MLog::eGui); 260 261 fLogTimer.Start(); 262 } 263 else 264 { 265 fLogTimer.Stop(); 266 267 fLog->DisableOutputDevice(MLog::eGui); 268 fLog->EnableOutputDevice(MLog::eStdout); 269 fLog->SetOutputGui(NULL); 270 271 fLog = &gLog; 272 } 273 } 274 275 // -------------------------------------------------------------------------- 276 // 277 // Add the Tabs and the predifined Tabs to the GUI 278 // 279 void MStatusDisplay::AddTabs() 280 { 281 fTab = new TGTab(this, 300, 300); 282 283 AddMarsTab(); 284 285 // Add fTab to Frame 286 TGLayoutHints *laytabs = new TGLayoutHints(kLHintsNormal|kLHintsExpandX|kLHintsExpandY, 5, 6, 5); 287 AddFrame(fTab, laytabs); 288 289 fList->Add(fTab); 290 fList->Add(laytabs); 291 } 292 293 // -------------------------------------------------------------------------- 294 // 295 // Add the progress bar to the GUI 296 // 50 297 void MStatusDisplay::AddProgressBar() 51 298 { 52 TGLayoutHints *laybar=new TGLayoutHints(kLHintsExpandX, 10,10,10,10);299 TGLayoutHints *laybar=new TGLayoutHints(kLHintsExpandX, 5, 6, 5, 5); 53 300 fList->Add(laybar); 54 301 … … 59 306 } 60 307 61 enum { 62 kPicMagic, 63 kPicMars 64 }; 65 66 void MStatusDisplay::AddTabs() 67 { 68 fTab = new TGTab(this, 300, 300); 69 70 // 71 // Create Tab1 72 // 73 TGCompositeFrame *f = fTab->AddTab("-=MARS=-"); 74 75 /* 76 TGHorizontalFrame *hf = new TGHorizontalFrame(f, 1, 1); 77 78 TGLayoutHints *lay = new TGLayoutHints(kLHintsNormal|kLHintsExpandX|kLHintsExpandY, 10., 10., 10., 10.); 79 fList->Add(lay); 80 f->AddFrame(hf, lay); 81 82 const TGPicture *pic1 = fList->GetPicture("magiclogo.xpm"); 83 if (pic1) 84 { 85 TGPictureButton *magic = new TGPictureButton(hf, pic1, kPicMagic); 86 fList->Add(magic); 87 magic->Associate(this); 88 89 TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft|kLHintsTop, 10., 10., 20., 10.); 90 fList->Add(lay1); 91 hf->AddFrame(magic, lay1); 92 } 93 */ 94 const TGPicture *pic2 = fList->GetPicture("marslogo.xpm"); 95 if (pic2) 96 { 97 TGPictureButton *mars = new TGPictureButton(f, pic2, kPicMars); 98 fList->Add(mars); 99 mars->Associate(this); 100 101 TGLayoutHints *lay2 = new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 10., 10., 10., 10.); 102 fList->Add(lay2); 103 f->AddFrame(mars, lay2); 104 } 105 106 // 107 // Crete second gui elemet for tab1 (TGVertical Frame) 108 // 109 TGLayoutHints *laytabs = new TGLayoutHints(kLHintsNormal|kLHintsExpandX|kLHintsExpandY, 10, 10, 10, 10); 110 AddFrame(fTab, laytabs); 111 112 fList->Add(fTab); 113 fList->Add(laytabs); 114 } 115 116 void MStatusDisplay::AddStatusLine1() 117 { 118 TGCompositeFrame *f = new TGCompositeFrame(this, 1, 1, kSunkenFrame); 308 309 // -------------------------------------------------------------------------- 310 // 311 // Adds the status lines to the GUI 312 // 313 void MStatusDisplay::AddStatusLines() 314 { 315 TGHorizontalFrame *hf = new TGHorizontalFrame(this, 1, 1); 316 317 TGCompositeFrame *f = new TGCompositeFrame(hf, 1, 1, kSunkenFrame); 119 318 120 319 fLine1 = new TGLabel(f, ""); 121 320 122 TGLayoutHints *lay = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 5, 5, 2, 2);321 TGLayoutHints *lay = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 0, 5); 123 322 f->AddFrame(fLine1, lay); 124 AddFrame(f, lay);323 hf->AddFrame(f, lay); 125 324 126 325 fList->Add(f); 127 326 fList->Add(fLine1); 128 327 fList->Add(lay); 129 } 130 131 void MStatusDisplay::AddStatusLine2() 132 { 133 TGCompositeFrame *f = new TGCompositeFrame(this, 1, 1, kSunkenFrame); 328 329 f = new TGCompositeFrame(hf, 1, 1, kSunkenFrame); 134 330 135 331 fLine2 = new TGLabel(f, ""); 136 137 TGLayoutHints *lay = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 5, 5, 2, 2);138 332 f->AddFrame(fLine2, lay); 139 AddFrame(f, lay); 140 333 hf->AddFrame(f, lay); 334 335 TGLayoutHints *layf = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 5, 0, 0, 3); 336 AddFrame(hf, layf); 337 338 fList->Add(layf); 141 339 fList->Add(f); 142 340 fList->Add(fLine2); 143 fList->Add(lay); 144 } 145 341 fList->Add(hf); 342 } 343 344 // -------------------------------------------------------------------------- 345 // 346 // Change the text in the status line 1 347 // 146 348 void MStatusDisplay::SetStatusLine1(const char *txt) 147 349 { 148 350 fLine1->SetText(txt); 149 } 150 351 gClient->ProcessEventsFor(fLine1); 352 } 353 354 // -------------------------------------------------------------------------- 355 // 356 // Change the text in the status line 2 357 // 151 358 void MStatusDisplay::SetStatusLine2(const char *txt) 152 359 { 153 360 fLine2->SetText(txt); 361 gClient->ProcessEventsFor(fLine2); 362 } 363 364 // -------------------------------------------------------------------------- 365 // 366 // Display information about the name of a container 367 // 368 void MStatusDisplay::SetStatusLine2(const MParContainer &cont) 369 { 370 TString txt = cont.GetDescriptor(); 371 txt += ": "; 372 txt += cont.GetTitle(); 373 374 cout << txt << endl; 375 376 SetStatusLine2(txt); 154 377 } 155 378 … … 164 387 // always by deleting the corresponding object. 165 388 // 166 MStatusDisplay::MStatusDisplay() : TGTransientFrame(gClient->GetRoot(), gClient->GetRoot(), 1, 1) 167 { 389 // Update time default: 10s 390 // 391 MStatusDisplay::MStatusDisplay(Long_t t) 392 : TGMainFrame(gClient->GetRoot(), 1, 1), fTimer(this, t, kTRUE), fLog(&gLog), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL) 393 { 394 gROOT->GetListOfSpecials()->Add(this); 395 396 // 397 // Create a list handling GUI widgets 398 // 168 399 fList = new MGList; 169 400 fList->SetOwner(); 170 401 171 SetWMSizeHints(640, 480, 1280, 1024, 10, 10); // set the smallest and biggest size of the Main frame 402 // 403 // set the smallest and biggest size of the Main frame 404 // and move it to its appearance position 405 SetWMSizeHints(640, 548, 1280, 1024, 10, 10); 172 406 Move(rand()%100+50, rand()%100+50); 173 407 174 fLayCanvas = new TGLayoutHints(kLHintsExpandX|kLHintsExpandY, 3, 3, 3, 3); 408 // 409 // Create the layout hint for the root embedded canavses 410 // 411 fLayCanvas = new TGLayoutHints(kLHintsExpandX|kLHintsExpandY); 175 412 fList->Add(fLayCanvas); 176 413 414 // 415 // Add Widgets (from top to bottom) 416 // 417 AddMenuBar(); 177 418 AddTabs(); 178 419 AddProgressBar(); 179 AddStatusLine1(); 180 AddStatusLine2(); 181 420 AddStatusLines(); 421 422 // 423 // Now do an automatic layout of the widgets and display the window 424 // 425 Layout(); 182 426 MapSubwindows(); 183 184 Layout();185 427 186 428 SetWindowName("Status Display"); … … 188 430 189 431 MapWindow(); 432 433 //lient->ProcessEventsFor(this); 434 gSystem->ProcessEvents(); 190 435 } 191 436 … … 198 443 { 199 444 delete fList; 445 446 gROOT->GetListOfSpecials()->Remove(this); 200 447 } 201 448 202 TCanvas *MStatusDisplay::GetCanvas(TGCompositeFrame *cf) 449 // -------------------------------------------------------------------------- 450 // 451 // Takes a TGCompositeFrame as argument. Searches for the first 452 // TRootEmbeddedCanvas which is contained by it and returns a pointer 453 // to the corresponding TCanvas. If it isn't found NULL is returned. 454 // 455 TCanvas *MStatusDisplay::GetCanvas(TGCompositeFrame *cf) const 203 456 { 204 457 TIter Next(cf->GetList()); … … 212 465 } 213 466 214 TCanvas *MStatusDisplay::GetCanvas(int i) 467 // -------------------------------------------------------------------------- 468 // 469 // Returns GetCanvas of the i-th Tab. 470 // 471 TCanvas *MStatusDisplay::GetCanvas(int i) const 215 472 { 216 473 if (i<0 || i>=fTab->GetNumberOfTabs()) 217 474 { 218 cout<< "MStatusDisplay::GetCanvas: Out of range." << endl;475 *fLog << warn << "MStatusDisplay::GetCanvas: Out of range." << endl; 219 476 return NULL; 220 477 } … … 223 480 } 224 481 225 TCanvas *MStatusDisplay::GetCanvas(const TString &name) 482 // -------------------------------------------------------------------------- 483 // 484 // Searches for a TRootEmbeddedCanvas in the TGCompositeFramme of the 485 // Tab with the name 'name'. Returns the corresponding TCanvas or 486 // NULL if something isn't found. 487 // 488 TCanvas *MStatusDisplay::GetCanvas(const TString &name) const 226 489 { 227 490 TGFrameElement *f; … … 249 512 } 250 513 514 // -------------------------------------------------------------------------- 515 // 516 // Calls TCanvas::cd(), for the canvas returned by GetCanvas. 517 // 518 Bool_t MStatusDisplay::CdCanvas(const TString &name) 519 { 520 TCanvas *c = GetCanvas(name); 521 if (!c) 522 return kFALSE; 523 524 c->cd(); 525 return kTRUE; 526 } 527 528 // -------------------------------------------------------------------------- 529 // 530 // Adds a new tab with the name 'name'. Adds a TRootEmbeddedCanvas to the 531 // tab and returns a reference to the corresponding TCanvas. 532 // 251 533 TCanvas &MStatusDisplay::AddTab(const char *name) 252 534 { 535 // Add new tab 253 536 TGCompositeFrame *f = fTab->AddTab(name); 254 537 255 TRootEmbeddedCanvas *ec = new TRootEmbeddedCanvas(name, f, 100, 100, 0); 538 // create root embedded canvas and add it to the tab 539 TRootEmbeddedCanvas *ec = new TRootEmbeddedCanvas(name, f, f->GetWidth(), f->GetHeight(), 0); 256 540 f->AddFrame(ec, fLayCanvas); 257 541 fList->Add(ec); 258 542 543 // set background and border mode of the canvas 259 544 TCanvas &c = *ec->GetCanvas(); 260 545 261 c.SetFillColor( /*165*/17);546 c.SetFillColor(16/*165*//*17*//*203*/); 262 547 c.SetBorderMode(0); 263 548 549 // If kNoContaxtMenu set set kNoCOntextMenu of the canvas 550 if (TestBit(kNoContextMenu)) 551 c.SetBit(kNoContextMenu); 552 553 // layout and map new tab 554 Layout(); 264 555 MapSubwindows(); 265 Layout(); 266 // MapWindow(); 267 268 cout << "Adding Tab '" << name << "' (TCanvas=" << &c << ")" << ec << endl; 269 556 557 // display new tab in the main frame 558 gClient->ProcessEventsFor(fTab); 559 560 *fLog << inf << "Adding Tab '" << name << "' (" << f->GetWidth() << "x"; 561 *fLog << f->GetHeight() << ", TCanvas=" << &c << ")" << endl; 562 563 // return pointer to new canvas 270 564 return c; 271 565 } 272 566 567 // -------------------------------------------------------------------------- 568 // 569 // Update a canvas in a tab, takes the corresponding TGCompositeFrame 570 // as an argument 571 // 572 void MStatusDisplay::UpdateTab(TGCompositeFrame *f) 573 { 574 if (!f) 575 return; 576 577 TCanvas *c=GetCanvas(f); 578 if (!c) 579 return; 580 581 c->Modified(); 582 c->Update(); 583 c->Paint(); 584 } 585 586 // -------------------------------------------------------------------------- 587 // 588 // Saves the given canvas (pad) or all pads (num<0) as a temporary 589 // postscript file and prints it using 'lpr'. If a printer name is set 590 // via SetPrinter 'lpr -Pname' is used. 591 // 592 Int_t MStatusDisplay::PrintToLpr(Int_t num) const 593 { 594 TString name = "mars"; 595 596 for (int i=0; i<6; i++) 597 name += (char)(gRandom->Uniform(25)+65); 598 599 name += ".ps"; 600 601 const Int_t pages = SaveAsPS(num, name); 602 if (!pages) 603 { 604 *fLog << warn << "MStatusDisplay::PrintToLpr: Sorry, couldn't save file as temporary postscript!" << endl; 605 return 0; 606 } 607 608 TString cmd="lpr "; 609 if (!fPrinter.IsNull()) 610 { 611 cmd += "-P"; 612 cmd += fPrinter; 613 cmd += " "; 614 } 615 cmd += name; 616 617 gSystem->Exec(cmd); 618 gSystem->Unlink(name); 619 620 return pages; 621 } 622 623 // -------------------------------------------------------------------------- 624 // 625 // Process the kC_COMMAND, kCM_MENU messages 626 // 627 Bool_t MStatusDisplay::ProcessMessageCommandMenu(Long_t id) 628 { 629 //cout << "Menu #" << id << endl; 630 switch (id) 631 { 632 case kLoopStop: 633 case kFileExit: 634 if (id==kFileExit && !TestBit(kIsLocked)) 635 delete this; 636 fStatus = (Status_t)id; 637 return kTRUE; 638 /* 639 case kFileSave: 640 cout << "Save..." << endl; 641 return kTRUE; 642 643 case kFileSaveAs: 644 cout << "SaveAs..." << endl; 645 return kTRUE; 646 */ 647 case kFileSaveAsPS: 648 //cout << "FileSaveAsPS..." << endl; 649 SaveAsPS(); 650 return kTRUE; 651 /* 652 case kFileSaveAsGIF: 653 cout << "FileSaveAsGIF..." << endl; 654 SaveAsGIF(); 655 return kTRUE; 656 657 case kFileSaveAsC: 658 cout << "FileSaveAsC..." << endl; 659 SaveAsC(); 660 return kTRUE; 661 */ 662 case kFileSaveAsRoot: 663 SaveAsRoot(); 664 return kTRUE; 665 666 case kFilePrint: 667 PrintToLpr(); 668 return kTRUE; 669 670 case kTabSaveAsPS: 671 SaveAsPS(fTab->GetCurrent()); 672 return kTRUE; 673 /* 674 case kTabSaveAsGIF: 675 cout << "TabSaveAsGIF... " << fTab->GetCurrent() << endl; 676 SaveAsGIF(fTab->GetCurrent()); 677 return kTRUE; 678 679 case kTabSaveAsC: 680 cout << "TabSaveAsC... " << fTab->GetCurrent() << endl; 681 SaveAsC(fTab->GetCurrent()); 682 return kTRUE; 683 */ 684 case kTabSaveAsRoot: 685 SaveAsRoot(fTab->GetCurrent()); 686 return kTRUE; 687 688 case kTabPrint: 689 PrintToLpr(fTab->GetCurrent()); 690 return kTRUE; 691 692 case kTabNext: 693 fTab->SetTab(fTab->GetCurrent()+1); 694 return kTRUE; 695 696 case kTabPrevious: 697 fTab->SetTab(fTab->GetCurrent()-1); 698 return kTRUE; 699 } 700 return kTRUE; 701 702 cout << "Command-Menu: Id=" << id << endl; 703 } 704 705 // -------------------------------------------------------------------------- 706 // 707 // Process the kC_COMMAND messages 708 // 709 Bool_t MStatusDisplay::ProcessMessageCommand(Long_t submsg, Long_t mp1, Long_t mp2) 710 { 711 switch (submsg) 712 { 713 case kCM_MENU: 714 return ProcessMessageCommandMenu(mp1); 715 716 case kCM_MENUSELECT: 717 cout << "Menuselect #" << mp1 << endl; 718 return kTRUE; 719 720 case kCM_TAB: 721 for (int i=1; i<fTab->GetNumberOfTabs(); i++) 722 fTab->GetTabContainer(i)->UnmapWindow(); 723 UpdateTab(fTab->GetTabContainer(mp1)); 724 fTab->GetTabContainer(mp1)->MapWindow(); 725 /* 726 if (mp1>0) 727 fMenu->AddPopup("&CaOs", fCaOs, NULL); 728 else 729 fMenu->RemovePopup("CaOs"); 730 fMenu->Resize(fMenu->GetDefaultSize()); 731 MapSubwindows(); 732 MapWindow(); 733 */ 734 return kTRUE; 735 736 case kCM_BUTTON: 737 if (mp1==kPicMars) 738 return kTRUE; 739 return kTRUE; 740 } 741 742 cout << "Command: " << "Submsg:" << submsg << " Mp1=" << mp1 << " Mp2=" << mp2 << endl; 743 return kTRUE; 744 } 745 746 // -------------------------------------------------------------------------- 747 // 748 // Process the messages from the GUI 749 // 273 750 Bool_t MStatusDisplay::ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2) 274 751 { 275 cout << "Msg: " << GET_MSG(msg) << " Submsg:" << GET_SUBMSG(msg) << " Mp1="; 276 cout << mp1 << " Mp2=" << mp2 << endl; 752 switch (GET_MSG(msg)) 753 { 754 case kC_COMMAND: 755 return ProcessMessageCommand(GET_SUBMSG(msg), mp1, mp2); 756 } 757 758 cout << "Msg: " << GET_MSG(msg) << " Submsg:" << GET_SUBMSG(msg); 759 cout << " Mp1=" << mp1 << " Mp2=" << mp2 << endl; 277 760 278 761 return kTRUE; … … 292 775 } 293 776 777 // -------------------------------------------------------------------------- 778 // 779 // Calls SetBit(kNoContextMenu) for all TCanvas objects found in the 780 // Tabs. 781 // 782 void MStatusDisplay::SetNoContextMenu(Bool_t flag=kTRUE) 783 { 784 flag ? SetBit(kNoContextMenu) : ResetBit(kNoContextMenu); 785 for (int i=1; i<fTab->GetNumberOfTabs(); i++) 786 { 787 TCanvas *c = GetCanvas(i); 788 if (c) 789 flag ? c->SetBit(kNoContextMenu) : c->ResetBit(kNoContextMenu); 790 } 791 } 792 793 // -------------------------------------------------------------------------- 794 // 795 // Updates the canvas (if existing) in the currenly displayed Tab. 796 // The update intervall is controlled by StartUpdate and StopUpdate 797 // 798 Bool_t MStatusDisplay::HandleTimer(TTimer *timer) 799 { 800 const Int_t c = fTab->GetCurrent(); 801 802 // Skip Legend Tab 803 if (c==0) 804 return kTRUE; 805 806 if (timer==&fTimer) 807 { 808 TGCompositeFrame *f=fTab->GetCurrentContainer(); 809 if (f!=fLogBox) 810 return kTRUE; 811 812 UpdateTab(f); 813 return kTRUE; 814 } 815 if (timer==&fLogTimer && c==fLogIdx) 816 { 817 fLog->UpdateGui(); 818 819 if (!fLogBox->TestBit(kHasChanged)) 820 return kTRUE; 821 822 fLogBox->MapSubwindows(); 823 fLogBox->Layout(); 824 fLogBox->ResetBit(kHasChanged); 825 return kTRUE; 826 } 827 828 return kTRUE; 829 } 830 831 // -------------------------------------------------------------------------- 832 // 833 // Draws a clone of a canvas into a new canvas. Taken from TCanvas. 834 // 835 void MStatusDisplay::DrawClonePad(TCanvas &newc, const TCanvas &oldc) const 836 { 837 //copy pad attributes 838 newc.Range(oldc.GetX1(),oldc.GetY1(),oldc.GetX2(),oldc.GetY2()); 839 newc.SetTickx(oldc.GetTickx()); 840 newc.SetTicky(oldc.GetTicky()); 841 newc.SetGridx(oldc.GetGridx()); 842 newc.SetGridy(oldc.GetGridy()); 843 newc.SetLogx(oldc.GetLogx()); 844 newc.SetLogy(oldc.GetLogy()); 845 newc.SetLogz(oldc.GetLogz()); 846 newc.SetBorderSize(oldc.GetBorderSize()); 847 newc.SetBorderMode(oldc.GetBorderMode()); 848 ((TAttLine&)oldc).Copy((TAttLine&)newc); 849 ((TAttFill&)oldc).Copy((TAttFill&)newc); 850 ((TAttPad&)oldc).Copy((TAttPad&)newc); 851 852 //copy primitives 853 TObject *obj; 854 TIter next(oldc.GetListOfPrimitives()); 855 while ((obj=next())) { 856 gROOT->SetSelectedPad(&newc); 857 newc.GetListOfPrimitives()->Add(obj->Clone(),obj->GetDrawOption()); 858 } 859 newc.Modified(); 860 newc.Update(); 861 } 862 863 // -------------------------------------------------------------------------- 864 // 865 // Reads the contents of a saved MStatusDisplay from a file. 866 // 867 Int_t MStatusDisplay::Read(const char *name) 868 { 869 if (!gFile) 870 { 871 *fLog << warn << "MStatusDisplay::Read: No file found. Please create a TFile first." << endl; 872 return 0; 873 } 874 875 if (!gFile->IsOpen()) 876 { 877 *fLog << warn << "MStatusDisplay::Read: File not open. Please open the TFile first." << endl; 878 return 0; 879 } 880 881 TObjArray list; 882 883 const Int_t n = list.Read(name); 884 if (n==0) 885 { 886 *fLog << warn << "MStatusDisplay::Read: No objects read." << endl; 887 return 0; 888 } 889 890 TIter Next(&list); 891 TCanvas *c; 892 while ((c=(TCanvas*)Next())) 893 DrawClonePad(AddTab(c->GetName()), *c); 894 895 *fLog << inf << "MStatusDisplay: Key " << name << " with " << n << " keys read from file." << endl; 896 897 return n; 898 } 899 900 // -------------------------------------------------------------------------- 901 // 902 // Writes the contents of a MStatusDisplay to a file. 903 // 904 Int_t MStatusDisplay::Write(Int_t num, const char *name, Int_t option, Int_t bufsize) 905 { 906 if (!gFile) 907 { 908 *fLog << warn << "MStatusDisplay::Write: No file found. Please create a TFile first." << endl; 909 return 0; 910 } 911 912 if (!gFile->IsOpen()) 913 { 914 *fLog << warn << "MStatusDisplay::Write: File not open. Please open the TFile first." << endl; 915 return 0; 916 } 917 918 if (!gFile->IsWritable()) 919 { 920 *fLog << warn << "MStatusDisplay::Write: File not writable." << endl; 921 return 0; 922 } 923 924 if (num==0) 925 { 926 *fLog << warn << "MStatusDisplay::Write: Tab doesn't contain an embedded Canvas... skipped." << endl; 927 return 0; 928 } 929 930 if (num>=fTab->GetNumberOfTabs()) 931 { 932 *fLog << warn << "MStatusDisplay::Write: Tab doesn't exist... skipped." << endl; 933 return 0; 934 } 935 936 TObjArray list; 937 938 const Int_t from = num<0 ? 1 : num; 939 const Int_t to = num<0 ? fTab->GetNumberOfTabs() : num+1; 940 941 TCanvas *c; 942 for (int i=from; i<to; i++) 943 if ((c = GetCanvas(i))) 944 list.Add(c); 945 946 const Int_t n = list.Write(name, kSingleKey); 947 948 *fLog << inf << "MStatusDisplay: " << n << " keys written to file as key " << name << "." << endl; 949 950 return n; 951 } 952 953 // -------------------------------------------------------------------------- 954 // 955 // Use this to start the synchronous (GUI eventloop driven) tab update. 956 // Can also be used to change the update intervall. If millisec<0 957 // the intervall given in SetUpdateTime is used. If the intervall in 958 // SetUpdateTime is <0 nothing is done. (Call SetUpdateTime(-1) to 959 // disable the automatic update in a MEventloop. 960 // 961 void MStatusDisplay::StartUpdate(Int_t millisec=-1) 962 { 963 if (fTimer.GetTime()<TTime(0)) 964 return; 965 fTimer.Start(millisec); 966 } 967 968 // -------------------------------------------------------------------------- 969 // 970 // Stops the automatic GUI update 971 // 972 void MStatusDisplay::StopUpdate() 973 { 974 fTimer.Stop(); 975 } 976 977 // -------------------------------------------------------------------------- 978 // 979 // Set the update interval for the GUI update, see StartUpdate. 980 // 981 void MStatusDisplay::SetUpdateTime(Long_t t) 982 { 983 fTimer.SetTime(t); 984 } 985 986 // -------------------------------------------------------------------------- 987 // 988 // Set the background color in a canvas 989 // 990 void MStatusDisplay::CanvasSetFillColor(TPad &p, Int_t col) const 991 { 992 TObject *obj; 993 994 TIter Next(p.GetListOfPrimitives()); 995 while ((obj=Next())) 996 { 997 if (obj->InheritsFrom(TPad::Class())) 998 CanvasSetFillColor(*(TPad*)obj, col); 999 if (obj->InheritsFrom(TFrame::Class())) 1000 ((TFrame*)obj)->SetFillColor(col); 1001 } 1002 1003 p.SetFillColor(col); 1004 } 1005 1006 void MStatusDisplay::AddExtension(TString &name, const TString &ext, Int_t num) const 1007 { 1008 if (name.IsNull()) 1009 { 1010 name = "status"; 1011 if (num>0) 1012 { 1013 name += "-"; 1014 name += num; 1015 } 1016 } 1017 1018 if (name.EndsWith("."+ext)) 1019 return; 1020 1021 name += "."; 1022 name += ext; 1023 } 1024 1025 // -------------------------------------------------------------------------- 1026 // 1027 // In case of num<0 all tabs are written into the PS file. If num>0 1028 // the canvas in the corresponding tab is written to the file. 1029 // Name is the name of the file (with or without extension). 1030 // 1031 // Returns the number of pages written. 1032 // 1033 // To write all tabs you can also use SaveAsPS(name) 1034 // 1035 Int_t MStatusDisplay::SaveAsPS(Int_t num, TString name) const 1036 { 1037 if (num>=fTab->GetNumberOfTabs()) 1038 { 1039 *fLog << warn << "Tab #" << num << " doesn't exist..." << endl; 1040 return 0; 1041 } 1042 if (num==0) 1043 { 1044 *fLog << warn << "Tab #" << num << " doesn't contain an embedded canvas..." << endl; 1045 return 0; 1046 } 1047 if (fTab->GetNumberOfTabs()<2 || !gPad) 1048 { 1049 *fLog << warn << "Sorry, you must have at least one existing canvas (gPad!=NULL)" << endl; 1050 return 0; 1051 } 1052 1053 AddExtension(name, "ps", num); 1054 1055 if (num<0) 1056 *fLog << inf << "Open ps-File: " << name << endl; 1057 1058 TPad *padsav = (TPad*)gPad; 1059 TVirtualPS *psave = gVirtualPS; 1060 1061 TPostScript ps(name, 112); 1062 ps.SetBit(TPad::kPrintingPS); 1063 ps.PrintFast(13, "/nan {1} def "); 1064 1065 gVirtualPS = &ps; 1066 1067 // 1068 // Create a list to delete the canvas clones 1069 // 1070 TList l; 1071 l.SetOwner(); 1072 1073 // 1074 // Create some GUI elements for a page legend 1075 // 1076 TLine line; 1077 1078 int page = 1; 1079 1080 // 1081 // Maintain tab numbers 1082 // 1083 const Int_t from = num<0 ? 1 : num; 1084 const Int_t to = num<0 ? fTab->GetNumberOfTabs() : num+1; 1085 1086 for (int i=from; i<to; i++) 1087 { 1088 TCanvas *c; 1089 if (!(c = GetCanvas(i))) 1090 { 1091 if (num<0) 1092 *fLog << inf << " - "; 1093 *fLog << "Tab #" << i << " doesn't contain an embedded Canvas... skipped." << endl; 1094 continue; 1095 } 1096 1097 // 1098 // Init page and page size, make sure, that the canvas in the file 1099 // has the same Aspect Ratio than on the screen. 1100 // 1101 ps.NewPage(); 1102 1103 Float_t psw = 26; // A4 - width 1104 Float_t psh = 20; // A4 - height 1105 1106 const Float_t cw = c->GetWw(); 1107 const Float_t ch = c->GetWh(); 1108 1109 if (psw/psh>cw/ch) 1110 psw = cw/ch*psh; 1111 else 1112 psh = ch/cw*psw; 1113 1114 ps.Range(psw, psh); // A4 1115 1116 // 1117 // Clone canvas and change background color and schedule for 1118 // deletion 1119 // 1120 TCanvas *n = (TCanvas*)c->Clone(); 1121 CanvasSetFillColor(*n, kWhite); 1122 l.Add(n); 1123 1124 // 1125 // Paint canvas into root file 1126 // 1127 if (num<0) 1128 *fLog << inf << " - "; 1129 *fLog << "Writing Tab #" << i << ": " << c->GetName() << " (" << n << ") "; 1130 if (num>0) 1131 *fLog << "to " << name; 1132 *fLog << "..." << flush; 1133 1134 n->SetBatch(kTRUE); 1135 n->Paint(); 1136 1137 // 1138 // Use the canvas as coordinate system for the overlaying text 1139 // 1140 gPad = n; 1141 1142 // 1143 // Print overlaying text (NDC = %) 1144 // 1145 ps.SetTextColor(kBlack); 1146 ps.SetTextSize(0.015); 1147 ps.SetTextFont(22); 1148 ps.SetTextAlign(11); // left top 1149 ps.TextNDC(0, 1.02, TString(" ")+n->GetName()); 1150 ps.SetTextAlign(21); // cent top 1151 ps.TextNDC(0.5, 1.02, "MARS - Magic Analysis and Reconstruction Software"); 1152 ps.SetTextAlign(31); // right top 1153 ps.TextNDC(1, 1.02, Form("Page No.%i (%i) ", page++, i)); 1154 line.PaintLineNDC(0, 1.015, 1, 1.015); 1155 1156 // 1157 // Finish drawing page 1158 // 1159 n->SetBatch(kFALSE); 1160 if (num<0) 1161 *fLog << "done." << endl; 1162 } 1163 1164 gPad = NULL; // Important! 1165 1166 l.Delete(); 1167 1168 ps.Close(); 1169 1170 gVirtualPS = psave; 1171 padsav->cd(); 1172 1173 *fLog << inf << "done." << endl; 1174 1175 return page-1; 1176 } 1177 1178 /* 1179 void MStatusDisplay::SaveAsGIF(Int_t num, TString name) const 1180 { 1181 AddExtension(name, "gif", num); 1182 1183 cout << "Open gif-File: " << name << endl; 1184 cout << " SORRY, not implemented." << endl; 1185 } 1186 1187 void MStatusDisplay::SaveAsC(Int_t num, TString name) const 1188 { 1189 AddExtension(name, "C", num); 1190 1191 cout << "Open C-File: " << name << endl; 1192 cout << " SORRY, not implemented." << endl; 1193 } 1194 */ 1195 1196 // -------------------------------------------------------------------------- 1197 // 1198 // In case of num<0 all tabs are written into the PS file. If num>0 1199 // the canvas in the corresponding tab is written to the file. 1200 // Name is the name of the file (with or without extension). 1201 // 1202 // Returns the number of keys written. 1203 // 1204 // To write all tabs you can also use SaveAsPS(name) 1205 // 1206 Int_t MStatusDisplay::SaveAsRoot(Int_t num, TString name) 1207 { 1208 if (num>=fTab->GetNumberOfTabs()) 1209 { 1210 *fLog << warn << "Tab #" << num << " doesn't exist..." << endl; 1211 return 0; 1212 } 1213 if (num==0) 1214 { 1215 *fLog << warn << "Tab #" << num << " doesn't contain an embedded canvas..." << endl; 1216 return 0; 1217 } 1218 if (fTab->GetNumberOfTabs()<2 || !gPad) 1219 { 1220 *fLog << warn << "Sorry, you must have at least one existing canvas." << endl; 1221 return 0; 1222 } 1223 1224 AddExtension(name, "root", num); 1225 1226 TFile *fsave = gFile; 1227 TFile file(name, "RECREATE", "MARS - Status Window Contents", 9); 1228 const Int_t keys = Write(num); 1229 gFile = fsave; 1230 1231 return keys; 1232 } -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.h
r1957 r1965 10 10 #endif 11 11 12 #ifndef ROOT_TTimer 13 #include <TTimer.h> 14 #endif 15 16 class MLog; 12 17 class MGList; 18 class MParContainer; 13 19 20 class TPad; 21 class TTimer; 14 22 class TCanvas; 15 23 16 24 class TGTab; 17 25 class TGLabel; 26 class TGListBox; 18 27 class TGProgressBar; 19 28 class TGHProgressBar; 20 29 21 class MStatusDisplay : public TG TransientFrame30 class MStatusDisplay : public TGMainFrame 22 31 { 32 public: 33 typedef enum { 34 kLoopNone, 35 kLoopStop, 36 kFileSave, 37 kFileSaveAs, 38 kFileSaveAsPS, 39 kFileSaveAsRoot, 40 kFileSaveAsGIF, 41 kFileSaveAsC, 42 kFilePrint, 43 kFilePrinterName, 44 kTabSave, 45 kTabSaveAs, 46 kTabSaveAsPS, 47 kTabSaveAsRoot, 48 kTabSaveAsGIF, 49 kTabSaveAsC, 50 kTabPrint, 51 kTabNext, 52 kTabPrevious, 53 kFileExit, 54 kPicMagic, 55 kPicMars 56 } Status_t; 57 23 58 private: 24 59 MGList *fList; … … 27 62 TGLayoutHints *fLayCanvas; 28 63 64 TTimer fTimer; 29 65 30 66 TGLabel *fLine1; 31 67 TGLabel *fLine2; 32 68 69 Status_t fStatus; 70 71 TString fPrinter; 72 73 MLog *fLog; 74 Int_t fLogIdx; 75 TTimer fLogTimer; 76 TGListBox *fLogBox; 77 78 void AddMenuBar(); 33 79 void AddProgressBar(); 80 void AddMarsTab(); 81 void AddLogTab(); 34 82 void AddTabs(); 35 void AddStatusLine1(); 36 void AddStatusLine2(); 83 void AddStatusLines(); 37 84 38 TCanvas *GetCanvas(TGCompositeFrame *f) ;85 TCanvas *GetCanvas(TGCompositeFrame *f) const; 39 86 87 Bool_t ProcessMessageCommandMenu(Long_t mp1); 88 Bool_t ProcessMessageCommand(Long_t submsg, Long_t mp1, Long_t mp2); 40 89 Bool_t ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2); 41 90 void CloseWindow(); 42 91 92 Bool_t HandleTimer(TTimer *timer=NULL); 93 void UpdateTab(TGCompositeFrame *f); 94 95 void DrawClonePad(TCanvas &newc, const TCanvas &oldc) const; 96 void CanvasSetFillColor(TPad &c, Int_t col) const; 97 98 void AddExtension(TString &name, const TString &ext, Int_t num) const; 99 100 enum { 101 kIsLocked = BIT(14) 102 }; 43 103 public: 44 MStatusDisplay( );104 MStatusDisplay(Long_t t=1000); 45 105 virtual ~MStatusDisplay(); 106 107 void SetLogStream(MLog *log); 108 109 void StartUpdate(Int_t millisec=-1); 110 void StopUpdate(); 111 void SetUpdateTime(Long_t t); 46 112 47 113 TGProgressBar *GetBar() const { return (TGProgressBar*)fBar; } … … 49 115 void SetStatusLine1(const char *txt); 50 116 void SetStatusLine2(const char *txt); 117 void SetStatusLine2(const MParContainer &cont); 118 119 void SetPrinter(const TString &lpr) { fPrinter = lpr; } 51 120 52 121 TCanvas &AddTab(const char *name); 53 122 54 TCanvas *GetCanvas(int i); 55 TCanvas *GetCanvas(const TString &name); 123 TCanvas *GetCanvas(int i) const; 124 TCanvas *GetCanvas(const TString &name) const; 125 126 Int_t Read(const char *name="MStatusDisplay"); 127 Int_t Write(const char *name="MStatusDisplay", Int_t option=0, Int_t bufsize=0) 128 { 129 return Write(-1, name, option, bufsize); 130 } 131 Int_t Write(Int_t num, const char *name="MStatusDisplay", Int_t option=0, Int_t bufsize=0); 132 133 Bool_t CdCanvas(const TString &name); 134 135 void SetNoContextMenu(Bool_t flag=kTRUE); 136 137 Int_t SaveAsPS(TString name="") const { return SaveAsPS(-1, name); } 138 //Bool_t SaveAsGIF(TString name="") const { return SaveAsGIF(-1, name); } 139 //Bool_t SaveAsC(TString name="") const { return SaveAsC(-1, name); } 140 Int_t SaveAsRoot(TString name="") { return SaveAsRoot(-1, name); } 141 Int_t PrintToLpr() const { return PrintToLpr(-1); } 142 143 Int_t SaveAsPS(Int_t num, TString name="") const; 144 //Bool_t SaveAsGIF(Int_t num, TString name="") const; 145 //Bool_t SaveAsC(Int_t num, TString name="") const; 146 Int_t SaveAsRoot(Int_t num, TString name=""); 147 Int_t PrintToLpr(Int_t num) const; 148 149 Status_t CheckStatus() const { return fStatus; } 150 void ClearStatus() { fStatus = kLoopNone; } 151 152 void Lock() { SetBit(kIsLocked); } 153 void UnLock() { ResetBit(kIsLocked); } 56 154 57 155 ClassDef(MStatusDisplay, 0) // Window for a status display -
trunk/MagicSoft/Mars/mmain/MainLinkDef.h
r1527 r1965 8 8 9 9 #pragma link C++ class MMars+; 10 #pragma link C++ class MEvtDisp+; 10 11 #pragma link C++ class MAnalysis+; 11 #pragma link C++ class MEvtDisp+;12 //#pragma link C++ class MTextEntry+; 12 13 #pragma link C++ class MDataCheck+; 13 14 #pragma link C++ class MMonteCarlo+; 14 15 #pragma link C++ class MProgressBar+; 15 16 #pragma link C++ class MCameraDisplay+; 17 #pragma link C++ class MStatusDisplay+; 16 18 17 19 #endif -
trunk/MagicSoft/Mars/mmain/Makefile
r1941 r1965 32 32 SRCFILES = MBrowser.cc \ 33 33 MEvtDisp.cc \ 34 MStatusDisplay.cc \ 34 35 MDataCheck.cc \ 35 36 MMars.cc \ 37 MGMenu.cc \ 36 38 MAnalysis.cc \ 37 39 MMonteCarlo.cc \
Note:
See TracChangeset
for help on using the changeset viewer.