Presentation is loading. Please wait.

Presentation is loading. Please wait.

Detector Drawing in Besvis

Similar presentations


Presentation on theme: "Detector Drawing in Besvis"— Presentation transcript:

1 Detector Drawing in Besvis
Long Peixun

2 Outline Structure of geom.root Detector drawing
About geom.root Analyzing geom.root Mdc, Tof, Emc, Muc and Beam Pipe Detector drawing 2 user-defined geometry classes Process of drawing detectors from geom.root Algorithm of deciding whether a point is in a polygon

3 About geom.root To use Besvis, we usually load the geometry file – geom.root. In order to analyze the code of drawing detectors, we should comprehend geometry structure first.

4 Analyzing Code

5 <NodeName>_<Index>
Analyzing Result Including nodes. Tree-like structure, the root node named volBes. Naming rule of nodes <NodeName>_<Index> First layer of the tree volBes logicalMdc_0 … logicalTof_1 … logicalEMC_2 … logicalMuc_3 … volBeamPipe_4 volBeamPipe_4 node has no child.

6 logicalMdc_0 logicalMdc_0 logicalMdcStereoLayer0_0 … logicalMdcStereoLayer7_7 logicalMdcAxialLayer8_8 … logicalMdcAxialLayer19_ logicalMdcStereoLayer20_20 … logicalMdcStereoLayer35_35 logicalMdcAxialLayer36_0_36 … logicalMdcAxialLayer42_1_49 logicalMdcSegment66_50 … logicalMdcSegment1_179 180 children, including 24 stereo layers, 25 axial layers and 130 segments. Segments are not displayed. Each layer has several replicas (wires). Layer-Replica, two-tier structure.

7 logicalTof_1 logicalTof_1 logicalEcTofEast_0 logicalBucketEc_0 logicalPVFEcEast_1 … logicalBucketEc_94 logicalPVFEcEast_ logicalEcTofWest_1 … logicalBrTof_2 logicalBucketBr2_0 logicalBucketBr2_1 logicalPVFBr2_2 … logicalBucketBr1_525 logicalBucketBr1_526 logicalPVFBr1_527 Each Endcap has 48 buckets and 48 PVFs. Barrel has 176 PVFs and 352 buckets, which spread in 2 layers, i.e., each Barrel layer has 88 PVFs and 176 buckets. Buckets are not displayed. Each PVF contains a scin (scintillation), and the scin will be drawn. Part-Layer-Scin, three-tier structure.

8 logicalEMC_2 logicalEMC_2 logicalEndWorld_0 logicalEndPhi2_0 … logicalEndPhi0_15 logicalEndWorld_1 … logicalBSCWorld_2 gears,rings,bars logicalBSCPhi_189 … logicalBSCPhi_308 Each Endcap has 16 children, which represent 16 sectors of EC. Each sector has several casing child nodes. There is a function to compute theta, phi of each Endcap casing. Sector-Casing → Phi-Theta. Barrel has 120 phi child nodes. For each phi node, the casing child node whose name contains “logicalBSCCasing” (theta nodes) will be drawn. Other nodes are not displayed. Part-Phi-Theta, three-tier structure.

9 logicalMuc_3 lMucP*S*G* nodes represent gaps.
logicalMuc_3 lMucP0S0G0_0 … lMucP2S3G7_135 lMucP0S0Ab0_136 … lMucP2S3Ab8_279 volumeSmallBlockGap0SB0_280 … volumeSmallBlockGap8SB1_423 lMucP*S*G* nodes represent gaps. P: part S: segment G: gap lMucP*S*Ab* nodes represent absorbers. Absorbers are not displayed, we just need their size information. Ab: absorber VolumeSmallBlockGap*SB* nodes are not displayed. SB: small block

10 logicalMuc_3 gaps and strips
lMucP0S0G0−lMucP0S0G0Al−lMucP0S0G0SP lMucP0S0G0s000_0 … lMucP0S0G0s063_63 P: part S: segment G: gap s: strip Endcap has 8 gaps, and Barrel has 9 gaps. Each gap has several strips. Barrel gap: 48 strips; EC gap: 64 strips. A strip is perpendicular to its neighbor strip. Part-Segment-Gap-Strip, four-tier structure.

11 2 user-defined geometry classes
BesPolygon2D Constructor parameters: points number, points’ coordinates array. The coordinate of input point is World Coordinate(3D), and it can be convert to Pixel Coordinate(2D) automatically. Including an algorithm of deciding whether a point is in this polygon. BesCircle2D Constructor parameters: inner radius, outer radius, center coordinate. Dividing circle into several sectors. The default dividing number is 40. Using a quadrilateral to approach each sector.

12 Process of drawing detectors
Load detector geometry ROOT file. Parse geometry file, get all necessary nodes and fill them into several arrays. For each node in step 2, get out the geometry data of this node. And then, construct geometry shapes using ROOT geometry classes. Convert World Coordinates to Pixel Coordinates. Draw detectors onto the canvas on demand.

13 判断一点是否在多边形内的算法 BesPolygon2D类目前使用的算法如下: 该算法存在的问题 输入:待检测点坐标P(x,y)
首先找出多边形的中心C(各个顶点坐标取平均值); 对多边形的每条边,检测P与C是否在这条边的同一侧: 如果存在一条边,P与C不在这条边的同一侧,则P位于多边形外; 如果对所有边,P与C都在同一侧,则P位于多边形内. 该算法存在的问题 对凹多边形可能会得到错误的结果,因为凹多边形的中心可能在多边形外 部.

14 判断一点是否在多边形内的算法 射线法 由待检测点P向任意方向作射线,若射线与多边形的边的交点个数为奇数, 则P在多边形内;为偶数,P在多边形外. 若射线恰好经过多边形的某一个或某几个顶点,则任意选取射线的一侧, 对于射线经过的顶点的两条边,只计数该侧的边与射线的交点. P P

15 判断一点是否在多边形内的算法 弧长法 规定边的左侧为多边形内部的方向为多边形的正向.
以待检测点P为圆心作单位圆,将多边形的全部有向边向单位圆作径向投 影,计算其在单位圆上弧长的代数和: 代数和为0,P在多边形外部; 代数和为2π,P在多边形内部. A B C D E P P

16 Reference 孙家广,胡事民. 计算机图形学基础教程[M]. 第2版. 北京: 清华大学 出版社, 2009, 48~50.


Download ppt "Detector Drawing in Besvis"

Similar presentations


Ads by Google