- Timestamp:
- 10/28/03 14:54:20 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2437 r2438 1 1 -*-*- END OF LINE -*-*- 2 2 3 2003/10/28: Thomas Bretz 4 5 * macros/readCT1.C: 6 - fixed to work with the correct geometry 7 8 * macros/readMagic.C: 9 - fixed - was crashing 10 11 * macros/tar.C: 12 - exclude 'Tag' files from tar 13 14 * manalysis/MGeomApply.[h,cc]: 15 - replaced constructor by SetGeometry (constructor was 16 not unique) 17 18 * mbase/MEvtLoop.[h,cc]: 19 - set fProgress already when setting fDisplay (gives the 20 possibility to overwrite fProgress) 21 - removed 'entries' from ProcessGuiEvents (moved to fNumEvents) 22 - Set ProgressBar position in percent instead of event number 23 - Set progress bar range from 0 to 1 24 25 * mbase/MReadSocket.cc: 26 - fixed to treat timeout correctly 27 - replaces usleep() by gSystem->Sleep() 28 29 * mbase/MTime.h: 30 - added SetTime(ULong_t) (support for gSystem->Now()) 31 - added SetTime(Double_t) 32 - added operator() 33 - fixed all comparison operators to use time instead of 34 time lo/hi - will be removed soon 35 36 * mimage/MHHillasSrc.cc: 37 - delete 3rd Pad 38 39 * mraw/MRawEvtData.cc: 40 - when drawing print gPad 41 42 43 3 44 2003/10/28: Wolfgang Wittek 4 45 5 * manalysis/MCT1PadONOFF.cc 6 - replace GetMeanRms() by GetPedestalRms() 7 - replace SetMeanRms() by SetPedestalRms() 8 - reactivate code which was commented out by tgb 9 (no compilation errors on Alpha OSF) 10 11 * manalysis/AnalysisLinkDef.h 12 /Makefile 13 - put back MCT1PadONOFF 14 15 * macros/CT1Analysis.C 16 /ONOFFCT1Analysis.C 17 - current versions of macros for the analysis of CT1 data 46 * manalysis/MCT1PadONOFF.cc 47 - replace GetMeanRms() by GetPedestalRms() 48 - replace SetMeanRms() by SetPedestalRms() 49 - reactivate code which was commented out by tgb 50 (no compilation errors on Alpha OSF) 51 52 * manalysis/AnalysisLinkDef.h, manalysis/Makefile 53 - put back MCT1PadONOFF 54 55 * macros/CT1Analysis.C, macros/ONOFFCT1Analysis.C 56 - current versions of macros for the analysis of CT1 data 18 57 19 58 … … 25 64 that goes with the same value to both FADC gains (fDigitalNoise) 26 65 - Class version has been changed from 2 to 3. 66 67 27 68 28 69 2003/10/24: Abelardo Moralejo … … 37 78 class would produce wrong results. 38 79 80 81 39 82 2003/10/23: Abelardo Moralejo 40 83 … … 44 87 we had in 3.02, and the graphics output had become unreadable. 45 88 Replacing some Draw() calls by DrawCopy() has solved the problem. 89 46 90 47 91 -
trunk/MagicSoft/Mars/macros/readCT1.C
r2377 r2438 49 49 MParList plist; 50 50 51 MGeomCamCT1 geomcam;52 51 MHillas hillas; 53 52 MHillasExt hillasext; … … 67 66 MHillasCalc hcalc; 68 67 68 geomapl.SetGeometry("MGeomCamCT1"); 69 69 70 tlist.AddToList(&read); 70 71 tlist.AddToList(&clone); … … 77 78 if (!evtloop.PreProcess()) 78 79 return; 80 81 MGeomCam *geomcam = (MGeomCam*)plist->FindObject("MGeomCam"); 79 82 80 83 Int_t icount = 0; -
trunk/MagicSoft/Mars/macros/readMagic.C
r2377 r2438 96 96 return; 97 97 98 MHCamera display1(geomcam); 99 MHCamera display2(geomcam); 98 MGeomCam *geomcam = (MGeomCam*)plist->FindObject("MGeomCam"); 99 100 MHCamera display1(*geomcam); 101 MHCamera display2(*geomcam); 100 102 101 103 TCanvas c("Events", "Real Events", 300, 600); -
trunk/MagicSoft/Mars/macros/tar.C
r1323 r2438 21 21 gSystem->cd(".."); 22 22 23 TString cmd = "tar cvf "+name+".tar --exclude=Root "+name+"/.rootrc "+name+"/*";23 TString cmd = "tar cvf "+name+".tar --exclude=Root Tag "+name+"/.rootrc "+name+"/*"; 24 24 25 25 cout << "Executing: " << cmd << endl; -
trunk/MagicSoft/Mars/manalysis/MGeomApply.cc
r2380 r2438 74 74 // -------------------------------------------------------------------------- 75 75 // 76 // Give the name of the geometry you want to have, eg. MGeomCamCT177 //78 MGeomApply::MGeomApply(const TString cam, const char *name, const char *title) : fGeomName(cam)79 {80 fName = name ? name : "MGeomApply";81 fTitle = title ? title : "Task to apply geometry settings";82 }83 84 // --------------------------------------------------------------------------85 //86 76 // Try to find 'MGeomCam' in the Parameter List. If it is not found, 87 77 // try to create a fGeomName object. -
trunk/MagicSoft/Mars/manalysis/MGeomApply.h
r2380 r2438 20 20 public: 21 21 MGeomApply(const char *name=NULL, const char *title=NULL); 22 MGeomApply(const TString name, const char *name=NULL, const char *title=NULL); 22 23 void SetGeometry(TString geom) { fGeomName = geom; } 23 24 24 25 ClassDef(MGeomApply, 0) // Task to apply geometry settings -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r2416 r2438 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>18 ! Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 120 ! Copyright: MAGIC Software Development, 2000-2003 21 21 ! 22 22 ! … … 78 78 #include <TSystem.h> // gSystem 79 79 #include <TStopwatch.h> 80 #include <TGProgressBar.h> 80 #include <TGProgressBar.h> 81 81 82 82 #include "MLog.h" … … 191 191 fProgress=NULL; 192 192 else 193 { 193 194 d->SetBit(kMustCleanup); 195 196 // Get pointer to update Progress bar 197 fProgress = fDisplay->GetBar(); 198 } 194 199 195 200 if (fParList) … … 237 242 // Lock display to prevent user from deleting it 238 243 fDisplay->Lock(); 239 // Get pointer to update Progress bar240 fProgress = fDisplay->GetBar();241 244 // Don't display context menus 242 245 fDisplay->SetNoContextMenu(); … … 267 270 } 268 271 269 Bool_t MEvtLoop::ProcessGuiEvents(Int_t num , Int_t entries)272 Bool_t MEvtLoop::ProcessGuiEvents(Int_t num) 270 273 { 271 274 if (gROOT->IsBatch()) … … 347 350 txt += " ("; 348 351 txt += speed; 349 txt += "Evts/s, est: "; 350 txt += (int)((long int)(t0-t2)*entries/(60000.*(num-start))); 351 txt += "m"; 352 txt += "Evts/s"; 353 if (fNumEvents>0) 354 { 355 txt += ", est: "; 356 txt += (int)((long int)(t0-t2)*fNumEvents/(60000.*(num-start))); 357 txt += "m"; 358 } 352 359 //txt += (int)fmod(entries/(1000.*(num-start)/(long int)(t0-t2)), 60); 353 360 //txt += "s"; … … 362 369 // Set new progress bar position 363 370 // 364 if (fProgress )365 fProgress->SetPosition(num );371 if (fProgress && fNumEvents>0) 372 fProgress->SetPosition(num/fNumEvents); 366 373 367 374 // … … 409 416 410 417 Int_t entries = INT_MAX; 418 fNumEvents = 0; 411 419 412 420 if (fProgress && !gROOT->IsBatch()) 413 421 { 414 422 fProgress->Reset(); 423 fProgress->SetRange(0, 1); 424 415 425 #ifdef __MARS__ 416 426 // limits.h … … 421 431 422 432 if (maxcnt>0) 423 f Progress->SetRange(0, TMath::Min(maxcnt, entries));433 fNumEvents = TMath::Min(maxcnt, entries); 424 434 else 425 435 if (entries!=INT_MAX) 426 f Progress->SetRange(0, entries);436 fNumEvents = entries; 427 437 } 428 438 … … 454 464 { 455 465 numcnts++; 456 if (!ProcessGuiEvents(++dummy , entries))466 if (!ProcessGuiEvents(++dummy)) 457 467 break; 458 468 } … … 462 472 { 463 473 numcnts++; 464 if (!ProcessGuiEvents(maxcnt - dummy , entries))474 if (!ProcessGuiEvents(maxcnt - dummy)) 465 475 break; 466 476 } … … 473 483 if (fProgress && !gROOT->IsBatch()) 474 484 { 475 fProgress->SetPosition(maxcnt>0 ? TMath::Min(maxcnt, entries) : entries); 485 //fProgress->SetPosition(maxcnt>0 ? TMath::Min(maxcnt, entries) : entries); 486 fProgress->SetPosition(1); 476 487 // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents 477 488 if (gApplication->InheritsFrom(TRint::Class())) -
trunk/MagicSoft/Mars/mbase/MEvtLoop.h
r2299 r2438 30 30 TGProgressBar *fProgress; //! 31 31 32 ULong_t fNumEvents; //! 33 32 34 enum { kIsOwner = BIT(14) }; 33 35 … … 37 39 void StreamPrimitive(ofstream &out) const; 38 40 39 Bool_t ProcessGuiEvents(Int_t num , Int_t entries);41 Bool_t ProcessGuiEvents(Int_t num); 40 42 41 43 public: -
trunk/MagicSoft/Mars/mbase/MReadSocket.cc
r2386 r2438 30 30 ////////////////////////////////////////////////////////////////////////////// 31 31 #include "MReadSocket.h" 32 33 /*34 #ifdef _REENTRANT35 #include <pthread.h>36 #endif37 */38 32 39 33 #include <unistd.h> // usleep … … 155 149 int MReadSocket::underflow() 156 150 { 151 if (fail()) 152 { 153 setg(fBuffer, fBuffer, fBuffer+fMtu); 154 return 0; 155 } 156 157 157 // 158 158 // This simple trick should do its job, because the … … 161 161 const TTime timeout = fTimeout+gSystem->Now(); 162 162 163 Int_t l , len=-1;163 Int_t len=-1; 164 164 while (len<0 && gSystem->Now()<timeout) 165 165 { 166 Int_t l; 166 167 fRxSocket->GetOption(kBytesToRead, l); 167 168 if (l==0) 168 169 { 169 usleep(1);170 gSystem->Sleep(1); 170 171 continue; 171 172 } … … 177 178 cout << "MReadSocket: TSocket::RecvRaw - Connection timed out." << endl; 178 179 setstate(ios::failbit); 180 memset(fBuffer, 0, fMtu); 181 len = fMtu; 179 182 } 180 183 -
trunk/MagicSoft/Mars/mbase/MTime.h
r2386 r2438 76 76 } 77 77 78 void SetTime(ULong_t t) 79 { 80 // t [millisec] 81 fNanoSec = (t*1000000)%1000; 82 t /= 1000; 83 fSec = t%60; 84 t /= 60; 85 fMin = t%60; 86 t /= 60; 87 fHour = t%24; 88 } 89 90 void SetTime(Double_t t) 91 { 92 // t [s] 93 fNanoSec = (UInt_t)(fmod(t, 1)*1e9); 94 fSec = (Byte_t)fmod(t, 60); 95 t /= 60; 96 fMin = (Byte_t)fmod(t, 60); 97 t /= 60; 98 fHour = (Byte_t)fmod(t, 24); 99 } 100 78 101 void SetTime(Byte_t h, Byte_t m, Byte_t s, UShort_t ns) 79 102 { … … 112 135 return fNanoSec/1e9+(fHour*24*60*60+fMin*60+fSec); 113 136 } 137 double operator()() const //[s] 138 { 139 return operator double(); 140 } 114 141 115 142 ClassDef(MTime, 1) //A generalized MARS time stamp … … 118 145 inline Double_t operator-(MTime &t1, MTime &t2) 119 146 { 120 return (Double_t)t1.GetTimeLo()-(Double_t)t2.GetTimeLo();147 return t1()-t2(); 121 148 } 122 149 123 150 inline Bool_t operator<(MTime &t1, MTime &t2) 124 151 { 125 return (t1.GetTimeHi()<=t2.GetTimeHi()) && (t1.GetTimeLo()<t2.GetTimeLo());152 return t1()<t2(); 126 153 } 127 154 128 155 inline Bool_t operator>(MTime &t1, MTime &t2) 129 156 { 130 return (t1.GetTimeHi()>=t2.GetTimeHi()) && (t1.GetTimeLo()>t2.GetTimeLo());157 return t1()>t2(); 131 158 } 132 159 133 160 inline Bool_t operator<=(MTime &t1, MTime &t2) 134 161 { 135 return (t1.GetTimeHi()<=t2.GetTimeHi()) && (t1.GetTimeLo()<=t2.GetTimeLo());162 return t1<=t2(); 136 163 } 137 164 138 165 inline Bool_t operator>=(MTime &t1, MTime &t2) 139 166 { 140 return (t1.GetTimeHi()>=t2.GetTimeHi()) && (t1.GetTimeLo()>=t2.GetTimeLo());167 return t1()>=t2(); 141 168 } 142 169 143 170 inline Bool_t operator==(MTime &t1, MTime &t2) 144 171 { 145 return (t1.GetTimeLo()==t2.GetTimeLo()) && (t1.GetTimeHi()==t2.GetTimeHi());172 return t1()==t2(); 146 173 } 147 174 -
trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc
r2416 r2438 217 217 fDist->Draw(); 218 218 219 delete pad->GetPad(3); 220 219 221 pad->cd(4); 220 222 gPad->SetBorderMode(0); -
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r2416 r2438 215 215 // <index> The pixel with the given index is drawn 216 216 // 217 #include <TVirtualPad.h> 217 218 void MRawEvtData::Draw(Option_t *opt) 218 219 { … … 300 301 { 301 302 // FIXME: Add Legend 302 *fLog << inf << "Drawing Histogram of Pixel with Idx #" << dec << pix.GetPixelId() << endl;303 *fLog << inf << "Drawing Histogram of Pixel with Idx #" << dec << pix.GetPixelId() << " to " << gPad << endl; 303 304 304 305 TH1F *histh = new TH1F(name, "FADC Samples", nh, -0.5, nh-.5);
Note:
See TracChangeset
for help on using the changeset viewer.