Changeset 2662 for trunk/MagicSoft/Mars
- Timestamp:
- 12/12/03 09:41:11 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCalibrationCam.h
r2661 r2662 110 110 Bool_t CalcNrPhotInnerPixel(); 111 111 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 112 void DrawPixelContent(Int_t num) const;112 void DrawPixelContent(Int_t num) const; 113 113 114 114 MCalibrationPix *GetCalibrationPix(Int_t idx) const; -
trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc
r2661 r2662 127 127 //fNumHiGainSamples = fRunHeader->GetNumSamplesHiGain(); 128 128 //fNumLoGainSamples = fRunHeader->GetNumSamplesLoGain(); 129 fNumHiGainSamples = fAfter+fBefore;130 fNumLoGainSamples = fAfter+fBefore;129 fNumHiGainSamples = 6; 130 fNumLoGainSamples = 6; 131 131 132 132 fSqrtHiGainSamples = TMath::Sqrt((float)fNumHiGainSamples); … … 221 221 } 222 222 223 pix.SetExtractedSignal(( float)sumHi - pedes*(float)fNumHiGainSamples,223 pix.SetExtractedSignal((Float_t)sumHi - pedes*(Float_t)fNumHiGainSamples, 224 224 pedrms*fSqrtHiGainSamples, 225 (( float)sumLo - pedes*(float)fNumLoGainSamples)*fConversionHiLo,225 ((Float_t)sumLo - pedes*(Float_t)fNumLoGainSamples)*fConversionHiLo, 226 226 pedrms*fSqrtLoGainSamples 227 227 ); -
trunk/MagicSoft/Mars/mhist/MHCalibrationPixel.cc
r2661 r2662 65 65 MHCalibrationPixel::MHCalibrationPixel(const char *name, const char *title) 66 66 : fPixId(-1), 67 fHiGainvsLoGain(NULL),68 67 fTotalEntries(0), 69 68 fHiGains(NULL), … … 71 70 fChargeGausFit(NULL), 72 71 fTimeGausFit(NULL), 72 fHivsLoGain(NULL), 73 73 fFitLegend(NULL), 74 74 fLowerFitRange(-2000.), … … 166 166 delete fHChargevsNLoGain; 167 167 168 if (fHiGainvsLoGain)169 delete fHiGainvsLoGain;170 171 168 delete fHiGains; 172 169 delete fLoGains; … … 178 175 if (fFitLegend) 179 176 delete fFitLegend; 177 if (fHivsLoGain) 178 delete fHivsLoGain; 179 180 180 181 181 } … … 379 379 { 380 380 381 if (!fHiGainvsLoGain) 382 { 383 384 // Create TGraph, we set the points later, get hold of the number of points with fTotalEntries 385 fHiGainvsLoGain = new TGraph(fTotalEntries,fHiGains->GetArray(),fLoGains->GetArray()); 386 fHiGainvsLoGain->SetName("HiGainvsLoGain"); 387 fHiGainvsLoGain->SetTitle("Plot the High Gain vs. Low Gain"); 388 fHiGainvsLoGain->GetXaxis()->Set(300,0.,1500.); 389 fHiGainvsLoGain->GetYaxis()->Set(400,0.,2000.); 390 fHiGainvsLoGain->GetXaxis()->SetTitle("Sum of Charges High Gain"); 391 fHiGainvsLoGain->GetYaxis()->SetTitle("Sum of Charges Low Gain"); 392 fHiGainvsLoGain->SetMarkerStyle(7); 393 394 } 395 396 TProfile *hist = new TProfile("PePe","Shit is still moving",100,0.,1000.,0.,1000.); 397 398 for (Int_t i=0;i<fTotalEntries;i++) 399 hist->Fill(fHiGains->At(i),fLoGains->At(i),1); 400 381 if (!fHivsLoGain) 382 FitHiGainvsLoGain(); 383 384 401 385 gStyle->SetOptFit(0); 402 386 gStyle->SetOptStat(1111111); 403 404 405 406 407 387 388 TCanvas *c = MakeDefCanvas(this,600,900); 389 390 gROOT->SetSelectedPad(NULL); 391 408 392 c->Divide(2,4); 409 393 … … 440 424 gROOT->SetSelectedPad(NULL); 441 425 gStyle->SetOptFit(); 442 // fHiGainvsLoGain->DrawClone("Apq")->SetBit(kCanDelete); 443 // fHiGainvsLoGain->Fit("p1","q"); 444 hist->Draw("prof"); 445 hist->Fit("pol1","pepe","markus",hist->GetMean()-3.*hist->GetRMS(),hist->GetMean()+2.*hist->GetRMS()); 446 447 fOffset = hist->GetFunction("pepe")->GetParameter(0); 448 fSlope = hist->GetFunction("pepe")->GetParameter(1); 449 450 cout << "Pepe: " << fOffset << " Markus: " << fSlope << endl; 426 fHivsLoGain->Draw("prof"); 451 427 452 428 … … 484 460 gROOT->SetSelectedPad(NULL); 485 461 gStyle->SetOptFit(); 486 hist->Draw("prof"); 487 hist->Fit("p1","pepe","markus",hist->GetMean()-3.*hist->GetRMS(),hist->GetMean()+3.*hist->GetRMS()); 488 // fHiGainvsLoGain->DrawClone("Apq")->SetBit(kCanDelete); 489 // fHiGainvsLoGain->Fit("p1","q"); 462 fHivsLoGain->Draw("prof"); 490 463 gPad->Modified(); 491 464 gPad->Update(); … … 563 536 } 564 537 538 void MHCalibrationPixel::FitHiGainvsLoGain() 539 { 540 541 if (fHivsLoGain) 542 return; 543 544 gStyle->SetOptFit(); 545 546 fHivsLoGain = new TProfile("HiGainvsLoGain","Plot the High Gain vs. Low Gain",100,0.,1000.,0.,1000.); 547 fHivsLoGain->GetXaxis()->SetTitle("Sum of Charges High Gain"); 548 fHivsLoGain->GetYaxis()->SetTitle("Sum of Charges Low Gain"); 549 550 for (Int_t i=0;i<fTotalEntries;i++) 551 fHivsLoGain->Fill(fHiGains->At(i),fLoGains->At(i),1); 552 553 fHivsLoGain->Fit("pol1","rq","",fHivsLoGain->GetMean()-2.5*fHivsLoGain->GetRMS(),fHivsLoGain->GetMean()+2.*fHivsLoGain->GetRMS()); 554 555 fOffset = fHivsLoGain->GetFunction("pol1")->GetParameter(0); 556 fSlope = fHivsLoGain->GetFunction("pol1")->GetParameter(1); 557 558 } 565 559 566 560 -
trunk/MagicSoft/Mars/mhist/MHCalibrationPixel.h
r2661 r2662 18 18 #endif 19 19 20 #ifndef ROOT_T Graph21 #include "T Graph.h"20 #ifndef ROOT_TProfile 21 #include "TProfile.h" 22 22 #endif 23 23 … … 36 36 37 37 Int_t fPixId; // Pixel Nr 38 TGraph *fHiGainvsLoGain; //! Plot the HiGain vs. the LoGain39 38 Int_t fTotalEntries; // Number of entries 40 39 … … 55 54 TF1* fTimeGausFit; 56 55 56 TProfile* fHivsLoGain; 57 57 58 TPaveText *fFitLegend; 58 59 … … 102 103 103 104 void SetPointInGraph(Float_t qhi, Float_t qlo); 105 void FitHiGainvsLoGain(); 104 106 105 107 Bool_t FillChargeLoGain(Float_t q) { return (fHChargeLoGain->Fill(q) > -1); }
Note:
See TracChangeset
for help on using the changeset viewer.