Changeset 8355
- Timestamp:
- 03/03/07 22:01:13 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc
r8192 r8355 83 83 using namespace std; 84 84 85 const Float_t MCalibrationRelTimeCalc::fgRelTimeResolutionLimit = 1.0;85 const Float_t MCalibrationRelTimeCalc::fgRelTimeResolutionLimit = 0.05; 86 86 87 87 // -------------------------------------------------------------------------- … … 372 372 */ 373 373 areasum [aidx] /= numareavalid[aidx]; 374 lowlim [aidx] = 0 .;374 lowlim [aidx] = 0; 375 375 upplim [aidx] = areasum [aidx] + fRelTimeResolutionLimit; 376 376 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc
r8342 r8355 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationChargeCam.cc,v 1.5 3 2007-03-01 18:21:08tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationChargeCam.cc,v 1.54 2007-03-03 22:00:25 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 21 21 ! Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de> 22 22 ! 23 ! Copyright: MAGIC Software Development, 2000-200 623 ! Copyright: MAGIC Software Development, 2000-2007 24 24 ! 25 25 ! … … 122 122 ///////////////////////////////////////////////////////////////////////////// 123 123 #include "MHCalibrationChargeCam.h" 124 #include "MHCalibrationCam.h"125 126 #include "MLog.h"127 #include "MLogManip.h"128 129 #include "MParList.h"130 131 #include "MHCalibrationChargePix.h"132 #include "MHCalibrationPix.h"133 134 #include "MCalibrationIntensityCam.h"135 #include "MCalibrationChargeCam.h"136 #include "MCalibrationChargePix.h"137 138 #include "MGeomCam.h"139 #include "MGeomPix.h"140 141 #include "MBadPixelsIntensityCam.h"142 #include "MBadPixelsCam.h"143 #include "MBadPixelsPix.h"144 145 #include "MRawEvtData.h"146 #include "MRawRunHeader.h"147 #include "MRawEvtPixelIter.h"148 149 #include "MExtractedSignalCam.h"150 #include "MExtractedSignalPix.h"151 152 #include "MArrayI.h"153 #include "MArrayD.h"154 124 155 125 #include <TOrdCollection.h> … … 159 129 #include <TStyle.h> 160 130 #include <TF1.h> 131 #include <TLine.h> 161 132 #include <TLatex.h> 162 133 #include <TLegend.h> 163 134 #include <TGraph.h> 164 135 #include <TEnv.h> 136 137 #include "MLog.h" 138 #include "MLogManip.h" 139 140 #include "MParList.h" 141 142 #include "MHCalibrationChargePix.h" 143 #include "MHCalibrationPix.h" 144 145 #include "MCalibrationIntensityCam.h" 146 #include "MCalibrationChargeCam.h" 147 #include "MCalibrationChargePix.h" 148 149 #include "MGeomCam.h" 150 #include "MGeomPix.h" 151 152 #include "MBadPixelsIntensityCam.h" 153 #include "MBadPixelsCam.h" 154 #include "MBadPixelsPix.h" 155 156 #include "MRawEvtData.h" 157 #include "MRawRunHeader.h" 158 #include "MRawEvtPixelIter.h" 159 160 #include "MExtractedSignalCam.h" 161 #include "MExtractedSignalPix.h" 162 163 #include "MArrayI.h" 164 #include "MArrayD.h" 165 165 166 166 ClassImp(MHCalibrationChargeCam); … … 287 287 cam->fLoGainLast = fLoGainLast; 288 288 cam->fReferenceFile = fReferenceFile; 289 cam->fInnerRefCharge = fInnerRefCharge; 290 cam->fOuterRefCharge = fOuterRefCharge; 289 291 290 292 // … … 388 390 if ( fColor == MCalibrationCam::kBLUE) 389 391 SetBinning(fLoGainNbins, fLoGainFirst, 2.*fLoGainLast - fLoGainFirst); 390 392 391 393 InitHiGainArrays(npixels,nareas,nsectors); 392 394 InitLoGainArrays(npixels,nareas,nsectors); … … 469 471 fAverageHiGainAreas->AddAt(new MHCalibrationChargePix(Form("%sHiGainArea%d",fHistName.Data(),j), 470 472 Form("%s High Gain Area Idx %d",fHistTitle.Data(),j)),j); 471 473 472 474 MHCalibrationChargePix &pix = (MHCalibrationChargePix&)GetAverageHiGainArea(j); 473 475 474 476 pix.SetBinning(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas), 475 477 fFirst, fLast); 476 478 477 479 pix.SetBinningAbsTime(higainsamples, -0.5, higainsamples-0.5); 478 480 … … 480 482 481 483 h = pix.GetHAbsTime(); 482 484 483 485 h->SetName (Form("H%sHiGainArea%d",fAbsHistName.Data(),j)); 484 486 h->SetTitle(Form("%s%s%d",fAbsHistTitle.Data(), … … 502 504 503 505 pix.SetBinningAbsTime(higainsamples, -0.5, higainsamples-0.5); 504 506 505 507 InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadSector(j) : fCam->GetAverageBadSector(j),j); 506 508 507 509 h = pix.GetHAbsTime(); 508 510 509 511 h->SetName (Form("H%sHiGainSector%02d",fAbsHistName.Data(),j)); 510 512 h->SetTitle(Form("%s%s%02d",fAbsHistTitle.Data(), … … 559 561 560 562 pix.SetBinning(fLoGainNbins, fLoGainFirst, fLoGainLast); 561 562 563 pix.SetProbLimit(fProbLimit); 563 564 … … 583 584 fAverageLoGainAreas->AddAt(new MHCalibrationChargePix(Form("%sLoGainArea%d",fHistName.Data(),j), 584 585 Form("%s Low Gain Area Idx %d",fHistTitle.Data(),j)),j); 585 586 586 587 MHCalibrationChargePix &pix = (MHCalibrationChargePix&)GetAverageLoGainArea(j); 587 588 588 589 pix.SetBinning(fLoGainNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas), 589 590 fLoGainFirst, fLoGainLast); 590 591 591 592 pix.SetBinningAbsTime(logainsamples, -0.5, logainsamples-0.5); 592 593 … … 669 670 const UInt_t nareas = fGeom->GetNumAreas(); 670 671 const UInt_t nsectors = fGeom->GetNumSectors(); 671 const UInt_t lofirst = signal->GetFirstUsedSliceLoGain(); 672 673 const Int_t hifirst = fSignal->GetFirstUsedSliceHiGain(); 674 const Int_t hilast = fSignal->GetLastUsedSliceHiGain(); 675 const Int_t lofirst = fSignal->GetFirstUsedSliceLoGain(); 676 const Int_t lolast = fSignal->GetLastUsedSliceLoGain(); 672 677 673 678 fSumhiarea .Reset(); … … 759 764 continue; 760 765 761 const Float_t timehi = (Float_t)pixel.GetIdxMaxHiGainSample( );766 const Float_t timehi = (Float_t)pixel.GetIdxMaxHiGainSample(hifirst, hilast); 762 767 763 768 histhi.FillAbsTime(timehi); … … 773 778 MHCalibrationChargePix &histlo = (MHCalibrationChargePix&)(*this)(pixid); 774 779 775 const Float_t timelo = (Float_t)pixel.GetIdxMaxLoGainSample(lofirst );780 const Float_t timelo = (Float_t)pixel.GetIdxMaxLoGainSample(lofirst, lolast); 776 781 histlo.FillAbsTime(timelo); 777 782 … … 1262 1267 if (pix.IsEmpty()) 1263 1268 return; 1264 1265 TVirtualPad *newpad = gPad; 1266 newpad->Divide(1,2); 1267 newpad->cd(1); 1268 1269 gPad->SetTicks(); 1270 if (!pix.IsEmpty() && !pix.IsOnlyOverflow() && !pix.IsOnlyUnderflow()) 1271 gPad->SetLogy(); 1272 1273 TH1F *hist = pix.GetHGausHist(); 1274 1275 TH1F *null = new TH1F("Null",hist->GetTitle(),100, 1276 pix.GetFirst() > 0. ? pix.GetFirst() : 0., 1277 pix.GetLast() > pix.GetFirst() 1278 ? ( pix.GetLast() > 450. 1279 ? ( fColor == MCalibrationCam::kBLUE ? 800. : 450. ) 1280 : pix.GetLast() ) 1281 : pix.GetFirst()*2.); 1282 1283 null->SetMaximum(1.1*hist->GetMaximum()); 1284 null->SetDirectory(NULL); 1285 null->SetBit(kCanDelete); 1286 null->SetStats(kFALSE); 1287 // 1288 // set the labels bigger 1289 // 1290 TAxis *xaxe = null->GetXaxis(); 1291 TAxis *yaxe = null->GetYaxis(); 1292 xaxe->CenterTitle(); 1293 yaxe->CenterTitle(); 1294 xaxe->SetTitleSize(0.07); 1295 yaxe->SetTitleSize(0.07); 1296 xaxe->SetTitleOffset(0.7); 1297 yaxe->SetTitleOffset(0.55); 1298 xaxe->SetLabelSize(0.06); 1299 yaxe->SetLabelSize(0.06); 1300 xaxe->SetTitle(hist->GetXaxis()->GetTitle()); 1301 yaxe->SetTitle(hist->GetYaxis()->GetTitle()); 1302 1303 null->Draw(); 1304 hist->Draw("same"); 1305 1306 gStyle->SetOptFit(); 1307 1308 TF1 *fit = pix.GetFGausFit(); 1309 1310 if (fit) 1311 { 1312 switch ( fColor ) 1313 { 1314 case MCalibrationCam::kGREEN: 1315 fit->SetLineColor(kGreen); 1316 break; 1317 case MCalibrationCam::kBLUE: 1318 fit->SetLineColor(kBlue); 1319 break; 1320 case MCalibrationCam::kUV: 1321 fit->SetLineColor(106); 1322 break; 1323 case MCalibrationCam::kCT1: 1324 fit->SetLineColor(006); 1325 break; 1326 default: 1327 fit->SetLineColor(kRed); 1328 } 1329 fit->Draw("same"); 1330 } 1331 1332 DisplayRefLines(null,refline); 1333 1334 newpad->cd(2); 1335 gPad->SetTicks(); 1336 1337 TH1F *null2 = new TH1F("Null2",hist->GetTitle(),100,0.,pix.GetEvents()->GetSize()/pix.GetEventFrequency()); 1338 1339 null2->SetMinimum(pix.GetMean()-10.*pix.GetSigma()); 1340 null2->SetMaximum(pix.GetMean()+10.*pix.GetSigma()); 1341 null2->SetDirectory(NULL); 1342 null2->SetBit(kCanDelete); 1343 null2->SetStats(kFALSE); 1344 // 1345 // set the labels bigger 1346 // 1347 TAxis *xaxe2 = null2->GetXaxis(); 1348 TAxis *yaxe2 = null2->GetYaxis(); 1349 xaxe2->CenterTitle(); 1350 yaxe2->CenterTitle(); 1351 xaxe2->SetTitleSize(0.07); 1352 yaxe2->SetTitleSize(0.07); 1353 xaxe2->SetTitleOffset(0.7); 1354 yaxe2->SetTitleOffset(0.55); 1355 xaxe2->SetLabelSize(0.06); 1356 yaxe2->SetLabelSize(0.06); 1357 1358 pix.CreateGraphEvents(); 1359 TGraph *gr = pix.GetGraphEvents(); 1360 if (gr) 1361 { 1362 xaxe2->SetTitle(gr->GetXaxis()->GetTitle()); 1363 yaxe2->SetTitle(gr->GetYaxis()->GetTitle()); 1364 } 1365 1366 null2->Draw(); 1367 1368 pix.DrawEvents("same"); 1369 1370 // newpad->cd(3); 1371 // pix.DrawPowerSpectrum(*newpad,4); 1372 1373 return; 1374 1269 1270 TVirtualPad *pad = gPad; 1271 pad->Divide(1,2, 1e-10, 1e-10); 1272 pad->cd(1); 1273 1274 gPad->SetBorderMode(0); 1275 gPad->SetTicks(); 1276 if (!pix.IsEmpty() && !pix.IsOnlyOverflow() && !pix.IsOnlyUnderflow()) 1277 gPad->SetLogy(); 1278 1279 TH1F *hist = pix.GetHGausHist(); 1280 TAxis *xaxe = hist->GetXaxis(); 1281 TAxis *yaxe = hist->GetYaxis(); 1282 xaxe->CenterTitle(); 1283 yaxe->CenterTitle(); 1284 xaxe->SetTitleSize(0.07); 1285 yaxe->SetTitleSize(0.07); 1286 xaxe->SetTitleOffset(0.7); 1287 yaxe->SetTitleOffset(0.55); 1288 xaxe->SetLabelSize(0.06); 1289 yaxe->SetLabelSize(0.06); 1290 xaxe->SetTitle(hist->GetXaxis()->GetTitle()); 1291 yaxe->SetTitle(hist->GetYaxis()->GetTitle()); 1292 xaxe->SetRange(hist->GetMaximumBin()-30, hist->GetMaximumBin()+30); 1293 1294 gStyle->SetOptFit(); 1295 1296 hist->Draw(); 1297 1298 TF1 *fit = pix.GetFGausFit(); 1299 if (fit) 1300 { 1301 switch (fColor) 1302 { 1303 case MCalibrationCam::kGREEN: 1304 fit->SetLineColor(kGreen); 1305 break; 1306 case MCalibrationCam::kBLUE: 1307 fit->SetLineColor(kBlue); 1308 break; 1309 case MCalibrationCam::kUV: 1310 fit->SetLineColor(106); 1311 break; 1312 case MCalibrationCam::kCT1: 1313 fit->SetLineColor(006); 1314 break; 1315 default: 1316 fit->SetLineColor(kRed); 1317 } 1318 fit->Draw("same"); 1319 } 1320 1321 DisplayRefLines(hist,refline); 1322 1323 pad->cd(2); 1324 gPad->SetBorderMode(0); 1325 gPad->SetTicks(); 1326 1327 pix.CreateGraphEvents(); 1328 TGraph *gr = pix.GetGraphEvents(); 1329 if (gr) 1330 { 1331 TH1F *null2 = gr->GetHistogram(); 1332 1333 null2->SetMinimum(pix.GetMean()-10.*pix.GetSigma()); 1334 null2->SetMaximum(pix.GetMean()+10.*pix.GetSigma()); 1335 null2->SetStats(kFALSE); 1336 1337 // 1338 // set the labels bigger 1339 // 1340 TAxis *xaxe2 = null2->GetXaxis(); 1341 TAxis *yaxe2 = null2->GetYaxis(); 1342 xaxe2->CenterTitle(); 1343 yaxe2->CenterTitle(); 1344 xaxe2->SetTitleSize(0.07); 1345 yaxe2->SetTitleSize(0.07); 1346 xaxe2->SetTitleOffset(0.7); 1347 yaxe2->SetTitleOffset(0.55); 1348 xaxe2->SetLabelSize(0.06); 1349 yaxe2->SetLabelSize(0.06); 1350 xaxe2->SetRangeUser(0, pix.GetEvents()->GetSize()/pix.GetEventFrequency()); 1351 } 1352 1353 pix.DrawEvents(); 1354 1355 // newpad->cd(3); 1356 // pix.DrawPowerSpectrum(*newpad,4); 1375 1357 } 1376 1377 1358 1378 1359 void MHCalibrationChargeCam::DisplayRefLines(const TH1F *hist, const Float_t refline) const 1379 1360 { 1380 1381 TGraph *uv10 = new TGraph(2); 1382 uv10->SetPoint(0,refline,0.); 1383 uv10->SetPoint(1,refline,hist->GetMaximum()); 1384 uv10->SetBit(kCanDelete); 1385 uv10->SetLineColor(106); 1386 uv10->SetLineStyle(2); 1387 uv10->SetLineWidth(3); 1388 uv10->Draw("L"); 1389 1390 TLegend *leg = new TLegend(0.8,0.55,0.99,0.99); 1391 leg->SetBit(kCanDelete); 1392 leg->AddEntry(uv10,"10 Leds UV","l"); 1393 1394 leg->Draw(); 1361 TLine *line = new TLine(refline, 0, refline, hist->GetMaximum()); 1362 line->SetLineColor(106); 1363 line->SetLineStyle(2); 1364 line->SetLineWidth(3); 1365 line->SetBit(kCanDelete); 1366 line->Draw(); 1367 1368 TLegend *leg = new TLegend(0.8,0.01,0.99,0.45); 1369 leg->AddEntry(line, "10 Leds UV", "l"); 1370 leg->SetBit(kCanDelete); 1371 leg->Draw(); 1395 1372 } 1396 1373 … … 1398 1375 { 1399 1376 1400 Bool_t rc = kFALSE; 1401 1402 if (MHCalibrationCam::ReadEnv(env,prefix,print)) 1403 rc = kTRUE; 1404 1377 Int_t rc = MHCalibrationCam::ReadEnv(env,prefix,print); 1378 if (rc==kERROR) 1379 return kERROR; 1380 1405 1381 if (IsEnvDefined(env, prefix, "HiGainNbins", print)) 1406 1382 { … … 1408 1384 rc = kTRUE; 1409 1385 } 1410 1386 1411 1387 if (IsEnvDefined(env, prefix, "HiGainFirst", print)) 1412 1388 { … … 1414 1390 rc = kTRUE; 1415 1391 } 1416 1392 1417 1393 if (IsEnvDefined(env, prefix, "HiGainLast", print)) 1418 1394 { … … 1420 1396 rc = kTRUE; 1421 1397 } 1422 1398 1423 1399 if (IsEnvDefined(env, prefix, "LoGainNbins", print)) 1424 1400 { … … 1426 1402 rc = kTRUE; 1427 1403 } 1428 1404 1429 1405 if (IsEnvDefined(env, prefix, "LoGainFirst", print)) 1430 1406 { … … 1432 1408 rc = kTRUE; 1433 1409 } 1434 1410 1435 1411 if (IsEnvDefined(env, prefix, "LoGainLast", print)) 1436 1412 { … … 1438 1414 rc = kTRUE; 1439 1415 } 1440 1416 1441 1417 if (IsEnvDefined(env, prefix, "TimeLowerLimit", print)) 1442 1418 { … … 1444 1420 rc = kTRUE; 1445 1421 } 1446 1422 1447 1423 if (IsEnvDefined(env, prefix, "TimeUpperLimit", print)) 1448 1424 { … … 1450 1426 rc = kTRUE; 1451 1427 } 1452 1428 1453 1429 if (IsEnvDefined(env, prefix, "ReferenceFile", print)) 1454 1430 { … … 1475 1451 } 1476 1452 1477 1478 1453 TEnv refenv(fReferenceFile); 1479 1454 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc
r8350 r8355 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationPulseTimeCam.cc,v 1.3 2 2007-03-01 23:43:33 tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationPulseTimeCam.cc,v 1.33 2007-03-03 22:01:13 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 105 105 106 106 #include <TEnv.h> 107 #include <TLine.h> 107 108 #include <TGraph.h> 108 109 #include <TLegend.h> … … 218 219 cam->fLast = fLast; 219 220 cam->fReferenceFile = fReferenceFile; 221 cam->fInnerRefTime = fInnerRefTime; 222 cam->fOuterRefTime = fOuterRefTime; 220 223 221 224 if (!IsAverageing()) … … 301 304 fHiGainArray->AddAt(new MHCalibrationPix(Form("%sHiGainPix%04d",fHistName.Data(),i), 302 305 Form("%s High Gain Pixel %4d",fHistTitle.Data(),i)),i); 303 304 MHCalibrationPix &pix = (*this)[i]; 306 307 MHCalibrationPix &pix = (*this)[i]; 305 308 pix.SetBinning(fNbins, fFirst, fLast); 306 309 307 310 MBadPixelsPix &bad = fIntensBad ? (*fIntensBad)[i] : (*fBadPixels)[i]; 308 311 InitHists(pix,bad,i); … … 322 325 fAverageHiGainAreas->AddAt(new MHCalibrationPix(Form("%sHiGainArea%d",fHistName.Data(),j), 323 326 Form("%s High Gain Area Idx %d",fHistTitle.Data(),j)),j); 324 327 325 328 MHCalibrationPix &pix = GetAverageHiGainArea(j); 326 329 pix.SetBinning(fNbins, fFirst, fLast); … … 338 341 MHCalibrationPix &pix = GetAverageHiGainSector(j); 339 342 pix.SetBinning(fNbins, fFirst, fLast); 340 343 341 344 InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadSector(j) : fCam->GetAverageBadSector(j),j); 342 345 } … … 469 472 for (Int_t i=0; i<fHiGainArray->GetSize(); i++) 470 473 { 471 474 472 475 MHCalibrationPix &hist = (*this)[i]; 473 476 474 477 if (hist.IsExcluded()) 475 478 continue; 476 479 477 480 MCalibrationPix &pix = calcam[i]; 478 481 CalcHists(hist,pix); … … 481 484 if (!IsAverageing()) 482 485 return kTRUE; 483 486 484 487 for (Int_t j=0; j<fAverageHiGainAreas->GetSize(); j++) 485 488 { 486 487 489 MHCalibrationPix &hist = GetAverageHiGainArea(j); 488 490 MCalibrationPix &pix = calcam.GetAverageArea(j); 489 491 CalcHists(hist,pix); 490 }491 492 } 493 492 494 for (Int_t j=0; j<fAverageHiGainSectors->GetSize(); j++) 493 495 { … … 496 498 CalcHists(hist,pix); 497 499 } 498 500 499 501 return kTRUE; 500 502 } … … 570 572 option.ToLower(); 571 573 572 TVirtualPad *pad = gPad ? gPad : MH::MakeDefCanvas(this); 574 TVirtualPad *pad = gPad ? gPad : MH::MakeDefCanvas(this); 573 575 pad->SetBorderMode(0); 574 pad->Divide(1,nareas );576 pad->Divide(1,nareas, 1e-10, 1e-10); 575 577 576 578 // 577 579 // Loop over inner and outer pixels 578 // 579 for (Int_t i=0; i<nareas;i++) 580 // 581 for (Int_t i=0; i<nareas;i++) 580 582 { 581 582 583 pad->cd(i+1); 583 584 584 585 MHCalibrationPix &hipix = GetAverageHiGainArea(i); 585 586 DrawDataCheckPixel(hipix,i ? fOuterRefTime : fInnerRefTime); 586 }587 } 587 588 } 588 589 … … 597 598 void MHCalibrationPulseTimeCam::DrawDataCheckPixel(MHCalibrationPix &pix, const Float_t refline) 598 599 { 599 600 gPad->SetTicks(); 601 602 TH1F *hist = pix.GetHGausHist(); 603 604 TH1F *null = new TH1F("Null",hist->GetTitle(),100, 605 pix.GetFirst() > 0. ? pix.GetFirst() : 0., 606 pix.GetLast() > pix.GetFirst() 607 ? pix.GetLast() : pix.GetFirst()*2.); 608 609 null->SetMaximum(1.1*hist->GetMaximum()); 610 null->SetDirectory(NULL); 611 null->SetBit(kCanDelete); 612 null->SetStats(kFALSE); 613 // 614 // set the labels bigger 615 // 616 TAxis *xaxe = null->GetXaxis(); 617 TAxis *yaxe = null->GetYaxis(); 618 xaxe->CenterTitle(); 619 yaxe->CenterTitle(); 620 xaxe->SetTitleSize(0.06); 621 yaxe->SetTitleSize(0.076); 622 xaxe->SetTitleOffset(0.6); 623 yaxe->SetTitleOffset(0.65); 624 xaxe->SetLabelSize(0.06); 625 yaxe->SetLabelSize(0.06); 626 xaxe->SetTitle(hist->GetXaxis()->GetTitle()); 627 yaxe->SetTitle(hist->GetYaxis()->GetTitle()); 628 629 null->Draw(); 630 hist->Draw("same"); 631 632 DisplayRefLines(null,refline); 633 634 return; 635 600 gPad->SetBorderMode(0); 601 gPad->SetTicks(); 602 603 TH1F *hist = pix.GetHGausHist(); 604 605 // 606 // set the labels bigger 607 // 608 TAxis *xaxe = hist->GetXaxis(); 609 TAxis *yaxe = hist->GetYaxis(); 610 xaxe->CenterTitle(); 611 yaxe->CenterTitle(); 612 xaxe->SetTitleSize(0.06); 613 yaxe->SetTitleSize(0.076); 614 xaxe->SetTitleOffset(0.6); 615 yaxe->SetTitleOffset(0.65); 616 xaxe->SetLabelSize(0.06); 617 yaxe->SetLabelSize(0.06); 618 xaxe->SetTitle(hist->GetXaxis()->GetTitle()); 619 yaxe->SetTitle(hist->GetYaxis()->GetTitle()); 620 xaxe->SetRange(hist->GetMaximumBin()-30, hist->GetMaximumBin()+30); 621 622 hist->Draw(); 623 624 DisplayRefLines(hist, refline); 636 625 } 637 626 638 627 void MHCalibrationPulseTimeCam::DisplayRefLines(const TH1F *hist, const Float_t refline) const 639 628 { 640 641 TGraph *gr = new TGraph(2); 642 gr->SetPoint(0,refline,0.); 643 gr->SetPoint(1,refline,hist->GetMaximum()); 644 gr->SetBit(kCanDelete); 645 gr->SetLineColor(106); 646 gr->SetLineStyle(2); 647 gr->SetLineWidth(3); 648 gr->Draw("L"); 649 650 TLegend *leg = new TLegend(0.8,0.35,0.99,0.65); 651 leg->SetBit(kCanDelete); 652 leg->AddEntry(gr,"Reference","l"); 653 654 leg->Draw(); 629 TLine *line = new TLine(refline, 0, refline, hist->GetMaximum()); 630 line->SetLineColor(106); 631 line->SetLineStyle(2); 632 line->SetLineWidth(3); 633 line->SetBit(kCanDelete); 634 line->Draw(); 635 636 TLegend *leg = new TLegend(0.8,0.35,0.99,0.65); 637 leg->AddEntry(line, "Reference", "l"); 638 leg->SetBit(kCanDelete); 639 leg->Draw(); 655 640 } 656 641
Note:
See TracChangeset
for help on using the changeset viewer.