Changeset 2762
- Timestamp:
- 01/09/04 22:47:53 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2761 r2762 5 5 -*-*- END OF LINE -*-*- 6 6 2004/01/09: Markus Gaug 7 8 * mcalib/MHCalibrationBlindPixel.h 9 - make the fit by default quiet 7 10 8 11 * mhist/MHCamera.[h.cc] -
trunk/MagicSoft/Mars/macros/calibration.C
r2717 r2762 23 23 \* ======================================================================== */ 24 24 25 void calibration(TString pedname="/ data/MAGIC/rootdata/2003_12_01/20031130_03340_P_CrabNebula_E.root",26 TString calname="/ data/MAGIC/rootdata/2003_12_01/20031130_03341_C_CrabNebula_E.root")25 void calibration(TString pedname="/mnt/Data/rootdata/2003_12_01/20031130_03340_P_CrabNebula_E.root", 26 TString calname="/mnt/Data/rootdata/2003_12_01/20031130_03341_C_CrabNebula_E.root") 27 27 { 28 28 … … 94 94 plist2.AddToList((MPedestalCam*)plist.FindObject("MPedestalCam")); 95 95 96 // MGeomApply geomapl2;97 96 tlist2.AddToList(&geomapl); 98 97 … … 167 166 MHCamera disp6 (geomcam, "MCalibrationCam;t", "Arrival Times"); 168 167 MHCamera disp7 (geomcam, "MCalibrationCam;sigmat", "Sigma of Arrival Times"); 169 MHCamera disp8 (geomcam, "MCalibrationCam;probt", " Chi Squareof Time Fit");168 MHCamera disp8 (geomcam, "MCalibrationCam;probt", "Probability of Time Fit"); 170 169 MHCamera disp9 (geomcam, "MCalibrationCam;ped", "Pedestals"); 171 170 MHCamera disp10 (geomcam, "MCalibrationCam;pedrms", "Pedestal RMS"); … … 211 210 disp3.SetYTitle("\\sigma_{Q} [FADC counts]"); 212 211 // disp4.SetYTitle("\\Delta {\\sigma_{Q}} [FADC counts]"); 213 disp5.SetYTitle("P [au]");212 disp5.SetYTitle("P_{Q} [au]"); 214 213 disp6.SetYTitle("T [FADC slices]"); 215 disp7.SetYTitle("\\ Delta T[FADC slices]");216 disp8.SetYTitle(" \\Chi^2 T[au]");214 disp7.SetYTitle("\\sigma_{T} [FADC slices]"); 215 disp8.SetYTitle("P_{T} [au]"); 217 216 disp9.SetYTitle("P [Total FADC counts ]"); 218 217 disp10.SetYTitle("RMS_{P} [Total FADC counts ]"); 219 disp11.SetYTitle("\\sigma^ 2_{Q} - RMS^2_{P} [FADC counts^2]");218 disp11.SetYTitle("\\sigma^{2}_{Q} - RMS^{2}_{P} [FADC counts^2]"); 220 219 disp12.SetYTitle("Nr Phe's"); 221 220 disp13.SetYTitle("Conversion Factor [Phe/FADC count]"); … … 225 224 226 225 MStatusDisplay *d3 = new MStatusDisplay; 227 228 // Set update time to 3s229 226 d3->SetUpdateTime(3000); 230 227 d3->Resize(1180,900); 228 229 gStyle->SetOptStat(1111); 230 gStyle->SetOptFit(); 231 232 // Charges 231 233 TCanvas *c1 = &d3->AddTab("Fitted Charges"); 232 c1->Divide(2, 2); 233 234 TObject *obj; 234 c1->Divide(2,3); 235 236 TObject *obj1; 237 TObject *obj2; 235 238 236 239 c1->cd(1); 237 gStyle->SetOptStat(1111); 238 obj=disp1.DrawCopy("hist"); 239 ((MHCamera*)obj)->AddNotify(*cam); 240 ((MHCamera*)obj)->SetPrettyPalette(); 240 obj1=disp1.DrawCopy("hist"); 241 ((MHCamera*)obj1)->AddNotify(*cam); 241 242 242 243 c1->cd(3); 243 244 gPad->SetBorderMode(0); 244 obj->Draw(); 245 obj1->Draw(); 246 ((MHCamera*)obj1)->SetPrettyPalette(); 247 248 c1->cd(5); 249 gPad->SetBorderMode(0); 250 obj2 = obj1->DrawClone("proj"); 251 gPad->Update(); 252 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 253 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 245 254 246 255 c1->cd(2); 247 gStyle->SetOptStat(1101); 248 obj=disp3.DrawCopy("hist"); 249 ((MHCamera*)obj)->AddNotify(*cam); 250 ((MHCamera*)obj)->SetPrettyPalette(); 256 obj1=disp3.DrawCopy("hist"); 257 ((MHCamera*)obj1)->AddNotify(*cam); 251 258 252 259 c1->cd(4); 253 260 gPad->SetBorderMode(0); 254 obj->Draw(); 255 256 261 obj1->Draw(); 262 ((MHCamera*)obj1)->SetPrettyPalette(); 263 264 c1->cd(6); 265 gPad->SetBorderMode(0); 266 obj2 = obj1->DrawClone("proj"); 267 gPad->Update(); 268 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 269 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 270 271 // Fit Probability 257 272 TCanvas *c12 = &d3->AddTab("Fit Prob."); 258 c12->Divide(1, 2);273 c12->Divide(1, 3); 259 274 260 275 c12->cd(1); 261 gStyle->SetOptStat(1101); 262 obj=disp5.DrawCopy("hist"); 263 ((MHCamera*)obj)->AddNotify(*cam); 264 ((MHCamera*)obj)->SetPrettyPalette(); 276 obj1=disp5.DrawCopy("hist"); 277 ((MHCamera*)obj1)->AddNotify(*cam); 265 278 266 279 c12->cd(2); 267 280 gPad->SetBorderMode(0); 268 obj->Draw(); 269 281 obj1->Draw(); 282 ((MHCamera*)obj1)->SetPrettyPalette(); 283 284 c12->cd(3); 285 gPad->SetBorderMode(0); 286 obj2 = obj1->DrawClone("proj"); 287 gPad->Update(); 288 ((MHCamera*)obj2)->GetYProj()->Fit("pol0","Q"); 289 ((MHCamera*)obj2)->GetYProj()->GetFunction("pol0")->SetLineColor(kYellow); 290 291 // Times 270 292 TCanvas *c2 = &d3->AddTab("Fitted Times"); 271 c2->Divide(3, 2);293 c2->Divide(3, 3); 272 294 273 295 c2->cd(1); 274 gStyle->SetOptStat(1111); 275 obj=disp6.DrawCopy("hist"); 276 ((MHCamera*)obj)->AddNotify(*cam); 277 ((MHCamera*)obj)->SetPrettyPalette(); 296 obj1=disp6.DrawCopy("hist"); 297 ((MHCamera*)obj1)->AddNotify(*cam); 278 298 279 299 c2->cd(4); 280 obj->Draw(); 300 obj1->Draw(); 301 ((MHCamera*)obj1)->SetPrettyPalette(); 302 303 c2->cd(7); 304 gPad->SetBorderMode(0); 305 obj2 = obj1->DrawClone("proj"); 306 gPad->Update(); 307 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 308 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 281 309 282 310 c2->cd(2); 283 gStyle->SetOptStat(1101); 284 obj=disp7.DrawCopy("hist"); 285 ((MHCamera*)obj)->AddNotify(*cam); 286 ((MHCamera*)obj)->SetPrettyPalette(); 311 obj1=disp7.DrawCopy("hist"); 312 ((MHCamera*)obj1)->AddNotify(*cam); 287 313 288 314 c2->cd(5); 289 obj->Draw(); 315 obj1->Draw(); 316 ((MHCamera*)obj1)->SetPrettyPalette(); 317 318 c2->cd(8); 319 gPad->SetBorderMode(0); 320 obj2 = obj1->DrawClone("proj"); 321 gPad->Update(); 322 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 323 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 290 324 291 325 c2->cd(3); 292 gStyle->SetOptStat(1101); 293 obj=disp8.DrawCopy("hist"); 294 ((MHCamera*)obj)->AddNotify(*cam); 295 ((MHCamera*)obj)->SetPrettyPalette(); 326 obj1=disp8.DrawCopy("hist"); 327 ((MHCamera*)obj1)->AddNotify(*cam); 296 328 297 329 c2->cd(6); 298 obj->Draw(); 299 330 obj1->Draw(); 331 ((MHCamera*)obj1)->SetPrettyPalette(); 332 333 c2->cd(9); 334 gPad->SetBorderMode(0); 335 obj2 = obj1->DrawClone("proj"); 336 gPad->Update(); 337 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 338 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 339 340 // Pedestals 300 341 TCanvas *c3 = &d3->AddTab("Pedestals"); 301 c3->Divide(2, 2);342 c3->Divide(2, 3); 302 343 303 344 c3->cd(1); 304 gStyle->SetOptStat(1111); 305 obj=disp9.DrawCopy("hist"); 306 ((MHCamera*)obj)->AddNotify(*cam); 307 ((MHCamera*)obj)->SetPrettyPalette(); 345 obj1=disp9.DrawCopy("hist"); 346 ((MHCamera*)obj1)->AddNotify(*cam); 308 347 309 348 c3->cd(3); 310 obj->Draw(); 349 obj1->Draw(); 350 ((MHCamera*)obj1)->SetPrettyPalette(); 351 352 c3->cd(5); 353 gPad->SetBorderMode(0); 354 obj2 = obj1->DrawClone("proj"); 355 gPad->Update(); 356 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 357 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 311 358 312 359 c3->cd(2); 313 gStyle->SetOptStat(1111); 314 obj=disp10.DrawCopy("hist"); 315 ((MHCamera*)obj)->AddNotify(*cam); 316 ((MHCamera*)obj)->SetPrettyPalette(); 360 obj1=disp10.DrawCopy("hist"); 361 ((MHCamera*)obj1)->AddNotify(*cam); 317 362 318 363 c3->cd(4); 319 obj->Draw(); 320 321 TCanvas *c4 = &d3->AddTab("Reduced Charges"); 322 c4->Divide(2,2); 364 obj1->Draw(); 365 ((MHCamera*)obj1)->SetPrettyPalette(); 366 367 c3->cd(6); 368 gPad->SetBorderMode(0); 369 obj2 = obj1->DrawClone("proj"); 370 gPad->Update(); 371 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 372 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 373 374 // Reduced Sigmas 375 TCanvas *c4 = &d3->AddTab("Reduced Sigmas"); 376 c4->Divide(2,3); 323 377 324 378 c4->cd(1); 325 gStyle->SetOptStat(1111); 326 obj=disp11.DrawCopy("hist"); 327 ((MHCamera*)obj)->AddNotify(*cam); 328 ((MHCamera*)obj)->SetPrettyPalette(); 379 obj1=disp11.DrawCopy("hist"); 380 ((MHCamera*)obj1)->AddNotify(*cam); 329 381 330 382 c4->cd(3); 331 obj->Draw(); 383 obj1->Draw(); 384 ((MHCamera*)obj1)->SetPrettyPalette(); 385 386 c4->cd(5); 387 gPad->SetBorderMode(0); 388 obj2 = obj1->DrawClone("proj"); 389 gPad->Update(); 390 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 391 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 332 392 333 393 c4->cd(2); 334 gStyle->SetOptStat(1111); 335 obj=disp16.DrawCopy("hist"); 336 ((MHCamera*)obj)->AddNotify(*cam); 337 ((MHCamera*)obj)->SetPrettyPalette(); 394 obj1=disp16.DrawCopy("hist"); 395 ((MHCamera*)obj1)->AddNotify(*cam); 338 396 339 397 c4->cd(4); 340 obj->Draw(); 341 398 obj1->Draw(); 399 ((MHCamera*)obj1)->SetPrettyPalette(); 400 401 c4->cd(6); 402 gPad->SetBorderMode(0); 403 obj2 = obj1->DrawClone("proj"); 404 gPad->Update(); 405 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 406 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 407 408 // F-Factor Method 342 409 TCanvas *c5 = &d3->AddTab("F-Factor Method"); 343 c5->Divide(2, 2);410 c5->Divide(2, 3); 344 411 345 412 c5->cd(1); 346 gStyle->SetOptStat(1111); 347 obj=disp12.DrawCopy("hist"); 348 ((MHCamera*)obj)->AddNotify(*cam); 349 ((MHCamera*)obj)->SetPrettyPalette(); 413 obj1=disp12.DrawCopy("hist"); 414 ((MHCamera*)obj1)->AddNotify(*cam); 350 415 351 416 c5->cd(3); 352 obj->Draw(); 417 obj1->Draw(); 418 ((MHCamera*)obj1)->SetPrettyPalette(); 419 420 c5->cd(5); 421 gPad->SetBorderMode(0); 422 obj2 = obj1->DrawClone("proj"); 423 gPad->Update(); 424 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 425 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 353 426 354 427 c5->cd(2); 355 gStyle->SetOptStat(1101); 356 obj=disp13.DrawCopy("hist"); 357 ((MHCamera*)obj)->AddNotify(*cam); 358 ((MHCamera*)obj)->SetPrettyPalette(); 428 obj1=disp13.DrawCopy("hist"); 429 ((MHCamera*)obj1)->AddNotify(*cam); 359 430 360 431 c5->cd(4); 361 obj->Draw(); 362 432 obj1->Draw(); 433 ((MHCamera*)obj1)->SetPrettyPalette(); 434 435 c5->cd(6); 436 gPad->SetBorderMode(0); 437 obj2 = obj1->DrawClone("proj"); 438 gPad->Update(); 439 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 440 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 441 442 // Blind Pixel Method 363 443 TCanvas *c6 = &d3->AddTab("Blind Pixel Method"); 364 c6->Divide(2, 2);444 c6->Divide(2, 3); 365 445 366 446 c6->cd(1); 367 gStyle->SetOptStat(1111); 368 obj=disp14.DrawCopy("hist"); 369 ((MHCamera*)obj)->AddNotify(*cam); 370 ((MHCamera*)obj)->SetPrettyPalette(); 447 obj1=disp14.DrawCopy("hist"); 448 ((MHCamera*)obj1)->AddNotify(*cam); 371 449 372 450 c6->cd(3); 373 obj->Draw(); 451 obj1->Draw(); 452 ((MHCamera*)obj1)->SetPrettyPalette(); 453 374 454 375 455 c6->cd(2); 376 gStyle->SetOptStat(1101); 377 obj=disp15.DrawCopy("hist"); 378 ((MHCamera*)obj)->AddNotify(*cam); 379 ((MHCamera*)obj)->SetPrettyPalette(); 456 obj1=disp15.DrawCopy("hist"); 457 ((MHCamera*)obj1)->AddNotify(*cam); 380 458 381 459 c6->cd(4); 382 obj->Draw(); 383 460 obj1->Draw(); 461 ((MHCamera*)obj1)->SetPrettyPalette(); 462 463 c6->cd(6); 464 gPad->SetBorderMode(0); 465 obj2 = obj1->DrawClone("proj"); 466 gPad->Update(); 467 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 468 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 384 469 } 385 470 -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r2698 r2762 103 103 // Default Constructor. To be used by the root system ONLY. 104 104 // 105 MHCamera::MHCamera() : TH1D(), fGeomCam(NULL), fColors(kItemsLegend) 105 MHCamera::MHCamera() : TH1D(), fGeomCam(NULL), fColors(kItemsLegend), fYProj(NULL) 106 106 { 107 107 Init(); … … 116 116 MHCamera::MHCamera(const MGeomCam &geom, const char *name, const char *title) 117 117 : fGeomCam(NULL), /*TH1D(name, title, geom.GetNumPixels(), -0.5, geom.GetNumPixels()-0.5), 118 fUsed(geom.GetNumPixels()),*/ fColors(kItemsLegend)118 fUsed(geom.GetNumPixels()),*/ fColors(kItemsLegend), fYProj(NULL) 119 119 { 120 120 //fGeomCam = (MGeomCam*)geom.Clone(); … … 160 160 { 161 161 if (fGeomCam) 162 162 delete fGeomCam; 163 163 if (fNotify) 164 delete fNotify; 164 delete fNotify; 165 if (fYProj) 166 delete fYProj; 167 165 168 } 166 169 … … 399 402 gPad->SetBorderMode(0); 400 403 404 TString opt(option); 405 opt.ToLower(); 406 401 407 AppendPad(option); 402 408 … … 414 420 // If this makes trouble please write a bug report. 415 421 // 416 TObject *MHCamera::DrawClone(Option_t *option) const 422 TObject *MHCamera::DrawClone(Option_t *option) const 417 423 { 418 424 // Draw a clone of this object in the current pad … … 423 429 424 430 TObject *newobj = Clone(); 431 425 432 if (!newobj) 426 433 return 0; … … 437 444 */ 438 445 439 const TString opt(option); 446 TString opt(option); 447 opt.ToLower(); 448 440 449 newobj->Draw(opt.IsNull() ? GetDrawOption() : option); 441 450 … … 445 454 return newobj; 446 455 } 456 457 void MHCamera::CreateProjection() 458 { 459 460 Int_t nbins = 50; 461 462 // Create the projection histogram 463 TString ytitle(GetYaxis()->GetTitle()); 464 fYProj = new TH1D(ytitle.Data(),GetTitle(),nbins,GetMinimum()-0.1,GetMaximum()+0.1); 465 fYProj->SetXTitle(ytitle.Data()); 466 fYProj->SetYTitle("Nr. of pixels"); 467 fYProj->Sumw2(); 468 fYProj->SetDirectory(NULL); 469 470 // Fill the projected histogram 471 Double_t cont; 472 for (Int_t binx =0;binx<=GetNbinsX()+1;binx++) { 473 cont = GetBinContent(binx); 474 if (cont) 475 fYProj->Fill(cont); 476 } 477 } 478 447 479 448 480 // ------------------------------------------------------------------------ … … 592 624 } 593 625 626 if (opt.Contains("proj")) 627 { 628 629 CreateProjection(); 630 opt.ReplaceAll("proj", ""); 631 fYProj->Paint(opt); 632 return; 633 } 634 594 635 gPad->Clear(); 595 636
Note:
See TracChangeset
for help on using the changeset viewer.