- Timestamp:
- 06/17/04 19:51:18 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4301 r4303 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2004/06/17: Markus Gaug 22 23 * mjobs/MJPedestal.[h,cc] 24 - adapted display for the datacheck 25 20 26 21 27 2004/06/17: Markus Gaug -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r4301 r4303 33 33 #include <TF1.h> 34 34 #include <TFile.h> 35 #include <TStyle.h>36 35 #include <TString.h> 37 36 #include <TCanvas.h> 38 37 #include <TSystem.h> 38 #include <TLine.h> 39 #include <TLegend.h> 40 #include <TLatex.h> 39 41 40 42 #include "MLog.h" … … 68 70 const Double_t MJPedestal::fgPedRmsMin = 0.; 69 71 const Double_t MJPedestal::fgPedRmsMax = 20.; 72 const Float_t MJPedestal::fgRefPedClosedLids = 9.635; 73 const Float_t MJPedestal::fgRefPedExtraGalactic = 9.93; 74 const Float_t MJPedestal::fgRefPedGalactic = 10.03; 75 const Float_t MJPedestal::fgRefPedRmsClosedLids = 1.7; 76 const Float_t MJPedestal::fgRefPedRmsExtraGalactic = 5.6; 77 const Float_t MJPedestal::fgRefPedRmsGalactic = 6.92; 70 78 // -------------------------------------------------------------------------- 71 79 // … … 173 181 if (fDataCheck) 174 182 { 183 175 184 c3.cd(1); 176 185 gPad->SetBorderMode(0); … … 178 187 MHCamera *obj1=(MHCamera*)disp0.DrawCopy("hist"); 179 188 obj1->SetDirectory(NULL); 189 // 190 // for the datacheck, fix the ranges!! 191 // 180 192 obj1->SetMinimum(fgPedestalMin); 181 193 obj1->SetMaximum(fgPedestalMax); 182 gPad->Modified(); 183 gPad->Update(); 184 194 // 195 // set reference lines 196 // 197 DisplayReferenceLines(obj1,0); 198 // 199 // end reference lines 200 // 185 201 c3.cd(3); 186 202 gPad->SetBorderMode(0); … … 191 207 gPad->SetBorderMode(0); 192 208 gPad->SetTicks(); 193 disp0.DrawProjection(7); 194 gPad->Modified(); 195 gPad->Update(); 209 obj1->DrawProjection(7); 196 210 197 211 c3.cd(2); … … 202 216 obj2->SetMinimum(fgPedRmsMin); 203 217 obj2->SetMaximum(fgPedRmsMax); 204 gPad->Modified(); 205 gPad->Update(); 218 // 219 // set reference lines 220 // 221 DisplayReferenceLines(obj1,1); 206 222 207 223 c3.cd(4); … … 213 229 gPad->SetBorderMode(0); 214 230 gPad->SetTicks(); 215 disp1.DrawProjection(6); 216 231 232 TArrayI inner(1); 233 inner[0] = 0; 234 235 TArrayI outer(1); 236 outer[0] = 1; 237 238 if (geomcam.InheritsFrom("MGeomCamMagic")) 239 { 240 TArrayI s0(6); 241 s0[0] = 6; 242 s0[1] = 1; 243 s0[2] = 2; 244 s0[3] = 3; 245 s0[4] = 4; 246 s0[5] = 5; 247 248 TArrayI s1(3); 249 s1[0] = 6; 250 s1[1] = 1; 251 s1[2] = 2; 252 253 TArrayI s2(3); 254 s2[0] = 3; 255 s2[1] = 4; 256 s2[2] = 5; 257 258 gPad->Clear(); 259 TVirtualPad *pad = gPad; 260 pad->Divide(2,1); 261 262 TH1D *inout[2]; 263 inout[0] = disp1.ProjectionS(s0, inner, "Inner"); 264 inout[1] = disp1.ProjectionS(s0, outer, "Outer"); 265 266 inout[0]->SetDirectory(NULL); 267 inout[1]->SetDirectory(NULL); 268 269 for (int i=0; i<2; i++) 270 { 271 TLegend *leg2 = new TLegend(0.6,0.2,0.9,0.55); 272 leg2->SetHeader(inout[i]->GetName()); 273 pad->cd(i+1); 274 inout[i]->SetLineColor(kRed+i); 275 inout[i]->SetBit(kCanDelete); 276 inout[i]->Draw(); 277 inout[i]->Fit("gaus","Q"); 278 leg2->AddEntry(inout[i],inout[i]->GetName(),"l"); 279 280 // 281 // Display the outliers as dead and noisy pixels 282 // 283 DisplayOutliers(inout[i]); 284 285 // 286 // Display the two half of the camera separately 287 // 288 TH1D *half[2]; 289 half[0] = disp1.ProjectionS(s1, i==0 ? inner : outer , "Sector 6-1-2"); 290 half[1] = disp1.ProjectionS(s2, i==0 ? inner : outer , "Sector 3-4-5"); 291 292 for (int j=0; j<2; j++) 293 { 294 half[j]->SetLineColor(kRed+i+2*j+1); 295 half[j]->SetDirectory(NULL); 296 half[j]->SetBit(kCanDelete); 297 half[j]->Draw("same"); 298 leg2->AddEntry(half[j],half[j]->GetName(),"l"); 299 } 300 leg2->Draw(); 301 } 302 } 217 303 } 218 304 else … … 221 307 disp1.CamDraw(c3, 2, 2, 6); 222 308 } 309 } 310 311 void MJPedestal::DisplayReferenceLines(MHCamera *cam, const Int_t what) const 312 { 313 314 TLine *gala = new TLine(0, 315 what ? fgRefPedRmsGalactic : fgRefPedGalactic,cam->GetNbinsX(), 316 what ? fgRefPedRmsGalactic : fgRefPedGalactic); 317 gala->SetBit(kCanDelete); 318 gala->SetLineColor(4); 319 gala->SetLineStyle(2); 320 gala->SetLineWidth(3); 321 gala->Draw(); 322 TLine *extr = new TLine(0, 323 what ? fgRefPedRmsExtraGalactic : fgRefPedExtraGalactic,cam->GetNbinsX(), 324 what ? fgRefPedRmsExtraGalactic : fgRefPedExtraGalactic); 325 extr->SetBit(kCanDelete); 326 extr->SetLineColor(5); 327 extr->SetLineStyle(2); 328 extr->SetLineWidth(3); 329 extr->Draw(); 330 TLine *close = new TLine(0, 331 what ? fgRefPedRmsClosedLids : fgRefPedClosedLids,cam->GetNbinsX(), 332 what ? fgRefPedRmsClosedLids : fgRefPedClosedLids); 333 close->SetBit(kCanDelete); 334 close->SetLineColor(6); 335 close->SetLineStyle(2); 336 close->SetLineWidth(3); 337 close->Draw(); 338 TLegend *leg = new TLegend(0.4,0.75,0.7,0.99); 339 leg->SetBit(kCanDelete); 340 leg->AddEntry(gala,"Galactic Source","l"); 341 leg->AddEntry(extr,"Extra-Galactic Source","l"); 342 leg->AddEntry(close,"Closed Lids","l"); 343 leg->Draw(); 344 } 345 346 void MJPedestal::DisplayOutliers(TH1D *hist) const 347 { 348 349 const Float_t mean = hist->GetFunction("gaus")->GetParameter(1); 350 const Float_t lolim = mean - 3.5*hist->GetFunction("gaus")->GetParameter(2); 351 const Float_t uplim = mean + 3.5*hist->GetFunction("gaus")->GetParameter(2); 352 const Stat_t dead = hist->Integral(0,hist->FindBin(lolim)-1); 353 const Stat_t noisy = hist->Integral(hist->FindBin(uplim)+1,hist->GetNbinsX()+1); 354 355 TLatex deadtex; 356 deadtex.SetTextSize(0.06); 357 deadtex.DrawLatex(0.1,hist->GetBinContent(hist->GetMaximumBin())/1.1,Form("%3i dead pixels",(Int_t)dead)); 358 359 TLatex noisytex; 360 noisytex.SetTextSize(0.06); 361 noisytex.DrawLatex(0.1,hist->GetBinContent(hist->GetMaximumBin())/1.2,Form("%3i noisy pixels",(Int_t)noisy)); 362 223 363 } 224 364 -
trunk/MagicSoft/Mars/mjobs/MJPedestal.h
r4301 r4303 13 13 class MRunIter; 14 14 class MHCamera; 15 class TH1D; 15 16 class MExtractor; 16 17 class MJPedestal : public MParContainer … … 22 23 static const Double_t fgPedRmsMin; 23 24 static const Double_t fgPedRmsMax; 25 26 static const Float_t fgRefPedClosedLids; 27 static const Float_t fgRefPedExtraGalactic; 28 static const Float_t fgRefPedGalactic; 29 30 static const Float_t fgRefPedRmsClosedLids; 31 static const Float_t fgRefPedRmsExtraGalactic; 32 static const Float_t fgRefPedRmsGalactic; 24 33 25 34 TString fOutputPath; … … 37 46 38 47 void DisplayResult(MParList &plist); 48 void DisplayReferenceLines(MHCamera *cam, const Int_t what) const; 49 void DisplayOutliers( TH1D *hist) const; 39 50 40 51 public:
Note:
See TracChangeset
for help on using the changeset viewer.