diff --git a/compact/definitions.xml b/compact/definitions.xml index c8744e9f30e7eb6301f24a5be812c13642ee5590..30f1dc9254773c645b3147b517a7fde7155f7891 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -381,11 +381,11 @@ Examples: <constant name="ForwardPIDRegion_zmin" value="CentralTrackingRegionP_zmax" /> <constant name="ForwardPIDRegion_length" value="140.0*cm" /> <comment> tangent of the opening angle at the front and back of the RICH </comment> - <constant name="ForwardPIDRegion_tan1" value="CentralTrackingRegionP_tan * 1.00" /> - <constant name="ForwardPIDRegion_tan2" value="Eta3_6_tan * 1.01" /> + <constant name="ForwardPIDRegion_tan1" value="CentralTrackingRegionP_tan * 0.88" /> + <constant name="ForwardPIDRegion_tan2" value="Eta3_6_tan * 0.89" /> <constant name="BackwardPIDRegion_zmin" value="CentralTrackingRegionN_zmax" /> - <constant name="BackwardPIDRegion_tan" value="CentralTrackingRegionN_tan" /> + <constant name="BackwardPIDRegion_tan" value="CentralTrackingRegionN_tan * 0.92" /> <constant name="BackwardPIDRegion_length" value="60.0*cm" /> <constant name="BackwardPIDRegion_rmax" value="CentralTrackingRegion_rmax" /> diff --git a/compact/display.xml b/compact/display.xml index cb021b22a60df4930cba2eb8aefa4bf7d52d7219..7cb035a0dfcabfd998a7b59a520b9f3e82c569bd 100644 --- a/compact/display.xml +++ b/compact/display.xml @@ -125,6 +125,7 @@ <vis name="DRICH_filter_vis" alpha="1.0" r="1.0" g="1.0" b="0.0" showDaughters="true" visible="true" /> <vis name="DRICH_mirror_vis" ref="AnlGray" showDaughters="true" visible="true" /> <vis name="DRICH_sensor_vis" ref="AnlBlue" showDaughters="true" visible="true" /> + <vis name="ERICH_sensor_vis" ref="AnlBlue" showDaughters="true" visible="true" /> <vis name="MRICH_aerogel_vis" ref="AnlTeal" showDaughters="true" visible="true" /> <vis name="MRICH_frame_vis" ref="AnlGold" showDaughters="true" visible="true" /> diff --git a/compact/display_geoviewer.xml b/compact/display_geoviewer.xml index 4dc26ceb3701342bbd2c37edf213cfc4b75d2fe0..42555347086562e9421ed9ea74bdec316e8d36c5 100644 --- a/compact/display_geoviewer.xml +++ b/compact/display_geoviewer.xml @@ -114,6 +114,7 @@ <vis name="DRICH_filter_vis" alpha="1.0" r="1.0" g="1.0" b="0.0" showDaughters="true" visible="true" /> <vis name="DRICH_mirror_vis" ref="AnlGray" showDaughters="true" visible="true" /> <vis name="DRICH_sensor_vis" ref="AnlGreen" showDaughters="true" visible="true" /> + <vis name="ERICH_sensor_vis" ref="AnlBlue" showDaughters="true" visible="false" /> <!-- invisible, to speedup graphics --> <vis name="MRICH_aerogel_vis" ref="AnlTeal" showDaughters="true" visible="true" /> <vis name="MRICH_frame_vis" ref="AnlGold" showDaughters="true" visible="true" /> diff --git a/compact/drich.xml b/compact/drich.xml index 1aa239f23f864966ce87ee3e391db4a383d9cd37..9c27e4db2a0e29a885b630bc3278fe0a39596d33 100644 --- a/compact/drich.xml +++ b/compact/drich.xml @@ -94,13 +94,14 @@ filter; the filter is applied to the back of the aerogel, so that it separates the aerogel and gas radiators - dimensions: + - `frontplane`: front of the aerogel, w.r.t. front plane of the vessel envelope + - `rmin` and `rmax`: inner and outer radius (at the front plane; radial bounds are conical) - `phiw`: azimuthal width of wedge - `thickness`: radiator thickness, defined separately for aerogel and filter - - `frontplane`: front of the aerogel, w.r.t. front plane of the vessel envelope - `pitch`: controls the angle of the radiator (0=vertical) </documentation> <radiator - rmin="DRICH_rmin0 + DRICH_wall_thickness + 2.0*cm" + rmin="DRICH_rmin0 + DRICH_wall_thickness + 0.2*cm" rmax="DRICH_rmax0 - DRICH_wall_thickness - 0.2*cm" phiw="60*degree" frontplane="DRICH_window_thickness + 0.5*DRICH_aerogel_thickness" @@ -142,17 +143,16 @@ material="Acrylic_DRICH" surface="MirrorSurface_DRICH" vis="DRICH_mirror_vis" - backplane="DRICH_window_thickness + 5.0*cm" + backplane="DRICH_window_thickness + 1.0*cm" rmin="DRICH_rmin1 + DRICH_wall_thickness - 1.0*cm" - rmax="DRICH_rmax2 - DRICH_wall_thickness - 5.0*cm" + rmax="DRICH_rmax2 - DRICH_wall_thickness - 1.0*cm" phiw="59.5*degree" thickness="0.2*cm" - focus_tune_x="40.0*cm" - focus_tune_z="-30.0*cm" + focus_tune_x="30.0*cm" + focus_tune_z="-40.0*cm" debug="DRICH_debug_mirror" /> - <!-- /detectors/detector/sensors --> <documentation level="10"> #### Sensors @@ -205,14 +205,14 @@ - `zmin`: z-plane cut </documentation> <sphere - centerz="-80.0 * cm" + centerz="-55.0 * cm" centerx="DRICH_rmax2 - 35.0*cm" - radius="100.0 * cm" + radius="85.0 * cm" debug="DRICH_debug_sensors" /> <sphericalpatch phiw="18*degree" - rmin="DRICH_rmax1 + 0.0*cm" + rmin="DRICH_rmax1 + 5.0*cm" rmax="DRICH_rmax2 - 5.0*cm" zmin="DRICH_SnoutLength + 5.0*cm" /> diff --git a/compact/erich.xml b/compact/erich.xml index a930c6c0065ea785a9017250f432c317ef254d11..f678748c905df9d6475a994458363394f5fffb4d 100644 --- a/compact/erich.xml +++ b/compact/erich.xml @@ -13,10 +13,11 @@ <constant name="ERICH_window_thickness" value="0.1*cm"/> <!-- thickness of entrance and exit walls --> <!-- additional parameters --> <constant name="ERICH_aerogel_thickness" value="3.0*cm"/> <!-- aerogel thickness --> -<constant name="ERICH_sensor_active_size" value="2*24.0*mm"/> <!-- sensor side length (effective area) --> -<constant name="ERICH_sensor_full_size" value="2*25.8*mm"/> <!-- sensor side length (full size, with enclosure) --> +<constant name="ERICH_sensor_active_size" value="24.0*mm"/> <!-- sensor side length (effective area) --> +<constant name="ERICH_sensor_full_size" value="25.8*mm"/> <!-- sensor side length (full size, with enclosure) --> <constant name="ERICH_sensor_thickness" value="1.5*mm"/> <!-- sensor thickness --> -<constant name="ERICH_num_px" value="2*8"/> <!-- number of pixels along one side of the sensor --> +<constant name="ERICH_sensor_dist" value="40*cm"/> <!-- distance between aerogel exit plane and sensor entrance plane --> +<constant name="ERICH_num_px" value="8"/> <!-- number of pixels along one side of the sensor --> <!-- debugging switches --> <comment> - `ERICH_debug_optics`: 1 = all components become vacuum; test opticalphotons from IP @@ -55,7 +56,6 @@ - `length`: overall z-length of the full vessel - `rmin0` and `rmin1`: bore radius at front plane and back plane, respectively - `rmax0` and `rmax1`: outer radius of vessel, at front plane and back plane, respectively - - `nsectors`: number of azimuthal sectors - `wall_thickness`: thickness of radial walls - `window_thickness`: thickness of entrance and exit disks </documentation> @@ -67,7 +67,6 @@ rmin1="ERICH_rmin1" rmax0="ERICH_rmax" rmax1="ERICH_rmax" - nsectors="6" wall_thickness="ERICH_wall_thickness" window_thickness="ERICH_window_thickness" /> @@ -81,14 +80,14 @@ the aerogel and gas radiators - dimensions: - `frontplane`: front of the aerogel, w.r.t. front plane of the vessel envelope - - `rmin` and `rmax`: inner and outer radius + - `rmin` and `rmax`: inner and outer radius (at the front plane; radial bounds are conical) - `phiw`: azimuthal width of wedge - `thickness`: radiator thickness, defined separately for aerogel and filter - `pitch`: controls the angle of the radiator (0=vertical) </documentation> <radiator frontplane="-ERICH_window_thickness" - rmin="ERICH_rmin0 + ERICH_wall_thickness + 0.5*cm" + rmin="ERICH_rmin0 + ERICH_wall_thickness + 0.2*cm" rmax="(ERICH_rmax/ERICH_zmax)*ERICH_zmin + 8.0*cm" phiw="60*degree" pitch="0*degree" @@ -132,7 +131,7 @@ <module material="Silicon" surface="SensorSurface_DRICH" - vis="DRICH_sensor_vis" + vis="ERICH_sensor_vis" side="ERICH_sensor_active_size" thickness="ERICH_sensor_thickness" gap="0.5*(ERICH_sensor_full_size-ERICH_sensor_active_size) + 0.5*mm" @@ -144,13 +143,12 @@ ##### Sensor plane - sensors will be placed on a plane - plane dimensions: - - `frontplane`: z-position of the sensor plane active surface (e.g., photocathode), w.r.t aerogel backplane; - absolute value of this number is the distance between aerogel/filter boundary and sensor surface + - `sensordist`: distance between sensor plane active surface (e.g., photocathode) and aerogel backplane - `rmin`: minimum radial position of a sensor's centroid - `rmax`: maximum radial position of a sensor's centroid </documentation> <plane - frontplane="-40*cm" + sensordist="ERICH_sensor_dist" rmin="ERICH_rmin1 + 2*cm" rmax="ERICH_rmax - 4*cm" /> diff --git a/compact/optical_materials.xml b/compact/optical_materials.xml index 00fe17cb860fde7ea9ad021d484aff334a9f9335..552ba5c495155b3ef861a83c401d69c697e8477f 100644 --- a/compact/optical_materials.xml +++ b/compact/optical_materials.xml @@ -427,8 +427,8 @@ 4.85156*eV 6.0*m 6.19921*eV 6.0*m "/> - <!-- dRICh aerogel --> - <matrix name="RINDEX__Aerogel_DRICH" coldim="2" values=" + <!-- dRICh aerogel, for density=0.11 g/cm3 (OLD versions are for 0.1g/cm3) --> + <matrix name="RINDEX__Aerogel_DRICH_OLD" coldim="2" values=" 1.87855*eV 1.01638 1.96673*eV 1.01642 2.0549*eV 1.01647 @@ -480,7 +480,59 @@ 6.11103*eV 1.02147 6.19921*eV 1.02167 "/> - <matrix name="ABSLENGTH__Aerogel_DRICH" coldim="2" values=" + <matrix name="RINDEX__Aerogel_DRICH" coldim="2" values=" + 1.87855*eV 1.01852 + 1.96673*eV 1.01856 + 2.05490*eV 1.01861 + 2.14308*eV 1.01866 + 2.23126*eV 1.01871 + 2.31943*eV 1.01876 + 2.40761*eV 1.01881 + 2.49579*eV 1.01887 + 2.58396*eV 1.01893 + 2.67214*eV 1.01899 + 2.76032*eV 1.01905 + 2.84849*eV 1.01912 + 2.93667*eV 1.01919 + 3.02485*eV 1.01926 + 3.11302*eV 1.01933 + 3.20120*eV 1.01941 + 3.28938*eV 1.01948 + 3.37755*eV 1.01956 + 3.46573*eV 1.01965 + 3.55391*eV 1.01973 + 3.64208*eV 1.01982 + 3.73026*eV 1.01991 + 3.81844*eV 1.02001 + 3.90661*eV 1.02010 + 3.99479*eV 1.02020 + 4.08297*eV 1.02030 + 4.17114*eV 1.02041 + 4.25932*eV 1.02052 + 4.34750*eV 1.02063 + 4.43567*eV 1.02074 + 4.52385*eV 1.02086 + 4.61203*eV 1.02098 + 4.70020*eV 1.02111 + 4.78838*eV 1.02123 + 4.87656*eV 1.02136 + 4.96473*eV 1.02150 + 5.05291*eV 1.02164 + 5.14109*eV 1.02178 + 5.22927*eV 1.02193 + 5.31744*eV 1.02208 + 5.40562*eV 1.02223 + 5.49380*eV 1.02239 + 5.58197*eV 1.02255 + 5.67015*eV 1.02271 + 5.75833*eV 1.02288 + 5.84650*eV 1.02306 + 5.93468*eV 1.02324 + 6.02286*eV 1.02342 + 6.11103*eV 1.02361 + 6.19921*eV 1.02381 + "/> + <matrix name="ABSLENGTH__Aerogel_DRICH_OLD" coldim="2" values=" 1.87855*eV 154*mm 1.96673*eV 156.17*mm 2.0549*eV 158.154*mm @@ -532,7 +584,59 @@ 6.11103*eV 7.29168*mm 6.19921*eV 6.69064*mm "/> - <matrix name="RAYLEIGH__Aerogel_DRICH" coldim="2" values=" + <matrix name="ABSLENGTH__Aerogel_DRICH" coldim="2" values=" + 1.87855*eV 140.000*mm + 1.96673*eV 141.973*mm + 2.05490*eV 143.776*mm + 2.14308*eV 145.431*mm + 2.23126*eV 146.955*mm + 2.31943*eV 148.364*mm + 2.40761*eV 149.669*mm + 2.49579*eV 150.882*mm + 2.58396*eV 152.012*mm + 2.67214*eV 153.067*mm + 2.76032*eV 154.055*mm + 2.84849*eV 154.982*mm + 2.93667*eV 155.854*mm + 3.02485*eV 156.674*mm + 3.11302*eV 157.448*mm + 3.20120*eV 158.180*mm + 3.28938*eV 158.872*mm + 3.37755*eV 159.528*mm + 3.46573*eV 160.150*mm + 3.55391*eV 160.742*mm + 3.64208*eV 147.916*mm + 3.73026*eV 128.139*mm + 3.81844*eV 111.378*mm + 3.90661*eV 97.121*mm + 3.99479*eV 84.948*mm + 4.08297*eV 74.518*mm + 4.17114*eV 65.552*mm + 4.25932*eV 57.819*mm + 4.34750*eV 51.130*mm + 4.43567*eV 45.327*mm + 4.52385*eV 40.278*mm + 4.61203*eV 35.873*mm + 4.70020*eV 32.019*mm + 4.78838*eV 28.641*mm + 4.87656*eV 25.670*mm + 4.96473*eV 23.054*mm + 5.05291*eV 20.742*mm + 5.14109*eV 18.698*mm + 5.22927*eV 16.884*mm + 5.31744*eV 15.272*mm + 5.40562*eV 13.837*mm + 5.49380*eV 12.557*mm + 5.58197*eV 11.413*mm + 5.67015*eV 10.389*mm + 5.75833*eV 9.470*mm + 5.84650*eV 8.645*mm + 5.93468*eV 7.902*mm + 6.02286*eV 7.233*mm + 6.11103*eV 6.629*mm + 6.19921*eV 6.082*mm + "/> + <matrix name="RAYLEIGH__Aerogel_DRICH_OLD" coldim="2" values=" 1.87855*eV 309.218*mm 1.96673*eV 257.383*mm 2.0549*eV 215.968*mm @@ -584,6 +688,58 @@ 6.11103*eV 2.76144*mm 6.19921*eV 2.607*mm "/> + <matrix name="RAYLEIGH__Aerogel_DRICH" coldim="2" values=" + 1.87855*eV 281.107*mm + 1.96673*eV 233.984*mm + 2.05490*eV 196.334*mm + 2.14308*eV 165.962*mm + 2.23126*eV 141.242*mm + 2.31943*eV 120.958*mm + 2.40761*eV 104.188*mm + 2.49579*eV 90.226*mm + 2.58396*eV 78.527*mm + 2.67214*eV 68.663*mm + 2.76032*eV 60.301*mm + 2.84849*eV 53.174*mm + 2.93667*eV 47.070*mm + 3.02485*eV 41.816*mm + 3.11302*eV 37.277*mm + 3.20120*eV 33.336*mm + 3.28938*eV 29.903*mm + 3.37755*eV 26.900*mm + 3.46573*eV 24.265*mm + 3.55391*eV 21.946*mm + 3.64208*eV 19.896*mm + 3.73026*eV 18.080*mm + 3.81844*eV 16.468*mm + 3.90661*eV 15.030*mm + 3.99479*eV 13.746*mm + 4.08297*eV 12.596*mm + 4.17114*eV 11.564*mm + 4.25932*eV 10.637*mm + 4.34750*eV 9.799*mm + 4.43567*eV 9.043*mm + 4.52385*eV 8.358*mm + 4.61203*eV 7.738*mm + 4.70020*eV 7.172*mm + 4.78838*eV 6.659*mm + 4.87656*eV 6.191*mm + 4.96473*eV 5.762*mm + 5.05291*eV 5.370*mm + 5.14109*eV 5.011*mm + 5.22927*eV 4.681*mm + 5.31744*eV 4.379*mm + 5.40562*eV 4.100*mm + 5.49380*eV 3.844*mm + 5.58197*eV 3.606*mm + 5.67015*eV 3.386*mm + 5.75833*eV 3.184*mm + 5.84650*eV 2.996*mm + 5.93468*eV 2.822*mm + 6.02286*eV 2.660*mm + 6.11103*eV 2.510*mm + 6.19921*eV 2.370*mm + "/> <!-- dRICh acrylic --> <matrix name="RINDEX__Acrylic_DRICH" coldim="2" values=" 4.13281*eV 1.5017 @@ -753,11 +909,20 @@ <property name="RINDEX" ref="RINDEX__C4F10_ERICH"/> <property name="ABSLENGTH" ref="ABSLENGTH__C4F10_ERICH"/> </material> - <material name="Aerogel_DRICH"> - <D type="density" value="0.1" unit="g/cm3"/> + <material name="Aerogel_DRICH_OLD"> + <D type="density" value="0.100" unit="g/cm3"/> <comment> n_air = [dens(Si02)-dens(aerogel)] / [dens(Si02)-dens(Air) ] </comment> <fraction n=" (2.32-0.1) / (2.32-0.0012)" ref="Air"/> <fraction n="1 - (2.32-0.1) / (2.32-0.0012)" ref="SiliconDioxide"/> + <property name="RINDEX" ref="RINDEX__Aerogel_DRICH_OLD"/> + <property name="ABSLENGTH" ref="ABSLENGTH__Aerogel_DRICH_OLD"/> + <property name="RAYLEIGH" ref="RAYLEIGH__Aerogel_DRICH_OLD"/> + </material> + <material name="Aerogel_DRICH"> + <D type="density" value="0.110" unit="g/cm3"/> + <comment> n_air = [dens(Si02)-dens(aerogel)] / [dens(Si02)-dens(Air) ] </comment> + <fraction n=" (2.32-0.11) / (2.32-0.0012)" ref="Air"/> + <fraction n="1 - (2.32-0.11) / (2.32-0.0012)" ref="SiliconDioxide"/> <property name="RINDEX" ref="RINDEX__Aerogel_DRICH"/> <property name="ABSLENGTH" ref="ABSLENGTH__Aerogel_DRICH"/> <property name="RAYLEIGH" ref="RAYLEIGH__Aerogel_DRICH"/> diff --git a/compact/subsystem_views/drich_only.xml b/compact/subsystem_views/drich_only.xml index d85dad6a539987fa9d58d79b2a39d74fa04f42d4..d1dff27e3ea1654aa0db437b577a3554ba3fb3d5 100644 --- a/compact/subsystem_views/drich_only.xml +++ b/compact/subsystem_views/drich_only.xml @@ -67,7 +67,7 @@ ## dRICh only </documentation> - <include ref="ip6/beampipe.xml" /> + <include ref="ip6/beampipe.xml" /> <include ref="compact/drich.xml" /> </lccdd> diff --git a/src/DRich_geo.cpp b/src/DRich_geo.cpp index 388feae695e0375bc1c991861f17e2b073a1c718..a53fa0514cdec3012e55e1f8db0102615a2349de 100644 --- a/src/DRich_geo.cpp +++ b/src/DRich_geo.cpp @@ -132,6 +132,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // snout solids double boreDelta = vesselRmin1 - vesselRmin0; + double snoutDelta = vesselRmax1 - vesselRmax0; Cone vesselSnout( snoutLength/2.0, vesselRmin0, @@ -219,6 +220,59 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec sens.setType("photoncounter"); + // BUILD RADIATOR ==================================================================== + + // attributes + double airGap = 0.01*mm; // air gap between aerogel and filter (FIXME? actually it's currently a gas gap) + + // solid and volume: create aerogel and filter + Cone aerogelSolid( + aerogelThickness/2, + radiatorRmin, + radiatorRmax, + radiatorRmin + boreDelta * aerogelThickness / vesselLength, + radiatorRmax + snoutDelta * aerogelThickness / snoutLength + ); + Cone filterSolid( + filterThickness/2, + radiatorRmin + boreDelta * (aerogelThickness + airGap) / vesselLength, + radiatorRmax + snoutDelta * (aerogelThickness + airGap) / snoutLength, + radiatorRmin + boreDelta * (aerogelThickness + airGap + filterThickness) / vesselLength, + radiatorRmax + snoutDelta * (aerogelThickness + airGap + filterThickness) / snoutLength + ); + + Volume aerogelVol( detName+"_aerogel", aerogelSolid, aerogelMat ); + Volume filterVol( detName+"_filter", filterSolid, filterMat ); + aerogelVol.setVisAttributes(aerogelVis); + filterVol.setVisAttributes(filterVis); + + // aerogel placement and surface properties + // TODO [low-priority]: define skin properties for aerogel and filter + auto radiatorPos = Position(0., 0., radiatorFrontplane) + originFront; + auto aerogelPV = gasvolVol.placeVolume(aerogelVol, + Translation3D(radiatorPos.x(), radiatorPos.y(), radiatorPos.z()) // re-center to originFront + * RotationY(radiatorPitch) // change polar angle to specified pitch // FIXME: probably broken (not yet in use anyway) + ); + DetElement aerogelDE(det, "aerogel_de", 0); + aerogelDE.setPlacement(aerogelPV); + //SkinSurface aerogelSkin(desc, aerogelDE, "mirror_optical_surface", aerogelSurf, aerogelVol); + //aerogelSkin.isValid(); + + // filter placement and surface properties + if(!debug_optics) { + auto filterPV = gasvolVol.placeVolume(filterVol, + Translation3D(0., 0., airGap) // add an air gap + * Translation3D(radiatorPos.x(), radiatorPos.y(), radiatorPos.z()) // re-center to originFront + * RotationY(radiatorPitch) // change polar angle + * Translation3D(0., 0., (aerogelThickness+filterThickness)/2.) // move to aerogel backplane + ); + DetElement filterDE(det, "filter_de", 0); + filterDE.setPlacement(filterPV); + //SkinSurface filterSkin(desc, filterDE, "mirror_optical_surface", filterSurf, filterVol); + //filterSkin.isValid(); + }; + + // SECTOR LOOP ////////////////////////////////// for(int isec=0; isec<nSectors; isec++) { @@ -230,43 +284,6 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec std::string secName = "sec" + std::to_string(isec); - // BUILD RADIATOR ==================================================================== - - // solid and volume: create aerogel and filter sectors - Tube aerogelSolid(radiatorRmin, radiatorRmax, aerogelThickness/2, -radiatorPhiw/2.0, radiatorPhiw/2.0); - Tube filterSolid( radiatorRmin, radiatorRmax, filterThickness/2, -radiatorPhiw/2.0, radiatorPhiw/2.0); - Volume aerogelVol( detName+"_aerogel_"+secName, aerogelSolid, aerogelMat ); - Volume filterVol( detName+"_filter_"+secName, filterSolid, filterMat ); - aerogelVol.setVisAttributes(aerogelVis); - filterVol.setVisAttributes(filterVis); - - // aerogel placement and surface properties - // TODO [low-priority]: define skin properties for aerogel and filter - auto radiatorPos = Position(0., 0., radiatorFrontplane) + originFront; - auto aerogelPV = gasvolVol.placeVolume(aerogelVol, - RotationZ(sectorRotation) // rotate about beam axis to sector - * Translation3D(radiatorPos.x(), radiatorPos.y(), radiatorPos.z()) // re-center to originFront - * RotationY(radiatorPitch) // change polar angle to specified pitch - ); - DetElement aerogelDE(det, Form("aerogel_de%d", isec), isec); - aerogelDE.setPlacement(aerogelPV); - //SkinSurface aerogelSkin(desc, aerogelDE, Form("mirror_optical_surface%d", isec), aerogelSurf, aerogelVol); - //aerogelSkin.isValid(); - - // filter placement and surface properties - if(!debug_optics) { - auto filterPV = gasvolVol.placeVolume(filterVol, - RotationZ(sectorRotation) // rotate about beam axis to sector - * Translation3D(radiatorPos.x(), radiatorPos.y(), radiatorPos.z()) // re-center to originFront - * RotationY(radiatorPitch) // change polar angle - * Translation3D(0., 0., (aerogelThickness+filterThickness)/2.) // move to aerogel backplane - ); - DetElement filterDE(det, Form("filter_de%d", isec), isec); - filterDE.setPlacement(filterPV); - //SkinSurface filterSkin(desc, filterDE, Form("mirror_optical_surface%d", isec), filterSurf, filterVol); - //filterSkin.isValid(); - }; - // BUILD SENSORS ==================================================================== @@ -370,7 +387,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // properties sensorPV.addPhysVolID("sector", isec).addPhysVolID("module", imod); - DetElement sensorDE(det, Form("sensor_de%d_%d", isec, imod), 10000*isec+imod); + DetElement sensorDE(det, Form("sensor_de%d_%d", isec, imod), (imod<<3)|isec ); // id must match IRTAlgorithm usage sensorDE.setPlacement(sensorPV); if(!debug_optics) { SkinSurface sensorSkin(desc, sensorDE, Form("sensor_optical_surface%d", isec), sensorSurf, sensorVol); @@ -446,17 +463,6 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec double xF = xS + focusTuneX; FocusMirror(zF,xF,B); - /* - // print some calculated parameters, viz. mirror attributes - //printf("(zC,xC) = ( %.2f, %.2f )\n",zC,xC); - //printf("zS = %f\n",zS); - //printf("xS = %f\n",xS); - //printf("B = %f\n",B); - printf("zM = %f\n",zM); - printf("xM = %f\n",xM); - printf("rM = %f\n",rM); - */ - // re-define mirror attributes to be w.r.t vessel front plane double mirrorCenterZ = zM - vesselZmin; double mirrorCenterX = xM; @@ -481,6 +487,18 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec 40*degree ); + /* CAUTION: if any of the relative placements or boolean operations below + * are changed, you MUST make sure this does not break access to the sphere + * primitive and positioning in Juggler `IRTAlgorithm`; cross check the + * mirror sphere attributes carefully! + */ + /* + // PRINT MIRROR ATTRIBUTES (before any sector z-rotation) + printf("zM = %f\n",zM); // sphere centerZ, w.r.t. IP + printf("xM = %f\n",xM); // sphere centerX, w.r.t. IP + printf("rM = %f\n",rM); // sphere radius + */ + // mirror placement transformation (note: transformations are in reverse order) auto mirrorPos = Position(mirrorCenterX, 0., mirrorCenterZ) + originFront; Transform3D mirrorPlacement( diff --git a/src/ERich_geo.cpp b/src/ERich_geo.cpp index 76ef437a1c8562de30c806cde34cf42fde5657c3..b10b2746a4fca2a051e52866c2690edc9c2691d6 100644 --- a/src/ERich_geo.cpp +++ b/src/ERich_geo.cpp @@ -37,7 +37,6 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec double vesselRmin1 = dims.attr<double>(_Unicode(rmin1)); double vesselRmax0 = dims.attr<double>(_Unicode(rmax0)); double vesselRmax1 = dims.attr<double>(_Unicode(rmax1)); - int nSectors = dims.attr<int>(_Unicode(nsectors)); double wallThickness = dims.attr<double>(_Unicode(wall_thickness)); double windowThickness = dims.attr<double>(_Unicode(window_thickness)); auto vesselMat = desc.material(detElem.attr<std::string>(_Unicode(material))); @@ -70,10 +69,10 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec double sensorGap = sensorElem.attr<double>(_Unicode(gap)); double sensorThickness = sensorElem.attr<double>(_Unicode(thickness)); // - sensor plane - auto sensorPlaneElem = detElem.child(_Unicode(sensors)).child(_Unicode(plane)); - double sensorPlaneFrontplane = sensorPlaneElem.attr<double>(_Unicode(frontplane)); - double sensorPlaneRmin = sensorPlaneElem.attr<double>(_Unicode(rmin)); - double sensorPlaneRmax = sensorPlaneElem.attr<double>(_Unicode(rmax)); + auto sensorPlaneElem = detElem.child(_Unicode(sensors)).child(_Unicode(plane)); + double sensorPlaneDist = sensorPlaneElem.attr<double>(_Unicode(sensordist)); + double sensorPlaneRmin = sensorPlaneElem.attr<double>(_Unicode(rmin)); + double sensorPlaneRmax = sensorPlaneElem.attr<double>(_Unicode(rmax)); // - debugging switches int debug_optics_mode = detElem.attr<int>(_Unicode(debug_optics)); @@ -103,6 +102,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec */ // tank solids + double boreDelta = vesselRmin1 - vesselRmin0; Cone vesselTank(vesselLength / 2.0, vesselRmin1, vesselRmax1, vesselRmin0, vesselRmax0); Cone gasvolTank(vesselLength / 2.0 - windowThickness, vesselRmin1 + wallThickness, vesselRmax1 - wallThickness, vesselRmin0 + wallThickness, vesselRmax0 - wallThickness); @@ -147,56 +147,60 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // sensitive detector type sens.setType("photoncounter"); - // SECTOR LOOP ////////////////////////////////// - for (int isec = 0; isec < nSectors; isec++) { - - // debugging filters, limiting the number of sectors - // if( debug_optics && isec!=0) continue; - - // sector rotation about z axis - double sectorRotation = isec * 360 / nSectors * degree; - std::string secName = "sec" + std::to_string(isec); - - // BUILD RADIATOR ////////////////////////////////////// - - // solid and volume: create aerogel and filter sectors - Tube aerogelSolid(radiatorRmin, radiatorRmax, aerogelThickness / 2, -radiatorPhiw / 2.0, radiatorPhiw / 2.0); - Tube filterSolid(radiatorRmin, radiatorRmax, filterThickness / 2, -radiatorPhiw / 2.0, radiatorPhiw / 2.0); - Volume aerogelVol(detName + "_aerogel_" + secName, aerogelSolid, aerogelMat); - Volume filterVol(detName + "_filter_" + secName, filterSolid, filterMat); - aerogelVol.setVisAttributes(aerogelVis); - filterVol.setVisAttributes(filterVis); - - // aerogel placement and surface properties - // TODO [low-priority]: define skin properties for aerogel and filter - auto radiatorPos = Position(0., 0., radiatorFrontplane - 0.5 * aerogelThickness) + originFront; - auto aerogelPV = gasvolVol.placeVolume( - aerogelVol, - RotationZ(sectorRotation) // rotate about beam axis to sector - * Translation3D(radiatorPos.x(), radiatorPos.y(), radiatorPos.z()) // re-center to originFront - * RotationY(radiatorPitch) // change polar angle to specified pitch - ); - DetElement aerogelDE(det, Form("aerogel_de%d", isec), isec); - aerogelDE.setPlacement(aerogelPV); - // SkinSurface aerogelSkin(desc, aerogelDE, Form("mirror_optical_surface%d", isec), aerogelSurf, aerogelVol); - // aerogelSkin.isValid(); - - // filter placement and surface properties - if (!debug_optics) { - auto filterPV = gasvolVol.placeVolume( - filterVol, - RotationZ(sectorRotation) // rotate about beam axis to sector - * Translation3D(radiatorPos.x(), radiatorPos.y(), radiatorPos.z()) // re-center to originFront - * RotationY(radiatorPitch) // change polar angle - * Translation3D(0., 0., -(aerogelThickness + filterThickness) / 2.) // move to aerogel backplane + + // BUILD RADIATOR ////////////////////////////////////// + + // attributes + double airGap = 0.01*mm; // air gap between aerogel and filter (FIXME? actually it's currently a gas gap) + + // solid and volume: create aerogel and filter + Cone aerogelSolid( + aerogelThickness/2, + radiatorRmin + boreDelta * aerogelThickness / vesselLength, /* at backplane */ + radiatorRmax, + radiatorRmin, /* at frontplane */ + radiatorRmax ); - DetElement filterDE(det, Form("filter_de%d", isec), isec); - filterDE.setPlacement(filterPV); - // SkinSurface filterSkin(desc, filterDE, Form("mirror_optical_surface%d", isec), filterSurf, filterVol); - // filterSkin.isValid(); - }; + Cone filterSolid( + filterThickness/2, + radiatorRmin + boreDelta * (aerogelThickness + airGap + filterThickness) / vesselLength, /* at backplane */ + radiatorRmax, + radiatorRmin + boreDelta * (aerogelThickness + airGap) / vesselLength, /* at frontplane */ + radiatorRmax + ); + Volume aerogelVol(detName + "_aerogel", aerogelSolid, aerogelMat); + Volume filterVol(detName + "_filter", filterSolid, filterMat); + aerogelVol.setVisAttributes(aerogelVis); + filterVol.setVisAttributes(filterVis); + + // aerogel placement and surface properties + // TODO [low-priority]: define skin properties for aerogel and filter + auto radiatorPos = Position(0., 0., radiatorFrontplane - 0.5 * aerogelThickness) + originFront; + auto aerogelPV = gasvolVol.placeVolume( + aerogelVol, + Translation3D(radiatorPos.x(), radiatorPos.y(), radiatorPos.z()) // re-center to originFront + * RotationY(radiatorPitch) // change polar angle to specified pitch // (FIXME: probably broken, currently not in use) + ); + DetElement aerogelDE(det, "aerogel_de", 0); + aerogelDE.setPlacement(aerogelPV); + // SkinSurface aerogelSkin(desc, aerogelDE, "mirror_optical_surface", aerogelSurf, aerogelVol); + // aerogelSkin.isValid(); + + // filter placement and surface properties + if (!debug_optics) { + auto filterPV = gasvolVol.placeVolume( + filterVol, + Translation3D(0., 0., -airGap) // add an airgap (FIXME: actually a gas gap) + * Translation3D(radiatorPos.x(), radiatorPos.y(), radiatorPos.z()) // re-center to originFront + * RotationY(radiatorPitch) // change polar angle + * Translation3D(0., 0., -(aerogelThickness + filterThickness) / 2.) // move to aerogel backplane + ); + DetElement filterDE(det, "filter_de", 0); + filterDE.setPlacement(filterPV); + // SkinSurface filterSkin(desc, filterDE, "mirror_optical_surface", filterSurf, filterVol); + // filterSkin.isValid(); + }; - }; // END SECTOR LOOP ////////////////////////// // BUILD SENSORS /////////////////////// @@ -209,9 +213,9 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec if (!debug_optics) sensorVol.setSensitiveDetector(sens); - // sensor plane positioning: we want |`sensorPlaneFrontplane`| to be the distance between the + // sensor plane positioning: we want `sensorPlaneDist` to be the distance between the // aerogel backplane (i.e., aerogel/filter boundary) and the sensor active surface (e.g, photocathode) - double sensorZpos = radiatorFrontplane - aerogelThickness + sensorPlaneFrontplane - 0.5 * sensorThickness; + double sensorZpos = radiatorFrontplane - aerogelThickness - sensorPlaneDist - 0.5 * sensorThickness; auto sensorPlanePos = Position(0., 0., sensorZpos) + originFront; // reference position // miscellaneous int imod = 0; // module number @@ -249,7 +253,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // properties sensorPV.addPhysVolID("module", imod); - DetElement sensorDE(det, Form("sensor_de_%d", imod), 10000 * imod); // TODO: what is this 10000? + DetElement sensorDE(det, Form("sensor_de_%d", imod), imod); sensorDE.setPlacement(sensorPV); if (!debug_optics) { SkinSurface sensorSkin(desc, sensorDE, "sensor_optical_surface", sensorSurf,