Changeset 2642 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 12/11/03 14:10:12 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHCalibrationBlindPixel.h
r2627 r2642 39 39 TF1 *fSinglePheFit; 40 40 TF1 *fTimeGausFit; 41 TF1 *fSinglePhePedFit; 41 42 42 43 Axis_t fBlindPixelChargefirst; … … 55 56 56 57 BlindPixelFitFunc fgSinglePheFitFunc; // In the beginning, 57 Int_t fgSinglePheFitNPar; // we want to be flexible using different functions58 Int_t fgSinglePheFitNPar; // we want to be flexible using different functions 58 59 59 60 Double_t fLambda; … … 78 79 Double_t fSigmaTimeErr; 79 80 81 Double_t fLambdaCheck; 82 Double_t fLambdaCheckErr; 83 80 84 public: 81 85 … … 88 92 Bool_t FillBlindPixelChargevsN(Stat_t rq, Int_t t) { return fHBlindPixelChargevsN->Fill(t,rq) > -1; } 89 93 90 const Double_t GetLambda() const { return fLambda; } 91 const Double_t GetMu0() const { return fMu0; } 92 const Double_t GetMu1() const { return fMu1; } 93 const Double_t GetSigma0() const { return fSigma0; } 94 const Double_t GetSigma1() const { return fSigma1; } 94 const Double_t GetLambda() const { return fLambda; } 95 const Double_t GetLambdaCheck() const { return fLambdaCheck; } 96 const Double_t GetMu0() const { return fMu0; } 97 const Double_t GetMu1() const { return fMu1; } 98 const Double_t GetSigma0() const { return fSigma0; } 99 const Double_t GetSigma1() const { return fSigma1; } 95 100 96 const Double_t GetLambdaErr() const { return fLambdaErr; } 97 const Double_t GetMu0Err() const { return fMu0Err; } 98 const Double_t GetMu1Err() const { return fMu1Err; } 99 const Double_t GetSigma0Err() const { return fSigma0Err; } 100 const Double_t GetSigma1Err() const { return fSigma1Err; } 101 const Double_t GetLambdaErr() const { return fLambdaErr; } 102 const Double_t GetLambdaCheckErr() const { return fLambdaCheckErr; } 103 const Double_t GetMu0Err() const { return fMu0Err; } 104 const Double_t GetMu1Err() const { return fMu1Err; } 105 const Double_t GetSigma0Err() const { return fSigma0Err; } 106 const Double_t GetSigma1Err() const { return fSigma1Err; } 101 107 102 const Double_t GetChiSquare() const { return fChisquare; }103 const Double_t GetProb() const { return fProb; }104 const Int_t GetNdf() const { return fNdf; }108 const Double_t GetChiSquare() const { return fChisquare; } 109 const Double_t GetProb() const { return fProb; } 110 const Int_t GetNdf() const { return fNdf; } 105 111 106 112 const Double_t GetMeanTime() const { return fMeanTime; } … … 118 124 Double_t sigma1); 119 125 120 Bool_t FitSinglePhe(Axis_t rmin=0, Axis_t rmax=0, Option_t *opt="R 0+");126 Bool_t FitSinglePhe(Axis_t rmin=0, Axis_t rmax=0, Option_t *opt="RL0+"); 121 127 Bool_t FitTime(Axis_t rmin=0., Axis_t rmax=0.,Option_t *opt="R0+"); 122 128 … … 126 132 void Draw(Option_t *option=""); 127 133 134 Bool_t IsFitOK() { return fFitOK; } 135 128 136 ClassDef(MHCalibrationBlindPixel, 1) 129 137 }; -
trunk/MagicSoft/Mars/mhist/MHCalibrationPixel.cc
r2629 r2642 40 40 41 41 #include <TFitter.h> 42 #include <TGraph.h> 43 #include <TAxis.h> 42 44 43 45 #include <TF1.h> … … 62 64 MHCalibrationPixel::MHCalibrationPixel(const char *name, const char *title) 63 65 : fPixId(-1), 66 fHiGainvsLoGain(NULL), 67 fTotalEntries(0), 68 fHiGains(NULL), 69 fLoGains(NULL), 64 70 fChargeGausFit(NULL), 65 71 fTimeGausFit(NULL), … … 141 147 fHChargevsNLoGain->SetDirectory(NULL); 142 148 149 fHiGains = new TArrayF(); 150 fLoGains = new TArrayF(); 151 143 152 } 144 153 … … 153 162 delete fHTimeLoGain; 154 163 delete fHChargevsNLoGain; 164 165 if (fHiGainvsLoGain) 166 delete fHiGainvsLoGain; 167 168 delete fHiGains; 169 delete fLoGains; 155 170 156 171 if (fChargeGausFit) … … 232 247 fChargeLastHiGain = 9999.5; 233 248 234 fHCharge LoGain->GetXaxis()->SetRangeUser(0.,fChargeLastLoGain);249 fHChargeHiGain->GetXaxis()->SetRangeUser(0.,fChargeLastHiGain); 235 250 236 251 for (Int_t i = fHChargeLoGain->FindBin(fChargeFirstLoGain); … … 280 295 } 281 296 297 void MHCalibrationPixel::SetPointInGraph(Float_t qhi,Float_t qlo) 298 { 299 300 fHiGains->Set(++fTotalEntries); 301 fLoGains->Set(fTotalEntries); 302 303 fHiGains->AddAt(qhi,fTotalEntries-1); 304 fLoGains->AddAt(qlo,fTotalEntries-1); 305 306 } 307 282 308 283 309 // ------------------------------------------------------------------------- … … 338 364 void MHCalibrationPixel::Draw(Option_t *opt) 339 365 { 366 367 if (!fHiGainvsLoGain) 368 { 369 370 // Create TGraph, we set the points later, get hold of the number of points with fTotalEntries 371 fHiGainvsLoGain = new TGraph(fTotalEntries,fHiGains->GetArray(),fLoGains->GetArray()); 372 fHiGainvsLoGain->SetName("HiGainvsLoGain"); 373 fHiGainvsLoGain->SetTitle("Plot the High Gain vs. Low Gain"); 374 fHiGainvsLoGain->GetXaxis()->Set(300,0.,1500.); 375 fHiGainvsLoGain->GetYaxis()->Set(400,0.,2000.); 376 fHiGainvsLoGain->SetMarkerStyle(7); 377 378 } 340 379 341 380 gStyle->SetOptFit(0); … … 374 413 fChargeGausFit->DrawCopy("same"); 375 414 } 415 c->Modified(); 416 c->Update(); 417 418 c->cd(3); 419 gROOT->SetSelectedPad(NULL); 420 fHiGainvsLoGain->DrawClone("Apq")->SetBit(kCanDelete); 421 gPad->Modified(); 422 gPad->Update(); 376 423 377 424 c->cd(4); … … 393 440 gPad->SetLogy(1); 394 441 gPad->SetTicks(); 442 395 443 fHChargeLoGain->DrawCopy(opt); 444 c->Modified(); 445 c->Update(); 446 396 447 c->cd(3); 397 448 DrawLegend(); 449 450 c->cd(4); 451 452 gROOT->SetSelectedPad(NULL); 453 fHiGainvsLoGain->DrawClone("Apq")->SetBit(kCanDelete); 454 gPad->Modified(); 455 gPad->Update(); 456 457 398 458 } 399 459 … … 426 486 427 487 fTimeGausFit->DrawCopy("same"); 488 c->Modified(); 489 c->Update(); 428 490 } 429 491 } … … 445 507 gPad->SetLogy(1); 446 508 fHTimeLoGain->DrawCopy(opt); 509 c->Modified(); 510 c->Update(); 511 447 512 } 448 513 c->Modified(); … … 459 524 c->Update(); 460 525 526 461 527 } 462 528 … … 616 682 fHChargeHiGain->Fit(fChargeGausFit,option); 617 683 618 Axis_t rtry = fChargeGausFit->GetParameter(1) - 2. 5*fChargeGausFit->GetParameter(2);684 Axis_t rtry = fChargeGausFit->GetParameter(1) - 2.0*fChargeGausFit->GetParameter(2); 619 685 620 686 rmin = (rtry < rmin ? rmin : rtry); 621 rmax = fChargeGausFit->GetParameter(1) + 2.5*fChargeGausFit->GetParameter(2);687 rmax = fChargeGausFit->GetParameter(1) + 3.5*fChargeGausFit->GetParameter(2); 622 688 fChargeGausFit->SetRange(rmin,rmax); 623 689 624 690 fHChargeHiGain->Fit(fChargeGausFit,option); 625 626 // rmin = fChargeGausFit->GetParameter(1) - 2.5*fChargeGausFit->GetParameter(2);627 // rmax = fChargeGausFit->GetParameter(1) + 2.5*fChargeGausFit->GetParameter(2);628 // fChargeGausFit->SetRange(rmin,rmax);629 630 // fHChargeHiGain->Fit(fChargeGausFit,option);631 691 632 692 fChargeChisquare = fChargeGausFit->GetChisquare(); … … 697 757 fHChargeLoGain->Fit(fChargeGausFit,option); 698 758 699 Axis_t rtry = fChargeGausFit->GetParameter(1) - 2. 5*fChargeGausFit->GetParameter(2);759 Axis_t rtry = fChargeGausFit->GetParameter(1) - 2.*fChargeGausFit->GetParameter(2); 700 760 701 761 rmin = (rtry < rmin ? rmin : rtry); 702 rmax = fChargeGausFit->GetParameter(1) + 2.5*fChargeGausFit->GetParameter(2);762 rmax = fChargeGausFit->GetParameter(1) + 3.5*fChargeGausFit->GetParameter(2); 703 763 fChargeGausFit->SetRange(rmin,rmax); 704 764 -
trunk/MagicSoft/Mars/mhist/MHCalibrationPixel.h
r2629 r2642 18 18 #endif 19 19 20 #ifndef ROOT_TGraph 21 #include "TGraph.h" 22 #endif 23 24 #ifndef ROOT_TArrayF 25 #include "TArrayF.h" 26 #endif 27 20 28 class TPaveText; 21 29 class TMath; … … 27 35 private: 28 36 29 Int_t fPixId; //-> Pixel Nr 30 37 Int_t fPixId; // Pixel Nr 38 TGraph *fHiGainvsLoGain; // Plot the HiGain vs. the LoGain 39 Int_t fTotalEntries; // Number of entries 40 41 TArrayF *fHiGains; 42 TArrayF *fLoGains; 43 31 44 protected: 32 45 33 TH1F* fHChargeHiGain; //-> Summed FADC slices34 TH1I* fHTimeHiGain; //->Mean arrival time in number of FADC sice35 TH1I* fHChargevsNHiGain; //->Summed Charge vs. Event Nr.46 TH1F* fHChargeHiGain; // Summed FADC slices High Gain 47 TH1I* fHTimeHiGain; // Mean arrival time in number of FADC sice 48 TH1I* fHChargevsNHiGain; // Summed Charge vs. Event Nr. 36 49 37 TH1F* fHChargeLoGain; //-> Summed FADC slices38 TH1I* fHTimeLoGain; //->Mean arrival time in number of FADC sice39 TH1I* fHChargevsNLoGain; //->Summed Charge vs. Event Nr.40 50 TH1F* fHChargeLoGain; // Summed FADC slices Low Gain 51 TH1I* fHTimeLoGain; // Mean arrival time in number of FADC sice 52 TH1I* fHChargevsNLoGain; // Summed Charge vs. Event Nr. 53 41 54 TF1* fChargeGausFit; 42 55 TF1* fTimeGausFit; … … 85 98 Bool_t Fill(const MParContainer *, const Stat_t w=1) { return kTRUE; } 86 99 87 Bool_t FillChargeLoGain(Float_t q) { return fHChargeLoGain->Fill(q) > -1; } 88 Bool_t FillTimeLoGain(Int_t t) { return fHTimeLoGain->Fill(t) > -1; } 89 Bool_t FillChargevsNLoGain(Float_t q, Int_t n) { return fHChargevsNLoGain->Fill(n,q) > -1; } 100 void SetPointInGraph(Float_t qhi, Float_t qlo); 90 101 91 Bool_t FillChargeHiGain(Float_t q) { return fHChargeHiGain->Fill(q) > -1; } 92 Bool_t FillTimeHiGain(Int_t t) { return fHTimeHiGain->Fill(t) > -1; } 93 Bool_t FillChargevsNHiGain(Float_t q, Int_t n) { return fHChargevsNHiGain->Fill(n,q) > -1; } 102 Bool_t FillChargeLoGain(Float_t q) { return (fHChargeLoGain->Fill(q) > -1); } 103 Bool_t FillTimeLoGain(Int_t t) { return (fHTimeLoGain->Fill(t) > -1); } 104 Bool_t FillChargevsNLoGain(Float_t q, Int_t n) { return (fHChargevsNLoGain->Fill(n,q) > -1); } 105 106 Bool_t FillChargeHiGain(Float_t q) { return (fHChargeHiGain->Fill(q) > -1); } 107 Bool_t FillTimeHiGain(Int_t t) { return (fHTimeHiGain->Fill(t) > -1); } 108 Bool_t FillChargevsNHiGain(Float_t q, Int_t n) { return (fHChargevsNHiGain->Fill(n,q) > -1); } 94 109 95 110 void SetUseLoGain() { fUseLoGain = kTRUE; } -
trunk/MagicSoft/Mars/mhist/MHCamera.h
r2627 r2642 125 125 virtual void SetCamContent(const MHCamera &d, Int_t type=0) { Reset(); AddCamContent(d, type); fEntries=d.fEntries; } 126 126 127 virtual void SetCamError(const MCamEvent &ev ent, Int_t type=0);127 virtual void SetCamError(const MCamEvent &evt, Int_t type=0); 128 128 129 129 virtual void CntCamContent(const MCamEvent &evt, Double_t threshold, Int_t type=0);
Note:
See TracChangeset
for help on using the changeset viewer.