Changeset 19636
- Timestamp:
- 09/15/19 14:20:56 (5 years ago)
- 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 ******************************************************************/ 1 15 void fresnellens_image() 2 16 { … … 4 18 Double_t telaz = 0; // [deg] Telescope orientation Azimuth 5 19 6 Double_t dzd = 8 ; // [deg] Relative angle of light ray Zd20 Double_t dzd = 85; // [deg] Relative angle of light ray Zd 7 21 Double_t daz = 0; // [deg] Relative angle of light ray Az 8 22 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) 10 24 // // This is different from F in MFresnelLens! 11 25 … … 13 27 14 28 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); 15 38 16 MPointingPos pointpos;17 pointpos.SetLocalPosition(telzd, telaz);18 39 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"); 21 45 22 46 MGeomCamFAMOUS geom(F); … … 24 48 MSimRays simrays; 25 49 simrays.SetNameReflector("Reflector"); 26 simrays.SetWavelengthRange( 700, 700);50 simrays.SetWavelengthRange(300, 890); 27 51 //simrays.SetNumPhotons(100000); 52 53 MPointingPos srcpos("Source"); 54 srcpos.SetLocalPosition(dzd, daz); 55 56 MPointingPos pointpos; 57 pointpos.SetLocalPosition(telzd, telaz); 28 58 29 59 // ---------------------------------------------- … … 37 67 plist.AddToList(&srcpos); 38 68 plist.AddToList(&geom); 69 plist.AddToList(&pde); 70 plist.AddToList(&acc); 39 71 40 72 tlist.AddToList(&simrays); … … 46 78 MHPhotonEvent plane4(2, "HMirrorPlane4"); 47 79 MHPhotonEvent planeC(9, "HPhotonEventCamera"); 80 MHPhotonEvent planeS(9, "HPhotonEventCamera"); 48 81 49 82 planeG.SetMaxImpact(60); … … 55 88 MFillH fill4(&plane4, "MirrorPlane4", "FillCameraPlane"); 56 89 MFillH fillC(&planeC, "MPhotonEvent", "FillCamera"); 90 MFillH fillS(&planeS, "MPhotonEvent", "FillCamera"); 57 91 58 92 fillG.SetNameTab("Ground", "Photon distribution at ground"); … … 61 95 fill3.SetNameTab("LensOut", "Photon distribution at plane output surface"); 62 96 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! 64 108 65 109 tlist.AddToList(&fillG); 110 tlist.AddToList(&absapd); 66 111 67 112 MSimReflector simref; … … 75 120 tlist.AddToList(&fill4); 76 121 tlist.AddToList(&fillC); 122 tlist.AddToList(&cones); 123 tlist.AddToList(&fillS); 77 124 78 125 //tlist.SetAccelerator(MTask::kAccDontReset|MTask::kAccDontTime); … … 84 131 loop.SetParList(&plist); 85 132 86 if (!loop.Eventloop( 100))133 if (!loop.Eventloop(510)) 87 134 return; 88 135 }
Note:
See TracChangeset
for help on using the changeset viewer.