Changeset 19786


Ignore:
Timestamp:
10/24/19 15:15:03 (5 years ago)
Author:
tbretz
Message:
Implemneted the option of a (non ideal) point source.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/hawc/fresnellens_psf.C

    r19648 r19786  
    3333    double psf = 0;  // Do not change! It might have unpredicted side effectes
    3434
    35     double angle = 6; // [cm] angle of incidence of simulates rays
     35    double angle = 0; // [cm] angle of incidence of simulates rays
     36
     37    //TVector3 point_source(0, -F*atan(angle*TMath::DegToRad()), F);  // Point source at x=0, y=0, z=F
     38    TVector3 point_source; // No point source
    3639
    3740    MFresnelLens lens;
     
    7174
    7275        TVector3 dir;
    73         dir.SetMagThetaPhi(1, (180-angle)*TMath::DegToRad(), TMath::Pi()/2);
     76        if (point_source.Mag()<1e-10)
     77            dir.SetMagThetaPhi(1, (180-angle)*TMath::DegToRad(), TMath::Pi()/2);
     78        else
     79        {
     80            // Note that this is not a perfect point source as the
     81            // flux is homogeneous over the surface of the lens
     82            TVector3 ps = pos - point_source;
     83            dir.SetMagThetaPhi(1, ps.Theta(), ps.Phi());
     84        }
    7485
    7586        double v = 1./(TMath::C()*100/1e9); // cm/ns
Note: See TracChangeset for help on using the changeset viewer.