Changeset 1030 for trunk/MagicSoft/Mars/mmain
- Timestamp:
- 11/05/01 10:35:36 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mmain
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmain/MAnalysis.cc
r1021 r1030 31 31 #include <TGButton.h> // TGTextButton 32 32 #include <TGTextEntry.h> // TGNumberEntry 33 #include <TGProgressBar.h> // TGHProgressBar34 35 33 36 34 ClassImp(MAnalysis) … … 48 46 fList->Add(hillas); 49 47 50 TGLayoutHints *laybut = new TGLayoutHints(kLHints Top|kLHintsLeft, 10, 10, 5, 5);48 TGLayoutHints *laybut = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 10, 10, 5, 5); 51 49 fList->Add(laybut); 52 50 … … 209 207 } 210 208 211 TGHProgressBar bar(fTop2);212 TGLayoutHints laybar(kLHintsExpandX|kLHintsCenterY|kLHintsRight, 10, 10, 5, 5); //, 10); //, 5, 5);213 bar.SetWidth(150);214 fTop2->AddFrame(&bar, &laybar);215 Layout();216 MapSubwindows();217 218 209 // 219 210 // Create a empty Parameter List and an empty Task List … … 252 243 // 253 244 MReadTree read("Events", fInputFile); 254 read.SetProgressBar(&bar);255 245 256 246 MCerPhotCalc ncalc; … … 277 267 MEvtLoop evtloop; 278 268 evtloop.SetParList(&plist); 279 evtloop.SetProgressBar(&bar); 269 270 // 271 // Add ProgressBar to window 272 // 273 TGProgressBar *bar = CreateProgressBar(fTop2); 274 read.SetProgressBar(bar); 275 evtloop.SetProgressBar(bar); 276 280 277 // 281 278 // Execute your analysis … … 283 280 Bool_t rc = evtloop.Eventloop(); 284 281 285 fTop2->RemoveFrame(&bar); 286 Layout(); 287 MapSubwindows(); 282 // 283 // Remove progressbar from window 284 // 285 DestroyProgressBar(bar); 288 286 289 287 if (!rc) -
trunk/MagicSoft/Mars/mmain/MBrowser.cc
r952 r1030 34 34 #include <TGListBox.h> // TGListBox 35 35 #include <TGComboBox.h> // TGComboBox 36 #include <TGProgressBar.h> // TGHProgressBar 36 37 #include <TGFSContainer.h> // TGFileContainer 37 38 … … 80 81 void MBrowser::CreateUpperFrame(TGCompositeFrame *frametop) 81 82 { 83 TGLayoutHints *lay1 = new TGLayoutHints(kLHintsTop |kLHintsExpandX, 2, 2, 2, 0); 84 TGLayoutHints *lay2 = new TGLayoutHints(kLHintsCenterY|kLHintsExpandX, 2, 2, 2, 2); 85 TGLayoutHints *lay3 = new TGLayoutHints(kLHintsBottom |kLHintsExpandX, 2, 2, 0, 2); 86 fList->Add(lay1); 87 fList->Add(lay2); 88 fList->Add(lay3); 82 89 83 90 // 84 91 // *********** Create Contents of frame top (upper part) ********** 85 92 // 86 fTop1 = new TGHorizontalFrame(frametop, 300, 100); 87 fTop2 = new TGHorizontalFrame(frametop, 300, 100); 88 fTop3 = new TGHorizontalFrame(frametop, 300, 100); 89 90 frametop->AddFrame(fTop1); 91 frametop->AddFrame(fTop2); 92 frametop->AddFrame(fTop3); 93 fTop1 = new TGHorizontalFrame(frametop, 500, 50); 94 fTop2 = new TGHorizontalFrame(frametop, 500, 50); 95 fTop3 = new TGHorizontalFrame(frametop, 500, 50); 96 97 // FIXME: If I use TGLayoutHints the Progress Bar doesn't disappear! 98 frametop->AddFrame(fTop1);//, lay1); 99 frametop->AddFrame(fTop2);//, lay2); 100 frametop->AddFrame(fTop3);//, lay3); 93 101 94 102 fList->Add(fTop1); … … 271 279 // ---- Create the top window with a lot of buttons ---- 272 280 // 281 TGLayoutHints *layframetop = new TGLayoutHints(kLHintsExpandX); 282 fList->Add(layframetop); 283 273 284 TGCompositeFrame *frametop = new TGCompositeFrame(this, 300, 100, kVerticalFrame); 274 285 fList->Add(frametop); 275 AddFrame(frametop );286 AddFrame(frametop, layframetop); 276 287 277 288 linesep = new TGHorizontal3DLine(this); … … 297 308 // 298 309 ChangeDir(); 299 SetWMSizeHints(400, 350, 1000, 1000, 10, 10); // set the smallest and biggest size of the Main frame 300 } 301 302 303 // ====================================================================== 304 // ====================================================================== 310 SetWMSizeHints(400, 350, 1000, 1000, 10, 10); // set the smallest and biggest size of the Main frame 311 } 312 305 313 306 314 MBrowser::~MBrowser() … … 313 321 } 314 322 315 // ====================================================================== 316 // ====================================================================== 323 TGProgressBar *MBrowser::CreateProgressBar(TGHorizontalFrame *frame) 324 { 325 static TGLayoutHints laybar(kLHintsCenterY|kLHintsRight/*|kLHintsExpandX*/, 326 10, 10); 327 328 TGHProgressBar *bar=new TGHProgressBar(frame); 329 330 bar->SetWidth(150); 331 bar->ShowPosition(); 332 333 frame->AddFrame(bar, &laybar); 334 335 Layout(); 336 MapSubwindows(); 337 338 return bar; 339 } 340 341 void MBrowser::DestroyProgressBar(TGProgressBar *bar) 342 { 343 TGHorizontalFrame *frame = (TGHorizontalFrame*)bar->GetParent(); 344 345 frame->RemoveFrame(bar); 346 347 Layout(); 348 MapSubwindows(); 349 350 delete bar; 351 } 317 352 318 353 void MBrowser::CloseWindow() … … 326 361 } 327 362 328 329 // ======================================================================330 // ======================================================================331 332 363 Bool_t MBrowser::InputFileSelected() 333 364 { … … 337 368 return fInputFile[0]!='\0'; 338 369 } 339 340 341 // ======================================================================342 // ======================================================================343 370 344 371 void MBrowser::DisplError(const char *txt) -
trunk/MagicSoft/Mars/mmain/MBrowser.h
r1016 r1030 14 14 class TGListView; 15 15 class TGComboBox; 16 class TGProgressBar; 16 17 class TGPictureButton; 17 18 class TGFileContainer; … … 54 55 void ChangeDir(const char *txt=NULL); 55 56 57 TGProgressBar *CreateProgressBar(TGHorizontalFrame *frame); 58 void DestroyProgressBar(TGProgressBar *bar); 59 56 60 TGHorizontalFrame *fTop1; 57 61 TGHorizontalFrame *fTop2; -
trunk/MagicSoft/Mars/mmain/MDataCheck.cc
r1023 r1030 56 56 : MBrowser(main, p, w, h) 57 57 { 58 TGTextButton *pedadc = new TGTextButton(fTop 2, "ADC Spectra of Pedestals", kButPedAdc);59 TGTextButton *cradc = new TGTextButton(fTop 2, "ADC Specta of Cosmics", kButEvtAdc);58 TGTextButton *pedadc = new TGTextButton(fTop1, "ADC Spectra of Pedestals", kButPedAdc); 59 TGTextButton *cradc = new TGTextButton(fTop1, "ADC Specta of Cosmics", kButEvtAdc); 60 60 TGTextButton *pedtdc = new TGTextButton(fTop3, "TDC Spectra of Pedestals", kButPedTdc); 61 61 TGTextButton *crtdc = new TGTextButton(fTop3, "TDC Specta of Cosmics", kButEvtTdc); … … 74 74 fList->Add(laybut); 75 75 76 fTop 2->AddFrame(pedadc, laybut);77 fTop 2->AddFrame(cradc, laybut);76 fTop1->AddFrame(pedadc, laybut); 77 fTop1->AddFrame(cradc, laybut); 78 78 79 79 fTop3->AddFrame(pedtdc, laybut); … … 115 115 plist.AddToList(&tasks); 116 116 117 MReadTree read in(treeName, inputfile);118 tasks.AddToList(&readin);117 MReadTree read(treeName, inputfile); 118 read.DisableAutoScheme(); 119 119 120 MFillH fillspect("MRawEvtData", "MHFadcCam"); 121 tasks.AddToList(&fillspect); 120 MFillH fill("MRawEvtData", "MHFadcCam"); 121 122 tasks.AddToList(&read); 123 tasks.AddToList(&fill); 122 124 123 125 // … … 127 129 magic.SetParList(&plist); 128 130 129 // ADD ProgressBar, TGHProgressBar::ShowStatus(); 131 // 132 // Add ProgressBar to window 133 // 134 TGProgressBar *bar = CreateProgressBar(fTop1); 135 read.SetProgressBar(bar); 136 magic.SetProgressBar(bar); 130 137 131 138 // 132 // start the loop running139 // Execute your analysis 133 140 // 134 if (!magic.Eventloop()) 141 Bool_t rc = magic.Eventloop(300); 142 143 // 144 // Remove progressbar from window 145 // 146 DestroyProgressBar(bar); 147 148 if (!rc) 135 149 return; 136 150 -
trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc
r1016 r1030 32 32 #include <TGButton.h> // TGTextButton 33 33 #include <TGTextEntry.h> // TGTextEntry 34 #include <TGProgressBar.h> // TGHProgressBar 34 35 #include <TGButtonGroup.h> // TGVButtonGroup 35 36 … … 44 45 void MMonteCarlo::AddButtons() 45 46 { 46 TGTextButton *carea = new TGTextButton(fTop 1, "Collection Area", M_BUTTON_COLAREA);47 TGTextButton *trate = new TGTextButton(fTop 1, "Trigger Rate", M_BUTTON_RATE);48 TGTextButton *thold = new TGTextButton(fTop 1, "Threshold", M_BUTTON_THRESHOLD);47 TGTextButton *carea = new TGTextButton(fTop2, "Collection Area", M_BUTTON_COLAREA); 48 TGTextButton *trate = new TGTextButton(fTop2, "Trigger Rate", M_BUTTON_RATE); 49 TGTextButton *thold = new TGTextButton(fTop2, "Threshold", M_BUTTON_THRESHOLD); 49 50 50 51 fList->Add(carea); … … 59 60 fList->Add(laybut); 60 61 61 fTop 1->AddFrame(carea, laybut);62 fTop 1->AddFrame(trate, laybut);63 fTop 1->AddFrame(thold, laybut);62 fTop2->AddFrame(carea, laybut); 63 fTop2->AddFrame(trate, laybut); 64 fTop2->AddFrame(thold, laybut); 64 65 } 65 66 … … 208 209 } 209 210 210 void MMonteCarlo::CalculateCollectionArea() const211 void MMonteCarlo::CalculateCollectionArea() 211 212 { 212 213 // … … 231 232 // - Then we can fill the efficiency histograms 232 233 // 233 MReadTree reader("Events", fInputFile); 234 // reader.UseLeaf("fImpact"); 235 // reader.UseLeaf("fEnergy"); 236 // reader.UseLeaf("fNumFirstLevel"); 237 238 tlist.AddToList(&reader); 234 MReadTree read("Events", fInputFile); 235 tlist.AddToList(&read); 239 236 240 237 MMcCollectionAreaCalc effi; … … 248 245 249 246 // 250 // Start to loop over all events 251 // 252 if (!magic.Eventloop()) 247 // Add ProgressBar to window 248 // 249 TGProgressBar *bar = CreateProgressBar(fTop2); 250 read.SetProgressBar(bar); 251 magic.SetProgressBar(bar); 252 253 // 254 // Execute your analysis 255 // 256 Bool_t rc = magic.Eventloop(); 257 258 // 259 // Remove progressbar from window 260 // 261 DestroyProgressBar(bar); 262 263 if (!rc) 253 264 return; 254 265 … … 260 271 } 261 272 262 void MMonteCarlo::CalculateTriggerRate() const273 void MMonteCarlo::CalculateTriggerRate() 263 274 { 264 275 // This macro has two input parameter: … … 332 343 // analised trigger conditions should be set (BgR[]) 333 344 // 334 MReadTree reader("Events", fInputFile); 335 /* reader.UseLeaf("fImpact"); 336 reader.UseLeaf("fEnergy"); 337 reader.UseLeaf("fPhi"); 338 reader.UseLeaf("fTheta"); 339 reader.UseLeaf("fNumFirstLevel"); 340 reader.UseLeaf("fPhotElfromShower"); 341 */ 342 tlist.AddToList(&reader); 345 MReadTree read("Events", fInputFile); 346 tlist.AddToList(&read); 343 347 344 348 Float_t BgR[10]={660, 4, 0, 0, 0, 0, 0, 0, 0, 0}; … … 354 358 355 359 // 356 // Start to loop over all events 357 // 358 if (!magic.Eventloop()) 360 // Add ProgressBar to window 361 // 362 TGProgressBar *bar = CreateProgressBar(fTop2); 363 read.SetProgressBar(bar); 364 magic.SetProgressBar(bar); 365 366 // 367 // Execute your analysis 368 // 369 Bool_t rc = magic.Eventloop(); 370 371 // 372 // Remove progressbar from window 373 // 374 DestroyProgressBar(bar); 375 376 if (!rc) 359 377 return; 360 378 … … 362 380 } 363 381 364 void MMonteCarlo::CalculateThreshold() const382 void MMonteCarlo::CalculateThreshold() 365 383 { 366 384 const Int_t dim = GetDim(); … … 423 441 // like one dimension MMcThresholdCalc 424 442 // 443 425 444 MReadTree read("Events", fInputFile); 426 /* read.UseLeaf("fEnergy"); 427 read.UseLeaf("fNumFirstLevel"); 428 */ 445 429 446 MMcThresholdCalc calc(dim); 430 447 tlist.AddToList(&read); … … 435 452 436 453 // 437 // Begin the loop (if the loop wasn't successfull 438 // don't try to draw the results 439 // 440 if (!evtloop.Eventloop()) 454 // Add ProgressBar to window 455 // 456 TGProgressBar *bar = CreateProgressBar(fTop2); 457 read.SetProgressBar(bar); 458 evtloop.SetProgressBar(bar); 459 460 // 461 // Execute your analysis 462 // 463 Bool_t rc = evtloop.Eventloop(); 464 465 // 466 // Remove progressbar from window 467 // 468 DestroyProgressBar(bar); 469 470 if (!rc) 441 471 return; 442 472 -
trunk/MagicSoft/Mars/mmain/MMonteCarlo.h
r1016 r1030 20 20 Int_t GetDim() const; 21 21 22 void CalculateCollectionArea() const;23 void CalculateTriggerRate() const;24 void CalculateThreshold() const;22 void CalculateCollectionArea(); 23 void CalculateTriggerRate(); 24 void CalculateThreshold(); 25 25 26 26 void AddButtons();
Note:
See TracChangeset
for help on using the changeset viewer.