Changeset 5651
- Timestamp:
- 12/21/04 09:40:56 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.cc
r5052 r5651 407 407 } 408 408 409 Int_t MCalibrationIntensityCam::CountNumEntries(const MCalibrationCam::PulserColor_t col) const 410 { 411 412 Int_t size = 0; 413 414 if (col == MCalibrationCam::kNONE) 415 return GetSize(); 416 else 417 for (Int_t i=0;i<GetSize();i++) 418 { 419 const MCalibrationCam *cam = GetCam(i); 420 if (cam->GetPulserColor() == col) 421 size++; 422 } 423 424 return size; 425 } -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.h
r5053 r5651 41 41 42 42 void AddToList( const char* name, const MGeomCam &geom ); 43 44 Int_t CountNumEntries(const MCalibrationCam::PulserColor_t col) const; 43 45 44 46 // Draws -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityChargeCam.cc
r5594 r5651 86 86 { 87 87 88 const Int_t size = GetSize(); 88 Int_t size = 0; 89 90 if (col == MCalibrationCam::kNONE) 91 size = GetSize(); 92 else 93 for (Int_t i=0;i<GetSize();i++) 94 { 95 MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i); 96 if (cam->GetPulserColor() == col) 97 size++; 98 } 99 100 if (size == 0) 101 return NULL; 89 102 90 103 TArrayF phe(size); … … 129 142 gr->GetXaxis()->SetTitle("Q [FADC counts]"); 130 143 gr->GetYaxis()->SetTitle("photo-electrons [1]"); 144 return gr; 145 } 146 147 // ------------------------------------------------------------------- 148 // 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 167 if (size == 0) 168 return NULL; 169 170 TArrayF phepersig(size); 171 TArrayF phepersigerr(size); 172 TArrayF sig(size); 173 TArrayF sigerr(size); 174 175 for (Int_t i=0;i<size;i++) 176 { 177 // 178 // Get the calibration cam from the intensity cam 179 // 180 MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i); 181 182 if (col != MCalibrationCam::kNONE) 183 if (cam->GetPulserColor() != col) 184 continue; 185 // 186 // Get the calibration pix from the calibration cam 187 // 188 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*cam)[pixid]; 189 // 190 // Don't use bad pixels 191 // 192 if (!pix.IsFFactorMethodValid()) 193 continue; 194 // 195 // For the calculation of Q, we have to use the 196 // converted value! 197 // 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(); 203 Float_t var = 0.; 204 205 phepersig[i] = sig[i] > 0. ? pix.GetPheFFactorMethod()/sig[i] : -1.; 206 if (sig[i] > 0. && phe > 0.) 207 { 208 var = err * err / phe / phe + sigerr[i]*sigerr[i]/sig[i]/sig[i]; 209 if (var > 0.001) 210 var = TMath::Sqrt(var)*phepersig[i]; 211 } 212 phepersigerr[i] = var; 213 } 214 215 TGraphErrors *gr = new TGraphErrors(size, 216 sig.GetArray(),phepersig.GetArray(), 217 sigerr.GetArray(),phepersigerr.GetArray()); 218 gr->SetTitle(Form("%s%3i","Pixel ",pixid)); 219 gr->GetXaxis()->SetTitle("Q [FADC counts]"); 220 gr->GetYaxis()->SetTitle("photo-electrons / Q [FADC cts ^{-1}]"); 131 221 return gr; 132 222 } … … 251 341 gr->SetTitle(Form("%s%3i","Pixel ",pixid)); 252 342 gr->GetXaxis()->SetTitle("1/Q [FADC counts^{-1}]"); 253 gr->GetYaxis()->SetTitle("\sigma_{red}^{2}/Q^{2} ");343 gr->GetYaxis()->SetTitle("\sigma_{red}^{2}/Q^{2} [1]"); 254 344 return gr; 255 345 } … … 322 412 323 413 414 Int_t MCalibrationIntensityChargeCam::CountNumValidEntries(const UInt_t pixid, const MCalibrationCam::PulserColor_t col) 415 { 416 417 Int_t nvalid = 0; 418 419 for (Int_t i=0;i<GetSize();i++) 420 { 421 const MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i); 422 const MCalibrationChargePix &pix = (MCalibrationChargePix&)(*cam)[pixid]; 423 424 if (col == MCalibrationCam::kNONE) 425 if (pix.IsFFactorMethodValid()) 426 nvalid++; 427 else 428 if (cam->GetPulserColor() == col) 429 if (pix.IsFFactorMethodValid()) 430 nvalid++; 431 } 432 return nvalid; 433 } -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityChargeCam.h
r5594 r5651 43 43 void SetNumPhotonsPINDiodeMethodErr ( const Float_t f ) { 44 44 ((MCalibrationChargeCam*)GetCam())->SetNumPhotonsPINDiodeMethodErr(f); } 45 46 Int_t CountNumValidEntries(const UInt_t pixid, const MCalibrationCam::PulserColor_t col=MCalibrationCam::kNONE); 45 47 46 48 TGraphErrors *GetRazmikPlot( const UInt_t pixid ); 47 49 TGraphErrors *GetPheVsCharge( const UInt_t pixid, const MCalibrationCam::PulserColor_t col=MCalibrationCam::kNONE); 50 TGraphErrors *GetPhePerCharge( const UInt_t pixid, const MCalibrationCam::PulserColor_t col=MCalibrationCam::kNONE); 48 51 TGraphErrors *GetPheVsChargePerArea( const Int_t aidx, const MCalibrationCam::PulserColor_t col=MCalibrationCam::kNONE); 49 52 TH2F *GetRazmikPlotResults( const Int_t aidx, const MGeomCam &geom );
Note:
See TracChangeset
for help on using the changeset viewer.