Changeset 8931 for trunk/MagicSoft/Mars/datacenter
- Timestamp:
- 06/09/08 15:17:23 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/macros
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/fillcalib.C
r8927 r8931 149 149 } 150 150 151 Float_t meani = h->GetMean(); 152 Float_t rmsi = h->GetRMS(); 153 meani = TMath::Nint(meani*10)/10.; 154 rmsi = TMath::Nint(rmsi*100)/100.; 155 TString meaninner = Form("%5.1f", meani); 156 TString rmsinner = Form("%6.2f", rmsi); 157 151 TString meaninner = Form("%5.1f", h->GetMean()); 152 TString rmsinner = Form("%6.2f", h->GetRMS()); 158 153 159 154 //getting the mean and rms from the arrival time (outer cam) … … 165 160 } 166 161 167 Float_t meano = h->GetMean(); 168 Float_t rmso = h->GetRMS(); 169 meano = TMath::Nint(meano*10)/10.; 170 rmso = TMath::Nint(rmso*100)/100.; 171 TString meanouter = Form("%5.1f", meano); 172 TString rmsouter = Form("%6.2f", rmso); 173 162 TString meanouter = Form("%5.1f", h->GetMean()); 163 TString rmsouter = Form("%6.2f", h->GetRMS()); 174 164 175 165 //Getting conversion factors … … 189 179 Stat_t meanconvi = c->GetMeanSectors(TArrayI(6, s0), inner); 190 180 Stat_t meanconvo = c->GetMeanSectors(TArrayI(6, s0), outer); 191 meanconvi = TMath::Nint(meanconvi*1000)/1000.;192 meanconvo = TMath::Nint(meanconvo*1000)/1000.;193 181 TString meanconvinner=Form("%6.3f", meanconvi); 194 182 TString meanconvouter=Form("%6.3f", meanconvo); -
trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C
r8927 r8931 62 62 #include <TRegexp.h> 63 63 64 #include <TH2.h> 64 65 #include <TFile.h> 65 66 #include <TGraph.h> … … 86 87 } 87 88 88 Float_t meanextpul = -1;89 Float_t rmsextpul = -1;89 TString meanextpulpos("NULL"); 90 TString rmsextpulpos("NULL"); 90 91 91 92 MCalibrationPulseTimeCam *pt; … … 93 94 if (pt) 94 95 { 95 meanextpul = pt->GetAverageArea(0).GetHiGainMean(); 96 rmsextpul = pt->GetAverageArea(0).GetHiGainRms(); 97 98 meanextpul = TMath::Nint(meanextpul*100)/100.; 99 rmsextpul = TMath::Nint(rmsextpul*100)/100.; 100 } 96 Double_t meanextpul = pt->GetAverageArea(0).GetHiGainMean(); 97 Double_t rmsextpul = pt->GetAverageArea(0).GetHiGainRms(); 98 99 if (meanextpul>=0 || rmsextpulpos>=0) 100 { 101 meanextpulpos.Form("%6.2f", meanextpul); 102 rmsextpulpos.Form("%6.2f", rmsextpul); 103 } 104 } 105 101 106 102 107 MStatusArray arr; … … 145 150 146 151 Int_t seq = atoi(sequence.Data()+6); 147 148 Double_t medoff;149 Double_t devoff;150 151 Double_t medcal;152 Double_t devcal;153 152 154 153 TString medpuloff("NULL"); … … 173 172 } 174 173 175 medoff = TMath::Nint(hilooff->GetMedian()*10000)/10000.; 176 devoff = TMath::Nint(hilooff->GetDev() *10000)/10000.; 177 178 medcal = TMath::Nint(hilocal->GetMedian()*100)/100.; 179 devcal = TMath::Nint(hilocal->GetDev() *100)/100.; 180 181 medpuloff.Form("%7.4f", medoff); 182 devpuloff.Form("%7.4f", devoff); 183 medhilocal.Form("%6.2f", medcal); 184 devhilocal.Form("%6.2f", devcal); 174 medpuloff.Form("%7.4f", hilooff->GetMedian()); 175 devpuloff.Form("%7.4f", hilooff->GetDev()); 176 medhilocal.Form("%6.2f", hilocal->GetMedian()); 177 devhilocal.Form("%6.2f", hilocal->GetDev()); 185 178 } 186 179 … … 204 197 } 205 198 206 meanrmsi = TMath::Nint(meanrmsi*100)/100.;207 meanrmso = TMath::Nint(meanrmso*100)/100.;199 TString meanrmsinner=Form("%6.2f", meanrmsi); 200 TString meanrmsouter=Form("%6.2f", meanrmso); 208 201 209 202 cam = (MHCamera*)arr.FindObjectInCanvas("Interp'd;avg", "MHCamera", "Interp'd"); … … 225 218 } 226 219 227 meansigi = TMath::Nint(meansigi*100)/100.; 228 meansigo = TMath::Nint(meansigo*100)/100.; 229 230 Stat_t meanpul = pul->GetMean(); 231 Stat_t rmspul = pul->GetRMS(); 232 233 if (meanpul<0 || rmspul<0) 220 TString meansiginner =Form("%6.2f", meansigi); 221 TString meansigouter =Form("%6.2f", meansigo); 222 223 if (pul->GetMean()<0 || pul->GetRMS()<0) 234 224 { 235 225 cout << "WARNING - PulsePos'd mean or rms < 0 " << endl; 236 cout << "PulsePos'd mean " << meanpul << endl; 237 cout << "PulsePos'd rms " << rmspul << endl; 238 return 2; 239 } 240 241 meanpul = TMath::Nint(meanpul*100)/100.; 242 rmspul = TMath::Nint(rmspul *100)/100.; 243 244 cam = (MHCamera*)arr.FindObjectInCanvas("Unsuitable;avg", "MHCamera", "Unsuitable"); 245 if (!cam) 246 { 247 cout << "WARNING - Reading of Unsuitable;avg failed." << endl; 248 return 2; 249 } 250 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 226 cout << "PulsePos'd mean " << pul->GetMean() << endl; 227 cout << "PulsePos'd rms " << pul->GetRMS() << endl; 228 return 2; 229 } 230 231 TString meanpulpos = Form("%6.2f", pul->GetMean()); 232 TString rmspulpos = Form("%6.2f", pul->GetRMS()); 268 233 269 234 /* … … 278 243 Double_t meanoff = TMath::Nint(pullo->GetMean()*100.)/100.; 279 244 Double_t rmsoff = TMath::Nint(pullo->GetRMS() *100.)/100.; 280 */281 245 282 246 // USE MEDIAN INSTEAD? GetQuantiles(Int_t nprobSum, Double_t *q, const Double_t *probSum=0); 283 247 284 285 TString meanrmsinner =Form("%6.2f", meanrmsi);286 TString meanrmsouter =Form("%6.2f", meanrmso);287 TString meansiginner =Form("%6.2f", meansigi);288 TString meansigouter =Form("%6.2f", meansigo);289 TString meanpulpos =Form("%6.2f", meanpul);290 TString rmspulpos =Form("%6.2f", rmspul);291 TString meanextpulpos=Form("%6.2f", meanextpul);292 TString rmsextpulpos =Form("%6.2f", rmsextpul);293 /*294 248 TString meanpulhi =Form("%6.2f", meanhi); 295 249 TString rmspulhi =Form("%6.2f", rmshi); … … 299 253 */ 300 254 301 if (meanextpul<0 && rmsextpul<0) 302 { 303 meanextpulpos = "NULL"; 304 rmsextpulpos = "NULL"; 255 cam = (MHCamera*)arr.FindObjectInCanvas("Unsuitable;avg", "MHCamera", "Unsuitable"); 256 if (!cam) 257 { 258 cout << "WARNING - Reading of Unsuitable;avg failed." << endl; 259 return 2; 260 } 261 262 Int_t unsuitable50 = cam->GetNumBinsAboveThreshold(0.50); 263 Int_t unsuitable01 = cam->GetNumBinsAboveThreshold(0.01); 264 265 TString unsuitablemax = "NULL"; 266 TString deadmax = "NULL"; 267 268 TGraph *gr = (TGraph*)arr.FindObjectInCanvas("BadPixTm", "TGraph", "BadPixTm"); 269 if (gr) 270 { 271 const Int_t p = TMath::FloorNint(gr->GetN()*0.999); 272 unsuitablemax = Form("%d", TMath::Nint(TMath::KOrdStat(gr->GetN(), gr->GetY(), p))); 273 } 274 275 gr = (TGraph*)arr.FindObjectInCanvas("DeadPixTm", "TGraph", "DeadPixTm"); 276 if (gr) 277 deadmax = Form("%d", TMath::Nint(TMath::MaxElement(gr->GetN(), gr->GetY()))); 278 279 TString rateped = "NULL"; 280 TString rateped2 = "NULL"; 281 TString ratecal = "NULL"; 282 TString ratetrig = "NULL"; 283 TString ratesum = "NULL"; 284 TString ratena = "NULL"; 285 TString ratenull = "NULL"; 286 287 TH2D *htp = (TH2D*)arr.FindObjectInCanvas("TrigPat", "TH2D", "TrigPat"); 288 if (htp) 289 { 290 htp->ResetBit(TH1::kCanRebin); 291 292 Int_t iped = htp->GetYaxis()->FindBin("Ped"); 293 Int_t iped2 = htp->GetYaxis()->FindBin("Ped+Trig"); 294 Int_t ical = htp->GetYaxis()->FindBin("Cal"); 295 Int_t itrig = htp->GetYaxis()->FindBin("Trig"); 296 Int_t isum = htp->GetYaxis()->FindBin("Sum"); 297 Int_t inull = htp->GetYaxis()->FindBin("0"); 298 Int_t ina = htp->GetYaxis()->FindBin("UNKNOWN"); 299 300 Int_t nx = htp->GetNbinsX(); 301 302 rateped = Form("%8.1f", iped <0 ? 0 : htp->Integral(1, nx, iped, iped) / nx); 303 rateped2 = Form("%7.2f", iped2<0 ? 0 : htp->Integral(1, nx, iped2, iped2) / nx); 304 ratecal = Form("%8.1f", ical <0 ? 0 : htp->Integral(1, nx, ical, ical) / nx); 305 ratetrig = Form("%8.1f", itrig<0 ? 0 : htp->Integral(1, nx, itrig, itrig) / nx); 306 ratesum = Form("%8.1f", isum <0 ? 0 : htp->Integral(1, nx, isum, isum) / nx); 307 ratenull = Form("%8.1f", inull<0 ? 0 : htp->Integral(1, nx, inull, inull) / nx); 308 ratena = Form("%7.2f", ina <0 ? 0 : htp->Integral(1, nx, ina, ina) / nx); 305 309 } 306 310 … … 325 329 cout << " UnsuitableMax (99.9%) " << setw(6) << unsuitablemax << endl; 326 330 cout << " DeadMax " << setw(6) << deadmax << endl; 331 cout << " Rate Trigger [Hz] " << rateped << endl; 332 cout << " Rate SUM [Hz] " << ratesum << endl; 333 cout << " Rate Ped+Trigger [Hz] " << rateped2 << endl; 334 cout << " Rate Pedestal [Hz] " << rateped << endl; 335 cout << " Rate Calibration [Hz] " << ratecal << endl; 336 cout << " Rate 0 [Hz] " << ratenull << endl; 337 cout << " Rate UNKNOWN [Hz] " << ratena << endl; 327 338 cout << endl; 328 339 … … 340 351 " fHiLoGainRatioMed=%s, fHiLoGainRatioDev=%s, " 341 352 " fUnsuitable50=%d, fUnsuitable01=%d, " 342 " fUnsuitableMax=%s, fDeadMax=%s " 353 " fUnsuitableMax=%s, fDeadMax=%s, " 354 " fRateTrigEvts=%s, fRateSumEvts=%s, " 355 " fRatePedTrigEvts=%s, fRatePedEvts=%s, " 356 " fRateCalEvts=%s, fRateNullEvts=%s, " 357 " fRateUnknownEvts=%s ", 343 358 meanrmsinner.Data(), meanrmsouter.Data(), 344 359 meansiginner.Data(), meansigouter.Data(), … … 350 365 medhilocal.Data(), devhilocal.Data(), 351 366 unsuitable50, unsuitable01, 352 unsuitablemax.Data(), deadmax.Data()); 353 354 return serv.Update("Calibration", vars, Form("fSequenceFirst=%d", seq), vars); 367 unsuitablemax.Data(), deadmax.Data(), 368 ratetrig.Data(), ratesum.Data(), 369 rateped2.Data(), rateped.Data(), 370 ratecal.Data(), ratenull.Data(), 371 ratena.Data() 372 ); 373 374 375 return serv.Update("Calibration", vars, Form("fSequenceFirst=%d", seq)); 355 376 } 356 377 -
trunk/MagicSoft/Mars/datacenter/macros/fillstar.C
r8927 r8931 134 134 Float_t mw = hmuon->GetMeanWidth(); 135 135 Float_t psf = 70.205*mw - 28.055; 136 psf = TMath::Nint(psf*10)/10.; 137 if (psf<0) 138 psf=0; 139 TString PSF = Form("%5.1f", psf); 136 TString PSF = Form("%5.1f", psf<0?0:psf); 140 137 Int_t num = (int)hmuon->GetEntries(); 141 138 … … 150 147 } 151 148 152 Float_t quality = h->GetMean(); 153 quality = TMath::Nint(quality*100)/100.; 154 TString islands = Form("%6.2f", quality); 149 TString islands = Form("%6.2f", h->GetMean()); 155 150 156 151 h = (TH1*)arr.FindObjectInCanvas("EffOnTheta", "TH1D", "EffOnTime"); … … 163 158 Float_t effon = h->Integral(); 164 159 Float_t mrate = num/effon; 165 mrate = TMath::Nint(mrate*100)/100.; 166 if (mrate<0) 167 mrate=0; 168 TString muonrate = Form("%6.2f", mrate); 160 TString muonrate = Form("%6.2f", mrate<0?0:mrate); 169 161 Int_t effontime = TMath::Nint(effon); 170 162
Note:
See TracChangeset
for help on using the changeset viewer.