Changeset 3051
- Timestamp:
- 02/07/04 12:19:18 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3050 r3051 17 17 - correct the input of Display (0: pedestal, 1: pedestalerror, 18 18 2: pedRMS, 3: pedRMSerror) 19 20 * manalysis/MHPedestalPixel.cc 21 - increased number of bins in for charges plot 19 22 20 23 -
trunk/MagicSoft/Mars/manalysis/MHPedestalPixel.cc
r3034 r3051 48 48 const Float_t gkSq2Pi = 2.506628274631; 49 49 const Float_t gkProbLimit = 0.01; 50 const Int_t MHPedestalPixel::gkChargeNbins = 250 ;50 const Int_t MHPedestalPixel::gkChargeNbins = 450 ; 51 51 const Axis_t MHPedestalPixel::gkChargeFirst = -0.5; 52 const Axis_t MHPedestalPixel::gkChargeLast = 249.5;52 const Axis_t MHPedestalPixel::gkChargeLast = 449.5; 53 53 const Int_t MHPedestalPixel::gkChargevsNbins = 1000; 54 54 const Axis_t MHPedestalPixel::gkChargevsNFirst = -0.5; -
trunk/MagicSoft/Mars/mcalib/MHCalibrationPixel.cc
r3025 r3051 671 671 fHivsLoGain->GetXaxis()->SetTitle("Sum of Charges High Gain"); 672 672 fHivsLoGain->GetYaxis()->SetTitle("Sum of Charges Low Gain"); 673 674 TString titleHiLoGain = TString(fHivsLoGain->GetName()); 675 titleHiLoGain += fPixId; 676 fHivsLoGain->SetName(titleHiLoGain.Data()); 673 fHivsLoGain->SetName(Form("%s%d",fHivsLoGain->GetName(),fPixId)); 677 674 678 675 for (Int_t i=0;i<fTotalEntries;i++) -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r2992 r3051 30 30 #include "MJPedestal.h" 31 31 32 #include <TF1.h> 32 33 #include <TFile.h> 33 34 #include <TStyle.h> 35 #include <TString.h> 34 36 #include <TCanvas.h> 35 37 #include <TSystem.h> … … 46 48 47 49 #include "MHCamera.h" 50 #include "MPedestalCam.h" 48 51 49 52 #include "MReadMarsFile.h" … … 109 112 110 113 // 111 // Get co ontainer from list114 // Get container from list 112 115 // 113 116 MGeomCam &geomcam = *(MGeomCam*)plist.FindObject("MGeomCam"); … … 120 123 121 124 disp0.SetCamContent(fPedestalCam, 0); 122 disp1.SetCamContent(fPedestalCam, 1); 125 disp0.SetCamError(fPedestalCam, 1); 126 disp1.SetCamContent(fPedestalCam, 2); 127 disp1.SetCamError(fPedestalCam, 3); 123 128 124 129 disp0.SetYTitle("P [fadc/slice]"); … … 128 133 // Display data 129 134 // 130 TObject *obj;131 132 135 TCanvas &c3 = fDisplay->AddTab("Pedestals"); 133 c3.Divide(2,2); 134 135 c3.cd(1); 136 c3.Divide(2,3); 137 138 *fLog << "BALBALBALBA" <<endl; 139 140 CamDraw(c3, 1, 2, disp0, 0); 141 CamDraw(c3, 2, 2, disp1, 1); 142 143 } 144 145 146 void MJPedestal::DrawProjection(MHCamera *obj1, Int_t fit) const 147 { 148 149 TH1D *obj2 = (TH1D*)obj1->Projection(); 150 obj2->Draw(); 151 obj2->SetBit(kCanDelete); 152 153 const Double_t min = obj2->GetBinCenter(obj2->GetXaxis()->GetFirst()); 154 const Double_t max = obj2->GetBinCenter(obj2->GetXaxis()->GetLast()); 155 const Double_t integ = obj2->Integral("width")/2.5066283; 156 const Double_t mean = obj2->GetMean(); 157 const Double_t rms = obj2->GetRMS(); 158 const Double_t width = max-min; 159 160 if (rms == 0. || width == 0. ) 161 return; 162 163 const TString dgausformula = TString("([0]-[3])/[2]*exp(-0.5*(x-[1])*(x-[1])/[2]/[2])" 164 "+[3]/[5]*exp(-0.5*(x-[4])*(x-[4])/[5]/[5])"); 165 166 TF1 *f=0; 167 switch (fit) 168 { 169 case 0: 170 f = new TF1("sgaus","gaus(0)",min,max); 171 f->SetLineColor(kYellow); 172 f->SetBit(kCanDelete); 173 f->SetParNames("Area","#mu","#sigma"); 174 f->SetParameters(integ/rms,mean,rms); 175 f->SetParLimits(0, 0. , integ); 176 f->SetParLimits(1, min , max); 177 f->SetParLimits(2, 0 , width/1.5); 178 obj2->Fit(f,"QLRM"); 179 break; 180 181 case 1: 182 f = new TF1("dgaus",dgausformula.Data(),min,max); 183 f->SetLineColor(kYellow); 184 f->SetBit(kCanDelete); 185 f->SetParNames("A_{tot}","#mu_{1}","#sigma_{1}","A_{2}","#mu_{2}","#sigma_{2}"); 186 f->SetParameters(integ,(min+mean)/2.,width/4., 187 integ/width/2.,(max+mean)/2.,width/4.); 188 // The left-sided Gauss 189 f->SetParLimits(0,integ-1.5 , integ+1.5); 190 f->SetParLimits(1,min+(width/10.), mean); 191 f->SetParLimits(2,0 , width/2.); 192 // The right-sided Gauss 193 f->SetParLimits(3,0 , integ); 194 f->SetParLimits(4,mean, max-(width/10.)); 195 f->SetParLimits(5,0 , width/2.); 196 obj2->Fit(f,"QLRM"); 197 break; 198 199 default: 200 obj2->Fit("gaus","Q"); 201 obj2->GetFunction("gaus")->SetLineColor(kYellow); 202 break; 203 } 204 } 205 206 207 208 void MJPedestal::CamDraw(TCanvas &c, Int_t x, Int_t y, MHCamera &cam1, Int_t fit) 209 { 210 211 c.cd(x); 136 212 gPad->SetBorderMode(0); 137 gStyle->SetOptStat(1101); 138 obj=disp0.DrawCopy("hist"); 139 140 c3.cd(3); 141 obj->Draw(); 142 143 c3.cd(2); 213 MHCamera *obj1=(MHCamera*)cam1.DrawCopy("hist"); 214 obj1->AddNotify(fPedestalCam); 215 216 c.cd(x+y); 144 217 gPad->SetBorderMode(0); 145 gStyle->SetOptStat(1101); 146 obj=disp1.DrawCopy("hist"); 147 148 c3.cd(4); 149 obj->Draw(); 150 } 218 obj1->Draw(); 219 ((MHCamera*)obj1)->SetPrettyPalette(); 220 221 c.cd(x+2*y); 222 gPad->SetBorderMode(0); 223 DrawProjection(obj1, fit); 224 225 } 226 151 227 152 228 Bool_t MJPedestal::WriteResult() -
trunk/MagicSoft/Mars/mjobs/MJPedestal.h
r2992 r3051 8 8 class MParList; 9 9 class MRunIter; 10 class MHCamera; 10 11 11 12 class MJPedestal : public MParContainer … … 18 19 MPedestalCam fPedestalCam; 19 20 21 void DrawProjection(MHCamera *obj1, Int_t fit) const; 22 void CamDraw(TCanvas &c, Int_t x, Int_t y, MHCamera &cam1, Int_t fit); 20 23 void DisplayResult(MParList &plist); 21 24 Bool_t WriteResult();
Note:
See TracChangeset
for help on using the changeset viewer.