Changeset 5864 for trunk/MagicSoft
- Timestamp:
- 01/16/05 21:46:43 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5861 r5864 24 24 25 25 * mhcalib/MHCalibrationCam.[h,cc] 26 - finished event type recognition and rejection. Only used if 27 SetInterlaced() is set. 26 * mhcalib/MHCalibrationRelTimeCam.[h,cc] 27 * mhcalib/MHCalibrationChargeCam.[h,cc] 28 - put overflow management and results camera initialization into 29 base class 28 30 29 31 * mcalib/MCalibrateData.[h,cc] -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.cc
r5858 r5864 86 86 using namespace std; 87 87 88 const Int_t MHCalibrationCam::fgPulserFrequency = 500; 89 const Float_t MHCalibrationCam::fgProbLimit = 0.0001; 88 const Int_t MHCalibrationCam::fgPulserFrequency = 500; 89 const Float_t MHCalibrationCam::fgProbLimit = 0.0001; 90 const Float_t MHCalibrationCam::fgOverflowLimit = 0.005; 90 91 const TString MHCalibrationCam::gsHistName = "Hist"; 91 92 const TString MHCalibrationCam::gsHistTitle = ""; … … 106 107 // Initializes: 107 108 // - fPulserFrequency to fgPulserFrequency 108 // - fProbLimit to fgProbLimit 109 // - fProbLimit to fgProbLimit 110 // - fOverflowLimit to fgOverflowLimit 109 111 // 110 112 // - SetAveregeing (kTRUE); … … 143 145 SetPulserFrequency(); 144 146 SetProbLimit(); 147 SetOverflowLimit(); 145 148 146 149 SetAverageing (kTRUE); … … 995 998 } 996 999 1000 // ------------------------------------------------------------- 1001 // 1002 // - Searches for the CalibrationIntensity*Cam corresponding to 'name'. 1003 // - In case, it does not exist in the parameter list, it searches 1004 // for the corresponding MCalibration*Cam. 1005 // - Initializes the MCalibration*Cam, if not yet done. 1006 // 1007 Bool_t MHCalibrationCam::InitCams( MParList *plist, const TString name ) 1008 { 1009 1010 TString intensname = "MCalibrationIntensity"; 1011 intensname += name; 1012 intensname += "Cam"; 1013 1014 TString ordname = "MCalibration"; 1015 ordname += name; 1016 ordname += "Cam"; 1017 1018 fIntensCam = (MCalibrationIntensityCam*)plist->FindObject(AddSerialNumber(intensname)); 1019 if (fIntensCam) 1020 *fLog << inf << "Found " << intensname << "... " << endl; 1021 else 1022 { 1023 fCam = (MCalibrationCam*)plist->FindObject(AddSerialNumber(ordname)); 1024 if (!fCam) 1025 { 1026 fCam = (MCalibrationCam*)plist->FindCreateObj(AddSerialNumber(ordname)); 1027 if (!fCam) 1028 { 1029 *fLog << err << "Cannot find nor create " << ordname << " ... abort." << endl; 1030 return kFALSE; 1031 } 1032 fCam->Init(*fGeom); 1033 } 1034 } 1035 return kTRUE; 1036 } 1037 997 1038 // -------------------------------------------------------------------------- 998 1039 // -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.h
r5863 r5864 41 41 private: 42 42 43 static const Int_t fgPulserFrequency; //! The default for fPulserFrequency (now set to: 500) 44 static const Float_t fgProbLimit; //! The default for fProbLimit (now set to: 0.0001) 45 46 static const TString gsHistName; //! Default Histogram names 47 static const TString gsHistTitle; //! Default Histogram titles 48 static const TString gsHistXTitle; //! Default Histogram x-axis titles 49 static const TString gsHistYTitle; //! Default Histogram y-axis titles 43 static const Int_t fgPulserFrequency; //! The default for fPulserFrequency (now set to: 500) 44 static const Float_t fgProbLimit; //! The default for fProbLimit (now set to: 0.0001) 45 static const Float_t fgOverflowLimit; //! The default for fOverflowLimit (now at: 0.005) 46 47 static const TString gsHistName; //! Default Histogram names 48 static const TString gsHistTitle; //! Default Histogram titles 49 static const TString gsHistXTitle; //! Default Histogram x-axis titles 50 static const TString gsHistYTitle; //! Default Histogram y-axis titles 50 51 51 52 protected: … … 56 57 57 58 Float_t fProbLimit; // Limit for acceptance of probability of Gauss-Fit 59 Float_t fOverflowLimit; // Part of maximum allowed overflow events 58 60 59 61 TString fHistName; //! Histogram names … … 64 66 Float_t fNumHiGainSaturationLimit; // Rel. amount sat. higain FADC slices until pixel is called saturated 65 67 Float_t fNumLoGainSaturationLimit; // Rel. amount sat. logain FADC slices until pixel is called saturated 66 Float_t fNumOverflowLimit; // Part of maximum allowed overflow events67 68 68 69 MArrayI fRunNumbers; // Numbers of runs used … … 111 112 virtual void InitHiGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors ); 112 113 virtual void InitLoGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors ); 113 114 114 115 virtual void ResetHistTitles(); 115 116 … … 138 139 MBadPixelsPix::UncalibratedType_t osctyp); 139 140 140 void InitHists ( MHCalibrationPix &hist, MBadPixelsPix &bad, const Int_t i); 141 141 void InitHists ( MHCalibrationPix &hist, MBadPixelsPix &bad, const Int_t i); 142 Bool_t InitCams ( MParList *plist, const TString name ); 143 142 144 Bool_t IsAverageing () const { return TESTBIT(fFlags,kAverageing); } 143 145 Bool_t IsDebug () const { return TESTBIT(fFlags,kDebug); } … … 218 220 void SetNumLoGainSaturationLimit( const Float_t lim ) { fNumLoGainSaturationLimit = lim; } 219 221 void SetNumHiGainSaturationLimit( const Float_t lim ) { fNumHiGainSaturationLimit = lim; } 220 void Set NumOverflowLimit ( const Float_t lim ) { fNumOverflowLimit = lim; }221 void SetPulserFrequency ( const Int_t f=fgPulserFrequency) { fPulserFrequency = f;}222 void SetOverflowLimit ( const Float_t f=fgOverflowLimit ) { fOverflowLimit = f; } 223 void SetPulserFrequency ( const Int_t i=fgPulserFrequency ) { fPulserFrequency = i; } 222 224 223 225 ClassDef(MHCalibrationCam, 4) // Base Histogram class for Calibration Camera -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindCam.cc
r5137 r5864 156 156 { 157 157 158 if (!InitCams(pList,"Blind")) 159 return kFALSE; 160 158 161 MExtractedSignalBlindPixel *signal = 159 162 (MExtractedSignalBlindPixel*)pList->FindObject(AddSerialNumber("MExtractedSignalBlindPixel")); … … 163 166 return kFALSE; 164 167 } 165 166 fIntensCam = (MCalibrationIntensityCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityBlindCam"));167 if (fIntensCam)168 *fLog << inf << "Found MCalibrationIntensityBlindCam ... " << endl;169 else170 {171 fCam = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationBlindCam"));172 if (!fCam)173 {174 fCam = (MCalibrationCam*)pList->FindCreateObj(AddSerialNumber("MCalibrationBlindCam"));175 if (!fCam)176 {177 *fLog << err << "Cannot find nor create MCalibrationBlindCam ... abort." << endl;178 return kFALSE;179 }180 }181 }182 168 183 169 const Int_t nblindpixels = signal->GetNumBlindPixels(); -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc
r5773 r5864 172 172 const Float_t MHCalibrationChargeCam::fgNumHiGainSaturationLimit = 0.01; 173 173 const Float_t MHCalibrationChargeCam::fgNumLoGainSaturationLimit = 0.005; 174 const Float_t MHCalibrationChargeCam::fgNumOverflowLimit = 0.005;175 174 const Float_t MHCalibrationChargeCam::fgTimeLowerLimit = 1.; 176 175 const Float_t MHCalibrationChargeCam::fgTimeUpperLimit = 2.; … … 220 219 SetNumHiGainSaturationLimit(fgNumHiGainSaturationLimit); 221 220 SetNumLoGainSaturationLimit(fgNumLoGainSaturationLimit); 222 SetNumOverflowLimit(fgNumOverflowLimit);223 221 224 222 SetTimeLowerLimit(); … … 361 359 } 362 360 363 fIntensCam = (MCalibrationIntensityCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityChargeCam")); 364 if (fIntensCam) 365 *fLog << inf << "Found MCalibrationIntensityChargeCam ... " << endl; 366 else 367 { 368 fCam = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationChargeCam")); 369 if (!fCam) 370 { 371 fCam = (MCalibrationCam*)pList->FindCreateObj(AddSerialNumber("MCalibrationChargeCam")); 372 if (!fCam) 373 { 374 *fLog << err << "Cannot find nor create MCalibrationChargeCam ... abort." << endl; 375 return kFALSE; 376 } 377 fCam->Init(*fGeom); 378 } 379 } 361 if (!InitCams(pList,"Charge")) 362 return kFALSE; 380 363 381 364 fFirstHiGain = signal->GetFirstUsedSliceHiGain(); … … 383 366 fFirstLoGain = signal->GetFirstUsedSliceLoGain(); 384 367 fLastLoGain = signal->GetLastUsedSliceLoGain(); 385 386 /*387 const Float_t numhigain = signal->GetNumUsedHiGainFADCSlices();388 const Float_t numlogain = signal->GetNumUsedLoGainFADCSlices();389 390 if (fCam)391 {392 if (fCam->GetNumHiGainFADCSlices() == 0.)393 fCam->SetNumHiGainFADCSlices ( numhigain );394 else if (fCam->GetNumHiGainFADCSlices() != numhigain)395 {396 *fLog << err << GetDescriptor()397 << ": Number of High Gain FADC extraction slices has changed, abort..." << endl;398 return kFALSE;399 }400 401 if (fCam->GetNumLoGainFADCSlices() == 0.)402 fCam->SetNumLoGainFADCSlices ( numlogain );403 else if (fCam->GetNumLoGainFADCSlices() != numlogain)404 {405 *fLog << err << GetDescriptor()406 << ": Number of Low Gain FADC extraction slices has changes, abort..." << endl;407 return kFALSE;408 }409 }410 */411 368 412 369 const Int_t npixels = fGeom->GetNumPixels(); … … 928 885 929 886 Stat_t overflow = h->GetBinContent(h->GetNbinsX()+1); 930 if (overflow > f NumOverflowLimit*histhi.GetHGausHist()->GetEntries())887 if (overflow > fOverflowLimit*histhi.GetHGausHist()->GetEntries()) 931 888 { 932 889 *fLog << warn … … 937 894 938 895 overflow = h->GetBinContent(0); 939 if (overflow > f NumOverflowLimit*histhi.GetHGausHist()->GetEntries())896 if (overflow > fOverflowLimit*histhi.GetHGausHist()->GetEntries()) 940 897 { 941 898 *fLog << warn … … 970 927 971 928 Stat_t overflow = h->GetBinContent(h->GetNbinsX()+1); 972 if (overflow > f NumOverflowLimit*histlo.GetHGausHist()->GetEntries())929 if (overflow > fOverflowLimit*histlo.GetHGausHist()->GetEntries()) 973 930 { 974 931 *fLog << warn … … 979 936 980 937 overflow = h->GetBinContent(0); 981 if (overflow > f NumOverflowLimit*histlo.GetHGausHist()->GetEntries())938 if (overflow > fOverflowLimit*histlo.GetHGausHist()->GetEntries()) 982 939 { 983 940 *fLog << warn -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.h
r5773 r5864 44 44 static const Float_t fgNumHiGainSaturationLimit; //! The default for fNumHiGainSaturationLimit (now at: 0.01) 45 45 static const Float_t fgNumLoGainSaturationLimit; //! The default for fNumLoGainSaturationLimit (now at: 0.005) 46 static const Float_t fgNumOverflowLimit; //! The default for fNumOverflowLimit (now at: 0.005)47 46 48 47 static const Float_t fgTimeLowerLimit; //! Default for fTimeLowerLimit (now set to: 1.) … … 58 57 Axis_t fLoGainLast; // Upper histogram limit low gain 59 58 60 Float_t fNumOverflowLimit; // Part of maximum allowed overflow events61 62 59 TString fAbsHistName; // Histogram names abs.times 63 60 TString fAbsHistTitle; // Histogram titles abs. times … … 117 114 void SetLoGainLast ( const Axis_t f ) { fLoGainLast = f; } 118 115 119 void SetNumOverflowLimit ( const Float_t f=fgNumOverflowLimit ) { fNumOverflowLimit = f; }120 121 116 void SetTimeLowerLimit ( const Float_t f=fgTimeLowerLimit ) { fTimeLowerLimit = f; } 122 117 void SetTimeUpperLimit ( const Float_t f=fgTimeUpperLimit ) { fTimeUpperLimit = f; } -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationHiLoCam.cc
r5749 r5864 253 253 { 254 254 255 fIntensCam = (MCalibrationIntensityCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityHiLoCam")); 256 if (fIntensCam) 257 *fLog << inf << "Found MCalibrationIntensityHiLoCam ... " << endl; 258 else 259 { 260 fCam = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationHiLoCam")); 261 if (!fCam) 262 { 263 fCam = (MCalibrationCam*)pList->FindCreateObj(AddSerialNumber("MCalibrationHiLoCam")); 264 if (!fCam) 265 { 266 *fLog << err << "Cannot find nor create MCalibrationHiLoCam ... abort." << endl; 267 return kFALSE; 268 } 269 fCam->Init(*fGeom); 270 } 271 } 255 if (!InitCams(pList,"HiLo")) 256 return kFALSE; 272 257 273 258 MExtractedSignalCam *signal = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam"); … … 544 529 545 530 Stat_t overflow = hist->GetBinContent(hist->GetNbinsX()+1); 546 if (overflow > 0.0005*hist->GetEntries())531 if (overflow > fOverflowLimit*hist->GetEntries()) 547 532 { 548 533 *fLog << warn << "Hist-overflow " << overflow 549 << " times in " << pix.GetName() << " (w/o saturation!) " <<endl;534 << " times in " << pix.GetName() << endl; 550 535 } 551 536 552 537 overflow = hist->GetBinContent(0); 553 if (overflow > 0.0005*hist->GetEntries())538 if (overflow > fOverflowLimit*hist->GetEntries()) 554 539 { 555 540 *fLog << warn << "Hist-underflow " << overflow 556 << " times in " << pix.GetName() << " (w/o saturation!) "<< endl;557 } 558 } 559 541 << " times in " << pix.GetName() << endl; 542 } 543 } 544 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc
r5863 r5864 130 130 const Axis_t MHCalibrationRelTimeCam::fgLast = 5.; 131 131 const Float_t MHCalibrationRelTimeCam::fgProbLimit = 0.; 132 const Float_t MHCalibrationRelTimeCam::fgNumOverflowLimit = 0.005;133 132 const TString MHCalibrationRelTimeCam::gsHistName = "RelTime"; 134 133 const TString MHCalibrationRelTimeCam::gsHistTitle = "Rel. Arr. Times"; … … 164 163 SetLast (fgLast ); 165 164 166 SetNumOverflowLimit(fgNumOverflowLimit);167 165 SetProbLimit(fgProbLimit); 168 166 … … 254 252 { 255 253 256 fIntensCam = (MCalibrationIntensityCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityRelTimeCam")); 257 if (fIntensCam) 258 *fLog << inf << "Found MCalibrationIntensityRelTimeCam ... " << endl; 259 else 260 { 261 fCam = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationRelTimeCam")); 262 if (!fCam) 263 { 264 fCam = (MCalibrationCam*)pList->FindCreateObj(AddSerialNumber("MCalibrationRelTimeCam")); 265 if (!fCam) 266 { 267 *fLog << err << "Cannot find nor create MCalibrationRelTimeCam ... abort." << endl; 268 return kFALSE; 269 } 270 fCam->Init(*fGeom); 271 } 272 } 254 if (!InitCams(pList,"RelTime")) 255 return kFALSE; 273 256 274 257 MArrivalTimeCam *signal = (MArrivalTimeCam*)pList->FindObject("MArrivalTimeCam"); … … 681 664 682 665 Stat_t overflow = hist->GetBinContent(hist->GetNbinsX()+1); 683 if (overflow > f NumOverflowLimit*hist->GetEntries())666 if (overflow > fOverflowLimit*hist->GetEntries()) 684 667 { 685 668 *fLog << warn << "HiGain Hist-overflow " << overflow … … 688 671 689 672 overflow = hist->GetBinContent(0); 690 if (overflow > f NumOverflowLimit*hist->GetEntries())673 if (overflow > fOverflowLimit*hist->GetEntries()) 691 674 { 692 675 *fLog << warn << "HiGain Hist-underflow " << overflow -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.h
r5863 r5864 22 22 23 23 static const Float_t fgNumHiGainSaturationLimit; //! The default for fNumHiGainSaturationLimit (now at: 0.25) 24 static const Float_t fgNumOverflowLimit; //! The default for fNumOverflowLimit (now at: 0.005)25 24 static const UInt_t fgReferencePixel; //! Default for fReferencePixel (now set to: 1) 26 25 static const Int_t fgNbins; //! Default number of bins (now set to: 900 ) -
trunk/MagicSoft/Mars/mhcalib/Makefile
r5850 r5864 21 21 INCLUDES = -I. -I../mbase -I../mgui -I../mgeom -I../mhbase -I../mcalib \ 22 22 -I../manalysis -I../mraw -I../mtools -I../mmc -I../mhist \ 23 -I../mimage -I../msignal -I../mbadpixels -I../mpedestal \ 24 -I../mtrigger 23 -I../mimage -I../msignal -I../mbadpixels -I../mpedestal 25 24 26 25 # mhbase: MBinning MH
Note:
See TracChangeset
for help on using the changeset viewer.