Changeset 2627 for trunk/MagicSoft/Mars/manalysis/MCalibrationPix.cc
- Timestamp:
- 12/09/03 18:25:21 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCalibrationPix.cc
r2603 r2627 50 50 fSigmaCharge(-1.), 51 51 fErrSigmaCharge(-1.), 52 fRSigma(-1.), 52 53 fChargeProb(-1.), 53 54 fPed(-1.), … … 56 57 fSigmaTime(-1.), 57 58 fTimeProb(-1.), 58 fRCharge(-1.),59 fErrRCharge(-1.),60 fRSigma(-1.),61 59 fFactor(1.3), 62 60 fPheFFactorMethod(-1.), 63 fConversionFFactorMethod(-1.) 61 fConversionFFactorMethod(-1.), 62 fHiGainSaturation(kFALSE) 64 63 { 65 64 … … 102 101 103 102 if (fPed && fPedRms) 104 fHist->SetLowerFitRange(fPed + 1.5*fPedRms); 103 fHist->SetLowerFitRange(3.5*fPedRms); 104 // fHist->SetLowerFitRange(fPed + 3.5*fPedRms); 105 105 else 106 106 *fLog << warn << "Cannot set lower fit range to suppress cosmics: Pedestals not available" << endl; 107 107 108 if(!fHist->FitCharge()) 108 109 if (fHiGainSaturation) 109 110 { 110 *fLog << warn << "Could not fit charges of pixel " << fPixId << endl; 111 fHist->PrintChargeFitResult(); 112 return kFALSE; 111 if(!fHist->FitChargeLoGain()) 112 { 113 *fLog << warn << "Could not fit Lo Gain charges of pixel " << fPixId << endl; 114 fHist->PrintChargeFitResult(); 115 return kFALSE; 116 } 117 } 118 else 119 { 120 if(!fHist->FitChargeHiGain()) 121 { 122 *fLog << warn << "Could not fit Hi Gain charges of pixel " << fPixId << endl; 123 fHist->PrintChargeFitResult(); 124 return kFALSE; 125 } 113 126 } 114 127 128 115 129 fCharge = fHist->GetChargeMean(); 116 130 fErrCharge = fHist->GetChargeMeanErr(); … … 122 136 { 123 137 124 fRCharge = fCharge - fPed;125 fErrRCharge = TMath::Sqrt(fErrCharge*fErrCharge + fPedRms*fPedRms);126 127 138 fRSigma = (fSigmaCharge*fSigmaCharge) - (fPedRms*fPedRms); 128 139 129 140 if (fRSigma > 0. ) 130 141 { 131 fPheFFactorMethod = fFactor * f RCharge*fRCharge / fRSigma;132 fConversionFFactorMethod = fPheFFactorMethod / fRCharge ;142 fPheFFactorMethod = fFactor * fCharge*fCharge / fRSigma; 143 fConversionFFactorMethod = fPheFFactorMethod / fCharge ; 133 144 } 134 145 else … … 144 155 } 145 156 157 146 158 void MCalibrationPix::SetPedestal(Float_t ped, Float_t pedrms) 147 159 { … … 150 162 fPedRms = pedrms; 151 163 152 if ((fRCharge == -1.) && (fCharge > 0.))153 fRCharge = fCharge - fPed;154 if ((fErrRCharge == -1.) && (fErrCharge > 0.))155 fErrRCharge = TMath::Sqrt(fErrCharge*fErrCharge + fPedRms*fPedRms);156 157 164 } 158 165 … … 160 167 { 161 168 162 if (!fHist->FitTime())169 if (fHiGainSaturation) 163 170 { 164 *fLog << warn << "Could not fit times of pixel " << fPixId << endl; 165 fHist->PrintTimeFitResult(); 166 return kFALSE; 171 if(!fHist->FitTimeLoGain()) 172 { 173 *fLog << warn << "Could not fit Lo Gain times of pixel " << fPixId << endl; 174 fHist->PrintTimeFitResult(); 175 return kFALSE; 176 } 167 177 } 168 178 else 179 { 180 if(!fHist->FitTimeHiGain()) 181 { 182 *fLog << warn << "Could not fit Hi Gain times of pixel " << fPixId << endl; 183 fHist->PrintTimeFitResult(); 184 return kFALSE; 185 } 186 } 187 169 188 fTime = fHist->GetTimeMean(); 170 189 fSigmaTime = fHist->GetTimeSigma();
Note:
See TracChangeset
for help on using the changeset viewer.