Changeset 8434
- Timestamp:
- 04/23/07 20:11:25 (18 years ago)
- Location:
- trunk/MagicSoft
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8433 r8434 19 19 -*-*- END OF LINE -*-*- 20 20 21 2007/04/23 Thomas Bretz 22 23 * callisto.cc, star.cc: 24 - removed "-raw" and "-root" option 25 - replaced inflating sequence path by new InflatePath 26 function 27 - removed MJCalib::kUse* usage, use MSequence::IsMonteCarlo 28 instead 29 30 * mhcalib/MHCalibrationChargeBlindCam.cc, 31 mhcalib/MHCalibrationHiLoCam.cc, 32 mhcalib/MHCalibrationPulseTimeCam.cc: 33 - removed obsolete include of MCalibrationIntensityCam 34 35 * mhcalib/MHPedestalCam.cc: 36 - removed obsolete usage of fIntensCam 37 38 * mhist/MHEvent.cc: 39 - replacedcompilation of description string by new 40 MMcEvt::GetDescription memeber function 41 42 * mjobs/MJCalib.[h,cc]: 43 - removed fDataFlag and corresponding member functions and 44 handling 45 46 * mjobs/MJCalibTest.cc, mjobs/MJCalibrateSignal.cc, 47 mjobs/MJCalibration.cc, mjobs/MJPedestal.cc, mjobs/MJStar.[h,cc]: 48 - replaced IsUseRawData and IsUseRootData by 49 MSequence::IsMonteCarlo 50 - use fSequence to determin whether it is MC sequence or not 51 52 * mjobs/MJCalibrateSignal.cc: 53 - renamed movie encoding task list 54 - do not write output files if encoding movie 55 56 * mjobs/MSequence.[h,cc]: 57 - removed "merpp"-path 58 - monte carlo files now always have 8digits run numbers 59 - added new resource "MonteCarlo" 60 - added new static member function InflatePath 61 - increased version number to 2 62 63 * mmc/MMcEvt.[hxx,cxx]: 64 - added new member function GetDescription 65 66 * mmovie/MMovieWrite.[h,cc]: 67 - added a sanity check for strange rms values 68 - search for MMcEvt in the parlist and improve output 69 in case of monte carlo data 70 - fixed some typos in the comments of ReadEnv 71 72 * mmovie/Makefile: 73 - added mmc search path 74 75 * mraw/MRawRunHeader.cc: 76 - set new defaults of fTelescopeNumber, fCameraVersion, 77 fFreqSampling and fNumSignificantBits for old MC data 78 79 80 21 81 2007/04/23 Daniela Dorner 22 82 -
trunk/MagicSoft/Mars/NEWS
r8432 r8434 17 17 - merpp: When reading raw data the data is now stored in a single 18 18 array. The lo-gain array is obsolete. The interface stays the same. 19 20 - callisto: The -root and -raw options to read merpped data have been 21 removed 22 23 - callisto: If the -mc option is given the sequence-name can now be 24 replaced by the MC sequence number 25 26 - callisto: If the sequence file contains "MonteCarlo: Yes" the 27 -mc option can now be omitted 19 28 20 29 - callisto: Started further simplification by removing obsolete -
trunk/MagicSoft/Mars/callisto.cc
r8406 r8434 55 55 gLog << " -y Extract and calibrate signal" << endl << endl; 56 56 gLog << " Data Type (exclusive):" << endl; 57 gLog << " -raw Read input from raw-data <default>" << endl;58 57 gLog << " -mc Input root-files are monte carlo files" << endl; 59 gLog << " -root Read input from root-files (merpped)" << endl << endl;60 58 gLog << " Options:" << endl; 61 59 gLog.Usage(); … … 192 190 Bool_t kModeC = arg.HasOnlyAndRemove("-c"); 193 191 Bool_t kModeY = arg.HasOnlyAndRemove("-y"); 194 195 MJCalib::DataType_t kDataType = MJCalib::kIsUseRawData; // root 196 if (arg.HasOnlyAndRemove("-root")) 197 kDataType = MJCalib::kIsUseRootData; // root 198 if (arg.HasOnlyAndRemove("-raw")) 199 kDataType = MJCalib::kIsUseRawData; // raw 200 if (arg.HasOnlyAndRemove("-mc")) 201 kDataType = MJCalib::kIsUseMC; // monte carlo 192 const Bool_t kIsMC = arg.HasOnlyAndRemove("-mc"); 202 193 203 194 if (!kInpathY.IsNull() || !kOutpathY.IsNull() || !kOutpath.IsNull() || !kPath.IsNull()) … … 267 258 TString kSequence = arg.GetArgumentStr(0); 268 259 269 if (kSequence.IsDigit()) 270 { 271 const Int_t numseq = kSequence.Atoi(); 272 kSequence = Form("/magic/sequences/%04d/sequence%08d.txt", numseq/10000, numseq); 273 gLog << inf << "Inflated sequence file: " << kSequence << endl; 274 } 275 276 if (gSystem->AccessPathName(kSequence, kFileExists)) 277 { 278 gLog << err << "Sorry, sequence file '" << kSequence << "' doesn't exist." << endl; 260 if (!MSequence::InflatePath(kSequence, kIsMC)) 279 261 return 3; 280 }281 262 282 263 if (gSystem->AccessPathName(kConfig, kFileExists)) … … 293 274 // 294 275 MSequence seq(kSequence, kInpathD); 276 if (!seq.IsMonteCarlo()) 277 seq.SetMonteCarlo(kIsMC); 295 278 if (kPrintSeq) 296 279 { … … 310 293 // 311 294 if (kPrintFiles) 312 PrintFiles(seq, kInpathD, kDataType==MJCalib::kIsUseRawData, kFALSE);295 PrintFiles(seq, kInpathD, !seq.IsMonteCarlo(), kFALSE); 313 296 if (kPrintFound) 314 PrintFiles(seq, kInpathD, kDataType==MJCalib::kIsUseRawData, kTRUE);297 PrintFiles(seq, kInpathD, !seq.IsMonteCarlo(), kTRUE); 315 298 316 299 if (seq.HasMoon()) … … 381 364 job1.SetDisplay(d); 382 365 job1.SetOverwrite(kOverwrite); 383 job1.SetDataType(kDataType);384 366 job1.SetUseHists(kMoon); 385 367 … … 411 393 job2.SetDisplay(d);; 412 394 job2.SetOverwrite(kOverwrite); 413 job2.SetDataType(kDataType);414 395 job2.SetUseHists(kMoon); 415 396 job2.SetDeadPixelCheck(); … … 447 428 job3.SetOverwrite(kOverwrite); 448 429 job3.SetPathOut(kOutpathC); 449 job3.SetDataType(kDataType);450 430 // job2.SetPathIn(kInpathC); // not yet needed 451 431 … … 479 459 job4.SetOverwrite(kOverwrite); 480 460 job4.SetPathOut(kOutpathC); 481 job4.SetDataType(kDataType);482 461 483 462 if (!job4.Process(job1.GetPedestalCam())) … … 514 493 job1.SetOverwrite(kOverwrite); 515 494 job1.SetPathIn(kInpathY); // --> READ Extractor from calib-file 516 job1.SetDataType(kDataType);517 495 //job1.SetPathOut(kOutpathY); // not yet needed 518 496 job1.SetUseData(); … … 544 522 job2.SetOverwrite(kOverwrite); 545 523 job2.SetPathIn(kInpathY); 546 job2.SetDataType(kDataType); 547 job2.SetPulsePosCheck(kDataType!=MJCalib::kIsUseMC); 524 job2.SetPulsePosCheck(!seq.IsMonteCarlo()); 548 525 job2.SetPathOut(kOutpathY); // for updating the extractor 549 526 … … 600 577 job3.SetOverwrite(kOverwrite); 601 578 job3.SetPathIn(kInpathY); 602 job3.SetDataType(kDataType);603 579 // job1.SetPathOut(kOutpathC); // not yet needed 604 580 // job1.SetPathIn(kInpathC); // not yet needed … … 634 610 job4.SetPathIn(kInpathY); 635 611 job4.SetPathOut(kOutpathY); 636 job4.SetDataType(kDataType);637 612 job4.SetMovieMode(kMovie); 638 if ( kDataType!=MJCalib::kIsUseMC)613 if (!seq.IsMonteCarlo()) 639 614 job4.SetExtractor(job2.GetExtractor()); 640 615 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindCam.cc
r8428 r8434 46 46 47 47 #include "MCalibrationBlindPix.h" 48 #include "MCalibrationIntensityCam.h"49 48 50 49 #include "MParList.h" -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationHiLoCam.cc
r8428 r8434 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationHiLoCam.cc,v 1.2 2 2007-04-20 13:55:00tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationHiLoCam.cc,v 1.23 2007-04-23 19:06:28 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 105 105 #include "MCalibrationHiLoPix.h" 106 106 #include "MCalibrationCam.h" 107 #include "MCalibrationIntensityCam.h"108 107 #include "MCalibrationPix.h" 109 108 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc
r8428 r8434 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationPulseTimeCam.cc,v 1.3 6 2007-04-20 13:55:00tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationPulseTimeCam.cc,v 1.37 2007-04-23 19:06:28 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 123 123 #include "MCalibrationPix.h" 124 124 #include "MHCalibrationPix.h" 125 #include "MCalibrationIntensityCam.h"126 125 127 126 #include "MGeomCam.h" -
trunk/MagicSoft/Mars/mhcalib/MHPedestalCam.cc
r8417 r8434 101 101 #include "MPedestalPix.h" 102 102 103 #include "MCalibrationIntensityCam.h"104 103 #include "MCalibrationPix.h" 105 104 … … 394 393 fFirst, fLast); 395 394 396 InitHists(pix, fIntensCam ? fIntensCam->GetAverageBadArea(j) : fCam->GetAverageBadArea(j),j);395 InitHists(pix, fCam->GetAverageBadArea(j), j); 397 396 398 397 } … … 411 410 fFirst, fLast); 412 411 413 InitHists(pix, fIntensCam ? fIntensCam->GetAverageBadSector(j) : fCam->GetAverageBadSector(j),j);412 InitHists(pix, fCam->GetAverageBadSector(j), j); 414 413 415 414 } -
trunk/MagicSoft/Mars/mhist/MHEvent.cc
r8364 r8434 282 282 283 283 if (fMcEvt) 284 { 285 TString txt("#splitline{"); 286 287 txt += fMcEvt->GetParticleName(); 288 txt += " "; 289 290 s.Insert(0, txt); 291 292 s += "}{ E="; 293 294 s+= fMcEvt->GetEnergyStr(); 295 296 s += " r="; 297 s += (int)(fMcEvt->GetImpact()/100+.5); 298 s += "m Zd="; 299 s += 0.1*TMath::Nint(fMcEvt->GetTelescopeTheta()*180/TMath::Pi()*10); 300 s += "\\circ "; 301 if (fMcEvt->GetPhotElfromShower()>=10000) 302 s += Form("%dk", (Int_t)(fMcEvt->GetPhotElfromShower()/1000.+.5)); 303 else 304 if (fMcEvt->GetPhotElfromShower()>=1000) 305 s += Form("%.1fk", fMcEvt->GetPhotElfromShower()/1000.); 306 else 307 s += fMcEvt->GetPhotElfromShower(); 308 s += "PhEl}"; 309 } 284 s = fMcEvt->GetDescription(s); 310 285 311 286 gPad=NULL; -
trunk/MagicSoft/Mars/mjobs/MJCalib.cc
r8369 r8434 48 48 // - fPulsePosCheck to kFALSE 49 49 // 50 MJCalib::MJCalib() : fDataFlag(kIsUseRawData), fStorage(0), 51 fIsPixelCheck(kFALSE), fIsPulsePosCheck(kFALSE)/*, 52 fIsHiLoCalibration(kFALSE)*/ 50 MJCalib::MJCalib() : fStorage(0), fIsPixelCheck(kFALSE), fIsPulsePosCheck(kFALSE) 53 51 { 54 52 SetUseBlindPixel(kFALSE); 55 53 SetUsePINDiode(kFALSE); 56 54 57 55 SetCheckedPixId(); 58 56 } … … 63 61 SetPulsePosCheck(GetEnv("PulsePosCheck", fIsPulsePosCheck)); 64 62 SetCheckedPixId(GetEnv("CheckedPixId",fCheckedPixId)); 65 //SetHiLoCalibration(GetEnv("HiLoCalibration", fIsHiLoCalibration));66 63 67 64 if (HasEnv("StorageType")) … … 81 78 return kTRUE; 82 79 83 TString dat = GetEnv("DataType", "");84 dat = dat.Strip(TString::kBoth);85 dat.ToLower();86 87 if (dat == (TString)"raw")88 SetUseRawData();89 90 if (dat == (TString)"mc" || dat == (TString)"montecarlo")91 SetUseMC();92 93 if (dat == (TString)"root")94 SetUseRootData();95 96 80 return kTRUE; 97 81 } -
trunk/MagicSoft/Mars/mjobs/MJCalibTest.cc
r8245 r8434 287 287 if (fSequence.IsValid()) 288 288 { 289 if (fSequence.SetupCalRuns(iter, 0, IsUseRawData())<=0)289 if (fSequence.SetupCalRuns(iter, 0, !fSequence.IsMonteCarlo())<=0) 290 290 return kFALSE; 291 291 } … … 369 369 read.DisableAutoScheme(); 370 370 371 if ( IsUseRawData())371 if (!fSequence.IsMonteCarlo()) 372 372 rawread.AddFiles(iter); 373 373 else -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r8428 r8434 80 80 #include "MCalibCalcFromPast.h" 81 81 82 #include "MReadReports.h"83 82 #include "MReadMarsFile.h" 84 83 #include "MRawFileRead.h" … … 90 89 #include "MGeomApply.h" 91 90 #include "MPedestalSubtract.h" 92 //#include "MMcPedestalCopy.h"93 91 #include "MPointingPosCalc.h" 94 92 #include "MPedCalcFromLoGain.h" … … 102 100 #include "MCalibrateData.h" 103 101 #include "MCalibrateRelTimes.h" 104 //#include "MBadPixelsMerge.h"105 102 #include "MBadPixelsCalc.h" 106 103 #include "MBadPixelsTreat.h" … … 248 245 if (fSequence.IsValid()) 249 246 { 250 if (fSequence.SetupDatRuns(iter, 0, IsUseRawData())<=0)247 if (fSequence.SetupDatRuns(iter, 0, !fSequence.IsMonteCarlo())<=0) 251 248 return kFALSE; 252 249 } … … 362 359 plist.AddToList(&tlist); 363 360 364 MReadReports readreal;365 readreal.AddTree("Events", "MTime.", MReadReports::kMaster);366 readreal.AddTree("Trigger");367 readreal.AddTree("Camera");368 readreal.AddTree("Drive");369 readreal.AddTree("CC");370 readreal.AddTree("Currents");371 372 361 MReadMarsFile readmc("Events"); 373 362 readmc.DisableAutoScheme(); … … 375 364 MRawFileRead rawread(NULL); 376 365 377 MRead *read = 0; 378 switch (GetDataFlag()) 379 { 380 case kIsUseRawData: read = &rawread; break; 381 case kIsUseMC: read = &readmc; break; 382 case kIsUseRootData: read = &readreal; break; 383 } 366 MRead *read = fSequence.IsMonteCarlo() ? (MRead*)&readmc : (MRead*)&rawread; 384 367 read->AddFiles(iter); 385 368 386 369 const TString fname(Form("%s{s/_D_/_Y_}{s/\\.raw$/.root}{s/\\.raw\\.gz$/.root}", fPathOut.Data())); 387 370 388 389 371 // Skips MC which have no contents. This are precisely the 390 372 // events which fullfilled the MC Lvl1 trigger and an … … 808 790 movwrite.SetFilter(&movfilt); 809 791 810 MTaskList tlistmov ;792 MTaskList tlistmov("MovieEncoder"); 811 793 tlistmov.AddToList(&movprep); 812 794 tlistmov.AddToList(&movfilt); … … 835 817 tlist.AddToList(read); 836 818 837 if (IsUseMC()) 838 { 839 tlist.AddToList(&writemc); 819 if (fSequence.IsMonteCarlo()) 820 { 821 if (!fIsMovieMode) 822 tlist.AddToList(&writemc); 840 823 tlist.AddToList(&contmc); 841 824 } … … 843 826 //if (IsUseRootData()) 844 827 // tlist2.AddToList(&pextr); 845 tlist.AddToList(&tlist2, IsUseRootData() ? "Events" : "All");846 847 //if ( IsUseMC())828 tlist.AddToList(&tlist2, fSequence.IsMonteCarlo() ? "Events" : "Alls"); 829 830 //if (fSequence.IsMonteCarlo()) 848 831 // tlist.AddToList(&pcalc, "Drive"); 849 832 850 tlist.AddToList(&write); 833 if (!fIsMovieMode) 834 tlist.AddToList(&write); 851 835 852 836 // Create and setup the eventloop … … 901 885 902 886 if (!WriteResult(interlacedcont)) 903 return kFALSE;887 return kFALSE; 904 888 905 889 // return if job went ok -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r8428 r8434 1458 1458 1459 1459 // Defined resource id 1460 const TString id = IsUseMC() ? "MC" : Form("%02d", period);1460 const TString id = fSequence.IsMonteCarlo() ? "MC" : Form("%02d", period); 1461 1461 1462 1462 // Check for a valid entry for the correct period … … 1707 1707 1708 1708 MDirIter iter; 1709 if (fSequence.SetupCalRuns(iter, 0, IsUseRawData())<=0)1709 if (fSequence.SetupCalRuns(iter, 0, !fSequence.IsMonteCarlo())<=0) 1710 1710 return kFALSE; 1711 1711 … … 1746 1746 MRawFileRead rawread(NULL); 1747 1747 1748 if ( IsUseRawData())1748 if (!fSequence.IsMonteCarlo()) 1749 1749 { 1750 1750 rawread.AddFiles(iter); … … 1948 1948 SetUsePINDiode(kFALSE); 1949 1949 1950 const Int_t numexec = IsUseRawData() ? rawread.GetNumExecutions() : read.GetNumExecutions();1950 const Int_t numexec = !fSequence.IsMonteCarlo() ? rawread.GetNumExecutions() : read.GetNumExecutions(); 1951 1951 if (numexec>0) 1952 1952 { -
trunk/MagicSoft/Mars/mjobs/MJStar.cc
r8323 r8434 119 119 } 120 120 121 Bool_t MJStar::Process( Bool_t ismc)121 Bool_t MJStar::Process() 122 122 { 123 123 if (!fSequence.IsValid()) … … 275 275 write.AddContainer("MMuonSetup", "RunHeaders"); 276 276 277 if ( ismc)277 if (fSequence.IsMonteCarlo()) 278 278 { 279 279 // Monte Carlo Data … … 311 311 writem.AddContainer("MRawEvtHeader", "Muons"); 312 312 writem.AddContainer("MPointingPos", "Muons"); 313 if ( ismc)313 if (fSequence.IsMonteCarlo()) 314 314 { 315 315 // Monte Carlo Data … … 318 318 } 319 319 320 if ( ismc)320 if (fSequence.IsMonteCarlo()) 321 321 if (fMuonAnalysis) 322 322 writem.AddCopySource("OriginalMC"); … … 326 326 MTaskList tlist2("Events"); 327 327 tlist2.AddToList(&apply); 328 if (! ismc)328 if (!fSequence.IsMonteCarlo()) 329 329 tlist2.AddToList(&cont); 330 330 tlist2.AddToList(&contsw); 331 if (! ismc)331 if (!fSequence.IsMonteCarlo()) 332 332 { 333 333 // Calibration events don't enter star at all. … … 450 450 // ------------------------------------------------------------ 451 451 452 tlist.AddToList( ismc? (MTask*)&readmc : (MTask*)&readreal);453 tlist.AddToList(&pcalc, ismc? "Events" : "Drive");452 tlist.AddToList(fSequence.IsMonteCarlo() ? (MTask*)&readmc : (MTask*)&readreal); 453 tlist.AddToList(&pcalc, fSequence.IsMonteCarlo() ? "Events" : "Drive"); 454 454 //tlist.AddToList(&filltst, "Events"); 455 455 tlist.AddToList(&tlist2, "Events"); 456 if (! ismc)456 if (!fSequence.IsMonteCarlo()) 457 457 { 458 458 // initiate task list -
trunk/MagicSoft/Mars/mjobs/MJStar.h
r6993 r8434 21 21 22 22 // Process 23 Bool_t Process( Bool_t ismc=kFALSE);23 Bool_t Process(); 24 24 25 25 ClassDef(MJStar, 0) // Tool to create a pedestal file (MPedestalCam) -
trunk/MagicSoft/Mars/mjobs/MSequence.cc
r8371 r8434 118 118 // seq.SetupPedRuns(iter, "/mypath", "[DPC]"); 119 119 // 120 // =========================================================================== 121 // 122 // Class Version 2: 123 // + fMonteCarlo 124 // 120 125 ///////////////////////////////////////////////////////////////////////////// 121 126 #include "MSequence.h" … … 220 225 switch (type) 221 226 { 222 case kRawDat: 227 case kRawDat: // rawdata 223 228 case kRawPed: 224 229 case kRawCal: 225 230 case kRawAll: 226 d += "rawfiles/"; 227 d += fNight.GetStringFmt("%Y/%m/%d"); 228 break; 229 case kRootDat: 231 case kRootDat: // mcdata 230 232 case kRootPed: 231 233 case kRootCal: 232 234 case kRootAll: 233 d += " merpp/";235 d += "rawfiles/"; 234 236 d += fNight.GetStringFmt("%Y/%m/%d"); 235 237 break; … … 253 255 // Changes to read the DAQ numbering format. Changes takes place 254 256 // between runs 35487 and 00035488 (2004_08_30) 255 const char *fmt = arr[i]>35487 ? "%08d_%s_*_E" : "%05d_%s_*_E";257 const char *fmt = arr[i]>35487 || fMonteCarlo ? "%08d_%s_*_E" : "%05d_%s_*_E"; 256 258 257 259 TString n; … … 447 449 fTriggerTable = env.GetValue("TriggerTable", ""); 448 450 fHvSettings = env.GetValue("HvSettings", ""); 451 fMonteCarlo = env.GetValue("MonteCarlo", kFALSE); 449 452 450 453 str = env.GetValue("Runs", ""); … … 488 491 } 489 492 gLog << "Sequence: " << fSequence << endl; 493 if (fMonteCarlo) 494 gLog << "MonteCarlo: Yes" << endl; 490 495 gLog << "Period: " << fPeriod << endl; 491 496 gLog << "Night: " << fNight << endl << endl; … … 646 651 fPeriod = MAstro::GetMagicPeriod(fNight.GetMjd()); 647 652 } 653 654 // -------------------------------------------------------------------------- 655 // 656 // If the sequence name seq is just a digit it is inflated to a full 657 // path following the datacenter standard. 658 // 659 // Returns if file accessible or not. 660 // 661 Bool_t MSequence::InflatePath(TString &seq, Bool_t ismc) 662 { 663 if (seq.IsDigit()) 664 { 665 const Int_t numseq = seq.Atoi(); 666 seq = "/magic/"; 667 if (ismc) 668 seq += "montecarlo/"; 669 seq += Form("sequences/%04d/sequence%08d.txt", numseq/10000, numseq); 670 gLog << inf << "Inflated sequence file: " << seq << endl; 671 } 672 673 if (!gSystem->AccessPathName(seq, kFileExists)) 674 return kTRUE; 675 676 gLog << err << "Sorry, sequence file '" << seq << "' doesn't exist." << endl; 677 return kFALSE; 678 } -
trunk/MagicSoft/Mars/mjobs/MSequence.h
r8398 r8434 51 51 TArrayI fDatRuns; 52 52 53 Bool_t fMonteCarlo; 54 53 55 //TExMap fFileNames; 54 56 … … 65 67 public: 66 68 MSequence() : fSequence((UInt_t)-1), fLastRun((UInt_t)-1), 67 fNumEvents((UInt_t)-1), fPeriod((UInt_t)-1) { }69 fNumEvents((UInt_t)-1), fPeriod((UInt_t)-1), fMonteCarlo(kFALSE) { } 68 70 MSequence(const char *fname, const char *path=""); 69 71 MSequence(const MSequence &s) : fSequence(s.fSequence), fStart(s.fStart), … … 72 74 fTriggerTable(s.fTriggerTable), fHvSettings(s.fHvSettings), 73 75 fRuns(s.fRuns), fCalRuns(s.fCalRuns), fPedRuns(s.fPedRuns), 74 fDatRuns(s.fDatRuns) { }76 fDatRuns(s.fDatRuns), fMonteCarlo(s.fMonteCarlo) { } 75 77 ~MSequence(); 76 78 … … 80 82 // Genaral interface 81 83 Bool_t IsValid() const { return fSequence!=(UInt_t)-1; } 84 Bool_t IsMonteCarlo() const { return fMonteCarlo; } 85 86 void SetMonteCarlo(Bool_t ismc=kTRUE) { fMonteCarlo=ismc; } 82 87 83 88 UInt_t SetupPedRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const; … … 115 120 const TString &GetSource() const { return fSource; } 116 121 117 const TString GetStandardPath() const { return "/magic/data/"; }122 const TString GetStandardPath() const { return fMonteCarlo?"/magic/montecarlo/":"/magic/data/"; } 118 123 119 124 const TString &GetFileName() const { return fFileName; } … … 133 138 UInt_t AddDatRuns(UInt_t num) { return AddDatRuns(num, num); } 134 139 135 ClassDef(MSequence, 1) 140 static Bool_t InflatePath(TString &seq, Bool_t ismc=kFALSE); 141 142 ClassDef(MSequence, 2) 136 143 }; 137 144 -
trunk/MagicSoft/Mars/mmovie/MMovieWrite.cc
r8411 r8434 78 78 // MBadPixelsCam 79 79 // MMovieData 80 // [MMcEvt] 80 81 // 81 82 ///////////////////////////////////////////////////////////////////////////// … … 97 98 #include "MGeomCam.h" 98 99 #include "MGeomPix.h" 100 101 #include "MMcEvt.hxx" 99 102 100 103 #include "MH.h" … … 279 282 return kFALSE; 280 283 } 284 285 fMC = (MMcEvt*)plist->FindObject("MMcEvt"); 281 286 282 287 return OpenPipe(); … … 592 597 593 598 const Double_t rms = fIn->GetMedianPedestalRms(); 594 595 h.SetMinimum(fIn->GetMax()-(fIn->GetMax()-rms)*99/98); // rms0 596 h.SetMaximum(fIn->GetMax()); 599 const Double_t max = fIn->GetMax(); // scale the lover limit such 600 const Double_t dif = (max-rms)*99/98; // that everything below rms is 601 const Double_t min = max-dif; // displayed as white 602 603 // If the maximum is equal or less the 604 // pedestal rms something must be wrong 605 if (dif<=0) 606 return kFALSE; 607 608 h.SetMinimum(min); 609 h.SetMaximum(max); 597 610 598 611 // ----------------------------------------- … … 763 776 764 777 cout << "MED=" << rms0 << endl; 765 */ 778 */ 779 780 TString s = Form("%d: ", GetNumExecutions()+1); 781 s += "Evt #"; 782 s += fHead->GetDAQEvtNumber(); 783 s += " of "; 784 s += "Run #"; 785 s += fRun->GetRunNumber(); 786 if (fMC) 787 s = fMC->GetDescription(s); 788 766 789 MHCamera h(*fCam); 767 h.SetTitle(Form("%d: Run #%d, Evt %d", GetNumExecutions()+1, 768 fRun->GetRunNumber(), fHead->GetDAQEvtNumber())); 790 h.SetTitle(s); 769 791 h.SetAllUsed(); 770 792 h.SetYTitle("V [au]"); … … 815 837 // 816 838 // Example: 817 // MMovie Prepare.TargetLength: 5 <seconds>818 // MMovie Prepare.NumEvents: 500819 // MMovie Prepare.Threshold: 2 <rms>820 // MMovie Prepare.Filename: movie.mpg839 // MMovieWrite.TargetLength: 5 <seconds> 840 // MMovieWrite.NumEvents: 500 841 // MMovieWrite.Threshold: 2 <rms> 842 // MMovieWrite.Filename: movie.mpg 821 843 // 822 844 Int_t MMovieWrite::ReadEnv(const TEnv &env, TString prefix, Bool_t print) -
trunk/MagicSoft/Mars/mmovie/MMovieWrite.h
r8406 r8434 9 9 class TASImage; 10 10 11 class MMcEvt; 11 12 class MGeomCam; 12 13 class MMovieData; … … 26 27 MBadPixelsCam *fBad; //! Information about bad pixels 27 28 MPedestalCam *fPed; //! Fundamental pedestal for palette and cleaning 29 MMcEvt *fMC; //! Informatio about MC events 28 30 29 31 MMovieData *fIn; //! Input data with splines for all pixels -
trunk/MagicSoft/Mars/mmovie/Makefile
r8397 r8434 21 21 INCLUDES = -I. -I../mbase -I../mraw -I../mgeom -I../mhbase -I../mgui \ 22 22 -I../mcalib -I../msignal -I../mbadpixels -I../mpedestal \ 23 -I../mhist 23 -I../mhist -I../mmc 24 24 25 25 SRCFILES = MMoviePrepare.cc \ -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
r8372 r8434 138 138 fPixAssignment = new MArrayS(0); 139 139 140 // Remark: If we read old MC data from a root file which do not 141 // yet contain one of these variable, the value given here is 142 // the default. Do not mix files with and without a value if the 143 // files with the value do not match the default! 140 144 fFormatVersion=0; 141 145 fSoftVersion=0; 142 fTelescopeNumber= 0;143 fCameraVersion= 0;144 fFadcType =0;146 fTelescopeNumber=1; 147 fCameraVersion=1; 148 fFadcType=0; 145 149 fRunType=kRTNone; // use 0xffff for invalidation, 0 means: Data run 146 150 fRunNumber=0; … … 155 159 fNumSamplesHiGain=0; 156 160 fNumEvents=0; 161 fNumBytesPerSample=1; 162 fFreqSampling=300; 163 fNumSignificantBits=8; 157 164 } 158 165 -
trunk/MagicSoft/Mars/star.cc
r8245 r8434 157 157 // Something special for datacenter access 158 158 // 159 if (kSequence.IsDigit()) 160 { 161 const Int_t numseq = kSequence.Atoi(); 162 kSequence = Form("/magic/sequences/%04d/sequence%08d.txt", numseq/10000, numseq); 163 gLog << inf << "Inflated sequence file: " << kSequence << endl; 164 } 165 166 if (gSystem->AccessPathName(kSequence, kFileExists)) 167 { 168 gLog << err << "Sorry, sequence file '" << kSequence << "' doesn't exist." << endl; 169 return 2; 170 } 159 if (!MSequence::InflatePath(kSequence, kIsMC)) 160 return 2; 171 161 172 162 if (gSystem->AccessPathName(kConfig, kFileExists)) … … 180 170 // 181 171 MSequence seq(kSequence, kInpath); 172 if (!seq.IsMonteCarlo()) 173 seq.SetMonteCarlo(kIsMC); 182 174 if (kPrintSeq) 183 175 { … … 248 240 job.DisableMuonAnalysis(); 249 241 250 if (!job.Process( kIsMC))242 if (!job.Process()) 251 243 { 252 244 gLog << err << "Calculation of image parameters failed." << endl << endl; -
trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx
r7880 r8434 18 18 ! Author(s): 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 520 ! Copyright: MAGIC Software Development, 2000-2007 21 21 ! 22 22 ! … … 199 199 200 200 fFadcTimeJitter = fadc_jitter; 201 201 202 202 fEventReuse = reuse; 203 203 } … … 217 217 TString str(opt); 218 218 if (str.IsNull()) 219 {220 219 *fLog << " Photoelectrons: " << fPhotElfromShower << endl; 221 return; 222 } 223 } 220 } 221 222 // -------------------------------------------------------------------------- 223 // 224 // Return a proper description of the monte carlo event 225 // 226 TString MMcEvt::GetDescription(TString s) const 227 { 228 TString txt("#splitline{"); 229 230 txt += GetParticleName(); 231 txt += " "; 232 txt += s; 233 txt += "}{ E="; 234 txt += GetEnergyStr(); 235 txt += " r="; 236 txt += (int)(GetImpact()/100+.5); 237 txt += "m Zd="; 238 txt += 0.1*TMath::Nint(GetTelescopeTheta()*180/TMath::Pi()*10); 239 txt += "\\circ "; 240 if (GetPhotElfromShower()>=10000) 241 txt += Form("%dk", (Int_t)(GetPhotElfromShower()/1000.+.5)); 242 else 243 if (GetPhotElfromShower()>=1000) 244 txt += Form("%.1fk", GetPhotElfromShower()/1000.); 245 else 246 txt += GetPhotElfromShower(); 247 txt += "PhEl}"; 248 249 return txt; 250 } -
trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx
r7880 r8434 100 100 Float_t GetMuonCphFraction() const { return fMuonCphFraction; } 101 101 102 TString GetDescription(TString s="") const; 103 102 104 // Setter 103 105 void SetTheta(Float_t Theta) { fTheta=Theta; } //Set Theta angle
Note:
See TracChangeset
for help on using the changeset viewer.