Changeset 1911 for trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc
- Timestamp:
- 04/07/03 16:08:03 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc
r1800 r1911 91 91 WARNING: 92 92 Bacause of some strage and hidden dependencies the 93 GetMai Frame call in the destructor of TGButton may fail if some93 GetMainFrame call in the destructor of TGButton may fail if some 94 94 of the other gui elemts is deleted first. 95 95 AddFirst adds the buttons at the beginning of the deletion list, … … 279 279 void MMonteCarlo::CalculateTriggerRate() 280 280 { 281 // This macro has two input parameter:281 // 282 282 // dim : = 0 -> root file with 1 trigger condition. 283 283 // > 0 -> number of trigger condition to be analised … … 285 285 // < 0 -> selects the -dim trigger condition. 286 286 // 287 // first we have to create our empty lists288 //289 287 const Int_t dim = GetDim(); 290 288 … … 294 292 // 295 293 // Setup the parameter list. 296 // - we do not need to create any other container. All of them297 // are created automatically without loss - we don't have to298 // access them-299 //300 // - we need to create MHMcRate only. The other containers301 // are created automatically without loss - we don't have to302 // access them-303 // - MHMcRate must be created by us because we need the pointer304 // to it and if it would get created automatically it would also be305 // deleted automatically306 // - Actually, depending on using a single trigger option MonteCarlo307 // file or a multyple trigger option, a MHMcRate or an array of308 // MHMcRate are needed.309 294 // 310 295 plist.AddToList(&tlist); 311 296 312 //313 // You don't have to add the MHMcRate container here by hand.314 // But if you want to print or display these containers later on315 // it is necessary (Rem: No printing or displaying is done in this316 // macro yet)317 //318 297 const UInt_t from = dim>0 ? 1 : -dim; 319 298 const UInt_t to = dim>0 ? dim : -dim; … … 334 313 // produced with the trigger_loop option. 335 314 // 336 337 315 if (dim < 0) 338 ((MHMcRate*)(hists[0]))->SetTriggerCondNum((Short_t)(-dim));339 else if (dim > 0)340 for (Short_t i = from ; i <=to; i++)341 316 ((MHMcRate*)(hists[0]))->SetTriggerCondNum(to); 317 else 318 for (UInt_t i=from; i<=to; i++) 319 ((MHMcRate*)(hists[i-1]))->SetTriggerCondNum(i); 342 320 343 321 // … … 393 371 DestroyProgressBar(bar); 394 372 373 delete BgR; 374 395 375 if (!rc) 396 376 return; … … 403 383 const Int_t dim = GetDim(); 404 384 405 //406 // This macro fill the container MHMcEnergies using the task407 // MMcThresholdCalc and shows the results.408 //409 385 MParList plist; 410 386 411 387 MTaskList tlist; 412 388 plist.AddToList(&tlist); 413 414 //415 // Setup the parameter list416 // - You need create the container MHMcEnergies.417 // + You need to put the number of trigger conditions when418 // you declarete the MHMcEnergies419 // + If you don't put any dimension to MHMcEnergies it works420 // taking only the trigger information from MMcTrig421 //422 389 423 390 // … … 453 420 // 454 421 // Setup the task list 455 // - You need the read and the MMcThresholdCalc tasks 456 // - You have to fill the histograms for the Energy threshold 457 // + You need to put the number of trigger conditions when 458 // you declarete the MMcThresholdCalc 459 // + If you don't put any dimension to MMcThresholdCalc it works 460 // like one dimension MMcThresholdCalc 461 // 462 422 // 463 423 MReadTree read("Events", fInputFile); 464 424 … … 492 452 // Now you can display the results 493 453 // 494 TIter Next(&hists); 495 TObject *obj; 496 while ((obj=Next())) 497 obj->DrawClone(); 454 hists.ForEach(TObject, DrawClone)(); 498 455 } 499 456
Note:
See TracChangeset
for help on using the changeset viewer.