Changeset 8147 for trunk/MagicSoft/Mars
- Timestamp:
- 10/23/06 13:27:21 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc
r7903 r8147 152 152 if (n!=GetSize()) 153 153 { 154 *fLog << warn << "MBadPixelsCam::Merge: Size mismatch ... ignored." << endl;154 *fLog << warn << "MBadPixelsCam::Merge: Size mismatch (" << n << "," << GetSize() << ")... ignored." << endl; 155 155 return; 156 156 } -
trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc
r8140 r8147 294 294 *fLog << inf << GetDescriptor() << ": Finalize calibration histograms: " << flush; 295 295 296 // This fills the IntensityCam which are newly created by 297 // ReInitialize with the result of the last calib cycle 296 298 if (Finalize("MHCalibrationChargeCam")) *fLog << "MHCalibrationChargeCam..." << flush; 297 299 if (Finalize("MHCalibrationChargeBlindCam")) *fLog << "MHCalibrationChargeBlindCam..." << flush; … … 305 307 if (fChargeCalc) 306 308 { 309 // Finalized Pedestals, Charges, Bad Pixels and all QE cams 307 310 if (!fChargeCalc->Finalize()) 308 311 { -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r8142 r8147 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCalc.cc,v 1.1 69 2006-10-20 18:50:35tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCalc.cc,v 1.170 2006-10-23 12:27:21 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 732 732 // the real number might change from event to event. 733 733 // (up to 50%!) 734 734 735 fNumHiGainSamples = fSignal->GetNumUsedHiGainFADCSlices(); 735 736 fNumLoGainSamples = fSignal->GetNumUsedLoGainFADCSlices(); … … 1003 1004 return kFALSE; 1004 1005 1006 const TString desc = Form("%7s%4d: ", what, cal.GetPixId()); 1007 1005 1008 if (cal.GetMean() < fChargeLimit*cal.GetPedRms()) 1006 1009 { 1007 *fLog << warn 1010 *fLog << warn << desc 1008 1011 << Form("Fitted Charge: %5.2f < %2.1f",cal.GetMean(),fChargeLimit) 1009 << Form(" * Pedestal RMS %5.2f in %s%3i",cal.GetPedRms(),what,cal.GetPixId()) << endl;1012 << Form(" * Pedestal RMS %5.2f",cal.GetPedRms()) << endl; 1010 1013 bad.SetUncalibrated( MBadPixelsPix::kChargeIsPedestal); 1011 1014 } … … 1013 1016 if (cal.GetMean() < fChargeRelErrLimit*cal.GetMeanErr()) 1014 1017 { 1015 *fLog << warn 1018 *fLog << warn << desc 1016 1019 << Form("Fitted Charge: %4.2f < %2.1f",cal.GetMean(),fChargeRelErrLimit) 1017 << Form(" * its error %4.2f in %s%3i",cal.GetMeanErr(),what,cal.GetPixId()) << endl;1020 << Form(" * its error %4.2f",cal.GetMeanErr()) << endl; 1018 1021 bad.SetUncalibrated( MBadPixelsPix::kChargeRelErrNotValid ); 1019 1022 } … … 1021 1024 if (cal.GetSigma() < cal.GetPedRms()) 1022 1025 { 1023 *fLog << warn << "Sigma of Fitted Charge: "1026 *fLog << warn << desc << "Sigma of Fitted Charge: " 1024 1027 << Form("%6.2f <",cal.GetSigma()) << " Ped. RMS=" 1025 << Form("%5.2f", cal.GetPedRms()) << " in " << what 1026 << Form("%3i",cal.GetPixId()) << endl; 1028 << Form("%5.2f", cal.GetPedRms()) << endl; 1027 1029 bad.SetUncalibrated( MBadPixelsPix::kChargeSigmaNotValid ); 1028 1030 return kFALSE; … … 1031 1033 if (!cal.CalcReducedSigma()) 1032 1034 { 1033 *fLog << warn << "Could not calculate the reduced sigma in " << what 1034 << ": " << Form("%4i",cal.GetPixId()) 1035 << endl; 1035 *fLog << warn << desc << "Could not calculate the reduced sigma" << endl; 1036 1036 bad.SetUncalibrated( MBadPixelsPix::kChargeSigmaNotValid ); 1037 1037 return kFALSE; … … 1040 1040 if (!cal.CalcFFactor()) 1041 1041 { 1042 *fLog << warn << "Could not calculate the F-Factor in " << what 1043 << ": " << Form("%4i",cal.GetPixId()) 1044 << endl; 1042 *fLog << warn << desc << "Could not calculate the F-Factor"<< endl; 1045 1043 bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes); 1046 1044 bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun); … … 1058 1056 if (!cal.CalcConvFFactor()) 1059 1057 { 1060 *fLog << warn << "Could not calculate the Conv. FADC counts to Phes in "; 1061 *fLog << what << ": " << Form("%4i", cal.GetPixId()) << endl; 1058 *fLog << warn << desc << "Could not calculate the Conv. FADC counts to Phes"<< endl; 1062 1059 bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes); 1063 1060 return kFALSE; … … 1069 1066 if (!fExtractor) 1070 1067 { 1071 *fLog << err << "Extractor resolution has been chosen, but not extractor is set. Cannot calibrate " << endl;1068 *fLog << err << "Extractor resolution has been chosen, but not extractor is set. Cannot calibrate." << endl; 1072 1069 return kFALSE; 1073 1070 } … … 1083 1080 if (resinfadc > 3.0*cal.GetPedRms() ) 1084 1081 { 1085 *fLog << warn << " Extractor Resolution: " << resinfadc<< " bigger than 3 Pedestal RMS "1086 << cal.GetPedRms() << endl;1082 *fLog << warn << desc << "Extractor Resolution " << Form("%5.2f", resinfadc) << " bigger than 3 Pedestal RMS " 1083 << Form("%4.2f", cal.GetPedRms()) << endl; 1087 1084 resinfadc = 3.0*cal.GetPedRms(); 1088 1085 } … … 1090 1087 if (!cal.CalcReducedSigma(resinfadc)) 1091 1088 { 1092 *fLog << warn << "Could not calculate the reduced sigma in " << what; 1093 *fLog << ": " << Form("%4i",cal.GetPixId()) << endl; 1089 *fLog << warn << desc << "Could not calculate the reduced sigma" << endl; 1094 1090 bad.SetUncalibrated( MBadPixelsPix::kChargeSigmaNotValid ); 1095 1091 return kFALSE; … … 1098 1094 if (!cal.CalcFFactor()) 1099 1095 { 1100 *fLog << warn << "Could not calculate the F-Factor in " << what; 1101 *fLog << ": " << Form("%4i",cal.GetPixId()) << endl; 1096 *fLog << warn << desc << "Could not calculate the F-Factor" << endl; 1102 1097 bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes); 1103 1098 bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun); … … 1115 1110 if (!cal.CalcConvFFactor()) 1116 1111 { 1117 *fLog << warn << "Could not calculate the Conv. FADC counts to Phes in " 1118 << what << ": " << Form("%4i",cal.GetPixId()) 1119 << endl; 1112 *fLog << warn << desc << "Could not calculate the Conv. FADC counts to Phes" << endl; 1120 1113 bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes); 1121 1114 return kFALSE; … … 1135 1128 return; 1136 1129 1130 const TString desc = Form("%7s%4d: ", what, cal.GetPixId()); 1131 1137 1132 if (cal.GetAbsTimeRms() > fArrTimeRmsLimit) 1138 1133 { 1139 1134 *fLog << warn; 1140 *fLog << "RMS of pulse arrival times: " << Form("%2.1f", cal.GetAbsTimeRms()); 1141 *fLog << " FADC sl. < " << Form("%2.1f", fArrTimeRmsLimit); 1142 *fLog << " in " << what << Form("%3i", cal.GetPixId()) << endl; 1135 *fLog << desc << "RMS of pulse arrival times: " << Form("%2.1f", cal.GetAbsTimeRms()); 1136 *fLog << " FADC sl. < " << Form("%2.1f", fArrTimeRmsLimit) << endl; 1143 1137 bad.SetUncalibrated( MBadPixelsPix::kFluctuatingArrivalTimes); 1144 1138 } … … 1310 1304 if (numareavalid[i] == 1) 1311 1305 areavars[i] = 0.; 1312 else if (numareavalid[i] == 0)1313 {1314 areaphes[i] = -1.;1315 areaweights[i] = -1.;1316 }1317 1306 else 1318 1307 { … … 1323 1312 if (areavars[i] < 0.) 1324 1313 { 1325 *fLog << warn << GetDescriptor() << ": No pixels with valid variance of photo-electrons found " 1326 << "in area index: " << i << endl; 1314 *fLog << warn << "Area " << setw(4) << i << ": No pixels with valid variance of photo-electrons found." << endl; 1327 1315 continue; 1328 1316 } … … 1367 1355 if (mean < 0.) 1368 1356 { 1369 *fLog << inf << GetDescriptor() << ": Fitted mean number of photo-electrons " << endl; 1370 *fLog << " with area idx " << i << ": " << mean << " is smaller than 0. " << endl; 1371 *fLog << warn << " Will use the simple mean and rms " << endl; 1357 *fLog << inf << "Area " << setw(4) << i << ": Fitted mean number of phe smaller 0." << endl; 1358 *fLog << warn << "Area " << setw(4) << i << ": Will use the simple mean and rms " << endl; 1372 1359 SetPheFitOK(i,kFALSE); 1373 1360 delete hist; … … 1375 1362 } 1376 1363 1377 *fLog << inf << GetDescriptor() << ": Mean number of phes with area idx " << i << ": "1364 *fLog << inf << "Area " << setw(4) << i << ": Mean number of phes: " 1378 1365 << Form("%7.2f+-%6.2f",mean,sigma) << endl; 1379 1366 … … 1427 1414 if ( nphe < lowlim[aidx] || nphe > upplim[aidx] ) 1428 1415 { 1429 *fLog << warn << "Number of phes:"1430 << Form("%7.2f out of +%3.1f-%3.1f sigma limit :",nphe,fPheErrUpperLimit,fPheErrLowerLimit)1431 << Form("[%7.2f,%7.2f] pixel%4i",lowlim[aidx],upplim[aidx],i) << endl;1416 *fLog << warn << "Pixel " << setw(4) << i << ": Num of phe " 1417 << Form("%7.2f out of +%3.1f-%3.1f sigma limit ",nphe,fPheErrUpperLimit,fPheErrLowerLimit) 1418 << Form("[%7.2f,%7.2f]",lowlim[aidx],upplim[aidx]) << endl; 1432 1419 bad.SetUncalibrated( MBadPixelsPix::kDeviatingNumPhes ); 1433 1420 … … 1447 1434 sectorphes [sector] += nphe/area; 1448 1435 numsectorvalid[sector] ++; 1449 } 1436 } 1450 1437 1451 1438 *fLog << endl; … … 1469 1456 areaphes[aidx] /= numareavalid[aidx]; 1470 1457 } 1471 1458 1472 1459 if (areaweights[aidx] < 0. || areaphes[aidx] <= 0.) 1473 1460 { 1474 *fLog << warn << GetDescriptor() 1475 << ": Mean number phes from area index " << aidx << " could not be calculated: " 1461 *fLog << warn << "Area " << setw(4) << aidx << ": Mean number phes could not be calculated: " 1476 1462 << " Mean: " << areaphes[aidx] 1477 << " Var iance: " << areaweights[aidx] << endl;1463 << " Var: " << areaweights[aidx] << endl; 1478 1464 apix.SetFFactorMethodValid(kFALSE); 1479 1465 continue; 1480 1466 } 1481 1482 *fLog << inf << GetDescriptor() 1483 << ": Average total phes for area idx " << aidx << ": " 1467 1468 *fLog << inf << "Area " << setw(4) << aidx << ": Average total phes: " 1484 1469 << Form("%7.2f +- %6.2f",areaphes[aidx],TMath::Sqrt(areaweights[aidx])) << endl; 1485 1470 1486 1471 apix.SetPheFFactorMethod ( areaphes[aidx] ); 1487 1472 apix.SetPheFFactorMethodVar( areaweights[aidx] / numareavalid[aidx] ); … … 1515 1500 if (sectorweights[sector] < 0. || sectorphes[sector] <= 0.) 1516 1501 { 1517 *fLog << warn << GetDescriptor() 1518 <<": Mean number phes/area for sector " << sector << " could not be calculated: " 1519 << " Mean: " << sectorphes[sector] 1520 << " Variance: " << sectorweights[sector] << endl; 1502 *fLog << warn << "Sector " << setw(4) << sector 1503 <<": Mean number phes/area could not be calculated:" 1504 << " Mean: " << sectorphes[sector] << " Var: " << sectorweights[sector] << endl; 1521 1505 spix.SetFFactorMethodValid(kFALSE); 1522 1506 continue; 1523 1507 } 1524 1508 1525 *fLog << inf << GetDescriptor()1526 << ": Avg number phes/mm^2 in sector " << sector << ": "1509 *fLog << inf << "Sector " << setw(4) << sector 1510 << ": Avg number phes/mm^2: " 1527 1511 << Form("%5.3f+-%4.3f",sectorphes[sector],TMath::Sqrt(sectorweights[sector])) 1528 1512 << endl; … … 1558 1542 { 1559 1543 *fLog << warn << GetDescriptor() 1560 << " : Could not calculate the Conv. FADC counts to Phes in pixel: "1561 << Form(" %4i",pix.GetPixId())1544 << "Pixel " << setw(4) << pix.GetPixId() 1545 <<": Could not calculate the Conv. FADC counts to Phes" 1562 1546 << endl; 1563 1547 bad.SetUncalibrated( MBadPixelsPix::kDeviatingNumPhes ); … … 1611 1595 if (2.*(lambdacheck-lambda)/(lambdacheck+lambda) > fLambdaCheckLimit) 1612 1596 { 1613 *fLog << warn << GetDescriptor()<< ": Lambda="1597 *fLog << warn << "BlindPix " << i << ": Lambda=" 1614 1598 << Form("%4.2f", lambda) << " and Lambda-Check=" 1615 1599 << Form("%4.2f", lambdacheck) << " differ by more than " 1616 << Form("%4.2f", fLambdaCheckLimit) << " in the Blind Pixel Nr." 1617 << Form("%2i", i) << endl; 1600 << Form("%4.2f", fLambdaCheckLimit) << endl; 1618 1601 blindpix.SetValid(kFALSE); 1619 1602 continue; … … 1622 1605 if (lambdaerr > fLambdaErrLimit) 1623 1606 { 1624 *fLog << warn << GetDescriptor()<< ": Error of Fitted Lambda="1607 *fLog << warn << "BlindPix " << i << ": Error of Fitted Lambda=" 1625 1608 << Form("%4.2f", lambdaerr) << " is greater than " 1626 << Form("%4.2f", fLambdaErrLimit) 1627 << " in Blind Pixel Nr." << Form("%2d", i) << endl; 1609 << Form("%4.2f", fLambdaErrLimit) << endl; 1628 1610 blindpix.SetValid(kFALSE); 1629 1611 continue; … … 1668 1650 if (fPINDiode->GetMean() < fChargeLimit*fPINDiode->GetPedRms()) 1669 1651 { 1670 *fLog << warn << GetDescriptor() << ": Fitted Charge is smaller than "1671 << fChargeLimit << " Pedestal RMS in PINDiode" << endl;1652 *fLog << warn << "PINDiode : Fitted Charge is smaller than " 1653 << fChargeLimit << " Pedestal RMS." << endl; 1672 1654 return kFALSE; 1673 1655 } … … 1675 1657 if (fPINDiode->GetMeanErr() < fChargeErrLimit) 1676 1658 { 1677 *fLog << warn << GetDescriptor() << ": Error of Fitted Charge is smaller than "1678 << fChargeErrLimit << " in PINDiode " <<endl;1659 *fLog << warn << "PINDiode : Error of Fitted Charge is smaller than " 1660 << fChargeErrLimit << endl; 1679 1661 return kFALSE; 1680 1662 } … … 1682 1664 if (fPINDiode->GetMean() < fChargeRelErrLimit*fPINDiode->GetMeanErr()) 1683 1665 { 1684 *fLog << warn << GetDescriptor() << ": Fitted Charge is smaller than "1685 << fChargeRelErrLimit << "* its error in PINDiode" << endl;1666 *fLog << warn << "PINDiode : Fitted Charge is smaller than " 1667 << fChargeRelErrLimit << "* its error" << endl; 1686 1668 return kFALSE; 1687 1669 } … … 1689 1671 if (fPINDiode->GetSigma() < fPINDiode->GetPedRms()) 1690 1672 { 1691 *fLog << warn << GetDescriptor() 1692 << ": Sigma of Fitted Charge smaller than Pedestal RMS in PINDiode " << endl; 1673 *fLog << warn << "PINDiode : Sigma of Fitted Charge smaller than Pedestal RMS" << endl; 1693 1674 return kFALSE; 1694 1675 } … … 1697 1678 if (!fPINDiode->CalcFluxOutsidePlexiglass()) 1698 1679 { 1699 *fLog << warn << "Could not calculate the flux of photons from the PIN Diode, "1680 *fLog << warn << "PINDiode : Could not calculate the flux of photons, " 1700 1681 << "will skip PIN Diode Calibration " << endl; 1701 1682 return kFALSE; … … 1905 1886 } 1906 1887 1907 *fLog << inf << GetDescriptor() << ": Mean F-Factor "1908 << "with area index #" << i << ": " <<Form("%4.2f+-%4.2f",mean,sigma) << endl;1888 *fLog << inf << "Area " << setw(4) << i <<": Mean F-Factor :" 1889 << Form("%4.2f+-%4.2f",mean,sigma) << endl; 1909 1890 1910 1891 lowlim [i] = 1.; … … 1932 1913 if ( ffactor < lowlim[aidx] || ffactor > upplim[aidx] ) 1933 1914 { 1934 *fLog << warn << "Overall F-Factor "1915 *fLog << warn << "Pixel " << setw(4) << i<< ": Overall F-Factor " 1935 1916 << Form("%5.2f",ffactor) << " out of range [" 1936 << Form("%5.2f,%5.2f",lowlim[aidx],upplim[aidx]) << "] Pixel " << i<< endl;1917 << Form("%5.2f,%5.2f",lowlim[aidx],upplim[aidx]) << "]" << endl; 1937 1918 1938 1919 bad.SetUncalibrated( MBadPixelsPix::kDeviatingFFactor ); -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc
r7188 r8147 799 799 if (convrelvar > limit || convrelvar < 0.) 800 800 { 801 *fLog << warn << GetDescriptor() << ": Conv. F-Factor Method Rel. Var.: "802 << Form("%4.3f out of limits: [0,%3.2f] in pixel:%4i",convrelvar,limit,fPixId) << endl;803 return kFALSE;801 *fLog << warn << "pixel " << setw(4) << fPixId << ": Conv. F-Factor Method Rel. Var.: " 802 << Form("%4.3f out of limits: [0,%3.2f]",convrelvar,limit) << endl; 803 return kFALSE; 804 804 } 805 805 -
trunk/MagicSoft/Mars/mfbase/MFDataPhrase.cc
r8091 r8147 116 116 *fLog << inf << "found: "; 117 117 fData->Print(); 118 *fLog << endl; 118 119 } 119 120 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc
r7886 r8147 719 719 720 720 const Float_t sumhi = pix.GetExtractedSignalHiGain(); 721 const Bool_t sathi = pix.IsHiGainSaturated();721 const Int_t sathi = pix.IsHiGainSaturated() ? 1 : 0; 722 722 723 723 if (IsOscillations()) … … 742 742 { 743 743 MHCalibrationChargePix &histlo = (MHCalibrationChargePix&)(*this)(i); 744 const Float_t sumlo 745 const Int_t satlo = (Int_t)pix.GetNumLoGainSaturated();744 const Float_t sumlo = pix.GetExtractedSignalLoGain(); 745 const Int_t satlo = pix.IsLoGainSaturated() ? 1 : 0; 746 746 747 747 if (IsOscillations()) … … 1130 1130 if (mean<lowerlimit) 1131 1131 { 1132 *fLog << warn << "Mean Arr.Time: "1132 *fLog << warn << hist.GetName() << ": Mean Arr.Time: " 1133 1133 << Form("%4.1f < %4.1f, %3.1f", mean, TMath::Floor(first)+fTimeLowerLimit, fTimeLowerLimit) 1134 << " slices below " << Form("%2i", (Int_t)first) << " in " 1135 << hist.GetName() << endl; 1134 << " slices below " << Form("%2i", (Int_t)first) << endl; 1136 1135 bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInFirstBin ); 1137 1136 } … … 1139 1138 if (mean>upperlimit) 1140 1139 { 1141 *fLog << warn << "Mean Arr.Time: "1140 *fLog << warn << hist.GetName() << ": Mean Arr.Time: " 1142 1141 << Form("%4.1f > %4.1f, %3.1f", mean, TMath::Floor(last)-fTimeUpperLimit, fTimeUpperLimit) 1143 << " slices above " << Form("%2i", (Int_t)last) << " in " 1144 << hist.GetName() << endl; 1142 << " slices above " << Form("%2i", (Int_t)last) << endl; 1145 1143 bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInLast2Bins ); 1146 1144 } -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc
r7430 r8147 414 414 Byte_t *end = start + pixel.GetNumHiGainSamples(); 415 415 Byte_t *p = start; 416 Byte_t max = 0;416 Byte_t *max = start; 417 417 Int_t maxpos = 0; 418 418 419 419 while (p < end) 420 420 { 421 if ( (*p > max) && (*p < fSaturationLimit))421 if (*p > *max) 422 422 { 423 max = *p;423 max = p; 424 424 maxpos = p-start-1; 425 425 } … … 433 433 while (p < end) 434 434 { 435 if ( (*p > max) && (*p < fSaturationLimit))435 if (*p > *max) 436 436 { 437 max = *p;437 max = p; 438 438 maxpos = p-start+pixel.GetNumHiGainSamples() - 1; 439 439 } … … 441 441 } 442 442 443 if ( max < fLowerSignalLimit)443 if (*max < fLowerSignalLimit || *max > fSaturationLimit) 444 444 continue; 445 445
Note:
See TracChangeset
for help on using the changeset viewer.