Changeset 5652
- Timestamp:
- 12/21/04 10:27:42 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityChargeCam.cc
r5651 r5652 46 46 #include "MGeomPix.h" 47 47 48 #include "MLog.h" 49 48 50 #include <TOrdCollection.h> 49 51 #include <TGraphErrors.h> … … 147 149 // ------------------------------------------------------------------- 148 150 // 149 // Returns a TGraphErrors with the number of photo-electrons vs. 150 // the extracted signal of pixel "pixid". 151 // 152 TGraphErrors *MCalibrationIntensityChargeCam::GetPhePerCharge( const UInt_t pixid, const MCalibrationCam::PulserColor_t col) 153 { 154 155 Int_t size = 0; 156 157 if (col == MCalibrationCam::kNONE) 158 size = GetSize(); 159 else 160 for (Int_t i=0;i<GetSize();i++) 161 { 162 MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i); 163 if (cam->GetPulserColor() == col) 164 size++; 165 } 166 151 // Returns a TGraphErrors with the mean effective number of photo-electrons divided by 152 // the mean charge of that pixel vs. the mean number of photo-electrons. 153 // 154 TGraphErrors *MCalibrationIntensityChargeCam::GetPhePerCharge( const UInt_t pixid, const MGeomCam &geom, const MCalibrationCam::PulserColor_t col) 155 { 156 157 Int_t size = CountNumValidEntries(pixid,col); 158 167 159 if (size == 0) 168 160 return NULL; … … 173 165 TArrayF sigerr(size); 174 166 175 for (Int_t i=0;i<size;i++) 167 Int_t cnt = 0; 168 169 for (Int_t i=0;i<GetSize();i++) 176 170 { 177 171 // … … 186 180 // Get the calibration pix from the calibration cam 187 181 // 188 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*cam)[pixid];182 const MCalibrationChargePix &pix = (MCalibrationChargePix&)(*cam)[pixid]; 189 183 // 190 184 // Don't use bad pixels … … 196 190 // converted value! 197 191 // 198 sig [i] = pix.GetConvertedMean(); 199 sigerr[i] = pix.GetConvertedMeanErr(); 200 // 201 const Float_t phe = pix.GetPheFFactorMethod(); 202 const Float_t err = pix.GetPheFFactorMethodErr(); 192 const Int_t aidx = geom[pixid].GetAidx(); 193 const MCalibrationChargePix &apix = (MCalibrationChargePix&)cam->GetAverageArea(aidx); 194 195 const Float_t q = pix.GetConvertedMean(); 196 const Float_t qerr = pix.GetConvertedMeanErr(); 197 // 198 const Float_t phe = apix.GetPheFFactorMethod(); 199 const Float_t err = apix.GetPheFFactorMethodErr(); 200 201 sig[cnt] = q; 202 sigerr[cnt] = qerr; 203 phepersig[cnt] = q > 0.00001 ? phe/q : -1.; 204 203 205 Float_t var = 0.; 204 205 phepersig[i] = sig[i] > 0. ? pix.GetPheFFactorMethod()/sig[i] : -1.; 206 if (sig[i] > 0. && phe > 0.) 206 207 if (q > 0.00001 && phe > 0.00001) 207 208 { 208 var = err * err / phe / phe + sigerr[i]*sigerr[i]/sig[i]/sig[i];209 if (var > 0.00 1)210 var = TMath::Sqrt(var)*phepersig[ i];209 var = err * err / phe / phe + qerr*qerr/q/q; 210 if (var > 0.00001) 211 var = TMath::Sqrt(var)*phepersig[cnt]; 211 212 } 212 phepersigerr[i] = var; 213 phepersigerr[cnt] = var; 214 cnt++; 213 215 } 214 216 … … 217 219 sigerr.GetArray(),phepersigerr.GetArray()); 218 220 gr->SetTitle(Form("%s%3i","Pixel ",pixid)); 219 gr->GetXaxis()->SetTitle(" Q [FADC counts]");220 gr->GetYaxis()->SetTitle(" photo-electrons / Q [FADC cts^{-1}]");221 gr->GetXaxis()->SetTitle("<photo-electrons> [1]"); 222 gr->GetYaxis()->SetTitle("<photo-electrons> / Q [FADC cts^{-1}]"); 221 223 return gr; 222 224 } … … 412 414 413 415 414 Int_t MCalibrationIntensityChargeCam::CountNumValidEntries(const UInt_t pixid, const MCalibrationCam::PulserColor_t col) 416 Int_t MCalibrationIntensityChargeCam::CountNumValidEntries(const UInt_t pixid, const MCalibrationCam::PulserColor_t col) const 415 417 { 416 418 … … 420 422 { 421 423 const MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i); 422 const MCalibrationChargePix &pix= (MCalibrationChargePix&)(*cam)[pixid];424 const MCalibrationChargePix &pix = (MCalibrationChargePix&)(*cam)[pixid]; 423 425 424 426 if (col == MCalibrationCam::kNONE) 425 if (pix.IsFFactorMethodValid()) 426 nvalid++; 427 else 428 if (cam->GetPulserColor() == col) 427 { 429 428 if (pix.IsFFactorMethodValid()) 430 429 nvalid++; 431 } 430 } 431 else 432 { 433 if (cam->GetPulserColor() == col) 434 { 435 if (pix.IsFFactorMethodValid()) 436 nvalid++; 437 } 438 } 439 } 440 432 441 return nvalid; 433 442 } -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityChargeCam.h
r5651 r5652 44 44 ((MCalibrationChargeCam*)GetCam())->SetNumPhotonsPINDiodeMethodErr(f); } 45 45 46 Int_t CountNumValidEntries(const UInt_t pixid, const MCalibrationCam::PulserColor_t col=MCalibrationCam::kNONE) ;46 Int_t CountNumValidEntries(const UInt_t pixid, const MCalibrationCam::PulserColor_t col=MCalibrationCam::kNONE) const; 47 47 48 48 TGraphErrors *GetRazmikPlot( const UInt_t pixid ); 49 49 TGraphErrors *GetPheVsCharge( const UInt_t pixid, const MCalibrationCam::PulserColor_t col=MCalibrationCam::kNONE); 50 TGraphErrors *GetPhePerCharge( const UInt_t pixid, const M CalibrationCam::PulserColor_t col=MCalibrationCam::kNONE);50 TGraphErrors *GetPhePerCharge( const UInt_t pixid, const MGeomCam &geom, const MCalibrationCam::PulserColor_t col=MCalibrationCam::kNONE); 51 51 TGraphErrors *GetPheVsChargePerArea( const Int_t aidx, const MCalibrationCam::PulserColor_t col=MCalibrationCam::kNONE); 52 52 TH2F *GetRazmikPlotResults( const Int_t aidx, const MGeomCam &geom );
Note:
See TracChangeset
for help on using the changeset viewer.