Changeset 4909 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 09/09/04 18:03:23 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r4870 r4909 111 111 112 112 #include "MPedestalCam.h" 113 #include "MCalibColorSteer.h" 114 115 #include "MCalibrationIntensityChargeCam.h" 116 #include "MCalibrationIntensityRelTimeCam.h" 117 #include "MCalibrationIntensityQECam.h" 118 113 119 #include "MCalibrationCam.h" 114 120 #include "MCalibrationQECam.h" … … 122 128 #include "MCalibrationChargeBlindCamTwoNewStyle.h" 123 129 #include "MCalibrationChargeCalc.h" 130 #include "MCalibColorSet.h" 124 131 125 132 #include "MHGausEvents.h" … … 170 177 171 178 const Float_t MJCalibration::fgRefConvFADC2PheInner = 0.14; 172 const Float_t MJCalibration::fgRefConvFADC2PheOuter = 0.4 5;179 const Float_t MJCalibration::fgRefConvFADC2PheOuter = 0.4; 173 180 const Float_t MJCalibration::fgRefConvFADC2PhotInner = 0.8; 174 181 const Float_t MJCalibration::fgRefConvFADC2PhotOuter = 3.8; … … 184 191 // 185 192 // - Sets fRuns to 0, fExtractor to NULL, fTimeExtractor to NULL, fColor to kNONE, 186 // fDisplay to kNormalDisplay, fRelTime to kFALSE, fDataCheck to kFALSE, 193 // fDisplay to kNormalDisplay, kRelTimes to kFALSE, kataCheck to kFALSE, kDebug to kFALSE, 194 // kIntensity to kFALSE 187 195 // - SetUseBlindPixel() 188 196 // - SetUsePINDiode() … … 191 199 : fRuns(0), fExtractor(NULL), fTimeExtractor(NULL), 192 200 fColor(MCalibrationCam::kNONE), fDisplayType(kNormalDisplay), 193 f RelTimes(kFALSE), fDataCheck(kFALSE), fDebug(kFALSE), fGeometry("MGeomCamMagic")201 fGeometry("MGeomCamMagic") 194 202 { 195 fName = name ? name : "MJCalibration"; 196 fTitle = title ? title : "Tool to create the calibration constants for one calibration run"; 197 198 SetUseBlindPixel(); 199 SetUsePINDiode(); 203 204 fName = name ? name : "MJCalibration"; 205 fTitle = title ? title : "Tool to create the calibration constants for one calibration run"; 206 207 SetUseBlindPixel(); 208 SetUsePINDiode(); 209 210 SetRelTimeCalibration( kFALSE ); 211 SetDataCheck ( kFALSE ); 212 SetDebug ( kFALSE ); 213 SetIntensity ( kFALSE ); 200 214 } 201 215 … … 297 311 MHCamera disp34(geomcam, "TimeOscillating", "Oscillating Pixels"); 298 312 MHCamera disp35(geomcam, "TotalConv", "Conversion Factor to photons"); 299 313 314 MCalibrationChargeCam *cam = NULL; 315 MCalibrationQECam *qecam = NULL; 316 MCalibrationRelTimeCam *relcam = NULL; 317 318 if (IsIntensity()) 319 { 320 cam = (MCalibrationChargeCam*) fIntensCalibCam.GetCam(); 321 qecam = (MCalibrationQECam*) fIntensQECam.GetCam(); 322 relcam = (MCalibrationRelTimeCam*)fIntensRelTimeCam.GetCam(); 323 } 324 else 325 { 326 cam = &fCalibrationCam; 327 qecam = &fQECam; 328 relcam = &fRelTimeCam; 329 } 330 300 331 // Fitted charge means and sigmas 301 disp1.SetCamContent( fCalibrationCam, 0);302 disp1.SetCamError( fCalibrationCam, 1);303 disp2.SetCamContent( fCalibrationCam, 2);304 disp2.SetCamError( fCalibrationCam, 3);332 disp1.SetCamContent(*cam, 0); 333 disp1.SetCamError( *cam, 1); 334 disp2.SetCamContent(*cam, 2); 335 disp2.SetCamError( *cam, 3); 305 336 306 337 // Reduced Sigmas and reduced sigmas per charge 307 disp3.SetCamContent( fCalibrationCam, 5);308 disp3.SetCamError( fCalibrationCam, 6);309 disp4.SetCamContent( fCalibrationCam, 7);310 disp4.SetCamError( fCalibrationCam, 8);338 disp3.SetCamContent(*cam, 5); 339 disp3.SetCamError( *cam, 6); 340 disp4.SetCamContent(*cam, 7); 341 disp4.SetCamError( *cam, 8); 311 342 312 343 // F-Factor Method 313 disp5.SetCamContent( fCalibrationCam, 9);314 disp5.SetCamError( fCalibrationCam, 10);315 disp6.SetCamContent( fCalibrationCam, 11);316 disp6.SetCamError( fCalibrationCam, 12);317 disp7.SetCamContent( fCalibrationCam, 13);318 disp7.SetCamError( fCalibrationCam, 14);344 disp5.SetCamContent(*cam, 9); 345 disp5.SetCamError( *cam, 10); 346 disp6.SetCamContent(*cam, 11); 347 disp6.SetCamError( *cam, 12); 348 disp7.SetCamContent(*cam, 13); 349 disp7.SetCamError( *cam, 14); 319 350 320 351 // Quantum Efficiencies 321 disp8.SetCamContent ( fQECam, 0 );322 disp8.SetCamError ( fQECam, 1 );323 disp9.SetCamContent ( fQECam, 2 );324 disp9.SetCamError ( fQECam, 3 );325 disp10.SetCamContent( fQECam, 4 );326 disp10.SetCamError ( fQECam, 5 );327 disp11.SetCamContent( fQECam, 6 );328 disp11.SetCamError ( fQECam, 7 );352 disp8.SetCamContent (*qecam, 0 ); 353 disp8.SetCamError (*qecam, 1 ); 354 disp9.SetCamContent (*qecam, 2 ); 355 disp9.SetCamError (*qecam, 3 ); 356 disp10.SetCamContent(*qecam, 4 ); 357 disp10.SetCamError (*qecam, 5 ); 358 disp11.SetCamContent(*qecam, 6 ); 359 disp11.SetCamError (*qecam, 7 ); 329 360 330 361 // Valid flags 331 disp12.SetCamContent( fQECam, 8 );332 disp13.SetCamContent( fQECam, 9 );333 disp14.SetCamContent( fQECam, 10);334 disp15.SetCamContent( fQECam, 11);362 disp12.SetCamContent(*qecam, 8 ); 363 disp13.SetCamContent(*qecam, 9 ); 364 disp14.SetCamContent(*qecam, 10); 365 disp15.SetCamContent(*qecam, 11); 335 366 336 367 // Conversion Hi-Lo 337 disp16.SetCamContent( fCalibrationCam, 25);338 disp17.SetCamContent( fCalibrationCam, 16);339 disp17.SetCamError ( fCalibrationCam, 17);340 disp18.SetCamContent( fCalibrationCam, 18);341 disp18.SetCamError ( fCalibrationCam, 19);368 disp16.SetCamContent(*cam, 25); 369 disp17.SetCamContent(*cam, 16); 370 disp17.SetCamError (*cam, 17); 371 disp18.SetCamContent(*cam, 18); 372 disp18.SetCamError (*cam, 19); 342 373 343 374 // Pickup and Blackout 344 disp19.SetCamContent( fCalibrationCam, 21);345 disp20.SetCamContent( fCalibrationCam, 22);346 disp21.SetCamContent( fCalibrationCam, 23);347 disp22.SetCamContent( fCalibrationCam, 24);375 disp19.SetCamContent(*cam, 21); 376 disp20.SetCamContent(*cam, 22); 377 disp21.SetCamContent(*cam, 23); 378 disp22.SetCamContent(*cam, 24); 348 379 349 380 // Pixels with defects 350 disp23.SetCamContent( fCalibrationCam, 20);381 disp23.SetCamContent(*cam, 20); 351 382 disp24.SetCamContent(fBadPixels, 6); 352 383 disp25.SetCamContent(fBadPixels, 7); … … 357 388 358 389 // Arrival Times 359 disp28.SetCamContent( fCalibrationCam, 26);360 disp28.SetCamError( fCalibrationCam, 27);361 disp29.SetCamContent( fCalibrationCam, 27);390 disp28.SetCamContent(*cam, 26); 391 disp28.SetCamError( *cam, 27); 392 disp29.SetCamContent(*cam, 27); 362 393 363 394 disp1.SetYTitle("Q [FADC counts]"); … … 403 434 { 404 435 405 MCalibrationChargePix &pix = (MCalibrationChargePix&) fCalibrationCam[i];406 MCalibrationQEPix &qe = (MCalibrationQEPix&) fQECam[i];436 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*cam) [i]; 437 MCalibrationQEPix &qe = (MCalibrationQEPix&) (*qecam)[i]; 407 438 408 439 if (!pix.IsFFactorMethodValid()) … … 417 448 418 449 419 if ( fRelTimes)420 { 421 disp30.SetCamContent( fRelTimeCam,0);422 disp30.SetCamError( fRelTimeCam,1);423 disp31.SetCamContent( fRelTimeCam,2);424 disp31.SetCamError( fRelTimeCam,3);425 disp32.SetCamContent( fRelTimeCam,4);450 if (IsRelTimes()) 451 { 452 disp30.SetCamContent(*relcam,0); 453 disp30.SetCamError( *relcam,1); 454 disp31.SetCamContent(*relcam,2); 455 disp31.SetCamError( *relcam,3); 456 disp32.SetCamContent(*relcam,4); 426 457 disp33.SetCamContent(fBadPixels,20); 427 458 disp34.SetCamContent(fBadPixels,21); … … 434 465 } 435 466 436 437 438 467 if (fDisplayType == kDataCheckDisplay) 439 468 { … … 739 768 if (geomcam.InheritsFrom("MGeomCamMagic")) 740 769 DisplayDoubleProject(&disp29, "", "jittering"); 741 742 770 743 771 // … … 884 912 obj9->Draw(); 885 913 886 if ( fRelTimes)914 if (IsRelTimes()) 887 915 { 888 916 // Rel. Times … … 955 983 disp29.CamDraw(c16, 2, 2, 5); 956 984 957 if ( fRelTimes)985 if (IsRelTimes()) 958 986 { 959 987 // Rel. Times … … 1052 1080 disp29.CamDraw(c30, 2, 2, 1); 1053 1081 1054 if ( fRelTimes)1082 if (IsRelTimes()) 1055 1083 { 1056 1084 // Rel. Times … … 1142 1170 { 1143 1171 1144 const Float_t mean = hist->GetFunction("gaus")->GetParameter(1); 1145 const Float_t lolim = mean - 4.0*hist->GetFunction("gaus")->GetParameter(2); 1146 const Float_t uplim = mean + 4.0*hist->GetFunction("gaus")->GetParameter(2); 1172 const Int_t kNotDraw = 1<<9; 1173 TF1 *f = hist->GetFunction("gaus"); 1174 f->ResetBit(kNotDraw); 1175 1176 const Float_t mean = f->GetParameter(1); 1177 const Float_t lolim = mean - 4.0*f->GetParameter(2); 1178 const Float_t uplim = mean + 4.0*f->GetParameter(2); 1147 1179 const Stat_t dead = hist->Integral(0,hist->FindBin(lolim)-1); 1148 1180 const Stat_t noisy = hist->Integral(hist->FindBin(uplim)+1,hist->GetNbinsX()+1); … … 1356 1388 SetNormalDisplay(); 1357 1389 1358 SetRelTimeCalibration(GetEnv("RelTimeCalibration", fRelTimes)); 1359 SetDataCheck(GetEnv("Datacheck", fDataCheck)); 1360 SetDebug(GetEnv("Debug", fDebug)); 1390 SetRelTimeCalibration(GetEnv("RelTimeCalibration", IsRelTimes())); 1391 SetDataCheck(GetEnv("Datacheck", IsDataCheck())); 1392 SetDebug(GetEnv("Debug", IsDebug())); 1393 SetIntensity(GetEnv("Intensity", IsIntensity())); 1394 1361 1395 SetUseBlindPixel(GetEnv("UseBlindPixel", IsUseBlindPixel())); 1362 1396 SetUsePINDiode(GetEnv("UsePINDiode", IsUsePINDiode())); … … 1438 1472 // 2) MCalibrationQECam (fQECam) 1439 1473 // 3) MCalibrationChargeCam (fCalibrationCam) 1440 // 4) MCalibrationRelTimeCam (fRelTimeCam) (only if flag fRelTimesis chosen)1474 // 4) MCalibrationRelTimeCam (fRelTimeCam) (only if flag IsRelTimes() is chosen) 1441 1475 // 5) MBadPixelsCam (fBadPixels) 1442 1476 // 6) MCalibrationChargePINDiode … … 1449 1483 // 5) MExtractPINDiode 1450 1484 // 6) MExtractBlindPixel 1451 // 7) MExtractTime (only if flag fRelTimesis chosen)1485 // 7) MExtractTime (only if flag IsRelTimes() is chosen) 1452 1486 // 8) MContinue(MFCosmics) 1453 // 9) MFillH("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode" )1454 // 10) MFillH("MHCalibrationChargeBlindCam", "MExtractedSignalBlindPixel" )1455 // 11) MFillH("MHCalibrationChargeCam", "MExtractedSignalCam" )1456 // 12) MFillH("MHCalibrationChargeCam", "MExtractedSignalCam" )1487 // 9) MFillH("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode", "FillPINDiode") 1488 // 10) MFillH("MHCalibrationChargeBlindCam", "MExtractedSignalBlindPixel", "FillBlindCam") 1489 // 11) MFillH("MHCalibrationChargeCam", "MExtractedSignalCam", "FillChargeCam") 1490 // 12) MFillH("MHCalibrationChargeCam", "MExtractedSignalCam", "FillRelTime") 1457 1491 // 13) MCalibrationChargeCalc 1458 // 14) MFillH("MHCalibrationRelTimeCam", "MArrivalTimeCam") (only if flag fRelTimesis chosen)1492 // 14) MFillH("MHCalibrationRelTimeCam", "MArrivalTimeCam") (only if flag IsRelTimes() is chosen) 1459 1493 // 15) MCalibrationRelTimeCalc 1460 1494 // - Execute MEvtLoop … … 1507 1541 plist.AddToList(&tlist); 1508 1542 plist.AddToList(this); // take care of fDisplay! 1509 1510 MReadMarsFile read("Events");1511 MRawFileRead rawread(NULL);1512 1543 1513 1544 MDirIter iter; … … 1528 1559 } 1529 1560 1530 if (fDataCheck) 1561 // 1562 // Input containers 1563 // 1564 plist.AddToList(&pedcam); 1565 plist.AddToList(&fBadPixels); 1566 1567 // 1568 // Calibration Results containers 1569 // 1570 if (IsIntensity()) 1571 { 1572 plist.AddToList(&fIntensQECam); 1573 plist.AddToList(&fIntensCalibCam); 1574 // plist.AddToList(&fIntensCalibrationBlindCam); 1575 // plist.AddToList(&fIntensCalibrationPINDiode); 1576 plist.AddToList(&fIntensRelTimeCam); 1577 } 1578 else 1579 { 1580 plist.AddToList(&fQECam); 1581 plist.AddToList(&fCalibrationCam); 1582 plist.AddToList(&fCalibrationBlindCam); 1583 plist.AddToList(&fCalibrationPINDiode); 1584 plist.AddToList(&fRelTimeCam); 1585 } 1586 1587 // 1588 // Initialize two histogram containers which could be modified in this class 1589 // 1590 MHCalibrationChargeCam chargecam; 1591 MHCalibrationChargeBlindCam blindcam; 1592 plist.AddToList(&chargecam); 1593 plist.AddToList(&blindcam); 1594 1595 // 1596 // Data Reading tasks 1597 // 1598 MReadMarsFile read("Events"); 1599 MRawFileRead rawread(NULL); 1600 1601 if (IsDataCheck()) 1531 1602 { 1532 1603 rawread.AddFiles(fSequence.IsValid() ? iter : *fRuns); … … 1540 1611 } 1541 1612 1542 MHCalibrationChargeCam chargecam; 1543 MHCalibrationChargeBlindCam blindcam; 1544 1545 plist.AddToList(&pedcam); 1546 plist.AddToList(&chargecam); 1547 plist.AddToList(&blindcam); 1548 plist.AddToList(&fBadPixels); 1549 plist.AddToList(&fQECam); 1550 plist.AddToList(&fCalibrationCam); 1551 plist.AddToList(&fCalibrationBlindCam); 1552 plist.AddToList(&fCalibrationPINDiode); 1553 plist.AddToList(&fRelTimeCam); 1554 1613 // 1614 // Other Tasks 1615 // 1555 1616 MGeomApply apply; 1556 1617 apply.SetGeometry(fGeometry); … … 1572 1633 } 1573 1634 1574 if ( fDebug)1635 if (IsDebug()) 1575 1636 { 1576 1637 chargecam.SetDebug(); … … 1579 1640 1580 1641 // 1581 // As long as there are no DM's, have to colour by hand 1582 // 1583 chargecam.SetColor (fColor); 1584 calcalc.SetPulserColor(fColor); 1585 1642 // Calibration histogramming 1643 // 1586 1644 MFillH fillpin("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode", "FillPINDiode"); 1587 1645 MFillH fillbnd("MHCalibrationChargeBlindCam", "MExtractedSignalBlindPixel", "FillBlindCam"); … … 1613 1671 MContinue cont(&cosmics); 1614 1672 1673 MTaskEnv taskenv("ExtractSignal"); 1674 taskenv.SetDefault(fExtractor ? fExtractor : &extract2); 1675 1615 1676 tlist.AddToList(&merge); 1616 1677 tlist.AddToList(&apply); 1617 1618 MTaskEnv taskenv("ExtractSignal");1619 taskenv.SetDefault(fExtractor ? fExtractor : &extract2);1620 1621 1678 tlist.AddToList(&taskenv); 1622 1679 tlist.AddToList(&pinext); … … 1626 1683 taskenv2.SetDefault(fTimeExtractor ? fTimeExtractor : ×pline); 1627 1684 1628 if ( fRelTimes)1685 if (IsRelTimes()) 1629 1686 tlist.AddToList(&taskenv2); 1630 1687 1688 // 1689 // FIXME: This is not yet implemented in the classes!!! 1690 // 1631 1691 if (fColor == MCalibrationCam::kCT1) 1632 1692 tlist.AddToList(&cont); 1633 1693 1694 MCalibColorSet colorset; 1695 tlist.AddToList(&colorset); 1696 1697 MCalibColorSteer steer; 1698 if (IsIntensity()) 1699 tlist.AddToList(&steer); 1700 1634 1701 tlist.AddToList(&fillcam); 1635 1702 1636 if ( fRelTimes)1703 if (IsRelTimes()) 1637 1704 { 1638 1705 tlist.AddToList(&filltme); … … 1662 1729 1663 1730 if (!WriteTasks(taskenv.GetTask(), taskenv2.GetTask())) 1664 1731 return kFALSE; 1665 1732 1666 1733 // Execute first analysis … … 1693 1760 if (fDisplay) 1694 1761 { 1695 /*1696 1762 if (IsUsePINDiode()) 1697 1763 { … … 1706 1772 cam->DrawClone(Form("nonew %s",drawoption.Data())); 1707 1773 } 1708 else if ( fRelTimes)1774 else if (IsRelTimes()) 1709 1775 { 1710 1776 MHCalibrationRelTimeCam *cam = … … 1713 1779 } 1714 1780 else 1715 { 1716 MHCalibrationChargeCam *cam = 1717 (MHCalibrationChargeCam*)plist.FindObject("MHCalibrationChargeCam"); 1718 cam->DrawClone(Form("nonew %s",drawoption.Data())); 1719 } */ 1781 chargecam.DrawClone(Form("nonew %s",drawoption.Data())); 1720 1782 } 1721 1783 … … 1896 1958 *fLog << inf << "ok." << endl; 1897 1959 1898 *fLog << inf << " - MCalibrationChargeCam..." << flush; 1899 if (fCalibrationCam.Write()<=0) 1900 { 1901 *fLog << err << "Unable to write MCalibrationChargeCam to " << oname << endl; 1902 return kFALSE; 1903 } 1904 *fLog << inf << "ok." << endl; 1905 1960 if (IsIntensity()) 1961 { 1962 *fLog << inf << " - MCalibrationIntensityChargeCam..." << flush; 1963 if (fIntensCalibCam.Write()<=0) 1964 { 1965 *fLog << err << "Unable to write MCalibrationIntensityChargeCam to " << oname << endl; 1966 return kFALSE; 1967 } 1968 *fLog << inf << "ok." << endl; 1969 1970 *fLog << inf << " - MCalibrationIntensityQECam..." << flush; 1971 if (fIntensQECam.Write()<=0) 1972 { 1973 *fLog << err << "Unable to write MCalibrationIntensityQECam to " << oname << endl; 1974 return kFALSE; 1975 } 1976 *fLog << inf << "ok." << endl; 1977 } 1978 else 1979 { 1980 *fLog << inf << " - MCalibrationChargeCam..." << flush; 1981 if (fCalibrationCam.Write()<=0) 1982 { 1983 *fLog << err << "Unable to write MCalibrationChargeCam to " << oname << endl; 1984 return kFALSE; 1985 } 1986 *fLog << inf << "ok." << endl; 1987 1988 *fLog << inf << " - MCalibrationQECam..." << flush; 1989 if (fQECam.Write()<=0) 1990 { 1991 *fLog << err << "Unable to write MCalibrationQECam to " << oname << endl; 1992 return kFALSE; 1993 } 1994 *fLog << inf << "ok." << endl; 1995 } 1996 1906 1997 *fLog << inf << " - MCalibrationChargeBlindCam..." << flush; 1907 1998 if (fCalibrationBlindCam.Write()<=0) 1908 {1999 { 1909 2000 *fLog << err << "Unable to write MCalibrationChargeBlindCam to " << oname << endl; 1910 2001 return kFALSE; 1911 }2002 } 1912 2003 *fLog << inf << "ok." << endl; 1913 2004 1914 2005 *fLog << inf << " - MCalibrationChargePINDiode..." << flush; 1915 2006 if (fCalibrationPINDiode.Write()<=0) 1916 {2007 { 1917 2008 *fLog << err << "Unable to write MCalibrationChargePINDiode to " << oname << endl; 1918 return kFALSE;1919 }1920 *fLog << inf << "ok." << endl;1921 1922 *fLog << inf << " - MCalibrationQECam..." << flush;1923 if (fQECam.Write()<=0)1924 {1925 *fLog << err << "Unable to write MCalibrationQECam to " << oname << endl;1926 2009 return kFALSE; 1927 2010 } … … 1948 2031 } 1949 2032 1950 if (fRelTimes) 1951 { 1952 *fLog << inf << " - MCalibrationRelTimeCam..." << flush; 1953 if (fRelTimeCam.Write()<=0) 1954 { 1955 *fLog << err << "Unable to write MCalibrationRelTimeCam to " << oname << endl; 1956 return kFALSE; 1957 } 1958 *fLog << inf << "ok." << endl; 2033 if (IsRelTimes()) 2034 { 2035 if (IsIntensity()) 2036 { 2037 *fLog << inf << " - MCalibrationIntensityRelTimeCam..." << flush; 2038 if (fIntensRelTimeCam.Write()<=0) 2039 { 2040 *fLog << err << "Unable to write MCalibrationIntensityRelTimeCam to " << oname << endl; 2041 return kFALSE; 2042 } 2043 *fLog << inf << "ok." << endl; 2044 } 2045 else 2046 { 2047 *fLog << inf << " - MCalibrationRelTimeCam..." << flush; 2048 if (fRelTimeCam.Write()<=0) 2049 { 2050 *fLog << err << "Unable to write MCalibrationRelTimeCam to " << oname << endl; 2051 return kFALSE; 2052 } 2053 *fLog << inf << "ok." << endl; 2054 } 2055 1959 2056 } 1960 2057 … … 1972 2069 outer[0] = 1; 1973 2070 1974 TArrayI s0(6);1975 s0[0] = 6;1976 s0[1] = 1;1977 s0[2] = 2;1978 s0[3] = 3;1979 s0[4] = 4;1980 s0[5] = 5;1981 1982 2071 TArrayI s1(3); 1983 2072 s1[0] = 6; … … 1994 2083 1995 2084 TH1D *inout[2]; 1996 inout[0] = cam->ProjectionS(s0, inner, "Inner"); 1997 inout[1] = cam->ProjectionS(s0, outer, "Outer"); 1998 FixDataCheckHist(inout[0]); 1999 FixDataCheckHist(inout[1]); 2000 2001 inout[0]->SetTitle(Form("%s %s",cam->GetTitle(),"Inner")); 2002 inout[1]->SetTitle(Form("%s %s",cam->GetTitle(),"Outer")); 2003 2085 2004 2086 for (int i=0; i<2; i++) 2005 2087 { … … 2008 2090 gPad->SetTicks(); 2009 2091 2092 inout[i] = cam->ProjectionS(TArrayI(), TArrayI(1,&i), i==0 ? "Inner" : "Outer"); 2093 FixDataCheckHist(inout[i]); 2094 inout[i]->SetTitle(Form("%s %s",cam->GetTitle(),i==0 ? "Inner" : "Outer")); 2010 2095 inout[i]->SetDirectory(NULL); 2011 2096 inout[i]->SetLineColor(kRed+i); 2012 2097 inout[i]->SetBit(kCanDelete); 2013 2098 inout[i]->Draw(); 2014 inout[i]->Fit("gaus", "Q"); 2099 // 2100 // Display the outliers as dead and noisy pixels 2101 // 2102 if (!inout[i]->Fit("gaus","0Q")) 2103 DisplayOutliers(inout[i],whatsmall,whatbig); 2104 2015 2105 gPad->Modified(); 2016 2106 gPad->Update(); … … 2024 2114 2025 2115 TLegend *leg2 = new TLegend(0.55,0.4,0.99,0.6); 2026 //2027 // Display the outliers as dead and noisy pixels2028 //2029 DisplayOutliers(inout[i],whatsmall,whatbig);2030 2116 2031 2117 // … … 2033 2119 // 2034 2120 TH1D *half[2]; 2035 half[0] = cam->ProjectionS(s1, i==0 ? inner : outer, "Sector 6-1-2");2036 half[1] = cam->ProjectionS(s2, i==0 ? inner : outer, "Sector 3-4-5");2121 half[0] = cam->ProjectionS(s1, TArrayI(1,&i), "Sector 6-1-2"); 2122 half[1] = cam->ProjectionS(s2, TArrayI(1,&i), "Sector 3-4-5"); 2037 2123 2038 2124 for (int j=0; j<2; j++) -
trunk/MagicSoft/Mars/mjobs/MJCalibration.h
r4870 r4909 4 4 #ifndef MARS_MJob 5 5 #include "MJob.h" 6 #endif 7 #ifndef MARS_MCalibrationIntensityChargeCam 8 #include "MCalibrationIntensityChargeCam.h" 6 9 #endif 7 10 #ifndef MARS_MCalibrationChargeCam … … 14 17 #include "MCalibrationChargePINDiode.h" 15 18 #endif 19 #ifndef MARS_MCalibrationIntensityRelTimeCam 20 #include "MCalibrationIntensityRelTimeCam.h" 21 #endif 16 22 #ifndef MARS_MCalibrationRelTimeCam 17 23 #include "MCalibrationRelTimeCam.h" 24 #endif 25 #ifndef MARS_MCalibrationIntensityQECam 26 #include "MCalibrationIntensityQECam.h" 18 27 #endif 19 28 #ifndef MARS_MCalibrationQECam … … 41 50 private: 42 51 43 static const Int_t gkIFAEBoxInaugurationRun; //! Run number of first IFAE box calibration44 static const Int_t gkSecondBlindPixelInstallation; //! Run number upon which second blind pixel was installed45 static const Int_t gkThirdBlindPixelInstallation; //! Run number upon which third blind pixel was installed52 static const Int_t gkIFAEBoxInaugurationRun; //! Run number of first IFAE box calibration 53 static const Int_t gkSecondBlindPixelInstallation; //! Run number upon which second blind pixel was installed 54 static const Int_t gkThirdBlindPixelInstallation; //! Run number upon which third blind pixel was installed 46 55 47 static const Double_t fgConvFADC2PheMin; //! Histogram minimum for conversion factor to phes48 static const Double_t fgConvFADC2PheMax; //! Histogram maximum for conversion factor to phes49 static const Double_t fgConvFADC2PhotMin; //! Histogram minimum for conversion factor to phs50 static const Double_t fgConvFADC2PhotMax; //! Histogram maixmum for conversion factor to phs51 static const Double_t fgQEMin; //! Histogram minimum for quantum efficiency52 static const Double_t fgQEMax; //! Histogram maximum for quantum efficiency53 static const Double_t fgArrivalTimeMin; //! Histogram minimum for arrival times54 static const Double_t fgArrivalTimeMax; //! Histogram maximum for arrival times56 static const Double_t fgConvFADC2PheMin; //! Histogram minimum for conversion factor to phes 57 static const Double_t fgConvFADC2PheMax; //! Histogram maximum for conversion factor to phes 58 static const Double_t fgConvFADC2PhotMin; //! Histogram minimum for conversion factor to phs 59 static const Double_t fgConvFADC2PhotMax; //! Histogram maixmum for conversion factor to phs 60 static const Double_t fgQEMin; //! Histogram minimum for quantum efficiency 61 static const Double_t fgQEMax; //! Histogram maximum for quantum efficiency 62 static const Double_t fgArrivalTimeMin; //! Histogram minimum for arrival times 63 static const Double_t fgArrivalTimeMax; //! Histogram maximum for arrival times 55 64 56 static const Float_t fgRefConvFADC2PheInner; //! Reference value for the conversion factor to phes - inner57 static const Float_t fgRefConvFADC2PheOuter; //! Reference value for the conversion factor to phes - outer58 static const Float_t fgRefConvFADC2PhotInner; //! Reference value for the conversion factor to phs - inner59 static const Float_t fgRefConvFADC2PhotOuter; //! Reference value for the conversion factor to phs - outer60 static const Float_t fgRefQEInner; //! Reference value for the quantum eff. cascades - inner61 static const Float_t fgRefQEOuter; //! Reference value for the quantum eff. cascades - outer62 static const Float_t fgRefArrivalTimeInner; //! Reference value for the arrival time - inner63 static const Float_t fgRefArrivalTimeOuter; //! Reference value for the arrival time - outer64 static const Float_t fgRefArrivalTimeRmsInner; //! Reference value for the arrival time - inner65 static const Float_t fgRefArrivalTimeRmsOuter; //! Reference value for the arrival time - outer65 static const Float_t fgRefConvFADC2PheInner; //! Reference value for the conversion factor to phes - inner 66 static const Float_t fgRefConvFADC2PheOuter; //! Reference value for the conversion factor to phes - outer 67 static const Float_t fgRefConvFADC2PhotInner; //! Reference value for the conversion factor to phs - inner 68 static const Float_t fgRefConvFADC2PhotOuter; //! Reference value for the conversion factor to phs - outer 69 static const Float_t fgRefQEInner; //! Reference value for the quantum eff. cascades - inner 70 static const Float_t fgRefQEOuter; //! Reference value for the quantum eff. cascades - outer 71 static const Float_t fgRefArrivalTimeInner; //! Reference value for the arrival time - inner 72 static const Float_t fgRefArrivalTimeOuter; //! Reference value for the arrival time - outer 73 static const Float_t fgRefArrivalTimeRmsInner; //! Reference value for the arrival time - inner 74 static const Float_t fgRefArrivalTimeRmsOuter; //! Reference value for the arrival time - outer 66 75 67 MRunIter *fRuns; // Calibration files76 MRunIter *fRuns; // Calibration files 68 77 69 MExtractor *fExtractor; // Signal extractor70 MExtractTime *fTimeExtractor; // Arrival Time extractor78 MExtractor *fExtractor; // Signal extractor 79 MExtractTime *fTimeExtractor; // Arrival Time extractor 71 80 72 MBadPixelsCam fBadPixels; // Bad Pixels cam, can be set from previous runs 73 MCalibrationChargeCam fCalibrationCam; // Calibration conversion factors FADC2Phe 74 MCalibrationChargeBlindCam fCalibrationBlindCam; // Calibration from Blind Pixel(s) 75 MCalibrationChargePINDiode fCalibrationPINDiode; // Calibration from PIN Diode 76 MCalibrationQECam fQECam; // Quantum efficiency, can be set from previous runs 77 MCalibrationRelTimeCam fRelTimeCam; // Calibration constants rel. times 81 MBadPixelsCam fBadPixels; // Bad Pixels cam, can be set from previous runs 82 MCalibrationIntensityChargeCam fIntensCalibCam; // Calibration conversion factors FADC2Phe for diff. intens. 83 MCalibrationChargeCam fCalibrationCam; // Calibration conversion factors FADC2Phe 84 MCalibrationChargeBlindCam fCalibrationBlindCam; // Calibration from Blind Pixel(s) 85 MCalibrationChargePINDiode fCalibrationPINDiode; // Calibration from PIN Diode 86 MCalibrationIntensityQECam fIntensQECam; // Quantum efficiency for diff. intensities, 87 MCalibrationQECam fQECam; // Quantum efficiency, can be set from previous runs 88 MCalibrationIntensityRelTimeCam fIntensRelTimeCam; // Calibration constants rel. times for diff. intensities 89 MCalibrationRelTimeCam fRelTimeCam; // Calibration constants rel. times 78 90 79 MCalibrationCam::PulserColor_t fColor; // Colour of the pulsed LEDs91 MCalibrationCam::PulserColor_t fColor; // Colour of the pulsed LEDs 80 92 81 enum Display_t // Possible Display types93 enum Display_t // Possible Display types 82 94 { 83 95 kFullDisplay, … … 96 108 Byte_t fDevices; // Bit-field for used devices for calibration 97 109 98 // Combine these options into a single bit-files (TestBit/SetBit, etc) 99 Bool_t fRelTimes; // Flag if relative times have to be calibrated 100 Bool_t fDataCheck; // Flag if the data check is run on raw data 101 Bool_t fDebug; // Flag if debug option is passed onto cal. classes 110 enum { kRelTimes, kDataCheck, kDebug, kIntensity }; // Possible flags 102 111 103 TString fGeometry; 112 Byte_t fFlags; // Bit-field for the flags 113 114 TString fGeometry; // Class name geometry 104 115 105 116 void DisplayResult ( MParList &plist ); … … 110 121 void FixDataCheckHist ( TH1D *hist ) const; 111 122 112 Bool_t WriteResult (TObject *geom);113 Bool_t WriteEventloop( MEvtLoop &evtloop) const;114 Bool_t WriteTasks (MTask *t1, MTask *t2) const;115 Bool_t CheckEnvLocal ();123 Bool_t WriteResult ( TObject *geom ); 124 Bool_t WriteEventloop( MEvtLoop &evtloop ) const; 125 Bool_t WriteTasks ( MTask *t1, MTask *t2) const; 126 Bool_t CheckEnvLocal (); 116 127 117 128 // WORKAROUNDS!!! … … 125 136 const char* GetOutputFile() const; 126 137 127 MCalibrationChargeCam &GetCalibrationCam() { return fCalibrationCam; } 128 MCalibrationRelTimeCam &GetRelTimeCam() { return fRelTimeCam; } 129 MCalibrationQECam &GetQECam() { return fQECam; } 130 MBadPixelsCam &GetBadPixels() { return fBadPixels; } 138 MCalibrationIntensityChargeCam &GetIntensCalibrationCam() { return fIntensCalibCam; } 139 MCalibrationIntensityRelTimeCam &GetIntensRelTimeCam() { return fIntensRelTimeCam; } 140 MCalibrationIntensityQECam &GetIntensQECam() { return fIntensQECam; } 141 142 MCalibrationChargeCam &GetCalibrationCam() { return fCalibrationCam; } 143 MCalibrationRelTimeCam &GetRelTimeCam() { return fRelTimeCam; } 144 MCalibrationQECam &GetQECam() { return fQECam; } 145 MBadPixelsCam &GetBadPixels() { return fBadPixels; } 131 146 132 147 Bool_t IsUseBlindPixel() const; 133 Bool_t IsUsePINDiode() const; 148 Bool_t IsUsePINDiode () const; 149 150 Bool_t IsRelTimes () const { return TESTBIT(fFlags,kRelTimes); } 151 Bool_t IsDataCheck () const { return TESTBIT(fFlags,kDataCheck); } 152 Bool_t IsDebug () const { return TESTBIT(fFlags,kDebug); } 153 Bool_t IsIntensity () const { return TESTBIT(fFlags,kIntensity); } 134 154 135 void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels);}136 void SetExtractor(MExtractor* ext) { fExtractor = ext;}137 void SetTimeExtractor(MExtractTime* ext) { fTimeExtractor = ext; }138 void SetQECam(const MCalibrationQECam &qe) { qe.Copy(fQECam);}139 void SetColor(const MCalibrationCam::PulserColor_t color) { fColor = color; }140 void SetInput(MRunIter *iter) { fRuns = iter;}155 void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); } 156 void SetExtractor(MExtractor* ext) { fExtractor = ext; } 157 void SetTimeExtractor(MExtractTime* ext) { fTimeExtractor = ext; } 158 void SetQECam(const MCalibrationQECam &qe) { qe.Copy(fQECam); } 159 void SetColor(const MCalibrationCam::PulserColor_t color) { fColor = color; } 160 void SetInput(MRunIter *iter) { fRuns = iter; } 141 161 142 162 // Displays … … 148 168 void SetGeometry(const char *geom) { fGeometry = geom; } 149 169 150 // Rel. Time 151 void SetRelTimeCalibration(const Bool_t b=kTRUE) { fRelTimes = b; } 152 153 // Data Check 154 void SetDataCheck(const Bool_t b=kTRUE) { fDataCheck = b; SetDataCheckDisplay(); } 155 156 // Debug 157 void SetDebug(const Bool_t b=kTRUE) { fDebug = b; } 170 // Flags 171 void SetRelTimeCalibration( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kRelTimes) : CLRBIT(fFlags,kRelTimes); } 172 void SetDataCheck ( const Bool_t b=kTRUE ) { b ? SetDataCheckDisplay(), SETBIT(fFlags,kDataCheck) 173 : CLRBIT(fFlags,kDataCheck); } 174 void SetDebug ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kDebug) : CLRBIT(fFlags,kDebug); } 175 void SetIntensity ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kIntensity) : CLRBIT(fFlags,kIntensity); } 158 176 159 177 // Devices
Note:
See TracChangeset
for help on using the changeset viewer.