Back to home page

EIC code displayed by LXR

 
 

    


Warning, /drich-dev/math/mirror-coords.nb is written in an unsupported language. File is not indexed.

0001 (* Content-type: application/vnd.wolfram.mathematica *)
0002 
0003 (*** Wolfram Notebook File ***)
0004 (* http://www.wolfram.com/nb *)
0005 
0006 (* CreatedBy='Mathematica 12.0' *)
0007 
0008 (*CacheID: 234*)
0009 (* Internal cache information:
0010 NotebookFileLineBreakTest
0011 NotebookFileLineBreakTest
0012 NotebookDataPosition[       158,          7]
0013 NotebookDataLength[     14138,        359]
0014 NotebookOptionsPosition[     12498,        325]
0015 NotebookOutlinePosition[     12831,        340]
0016 CellTagsIndexPosition[     12788,        337]
0017 WindowFrame->Normal*)
0018 
0019 (* Beginning of Notebook Content *)
0020 Notebook[{
0021 Cell[BoxData[
0022  RowBox[{"(*", " ", "\[IndentingNewLine]", 
0023   RowBox[{
0024    RowBox[{"Given", " ", "mirror", " ", "parameters", " ", 
0025     RowBox[{"(", 
0026      RowBox[{"center", ",", "radius"}], ")"}]}], ",", " ", 
0027    RowBox[{
0028    "determine", " ", "the", " ", "parameters", " ", "used", " ", "in", " ", 
0029     "the", " ", "compact", " ", "XML", " ", "file"}], ",", " ", 
0030    RowBox[{
0031    "the", " ", "backplane", " ", "distance", " ", "and", " ", "focus", " ", 
0032     RowBox[{"tunes", ".", " ", "This"}], " ", "notebook", " ", "can", " ", 
0033     "be", " ", "used", " ", "to", " ", "convert", " ", "mirror", " ", 
0034     "prameters", " ", "from", " ", "the", " ", "Geant4", " ", "text", " ", 
0035     "file", " ", "to", " ", "the", " ", "parameters", " ", "used", " ", "in", 
0036     " ", 
0037     RowBox[{"DD4hep", "."}]}]}], "\[IndentingNewLine]", "*)"}]], "Input",
0038  CellChangeTimes->{{3.861494347534471*^9, 3.861494520842074*^9}},
0039  CellLabel->"In[1]:=",ExpressionUUID->"a51436c4-7b1f-4984-ac4f-adc553a99fba"],
0040 
0041 Cell[CellGroupData[{
0042 
0043 Cell[BoxData[
0044  RowBox[{
0045   RowBox[{"(*", " ", 
0046    RowBox[{
0047     RowBox[{"tank", " ", "params"}], ",", " ", 
0048     RowBox[{"w", ".", "r", ".", "t", ".", " ", "IP"}]}], " ", "*)"}], 
0049   "\[IndentingNewLine]", 
0050   RowBox[{
0051    RowBox[{
0052     RowBox[{"zMax", "=", "280"}], ";"}], "\[IndentingNewLine]", 
0053    RowBox[{
0054     RowBox[{"tankLength", " ", "=", "80"}], ";"}], "\[IndentingNewLine]", 
0055    RowBox[{"(*", " ", 
0056     RowBox[{
0057      RowBox[{"mirror", " ", "params"}], ",", " ", 
0058      RowBox[{"defined", " ", 
0059       RowBox[{"w", ".", "r", ".", "t", ".", " ", "IP"}], 
0060       "\[IndentingNewLine]", "*", " ", 
0061       RowBox[{"note", ":", " ", 
0062        RowBox[{"in", " ", "the", " ", "G4", " ", "text", " ", "file"}]}]}], 
0063      ",", " ", 
0064      RowBox[{"coords", " ", "are", " ", 
0065       RowBox[{"w", ".", "r", ".", "t", ".", " ", "centerZ"}], " ", "of", " ", 
0066       "tank"}]}], "\[IndentingNewLine]", "*)"}], "\[IndentingNewLine]", 
0067    RowBox[{
0068     RowBox[{"tankCenterZ", " ", "=", " ", 
0069      RowBox[{"zMax", "-", 
0070       RowBox[{"tankLength", "/", "2"}]}]}], ";"}], "\[IndentingNewLine]", 
0071    RowBox[{
0072     RowBox[{"zM", "=", 
0073      RowBox[{
0074       RowBox[{"-", "160.81"}], "+", "tankCenterZ"}]}], ";"}], 
0075    "\[IndentingNewLine]", 
0076    RowBox[{
0077     RowBox[{"xM", "=", "125"}], ";"}], " ", "\[IndentingNewLine]", 
0078    RowBox[{
0079     RowBox[{"rM", "=", "200"}], ";"}], "\[IndentingNewLine]", 
0080    RowBox[{"Print", "[", 
0081     RowBox[{"\"\<mirror {z,x,r} = \>\"", ",", 
0082      RowBox[{"List", "[", 
0083       RowBox[{"zM", ",", "xM", ",", "rM"}], "]"}]}], "]"}]}]}]], "Input",
0084  CellChangeTimes->{{3.861463012843894*^9, 3.861463059769834*^9}, {
0085    3.8614895734851418`*^9, 3.861489636505905*^9}, {3.861489689575306*^9, 
0086    3.861489803771747*^9}, {3.861490007827812*^9, 3.861490050394231*^9}, {
0087    3.861490211086515*^9, 3.861490320298542*^9}, 3.861490352388782*^9, {
0088    3.861490887566338*^9, 3.861490959519855*^9}, {3.86149099191861*^9, 
0089    3.861490996375588*^9}},
0090  CellLabel->"In[2]:=",ExpressionUUID->"c9d1d621-e864-4bdd-baef-7cc3c6d925c8"],
0091 
0092 Cell[BoxData[
0093  InterpretationBox[
0094   RowBox[{"\<\"mirror {z,x,r} = \"\>", "\[InvisibleSpace]", 
0095    RowBox[{"{", 
0096     RowBox[{"79.19`", ",", "125", ",", "200"}], "}"}]}],
0097   SequenceForm["mirror {z,x,r} = ", {79.19, 125, 200}],
0098   Editable->False]], "Print",
0099  CellChangeTimes->{{3.8614909540589247`*^9, 3.861491019381546*^9}, 
0100    3.861493943671361*^9, 3.86149452950174*^9},
0101  CellLabel->
0102   "During evaluation of \
0103 In[2]:=",ExpressionUUID->"d65c01d0-fe1f-4536-a954-4ea5e6f80b88"]
0104 }, Open  ]],
0105 
0106 Cell[BoxData["\[IndentingNewLine]"], "Input",
0107  CellChangeTimes->{
0108   3.861490971472043*^9},ExpressionUUID->"c629c846-d118-4d33-a4b3-\
0109 7de879e39ae6"],
0110 
0111 Cell[BoxData[
0112  RowBox[{
0113   RowBox[{"(*", " ", 
0114    RowBox[{"short", " ", "snout", " ", "option"}], " ", "*)"}], 
0115   "\[IndentingNewLine]", 
0116   RowBox[{
0117    RowBox[{"snoutLength", "=", "4"}], ";"}]}]], "Input",
0118  CellChangeTimes->{{3.861490371565455*^9, 3.861490373471784*^9}, {
0119   3.86149046152925*^9, 3.86149048550126*^9}},
0120  CellLabel->"In[9]:=",ExpressionUUID->"502310b7-36ae-4088-a3e4-a1a44a7994f1"],
0121 
0122 Cell[BoxData[
0123  RowBox[{
0124   RowBox[{"(*", " ", 
0125    RowBox[{"long", " ", "snout", " ", "option"}], " ", "*)"}], 
0126   "\[IndentingNewLine]", 
0127   RowBox[{
0128    RowBox[{"snoutLength", "=", "20"}], ";"}]}]], "Input",
0129  CellChangeTimes->{{3.861490378374062*^9, 3.861490390780574*^9}, 
0130    3.861490467693169*^9, 3.8614905934975967`*^9, 3.861490966494294*^9},
0131  CellLabel->"In[10]:=",ExpressionUUID->"39826910-c8e7-4254-855d-af6c1e767319"],
0132 
0133 Cell[BoxData["\[IndentingNewLine]"], "Input",
0134  CellChangeTimes->{
0135   3.861490973868333*^9},ExpressionUUID->"c8892de8-a634-41d2-b4a5-\
0136 d4f335140f21"],
0137 
0138 Cell[CellGroupData[{
0139 
0140 Cell[BoxData[
0141  RowBox[{
0142   RowBox[{"(*", " ", 
0143    RowBox[{
0144     RowBox[{"sensor", " ", "sphere", " ", "params"}], ",", " ", 
0145     RowBox[{"from", " ", "compact", " ", "XML", " ", "file"}], ",", " ", 
0146     RowBox[{"defined", " ", 
0147      RowBox[{"w", ".", "r", ".", "t", ".", " ", "vessel"}], " ", "front", " ",
0148       "plane", " ", 
0149      RowBox[{"(", "zMin", ")"}]}]}], " ", "*)"}], "\[IndentingNewLine]", 
0150   RowBox[{
0151    RowBox[{
0152     RowBox[{"zMin", "=", 
0153      RowBox[{"zMax", "-", "tankLength", "-", "snoutLength"}]}], ";"}], 
0154    "\[IndentingNewLine]", 
0155    RowBox[{
0156     RowBox[{"zSxml", "=", 
0157      RowBox[{
0158       RowBox[{"-", "168.07"}], "+", "snoutLength", "+", 
0159       RowBox[{"tankLength", "/", "2"}]}]}], ";"}], "\[IndentingNewLine]", 
0160    RowBox[{
0161     RowBox[{"xSxml", "=", "124.98"}], ";"}], "\[IndentingNewLine]", 
0162    RowBox[{"Print", "[", 
0163     RowBox[{"\"\<snoutLength = \>\"", ",", "snoutLength"}], "]"}], 
0164    "\[IndentingNewLine]", 
0165    RowBox[{"Print", "[", 
0166     RowBox[{"\"\<zMin = \>\"", ",", "zMin"}], "]"}], "\[IndentingNewLine]", 
0167    RowBox[{"Print", "[", 
0168     RowBox[{"\"\<sensor sphere center {z,x} = \>\"", ",", 
0169      RowBox[{"List", "[", 
0170       RowBox[{"zSxml", ",", "xSxml"}], "]"}]}], "]"}]}]}]], "Input",
0171  CellChangeTimes->{{3.86146281569676*^9, 3.8614630066260023`*^9}, {
0172   3.8614630713901567`*^9, 3.861463088250355*^9}, {3.8614900598765917`*^9, 
0173   3.86149006085793*^9}, {3.8614902493362017`*^9, 3.86149025005215*^9}, {
0174   3.8614903473168573`*^9, 3.86149037024512*^9}, {3.8614904085972767`*^9, 
0175   3.861490447765874*^9}, {3.861490518400798*^9, 3.861490562774126*^9}, {
0176   3.86149061066783*^9, 3.8614906914917297`*^9}, {3.861490818767581*^9, 
0177   3.86149085505558*^9}, {3.8614910309419403`*^9, 3.8614910446693287`*^9}},
0178  CellLabel->"In[11]:=",ExpressionUUID->"cc1750a3-9903-48b7-868c-425c57eddaa7"],
0179 
0180 Cell[CellGroupData[{
0181 
0182 Cell[BoxData[
0183  InterpretationBox[
0184   RowBox[{"\<\"snoutLength = \"\>", "\[InvisibleSpace]", "20"}],
0185   SequenceForm["snoutLength = ", 20],
0186   Editable->False]], "Print",
0187  CellChangeTimes->{
0188   3.861490563647402*^9, {3.861490674398841*^9, 3.8614906928989563`*^9}, {
0189    3.861490857351366*^9, 3.861490874964965*^9}, 3.861491045536024*^9, {
0190    3.861493953938398*^9, 3.861493971655673*^9}, 3.861494535618882*^9},
0191  CellLabel->
0192   "During evaluation of \
0193 In[11]:=",ExpressionUUID->"bb82086f-14ae-4137-981c-d6a1258871ac"],
0194 
0195 Cell[BoxData[
0196  InterpretationBox[
0197   RowBox[{"\<\"zMin = \"\>", "\[InvisibleSpace]", "180"}],
0198   SequenceForm["zMin = ", 180],
0199   Editable->False]], "Print",
0200  CellChangeTimes->{
0201   3.861490563647402*^9, {3.861490674398841*^9, 3.8614906928989563`*^9}, {
0202    3.861490857351366*^9, 3.861490874964965*^9}, 3.861491045536024*^9, {
0203    3.861493953938398*^9, 3.861493971655673*^9}, 3.8614945356238117`*^9},
0204  CellLabel->
0205   "During evaluation of \
0206 In[11]:=",ExpressionUUID->"a3adb6f6-f9a0-4421-b8f0-7267746efede"],
0207 
0208 Cell[BoxData[
0209  InterpretationBox[
0210   RowBox[{"\<\"sensor sphere center {z,x} = \"\>", "\[InvisibleSpace]", 
0211    RowBox[{"{", 
0212     RowBox[{
0213      RowBox[{"-", "108.07`"}], ",", "124.98`"}], "}"}]}],
0214   SequenceForm["sensor sphere center {z,x} = ", {-108.07, 124.98}],
0215   Editable->False]], "Print",
0216  CellChangeTimes->{
0217   3.861490563647402*^9, {3.861490674398841*^9, 3.8614906928989563`*^9}, {
0218    3.861490857351366*^9, 3.861490874964965*^9}, 3.861491045536024*^9, {
0219    3.861493953938398*^9, 3.861493971655673*^9}, 3.861494535630763*^9},
0220  CellLabel->
0221   "During evaluation of \
0222 In[11]:=",ExpressionUUID->"1635b331-7148-4499-a594-abbaa2cca3d1"]
0223 }, Open  ]]
0224 }, Open  ]],
0225 
0226 Cell[BoxData["\[IndentingNewLine]"], "Input",
0227  CellChangeTimes->{
0228   3.861491070773233*^9},ExpressionUUID->"6c4508a0-6dbb-4203-b00c-\
0229 6d0d6843550b"],
0230 
0231 Cell[CellGroupData[{
0232 
0233 Cell[BoxData[
0234  RowBox[{
0235   RowBox[{"(*", " ", 
0236    RowBox[{
0237    "convert", " ", "compact", " ", "XML", " ", "params", " ", "to", " ", 
0238     "coords", " ", "that", " ", "are", " ", "defined", " ", 
0239     RowBox[{"w", ".", "r", ".", "t", ".", " ", "IP"}]}], " ", "*)"}], 
0240   "\[IndentingNewLine]", 
0241   RowBox[{
0242    RowBox[{
0243     RowBox[{"zS", "=", 
0244      RowBox[{"zSxml", "+", "zMin"}]}], ";"}], "\[IndentingNewLine]", 
0245    RowBox[{
0246     RowBox[{"xS", "=", "xSxml"}], ";"}], "\[IndentingNewLine]", 
0247    RowBox[{
0248     RowBox[{"b", "=", 
0249      RowBox[{"zMax", "-", "bXml"}]}], ";"}], "\[IndentingNewLine]", 
0250    RowBox[{"(*", " ", 
0251     RowBox[{
0252      RowBox[{"focal", " ", "point"}], " ", "=", " ", 
0253      RowBox[{
0254       RowBox[{"sensor", " ", "sphere", " ", "center"}], " ", "+", " ", 
0255       RowBox[{"focus", " ", "tune"}]}]}], " ", "*)"}], "\[IndentingNewLine]", 
0256    
0257    RowBox[{
0258     RowBox[{"zF", "=", 
0259      RowBox[{"zS", "+", "zT"}]}], ";"}], "\[IndentingNewLine]", 
0260    RowBox[{
0261     RowBox[{"xF", "=", 
0262      RowBox[{"xS", "+", "xT"}]}], ";"}], "\[IndentingNewLine]", 
0263    RowBox[{"(*", " ", 
0264     RowBox[{
0265      RowBox[{"invert", " ", "FocusMirror", " ", "function"}], ",", " ", 
0266      RowBox[{
0267       RowBox[{"determining", " ", "compact", " ", "XML", " ", 
0268        RowBox[{"params", ":", "\[IndentingNewLine]", "  ", 
0269         RowBox[{"'", 
0270          RowBox[{"backplane", "'"}]}]}]}], " ", "=", " ", 
0271       RowBox[{
0272        RowBox[{
0273         RowBox[{"`bXml`", "\[IndentingNewLine]", " ", "'"}], "focus_tune", 
0274         RowBox[{"_x", "'"}]}], " ", "=", " ", 
0275        RowBox[{
0276         RowBox[{
0277          RowBox[{"`xT`", "\[IndentingNewLine]", "'"}], "focus_tune", 
0278          RowBox[{"_z", "'"}]}], " ", "=", " ", "`zT`"}]}]}]}], 
0279     "\[IndentingNewLine]", "*)"}], "\[IndentingNewLine]", 
0280    RowBox[{"NSolve", "[", "\[IndentingNewLine]", 
0281     RowBox[{
0282      RowBox[{
0283       RowBox[{"zM", "\[Equal]", 
0284        RowBox[{"b", "*", 
0285         RowBox[{"zF", "/", 
0286          RowBox[{"(", 
0287           RowBox[{
0288            RowBox[{"2", "*", "b"}], "-", "zF"}], ")"}]}]}]}], " ", "&&", 
0289       "\[IndentingNewLine]", 
0290       RowBox[{"xM", "\[Equal]", 
0291        RowBox[{"b", "*", 
0292         RowBox[{"xF", "/", 
0293          RowBox[{"(", 
0294           RowBox[{
0295            RowBox[{"2", "*", "b"}], "-", "zF"}], ")"}]}]}]}], " ", "&&", 
0296       "\[IndentingNewLine]", 
0297       RowBox[{"rM", "\[Equal]", 
0298        RowBox[{"b", "-", "zM"}]}]}], ",", "\[IndentingNewLine]", 
0299      RowBox[{"{", 
0300       RowBox[{"zT", ",", "xT", ",", "bXml"}], "}"}]}], "\[IndentingNewLine]", 
0301     "]"}]}]}]], "Input",
0302  CellChangeTimes->{{3.86146204136735*^9, 3.861462311186831*^9}, {
0303    3.8614623435312233`*^9, 3.861462464900182*^9}, {3.861462730385789*^9, 
0304    3.86146275928404*^9}, {3.861462810579749*^9, 3.861462813655353*^9}, 
0305    3.861463100799062*^9, {3.861491107370513*^9, 3.861491107655604*^9}, {
0306    3.8614911455849*^9, 3.861491300910008*^9}, {3.861491812751473*^9, 
0307    3.861491836453175*^9}},
0308  CellLabel->"In[17]:=",ExpressionUUID->"4ae4814c-dbe0-4e32-b2c5-d6b3f8a8c0e5"],
0309 
0310 Cell[BoxData[
0311  RowBox[{"{", 
0312   RowBox[{"{", 
0313    RowBox[{
0314     RowBox[{"bXml", "\[Rule]", "0.8100000000000023`"}], ",", 
0315     RowBox[{"zT", "\[Rule]", "51.453314359060215`"}], ",", 
0316     RowBox[{"xT", "\[Rule]", "69.77835705117468`"}]}], "}"}], "}"}]], "Output",\
0317 
0318  CellChangeTimes->{
0319   3.861462173760985*^9, 3.861462761161839*^9, {3.861463075107874*^9, 
0320    3.8614631017595654`*^9}, 3.861489820757105*^9, 3.8614912732212*^9, 
0321    3.8614917924203453`*^9, 3.861491837616551*^9, {3.861493958092032*^9, 
0322    3.861493973837943*^9}, 3.8614945374527073`*^9},
0323  CellLabel->"Out[22]=",ExpressionUUID->"8f23bc0a-58e1-47f5-b709-3fb0b9a3e908"]
0324 }, Open  ]]
0325 },
0326 WindowSize->{794, 806},
0327 WindowMargins->{{3, Automatic}, {28, Automatic}},
0328 FrontEndVersion->"12.0 for Linux x86 (64-bit) (April 8, 2019)",
0329 StyleDefinitions->"Default.nb"
0330 ]
0331 (* End of Notebook Content *)
0332 
0333 (* Internal cache information *)
0334 (*CellTagsOutline
0335 CellTagsIndex->{}
0336 *)
0337 (*CellTagsIndex
0338 CellTagsIndex->{}
0339 *)
0340 (*NotebookFileOutline
0341 Notebook[{
0342 Cell[558, 20, 979, 18, 184, "Input",ExpressionUUID->"a51436c4-7b1f-4984-ac4f-adc553a99fba"],
0343 Cell[CellGroupData[{
0344 Cell[1562, 42, 2000, 47, 284, "Input",ExpressionUUID->"c9d1d621-e864-4bdd-baef-7cc3c6d925c8"],
0345 Cell[3565, 91, 473, 11, 26, "Print",ExpressionUUID->"d65c01d0-fe1f-4536-a954-4ea5e6f80b88"]
0346 }, Open  ]],
0347 Cell[4053, 105, 147, 3, 59, "Input",ExpressionUUID->"c629c846-d118-4d33-a4b3-7de879e39ae6"],
0348 Cell[4203, 110, 395, 9, 59, "Input",ExpressionUUID->"502310b7-36ae-4088-a3e4-a1a44a7994f1"],
0349 Cell[4601, 121, 421, 9, 59, "Input",ExpressionUUID->"39826910-c8e7-4254-855d-af6c1e767319"],
0350 Cell[5025, 132, 147, 3, 59, "Input",ExpressionUUID->"c8892de8-a634-41d2-b4a5-d4f335140f21"],
0351 Cell[CellGroupData[{
0352 Cell[5197, 139, 1807, 38, 209, "Input",ExpressionUUID->"cc1750a3-9903-48b7-868c-425c57eddaa7"],
0353 Cell[CellGroupData[{
0354 Cell[7029, 181, 508, 11, 26, "Print",ExpressionUUID->"bb82086f-14ae-4137-981c-d6a1258871ac"],
0355 Cell[7540, 194, 498, 11, 26, "Print",ExpressionUUID->"a3adb6f6-f9a0-4421-b8f0-7267746efede"],
0356 Cell[8041, 207, 634, 14, 26, "Print",ExpressionUUID->"1635b331-7148-4499-a594-abbaa2cca3d1"]
0357 }, Open  ]]
0358 }, Open  ]],
0359 Cell[8702, 225, 147, 3, 59, "Input",ExpressionUUID->"6c4508a0-6dbb-4203-b00c-6d0d6843550b"],
0360 Cell[CellGroupData[{
0361 Cell[8874, 232, 2981, 75, 459, "Input",ExpressionUUID->"4ae4814c-dbe0-4e32-b2c5-d6b3f8a8c0e5"],
0362 Cell[11858, 309, 624, 13, 94, "Output",ExpressionUUID->"8f23bc0a-58e1-47f5-b709-3fb0b9a3e908"]
0363 }, Open  ]]
0364 }
0365 ]
0366 *)
0367