Changeset 6729 for trunk/MagicSoft
- Timestamp:
- 03/03/05 22:09:52 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mhcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc
r6721 r6729 145 145 using namespace std; 146 146 147 const Byte_t MHCalibrationPulseTimeCam::fgSaturationLimit = 255; 148 const Byte_t MHCalibrationPulseTimeCam::fgLowerSignalLimit = 100; 149 const Int_t MHCalibrationPulseTimeCam::fgNumPixelsRequired = 4; 147 150 const Int_t MHCalibrationPulseTimeCam::fgHiGainNbins = 40; 148 151 const Axis_t MHCalibrationPulseTimeCam::fgHiGainFirst = -0.5; 149 152 const Axis_t MHCalibrationPulseTimeCam::fgHiGainLast = 19.5; 150 153 const Float_t MHCalibrationPulseTimeCam::fgProbLimit = 0.001; 151 const Byte_t MHCalibrationPulseTimeCam::fgLowerSignalLimit = 85;152 154 const TString MHCalibrationPulseTimeCam::gsHistName = "PulseTime"; 153 155 const TString MHCalibrationPulseTimeCam::gsHistTitle = "Extracted Times"; … … 171 173 // - fHistYTitle to gsHistYTitle 172 174 // 175 // - fSaturationLimit to fgSaturationLimit 176 // - fLowerSignalLimit to fgLowerSignalLimit 177 // - fNumPixelsRequired to fgNumPixelsRequired 178 // 173 179 MHCalibrationPulseTimeCam::MHCalibrationPulseTimeCam(const char *name, const char *title) 174 : f RawEvt(NULL)180 : fBadPixels(NULL) 175 181 { 176 182 … … 193 199 SetOscillations(kFALSE); 194 200 201 SetSaturationLimit(); 195 202 SetLowerSignalLimit(); 203 SetNumPixelsRequired(); 196 204 197 205 fInnerRefTime = 5.; … … 242 250 { 243 251 244 f RawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");245 if (!f RawEvt)252 fBadPixels = (MBadPixelsCam*)pList->FindObject("MBadPixelsCam"); 253 if (!fBadPixels) 246 254 { 247 *fLog << err << dbginf << "MRawEvtData not found... aborting." << endl; 248 return kFALSE; 255 *fLog << warn << GetDescriptor() << "MBadPixelsCam not found... " << endl; 249 256 } 250 257 … … 297 304 } 298 305 306 void MHCalibrationPulseTimeCam::InitHiGainArrays(const Int_t npixels, const Int_t nareas, const Int_t nsectors) 307 { 308 309 if (fHiGainArray->GetSize()==0) 310 { 311 for (Int_t i=0; i<npixels; i++) 312 { 313 fHiGainArray->AddAt(new MHCalibrationPix(Form("%sHiGainPix%04d",fHistName.Data(),i), 314 Form("%s High Gain Pixel %4d",fHistTitle.Data(),i)),i); 315 316 MHCalibrationPix &pix = (*this)[i]; 317 pix.SetNbins(fNbins*2); 318 pix.SetFirst(fFirst); 319 pix.SetLast (fLast); 320 321 MBadPixelsPix &bad = fIntensBad ? (*fIntensBad)[i] : (*fBadPixels)[i]; 322 InitHists(pix,bad,i); 323 324 if (fCam) 325 (*fCam)[i].SetPixId(i); 326 } 327 } 328 329 if (!IsAverageing()) 330 return; 331 332 if (fAverageHiGainAreas->GetSize()==0) 333 { 334 for (Int_t j=0; j<nareas; j++) 335 { 336 fAverageHiGainAreas->AddAt(new MHCalibrationPix(Form("%sHiGainArea%d",fHistName.Data(),j), 337 Form("%s High Gain Area Idx %d",fHistTitle.Data(),j)),j); 338 339 MHCalibrationPix &pix = GetAverageHiGainArea(j); 340 341 pix.SetNbins(fNbins*2); 342 pix.SetFirst(fFirst); 343 pix.SetLast (fLast); 344 345 InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadArea(j) : fCam->GetAverageBadArea(j),j); 346 } 347 } 348 349 if (fAverageHiGainSectors->GetSize()==0) 350 { 351 for (Int_t j=0; j<nsectors; j++) 352 { 353 fAverageHiGainSectors->AddAt(new MHCalibrationPix(Form("%sHiGainSector%02d",fHistName.Data(),j), 354 Form("%s High Gain Sector %02d",fHistTitle.Data(),j)),j); 355 MHCalibrationPix &pix = GetAverageHiGainSector(j); 356 357 pix.SetNbins(fNbins); 358 pix.SetFirst(fFirst); 359 pix.SetLast (fLast); 360 361 InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadSector(j) : fCam->GetAverageBadSector(j),j); 362 } 363 } 364 } 299 365 300 366 // -------------------------------------------------------------------------- … … 317 383 { 318 384 319 M ExtractedSignalCam *signal = (MExtractedSignalCam*)par;320 if (! signal)321 { 322 *fLog << err << "No argument in M ExtractedSignalCam::Fill... abort." << endl;385 MRawEvtData *data = (MRawEvtData*)par; 386 if (!data) 387 { 388 *fLog << err << "No argument in MHCalibrationPulseTimeCam::Fill... abort." << endl; 323 389 return kFALSE; 324 390 } … … 332 398 fAverageSectorNum.Reset(); 333 399 334 MRawEvtPixelIter pixel( fRawEvt);400 MRawEvtPixelIter pixel(data); 335 401 while (pixel.Next()) 336 402 { … … 338 404 const Int_t i = pixel.GetPixelId(); 339 405 340 MHCalibrationPix &histhi = (*this)[i]; 341 342 if (histhi.IsExcluded()) 343 continue; 344 345 const MExtractedSignalPix &pix = (*signal)[i]; 346 347 const Int_t sathi = (Int_t)pix.GetNumHiGainSaturated(); 348 349 if (sathi) 350 continue; 406 if (fBadPixels) 407 { 408 MBadPixelsPix &bad = (*fBadPixels)[i]; 409 if (bad.IsUnsuitable()) 410 continue; 411 } 351 412 352 413 Byte_t *start = pixel.GetHiGainSamples(); … … 358 419 while (p < end) 359 420 { 360 if ( *p > max)421 if ((*p > max) && (*p < fSaturationLimit)) 361 422 { 362 363 423 max = *p; 424 maxpos = p-start-1; 364 425 } 365 426 p++; … … 372 433 while (p < end) 373 434 { 374 if ( *p > max)435 if ((*p > max) && (*p < fSaturationLimit)) 375 436 { 376 437 max = *p; … … 384 445 385 446 const Float_t time = (Float_t)maxpos; 386 histhi.FillHist(time); 447 448 (*this)[i].FillHist(time); 387 449 388 // *fLog << inf << time << endl;389 390 450 const Int_t aidx = (*fGeom)[i].GetAidx(); 391 451 const Int_t sector = (*fGeom)[i].GetSector(); … … 403 463 const Int_t npix = fAverageAreaNum[j]; 404 464 405 if (npix == 0) 406 continue; 407 408 MHCalibrationPix &hipix = GetAverageHiGainArea(j); 409 hipix.FillHist(fSumhiarea[j]/npix); 410 465 if (npix > fNumPixelsRequired) 466 GetAverageHiGainArea(j).FillHist(fSumhiarea[j]/npix); 411 467 } 412 468 … … 416 472 const Int_t npix = fAverageSectorNum[j]; 417 473 418 if (npix == 0) 419 continue; 420 421 MHCalibrationPix &hipix = GetAverageHiGainSector(j); 422 hipix.FillHist(fSumhisector [j]/npix); 474 if (npix > 0) 475 GetAverageHiGainSector(j).FillHist(fSumhisector [j]/npix); 423 476 } 424 477 … … 586 639 null->SetDirectory(NULL); 587 640 null->SetBit(kCanDelete); 641 null->SetStats(kFALSE); 588 642 // 589 643 // set the labels bigger … … 638 692 rc = kTRUE; 639 693 694 if (IsEnvDefined(env, prefix, "SaturationLimit", print)) 695 { 696 SetSaturationLimit(GetEnvValue(env, prefix, "SaturationLimit", fSaturationLimit)); 697 rc = kTRUE; 698 } 699 640 700 if (IsEnvDefined(env, prefix, "LowerSignalLimit", print)) 641 701 { … … 644 704 } 645 705 706 if (IsEnvDefined(env, prefix, "NumPixelsRequired", print)) 707 { 708 SetNumPixelsRequired(GetEnvValue(env,prefix,"NumPixelsRequired",fNumPixelsRequired)); 709 rc = kTRUE; 710 } 711 646 712 if (IsEnvDefined(env, prefix, "ReferenceFile", print)) 647 713 { -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.h
r6688 r6729 21 21 private: 22 22 23 static const Byte_t fgLowerSignalLimit; //! Default for fLowerSignalLimit 23 static const Byte_t fgSaturationLimit; //! Default for fSaturationLimit (now set to: 245) 24 static const Byte_t fgLowerSignalLimit; //! Default for fLowerSignalLimit 25 static const Int_t fgNumPixelsRequired; //! Default for fNumPixelsRequired 24 26 25 27 static const Int_t fgHiGainNbins; //! Nr. bins of HiGain Histograms (now set to: 550 ) … … 35 37 static const TString gsHistYTitle; //! Default Histogram y-axis titles 36 38 37 Byte_t fLowerSignalLimit; // Lower signal limit for pulse time extraction 38 39 Byte_t fSaturationLimit; // Highest FADC slice value until being declared saturated 40 Byte_t fLowerSignalLimit; // Lower signal limit for pulse time extraction 41 Int_t fNumPixelsRequired; // Minimum Number of pixels required for averageing 42 39 43 TString fReferenceFile; // File name containing the reference values 40 44 … … 42 46 Float_t fOuterRefTime; // The reference mean arrival time outer pixels 43 47 44 MArray D fSumhiarea ;//!45 MArray D fSumhisector;//!48 MArrayF fSumhiarea ; //! 49 MArrayF fSumhisector; //! 46 50 47 MRawEvtData *fRawEvt; //! Raw event data 51 MBadPixelsCam *fBadPixels; //! Bad Pixels 52 53 void InitHiGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors ); 48 54 49 55 Bool_t SetupHists(const MParList *pList); … … 70 76 void Draw(const Option_t *opt); 71 77 72 void SetReferenceFile ( const TString ref=fgReferenceFile ) { fReferenceFile = ref; } 73 void SetLowerSignalLimit( const Byte_t lim=fgLowerSignalLimit ) { fLowerSignalLimit = lim; } 74 78 void SetReferenceFile ( const TString ref=fgReferenceFile ) { fReferenceFile = ref; } 79 void SetSaturationLimit ( const Byte_t lim=fgSaturationLimit ) { fSaturationLimit = lim; } 80 void SetLowerSignalLimit ( const Byte_t lim=fgLowerSignalLimit ) { fLowerSignalLimit = lim; } 81 void SetNumPixelsRequired( const Byte_t lim=fgNumPixelsRequired ) { fNumPixelsRequired = lim; } 82 75 83 Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const { return kTRUE; } 76 84 void DrawPixelContent( Int_t num ) const;
Note:
See TracChangeset
for help on using the changeset viewer.