Changeset 3947 in Sophya for trunk/Cosmo/RadioBeam/mdish.cc
- Timestamp:
- Feb 14, 2011, 12:58:29 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/RadioBeam/mdish.cc
r3934 r3947 65 65 } 66 66 67 HProf Four2DResponse::GetProjNoiseLevel(int nbin, bool fgnorm1) 68 { 69 Histo2D h2w = GetResponse(2*nbin, 2*nbin); 70 r_8 vmin=h2w.VMin(); 71 r_8 vmax=h2w.VMax(); 72 double seuil=vmax/10000.; 73 if (seuil<1.e-6) seuil=1.e-6; 74 r_8 facnorm=((fgnorm1)?vmax:1.); 75 cout << " Four2DResponse::GetProjNoiseLevel Min,Max=" << vmin << " , " << vmax 76 << " facnorm=" << facnorm << " seuil=" << seuil << endl; 77 double kmax=2.*M_PI*D(); 78 HProf hp(0,kmax,nbin); 79 double x,y; 80 for(sa_size_t j=0; j<h2w.NBinY(); j++) { 81 for(sa_size_t i=0; i<h2w.NBinX(); i++) { 82 h2w.BinCenter(i,j,x,y); 83 double yw=h2w(i,j); 84 if (yw<seuil) continue; 85 hp.Add(sqrt(x*x+y*y),facnorm/yw); 86 } 87 } 88 return hp; 89 } 90 91 HProf Four2DResponse::GetProjResponse(int nbin, bool fgnorm1) 92 { 93 Histo2D h2w = GetResponse(2*nbin, 2*nbin); 94 r_8 vmin=h2w.VMin(); 95 r_8 vmax=h2w.VMax(); 96 r_8 facnorm=((fgnorm1)?(1./vmax):1.); 97 cout << " Four2DResponse::GetProjResponse Min,Max=" << vmin << " , " << vmax 98 << " facnorm=" << facnorm << endl; 99 double kmax=2.*M_PI*D(); 100 HProf hp(0,kmax,nbin); 101 double x,y; 102 for(sa_size_t j=0; j<h2w.NBinY(); j++) { 103 for(sa_size_t i=0; i<h2w.NBinX(); i++) { 104 h2w.BinCenter(i,j,x,y); 105 hp.Add(sqrt(x*x+y*y),h2w(i,j)*facnorm); 106 } 107 } 108 return hp; 109 } 110 67 111 //--------------------------------------------------------------- 68 112 // -- Four2DRespTable : Reponse tabulee instrumentale ds le plan k_x,k_y (angles theta,phi) … … 185 229 SetBeamNSamples(); 186 230 SetPrtLevel(); 231 fgcomputedone_=false; 187 232 mcnt_=0; 188 233 } 189 234 190 Histo2D MultiDish::GetResponse()191 { 192 cout << " MultiDish:: GetResponse() - NDishes=" << dishes_.size() << " nx=" << nx_ << " ny=" << ny_ << endl;235 void MultiDish::ComputeResponse() 236 { 237 cout << " MultiDish::ComputeResponse() - NDishes=" << dishes_.size() << " nx=" << nx_ << " ny=" << ny_ << endl; 193 238 double kmx = 1.2*DeuxPI*dmax_/lambda_; 194 239 double dkmx = kmx/(double)nx_; … … 198 243 h2w_.Define(-kmxx,kmxx,2*nx_+1,-kmxy,kmxy,2*ny_+1); 199 244 h2w_.SetZeroBin(0.,0.); 245 kmax_=kmx; 200 246 201 247 double dold = dishes_[0].Diameter()/lambda_; … … 210 256 double dtet = thetamax_/(double)ntet_; 211 257 double dphi = phimax_/(double)nphi_; 212 cout << " MultiDish:: GetResponse() - ThetaMax=" << thetamax_ << " NTheta=" << ntet_258 cout << " MultiDish::ComputeResponse() - ThetaMax=" << thetamax_ << " NTheta=" << ntet_ 213 259 << " PhiMax=" << phimax_ << " NPhi=" << nphi_ << endl; 214 260 … … 224 270 sumw += CumulResp(rd, theta, -(phi+M_PI)); 225 271 } 226 if (prtlev_>0) cout << " MultiDish::GetResponse() done ktheta=" << kt << " / MaxNTheta= " << ntet_ << endl; 227 } 272 if (prtlev_>0) 273 cout << " MultiDish::ComputeResponse() done ktheta=" << kt << " / MaxNTheta= " 274 << ntet_ << endl; 275 } 276 r_8 rmin,rmax; 277 h2w_.GetMinMax(rmin,rmax); 278 cout << " MultiDish::ComputeResponse() finished : Rep_min,max=" << rmin << "," << rmax << " sumW0=" 279 << sumw << " ?=" << h2w_.SumWBinZero() << endl; 280 fgcomputedone_=true; 281 return; 282 } 283 284 Histo2D MultiDish::GetResponse() 285 { 286 if (!fgcomputedone_) ComputeResponse(); 287 228 288 double kx1 = DeuxPI*(dishes_[0].DiameterX())/lambda_; 229 289 double ky1 = DeuxPI*(dishes_[0].DiameterY())/lambda_; … … 236 296 ib=jb=0; 237 297 } 298 double sumw=h2w_.SumWBinZero(); 238 299 double vmax=h2.VMax(); 239 300 cout << " MultiDish::GetResponse[1] VMin=" << h2.VMin() << " VMax= " << vmax … … 257 318 return h2; 258 319 } 320 321 HProf MultiDish::GetProjNoiseLevel(int nbin, bool fgnorm1) 322 { 323 r_8 vmin,vmax; 324 h2w_.GetMinMax(vmin,vmax); 325 double seuil=vmax/10000.; 326 if (seuil<1.e-6) seuil=1.e-6; 327 r_8 facnorm=((fgnorm1)?vmax:1.); 328 cout << " MultiDish::GetProjNoiseLevel Min,Max=" << vmin << " , " << vmax 329 << " facnorm=" << facnorm << " seuil=" << seuil << endl; 330 HProf hp(0,kmax_,nbin); 331 for(sa_size_t j=0; j<h2w_.NBinY(); j++) { 332 double y=h2w_.Y(j); 333 for(sa_size_t i=0; i<h2w_.NBinX(); i++) { 334 double x=h2w_.X(i); 335 double yw=h2w_(i,j); 336 if (yw<seuil) continue; 337 hp.Add(sqrt(x*x+y*y),facnorm/yw); 338 } 339 } 340 return hp; 341 } 342 343 HProf MultiDish::GetProjResponse(int nbin, bool fgnorm1) 344 { 345 r_8 vmin,vmax; 346 h2w_.GetMinMax(vmin,vmax); 347 r_8 facnorm=((fgnorm1)?(1./vmax):1.); 348 cout << " MultiDish::GetProjResponse Min,Max=" << vmin << " , " << vmax 349 << " facnorm=" << facnorm << endl; 350 HProf hp(0,kmax_,nbin); 351 for(sa_size_t j=0; j<h2w_.NBinY(); j++) { 352 double y=h2w_.Y(j); 353 for(sa_size_t i=0; i<h2w_.NBinX(); i++) { 354 double x=h2w_.X(i); 355 hp.Add(sqrt(x*x+y*y),h2w_(i,j)*facnorm); 356 } 357 } 358 return hp; 359 } 360 259 361 260 362 Histo2D MultiDish::PosDist(int nx, int ny, double dmax) … … 312 414 double kx0 = DeuxPI*(dishes_[i].X-dishes_[j].X)/lambda_; 313 415 double ky0 = DeuxPI*(dishes_[i].Y-dishes_[j].Y)/lambda_; 416 double pgain=dishes_[i].Gain()*dishes_[j].Gain(); 314 417 rot.Do(kx0, ky0); 315 418 // if (kx0<0) kx0=-kx0; … … 321 424 double y = jy*dy; 322 425 if ((ix>0)&&(jy>0)) { 323 sumw += AddToHisto(kx0, ky0, x, y, rd(x,y) , fgfh);324 if (j!=i) sumw += AddToHisto(-kx0, -ky0, x, y, rd(x,y) , fgfh);426 sumw += AddToHisto(kx0, ky0, x, y, rd(x,y)*pgain, fgfh); 427 if (j!=i) sumw += AddToHisto(-kx0, -ky0, x, y, rd(x,y)*pgain, fgfh); 325 428 } 326 429 else { 327 430 if ((ix==0)&&(jy==0)) { 328 sumw += h2w_.Add(kx0, ky0, rd(0.,0.) , fgfh);329 if (j!=i) sumw += h2w_.Add(-kx0, -ky0, rd(0.,0.) , fgfh);431 sumw += h2w_.Add(kx0, ky0, rd(0.,0.)*pgain, fgfh); 432 if (j!=i) sumw += h2w_.Add(-kx0, -ky0, rd(0.,0.)*pgain, fgfh); 330 433 } 331 434 else { 332 double w = rd(x,y) ;435 double w = rd(x,y)*pgain; 333 436 if (ix==0) { 334 437 sumw += h2w_.Add(kx0, ky0+y, w, fgfh);
Note:
See TracChangeset
for help on using the changeset viewer.