Changeset 8489 for trunk/MagicSoft/Mars/datacenter
- Timestamp:
- 05/10/07 16:33:01 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C
r8477 r8489 63 63 64 64 #include <TFile.h> 65 #include <TGraph.h> 65 66 #include <TSQLResult.h> 66 67 … … 69 70 #include "MStatusArray.h" 70 71 #include "MHCamera.h" 72 #include "MHVsTime.h" 71 73 72 74 #include "MCalibrationPulseTimeCam.h" … … 74 76 75 77 using namespace std; 76 77 Int_t CalcUnsuitable(const MHCamera &cam, Float_t f)78 {79 Int_t n = 0;80 for (int i=0; i<cam.GetNbinsX(); i++)81 if (cam.GetBinContent(i+1)>f)82 n++;83 84 return n;85 }86 78 87 79 int Process(MSQLServer &serv, TString fname, Bool_t dummy) … … 257 249 } 258 250 259 Int_t unsuitable50 = CalcUnsuitable(*cam, 0.50); 260 Int_t unsuitable01 = CalcUnsuitable(*cam, 0.01); 251 Int_t unsuitable50 = cam->GetNumBinsAboveThreshold(0.50); 252 Int_t unsuitable01 = cam->GetNumBinsAboveThreshold(0.01); 253 254 TString unsuitablemax = "NULL"; 255 TString deadmax = "NULL"; 256 257 TGraph *gr = (TGraph*)arr.FindObjectInCanvas("BadPixTm", "TGraph", "BadPixTm"); 258 if (gr) 259 { 260 const Int_t p = TMath::FloorNint(gr->GetN()*0.999); 261 unsuitablemax = Form("%d", TMath::Nint(TMath::KOrdStat(gr->GetN(), gr->GetY(), p))); 262 } 263 264 gr = (TGraph*)arr.FindObjectInCanvas("DeadPixTm", "TGraph", "DeadPixTm"); 265 if (gr) 266 deadmax = Form("%d", TMath::Nint(TMath::MaxElement(gr->GetN(), gr->GetY()))); 267 261 268 262 269 /* … … 316 323 cout << " Unsuitable > 50%: " << setw(6) << unsuitable50 << endl; 317 324 cout << " Unsuitable > 1%: " << setw(6) << unsuitable01 << endl; 325 cout << " UnsuitableMax (99.9%) " << setw(6) << unsuitablemax << endl; 326 cout << " DeadMax " << setw(6) << deadmax << endl; 318 327 cout << endl; 319 328 … … 331 340 " fPulsePosOffMed=%s, fPulsePosOffDev=%s, " 332 341 " fHiLoGainRatioMed=%s, fHiLoGainRatioDev=%s, " 333 " fUnsuitable50=%d, fUnsuitable01=%d " 342 " fUnsuitable50=%d, fUnsuitable01=%d, " 343 " fUnsuitableMax=%s, fDeadMax=%s " 334 344 " WHERE fSequenceFirst='%d' ", 335 345 meanrmsinner.Data(), meanrmsouter.Data(), … … 342 352 medhilocal.Data(), devhilocal.Data(), 343 353 unsuitable50, unsuitable01, 354 unsuitablemax.Data(), deadmax.Data(), 344 355 seq); 345 356
Note:
See TracChangeset
for help on using the changeset viewer.