Changeset 5298 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 10/20/04 16:21:23 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r5167 r5298 332 332 MHCamEvent evt6(0, "Times", "Arrival Time;;T [slice]"); 333 333 evt0.EnableVariance(); 334 evt1.EnableVariance(); 334 335 evt2.EnableVariance(); 335 336 evt3.EnableVariance(); 337 evt4.EnableVariance(); 336 338 evt6.EnableVariance(); 337 339 -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r5234 r5298 17 17 ! 18 18 ! Author(s): Thomas Bretz, 1/2004 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! Markus Gaug ,04/2004 <mailto:markus@ifae.es>19 ! Author(s): Markus Gaug, 4/2004 <mailto:markus@ifae.es> 20 20 ! 21 21 ! Copyright: MAGIC Software Development, 2000-2004 … … 84 84 const Float_t MJPedestal::fgRefPedRmsExtraGalacticOuter = 3.35; 85 85 const Float_t MJPedestal::fgRefPedRmsGalacticOuter = 4.2; 86 86 87 // -------------------------------------------------------------------------- 87 88 // … … 99 100 fDataCheck(kFALSE), fUseData(kFALSE) 100 101 { 101 102 fName = name ? name : "MJPedestal"; 103 fTitle = title ? title : "Tool to create a pedestal file (MPedestalCam)"; 104 105 SetNormalStorage(); 106 102 fName = name ? name : "MJPedestal"; 103 fTitle = title ? title : "Tool to create a pedestal file (MPedestalCam)"; 104 105 SetNormalStorage(); 107 106 } 108 107 … … 128 127 Bool_t MJPedestal::ReadPedestalCam() 129 128 { 130 131 if (IsNoStorage()) 132 return kFALSE; 133 134 const TString fname = GetOutputFile(); 135 136 if (gSystem->AccessPathName(fname, kFileExists)) 137 { 138 *fLog << warn << "Input file " << fname << " doesn't exist, will create it." << endl; 139 return kFALSE; 140 } 141 142 *fLog << inf << "Reading from file: " << fname << endl; 143 144 TFile file(fname, "READ"); 145 if (fPedestalCam.Read()<=0) 146 { 147 *fLog << err << "Unable to read MPedestalCam from " << fname << endl; 148 return kFALSE; 149 } 150 151 if (file.FindKey("MBadPixelsCam")) 152 { 153 MBadPixelsCam bad; 129 if (IsNoStorage()) 130 return kFALSE; 131 132 const TString fname = GetOutputFile(); 133 134 if (gSystem->AccessPathName(fname, kFileExists)) 135 { 136 *fLog << warn << "Input file " << fname << " doesn't exist, will create it." << endl; 137 return kFALSE; 138 } 139 140 *fLog << inf << "Reading from file: " << fname << endl; 141 142 TFile file(fname, "READ"); 143 if (fPedestalCam.Read()<=0) 144 { 145 *fLog << err << "Unable to read MPedestalCam from " << fname << endl; 146 return kFALSE; 147 } 148 149 if (file.FindKey("MBadPixelsCam")) 150 { 151 MBadPixelsCam bad; 154 152 if (bad.Read()<=0) 155 153 { 156 154 *fLog << err << "Unable to read MBadPixelsCam from " << fname << endl; 157 155 return kFALSE; 158 156 } 159 157 fBadPixels.Merge(bad); 160 158 } 161 159 162 if (fDisplay && !fDisplay->GetCanvas("Pedestals"))163 fDisplay->Read();164 165 return kTRUE;160 if (fDisplay && !fDisplay->GetCanvas("Pedestals")) 161 fDisplay->Read(); 162 163 return kTRUE; 166 164 } 167 165 … … 371 369 void MJPedestal::DisplayReferenceLines(MHCamera *cam, const Int_t what) const 372 370 { 373 374 371 Double_t x = cam->GetNbinsX(); 375 372 … … 441 438 void MJPedestal::FixDataCheckHist(TH1D *hist) const 442 439 { 443 444 440 hist->SetDirectory(NULL); 445 441 hist->SetStats(0); … … 459 455 xaxe->SetLabelSize(0.05); 460 456 yaxe->SetLabelSize(0.05); 461 462 } 457 } 458 463 459 /* 464 460 Bool_t MJPedestal::WriteEventloop(MEvtLoop &evtloop) const … … 494 490 // Prefix.DataCheck: Yes, No 495 491 // Prefix.UseData: Yes, No 492 // Prefix.DisableOutput: Yes, No 496 493 // 497 494 Bool_t MJPedestal::CheckEnvLocal() … … 502 499 SetDataCheck(GetEnv("DataCheck", fDataCheck)); 503 500 SetUseData(GetEnv("UseData", fUseData)); 501 SetNoStorage(GetEnv("DisableOutput", IsNoStorage())); 504 502 505 503 return kTRUE; … … 516 514 Bool_t MJPedestal::WriteResult() 517 515 { 518 519 if (IsNoStorage()) 516 if (IsNoStorage()) 517 return kTRUE; 518 519 if (fPathOut.IsNull()) 520 return kTRUE; 521 522 const TString oname(GetOutputFile()); 523 524 *fLog << inf << "Writing to file: " << oname << endl; 525 526 TFile file(oname, "UPDATE", "File created by MJPedestal", 9); 527 if (!file.IsOpen()) 528 { 529 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl; 530 return kFALSE; 531 } 532 533 if (fDisplay && fDisplay->Write()<=0) 534 { 535 *fLog << err << "Unable to write MStatusDisplay to " << oname << endl; 536 return kFALSE; 537 } 538 539 if (fPedestalCam.Write()<=0) 540 { 541 *fLog << err << "Unable to write MPedestalCam to " << oname << endl; 542 return kFALSE; 543 } 544 545 if (fBadPixels.Write()<=0) 546 { 547 *fLog << err << "Unable to write MBadPixelsCam to " << oname << endl; 548 return kFALSE; 549 } 550 520 551 return kTRUE; 521 522 if (fPathOut.IsNull())523 return kTRUE;524 525 const TString oname(GetOutputFile());526 527 *fLog << inf << "Writing to file: " << oname << endl;528 529 TFile file(oname, "UPDATE", "File created by MJPedestal", 9);530 if (!file.IsOpen())531 {532 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;533 return kFALSE;534 }535 536 if (fDisplay && fDisplay->Write()<=0)537 {538 *fLog << err << "Unable to write MStatusDisplay to " << oname << endl;539 return kFALSE;540 }541 542 if (fPedestalCam.Write()<=0)543 {544 *fLog << err << "Unable to write MPedestalCam to " << oname << endl;545 return kFALSE;546 }547 548 if (fBadPixels.Write()<=0)549 {550 *fLog << err << "Unable to write MBadPixelsCam to " << oname << endl;551 return kFALSE;552 }553 554 return kTRUE;555 552 } 556 553
Note:
See TracChangeset
for help on using the changeset viewer.