Changeset 4066 for trunk/MagicSoft/Mars
- Timestamp:
- 05/13/04 16:41:04 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4064 r4066 24 24 - introduced intrinsic delay of low-gain, as measured by Florian. 25 25 26 * mjobs/MJCalibration.cc 27 * mjobs/MJExtractCalibTest.cc 28 - fixed some errors in the storage of the rel. times. 26 29 27 30 2004/05/12: Thomas Bretz -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r4009 r4066 907 907 plist.AddToList(&fQECam); 908 908 plist.AddToList(&fCalibrationCam); 909 plist.AddToList(&fRelTimeCam); 909 910 plist.AddToList(&pindiode); 910 911 plist.AddToList(&blindpix); … … 960 961 if (fRelTimes) 961 962 { 962 plist.AddToList(&fRelTimeCam);963 964 963 if (fTimeExtractor) 965 964 tlist.AddToList(fTimeExtractor); … … 1042 1041 } 1043 1042 1043 if (fRelTimeCam.Read()<=0) 1044 { 1045 *fLog << err << "Unable to read MCalibrationRelTimeCam from " << fname << endl; 1046 return kFALSE; 1047 } 1048 1044 1049 if (file.FindKey("MBadPixelsCam")) 1045 1050 { … … 1111 1116 } 1112 1117 1118 if (fRelTimes) 1119 if (fRelTimeCam.Write()<=0) 1120 { 1121 *fLog << err << "Unable to write MCalibrationQECam to " << oname << endl; 1122 return kFALSE; 1123 } 1124 1113 1125 if (fBadPixels.Write()<=0) 1114 1126 { … … 1121 1133 } 1122 1134 1135 1136 1137 1138 1139 1140 -
trunk/MagicSoft/Mars/mjobs/MJExtractCalibTest.cc
r4015 r4066 64 64 #include "MCalibrateRelTimes.h" 65 65 #include "MPedPhotCalc.h" 66 #include "MWriteRootFile.h"67 66 68 67 #include "MStatusDisplay.h" … … 205 204 Bool_t MJExtractCalibTest::ProcessD(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam) 206 205 { 207 const TString fname = GetOutputFile();208 209 if (gSystem->AccessPathName(fname, kFileExists))206 // const TString fname = GetOutputFile(); 207 208 // if (gSystem->AccessPathName(fname, kFileExists)) 210 209 return ProcessFileD(pedcam,calcam,qecam); 211 210 212 return kTRUE;211 // return kTRUE; 213 212 } 214 213 … … 283 282 tlist.AddToList(&fillcam); 284 283 285 MWriteRootFile write(GetOutputFile(), "RECREATE", fRuns->GetRunsAsString(), 2);286 write.AddContainer(&pedcam , "RunHeaders" );287 write.AddContainer(&pedphot , "RunHeaders" );288 write.AddContainer(&calcam , "Events" );289 write.AddContainer(&qecam , "Events" );290 write.AddContainer(&fBadPixels , "RunHeaders" );291 write.AddContainer("MHCalibrationTestCam", "Events" );292 // write.AddContainer(&testtime );293 tlist.AddToList(&write);294 295 284 // Create and setup the eventloop 296 285 MEvtLoop evtloop(fName); … … 310 299 DisplayResult(plist); 311 300 301 if (!WriteResultD()) 302 return kFALSE; 303 312 304 *fLog << inf << GetDescriptor() << ": Done." << endl; 313 305 … … 317 309 Bool_t MJExtractCalibTest::ProcessT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam) 318 310 { 319 const TString fname = GetOutputFile(); 320 321 if (gSystem->AccessPathName(fname, kFileExists)) 311 312 // const TString fname = GetOutputFile(); 313 314 // if (gSystem->AccessPathName(fname, kFileExists)) 322 315 return ProcessFileT(pedcam,relcam); 323 316 324 return kTRUE;317 // return kTRUE; 325 318 } 326 319 … … 348 341 // Setup Lists 349 342 MParList plist; 343 plist.AddToList(&pedcam); 350 344 plist.AddToList(&relcam); 351 345 plist.AddToList(&arrtime); … … 389 383 tlist.AddToList(&fillcam); 390 384 391 MWriteRootFile write(GetOutputFile(), "UPDATE", fRuns->GetRunsAsString(), 2);392 write.AddContainer(&relcam , "Events" );393 write.AddContainer(&fBadPixels , "RunHeaders" );394 write.AddContainer("MHCalibrationTestCam" , "Events" );395 write.AddContainer("MHCalibrationTestTimeCam", "Events" );396 write.AddContainer("MArrivalTimeCam" , "Events" );397 398 385 // Create and setup the eventloop 399 386 MEvtLoop evtloop(fName); … … 412 399 413 400 DisplayResultT(plist); 401 402 if (!WriteResultT()) 403 return kFALSE; 414 404 415 405 *fLog << inf << GetDescriptor() << ": Done." << endl; … … 455 445 } 456 446 457 458 /* 459 Bool_t MJExtractCalibTest::ProcessFile(MPedestalCam *pedcam, MCalibrationChargeCam *calcam) 460 { 461 if (!fRuns) 462 { 463 *fLog << err << "No Runs choosen... abort." << endl; 464 return kFALSE; 465 } 466 if (fRuns->GetNumRuns() != fRuns->GetNumEntries()) 467 { 468 *fLog << err << "Number of files found doesn't match number of runs... abort." << endl; 469 return kFALSE; 470 } 471 472 Int_t type = 0; 473 if (pedcam && calcam) type = 2; 474 if (pedcam && !calcam) type = 3; 475 476 *fLog << inf; 477 fLog->Separator(GetDescriptor()); 478 *fLog << "Calculating from Runs " << fRuns->GetRunsAsString() << endl; 479 *fLog << endl; 480 481 MReadMarsFile read("Events"); 482 read.DisableAutoScheme(); 483 static_cast<MRead&>(read).AddFiles(*fRuns); 484 485 // Setup Tasklist 486 MParList plist; 487 switch (type) 488 { 489 case 2: 490 plist.AddToList(calcam); 491 plist.AddToList(&fPedPhotCam); 492 case 3: 493 plist.AddToList(pedcam); 494 } 495 496 MTaskList tlist; 497 plist.AddToList(&tlist); 498 499 MGeomApply apply; // Only necessary to craete geometry 500 MExtractSignal extract; 501 MCalibrate calib; 502 MPedPhotCalc calc; 503 504 505 MHCamEvent evt1("ExtOffset"); 506 MHCamEvent evt2("CalOffset"); 507 evt1.SetType(0); 508 evt2.SetType(0); 509 MFillH fill1(&evt1, "MExtractedSignalCam", "FillExtractedSignal"); 510 MFillH fill2(&evt2, "MCerPhotEvt", "FillCerPhotEvt"); 511 512 tlist.AddToList(&read); 513 tlist.AddToList(&apply); 514 tlist.AddToList(&extract); 515 if (TestBit(kEnableGraphicalOutput)) 516 tlist.AddToList(&fill1); 517 tlist.AddToList(&calib); 518 tlist.AddToList(&calc); 519 if (TestBit(kEnableGraphicalOutput)) 520 tlist.AddToList(&fill2); 521 522 523 MHCamEvent evt("ExtSignal"); 524 evt.SetType(0); 525 MFillH fill(&evt, "MExtractedSignalCam"); 526 527 MWriteRootFile write(GetOutputFileD(), "RECREATE", fRuns->GetRunsAsString(), 2); 528 write.AddContainer("MExtractedSignalCam", "Events"); 529 write.AddContainer("MTime", "Events"); 530 write.AddContainer("MRawRunHeader", "RunHeaders"); 531 write.AddContainer("MPedestalCam", "RunHeaders"); 532 533 tlist.AddToList(&read); 534 tlist.AddToList(&apply); 535 tlist.AddToList(&extract); 536 if (TestBit(kEnableGraphicalOutput)) 537 tlist.AddToList(&fill); 538 tlist.AddToList(&write); 539 540 // Create and setup the eventloop 541 MEvtLoop evtloop(fName); 542 evtloop.SetParList(&plist); 543 evtloop.SetDisplay(fDisplay); 544 evtloop.SetLogStream(fLog); 545 546 // Execute first analysis 547 if (!evtloop.Eventloop()) 548 { 549 *fLog << err << GetDescriptor() << ": Failed." << endl; 550 return kFALSE; 551 } 552 553 tlist.PrintStatistics(); 554 555 //DisplayResult(plist); 556 557 //if (!WriteResult()) 558 // return kFALSE; 559 560 *fLog << inf << GetDescriptor() << ": Done." << endl; 447 Bool_t MJExtractCalibTest::WriteResultD() 448 { 449 450 if (fOutputPath.IsNull()) 451 return kTRUE; 452 453 const TString oname(GetOutputFile()); 454 455 *fLog << inf << "Writing to file: " << oname << endl; 456 457 TFile file(oname, "UPDATE"); 458 459 if (fDisplay && fDisplay->Write()<=0) 460 { 461 *fLog << err << "Unable to write MStatusDisplay to " << oname << endl; 462 return kFALSE; 463 } 464 465 if (fPedPhotCam.Write()<=0) 466 { 467 *fLog << err << "Unable to write MPedPhotCam to " << oname << endl; 468 return kFALSE; 469 } 470 471 if (fTestCam.Write()<=0) 472 { 473 *fLog << err << "Unable to write MHCalibrationTestCam to " << oname << endl; 474 return kFALSE; 475 } 561 476 562 477 return kTRUE; 563 478 564 565 // ------------------------------------------------------ 566 567 MGeomApply apply; // Only necessary to craete geometry 568 MExtractSignal extract; 569 MCalibrate calib; 570 MPedPhotCalc calc; 571 572 MHCamEvent evt1("ExtOffset"); 573 MHCamEvent evt2("CalOffset"); 574 evt1.SetType(0); 575 evt2.SetType(0); 576 MFillH fill1(&evt1, "MExtractedSignalCam", "FillExtractedSignal"); 577 MFillH fill2(&evt2, "MCerPhotEvt", "FillCerPhotEvt"); 578 579 tlist.AddToList(&read); 580 tlist.AddToList(&apply); 581 tlist.AddToList(&extract); 582 if (TestBit(kEnableGraphicalOutput)) 583 tlist.AddToList(&fill1); 584 tlist.AddToList(&calib); 585 tlist.AddToList(&calc); 586 if (TestBit(kEnableGraphicalOutput)) 587 tlist.AddToList(&fill2); 588 589 // Create and setup the eventloop 590 MEvtLoop evtloop(fName); 591 evtloop.SetParList(&plist); 592 evtloop.SetDisplay(fDisplay); 593 evtloop.SetLogStream(fLog); 594 595 // Execute first analysis 596 if (!evtloop.Eventloop()) 597 { 598 *fLog << err << GetDescriptor() << ": Failed." << endl; 599 return kFALSE; 600 } 601 602 tlist.PrintStatistics(); 603 604 //DisplayResult(plist); 605 606 if (!WriteResult()) 607 return kFALSE; 608 609 *fLog << inf << GetDescriptor() << ": Done." << endl; 479 } 480 481 Bool_t MJExtractCalibTest::WriteResultT() 482 { 483 484 if (fOutputPath.IsNull()) 485 return kTRUE; 486 487 const TString oname(GetOutputFile()); 488 489 *fLog << inf << "Writing to file: " << oname << endl; 490 491 TFile file(oname, "UPDATE"); 492 493 if (fDisplay && fDisplay->Write()<=0) 494 { 495 *fLog << err << "Unable to write MStatusDisplay to " << oname << endl; 496 return kFALSE; 497 } 498 499 if (fTestTimeCam.Write()<=0) 500 { 501 *fLog << err << "Unable to write MHCalibrationTestTimeCam to " << oname << endl; 502 return kFALSE; 503 } 610 504 611 505 return kTRUE; 612 } 613 */ 506 507 } 508 509 -
trunk/MagicSoft/Mars/mjobs/MJExtractCalibTest.h
r4015 r4066 45 45 void DisplayResult(MParList &plist); 46 46 void DisplayResultT(MParList &plist); 47 48 Bool_t WriteResultD(); 49 Bool_t WriteResultT(); 47 50 48 51 Bool_t ProcessFileD(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam); 49 Bool_t ProcessFileP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam);50 52 Bool_t ProcessFileT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam); 51 53
Note:
See TracChangeset
for help on using the changeset viewer.