Changeset 7188 for trunk/MagicSoft/Mars/mhcalib
- Timestamp:
- 07/13/05 19:06:26 (19 years ago)
- Location:
- trunk/MagicSoft/Mars/mhcalib
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhcalib/HCalibLinkDef.h
r6598 r7188 15 15 #pragma link C++ class MHCalibrationTestCam+; 16 16 #pragma link C++ class MHCalibrationHiLoCam+; 17 #pragma link C++ class MHCalibrationHiLoPix+; 17 18 #pragma link C++ class MHCalibrationPulseTimeCam+; 18 19 #pragma link C++ class MHPedestalCam+; -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.cc
r7095 r7188 60 60 // + Bool_t fIsLoGainFitRanges; // Are low-gain fit ranges defined? 61 61 // 62 // Class Version 5: 63 // + Int_t fMaxNumEvts; // Max Number of events 62 64 // 63 65 ///////////////////////////////////////////////////////////////////////////// … … 103 105 const Float_t MHCalibrationCam::fgProbLimit = 0.0001; 104 106 const Float_t MHCalibrationCam::fgOverflowLimit = 0.005; 107 const Int_t MHCalibrationCam::fgMaxNumEvts = 4096; 105 108 106 109 const TString MHCalibrationCam::gsHistName = "Hist"; … … 141 144 fHistName(gsHistName),fHistTitle(gsHistTitle), 142 145 fHistXTitle(gsHistXTitle),fHistYTitle(gsHistYTitle), 146 fCurrentNumEvts(0), 143 147 fColor(MCalibrationCam::kNONE), fIntensBad(NULL), 144 148 fBadPixels(NULL), fIntensCam(NULL), fCam(NULL), fGeom(NULL), … … 167 171 SetProbLimit(); 168 172 SetOverflowLimit(); 173 SetMaxNumEvts(); 169 174 170 175 SetAverageing (kTRUE); … … 385 390 { 386 391 SetIsReset(); 392 393 fCurrentNumEvts = 0; 387 394 388 395 ResetHistTitles(); … … 543 550 } 544 551 552 fCurrentNumEvts = 0; 553 545 554 return SetupHists(pList); 546 555 } … … 630 639 631 640 MBadPixelsPix &bad = fIntensBad ? (*fIntensBad)[i] : (*fBadPixels)[i]; 632 if (bad.Is Bad())641 if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 633 642 continue; 634 643 … … 649 658 SetLoGain(fRunHeader->GetNumSamplesLoGain()); 650 659 } 660 661 fCurrentNumEvts = 0; 651 662 652 663 if (!ReInitHists(pList)) … … 874 885 Bool_t MHCalibrationCam::Fill(const MParContainer *par, const Stat_t w) 875 886 { 887 if (fCurrentNumEvts >= fMaxNumEvts) 888 return kTRUE; 889 890 fCurrentNumEvts++; 891 876 892 SetIsReset(kFALSE); 877 893 … … 950 966 if (GetNumExecutions() < 2) 951 967 return kTRUE; 968 969 *fLog << inf << GetDescriptor() << ": Number of event used to fill histograms == " << fCurrentNumEvts << endl; 952 970 953 971 if (fHiGainArray->GetSize() == 0 && fLoGainArray->GetSize() == 0) … … 1180 1198 void MHCalibrationCam::CalcAverageSigma() 1181 1199 { 1182 1183 if (!fCam)1184 return;1185 1186 1200 if (!IsAverageing()) 1187 1201 return; 1188 1202 1203 MCalibrationCam *cam = fIntensCam ? fIntensCam->GetCam() : fCam; 1204 if (!cam) 1205 return; 1206 1189 1207 for (UInt_t j=0; j<fGeom->GetNumAreas(); j++) 1190 1208 { 1191 1209 1192 MCalibrationPix &pix = fCam->GetAverageArea(j);1210 MCalibrationPix &pix = cam->GetAverageArea(j); 1193 1211 1194 1212 const Float_t numsqr = TMath::Sqrt((Float_t)fAverageAreaNum[j]); … … 1203 1221 fAverageAreaRelSigmaVar[j] += pix.GetMeanRelVar(); 1204 1222 fAverageAreaRelSigmaVar[j] *= fAverageAreaRelSigma[j]; 1223 } 1224 1225 for (UInt_t j=0; j<fGeom->GetNumSectors(); j++) 1226 { 1227 MCalibrationPix &pix = cam->GetAverageSector(j); 1228 1229 const Float_t numsqr = TMath::Sqrt((Float_t)fAverageSectorNum[j]); 1230 pix.SetSigma (pix.GetSigma() * numsqr); 1231 pix.SetSigmaVar(pix.GetSigmaErr() * pix.GetSigmaErr() * numsqr); 1205 1232 } 1206 1233 } … … 1283 1310 { 1284 1311 *fLog << dbginf << GetDescriptor() << ": ID " << GetName() 1312 << " "<<pix.GetPixId() 1285 1313 << " HiGainSaturation: " << pix.IsHiGainSaturation() 1286 1314 << " HiGainMean: " << hist.GetMean () … … 1374 1402 { 1375 1403 *fLog << dbginf << GetDescriptor() << "ID: " << hist.GetName() 1376 << " HiGainSaturation: " << pix.IsHiGainSaturation() 1404 << " "<<pix.GetPixId() 1405 << " HiGainSaturation: " << pix.IsHiGainSaturation() 1377 1406 << " LoGainMean: " << hist.GetMean () 1378 1407 << " LoGainMeanErr: " << hist.GetMeanErr () … … 1546 1575 rc = kTRUE; 1547 1576 } 1577 1578 if (IsEnvDefined(env, prefix, "MaxNumEvts", print)) 1579 { 1580 SetMaxNumEvts(GetEnvValue(env, prefix, "MaxNumEvts", fMaxNumEvts)); 1581 rc = kTRUE; 1582 } 1548 1583 1549 1584 if (IsEnvDefined(env, prefix, "OverflowLimit", print)) -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.h
r7095 r7188 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) 46 47 static const Int_t fgPulserFrequency; //! The default for fPulserFrequency (now set to: 500) 48 static const Float_t fgProbLimit; //! The default for fProbLimit (now set to: 0.0001) 49 static const Float_t fgOverflowLimit; //! The default for fOverflowLimit (now at: 0.005) 42 static const Double_t fgLowerFitLimitHiGain; //! Default for fLowerFitLimitHiGain 43 static const Double_t fgUpperFitLimitHiGain; //! Default for fUpperFitLimitHiGain 44 static const Double_t fgLowerFitLimitLoGain; //! Default for fLowerFitLimitLoGain 45 static const Double_t fgUpperFitLimitLoGain; //! Default for fUpperFitLimitLoGain 46 47 static const Int_t fgPulserFrequency; //! Default for fPulserFrequency 48 static const Float_t fgProbLimit; //! Default for fProbLimit 49 static const Float_t fgOverflowLimit; //! Default for fOverflowLimit 50 static const Int_t fgMaxNumEvts; //! Default for fMaxNumEvts 50 51 51 52 static const TString gsHistName; //! Default Histogram names … … 78 79 Float_t fNumHiGainSaturationLimit; // Rel. amount sat. higain FADC slices until pixel is called saturated 79 80 Float_t fNumLoGainSaturationLimit; // Rel. amount sat. logain FADC slices until pixel is called saturated 81 82 Int_t fMaxNumEvts; // Max Number of events 83 Int_t fCurrentNumEvts; //! Current number of events 80 84 81 85 MArrayI fRunNumbers; // Numbers of runs used … … 191 195 void DrawPixelContent( Int_t num ) const {} 192 196 197 const MArrayI &GetAverageAreaNum () const { return fAverageAreaNum; } 193 198 const Int_t GetAverageAreas () const; 194 199 MHCalibrationPix &GetAverageHiGainArea (UInt_t i); … … 200 205 MHCalibrationPix &GetAverageLoGainSector(UInt_t i); 201 206 const MHCalibrationPix &GetAverageLoGainSector(UInt_t i) const; 202 const Int_t GetAverageSectors () const; 207 const MArrayI &GetAverageSectorNum () const { return fAverageSectorNum; } 208 const Int_t GetAverageSectors () const; 203 209 const MCalibrationCam::PulserColor_t GetColor () const { return fColor; } 204 210 const Float_t GetNumHiGainSaturationLimit() const { return fNumHiGainSaturationLimit; } … … 234 240 void SetFirst ( const Axis_t f ) { fFirst = f; } 235 241 void SetLast ( const Axis_t f ) { fLast = f; } 242 void SetMaxNumEvts ( const Int_t i=fgMaxNumEvts ) { fMaxNumEvts = i; } 236 243 237 244 void SetProbLimit ( const Float_t f=fgProbLimit) { fProbLimit = f; } … … 242 249 void SetPulserFrequency ( const Int_t i=fgPulserFrequency ) { fPulserFrequency = i; } 243 250 244 ClassDef(MHCalibrationCam, 5) // Base Histogram class for Calibration Camera251 ClassDef(MHCalibrationCam, 6) // Base Histogram class for Calibration Camera 245 252 }; 246 253 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc
r7126 r7188 64 64 // from the mean are counted as Pickup events (stored in MHCalibrationPix::fPickup) 65 65 // 66 // Unless more than fNumHiGainSaturationLimit (default: 1%) of the overall FADC66 // If more than fNumHiGainSaturationLimit (default: 15%) of the overall FADC 67 67 // slices show saturation, the following flag is set: 68 68 // - MCalibrationChargePix::SetHiGainSaturation(); … … 108 108 // sigmas in the camera. 109 109 // 110 // Class Version 2: 111 // + Float_t fNumLoGainBlackoutLimit; // Rel. amount blackout logain events until pixel is declared unsuitable 112 // 110 113 ///////////////////////////////////////////////////////////////////////////// 111 114 #include "MHCalibrationChargeCam.h" … … 157 160 158 161 const Int_t MHCalibrationChargeCam::fgChargeHiGainNbins = 500; 159 const Axis_t MHCalibrationChargeCam::fgChargeHiGainFirst = - 100.125;160 const Axis_t MHCalibrationChargeCam::fgChargeHiGainLast = 1 899.875;162 const Axis_t MHCalibrationChargeCam::fgChargeHiGainFirst = -98.; 163 const Axis_t MHCalibrationChargeCam::fgChargeHiGainLast = 1902.; 161 164 const Int_t MHCalibrationChargeCam::fgChargeLoGainNbins = 500; 162 const Axis_t MHCalibrationChargeCam::fgChargeLoGainFirst = - 100.25;163 const Axis_t MHCalibrationChargeCam::fgChargeLoGainLast = 899.75;165 const Axis_t MHCalibrationChargeCam::fgChargeLoGainFirst = -99.; 166 const Axis_t MHCalibrationChargeCam::fgChargeLoGainLast = 901.; 164 167 const Float_t MHCalibrationChargeCam::fgProbLimit = 0.00000001; 165 168 const TString MHCalibrationChargeCam::gsHistName = "Charge"; … … 173 176 const Float_t MHCalibrationChargeCam::fgNumHiGainSaturationLimit = 0.15; 174 177 const Float_t MHCalibrationChargeCam::fgNumLoGainSaturationLimit = 0.005; 178 const Float_t MHCalibrationChargeCam::fgNumLoGainBlackoutLimit = 0.05; 179 const Float_t MHCalibrationChargeCam::fgLoGainBlackoutLimit = 3.5; 180 const Float_t MHCalibrationChargeCam::fgLoGainPickupLimit = 3.5; 175 181 const Float_t MHCalibrationChargeCam::fgTimeLowerLimit = 1.; 176 182 const Float_t MHCalibrationChargeCam::fgTimeUpperLimit = 3.; … … 189 195 // - fTimeLowerLimit to fgTimeLowerLimit 190 196 // - fTimeUpperLimit to fgTimeUpperLimit 197 // - fNumLoGainBlackoutLimit to fgNumLoGainBlackoutLimit 191 198 // 192 199 // - fNbins to fgChargeHiGainNbins … … 217 224 SetNumHiGainSaturationLimit(fgNumHiGainSaturationLimit); 218 225 SetNumLoGainSaturationLimit(fgNumLoGainSaturationLimit); 226 227 SetNumLoGainBlackoutLimit (fgNumLoGainBlackoutLimit); 219 228 220 229 SetTimeLowerLimit(); … … 571 580 pix.SetAbsTimeFirst(-0.5); 572 581 pix.SetAbsTimeLast(logainsamples-0.5); 573 582 pix.SetPickupLimit(fgLoGainPickupLimit); 583 pix.SetBlackoutLimit(fgLoGainBlackoutLimit); 584 574 585 InitHists(pix,(*badcam)[i],i); 575 586 … … 708 719 709 720 const Float_t sumhi = pix.GetExtractedSignalHiGain(); 710 const Int_t sathi = (Int_t)pix.GetNumHiGainSaturated();721 const Bool_t sathi = pix.GetNumHiGainSaturated()>0; 711 722 712 723 if (IsOscillations()) … … 715 726 histhi.FillHist(sumhi); 716 727 717 histhi.AddSaturated(sathi); 728 histhi.AddSaturated(sathi); 718 729 719 730 const Int_t aidx = (*fGeom)[i].GetAidx(); … … 721 732 722 733 fSumhiarea[aidx] += sumhi; 723 fSathiarea[aidx] += sathi;724 725 734 fSumhisector[sector] += sumhi; 726 fSathisector[sector] += sathi; 735 if (sathi) 736 { 737 fSathiarea[aidx]++; 738 fSathisector[sector]++; 739 } 727 740 728 741 if (IsLoGain()) … … 939 952 continue; 940 953 } 954 955 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*chargecam)[i] ; 956 if (!pix.IsHiGainSaturation()) 957 continue; 941 958 942 959 h = histlo.GetHGausHist(); … … 960 977 } 961 978 962 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*chargecam)[i] ; 963 964 if (pix.IsHiGainSaturation()) 965 FinalizeAbsTimes(histlo, pix, bad, fFirstLoGain, fLastLoGain); 979 FinalizeAbsTimes(histlo, pix, bad, fFirstLoGain, fLastLoGain); 966 980 } 967 981 … … 1063 1077 MBadPixelsPix::kLoGainOscillating); 1064 1078 1079 // 1080 // Check for pixels which have the high-gain saturated, but the low-gain 1081 // switch not applied in sufficient cases. Have to exclude these pixels, 1082 // although they not abnormal. They simply cannot be calibrated... 1083 // 1084 for (Int_t i=0; i<fLoGainArray->GetSize(); i++) 1085 { 1086 1087 MHCalibrationChargePix &histlo = (MHCalibrationChargePix&)(*this)(i); 1088 if (histlo.IsExcluded()) 1089 continue; 1090 1091 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*chargecam)[i] ; 1092 if (!pix.IsHiGainSaturation()) 1093 continue; 1094 1095 // 1096 // Now,treat only low-gain calibrated pixels: 1097 // 1098 const Double_t lim = fNumLoGainBlackoutLimit*histlo.GetHGausHist()->GetEntries(); 1099 if (histlo.GetBlackout() <= lim) 1100 continue; 1101 1102 MBadPixelsPix &bad = (*badcam)[i]; 1103 bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun); 1104 bad.SetUncalibrated(MBadPixelsPix::kLoGainBlackout); 1105 } 1065 1106 1066 1107 return kTRUE; … … 1128 1169 MCalibrationPix &pix = (*chargecam)[i]; 1129 1170 1130 if (bad.IsUncalibrated( MBadPixelsPix::kHiGainNotFitted))1131 if (!pix.IsHiGainSaturation())1132 bad.SetUnsuitable( MBadPixelsPix::kUnreliableRun);1171 if (bad.IsUncalibrated(MBadPixelsPix::kHiGainNotFitted)) 1172 if (!pix.IsHiGainSaturation()) 1173 bad.SetUnsuitable(MBadPixelsPix::kUnreliableRun); 1133 1174 1134 if (bad.IsUncalibrated( MBadPixelsPix::kLoGainNotFitted))1135 if (pix.IsHiGainSaturation())1136 bad.SetUnsuitable( MBadPixelsPix::kUnreliableRun);1137 1138 if (bad.IsUncalibrated( MBadPixelsPix::kLoGainSaturation))1139 bad.SetUnsuitable( MBadPixelsPix::kUnsuitableRun);1175 if (bad.IsUncalibrated(MBadPixelsPix::kLoGainNotFitted)) 1176 if (pix.IsHiGainSaturation()) 1177 bad.SetUnsuitable(MBadPixelsPix::kUnreliableRun); 1178 1179 if (bad.IsUncalibrated(MBadPixelsPix::kLoGainSaturation)) 1180 bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun); 1140 1181 1141 1182 if (IsOscillations()) 1142 1183 { 1143 if (bad.IsUncalibrated( MBadPixelsPix::kHiGainOscillating )) 1144 bad.SetUnsuitable( MBadPixelsPix::kUnreliableRun ); 1145 1146 if (bad.IsUncalibrated( MBadPixelsPix::kLoGainOscillating )) 1147 if (pix.IsHiGainSaturation()) 1148 bad.SetUnsuitable( MBadPixelsPix::kUnreliableRun ); 1184 if (bad.IsUncalibrated(MBadPixelsPix::kHiGainOscillating)) 1185 if (!pix.IsHiGainSaturation()) 1186 bad.SetUnsuitable(MBadPixelsPix::kUnreliableRun); 1187 1188 if (bad.IsUncalibrated(MBadPixelsPix::kLoGainOscillating)) 1189 if (pix.IsHiGainSaturation()) 1190 bad.SetUnsuitable(MBadPixelsPix::kUnreliableRun); 1149 1191 } 1150 1192 } 1151 1152 1153 1154 1193 } 1155 1194 … … 1437 1476 } 1438 1477 1478 if (IsEnvDefined(env, prefix, "NumLoGainBlackoutLimit", print)) 1479 { 1480 SetNumLoGainBlackoutLimit(GetEnvValue(env, prefix, "NumLoGainBlackoutLimit", fNumLoGainBlackoutLimit)); 1481 rc = kTRUE; 1482 } 1483 1484 1439 1485 TEnv refenv(fReferenceFile); 1440 1486 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.h
r7043 r7188 44 44 static const TString gsAbsHistYTitle; //! Default Histogram y-axis titles abs.times 45 45 46 static const Float_t fgNumHiGainSaturationLimit; //! The default for fNumHiGainSaturationLimit 47 static const Float_t fgNumLoGainSaturationLimit; //! The default for fNumLoGainSaturationLimit 46 static const Float_t fgNumHiGainSaturationLimit; //! Default for fNumHiGainSaturationLimit 47 static const Float_t fgNumLoGainSaturationLimit; //! Default for fNumLoGainSaturationLimit 48 static const Float_t fgNumLoGainBlackoutLimit; //! Default for fNumLoGainBlackoutLimit (now at: 0.05) 49 50 static const Float_t fgLoGainBlackoutLimit; //! Default for low-gain blackout limit (now at: 3.5) 51 static const Float_t fgLoGainPickupLimit; //! Default for low-gian pickup limit (now at: 3.5) 48 52 49 53 static const Float_t fgTimeLowerLimit; //! Default for fTimeLowerLimit … … 53 57 Axis_t fLoGainFirst; // Lower histogram limit low gain 54 58 Axis_t fLoGainLast; // Upper histogram limit low gain 59 60 Float_t fNumLoGainBlackoutLimit; // Rel. amount blackout logain events until pixel is declared unsuitable 55 61 56 62 TString fAbsHistName; // Histogram names abs.times … … 124 130 void SetLoGainLast ( const Axis_t f ) { fLoGainLast = f; } 125 131 132 void SetNumLoGainBlackoutLimit( const Float_t f=fgNumLoGainBlackoutLimit ) { fNumLoGainBlackoutLimit = f; } 133 126 134 void SetReferenceFile ( const TString ref=fgReferenceFile ) { fReferenceFile = ref; } 127 135 128 136 void SetTimeLowerLimit( const Float_t f=fgTimeLowerLimit ) { fTimeLowerLimit = f; } 129 137 void SetTimeUpperLimit( const Float_t f=fgTimeUpperLimit ) { fTimeUpperLimit = f; } 130 138 139 // MHCamEvent 131 140 Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const { return kTRUE; } 132 141 void DrawPixelContent( Int_t num ) const; 133 142 134 ClassDef(MHCalibrationChargeCam, 1) // Histogram class for Charge Camera Calibration143 ClassDef(MHCalibrationChargeCam, 2) // Histogram class for Charge Camera Calibration 135 144 }; 136 145 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePix.h
r5137 r7188 42 42 43 43 // Draws 44 v irtual void Draw(Option_t *opt="");44 void Draw(Option_t *opt=""); 45 45 46 46 ClassDef(MHCalibrationChargePix, 1) // Base Histogram class for Charge Pixel Calibration -
trunk/MagicSoft/Mars/mhcalib/MHGausEvents.cc
r6800 r7188 483 483 option.ToLower(); 484 484 485 Int_t win = 1;485 Int_t win = 1; 486 486 Int_t nofit = 0; 487 487 488 488 if (option.Contains("events")) 489 { 490 option.ReplaceAll("events",""); 491 win += 1; 492 } 489 win += 1; 493 490 if (option.Contains("fourier")) 494 { 495 option.ReplaceAll("fourier",""); 496 win += 2; 497 } 491 win += 2; 498 492 499 493 if (IsEmpty()) … … 779 773 } 780 774 781 782 const Double_t MHGausEvents::GetChiSquare() const783 {784 return ( fFGausFit ? fFGausFit->GetChisquare() : 0.);785 }786 787 788 const Double_t MHGausEvents::GetExpChiSquare() const789 {790 return ( fFExpFit ? fFExpFit->GetChisquare() : 0.);791 }792 793 794 const Int_t MHGausEvents::GetExpNdf() const795 {796 return ( fFExpFit ? fFExpFit->GetNDF() : 0);797 }798 799 800 const Double_t MHGausEvents::GetExpProb() const801 {802 return ( fFExpFit ? fFExpFit->GetProb() : 0.);803 }804 805 806 const Int_t MHGausEvents::GetNdf() const807 {808 return ( fFGausFit ? fFGausFit->GetNDF() : 0);809 }810 811 const Double_t MHGausEvents::GetOffset() const812 {813 return ( fFExpFit ? fFExpFit->GetParameter(0) : 0.);814 }815 816 817 818 // --------------------------------------------------------------------------819 //820 // If fFExpFit exists, returns fit parameter 1 (Slope of Exponential fit),821 // otherwise 0.822 //823 const Double_t MHGausEvents::GetSlope() const824 {825 return ( fFExpFit ? fFExpFit->GetParameter(1) : 0.);826 }827 828 775 // -------------------------------------------------------------------------- 829 776 // … … 839 786 // att.Copy(fHGausHist.GetXaxis()); 840 787 } 841 842 // --------------------------------------------------------------------------843 //844 // Return kFALSE if number of entries is 0845 //846 const Bool_t MHGausEvents::IsEmpty() const847 {848 return !(fHGausHist.GetEntries());849 }850 851 // --------------------------------------------------------------------------852 //853 // Return kTRUE if number of entries is bin content of fNbins+1854 //855 const Bool_t MHGausEvents::IsOnlyOverflow() const856 {857 return fHGausHist.GetEntries() == fHGausHist.GetBinContent(fNbins+1);858 }859 860 // --------------------------------------------------------------------------861 //862 // Return kTRUE if number of entries is bin content of 0863 //864 const Bool_t MHGausEvents::IsOnlyUnderflow() const865 {866 return fHGausHist.GetEntries() == fHGausHist.GetBinContent(0);867 }868 869 870 const Bool_t MHGausEvents::IsExcluded() const871 {872 return TESTBIT(fFlags,kExcluded);873 }874 875 876 const Bool_t MHGausEvents::IsExpFitOK() const877 {878 return TESTBIT(fFlags,kExpFitOK);879 }880 881 const Bool_t MHGausEvents::IsFourierSpectrumOK() const882 {883 return TESTBIT(fFlags,kFourierSpectrumOK);884 }885 886 887 const Bool_t MHGausEvents::IsGausFitOK() const888 {889 return TESTBIT(fFlags,kGausFitOK);890 }891 892 788 893 789 // ----------------------------------------------------------------------------------- … … 929 825 } 930 826 931 // --------------------------------------------------------------------------932 //933 // Set Excluded bit from outside934 //935 void MHGausEvents::SetExcluded(const Bool_t b)936 {937 b ? SETBIT(fFlags,kExcluded) : CLRBIT(fFlags,kExcluded);938 }939 940 941 // -------------------------------------------------------------------942 //943 // The flag setters are to be used ONLY for Monte-Carlo!!944 //945 void MHGausEvents::SetExpFitOK(const Bool_t b)946 {947 948 b ? SETBIT(fFlags,kExpFitOK) : CLRBIT(fFlags,kExpFitOK);949 }950 951 // -------------------------------------------------------------------952 //953 // The flag setters are to be used ONLY for Monte-Carlo!!954 //955 void MHGausEvents::SetFourierSpectrumOK(const Bool_t b)956 {957 958 b ? SETBIT(fFlags,kFourierSpectrumOK) : CLRBIT(fFlags,kFourierSpectrumOK);959 }960 961 962 // -------------------------------------------------------------------963 //964 // The flag setters are to be used ONLY for Monte-Carlo!!965 //966 void MHGausEvents::SetGausFitOK(const Bool_t b)967 {968 b ? SETBIT(fFlags,kGausFitOK) : CLRBIT(fFlags,kGausFitOK);969 970 }971 972 827 // ---------------------------------------------------------------------------- 973 828 // -
trunk/MagicSoft/Mars/mhcalib/MHGausEvents.h
r6800 r7188 4 4 #ifndef ROOT_TH1 5 5 #include <TH1.h> 6 #endif 7 8 #ifndef ROOF_TF1 9 #include <TF1.h> 6 10 #endif 7 11 … … 16 20 class TVirtualPad; 17 21 class TGraph; 18 class MArrayF;19 22 class TH1F; 20 23 class TH1I; 21 24 class TF1; 25 22 26 class MHGausEvents : public MH 23 27 { … … 28 32 const static Int_t fgPowerProbabilityBins; //! Default for fPowerProbabilityBins (now set to: 20) 29 33 30 Float_t *CreateEventXaxis(Int_t n); // Create an x-axis for the Event TGraphs31 Float_t *CreatePSDXaxis (Int_t n);// Create an x-axis for the PSD TGraphs34 Float_t *CreateEventXaxis(Int_t n); // Create an x-axis for the Event TGraphs 35 Float_t *CreatePSDXaxis (Int_t n); // Create an x-axis for the PSD TGraphs 32 36 33 37 protected: 34 38 35 Float_t fEventFrequency; // Event frequency in Hertz (to be set)36 37 39 Int_t fBinsAfterStripping; // Bins for the Gauss Histogram after stripping off the zeros at both ends 38 40 UInt_t fCurrentSize; // Current size of the array fEvents 41 Float_t fEventFrequency; // Event frequency in Hertz (to be set) 39 42 Byte_t fFlags; // Bit field for the fit result bits 40 43 Int_t fPowerProbabilityBins; // Bins for the projected power spectrum … … 82 85 83 86 // Draws 84 void Draw (Option_t *option="");// *MENU*85 void DrawEvents (Option_t *option="");// *MENU*86 void DrawPowerSpectrum (Option_t *option="");// *MENU*87 void DrawPowerProjection( Option_t *option="");// *MENU*87 void Draw ( Option_t *option="" ); // *MENU* 88 void DrawEvents ( Option_t *option="" ); // *MENU* 89 void DrawPowerSpectrum ( Option_t *option="" ); // *MENU* 90 void DrawPowerProjection( Option_t *option="" ); // *MENU* 88 91 89 92 // Fill 90 void FillArray ( const Float_t f );91 Bool_t FillHist ( const Float_t f );92 Bool_t FillHistAndArray ( const Float_t f );93 void FillArray ( const Float_t f ); 94 Bool_t FillHist ( const Float_t f ); 95 Bool_t FillHistAndArray ( const Float_t f ); 93 96 94 97 // Fits 95 Bool_t FitGaus (Option_t *option="RQ0",96 97 const Double_t xmax=0.);// *MENU*98 Bool_t FitGaus ( Option_t *option="RQ0", 99 const Double_t xmin=0., 100 const Double_t xmax=0.); // *MENU* 98 101 99 102 // Inits … … 101 104 102 105 // Getters 103 const Double_t GetChiSquare() const ;104 const Double_t GetExpChiSquare() const ;105 const Int_t GetExpNdf() const ;106 const Double_t GetExpProb() const ;106 const Double_t GetChiSquare() const { return ( fFGausFit ? fFGausFit->GetChisquare() : 0.); } 107 const Double_t GetExpChiSquare() const { return ( fFExpFit ? fFExpFit->GetChisquare() : 0.); } 108 const Int_t GetExpNdf() const { return ( fFExpFit ? fFExpFit->GetNDF() : 0 ); } 109 const Double_t GetExpProb() const { return ( fFExpFit ? fFExpFit->GetProb() : 0.); } 107 110 MArrayF *GetEvents() { return &fEvents; } 108 111 const MArrayF *GetEvents() const { return &fEvents; } 109 const Float_t GetEventFrequency () const { return fEventFrequency;}110 TF1 *GetFExpFit() { return fFExpFit; }112 const Float_t GetEventFrequency () const { return fEventFrequency; } 113 TF1 *GetFExpFit() { return fFExpFit; } 111 114 const TF1 *GetFExpFit() const { return fFExpFit; } 112 115 TF1 *GetFGausFit() { return fFGausFit; } … … 125 128 const Double_t GetMean() const { return fMean; } 126 129 const Double_t GetMeanErr() const { return fMeanErr; } 127 const Int_t GetNdf() const ;128 const Int_t GetNbins() const { return fNbins;}129 const Double_t GetOffset() const ;130 const Int_t GetNdf() const { return ( fFGausFit ? fFGausFit->GetNDF() : 0); } 131 const Int_t GetNbins() const { return fNbins; } 132 const Double_t GetOffset() const { return ( fFExpFit ? fFExpFit->GetParameter(0) : 0.); } 130 133 MArrayF *GetPowerSpectrum() { return fPowerSpectrum; } 131 134 const MArrayF *GetPowerSpectrum() const { return fPowerSpectrum; } … … 133 136 const Double_t GetSigma() const { return fSigma; } 134 137 const Double_t GetSigmaErr() const { return fSigmaErr; } 135 const Double_t GetSlope() const ;138 const Double_t GetSlope() const { return ( fFExpFit ? fFExpFit->GetParameter(1) : 0.); } 136 139 137 const Bool_t IsExcluded() const;138 const Bool_t IsExpFitOK() const;139 const Bool_t IsEmpty() const;140 const Bool_t IsFourierSpectrumOK() const;141 const Bool_t IsGausFitOK() const;142 const Bool_t IsOnlyOverflow() const;143 const Bool_t IsOnlyUnderflow() const;140 const Bool_t IsExcluded() const { return TESTBIT(fFlags,kExcluded); } 141 const Bool_t IsExpFitOK() const { return TESTBIT(fFlags,kExpFitOK); } 142 const Bool_t IsEmpty() const { return !(fHGausHist.GetEntries()); } 143 const Bool_t IsFourierSpectrumOK() const { return TESTBIT(fFlags,kFourierSpectrumOK); } 144 const Bool_t IsGausFitOK() const { return TESTBIT(fFlags,kGausFitOK); } 145 const Bool_t IsOnlyOverflow() const { return fHGausHist.GetEntries() == fHGausHist.GetBinContent(fNbins+1); } 146 const Bool_t IsOnlyUnderflow() const { return fHGausHist.GetEntries() == fHGausHist.GetBinContent(0); } 144 147 145 148 // Prints … … 148 151 // Setters 149 152 void SetEventFrequency ( const Float_t f ) { fEventFrequency = f; } 150 void SetExcluded ( const Bool_t b=kTRUE ) ;151 void SetExpFitOK ( const Bool_t b=kTRUE ) ;152 void SetFourierSpectrumOK( const Bool_t b=kTRUE ) ;153 void SetGausFitOK ( const Bool_t b=kTRUE ) ;153 void SetExcluded ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kExcluded) : CLRBIT(fFlags,kExcluded); } 154 void SetExpFitOK ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kExpFitOK) : CLRBIT(fFlags,kExpFitOK); } 155 void SetFourierSpectrumOK( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kFourierSpectrumOK) : CLRBIT(fFlags,kFourierSpectrumOK); } 156 void SetGausFitOK ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kGausFitOK) : CLRBIT(fFlags,kGausFitOK);} 154 157 void SetLast ( const Double_t d ) { fLast = d; } 155 158 void SetFirst ( const Double_t d ) { fFirst = d; } -
trunk/MagicSoft/Mars/mhcalib/Makefile
r6598 r7188 41 41 MHCalibrationRelTimeCam.cc \ 42 42 MHCalibrationHiLoCam.cc \ 43 MHCalibrationHiLoPix.cc \ 43 44 MHCalibrationTestCam.cc \ 44 45 MHCalibrationPulseTimeCam.cc \
Note:
See TracChangeset
for help on using the changeset viewer.