- Timestamp:
- 01/20/05 16:46:31 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityChargeCam.cc
r5866 r5914 45 45 #include <TGraphErrors.h> 46 46 #include <TOrdCollection.h> 47 #include <TH1 D.h>47 #include <TH1.h> 48 48 49 49 #include "MLog.h" … … 551 551 // photo-electrons vs. camera number for pixel 'pixid' 552 552 // 553 TGraphErrors *MCalibrationIntensityChargeCam::GetVarVsTime( const Int_t pixid , const Option_t * opt)553 TGraphErrors *MCalibrationIntensityChargeCam::GetVarVsTime( const Int_t pixid , const Option_t *varname ) 554 554 { 555 555 … … 559 559 return NULL; 560 560 561 TString option( opt);561 TString option(varname); 562 562 563 563 TArrayF nr(size); … … 664 664 // per area index 'aidx' vs. the calibration camera number 665 665 // 666 TGraphErrors *MCalibrationIntensityChargeCam::GetVarPerAreaVsTime( const Int_t aidx, const MGeomCam &geom, const Option_t * opt)666 TGraphErrors *MCalibrationIntensityChargeCam::GetVarPerAreaVsTime( const Int_t aidx, const MGeomCam &geom, const Option_t *varname) 667 667 { 668 668 … … 672 672 return NULL; 673 673 674 TString option( opt);674 TString option(varname); 675 675 676 676 TArrayF vararea(size); … … 981 981 } 982 982 983 TH1F *MCalibrationIntensityChargeCam::GetVarFluctuations( const Int_t aidx, const MGeomCam &geom, const Option_t *varname ) 984 { 985 986 const Int_t size = GetSize(); 987 988 if (size == 0) 989 return NULL; 990 991 TString option(varname); 992 993 TH1F *hist = new TH1F("hist",Form("%s - Rel. Fluctuations %s Pixel",option.Data(),aidx ? "Outer" : "Inner"), 994 200,0.,100.); 995 hist->SetXTitle("Relative Fluctuation [%]"); 996 hist->SetYTitle("Nr. channels [1]"); 997 hist->SetFillColor(kRed+aidx); 998 999 MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(); 1000 1001 // 1002 // Loop over pixels 1003 // 1004 for (Int_t npix=0;npix<cam->GetSize();npix++) 1005 { 1006 if (geom[npix].GetAidx() != aidx) 1007 continue; 1008 1009 Double_t variab = 0.; 1010 Double_t variab2 = 0.; 1011 Double_t variance = 0.; 1012 Int_t num = 0; 1013 Float_t pvar = 0.; 1014 Float_t relrms = 99.9; 1015 // 1016 // Loop over the Cams for each pixel 1017 // 1018 for (Int_t i=0; i<GetSize(); i++) 1019 { 1020 MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i); 1021 // 1022 // Get the calibration pix from the calibration cam 1023 // 1024 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*cam)[npix]; 1025 // 1026 // Don't use bad pixels 1027 // 1028 if (!pix.IsFFactorMethodValid()) 1029 continue; 1030 1031 if (option.Contains("RSigma")) 1032 pvar = pix.GetRSigma(); 1033 if (option.Contains("AbsTime")) 1034 pvar = pix.GetAbsTimeMean(); 1035 if (option.Contains("ConversionHiLo")) 1036 pvar = pix.GetConversionHiLo(); 1037 if (option.Contains("ConvertedMean")) 1038 pvar = pix.GetConvertedMean(); 1039 if (option.Contains("ConvertedSigma")) 1040 pvar = pix.GetConvertedSigma(); 1041 if (option.Contains("ConvertedRSigma")) 1042 pvar = pix.GetConvertedRSigma(); 1043 if (option.Contains("MeanConvFADC2Phe")) 1044 pvar = pix.GetMeanConvFADC2Phe(); 1045 if (option.Contains("MeanFFactorFADC2Phot")) 1046 pvar = pix.GetMeanFFactorFADC2Phot(); 1047 if (option.Contains("Ped")) 1048 pvar = pix.GetPed(); 1049 if (option.Contains("PedRms")) 1050 pvar = pix.GetPedRms(); 1051 if (option.Contains("PheFFactorMethod")) 1052 pvar = pix.GetPheFFactorMethod(); 1053 if (option.Contains("RSigmaPerCharge")) 1054 pvar = pix.GetRSigmaPerCharge(); 1055 1056 variab += pvar; 1057 variab2 += pvar*pvar; 1058 num++; 1059 } 1060 1061 if (num > 1) 1062 { 1063 variab /= num; 1064 variance = (variab2 - variab*variab*num) / (num-1); 1065 1066 if (variance > 0.) 1067 relrms = TMath::Sqrt(variance)/variab * 100.; 1068 } 1069 hist->Fill(relrms); 1070 } 1071 return hist; 1072 } 1073 -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityChargeCam.h
r5866 r5914 16 16 class TGraphErrors; 17 17 class TH2F; 18 class TH1F; 18 19 class MGeomCam; 19 20 20 class MCalibrationIntensityChargeCam : public MCalibrationIntensityCam 21 21 { … … 41 41 TGraphErrors *GetPhotVsTime( const Option_t *method="FFactor" ); 42 42 43 TGraphErrors *GetVarPerAreaVsTime( const Int_t aidx, const MGeomCam &geom, const Option_t *opt ); 44 TGraphErrors *GetVarVsTime( const Int_t pixid , const Option_t *opt ); 43 TGraphErrors *GetVarPerAreaVsTime( const Int_t aidx, const MGeomCam &geom, const Option_t *varname ); 44 TGraphErrors *GetVarVsTime( const Int_t pixid , const Option_t *varname ); 45 TH1F *GetVarFluctuations( const Int_t aidx, const MGeomCam &geom, const Option_t *varname); 45 46 46 47 ClassDef(MCalibrationIntensityChargeCam, 1) // Container Intensity Charge Calibration Results Camera
Note:
See TracChangeset
for help on using the changeset viewer.