Changeset 2715 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 12/18/03 17:23:50 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCalibrationCam.cc
r2699 r2715 173 173 MCalibrationPix &MCalibrationCam::operator[](Int_t i) const 174 174 { 175 return *static_cast<MCalibrationPix*>(fPixels->UncheckedAt(i)); 176 } 177 178 // -------------------------------------------------------------------------- 179 // 180 // Return a pointer to the pixel with the requested idx. 181 // NULL if it doesn't exist. 182 // 183 MCalibrationPix *MCalibrationCam::GetCalibrationPix(Int_t idx) const 184 { 185 if (idx<0) 186 return NULL; 187 175 176 if (!CheckBounds(i)) 177 return *static_cast<MCalibrationPix*>(NULL); 178 179 return *static_cast<MCalibrationPix*>(fPixels->UncheckedAt(i)); 180 } 181 182 183 // -------------------------------------------------------------------------- 184 // 185 // Return true if pixel is inside bounds of the TClonesArray fPixels 186 // 187 Bool_t MCalibrationCam::IsPixelUsed(Int_t idx) const 188 { 188 189 if (!CheckBounds(idx)) 189 return NULL; 190 191 return (MCalibrationPix*)fPixels->At(idx); 192 } 193 194 195 196 197 Bool_t MCalibrationCam::IsPixelUsed(Int_t idx) const 198 { 190 return kFALSE; 191 192 return kTRUE; 193 } 194 195 // -------------------------------------------------------------------------- 196 // 197 // Return true if pixel has already been fitted once (independent of the result) 198 // 199 Bool_t MCalibrationCam::IsPixelFitted(Int_t idx) const 200 { 201 199 202 if (!CheckBounds(idx)) 200 203 return kFALSE; 201 204 202 return kTRUE; 203 } 204 205 Bool_t MCalibrationCam::IsPixelFitted(Int_t idx) const 206 { 207 return ((*this)[idx].GetCharge() > 0. && (*this)[idx].GetErrCharge() > 0.); 208 } 209 210 211 205 return (*this)[idx].IsFitted(); 206 } 207 208 // -------------------------------------------------------------------------- 209 // 210 // Return TRUE if: 211 // 212 // 1) Pixel is inside the range of the TClonesArray 213 // 2) Pixel has a fitted charge greater than 3*PedRMS 214 // 3) Pixel has a charge sigma bigger than its Pedestal RMS 215 // 4) Pixel has a fit error greater than 0. 216 // 5) Pixel has a fit Probability greater than 0.0001 217 // 6) If FitTimes is used, 218 // the mean arrival time is at least 1.5 slices from the edge 219 // 220 Bool_t MCalibrationCam::IsPixelFitValid(Int_t idx) const 221 { 222 223 if (!CheckBounds(idx)) 224 return kFALSE; 225 226 return (*this)[idx].IsFitValid(); 227 } 228 229 // -------------------------------------- 230 // 212 231 void MCalibrationCam::Clear(Option_t *o) 213 232 { … … 215 234 } 216 235 236 // -------------------------------------------------------------------------- 237 // 238 // Sets the user ranges of all histograms such that 239 // empty bins at the edges are not used. Additionally, it rebins the 240 // histograms such that in total, 50 bins are used. 241 // 217 242 void MCalibrationCam::CutEdges() 218 243 { 219 244 220 245 fBlindPixel->GetHist()->CutAllEdges(); 246 fPINDiode->GetHist()->CutAllEdges(); 221 247 222 248 TIter Next(fPixels); … … 230 256 } 231 257 258 // -------------------------------------------------------------------------- 259 // 260 // 261 // 262 // 263 // 232 264 void MCalibrationCam::Print(Option_t *o) const 233 265 { 234 266 235 236 237 238 239 240 241 242 243 244 { 245 246 if (pix-> GetCharge() >= 0.)267 *fLog << all << GetDescriptor() << ":" << endl; 268 int id = 0; 269 270 *fLog << "Succesfully calibrated pixels:" << endl; 271 *fLog << endl; 272 273 TIter Next(fPixels); 274 MCalibrationPix *pix; 275 while ((pix=(MCalibrationPix*)Next())) 276 { 277 278 if (pix->IsFitValid()) 247 279 { 248 280 *fLog << pix->GetPixId() << " Pedestals: " << pix->GetPed() << " +- " << pix->GetPedRms() … … 252 284 } 253 285 } 254 255 256 257 258 259 260 261 262 286 287 *fLog << id << " succesful pixels :-))" << endl; 288 id = 0; 289 290 *fLog << endl; 291 *fLog << "Pixels with errors:" << endl; 292 *fLog << endl; 293 294 TIter Next2(fPixels); 263 295 while ((pix=(MCalibrationPix*)Next2())) 264 {265 266 if (pix->GetCharge() == -1.)267 268 269 296 { 297 298 if (!pix->IsFitValid()) 299 { 300 *fLog << pix->GetPixId() << " Pedestals: " << pix->GetPed() << " +- " << pix->GetPedRms() 301 << " Reduced Charge: " << pix->GetCharge() << " +- " 270 302 << pix->GetSigmaCharge() << " Reduced Sigma: " << TMath::Sqrt(pix->GetRSigmaSquare()) << endl; 271 272 273 }303 id++; 304 } 305 } 274 306 *fLog << id << " pixels with errors :-((" << endl; 275 307 276 308 } 277 309 … … 321 353 val = -1.; 322 354 break; 355 case 11: 356 val = (*this)[idx].GetPheFFactorMethod(); 357 break; 358 case 12: 359 val = (*this)[idx].GetPheFFactorMethodError(); 360 break; 361 case 13: 362 val = (*this)[idx].GetMeanConversionFFactorMethod(); 363 break; 364 case 14: 365 val = (*this)[idx].GetErrorConversionFFactorMethod(); 366 break; 323 367 case 15: 368 if (idx < 397) 369 val = (double)fMeanPhotInsidePlexiglass; 370 else 371 val = (double)fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelArea; 372 break; 373 case 16: 374 if (idx < 397) 375 val = (*this)[idx].GetMeanConversionBlindPixelMethod(); 376 else 377 val = (*this)[idx].GetMeanConversionBlindPixelMethod()*gkCalibrationOutervsInnerPixelArea; 378 break; 379 case 17: 324 380 if ((*this)[idx].GetCharge() != 0.) 325 381 val = ((*this)[idx].GetSigmaCharge()/(*this)[idx].GetCharge())* … … 327 383 else 328 384 val = -1.; 329 break;330 case 11:331 val = (*this)[idx].GetPheFFactorMethod();332 break;333 case 12:334 val = (*this)[idx].GetMeanConversionFFactorMethod();335 break;336 case 13:337 if (idx < 397)338 val = (double)fMeanPhotInsidePlexiglass;339 else340 val = (double)fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelArea;341 break;342 case 14:343 if (idx < 397)344 val = (*this)[idx].GetMeanConversionBlindPixelMethod();345 else346 val = (*this)[idx].GetMeanConversionBlindPixelMethod()*gkCalibrationOutervsInnerPixelArea;347 385 break; 348 386 default: -
trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc
r2699 r2715 56 56 // Default constructor. 57 57 // 58 MExtractSignal::MExtractSignal(const Byte_t first, const Byte_t last, const char *name, const char *title) 58 MExtractSignal::MExtractSignal(const Byte_t first, const Byte_t last, const Byte_t logainshift, 59 const char *name, const char *title) 59 60 : fNumHiGainSamples(last-first+1), fNumLoGainSamples(last-first+1), 60 61 fSaturationLimit(254), fConversionHiLo(10.) … … 66 67 AddToBranchList("MRawEvtData.*"); 67 68 68 fFirst = first; 69 fFirst = first; 70 fLoGainFirst = first+logainshift; 69 71 70 72 fSqrtHiGainSamples = TMath::Sqrt((Float_t)fNumHiGainSamples); … … 186 188 187 189 ptr = pixel.GetLoGainSamples(); 188 first = ptr + f First + 1;189 last = ptr + f First + fNumLoGainSamples +1;190 first = ptr + fLoGainFirst + 1; 191 last = ptr + fLoGainFirst + fNumLoGainSamples +1; 190 192 Byte_t maxlo = 0; 191 193 Byte_t midlo = 0; … … 222 224 pix.SetArrivalTimes((Float_t)(midlo+fFirst),0.,0.); 223 225 else 224 pix.SetArrivalTimes((Float_t)(midhi+f First),0.,0.);226 pix.SetArrivalTimes((Float_t)(midhi+fLoGainFirst),0.,0.); 225 227 226 228 } /* while (pixel.Next()) */ -
trunk/MagicSoft/Mars/manalysis/MExtractSignal.h
r2666 r2715 32 32 33 33 Byte_t fFirst; 34 Byte_t fLoGainFirst; 34 35 35 36 Byte_t fNumHiGainSamples; … … 49 50 public: 50 51 51 MExtractSignal(const Byte_t first=4, const Byte_t last=9, const char *name=NULL, const char *title=NULL);52 MExtractSignal(const Byte_t first=4, const Byte_t last=9, const Byte_t logainshift=1, const char *name=NULL, const char *title=NULL); 52 53 53 54 void SetSaturationLimit(Byte_t lim) { fSaturationLimit = lim; }
Note:
See TracChangeset
for help on using the changeset viewer.