Changeset 2563 for trunk/MagicSoft/Mars
- Timestamp:
- 11/23/03 21:18:30 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2557 r2563 4 4 5 5 -*-*- END OF LINE -*-*- 6 2003/11/23: Thomas Bretz 7 8 * star.cc: 9 - fixed a typo 10 11 * manalysis/MCerPhotCalc.cc: 12 - fixed logging stream 13 14 * mbase/MStatusDisplay.[h,cc]: 15 - made fLog available to derived classes 16 - added Reset()-function 17 - added some debug messages to CloseWindow() 18 - put 'return' back into HandleConfigureNotify (fixes the 19 problem with the random size of the Mona display) 20 - added a new workaround in HandleEvent which fixed a crash 21 when switching back to the 'main' tab in MEventDisplay 22 This is NOT understood! 23 - changed bit 14/15 to 15/16. BIT(14) is used in TGMainFrame 24 already 25 26 * mfilter/MFRealTimePeriod.h: 27 - added Setter for timeout 28 29 * mhist/MHCamEvent.cc: 30 - fill the rms for each event. This may be switched off by 31 a status bit in the future for speed reasons. 32 33 * mhist/MHCamera.[h,cc]: 34 - removed Profile() from GetMaximum/GetMinimum if no 35 autoscale is done 36 - added 'content' Draw option 37 38 * mhist/MHEvent.cc: 39 - fixed a typo: GetNumEvents() --> GetRunNumber() 40 41 * mhist/MHTriggerLvl0.cc: 42 - small changes to output 43 44 * mraw/MRawSocketRead.[h,cc]: 45 - renamed fRawEvtTime to fTime 46 - changed 'MRawEvtTime' to 'MTime' 47 - added some debugging output in case of kContinue 48 49 50 6 51 2003/11/22: Thomas Bretz 7 52 -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
r2470 r2563 97 97 if (!fRunHeader) 98 98 { 99 *fLog << dbginf<< "MRawRunHeader not found... aborting." << endl;99 *fLog << err << "MRawRunHeader not found... aborting." << endl; 100 100 return kFALSE; 101 101 } … … 104 104 if (!fRawEvt) 105 105 { 106 *fLog << dbginf<< "MRawEvtData not found... aborting." << endl;106 *fLog << err << "MRawEvtData not found... aborting." << endl; 107 107 return kFALSE; 108 108 } … … 111 111 if (!fPedestals) 112 112 { 113 *fLog << dbginf<< "MPedestalCam not found... aborting." << endl;113 *fLog << err << "MPedestalCam not found... aborting." << endl; 114 114 return kFALSE; 115 115 } -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
r2550 r2563 560 560 // 561 561 MStatusDisplay::MStatusDisplay(Long_t t) 562 : TGMainFrame(NULL, 1, 1), f Tab(NULL), fTimer(this, t, kTRUE), fStatus(kLoopNone), fLog(&gLog), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL), fIsLocked(0)562 : TGMainFrame(NULL, 1, 1), fLog(&gLog), fTab(NULL), fTimer(this, t, kTRUE), fStatus(kLoopNone), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL), fIsLocked(0) 563 563 { 564 564 // p==NULL means: Take gClient->GetRoot() if not in batch mode … … 587 587 fList = new MGList; 588 588 fList->SetOwner(); 589 590 //591 // set the smallest and biggest size of the Main frame592 // and move it to its appearance position593 SetWMSizeHints(570, 480, 1280, 980, 1, 1);594 Move(rand()%100+50, rand()%100+50);595 Resize(570, 480);596 589 597 590 // … … 612 605 AddStatusBar(); 613 606 } 607 608 // 609 // set the smallest and biggest size of the Main frame 610 // and move it to its appearance position 611 SetWMSizeHints(570, 480, 1280, 980, 1, 1); 612 MoveResize(rand()%100+570, rand()%100+480, 570, 480); 614 613 615 614 // … … 1052 1051 */ 1053 1052 1053 void MStatusDisplay::Reset() 1054 { 1055 for (int i=fTab->GetNumberOfTabs()-1; i>0; i--) 1056 RemoveTab(i); 1057 } 1058 1054 1059 // -------------------------------------------------------------------------- 1055 1060 // … … 1077 1082 1078 1083 case kFileReset: 1079 for (int i=fTab->GetNumberOfTabs()-1; i>0; i--) 1080 RemoveTab(i); 1084 Reset(); 1081 1085 return kTRUE; 1082 1086 /* … … 1217 1221 switch (submsg) 1218 1222 { 1219 case kCM_MENU: 1223 case kCM_MENU: // 1 1220 1224 return ProcessMessageCommandMenu(mp1); // mp2=userdata 1221 case kCM_TAB: 1225 case kCM_TAB: // 8 1222 1226 /* 1223 1227 for (int i=0; i<fTab->GetNumberOfTabs(); i++) … … 1238 1242 return kTRUE; 1239 1243 #ifdef DEBUG 1240 case kCM_MENUSELECT: 1244 case kCM_MENUSELECT: // 2 1241 1245 cout << "Command-Menuselect #" << mp1 << " (UserData=" << (void*)mp2 << ")" << endl; 1242 1246 return kTRUE; 1243 1247 1244 case kCM_BUTTON: 1248 case kCM_BUTTON: // 3 1245 1249 cout << "Command-Button." << endl; 1246 1250 return kTRUE; 1247 1251 1248 case kCM_CHECKBUTTON: 1252 case kCM_CHECKBUTTON: // 4 1249 1253 cout << "Command-CheckButton." << endl; 1250 1254 return kTRUE; 1251 1255 1252 case kCM_RADIOBUTTON: 1256 case kCM_RADIOBUTTON: // 5 1253 1257 cout << "Command-RadioButton." << endl; 1254 1258 return kTRUE; 1255 1259 1256 case kCM_LISTBOX: 1260 case kCM_LISTBOX: // 6 1257 1261 cout << "Command-Listbox #" << mp1 << " (LineId #" << mp2 << ")" << endl; 1258 1262 return kTRUE; 1259 1263 1260 case kCM_COMBOBOX: 1264 case kCM_COMBOBOX: // 7 1261 1265 cout << "Command-ComboBox." << endl; 1262 1266 return kTRUE; … … 1351 1355 { 1352 1356 // Can be found in WidgetMessageTypes.h 1357 #ifdef DEBUG 1353 1358 cout << "Msg: " << GET_MSG(msg) << " Submsg:" << GET_SUBMSG(msg); 1354 1359 cout << " Mp1=" << mp1 << " Mp2=" << mp2 << endl; 1360 #endif 1355 1361 switch (GET_MSG(msg)) 1356 1362 { 1357 case kC_COMMAND: 1363 case kC_COMMAND: // 1 1358 1364 return ProcessMessageCommand(GET_SUBMSG(msg), mp1, mp2); 1359 1365 1360 case kC_TEXTVIEW: 1366 case kC_TEXTVIEW: // 9 1361 1367 return ProcessMessageTextview(GET_SUBMSG(msg), mp1, mp2); 1362 1368 1363 case kC_USER: 1369 case kC_USER: // 1001 1364 1370 return ProcessMessageUser(GET_SUBMSG(msg), mp1, mp2); 1365 1371 } … … 1387 1393 gLog << dbg << "MStatusDisplay is on heap: " << (int)IsOnHeap() << endl; 1388 1394 1389 if (TestBit(kExitLoopOnExit)) 1395 if (TestBit(kExitLoopOnExit) || TestBit(kExitLoopOnClose)) 1396 { 1397 gLog << dbg << "CloseWindow() calling ExitLoop." << endl; 1390 1398 gSystem->ExitLoop(); 1391 if (TestBit(kExitLoopOnClose)) 1392 gSystem->ExitLoop(); 1399 } 1393 1400 1394 1401 if (fIsLocked<=0 && IsOnHeap()) 1402 { 1403 gLog << dbg << "delete MStatusDisplay;" << endl; 1395 1404 delete this; 1405 } 1396 1406 fStatus = kFileExit; 1407 gLog << dbg << "MStatusDisplay.fStatus=kFileExit;" << endl; 1397 1408 } 1398 1409 … … 2117 2128 */ 2118 2129 2119 //Bool_t wchanged = w!=GetWidth();2130 Bool_t wchanged = w!=GetWidth(); 2120 2131 Bool_t hchanged = h!=GetHeight(); 2121 /* 2132 2122 2133 if (!wchanged && !hchanged) 2123 2134 { 2124 2135 Layout(); 2125 2136 // FIXME: Make sure that this doesn't result in endless loops. 2126 //return kTRUE;2127 } 2128 */ 2137 return kTRUE; 2138 } 2139 2129 2140 2130 2141 if (GetWidth()==1 && GetHeight()==1) … … 2149 2160 Bool_t MStatusDisplay::HandleEvent(Event_t *event) 2150 2161 { 2162 #if ROOT_VERSION_CODE == ROOT_VERSION(3,05,07) 2163 // Strange... crashes on the LP machines... 2164 if (event->fType==kClientMessage) 2165 if (event->fHandle == gROOT_MESSAGE) 2166 if (event->fUser[0]==264 && event->fUser[1] == 0 && event->fUser[2]==0) 2167 return kTRUE; 2168 #endif 2169 2151 2170 Bool_t rc = TGMainFrame::HandleEvent(event); 2152 2171 -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.h
r2550 r2563 56 56 enum 57 57 { 58 kExitLoopOnExit = BIT(14), 59 kExitLoopOnClose = BIT(15) 58 // TGMainFrame::kDontCallClose = BIT(14) 59 kExitLoopOnExit = BIT(15), 60 kExitLoopOnClose = BIT(16) 60 61 }; 61 62 62 63 protected: 64 MLog *fLog; 63 65 MGList *fList; 64 66 TGCompositeFrame *fUserFrame; … … 80 82 TString fPrinter; 81 83 82 MLog *fLog;83 84 Int_t fLogIdx; 84 85 TTimer fLogTimer; … … 179 180 void UnLock() { if (fIsLocked>0) fIsLocked--; } 180 181 182 void Reset(); 183 181 184 Bool_t CheckTabForCanvas(int num) const; 182 185 -
trunk/MagicSoft/Mars/mfilter/MFRealTimePeriod.h
r2490 r2563 21 21 } 22 22 23 void SetTime(UInt_t millis) { fMilliSec = millis; } 24 23 25 Int_t Process(); 24 26 Bool_t IsExpressionTrue() const { return fResult; } -
trunk/MagicSoft/Mars/mhist/MHCamEvent.cc
r2550 r2563 124 124 if (!evt) 125 125 { 126 *fLog << err << dbginf << " No MCamEvent found..." << endl;126 *fLog << err << dbginf << "Got no MCamEvent as argument of Fill()..." << endl; 127 127 return kFALSE; 128 128 } 129 129 fSum->AddCamContent(*evt, fType); 130 130 fRms->SetCamContent(*fSum, 1); 131 131 return kTRUE; 132 132 } … … 138 138 Bool_t MHCamEvent::Finalize() 139 139 { 140 fRms->AddCamContent(*fSum, 1);140 //fRms->AddCamContent(*fSum, 1); 141 141 return kTRUE; 142 142 } -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r2557 r2563 299 299 { 300 300 if (fMinimum != -1111) 301 return Profile(fMinimum);301 return fMinimum; 302 302 303 303 if (fNcells<=1) … … 329 329 { 330 330 if (fMaximum!=-1111) 331 return Profile(fMaximum);331 return fMaximum; 332 332 333 333 if (fNcells<=1) … … 359 359 // To draw a camera into its own pad do something like: 360 360 // 361 // MGeomCamMagic m; 362 // MHCamera *d=new MHCamera(m); 363 // 364 // TCanvas *c = new TCanvas; 365 // c->Divide(2,1); 366 // c->cd(1); 367 // 368 // d->FillRandom(); 369 // d->Draw(); 370 // d->SetBit(kCanDelete); 361 // MGeomCamMagic m; 362 // MHCamera *d=new MHCamera(m); 363 // 364 // TCanvas *c = new TCanvas; 365 // c->Divide(2,1); 366 // c->cd(1); 367 // 368 // d->FillRandom(); 369 // d->Draw(); 370 // d->SetBit(kCanDelete); 371 // 372 // There are several drawing options: 373 // 'hist' Draw as a standard TH1 histogram (value vs. pixel index) 374 // 'box' Draw hexagons which size is in respect to its contents 375 // 'nocol' Leave the 'boxed' hexagons empty 376 // 'pixelindex' Display the pixel index in each pixel 377 // 'sectorindex' Display the sector index in each pixel 378 // 'content' Display the relative content aligned to GetMaximum() and 379 // GeMinimum() ((val-min)/(max-min)) 371 380 // 372 381 void MHCamera::Draw(Option_t *option) … … 570 579 571 580 if (opt.Contains("pixelindex")) 572 PaintIndices( kFALSE);581 PaintIndices(0); 573 582 if (opt.Contains("sectorindex")) 574 PaintIndices(kTRUE); 583 PaintIndices(1); 584 if (opt.Contains("content")) 585 PaintIndices(2); 575 586 } 576 587 … … 632 643 } 633 644 634 void MHCamera::PaintIndices( Bool_t sector)645 void MHCamera::PaintIndices(Int_t type) 635 646 { 636 647 if (fNcells<=1) 648 return; 649 650 const Double_t min = GetMinimum(); 651 const Double_t max = GetMaximum(); 652 653 if (type==2 && max==min) 637 654 return; 638 655 … … 646 663 647 664 TString num; 648 num += sector ? h.GetSector() : i; 665 switch (type) 666 { 667 case 0: num += i; break; 668 case 1: num += h.GetSector(); break; 669 case 2: num += (Int_t)((fArray[i+1]-min)/(max-min)); break; 670 } 649 671 650 672 txt.SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()/1.05); -
trunk/MagicSoft/Mars/mhist/MHCamera.h
r2557 r2563 30 30 public: 31 31 enum { 32 kProfile = BIT(18), 32 kProfile = BIT(18), // FIXME: When changing change max/min! 33 33 kFreezed = BIT(19), 34 34 kNoLegend = BIT(20) … … 59 59 Int_t GetColor(Float_t val, Float_t min, Float_t max, Bool_t islog); 60 60 61 void PaintIndices( Bool_t sector);61 void PaintIndices(Int_t type); 62 62 void Update(Bool_t islog, Bool_t isbox, Bool_t iscol); 63 63 void UpdateLegend(Float_t min, Float_t max, Bool_t islog); -
trunk/MagicSoft/Mars/mhist/MHEvent.cc
r2529 r2563 200 200 { 201 201 s += "Run #"; 202 s += fRawRunHeader->Get NumEvents();202 s += fRawRunHeader->GetRunNumber(); 203 203 } 204 204 -
trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.cc
r2550 r2563 126 126 if (!evt) 127 127 { 128 *fLog << err << dbginf << " No MCamEvent found..." << endl;128 *fLog << err << dbginf << "Got no MCamEvent as argument of Fill()..." << endl; 129 129 return kFALSE; 130 130 } -
trunk/MagicSoft/Mars/mraw/MRawSocketRead.cc
r2529 r2563 39 39 // MRawEvtData 40 40 // MRawCrateArray 41 // M RawEvtTime41 // MTime 42 42 // 43 43 ////////////////////////////////////////////////////////////////////////////// … … 147 147 // MRawEvtData <output> if not found it is created 148 148 // MRawCrateArray <output> if not found it is created 149 // M RawEvtTime <output> if not found it is created (MTime)149 // MTime <output> if not found it is created 150 150 // 151 151 // If all containers are found or created the run header is read from the … … 180 180 return kFALSE; 181 181 182 f RawEvtTime = (MTime*)pList->FindCreateObj("MTime", "MRawEvtTime");183 if (!f RawEvtTime)182 fTime = (MTime*)pList->FindCreateObj("MTime"); 183 if (!fTime) 184 184 return kTRUE; 185 185 … … 268 268 269 269 if (atoi(size)==fRawRunHeader->GetNumTotalBytes()) 270 { 271 *fLog << dbg << "Event contains only run header information... skipped." << endl; 270 272 return kCONTINUE; 273 } 271 274 272 275 // 273 276 // Give the run header information to the 'sub-classes' 274 277 // 275 fRawEvtHeader->Init(fRawRunHeader, f RawEvtTime);278 fRawEvtHeader->Init(fRawRunHeader, fTime); 276 279 fRawEvtData ->Init(fRawRunHeader); 277 280 … … 317 320 // 318 321 if (fEvtNumber==fRawEvtHeader->GetDAQEvtNumber()) 322 { 323 *fLog << dbg << "Event number #" << dec << fEvtNumber << " didn't change... skipped." << endl; 319 324 return kCONTINUE; 325 } 320 326 321 327 fEvtNumber=fRawEvtHeader->GetDAQEvtNumber(); -
trunk/MagicSoft/Mars/mraw/MRawSocketRead.h
r2490 r2563 21 21 MRawEvtData *fRawEvtData; // raw evt header infomation container to fill from file 22 22 MRawCrateArray *fRawCrateArray; // crate information array container to fill from file 23 MTime *f RawEvtTime;// raw evt time information container to fill from file23 MTime *fTime; // raw evt time information container to fill from file 24 24 25 25 MReadSocket *fIn; //! buffered input stream (file to read from) -
trunk/MagicSoft/Mars/star.cc
r2562 r2563 52 52 gLog << all << endl; 53 53 gLog << "Sorry the usage is:" << endl; 54 gLog << " star [-a0] [-vn] [-cn] inputfile[.roo r] outputfile[.root]" << endl << endl;54 gLog << " star [-a0] [-vn] [-cn] inputfile[.root] outputfile[.root]" << endl << endl; 55 55 gLog << " input file: Merpped or MC root file." << endl; 56 56 gLog << " ouput file: Star-file (image parameter file)" << endl;
Note:
See TracChangeset
for help on using the changeset viewer.