Changeset 4584 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 08/12/04 06:58:34 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc
r3339 r4584 26 26 ////////////////////////////////////////////////////////////////////////////// 27 27 // // 28 // MHSigmaTheta (extension of Robert's MHSigmabarTheta)//28 // MHSigmaTheta // 29 29 // // 30 // calculates - the 2D-histogram sigmabar vs. Theta, and // 30 // calculates - the 2D-histogram sigmabar vs. Theta (Inner), and // 31 // - the 2D-histogram sigmabar vs. Theta (Outer) // 31 32 // - the 3D-histogram sigma, pixel no., Theta // 32 33 // - the 3D-histogram (sigma^2-sigmabar^2), pixel no., Theta // … … 39 40 40 41 #include "MTime.h" 41 #include "M McEvt.hxx"42 #include "MPointingPos.h" 42 43 43 44 #include "MBinning.h" … … 46 47 47 48 #include "MGeomCam.h" 49 #include "MBlindPixels.h" 48 50 49 51 #include "MPedPhotCam.h" … … 70 72 71 73 fSigmaTheta.SetDirectory(NULL); 72 fSigmaTheta.SetName("2D-ThetaSigmabar ");74 fSigmaTheta.SetName("2D-ThetaSigmabar(Inner)"); 73 75 fSigmaTheta.SetTitle("2D: \\bar{\\sigma}, \\Theta"); 74 76 fSigmaTheta.SetXTitle("\\Theta [\\circ]"); 75 fSigmaTheta.SetYTitle("Sigmabar"); 77 fSigmaTheta.SetYTitle("Sigmabar(Inner) / SQRT(Area)"); 78 79 fSigmaThetaOuter.SetDirectory(NULL); 80 fSigmaThetaOuter.SetName("2D-ThetaSigmabar(Outer)"); 81 fSigmaThetaOuter.SetTitle("2D: \\bar{\\sigma}, \\Theta"); 82 fSigmaThetaOuter.SetXTitle("\\Theta [\\circ]"); 83 fSigmaThetaOuter.SetYTitle("Sigmabar(Outer) / SQRT(Area)"); 76 84 77 85 fSigmaPixTheta.SetDirectory(NULL); … … 80 88 fSigmaPixTheta.SetXTitle("\\Theta [\\circ]"); 81 89 fSigmaPixTheta.SetYTitle("Pixel Id"); 82 fSigmaPixTheta.SetZTitle(" \\sigma");90 fSigmaPixTheta.SetZTitle("Sigma"); 83 91 84 92 fDiffPixTheta.SetDirectory(NULL); … … 87 95 fDiffPixTheta.SetXTitle("\\Theta [\\circ]"); 88 96 fDiffPixTheta.SetYTitle("Pixel Id"); 89 fDiffPixTheta.SetZTitle(" {\\sigma}^{2}-\\bar{\\sigma}^{2}");97 fDiffPixTheta.SetZTitle("(Sigma2 - Sigmabar2)/Area"); 90 98 91 99 // Set default binning … … 102 110 binspix.SetEdges(578, -0.5, 577.5); 103 111 104 SetBinning(&fSigmaTheta, &binst, &binsb); 105 SetBinning(&fSigmaPixTheta, &binst, &binspix, &binsb); 106 SetBinning(&fDiffPixTheta, &binst, &binspix, &binsd); 112 SetBinning(&fSigmaTheta, &binst, &binsb); 113 SetBinning(&fSigmaThetaOuter, &binst, &binsb); 114 SetBinning(&fSigmaPixTheta, &binst, &binspix, &binsb); 115 SetBinning(&fDiffPixTheta, &binst, &binspix, &binsd); 107 116 } 108 117 … … 120 129 } 121 130 122 f McEvt = (MMcEvt*)plist->FindObject("MMcEvt");123 if (!f McEvt)124 *fLog << warn << "M McEvtnot found... aborting." << endl;131 fPointPos = (MPointingPos*)plist->FindObject("MPointingPos"); 132 if (!fPointPos) 133 *fLog << warn << "MPointingPos not found... aborting." << endl; 125 134 126 135 … … 132 141 } 133 142 fPed->InitSize(fCam->GetNumPixels()); 143 144 145 fBlindPix = (MBlindPixels*)plist->FindObject("MBlindPixels"); 146 if (!fBlindPix) 147 { 148 *fLog << err << "MBlindPixels not found... continue. " << endl; 149 } 134 150 135 151 … … 177 193 if (binssigma) 178 194 { 179 SetBinning(&fSigmaTheta, binstheta, binssigma); 180 SetBinning(&fSigmaPixTheta, binstheta, &binspix, binssigma); 195 SetBinning(&fSigmaTheta, binstheta, binssigma); 196 SetBinning(&fSigmaThetaOuter, binstheta, binssigma); 197 SetBinning(&fSigmaPixTheta, binstheta, &binspix, binssigma); 181 198 } 182 199 … … 191 208 // Fill the histograms 192 209 // 210 // ignore pixels if they are unused or blind 211 // 193 212 Bool_t MHSigmaTheta::Fill(const MParContainer *par, const Stat_t w) 194 213 { 195 Double_t theta = f McEvt ? fMcEvt->GetTelescopeTheta()*kRad2Deg : 0;214 Double_t theta = fPointPos->GetZd(); 196 215 fSigmabar->Calc(*fCam, *fPed, *fEvt); 197 Double_t mysig = fSigmabar->GetSigmabarInner(); 198 199 //*fLog << "theta, mysig = " << theta << ", " << mysig << endl; 216 Double_t mysig = fSigmabar->GetSigmabarInner(); 217 Double_t mysigouter = fSigmabar->GetSigmabarOuter(); 218 219 //*fLog << "theta, mysig, mysigouter = " << theta << ", " << mysig 220 // << ", " << mysigouter << endl; 200 221 201 222 fSigmaTheta.Fill(theta, mysig); 223 fSigmaThetaOuter.Fill(theta, mysigouter); 202 224 203 225 const UInt_t npix = fEvt->GetNumPixels(); … … 205 227 for (UInt_t i=0; i<npix; i++) 206 228 { 207 MCerPhotPix cerpix = (*fEvt)[i]; 229 MCerPhotPix &cerpix = (*fEvt)[i]; 230 const Int_t id = cerpix.GetPixId(); 231 208 232 if (!cerpix.IsPixelUsed()) 209 continue; 210 211 const Int_t id = cerpix.GetPixId(); 233 { 234 //*fLog << all << "MHSigmaTheta::Fill; unused pixel found, id = " 235 // << id << endl; 236 continue; 237 } 238 212 239 const MPedPhotPix &pix = (*fPed)[id]; 240 241 if ( fBlindPix != NULL && fBlindPix->IsBlind(id) ) 242 { 243 // this should never occur, because blind pixels should have 244 // been set unused by MBlindPixelsCalc2::UnMap() 245 //*fLog << all << "MHSigmaTheta::Fill; blind pixel found which is used, id = " 246 // << id << "... go to next pixel." << endl; 247 continue; 248 } 213 249 214 250 // ratio is the area of pixel 0 … … 219 255 fSigmaPixTheta.Fill(theta, (Double_t)id, sigma*sqrt(ratio)); 220 256 221 const Double_t diff = sigma*sigma*ratio - mysig*mysig; 257 Double_t diff; 258 if (ratio > 0.5) 259 { 260 // inner pixel 261 diff = sigma*sigma*ratio - mysig*mysig; 262 } 263 else 264 { 265 // outer pixel 266 diff = sigma*sigma*ratio - mysigouter*mysigouter; 267 } 268 222 269 fDiffPixTheta.Fill(theta, (Double_t)id, diff); 223 270 } … … 262 309 AppendPad(""); 263 310 264 pad->Divide(3, 2);311 pad->Divide(3, 3); 265 312 266 313 // draw the 2D histogram Sigmabar versus Theta … … 283 330 h->SetTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2} vs. \\Theta (all pixels)"); 284 331 h->SetXTitle("\\Theta [\\circ]"); 285 h->SetYTitle(" \\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2}");332 h->SetYTitle("(Sigma2 - Sigmabar2) / Area"); 286 333 h->Draw("box"); 287 334 h->SetBit(kCanDelete); … … 293 340 h->SetTitle("\\sigma_{ped} vs. \\Theta (all pixels)"); 294 341 h->SetXTitle("\\Theta [\\circ]"); 295 h->SetYTitle(" \\sigma_{ped}");342 h->SetYTitle("Sigma"); 296 343 h->Draw("box"); 297 344 h->SetBit(kCanDelete); … … 313 360 h->SetTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2} vs. pixel Id (all \\Theta)"); 314 361 h->SetXTitle("Pixel Id"); 315 h->SetYTitle(" \\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2}");362 h->SetYTitle("Sigma2 - sigmabar2) / Area"); 316 363 h->Draw("box"); 317 364 h->SetBit(kCanDelete); … … 323 370 h->SetTitle("\\sigma_{ped} vs. pixel Id (all \\Theta)"); 324 371 h->SetXTitle("Pixel Id"); 325 h->SetYTitle(" \\sigma_{ped}");372 h->SetYTitle("Sigma"); 326 373 h->Draw("box"); 327 374 h->SetBit(kCanDelete); … … 329 376 pad->cd(4); 330 377 fSigmaTheta.Draw(opt); 378 379 pad->cd(7); 380 fSigmaThetaOuter.Draw(opt); 331 381 332 382 //pad->cd(8); -
trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h
r2798 r4584 16 16 class MGeomCam; 17 17 class MCerPhotEvt; 18 class M McEvt;18 class MPointingPos; 19 19 class MPedPhotCam; 20 20 class MSigmabar; 21 21 class MParList; 22 class MBlindPixels; 22 23 23 24 … … 29 30 MCerPhotEvt *fEvt; //! 30 31 MSigmabar *fSigmabar; //! 31 MMcEvt *fMcEvt; //! 32 33 TH2D fSigmaTheta; // 2D-distribution sigmabar versus Theta; 34 // sigmabar is the average pedestasl sigma in an event 32 MPointingPos *fPointPos; //! 33 MBlindPixels *fBlindPix; //! 34 35 // sigmabar is the average pedestal sigma 36 TH2D fSigmaTheta; // 2D-distribution sigmabar versus Theta (Inner) 37 TH2D fSigmaThetaOuter; // 2D-distribution sigmabar versus Theta (Outer) 38 35 39 TH3D fSigmaPixTheta; // 3D-distr.:Theta, pixel, pedestal sigma 36 40 TH3D fDiffPixTheta; // 3D-distr.:Theta, pixel, sigma^2-sigmabar^2 … … 46 50 const TH2D *GetSigmaTheta() { return &fSigmaTheta; } 47 51 const TH2D *GetSigmaTheta() const { return &fSigmaTheta; } 52 53 const TH2D *GetSigmaThetaOuter() { return &fSigmaThetaOuter; } 54 const TH2D *GetSigmaThetaOuter() const { return &fSigmaThetaOuter; } 48 55 49 56 const TH3D *GetSigmaPixTheta() { return &fSigmaPixTheta; }
Note:
See TracChangeset
for help on using the changeset viewer.