Changeset 19636 for trunk


Ignore:
Timestamp:
09/15/19 14:20:56 (5 years ago)
Author:
tbretz
Message:
Added some absorption and some comments:
File:
1 edited

Legend:

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

    r19617 r19636  
     1/*****************************************************************
     2
     3 fresnellens_image.C - Example how to simulate a fresnel lens
     4
     5 To run the macro from the command line (assuming you are in a directory
     6 Mars/build where you have built your Mars environment) you have to do
     7
     8    root ../hawc/fresnellens_image.C
     9
     10 or from within root
     11
     12    [0] .x ../hawc/fresnellens_image.C
     13
     14******************************************************************/
    115void fresnellens_image()
    216{
     
    418    Double_t telaz = 0;      // [deg] Telescope orientation Azimuth
    519
    6     Double_t dzd   = 8;      // [deg] Relative angle of light ray Zd
     20    Double_t dzd   = 85;      // [deg] Relative angle of light ray Zd
    721    Double_t daz   = 0;      // [deg] Relative angle of light ray Az
    822
    9     Double_t F     = 0.5021; // [m]   Distance of camera to lens
     23    Double_t F     = 0.5021; // [m]   Distance of camera to lens (w.r.t. to lens exit)
    1024    //                       // This is different from F in MFresnelLens!
    1125
     
    1327
    1428    MFresnelLens lens("Reflector");
     29    //lens.DefineLens(F, D, w, H, lambda);
     30    //lens.EnableSlopeAbsorption();
     31    //lens.EnableDraftAbsorption();
     32    //lens.DisableBottomReflection();
     33    //lens.DisableMultiEntry();
     34    //lens.DisableFresnelReflection();
     35    //lens.SetMinHits(5);
     36    //lens.SetMaxHits(0);
     37    lens.ReadTransmission("resmc/hawcseye/transmission-pmma-3mm.txt", 0.3, true);
    1538
    16     MPointingPos pointpos;
    17     pointpos.SetLocalPosition(telzd, telaz);
    1839
    19     MPointingPos srcpos("Source");
    20     srcpos.SetLocalPosition(dzd, daz);
     40    MParSpline pde("PhotonDetectionEfficiency");
     41    MParSpline acc("ConesAngularAcceptance");
     42
     43    pde.ReadFile("resmc/hawcseye/pde.txt");
     44    acc.ReadFile("resmc/hawcseye/cones-angular-acceptance.txt");
    2145
    2246    MGeomCamFAMOUS geom(F);
     
    2448    MSimRays simrays;
    2549    simrays.SetNameReflector("Reflector");
    26     simrays.SetWavelengthRange(700, 700);
     50    simrays.SetWavelengthRange(300, 890);
    2751    //simrays.SetNumPhotons(100000);
     52
     53    MPointingPos srcpos("Source");
     54    srcpos.SetLocalPosition(dzd, daz);
     55
     56    MPointingPos pointpos;
     57    pointpos.SetLocalPosition(telzd, telaz);
    2858
    2959    // ----------------------------------------------
     
    3767    plist.AddToList(&srcpos);
    3868    plist.AddToList(&geom);
     69    plist.AddToList(&pde);
     70    plist.AddToList(&acc);
    3971
    4072    tlist.AddToList(&simrays);
     
    4678    MHPhotonEvent plane4(2, "HMirrorPlane4");
    4779    MHPhotonEvent planeC(9, "HPhotonEventCamera");
     80    MHPhotonEvent planeS(9, "HPhotonEventCamera");
    4881
    4982    planeG.SetMaxImpact(60);
     
    5588    MFillH fill4(&plane4, "MirrorPlane4", "FillCameraPlane");
    5689    MFillH fillC(&planeC, "MPhotonEvent", "FillCamera");
     90    MFillH fillS(&planeS, "MPhotonEvent", "FillCamera");
    5791
    5892    fillG.SetNameTab("Ground",      "Photon distribution at ground");
     
    6195    fill3.SetNameTab("LensOut",     "Photon distribution at plane output surface");
    6296    fill4.SetNameTab("CameraPlane", "Photon distribution at camera plane");
    63     fillC.SetNameTab("Camera",      "Photon distribution which hit a sensor in the focal plane");
     97    fillC.SetNameTab("Camera",      "Photon distribution which hit a cone in the focal plane");
     98    fillS.SetNameTab("Sensor",      "Photon distribution which hit a sensor in the focal plane");
     99
     100    MSimAbsorption absapd("SimPhotonDetectionEfficiency");
     101    MSimAbsorption cones("SimConesAngularAcceptance");
     102    absapd.SetParName("PhotonDetectionEfficiency");
     103    cones.SetParName("ConesAngularAcceptance");
     104    cones.SetUseTheta();
     105    cones.SetForce();
     106    absapd.SetForce();
     107    // We loose another 4% at the cone surface!
    64108
    65109    tlist.AddToList(&fillG);
     110    tlist.AddToList(&absapd);
    66111
    67112    MSimReflector simref;
     
    75120    tlist.AddToList(&fill4);
    76121    tlist.AddToList(&fillC);
     122    tlist.AddToList(&cones);
     123    tlist.AddToList(&fillS);
    77124
    78125    //tlist.SetAccelerator(MTask::kAccDontReset|MTask::kAccDontTime);
     
    84131    loop.SetParList(&plist);
    85132
    86     if (!loop.Eventloop(100))
     133    if (!loop.Eventloop(510))
    87134        return;
    88135}
Note: See TracChangeset for help on using the changeset viewer.