Changeset 7005 for trunk/MagicSoft/Mars/mhcalib
- Timestamp:
- 05/10/05 12:13:12 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mhcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.cc
r6926 r7005 52 52 // The flag kAverageing steers if the event-by-event averages are treated at all. 53 53 // 54 // Class Version 5: 55 // + Double_t fLowerFitLimitHiGain; // Lower limit for the fit range for the hi-gain hist 56 // + Double_t fUpperFitLimitHiGain; // Upper limit for the fit range for the hi-gain hist 57 // + Double_t fLowerFitLimitLoGain; // Lower limit for the fit range for the lo-gain hist 58 // + Double_t fUpperFitLimitLoGain; // Upper limit for the fit range for the lo-gain hist 59 // + Bool_t fIsHiGainFitRanges; // Are high-gain fit ranges defined? 60 // + Bool_t fIsLoGainFitRanges; // Are low-gain fit ranges defined? 61 // 62 // 54 63 ///////////////////////////////////////////////////////////////////////////// 55 64 #include "MHCalibrationCam.h" … … 86 95 using namespace std; 87 96 97 const Double_t MHCalibrationCam::fgLowerFitLimitHiGain = 0; 98 const Double_t MHCalibrationCam::fgUpperFitLimitHiGain = 0; 99 const Double_t MHCalibrationCam::fgLowerFitLimitLoGain = 0; 100 const Double_t MHCalibrationCam::fgUpperFitLimitLoGain = 0; 101 88 102 const Int_t MHCalibrationCam::fgPulserFrequency = 500; 89 103 const Float_t MHCalibrationCam::fgProbLimit = 0.0001; 90 104 const Float_t MHCalibrationCam::fgOverflowLimit = 0.005; 105 91 106 const TString MHCalibrationCam::gsHistName = "Hist"; 92 107 const TString MHCalibrationCam::gsHistTitle = ""; 93 108 const TString MHCalibrationCam::gsHistXTitle = ""; 94 109 const TString MHCalibrationCam::gsHistYTitle = "Nr. events"; 110 95 111 // -------------------------------------------------------------------------- 96 112 // … … 116 132 //- SetSizeCheck (kTRUE); 117 133 //- SetInterlaced (kFALSE); 134 //- SetLowerFitLimitHiGain(); 135 //- SetUpperFitLimitHiGain(); 136 //- SetLowerFitLimitLoGain(); 137 //- SetUpperFitLimitLoGain(); 118 138 // 119 139 MHCalibrationCam::MHCalibrationCam(const char *name, const char *title) 120 : fHistName(gsHistName),fHistTitle(gsHistTitle), 121 fHistXTitle(gsHistXTitle),fHistYTitle(gsHistYTitle), 122 fColor(MCalibrationCam::kNONE), fIntensBad(NULL), 123 fBadPixels(NULL), fIntensCam(NULL), fCam(NULL), fGeom(NULL), 124 fRunHeader(NULL) 140 : fIsHiGainFitRanges(kFALSE), fIsLoGainFitRanges(kFALSE), 141 fHistName(gsHistName),fHistTitle(gsHistTitle), 142 fHistXTitle(gsHistXTitle),fHistYTitle(gsHistYTitle), 143 fColor(MCalibrationCam::kNONE), fIntensBad(NULL), 144 fBadPixels(NULL), fIntensCam(NULL), fCam(NULL), fGeom(NULL), 145 fRunHeader(NULL) 125 146 { 126 147 … … 152 173 SetOscillations(kTRUE); 153 174 SetSizeCheck (kTRUE); 175 176 SetLowerFitLimitHiGain(); 177 SetUpperFitLimitHiGain(); 178 SetLowerFitLimitLoGain(); 179 SetUpperFitLimitLoGain(); 154 180 } 155 181 … … 1048 1074 MBadPixelsPix::UncalibratedType_t osctyp) 1049 1075 { 1050 1076 fIsHiGainFitRanges = TMath::Abs(fUpperFitLimitHiGain - fLowerFitLimitHiGain) > 1E-5; 1077 1051 1078 for (Int_t i=0; i<fHiGainArray->GetSize(); i++) 1052 1079 { … … 1097 1124 MBadPixelsPix::UncalibratedType_t osctyp) 1098 1125 { 1099 1126 fIsLoGainFitRanges = TMath::Abs(fUpperFitLimitLoGain - fLowerFitLimitLoGain) > 1E-5; 1127 1100 1128 if (!IsLoGain()) 1101 1129 return; … … 1207 1235 // 2) Fit the Hi Gain histograms with a Gaussian 1208 1236 // 1209 if (!hist.FitGaus()) 1210 // 1211 // 3) In case of failure set the bit Fitted to false and take histogram means and RMS 1212 // 1213 if (!hist.RepeatFit()) 1214 { 1215 hist.BypassFit(); 1216 bad.SetUncalibrated( fittyp ); 1217 } 1237 if (fIsHiGainFitRanges) 1238 { 1239 if (!hist.FitGaus("R",fLowerFitLimitHiGain,fUpperFitLimitHiGain)) 1240 bad.SetUncalibrated( fittyp ); 1241 } 1242 else 1243 if (!hist.FitGaus()) 1244 // 1245 // 3) In case of failure set the bit Fitted to false and take histogram means and RMS 1246 // 1247 if (!hist.RepeatFit()) 1248 { 1249 hist.BypassFit(); 1250 bad.SetUncalibrated( fittyp ); 1251 } 1252 1218 1253 1219 1254 // … … 1291 1326 // 2) Fit the Hi Gain histograms with a Gaussian 1292 1327 // 1293 if (!hist.FitGaus()) 1294 // 1295 // 3) In case of failure set the bit Fitted to false and take histogram means and RMS 1296 // 1297 if (!hist.RepeatFit()) 1298 { 1299 hist.BypassFit(); 1300 if (pix.IsHiGainSaturation()) 1328 if (fIsLoGainFitRanges) 1329 { 1330 if (!hist.FitGaus("R",fLowerFitLimitLoGain,fUpperFitLimitLoGain)) 1301 1331 bad.SetUncalibrated( fittyp ); 1302 } 1303 1332 } 1333 else 1334 if (!hist.FitGaus()) 1335 // 1336 // 3) In case of failure set the bit Fitted to false and take histogram means and RMS 1337 // 1338 if (!hist.RepeatFit()) 1339 { 1340 hist.BypassFit(); 1341 if (pix.IsHiGainSaturation()) 1342 bad.SetUncalibrated( fittyp ); 1343 } 1344 1304 1345 // 1305 1346 // 4) Check for oscillations … … 1429 1470 } 1430 1471 1472 // ----------------------------------------------------------------------------- 1473 // 1474 // Available options 1475 // Debug 1476 // LoGain 1477 // Oscillations 1478 // SizeCheck 1479 // Averageing 1480 // Nbins 1481 // First 1482 // Last 1483 // ProbLimit 1484 // OverflowLimit 1485 // PulserFrequency 1486 // LowerFitLimitHiGain 1487 // UpperFitLimitHiGain 1488 // LowerFitLimitLoGain 1489 // UpperFitLimitLoGain 1490 // 1431 1491 Int_t MHCalibrationCam::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 1432 1492 { … … 1493 1553 rc = kTRUE; 1494 1554 } 1555 1556 if (IsEnvDefined(env, prefix, "LowerFitLimitHiGain", print)) 1557 { 1558 SetLowerFitLimitHiGain(GetEnvValue(env, prefix, "LowerFitLimitHiGain", fLowerFitLimitHiGain)); 1559 rc = kTRUE; 1560 } 1561 1562 if (IsEnvDefined(env, prefix, "UpperFitLimitHiGain", print)) 1563 { 1564 SetUpperFitLimitHiGain(GetEnvValue(env, prefix, "UpperFitLimitHiGain", fUpperFitLimitHiGain)); 1565 rc = kTRUE; 1566 } 1567 1568 if (IsEnvDefined(env, prefix, "LowerFitLimitLoGain", print)) 1569 { 1570 SetLowerFitLimitLoGain(GetEnvValue(env, prefix, "LowerFitLimitLoGain", fLowerFitLimitLoGain)); 1571 rc = kTRUE; 1572 } 1573 1574 if (IsEnvDefined(env, prefix, "UpperFitLimitLoGain", print)) 1575 { 1576 SetUpperFitLimitLoGain(GetEnvValue(env, prefix, "UpperFitLimitLoGain", fUpperFitLimitLoGain)); 1577 rc = kTRUE; 1578 } 1579 1495 1580 1496 1581 return rc; -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.h
r6771 r7005 40 40 41 41 private: 42 static const Double_t fgLowerFitLimitHiGain; //! The default for fLowerFitLimitHiGain (now at: 0) 43 static const Double_t fgUpperFitLimitHiGain; //! The default for fUpperFitLimitHiGain (now at: 0) 44 static const Double_t fgLowerFitLimitLoGain; //! The default for fLowerFitLimitLoGain (now at: 0) 45 static const Double_t fgUpperFitLimitLoGain; //! The default for fUpperFitLimitLoGain (now at: 0) 42 46 43 47 static const Int_t fgPulserFrequency; //! The default for fPulserFrequency (now set to: 500) … … 58 62 Float_t fProbLimit; // Limit for acceptance of probability of Gauss-Fit 59 63 Float_t fOverflowLimit; // Part of maximum allowed overflow events 64 65 Double_t fLowerFitLimitHiGain; // Lower limit for the fit range for the hi-gain hist 66 Double_t fUpperFitLimitHiGain; // Upper limit for the fit range for the hi-gain hist 67 Double_t fLowerFitLimitLoGain; // Lower limit for the fit range for the lo-gain hist 68 Double_t fUpperFitLimitLoGain; // Upper limit for the fit range for the lo-gain hist 69 70 Bool_t fIsHiGainFitRanges; // Are high-gain fit ranges defined? 71 Bool_t fIsLoGainFitRanges; // Are low-gain fit ranges defined? 60 72 61 73 TString fHistName; //! Histogram names … … 211 223 void SetHistXTitle( const char *name ) { fHistXTitle = name; } 212 224 void SetHistYTitle( const char *name ) { fHistYTitle = name; } 225 226 void SetLowerFitLimitHiGain( const Double_t d=fgLowerFitLimitHiGain) { fLowerFitLimitHiGain = d; } 227 void SetUpperFitLimitHiGain( const Double_t d=fgUpperFitLimitHiGain) { fUpperFitLimitHiGain = d; } 228 void SetLowerFitLimitLoGain( const Double_t d=fgLowerFitLimitLoGain) { fLowerFitLimitLoGain = d; } 229 void SetUpperFitLimitLoGain( const Double_t d=fgUpperFitLimitLoGain) { fUpperFitLimitLoGain = d; } 213 230 214 231 void SetNbins ( const Int_t i ) { fNbins = i; } … … 223 240 void SetPulserFrequency ( const Int_t i=fgPulserFrequency ) { fPulserFrequency = i; } 224 241 225 ClassDef(MHCalibrationCam, 4) // Base Histogram class for Calibration Camera242 ClassDef(MHCalibrationCam, 5) // Base Histogram class for Calibration Camera 226 243 }; 227 244
Note:
See TracChangeset
for help on using the changeset viewer.