Changeset 9309
- Timestamp:
- 02/09/09 14:14:59 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9308 r9309 97 97 - added -I../mtrigger 98 98 99 99 * mjobs/MJSimulation.[h,cc]: 100 - added new mode to force the use of the trigger "electronics" 101 - moved setup of the fadc to the resource file 102 - added a new histogram to show the maximum signal in all pixels 103 - automatically setup the range of the TrigPos histogram 104 - don't show all histograms in all run conditions 105 106 * mraw/MRawRunHeader.[h,cc]: 107 - added ReadEnv for a setup from a resource file in ceres 108 109 * msimcamera/MSimAPD.cc: 110 - added a sanity check if ReInit has not been called 100 111 101 112 -
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(); -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
r9308 r9309 938 938 switch (fFadcType) 939 939 { 940 case 1: *fLog << "Siegen"; break; 941 case 2: *fLog << "MUX"; break; 940 case 1: *fLog << "Siegen"; break; 941 case 2: *fLog << "MUX"; break; 942 case 0xffff: *fLog << "artificial"; break; 942 943 default: *fLog << "unknown"; 943 944 } … … 953 954 *fLog << "Source: '" << fSourceName << "' " << " "; 954 955 *fLog << fSourceEpochChar << dec << fSourceEpochDate << endl; 955 *fLog << "Run Start: " << fRunStart << endl; 956 *fLog << "Run Stop: " << fRunStop << endl; 957 *fLog << "Crates: " << fNumCrates << " x " << fNumPixInCrate << " Pixel/Crate = " << fNumCrates*fNumPixInCrate << " Pixel/Evt" << endl; 958 *fLog << "Num Pixels: " << GetNumNormalPixels() << " (normal) + " << GetNumSpecialPixels() << " (special) = " << GetNumConnectedPixels() << " (total)" << endl; 956 if (fRunStart) 957 *fLog << "Run Start: " << fRunStart << endl; 958 if (fRunStop) 959 *fLog << "Run Stop: " << fRunStop << endl; 960 if (fNumCrates>0 || fNumPixInCrate>0) 961 *fLog << "Crates: " << fNumCrates << " x " << fNumPixInCrate << " Pixel/Crate = " << fNumCrates*fNumPixInCrate << " Pixel/Evt" << endl; 962 if (GetNumConnectedPixels()>0) 963 *fLog << "Num Pixels: " << GetNumNormalPixels() << " (normal) + " << GetNumSpecialPixels() << " (special) = " << GetNumConnectedPixels() << " (total)" << endl; 959 964 if (fFormatVersion>6) 960 965 *fLog << "Sampling: " << fSamplingFrequency << "MHz with " << (int)fFadcResolution << " significant bits" << endl; … … 1248 1253 fNumEventsRead = num; 1249 1254 } 1255 1256 // -------------------------------------------------------------------------- 1257 // 1258 // NumSamples: 50 1259 // NumBytePerSample: 2 1260 // SamplingFrequency: 2000 1261 // FadcResolution: 12 1262 // FadcType: XXXX 1263 // 1264 Int_t MRawRunHeader::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 1265 { 1266 Bool_t rc = kFALSE; 1267 1268 if (IsEnvDefined(env, prefix, "NumSamples", print)) 1269 { 1270 rc = kTRUE; 1271 fNumSamplesHiGain = GetEnvValue(env, prefix, "NumSamples", fNumSamplesHiGain); 1272 fNumSamplesLoGain = 0; 1273 } 1274 1275 if (IsEnvDefined(env, prefix, "NumBytesPerSample", print)) 1276 { 1277 rc = kTRUE; 1278 fNumBytesPerSample = GetEnvValue(env, prefix, "NumBytesPerSample", fNumBytesPerSample); 1279 } 1280 1281 if (IsEnvDefined(env, prefix, "SamplingFrequency", print)) 1282 { 1283 rc = kTRUE; 1284 fSamplingFrequency = GetEnvValue(env, prefix, "SamplingFrequency", fSamplingFrequency); 1285 } 1286 1287 if (IsEnvDefined(env, prefix, "FadcResolution", print)) 1288 { 1289 rc = kTRUE; 1290 fFadcResolution = GetEnvValue(env, prefix, "FadcResolution", fFadcResolution); 1291 } 1292 // Saturation behaviour etc. 1293 if (IsEnvDefined(env, prefix, "FadcType", print)) 1294 { 1295 //rc = kTRUE; 1296 //TString type = GetEnvValue(env, prefix, "FadcType", ""); 1297 // Eval "Siegen", "MUX", Dwarf" 1298 } 1299 else 1300 if (rc) 1301 fFadcType = 0xffff; // "Artificial" 1302 1303 return rc; 1304 } 1305 -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
r9270 r9309 78 78 79 79 Bool_t ReadEvtOld(istream& fin); 80 81 // MParContainer 82 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 80 83 81 84 public: -
trunk/MagicSoft/Mars/msimcamera/MSimAPD.cc
r9243 r9309 154 154 // average hit rate 155 155 const UInt_t npix = fAPDs.GetEntriesFast(); 156 157 // Check if we can safely proceed (this can fail if we either haven't been 158 // ReInit'ed or the max index in MPhotonStatistics is wrong) 159 if ((Int_t)npix<fStat->GetMaxIndex()) 160 { 161 *fLog << err << "ERROR - MSimAPD::Process: Only " << npix << " APDs initialized. At least " << fStat->GetMaxIndex() << " needed... abort." << endl; 162 return kERROR; 163 } 164 156 165 for (UInt_t idx=0; idx<npix; idx++) 157 166 static_cast<APD*>(fAPDs.UncheckedAt(idx))->FillRandom(fFreq, fStat->GetTimeFirst());
Note:
See TracChangeset
for help on using the changeset viewer.