Changeset 9309 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 02/09/09 14:14:59 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJSimulation.cc
r9303 r9309 27 27 // MJSimulation 28 28 // 29 // 30 // Force reading a corsika file even if the footer (RUNE-section) is missing 31 // by setting fForceMode to kTRUE or from the resource file by 32 // 33 // ForceMode: Yes 34 // 35 // 36 // In case of a pedestal or calibration run the artificial trigger can 37 // be "switched off" and the cosmics trrigger "switched on" by setting 38 // fForceTrigger to kTRUE or from the resource file by 39 // 40 // ForceTrigger: Yes 41 // 42 // 29 43 ///////////////////////////////////////////////////////////////////////////// 30 44 #include "MJSimulation.h" … … 95 109 // Sets fRuns to 0, fExtractor to NULL, fDataCheck to kFALSE 96 110 // 97 MJSimulation::MJSimulation(const char *name, const char *title) : fForceMode(kFALSE) 111 MJSimulation::MJSimulation(const char *name, const char *title) 112 : fForceMode(kFALSE), fForceTrigger(kFALSE) 98 113 { 99 114 fName = name ? name : "MJSimulation"; … … 103 118 Bool_t MJSimulation::CheckEnvLocal() 104 119 { 105 fForceMode = GetEnv("ForceMode", fForceMode); 120 fForceMode = GetEnv("ForceMode", fForceMode); 121 fForceTrigger = GetEnv("ForceTrigger", fForceTrigger); 106 122 107 123 return kTRUE; … … 231 247 232 248 MRawRunHeader header; 233 header.InitFadcType(3); 249 header.SetValidMagicNumber(); 250 //header.InitFadcType(3); 234 251 235 252 header.SetRunInfo(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTData, 1, 1); … … 237 254 { 238 255 if (!args.GetArgumentStr(0).CompareTo("pedestal", TString::kIgnoreCase)) 256 { 239 257 header.SetRunInfo(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTPedestal, 1, 1); 258 header.SetSourceInfo("Pedestal"); 259 } 240 260 if (!args.GetArgumentStr(0).CompareTo("calibration", TString::kIgnoreCase)) 261 { 241 262 header.SetRunInfo(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTCalibration, 1, 1); 263 header.SetSourceInfo("Calibration"); 264 } 242 265 if (!args.GetArgumentStr(0).CompareTo("pointrun", TString::kIgnoreCase)) 243 266 header.SetRunInfo(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTPointRun, 1, 1); … … 288 311 MBinning binszd( 70, 0, 70, "BinningZd"); 289 312 MBinning binsvc(155, 0, 31, "BinningViewCone"); 290 MBinning binstr(150, -25, 125, "BinningTrigger");291 313 MBinning binsew(150, 0, 25, "BinningEvtWidth"); 314 MBinning binstr("BinningTrigPos"); 292 315 293 316 plist.AddToList(&binse); … … 298 321 plist.AddToList(&binsaz); 299 322 plist.AddToList(&binsvc); 323 plist.AddToList(&binsew); 300 324 plist.AddToList(&binstr); 301 plist.AddToList(&binsew);302 325 303 326 MHn mhn1, mhn2, mhn3; … … 307 330 308 331 MH3 mhtp("TriggerPos.fVal-IntendedPulsePos.fVal-MPulseShape.GetPulseWidth"); 309 mhtp.SetName("Trig ger");332 mhtp.SetName("TrigPos"); 310 333 mhtp.SetTitle("Trigger position w.r.t. the first photon hitting an APD"); 311 334 … … 456 479 hcalc.Disable(MHillasCalc::kCalcConc); 457 480 458 MHCamEvent evt0a(/*10*/0, "Signal", "Average signal;;S [ph]"); 459 MHCamEvent evt0d(/*11*/8, "ArrTm", "Time after first photon;;T [ns]"); 481 MHCamEvent evt0a(/*10*/0, "Signal", "Average signal;;S [ph]"); 482 MHCamEvent evt0c(/*10*/0, "MaxSignal", "Maximum signal;;S [ph]"); 483 MHCamEvent evt0d(/*11*/8, "ArrTm", "Time after first photon;;T [ns]"); 460 484 evt0a.SetErrorSpread(kFALSE); 461 462 MFillH fillx0a(&evt0a, "MSignalCam", "FillSignal"); 485 evt0c.SetCollectMax(); 486 487 MFillH fillx0a(&evt0a, "MSignalCam", "FillAvgSignal"); 488 MFillH fillx0c(&evt0c, "MSignalCam", "FillMaxSignal"); 463 489 MFillH fillx0d(&evt0d, "MSignalCam", "FillArrTm"); 464 490 MFillH fillx1("MHHillas", "MHillas", "FillHillas"); … … 517 543 tasks.AddToList(&simsum); 518 544 tasks.AddToList(&simcam); 519 if (header.IsDataRun() )545 if (header.IsDataRun() || fForceTrigger) 520 546 tasks.AddToList(&simtrig); 521 547 tasks.AddToList(&conttrig); … … 525 551 { 526 552 tasks.AddToList(&write1); 527 tasks.AddToList(&write2); 553 if (!header.IsPedestalRun()) 554 tasks.AddToList(&write2); 528 555 tasks.AddToList(&write3); 529 556 } … … 532 559 tasks.AddToList(&fillh3); 533 560 tasks.AddToList(&filltp); 534 tasks.AddToList(&fillew); 535 tasks.AddToList(&fillx0a); 536 // tasks.AddToList(&clean); 537 tasks.AddToList(&hcalc); 538 tasks.AddToList(&fillx0d); 539 tasks.AddToList(&fillx1); 540 //tasks.AddToList(&fillx2); 541 tasks.AddToList(&fillx3); 542 //tasks.AddToList(&fillx4); 543 //tasks.AddToList(&fillx5); 561 if (header.IsDataRun()) 562 tasks.AddToList(&fillew); 563 if (!header.IsPedestalRun()) 564 { 565 tasks.AddToList(&fillx0a); 566 tasks.AddToList(&fillx0c); 567 //tasks.AddToList(&clean); 568 tasks.AddToList(&hcalc); 569 tasks.AddToList(&fillx0d); 570 tasks.AddToList(&fillx1); 571 //tasks.AddToList(&fillx2); 572 tasks.AddToList(&fillx3); 573 //tasks.AddToList(&fillx4); 574 //tasks.AddToList(&fillx5); 575 } 544 576 545 577 //------------------------------------------- … … 555 587 return kFALSE; 556 588 589 if (binstr.IsDefault()) 590 binstr.SetEdgesLin(150, -shape.GetPulseWidth(), 591 header.GetFreqSampling()/1000.*header.GetNumSamples()+shape.GetPulseWidth()); 592 593 header.Print(); 594 557 595 // Execute first analysis 558 596 if (!evtloop.Eventloop(fMaxEvents)) -
trunk/MagicSoft/Mars/mjobs/MJSimulation.h
r9275 r9309 12 12 { 13 13 private: 14 Bool_t fForceMode; 14 Bool_t fForceMode; // Force execution even if RUNE-section was not found 15 16 Bool_t fForceTrigger; // Force the use of the trigger "electronics" 15 17 16 18 Bool_t WriteResult();
Note:
See TracChangeset
for help on using the changeset viewer.