Changeset 7208 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 07/22/05 11:11:26 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MHDisp.cc
r7202 r7208 248 248 // To calculate significance map smear with 2*theta-cut and 249 249 // do not normalize gauss, for event map use theta-cut/2 instead 250 for (int x=1; x<=nx; x++) 251 { 252 const Double_t cx = axex.GetBinCenter(x); 253 const Double_t px = cx-pos1.X(); 254 255 for (int y=1; y<=ny; y++) 256 { 257 const Double_t cy = axey.GetBinCenter(y); 258 const Double_t sp = Sq(px, cy-pos1.Y()); 259 if (smear) 250 if (smear || fHistOff) 251 { 252 for (int x=1; x<=nx; x++) 253 { 254 const Double_t cx = axex.GetBinCenter(x); 255 const Double_t px = cx-pos1.X(); 256 257 for (int y=1; y<=ny; y++) 260 258 { 261 const Double_t dp = sp/psf; 262 263 // Values below 1e-3 (>3.5sigma) are not filled into the histogram 264 if (dp<4) 259 const Double_t cy = axey.GetBinCenter(y); 260 const Double_t sp = Sq(px, cy-pos1.Y()); 261 if (smear) 265 262 { 266 const Double_t rc = TMath::Exp(-dp)/normg; 267 if (!fHistOff) 268 bg.AddBinContent(bg.GetBin(x, y), rc); 269 else 270 fHist.AddBinContent(fHist.GetBin(x, y, bz), rc); 263 const Double_t dp = sp/psf; 264 265 // Values below 1e-3 (>3.5sigma) are not filled into the histogram 266 if (dp<4) 267 { 268 const Double_t rc = TMath::Exp(-dp)/normg; 269 if (!fHistOff) 270 bg.AddBinContent(bg.GetBin(x, y), rc); 271 else 272 fHist.AddBinContent(fHist.GetBin(x, y, bz), rc); 273 } 271 274 } 275 276 if (!fHistOff) 277 continue; 278 279 // If we are filling the signal already (fHistOff!=NULL) 280 // we also fill the background by projecting the 281 // background in the camera into the sky plot. 282 const TVector2 v = TVector2(cx+m.X(), cy+m.Y()); 283 284 // Speed up further: Xmax-fWobble 285 if (v.Mod()>axex.GetXmax()) // Gains 10% speed 286 continue; 287 288 const Int_t bx = axex.FindFixBin(v^rot); 289 const Int_t by = axey.FindFixBin(v*rot); 290 const Double_t bg = fHistOff->GetBinContent(bx, by, bz); 291 292 fHistBg.AddBinContent(fHistBg.GetBin(x, y), bg); 272 293 } 273 274 if (!fHistOff)275 continue;276 277 // If we are filling the signal already (fHistOff!=NULL)278 // we also fill the background by projecting the279 // background in the camera into the sky plot.280 const TVector2 v = TVector2(cx+m.X(), cy+m.Y());281 282 // Speed up further: Xmax-fWobble283 if (v.Mod()>axex.GetXmax()) // Gains 10% speed284 continue;285 286 const Int_t bx = axex.FindFixBin(v^rot);287 const Int_t by = axey.FindFixBin(v*rot);288 const Double_t bg = fHistOff->GetBinContent(bx, by, bz);289 290 fHistBg.AddBinContent(fHistBg.GetBin(x, y), bg);291 294 } 292 295 }
Note:
See TracChangeset
for help on using the changeset viewer.