Changeset 2812
- Timestamp:
- 01/15/04 13:58:31 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2811 r2812 10 10 - incorporate Thomas's changes 11 11 - replace void CreateProjection() by TH1D *Projection(const char*) 12 13 * macros/calibration.C 14 - replace MHCamera->Draw("proj") by MHCamera->Projection() 12 15 13 16 -
trunk/MagicSoft/Mars/macros/calibration.C
r2797 r2812 24 24 25 25 void calibration(TString pedname="/mnt/Data/rootdata/Miscellaneous/2003_12_19/20031218_03522_P_Park_E.root", 26 26 TString calname="/mnt/Data/rootdata/Miscellaneous/2003_12_19/20031218_03527_C_Park_E.root") 27 27 { 28 28 … … 56 56 57 57 MHCamEvent hist("Pedestal"); 58 hist.SetType( 0);58 hist.SetType(1); 59 59 plist.AddToList(&hist); 60 60 MFillH fill(&hist, "MPedestalCam"); … … 82 82 tlist.PrintStatistics(); 83 83 84 85 84 // 86 85 // Create a empty Parameter List and an empty Task List 87 86 // 88 87 MParList plist2; 89 90 88 MTaskList tlist2; 91 89 plist2.AddToList(&tlist2); 92 90 93 91 // 92 // Get the previously created MPedestalCam into the new Parameter List 93 // 94 94 plist2.AddToList((MPedestalCam*)plist.FindObject("MPedestalCam")); 95 95 96 // 97 // Get the MAGIC geometry 98 // 96 99 tlist2.AddToList(&geomapl); 100 plist2.AddToList(&geomcam); 97 101 98 102 // … … 106 110 MExtractSignal sigsig; 107 111 MCalibrationCalc calcalc; 108 MExtractedSignalCam sigcam;109 110 plist2.AddToList(&geomcam);111 plist2.AddToList(&sigcam);112 113 112 // 114 113 // As long, as we don't have digital modules, … … 120 119 tlist2.AddToList(&sigsig); 121 120 tlist2.AddToList(&calcalc); 121 122 MExtractedSignalCam sigcam; 123 plist2.AddToList(&sigcam); 122 124 123 125 // … … 152 154 MHCamera disp11 (geomcam, "MCalibrationPix;RSigma", "Reduced Sigmas"); 153 155 MHCamera disp12 (geomcam, "MCalibrationPix;PheFFactorMethod", "Nr. of Phe's (F-Factor Method)"); 154 MHCamera disp13 (geomcam, "MCalibrationPix;MeanConversionFFactorMethod", "Conversion Factor (F-Factor Method)"); 155 MHCamera disp14 (geomcam, "MCalibrationPix;MeanPhotInsidePlexiglass", "Nr. of Photons (Blind Pixel Method)"); 156 MHCamera disp15 (geomcam, "MCalibrationPix;MeanConversionBlindPixelMethod", "Conversion Factor (Blind Pixel Method)"); 156 MHCamera disp13 (geomcam, "MCalibrationPix;MeanConversionFFactorMethod", 157 "Conversion Factor (F-Factor Method)"); 158 MHCamera disp14 (geomcam, "MCalibrationPix;MeanPhotInsidePlexiglass", 159 "Nr. of Photons (Blind Pixel Method)"); 160 MHCamera disp15 (geomcam, "MCalibrationPix;MeanConversionBlindPixelMethod", 161 "Conversion Factor (Blind Pixel Method)"); 157 162 MHCamera disp16 (geomcam, "MCalibrationPix;RSigma/Charge", "Reduced Sigma per Charge"); 158 163 … … 188 193 189 194 disp1.SetYTitle("Charge [FADC counts]"); 190 // disp2.SetYTitle("\\Delta Q [FADC counts]");191 195 disp3.SetYTitle("\\sigma_{Charge} [FADC counts]"); 192 // disp4.SetYTitle("\\Delta {\\sigma_{Q}} [FADC counts]");193 196 disp5.SetYTitle("P_{Charge} [1]"); 194 197 disp6.SetYTitle("Arr. Time [Time Slice Nr.]"); … … 216 219 217 220 TObject *obj1; 218 TObject *obj2;219 221 220 222 c1->cd(1); … … 229 231 c1->cd(5); 230 232 gPad->SetBorderMode(0); 231 obj2 = obj1->DrawClone("proj"); 232 gPad->Update(); 233 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 234 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 233 Float_t he = gStyle->GetStatH(); 234 Float_t wi = gStyle->GetStatH(); 235 gStyle->SetStatH(0.4); 236 gStyle->SetStatW(0.25); 237 TH1D *h2 = ((MHCamera*)obj1)->Projection(obj1->GetName()); 238 h2->Fit("gaus","Q"); 239 h2->GetFunction("gaus")->SetLineColor(kYellow); 240 h2->Draw(); 241 gStyle->SetStatH(he); 242 gStyle->SetStatW(wi); 235 243 236 244 c1->cd(2); … … 245 253 c1->cd(6); 246 254 gPad->SetBorderMode(0); 247 obj2 = obj1->DrawClone("proj"); 248 gPad->Update(); 249 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 250 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 255 Float_t he = gStyle->GetStatH(); 256 Float_t wi = gStyle->GetStatH(); 257 gStyle->SetStatH(0.4); 258 gStyle->SetStatW(0.25); 259 TH1D *h2 = ((MHCamera*)obj1)->Projection(obj1->GetName()); 260 h2->Fit("gaus","Q"); 261 h2->GetFunction("gaus")->SetLineColor(kYellow); 262 h2->Draw(); 263 gStyle->SetStatH(he); 264 gStyle->SetStatW(wi); 251 265 252 266 // Fit Probability … … 265 279 c12->cd(3); 266 280 gPad->SetBorderMode(0); 267 obj2 = obj1->DrawClone("proj"); 268 gPad->Update(); 269 ((MHCamera*)obj2)->GetYProj()->Fit("pol0","Q"); 270 ((MHCamera*)obj2)->GetYProj()->GetFunction("pol0")->SetLineColor(kYellow); 281 Float_t he = gStyle->GetStatH(); 282 Float_t wi = gStyle->GetStatH(); 283 gStyle->SetStatH(0.4); 284 gStyle->SetStatW(0.25); 285 TH1D *h2 = ((MHCamera*)obj1)->Projection(obj1->GetName()); 286 h2->Fit("gaus","Q"); 287 h2->GetFunction("gaus")->SetLineColor(kYellow); 288 h2->Draw(); 289 gStyle->SetStatH(he); 290 gStyle->SetStatW(wi); 271 291 272 292 // Times … … 284 304 c2->cd(7); 285 305 gPad->SetBorderMode(0); 286 obj2 = obj1->DrawClone("proj"); 287 gPad->Update(); 288 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 289 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 306 Float_t he = gStyle->GetStatH(); 307 Float_t wi = gStyle->GetStatH(); 308 gStyle->SetStatH(0.4); 309 gStyle->SetStatW(0.25); 310 TH1D *h2 = ((MHCamera*)obj1)->Projection(obj1->GetName()); 311 h2->Fit("gaus","Q"); 312 h2->GetFunction("gaus")->SetLineColor(kYellow); 313 h2->Draw(); 314 gStyle->SetStatH(he); 315 gStyle->SetStatW(wi); 290 316 291 317 c2->cd(2); … … 299 325 c2->cd(8); 300 326 gPad->SetBorderMode(0); 301 obj2 = obj1->DrawClone("proj"); 302 gPad->Update(); 303 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 304 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 327 Float_t he = gStyle->GetStatH(); 328 Float_t wi = gStyle->GetStatH(); 329 gStyle->SetStatH(0.4); 330 gStyle->SetStatW(0.25); 331 TH1D *h2 = ((MHCamera*)obj1)->Projection(obj1->GetName()); 332 h2->Fit("gaus","Q"); 333 h2->GetFunction("gaus")->SetLineColor(kYellow); 334 h2->Draw(); 335 gStyle->SetStatH(he); 336 gStyle->SetStatW(wi); 305 337 306 338 c2->cd(3); … … 314 346 c2->cd(9); 315 347 gPad->SetBorderMode(0); 316 obj2 = obj1->DrawClone("proj"); 317 gPad->Update(); 318 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 319 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 348 Float_t he = gStyle->GetStatH(); 349 Float_t wi = gStyle->GetStatH(); 350 gStyle->SetStatH(0.4); 351 gStyle->SetStatW(0.25); 352 TH1D *h2 = ((MHCamera*)obj1)->Projection(obj1->GetName()); 353 h2->Fit("gaus","Q"); 354 h2->GetFunction("gaus")->SetLineColor(kYellow); 355 h2->Draw(); 356 gStyle->SetStatH(he); 357 gStyle->SetStatW(wi); 320 358 321 359 // Pedestals … … 333 371 c3->cd(5); 334 372 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); 373 Float_t he = gStyle->GetStatH(); 374 Float_t wi = gStyle->GetStatH(); 375 gStyle->SetStatH(0.4); 376 gStyle->SetStatW(0.25); 377 TH1D *h2 = ((MHCamera*)obj1)->Projection(obj1->GetName()); 378 h2->Fit("gaus","Q"); 379 h2->GetFunction("gaus")->SetLineColor(kYellow); 380 h2->Draw(); 381 gStyle->SetStatH(he); 382 gStyle->SetStatW(wi); 339 383 340 384 c3->cd(2); … … 348 392 c3->cd(6); 349 393 gPad->SetBorderMode(0); 350 obj2 = obj1->DrawClone("proj"); 351 gPad->Update(); 352 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 353 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 394 Float_t he = gStyle->GetStatH(); 395 Float_t wi = gStyle->GetStatH(); 396 gStyle->SetStatH(0.4); 397 gStyle->SetStatW(0.25); 398 TH1D *h2 = ((MHCamera*)obj1)->Projection(obj1->GetName()); 399 h2->Fit("gaus","Q"); 400 h2->GetFunction("gaus")->SetLineColor(kYellow); 401 h2->Draw(); 402 gStyle->SetStatH(he); 403 gStyle->SetStatW(wi); 354 404 355 405 // Reduced Sigmas … … 367 417 c4->cd(5); 368 418 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); 419 Float_t he = gStyle->GetStatH(); 420 Float_t wi = gStyle->GetStatH(); 421 gStyle->SetStatH(0.4); 422 gStyle->SetStatW(0.25); 423 TH1D *h2 = ((MHCamera*)obj1)->Projection(obj1->GetName()); 424 h2->Fit("gaus","Q"); 425 h2->GetFunction("gaus")->SetLineColor(kYellow); 426 h2->Draw(); 427 gStyle->SetStatH(he); 428 gStyle->SetStatW(wi); 373 429 374 430 c4->cd(2); … … 382 438 c4->cd(6); 383 439 gPad->SetBorderMode(0); 384 obj2 = obj1->DrawClone("proj"); 385 gPad->Update(); 386 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 387 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 440 Float_t he = gStyle->GetStatH(); 441 Float_t wi = gStyle->GetStatH(); 442 gStyle->SetStatH(0.4); 443 gStyle->SetStatW(0.25); 444 TH1D *h2 = ((MHCamera*)obj1)->Projection(obj1->GetName()); 445 h2->Fit("gaus","Q"); 446 h2->GetFunction("gaus")->SetLineColor(kYellow); 447 h2->Draw(); 448 gStyle->SetStatH(he); 449 gStyle->SetStatW(wi); 388 450 389 451 // F-Factor Method … … 401 463 c5->cd(5); 402 464 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); 465 Float_t he = gStyle->GetStatH(); 466 Float_t wi = gStyle->GetStatH(); 467 gStyle->SetStatH(0.4); 468 gStyle->SetStatW(0.25); 469 TH1D *h2 = ((MHCamera*)obj1)->Projection(obj1->GetName()); 470 h2->Fit("gaus","Q"); 471 h2->GetFunction("gaus")->SetLineColor(kYellow); 472 h2->Draw(); 473 gStyle->SetStatH(he); 474 gStyle->SetStatW(wi); 407 475 408 476 c5->cd(2); … … 416 484 c5->cd(6); 417 485 gPad->SetBorderMode(0); 418 obj2 = obj1->DrawClone("proj"); 419 gPad->Update(); 420 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 421 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 486 Float_t he = gStyle->GetStatH(); 487 Float_t wi = gStyle->GetStatH(); 488 gStyle->SetStatH(0.4); 489 gStyle->SetStatW(0.25); 490 TH1D *h2 = ((MHCamera*)obj1)->Projection(obj1->GetName()); 491 h2->Fit("gaus","Q"); 492 h2->GetFunction("gaus")->SetLineColor(kYellow); 493 h2->Draw(); 494 gStyle->SetStatH(he); 495 gStyle->SetStatW(wi); 422 496 423 497 // Blind Pixel Method … … 444 518 c6->cd(6); 445 519 gPad->SetBorderMode(0); 446 obj2 = obj1->DrawClone("proj"); 447 gPad->Update(); 448 ((MHCamera*)obj2)->GetYProj()->Fit("gaus","Q"); 449 ((MHCamera*)obj2)->GetYProj()->GetFunction("gaus")->SetLineColor(kYellow); 520 Float_t he = gStyle->GetStatH(); 521 Float_t wi = gStyle->GetStatH(); 522 gStyle->SetStatH(0.4); 523 gStyle->SetStatW(0.25); 524 TH1D *h2 = ((MHCamera*)obj1)->Projection(obj1->GetName()); 525 h2->Fit("gaus","Q"); 526 h2->GetFunction("gaus")->SetLineColor(kYellow); 527 h2->Draw(); 528 gStyle->SetStatH(he); 529 gStyle->SetStatW(wi); 530 450 531 } 451 532 -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r2810 r2812 95 95 // Default Constructor. To be used by the root system ONLY. 96 96 // 97 MHCamera::MHCamera() : TH1D(), fGeomCam(NULL), fColors(kItemsLegend) , fYProj(NULL)97 MHCamera::MHCamera() : TH1D(), fGeomCam(NULL), fColors(kItemsLegend) 98 98 { 99 99 Init(); … … 474 474 TH1D *MHCamera::Projection(const char *name) const 475 475 { 476 477 Int_t nbins = 50; 478 476 479 // Create the projection histogram 477 480 TString pname(name); … … 495 498 Int_t newbins=0; 496 499 497 THLimitsFinder::OptimizeLimits( 50, newbins, min, max, kFALSE);498 499 h1 = new TH1D(pname, GetTitle(), 50, min, max);500 THLimitsFinder::OptimizeLimits(nbins, newbins, min, max, kFALSE); 501 502 h1 = new TH1D(pname, GetTitle(), nbins, min, max); 500 503 501 504 h1->SetXTitle(GetYaxis()->GetTitle()); … … 516 519 517 520 return h1; 518 }519 520 // ------------------------------------------------------------------------521 // Will be removed in the future522 void MHCamera::CreateProjection()523 {524 Int_t nbins = 50;525 526 // Create the projection histogram527 TString ytitle(GetYaxis()->GetTitle());528 fYProj = new TH1D(ytitle.Data(),GetTitle(),nbins,GetMinimum()-0.1,GetMaximum()+0.1);529 fYProj->SetXTitle(ytitle.Data());530 fYProj->SetYTitle("Nr. of pixels");531 fYProj->Sumw2();532 fYProj->SetDirectory(NULL);533 534 // Fill the projected histogram535 Double_t cont;536 for (Int_t binx =0;binx<=GetNbinsX()+1;binx++) {537 cont = GetBinContent(binx);538 if (cont)539 fYProj->Fill(cont);540 }541 521 } 542 522 … … 689 669 if (opt.Contains("proj")) 690 670 { 691 CreateProjection(); 692 opt.ReplaceAll("proj", ""); 693 Float_t he = gStyle->GetStatH(); 694 Float_t wi = gStyle->GetStatH(); 695 gStyle->SetStatH(0.4); 696 gStyle->SetStatW(0.25); 697 fYProj->Paint(opt); 698 gStyle->SetStatH(he); 699 gStyle->SetStatW(wi); 700 return; 671 opt.ReplaceAll("proj", ""); 672 Projection(GetName())->Paint(opt); 673 return; 701 674 } 702 675
Note:
See TracChangeset
for help on using the changeset viewer.