From 4bf7f5c31f0fe035acf99c174e945f072a7a3538 Mon Sep 17 00:00:00 2001 From: Pere Mato Date: Tue, 9 Apr 2024 17:03:09 +0200 Subject: [PATCH] Initial commit --- .github/workflows/jupyterbook.yml | 51 ++ LICENSE | 516 ++++++++++++++---- Project.toml | 3 + README.md | 16 +- tutorial/README.md | 9 + tutorial/docs/DetectorB1.jl | 94 ++++ tutorial/docs/_config.yml | 41 ++ tutorial/docs/_toc.yml | 16 + tutorial/docs/assets/hsf_logo_angled.png | Bin 0 -> 14308 bytes .../docs/examples/30_cm_bubble_chamber.jpg | Bin 0 -> 31004 bytes tutorial/docs/examples/DetectorHBC30.jl | 70 +++ tutorial/docs/examples/HBC30.ipynb | 308 +++++++++++ tutorial/docs/geant4-jl-applications.ipynb | 165 ++++++ tutorial/docs/geant4-jl-intro.ipynb | 463 ++++++++++++++++ tutorial/docs/intro.md | 22 + tutorial/environment.yml | 12 + 16 files changed, 1663 insertions(+), 123 deletions(-) create mode 100644 .github/workflows/jupyterbook.yml create mode 100644 Project.toml create mode 100644 tutorial/README.md create mode 100644 tutorial/docs/DetectorB1.jl create mode 100644 tutorial/docs/_config.yml create mode 100644 tutorial/docs/_toc.yml create mode 100644 tutorial/docs/assets/hsf_logo_angled.png create mode 100644 tutorial/docs/examples/30_cm_bubble_chamber.jpg create mode 100644 tutorial/docs/examples/DetectorHBC30.jl create mode 100644 tutorial/docs/examples/HBC30.ipynb create mode 100644 tutorial/docs/geant4-jl-applications.ipynb create mode 100644 tutorial/docs/geant4-jl-intro.ipynb create mode 100644 tutorial/docs/intro.md create mode 100644 tutorial/environment.yml diff --git a/.github/workflows/jupyterbook.yml b/.github/workflows/jupyterbook.yml new file mode 100644 index 0000000..a50b523 --- /dev/null +++ b/.github/workflows/jupyterbook.yml @@ -0,0 +1,51 @@ +name: deploy-book +on: + pull_request: + branches: + - main + push: + branches: + - main + +# This job installs dependencies, builds the book, and pushes it to `gh-pages` +jobs: + deploy-book: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./julia-intro + shell: bash -l {0} + + steps: + - uses: actions/checkout@v4 + # Install dependencies + - name: Set up MiniConda + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: ./julia-intro/environment.yml + init-shell: bash powershell + cache-environment: true + + - name: Set up Julia + uses: julia-actions/setup-julia@v1 + + - uses: julia-actions/cache@v1 + - uses: julia-actions/julia-buildpkg@v1 + + + - name: Build the book + run: | + jupyter-book build ./docs + + # Push the book's HTML to github-pages + - name: GitHub Pages action + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./geant4.jl/docs/_build/html + if: github.event_name != 'pull_request' + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./julia-intro/docs/_build/html + if: github.event_name == 'pull_request' diff --git a/LICENSE b/LICENSE index 0e259d4..4ea99c2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,121 +1,395 @@ -Creative Commons Legal Code - -CC0 1.0 Universal - - CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE - LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN - ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS - INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES - REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS - PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM - THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED - HEREUNDER. - -Statement of Purpose - -The laws of most jurisdictions throughout the world automatically confer -exclusive Copyright and Related Rights (defined below) upon the creator -and subsequent owner(s) (each and all, an "owner") of an original work of -authorship and/or a database (each, a "Work"). - -Certain owners wish to permanently relinquish those rights to a Work for -the purpose of contributing to a commons of creative, cultural and -scientific works ("Commons") that the public can reliably and without fear -of later claims of infringement build upon, modify, incorporate in other -works, reuse and redistribute as freely as possible in any form whatsoever -and for any purposes, including without limitation commercial purposes. -These owners may contribute to the Commons to promote the ideal of a free -culture and the further production of creative, cultural and scientific -works, or to gain reputation or greater distribution for their Work in -part through the use and efforts of others. - -For these and/or other purposes and motivations, and without any -expectation of additional consideration or compensation, the person -associating CC0 with a Work (the "Affirmer"), to the extent that he or she -is an owner of Copyright and Related Rights in the Work, voluntarily -elects to apply CC0 to the Work and publicly distribute the Work under its -terms, with knowledge of his or her Copyright and Related Rights in the -Work and the meaning and intended legal effect of CC0 on those rights. - -1. Copyright and Related Rights. A Work made available under CC0 may be -protected by copyright and related or neighboring rights ("Copyright and -Related Rights"). Copyright and Related Rights include, but are not -limited to, the following: - - i. the right to reproduce, adapt, distribute, perform, display, - communicate, and translate a Work; - ii. moral rights retained by the original author(s) and/or performer(s); -iii. publicity and privacy rights pertaining to a person's image or - likeness depicted in a Work; - iv. rights protecting against unfair competition in regards to a Work, - subject to the limitations in paragraph 4(a), below; - v. rights protecting the extraction, dissemination, use and reuse of data - in a Work; - vi. database rights (such as those arising under Directive 96/9/EC of the - European Parliament and of the Council of 11 March 1996 on the legal - protection of databases, and under any national implementation - thereof, including any amended or successor version of such - directive); and -vii. other similar, equivalent or corresponding rights throughout the - world based on applicable law or treaty, and any national - implementations thereof. - -2. Waiver. To the greatest extent permitted by, but not in contravention -of, applicable law, Affirmer hereby overtly, fully, permanently, -irrevocably and unconditionally waives, abandons, and surrenders all of -Affirmer's Copyright and Related Rights and associated claims and causes -of action, whether now known or unknown (including existing as well as -future claims and causes of action), in the Work (i) in all territories -worldwide, (ii) for the maximum duration provided by applicable law or -treaty (including future time extensions), (iii) in any current or future -medium and for any number of copies, and (iv) for any purpose whatsoever, -including without limitation commercial, advertising or promotional -purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each -member of the public at large and to the detriment of Affirmer's heirs and -successors, fully intending that such Waiver shall not be subject to -revocation, rescission, cancellation, termination, or any other legal or -equitable action to disrupt the quiet enjoyment of the Work by the public -as contemplated by Affirmer's express Statement of Purpose. - -3. Public License Fallback. Should any part of the Waiver for any reason -be judged legally invalid or ineffective under applicable law, then the -Waiver shall be preserved to the maximum extent permitted taking into -account Affirmer's express Statement of Purpose. In addition, to the -extent the Waiver is so judged Affirmer hereby grants to each affected -person a royalty-free, non transferable, non sublicensable, non exclusive, -irrevocable and unconditional license to exercise Affirmer's Copyright and -Related Rights in the Work (i) in all territories worldwide, (ii) for the -maximum duration provided by applicable law or treaty (including future -time extensions), (iii) in any current or future medium and for any number -of copies, and (iv) for any purpose whatsoever, including without -limitation commercial, advertising or promotional purposes (the -"License"). The License shall be deemed effective as of the date CC0 was -applied by Affirmer to the Work. Should any part of the License for any -reason be judged legally invalid or ineffective under applicable law, such -partial invalidity or ineffectiveness shall not invalidate the remainder -of the License, and in such case Affirmer hereby affirms that he or she -will not (i) exercise any of his or her remaining Copyright and Related -Rights in the Work or (ii) assert any associated claims and causes of -action with respect to the Work, in either case contrary to Affirmer's -express Statement of Purpose. - -4. Limitations and Disclaimers. - - a. No trademark or patent rights held by Affirmer are waived, abandoned, - surrendered, licensed or otherwise affected by this document. - b. Affirmer offers the Work as-is and makes no representations or - warranties of any kind concerning the Work, express, implied, - statutory or otherwise, including without limitation warranties of - title, merchantability, fitness for a particular purpose, non - infringement, or the absence of latent or other defects, accuracy, or - the present or absence of errors, whether or not discoverable, all to - the greatest extent permissible under applicable law. - c. Affirmer disclaims responsibility for clearing rights of other persons - that may apply to the Work or any use thereof, including without - limitation any person's Copyright and Related Rights in the Work. - Further, Affirmer disclaims responsibility for obtaining any necessary - consents, permissions or other rights required for any use of the - Work. - d. Affirmer understands and acknowledges that Creative Commons is not a - party to this document and has no duty or obligation with respect to - this CC0 or use of the Work. +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/Project.toml b/Project.toml new file mode 100644 index 0000000..8fafff0 --- /dev/null +++ b/Project.toml @@ -0,0 +1,3 @@ +[deps] +Geant4 = "559df036-b7a0-42fd-85df-7d5dd9d70f44" +IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a" diff --git a/README.md b/README.md index ed5f7e3..0dbd386 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,14 @@ -# Geant4-tutorial -Tutorial for Geant4.jl +# Geant4.jl-tutorial +Materials for the Geant4.jl Tutorial. + +Read the rendered Jupyter book: https://juliahep.github.io/JuliaHEP-2023/ + +Follow the tutorial with Binder: +[![Binder](https://binderhub.ssl-hep.org/badge_logo.svg)](https://binderhub.ssl-hep.org/v2/gh/JuliaHEP/JuliaHEP-2023/HEAD?labpath=julia-intro%2Fdocs%2Fjulia-intro-intro.ipynb) + +- - - +When not taken from other sources (with its own Copyright and License), this material is: + +Copyright © 2023 CERN and the authors / contributors. + +Licensed under [CC-BY-4.0](./LICENSE). \ No newline at end of file diff --git a/tutorial/README.md b/tutorial/README.md new file mode 100644 index 0000000..46ddcc8 --- /dev/null +++ b/tutorial/README.md @@ -0,0 +1,9 @@ +# An set of tutorials for Geant4.jl + +This is a collection of Jupyter notebooks quickly covering various aspects of the Julia bindings for Geant4. It is assumed some familiarity of Geant4 itself. + +The set of notebooks can also be processed by [Jupyter Book](https://jupyterbook.org/en/stable/intro.html) into a set of web pages. + +- The `environment.yaml` file can be used by conda/mamba to setup the appropriate set of Python packages to do this. + +Licenced CC-BY-4.0, Copyright © 2023 Pere Mato, CERN and other contributors diff --git a/tutorial/docs/DetectorB1.jl b/tutorial/docs/DetectorB1.jl new file mode 100644 index 0000000..3063fd1 --- /dev/null +++ b/tutorial/docs/DetectorB1.jl @@ -0,0 +1,94 @@ +#---Example B1Detector constructor function-------------------------------------------------------- +# It should return a pointer to G4VPhysicalVolume (aka CxxPtr{G4VPhysicalVolume}) +#-------------------------------------------------------------------------------------------------- +function constructB1Detector(::Nothing)::CxxPtr{G4VPhysicalVolume} + + nist = G4NistManager!Instance() + + # Envelope parameters + env_sizeXY = 20cm + env_sizeZ = 30cm + env_mat = FindOrBuildMaterial(nist, "G4_WATER") + + # Option to switch on/off checking of volumes overlaps + checkOverlaps = true + + # World + world_sizeXY = 1.2*env_sizeXY + world_sizeZ = 1.2*env_sizeZ + world_mat = FindOrBuildMaterial(nist, "G4_AIR") + + solidworld = G4Box("World", 0.5 * world_sizeXY, 0.5 * world_sizeXY, 0.5 * world_sizeZ) + logicworld = G4LogicalVolume(solidworld, world_mat, "World") + + physWorld = G4PVPlacement(nothing, # no rotation + G4ThreeVector(), # at (0,0,0) + logicworld, #q its logical volume + "World", # its name + nothing, # its mother volume + false, # no boolean operation + 0, # copy number + checkOverlaps) # overlaps checking + + # Envelope + solidEnv = G4Box("Envelope", 0.5 * env_sizeXY, 0.5 * env_sizeXY, 0.5 * env_sizeZ) + logicEnv = G4LogicalVolume(solidEnv, env_mat, "Envelope") + + G4PVPlacement(nothing, # no rotation + G4ThreeVector(), # at (0,0,0) + logicEnv, # its logical volume + "Envelope", # its name + logicworld, # its mother volume + false, # no boolean operation + 0, # copy number + checkOverlaps) # overlaps checking + # shape 1 + shape1_mat = FindOrBuildMaterial(nist, "G4_A-150_TISSUE") + pos1 = G4ThreeVector(0, 2cm, -7cm) + + # Conical section shape + shape1_rmina = 0cm; shape1_rmaxa = 2cm + shape1_rminb = 0cm; shape1_rmaxb = 4cm + shape1_hz = 3cm + shape1_phimin = 0deg; shape1_phimax = 360deg + + solidShape1 = G4Cons("Shape1", shape1_rmina, shape1_rmaxa, shape1_rminb, shape1_rmaxb, + shape1_hz, shape1_phimin, shape1_phimax) + + logicShape1 = G4LogicalVolume(solidShape1, shape1_mat, "Shape1") + G4PVPlacement(nothing, # no rotation + pos1, # at position + logicShape1, # its logical volume + "Shape1", # its name + logicEnv, # its mother volume + false, # no boolean operation + 0, # copy number + checkOverlaps)# overlaps checking + # Shape 2 + shape2_mat = FindOrBuildMaterial(nist, "G4_BONE_COMPACT_ICRU") + pos2 = G4ThreeVector(0, -1cm, 7cm) + + # Trapezoid shape + shape2_dxa = 12cm; shape2_dxb = 12cm + shape2_dya = 10cm; shape2_dyb = 16cm + shape2_dz = 6cm + solidShape2 = G4Trd("Shape2", 0.5 * shape2_dxa, 0.5 * shape2_dxb, 0.5 * shape2_dya, 0.5 * shape2_dyb, 0.5 * shape2_dz) + logicShape2 = G4LogicalVolume(solidShape2, shape2_mat, "Shape2") + G4PVPlacement(nothing, # no rotation + pos2, # at position + logicShape2, # its logical volume + "Shape2", # its name + logicEnv, # its mother volume + false, # no boolean operation + 0, # copy number + checkOverlaps) # overlaps checking + + # Visualization attributes + SetVisAttributes(logicworld, G4VisAttributes!GetInvisible()) + SetVisAttributes(logicEnv, G4VisAttributes!GetInvisible()) + SetVisAttributes(logicShape1, G4VisAttributes(G4Colour(1.0, 1.0, 0.0))) + SetVisAttributes(logicShape2, G4VisAttributes(G4Colour(0.0, 0.0, 1.0))) + + return physWorld # return a pointer to the G4PhysicalVolume +end + \ No newline at end of file diff --git a/tutorial/docs/_config.yml b/tutorial/docs/_config.yml new file mode 100644 index 0000000..7ee4ebe --- /dev/null +++ b/tutorial/docs/_config.yml @@ -0,0 +1,41 @@ +# Book settings +# Learn more at https://jupyterbook.org/customize/config.html + +title: Geant4.jl Tutorials +author: Pere Mato +copyright: "CERN, The Contributors 2023" +logo: images/juliaheplogo.png + +# Force re-execution of notebooks on each build. +# See https://jupyterbook.org/content/execute.html +execute: + execute_notebooks: force + +# Define the name of the latex output file for PDF builds +latex: + latex_documents: + targetname: Geant4-tutorial.tex + +# Add a bibtex file so that we can create citations +bibtex_bibfiles: + - references.bib + +# Information about where the book exists on the web +repository: + url: https://github.com/peremato/Geant4.jl-tutorial # Online location of your book + path_to_book: tutorial/docs # Optional path to your book, relative to the repository root + branch: main # Which branch of the repository should be used when creating links (optional) + +# Add GitHub buttons to your book +# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository +html: + use_issues_button: true + use_repository_button: true + +# Files in the `assets` subdirectory will be copied into the output directory +# This is used for, e.g.. images that will be inserted through HTML tags in order +# to have finer control over size/placement +sphinx: + config: + html_extra_path: ["assets"] + html_js_files: [ ['https://views.scientific-python.org/js/script.js', {'defer': 'defer', 'data-domain': 'hepsoftwarefoundation.org'}] ] diff --git a/tutorial/docs/_toc.yml b/tutorial/docs/_toc.yml new file mode 100644 index 0000000..3f7dbcc --- /dev/null +++ b/tutorial/docs/_toc.yml @@ -0,0 +1,16 @@ +# Table of contents +# Learn more at https://jupyterbook.org/customize/toc.html + +format: jb-book +root: intro +parts: +- caption: Introduction to Geant4.jl + chapters: + - file: geant4-jl-intro +- caption: Building simulation applications + chapters: + - file: geant4-jl-applications +- caption: Complete examples + chapters: + - file: examples/HBC30 + \ No newline at end of file diff --git a/tutorial/docs/assets/hsf_logo_angled.png b/tutorial/docs/assets/hsf_logo_angled.png new file mode 100644 index 0000000000000000000000000000000000000000..f0b7af0c4bd4f5080e7ec8d037831eda41dca7af GIT binary patch literal 14308 zcmcJ$byOYCvOl_Ug1fr}cL?t88rW#qxVr~7?iw6|LvV-Sx^W3^!GgO(aCv;sJ->7B zyX(ER-aoI`>ZzKVPgQkw_e@Xs^hBzu$f6<2$q8~~_`M}7vuy`NK<%4sMA06rf9fPfGH;PG7)Z~y?fvjYG}#sGjoIskz0l+~s# z^nM}494K$0tPEg$=Me#LQ1AelcMb{w{eHmuHxKpB69N9Q{LTRsposs&YlK?^VE--G zd#C>-x%d1J?!PEZ9@KwZ$%Fn6dN>c}KYYeNYRRf;zuw6QCpleL000^Lp9}@a%pw2) zpn0vefNnr#B>_`MdsdK{qlr1Im%Y@UMvo-)cK{k{N&i(&H*1Uk_T=FD@37tjWc%j|8wV>p+kb4os|x)i6##0OyE@vr z|6^Z-ms99p(Epq8za9OTg6{v5!v7ThZv|BsYxDQm{^fz=-wyt#?0@4W9qpZ5%w1jo zDG|@V@&8lyzwv5Tj&6?c?c!o>D(~QC?((kuZ*Tu6od0*kzikPz{ZqC7qpJU_9sebL zZ%7d&A-4Z?3K66PQ1Wj8fID1XN?gke>eTOpG08xR2RT<8^KXK}fxU=G4w-ry7+b73 z0(~^f-!x-&qD)B%s39aD@e`b$pTDoc)_uQLZIM6>WL8W~7*mmeVAcPIWhM`CvT9gL zMYjV|K%t13>n?C`tv&hiyo654efP7akDrQI z`!qBoO@VicZT-liq*7BB0q%obT?8^jT26-{4=)nHbVZWHkN1$Ro14gu_gHC6`WM=xM~6*$nYQnt4ejMchu0e_*(Ab06blMBX)AMqd}Zc8qwzu#4&c5KN!I zEnG{ZWm$SZkfKmGr9s44095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$3oqW&)Z_D958J~O!fV&zDH*uuLqE2sXMN3gVyFXB zD?6YLV~~O_#gJXXHfE1yVqTrZe^4aFtAeb;rm*3M?+vVw8Fbj_wkP5KINhL7(xXsD z&e#JqJX8rG&@--4RA>`l>SQ(?)CokA4k=?ac0+c}$@WmG2K!1z=U%|T;_3RBJeQ6Z z_GQ#P(tPkMRRcua+yaWChtp~kwJ4acgS53r03+8Z?#wciptr9cVjP0UCY+GN4i4Eg q^A+L52$Ma+Z2ccU`uL+gv%xsC(aILd|M=(MHF;?jscH%1p#KX!_?rO$ literal 0 HcmV?d00001 diff --git a/tutorial/docs/examples/30_cm_bubble_chamber.jpg b/tutorial/docs/examples/30_cm_bubble_chamber.jpg new file mode 100644 index 0000000000000000000000000000000000000000..15110a399100489e488ddd3cd9bcb0c43a4a58e8 GIT binary patch literal 31004 zcmX_HWmH?w(++OMr4*Oot_2DdhXfD7tw<;qC=R8R7PlfH!5snwcPoV=KPXxVQrw-E z;zcSi|1a-7d(Pdtvv+syp4quG&(8i^__qO|0&9V^05~`}xF@(L0KmV$07ES|PZ)=v zcYv=GOo7AI-~W}Lf|!_-HyrNm+>5TAgM0H2VMfRKoYkeHN;l$3;ol#YV(5!GWlM#jf< z3=B-HJnT%&+$;STta-JM})-q1OyKx9sr+!nvjN5f>xD?j?37= zNAi7IBR#hoq_}UI0mvhzZsO?c7lCNvm3At@ZW2G1agI#yKb6&lmTE*b&z$*}4a}bZ zTLKXOZ_MX_J7eK?ID|8pzx5oCO}O1#LtByV%{1Fa>0X>2sj_RztF$)ga0mZw32j93 zCfg==huSOS3k@+6c4@U&Y5%J{zSIboPRZe3k$!khq%BAXt2CfJL4Cp;F0GxYpI$}# zJ;ho3RWbq@M0_;THkF|EtXPtJFHSG+wnQn7U0S=t^`SDLddo!{^}k+Z|2~X4eW4Nh zKyl(d@Dzx(C#X7UAD(b2yC&=EJV+9i_?nBVDe2p&QreQW{wM11(O(`K|F73yLzmDhr);S_;x`NpT}{SY>N@-LK?8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{dq5vc(&fnteByQCI9gYLBID^01uTT6NpR`~ zf`zsbZ%?0gl=QU2da6bI*0$(7k7R5wxYOxG%VepyQWk}H9Yhz>Ck;YLrxFrePhn&9 zgjX`+MNH-zf?~-}0B$xBM_yV?%U2{EpIM61b8TZ|v4#r3I;O_`@be|I3f! GetPostStepPoint |> GetPosition\n", + " auxpoints = step |> GetPointerToVectorOfAuxiliaryPoints\n", + " if auxpoints != C_NULL\n", + " for ap in auxpoints\n", + " push!(tracks[end].points, Point3{Float64}(x(ap),y(ap),z(ap)))\n", + " end\n", + " end\n", + " push!(tracks[end].points, Point3{Float64}(x(p),y(p),z(p)))\n", + " return\n", + "end\n", + "#---Tracking pre-action---------------------------------------------------------------------------- \n", + "function pretrackaction(track::G4Track, app::G4JLApplication)::Nothing\n", + " tracks = getSIMdata(app).tracks\n", + " p = GetPosition(track)[]\n", + " particle = track |> GetParticleDefinition\n", + " name = particle |> GetParticleName |> String\n", + " charge = particle |> GetPDGCharge |> Int\n", + " energy = track |> GetKineticEnergy\n", + " push!(tracks, Track(name, charge, energy, [Point3{Float64}(x(p),y(p),z(p))]))\n", + " return\n", + "end\n", + "#---Tracking post-action---------------------------------------------------------------------------- \n", + "function posttrackaction(track::G4Track, app::G4JLApplication)::Nothing\n", + " data = getSIMdata(app)\n", + " id = track |> GetTrackID\n", + " energy = track |> GetKineticEnergy\n", + " if id == 1 && energy > 0.80 * data.fEkin # primary particle did not losse any energy\n", + " if track |> GetStep |> GetPostStepPoint |> GetPhysicalVolume == C_NULL # Only if outside world\n", + " data.veto = true\n", + " end\n", + " end\n", + " return\n", + "end\n", + "#---Begin-event-action---------------------------------------------------------------------------- \n", + "function beginevent(::G4Event, app::G4JLApplication)::Nothing\n", + " data = getSIMdata(app)\n", + " data.veto = false\n", + " empty!(data.tracks)\n", + " return\n", + "end\n", + "#---Begin Run Action-------------------------------------------------------------------------------\n", + "function beginrun(run::G4Run, app::G4JLApplication)::Nothing\n", + " data = getSIMdata(app)\n", + " gun = app.generator.data.gun\n", + " data.fParticle = gun |> GetParticleDefinition |> GetParticleName |> String\n", + " data.fEkin = gun |> GetParticleEnergy\n", + " return\n", + "end" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Define the primary particle generator, the magnetic filed and the application" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import Geant4.SystemOfUnits:tesla\n", + "#--------------------------------------------------------------------------------------------------\n", + "#---Particle Gun initialization--------------------------------------------------------------------\n", + "#--------------------------------------------------------------------------------------------------\n", + "particlegun = G4JLGunGenerator(particle = \"pi+\", \n", + " energy = 330MeV, \n", + " direction = G4ThreeVector(0,-1,0), \n", + " position = G4ThreeVector(0, hbc30.worldZHalfLength,0))\n", + "\n", + "#--------------------------------------------------------------------------------------------------\n", + "#---Magnetic Field initialization------------------------------------------------------------------\n", + "#--------------------------------------------------------------------------------------------------\n", + "bfield = G4JLUniformMagField(G4ThreeVector(0,0, 1.5tesla))\n", + "\n", + "#--------------------------------------------------------------------------------------------------\n", + "#---Create the Application-------------------------------------------------------------------------\n", + "#--------------------------------------------------------------------------------------------------\n", + "app = G4JLApplication(; detector = hbc30, # detector with parameters\n", + " simdata = HBC30SimData(), # simulation data structure\n", + " generator = particlegun, # primary particle generator\n", + " field = bfield, # uniform magnetic field\n", + " nthreads = 0, # # of threads (0 = no MT)\n", + " physics_type = FTFP_BERT, # what physics list to instantiate\n", + " stepaction_method = stepaction, # step action method\n", + " begineventaction_method = beginevent, # begin-event action (initialize per-event data)\n", + " pretrackaction_method = pretrackaction, # pre-tracking action\n", + " posttrackaction_method = posttrackaction, # post-tracking action\n", + " beginrunaction_method = beginrun # begin run action\n", + " );" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Draw and trigger functions" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#---Draw functions---------------------------------------------------------------------------------\n", + "function drawdetector(s, app)\n", + " world = GetWorldVolume()\n", + " Geant4.draw!(s, world)\n", + "end\n", + "\n", + "function drawevent(s, app)\n", + " data = app.simdata[1]\n", + " # clear previous plots from previous event\n", + " tobe = [p for p in plots(s) if p isa Lines || p isa Makie.Text] # The event is made of lines and text \n", + " for p in tobe\n", + " delete!(s,p)\n", + " end\n", + " # draw new event\n", + " for t in data.tracks\n", + " style = abs(t.charge) > 0. ? :solid : :dot\n", + " lines!(s, t.points, linestyle=style)\n", + " if t.energy > data.fEkin/20\n", + " text!(s, t.points[end], text=t.particle)\n", + " end\n", + " end\n", + "end\n", + "\n", + "#---Very simplistic trigger to get interesting events to plot--------------------------------------\n", + "function nexttrigger(app)\n", + " data = app.simdata[1]\n", + " beamOn(app,1)\n", + " n = 1\n", + " while data.veto\n", + " beamOn(app,1)\n", + " n += 1\n", + " end\n", + " println(\"Got a trigger after $n generated particles\")\n", + "end" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#---Configure, Initialize and Run------------------------------------------------------------------ \n", + "configure(app)\n", + "initialize(app)\n", + "\n", + "ui`/tracking/storeTrajectory 2` # store auxiliary points to smooth trajectory" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#---Draw detector and first event that triggers\n", + "fig = Figure(size=(2048,2028))\n", + "s = LScene(fig[1,1])\n", + "\n", + "drawdetector(s, app)\n", + "nexttrigger(app); drawevent(s, app)\n", + "\n", + "display(\"image/png\", fig)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#---Change the energy and type of particle and draw the next event\n", + "SetParticleEnergy(particlegun, 1GeV)\n", + "SetParticleByName(particlegun, \"e-\")\n", + "\n", + "fig = Figure(size=(2048,2028))\n", + "s = LScene(fig[1,1])\n", + "\n", + "drawdetector(s, app)\n", + "nexttrigger(app); drawevent(s, app)\n", + "\n", + "display(\"image/png\", fig)" + ] + } + ], + "metadata": { + "@webio": { + "lastCommId": null, + "lastKernelId": null + }, + "kernelspec": { + "display_name": "Julia 1.10.0", + "language": "julia", + "name": "julia-1.10" + }, + "language_info": { + "file_extension": ".jl", + "mimetype": "application/julia", + "name": "julia", + "version": "1.10.0" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/tutorial/docs/geant4-jl-applications.ipynb b/tutorial/docs/geant4-jl-applications.ipynb new file mode 100644 index 0000000..db11338 --- /dev/null +++ b/tutorial/docs/geant4-jl-applications.ipynb @@ -0,0 +1,165 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Basic/B1 Example\n", + "Import the `Geant4` and `Geant4.SystemOfUnits` modules" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "using Geant4\n", + "using Geant4.SystemOfUnits" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Define the function that will construct the detector geometry.\n", + "The setup consists of a an envelope of box shape containing two volumes: a spherical cone and a trapezoid.\n", + "\n", + "In this example we use some common materials materials for medical applications. The envelope is made of water and the two inner volumes\n", + "are made from tissue and bone materials.\n", + "The materials are created with the help of the G4NistManager class,\n", + "which allows to build a material from the NIST database using their\n", + "names. All available materials can be found in the Geant4 User's Guide\n", + "for Application Developers, Appendix 10: Geant4 Materials Database." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "include(\"DetectorB1.jl\")\n", + "\n", + "detdesc = G4JLDetectorConstruction(constructB1Detector)\n", + "physics = QBBC()\n", + "#SetVerboseLevel(physics, 1)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### User Actions" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# User Actions\n", + "function buildApp(self::G4JLActionInitialization, ::Nothing)\n", + " # Create particle gun\n", + " particle_gun = G4JLParticleGun() \n", + " # Setup particle gun\n", + " pg = GetGun(particle_gun)\n", + " SetParticleByName(pg, \"e-\")\n", + " SetParticleEnergy(pg, 100MeV)\n", + " SetParticleMomentumDirection(pg, G4ThreeVector(0,0,1))\n", + " SetParticlePosition(pg, G4ThreeVector(0,0,-16cm))\n", + " # Register and relinquish ownership\n", + " SetUserAction(self, move!(particle_gun))\n", + " end\n", + " app = G4JLActionInitialization(buildApp)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Instantiate RunManager and initialize" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Construct the default run manager and set initializers\n", + "runManager = G4RunManager()\n", + "\n", + "# Register User initialization objects and relinquish ownership\n", + "SetUserInitialization(runManager, move!(detdesc))\n", + "SetUserInitialization(runManager, move!(physics))\n", + "SetUserInitialization(runManager, move!(app))\n", + "\n", + "# Get the pointer to the User Interface manager\n", + "UImanager = G4UImanager!GetUIpointer();" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Execute the commands to initialize and run few events" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Initialize kernel\n", + "ApplyCommand(UImanager, \"/run/initialize\")\n", + "\n", + "# Change verbosity\n", + "#ApplyCommand(UImanager, \"/control/verbose 2\")\n", + "#ApplyCommand(UImanager, \"/run/verbose 2\")\n", + "#ApplyCommand(UImanager, \"/event/verbose 0\")\n", + "ApplyCommand(UImanager, \"/tracking/verbose 1\")\n", + "\n", + "# gamma 6 MeV to the direction (0.,0.,1.)\n", + "ApplyCommand(UImanager, \"/gun/particle gamma\")\n", + "ApplyCommand(UImanager, \"/gun/energy 6 MeV\")\n", + "\n", + "# go\n", + "ApplyCommand(UImanager, \"/run/beamOn 1\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ApplyCommand(UImanager, \"/gun/particle e+\")\n", + "ApplyCommand(UImanager, \"/gun/energy 60 MeV\")\n", + "ApplyCommand(UImanager, \"/run/beamOn 1\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Julia 1.10.0", + "language": "julia", + "name": "julia-1.10" + }, + "language_info": { + "file_extension": ".jl", + "mimetype": "application/julia", + "name": "julia", + "version": "1.10.0" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/tutorial/docs/geant4-jl-intro.ipynb b/tutorial/docs/geant4-jl-intro.ipynb new file mode 100644 index 0000000..a03c619 --- /dev/null +++ b/tutorial/docs/geant4-jl-intro.ipynb @@ -0,0 +1,463 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "source": [ + "# Introduction to Geant4.jl\n", + "\n", + "Geant4.jl provides the Julia bindings for the [Geant4](https://geant4.web.cern.ch) particle transportation toolkit. It is using [CxxWrap.jl](https://github.com/JuliaInterop/CxxWrap.jl) package to wrap C++ types and functions to Julia. Since the Geant4 toolkit is rather large and complex, writing the wrapper code by hand is not really an option. For this we use the package [WrapIt](https://github.com/grasph/wrapit) that automates the generation of the wrapper code making use of the clang library.\n", + "\n", + "Documentation of the concepts and how to write applications with the Geant4 toolkit can be found with the [Application Developer Guide](https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/index.html) or the [Classes and Members reference guide](https://geant4.kek.jp/Reference/v11.1.1/index.html) for a detailed description of each C++ class. In this tutorial we will only highlight the differences between the Julia and the C++ API. We will document the additional types that have been added on top of the C++ classes to make the user interface more Julia friendly. To distinguish these new types from the types coming directly from C++ via the CxxWrap wrappers, these types are prefixed with `G4JL`.\n", + "\n", + "## Installation\n", + "The Geant4.jl package does no require any special installation. Stable releases are registered into the Julia general registry, and therefore can be deployed with the standard `Pkg` Julia package manager.\n", + "\n", + "**Please note that the first time the `Geant4` package is added it may take some time since it downloads all the binary libraries and data files of Geant4** " + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[32m\u001b[1m Resolving\u001b[22m\u001b[39m package versions...\n", + "\u001b[32m\u001b[1m No Changes\u001b[22m\u001b[39m to `~/Development/Geant4.jl-tutorial/Project.toml`\n", + "\u001b[32m\u001b[1m No Changes\u001b[22m\u001b[39m to `~/Development/Geant4.jl-tutorial/Manifest.toml`\n" + ] + } + ], + "source": [ + "using Pkg\n", + "Pkg.add(\"Geant4\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Interacting with the wrapped classes\n", + "\n", + "Import the `Geant4` module. All the wrapped Geant4 classes are implicitly exported since they are prefixed by `G4`, and therefore the chances of a name clash with other Julia symbols is minimal.\n", + "\n", + "### Object instantiation\n", + "\n", + "We start by instantiating some very simple object of type `G4Box`. Note that\n", + "- The C++ constructor called is `G4Box::G4Box(const G4String &pName, G4double pX, G4double pY, G4double pZ)`\n", + "- The conversion of julia `Int64` to C++ `G4double` is implicit, as well as the `String` to `G4String` " + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Geant4.G4BoxAllocated(Ptr{Nothing} @0x0000000100325d90)" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "using Geant4\n", + "box = G4Box(\"MyBox\", 1, 2, 3) # the C++ contructor called G4Box (const G4String &pName, G4double pX, G4double pY, G4double pZ)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The returned object is a pointer (`Ptr`) to the wrapped C++ object. The `CxxWrap` package encodes (with the type Geant4.G4BoxAllocated`) that the object has been allocated from Julia and will by default be garbage collected when not needed anymore. " + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2-element Vector{Any}:\n", + " Geant4.G4BoxAllocated\n", + " Geant4.G4BoxDereferenced" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "using Test\n", + "@test typeof(box) == Geant4.G4BoxAllocated\n", + "@test box isa G4Box\n", + "\n", + "subtypes(G4Box)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To take the C++ pointer or the reference, the `CxxWrap` module provides the functions `CxxPtr` and `CxxRef`. This is often needed to comply with the Geant4 C++ interfaces. " + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "\u001b[32m\u001b[1mTest Passed\u001b[22m\u001b[39m" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "r_box = CxxRef(box)\n", + "p_box = CxxPtr(box)\n", + "@test r_box isa CxxRef{G4Box} # reference\n", + "@test p_box isa CxxPtr{G4Box} # pointer" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The user can derefence a `CxxRef` or `CxxPtr` with the operator `[]`" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "typeof(r_box[]) = Geant4.G4BoxDereferenced\n", + "typeof(p_box[]) = Geant4.G4BoxDereferenced\n" + ] + }, + { + "data": { + "text/plain": [ + "\u001b[32m\u001b[1mTest Passed\u001b[22m\u001b[39m" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "@show typeof(r_box[])\n", + "@show typeof(p_box[])\n", + "@test r_box[] == box\n", + "@test p_box[] == box" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Calling class methods\n", + "In julia, `methods` are instances of functions with a given name, of which the multi-dispatch functionality will select the best one that matches the actual argument types. To call a C++ method of a class we need to pass the object as first argument." + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "\u001b[32m\u001b[1mTest Passed\u001b[22m\u001b[39m" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "vol = GetCubicVolume(box)\n", + "@test vol == 8 * GetXHalfLength(box) * GetYHalfLength(box) * GetZHalfLength(box) " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can see the methods defined for the function `GetCubicVolume` using the Julia builtin function `methods()`" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "# 58 methods for generic function GetCubicVolume from \u001b[36mGeant4\u001b[39m:" + ], + "text/plain": [ + "# 58 methods for generic function \"GetCubicVolume\" from \u001b[36mGeant4\u001b[39m:\n", + " [1] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4SubtractionSolid}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [2] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4UnionSolid}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [3] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4TwistedTubs}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [4] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4BooleanSolid}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [5] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4GenericTrap}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [6] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4TwistedTrd}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [7] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4TwistedBox}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [8] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Tet}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [9] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Paraboloid}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [10] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4EllipticalCone}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [11] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4EllipticalTube}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [12] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4CutTubs}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [13] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Tubs}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [14] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Hype}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [15] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Para}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [16] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Torus}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [17] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Ellipsoid}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [18] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Orb}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [19] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Sphere}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [20] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Cons}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [21] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Trap}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [22] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Trd}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [23] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4MultiUnion}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [24] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Box}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [25] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4DisplacedSolid}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [26] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Polyhedra}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [27] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4Polycone}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [28] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4VCSGfaceted}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [29] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{Ptr{Nothing}, CxxPtr{<:G4VSolid}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [30] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4SubtractionSolid, CxxRef{<:G4SubtractionSolid}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [31] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4UnionSolid, CxxRef{<:G4UnionSolid}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [32] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4TwistedTubs, CxxRef{<:G4TwistedTubs}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [33] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4BooleanSolid, CxxRef{<:G4BooleanSolid}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [34] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4GenericTrap, CxxRef{<:G4GenericTrap}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [35] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4TwistedTrd, CxxRef{<:G4TwistedTrd}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [36] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4TwistedBox, CxxRef{<:G4TwistedBox}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [37] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Tet, CxxRef{<:G4Tet}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [38] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Paraboloid, CxxRef{<:G4Paraboloid}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [39] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4EllipticalCone, CxxRef{<:G4EllipticalCone}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [40] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4EllipticalTube, CxxRef{<:G4EllipticalTube}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [41] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4CutTubs, CxxRef{<:G4CutTubs}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [42] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Tubs, CxxRef{<:G4Tubs}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [43] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Hype, CxxRef{<:G4Hype}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [44] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Para, CxxRef{<:G4Para}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [45] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Torus, CxxRef{<:G4Torus}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [46] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Ellipsoid, CxxRef{<:G4Ellipsoid}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [47] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Orb, CxxRef{<:G4Orb}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [48] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Sphere, CxxRef{<:G4Sphere}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [49] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Cons, CxxRef{<:G4Cons}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [50] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Trap, CxxRef{<:G4Trap}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [51] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Trd, CxxRef{<:G4Trd}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [52] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4MultiUnion, CxxRef{<:G4MultiUnion}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [53] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Box, CxxRef{<:G4Box}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [54] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4DisplacedSolid, CxxRef{<:G4DisplacedSolid}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [55] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4VCSGfaceted, CxxRef{<:G4VCSGfaceted}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [56] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Polycone, CxxRef{<:G4Polycone}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [57] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4Polyhedra, CxxRef{<:G4Polyhedra}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m\n", + " [58] GetCubicVolume(\u001b[90marg1\u001b[39m::\u001b[1mUnion\u001b[22m\u001b[0m{G4VSolid, CxxRef{<:G4VSolid}})\n", + "\u001b[90m @\u001b[39m \u001b[90m~/.julia/packages/CxxWrap/5IZvn/src/\u001b[39m\u001b[90m\u001b[4mCxxWrap.jl:624\u001b[24m\u001b[39m" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "methods(GetCubicVolume)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Working in the inheritance\n", + "In Geant4 all solid types inherit from a common base class `G4VSolid`. The method `Clone` returns a pointer to this base class. " + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "\u001b[32m\u001b[1mTest Passed\u001b[22m\u001b[39m" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "solid = Clone(box)\n", + "@test typeof(solid) == CxxPtr{G4VSolid}\n", + "@test CxxPtr(box) == box # same instance\n", + "@test solid != box # these are two diffrent instances\n", + "@test GetCubicVolume(solid) == GetCubicVolume(box)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Object ownership\n", + "By default all objects instantiated by Julia will garbage collected (deleted) by Julia. this may pose problems with Geant4 since in many occasions the ownership is transferred implicitly to the toolkit, which will take care of doing a cleanup at the adequate moment. If we do nor pay attention we may get crashes (use a deleted objects and double deletions).\n", + "\n", + "There are nevertheless some exceptions that have been added to simplify the interactions for the following classes: `G4PVPlacement`,\n", + "`G4LogicalVolume`, `G4PVReplica`, `G4Material`, `G4Isotope`, `G4Element`, `G4JLParticleGun`, \n", + " `G4JLDetectorConstruction`, `G4JLGeneratorAction`, `G4JLRunAction`, `G4JLSensDet`, `G4JLWorkerInitialization`, `G4JLStateDependent`,\n", + " `G4LogicalSkinSurface`, `G4LogicalBorderSurface`, `G4OpticalSurface`\n", + "\n", + "The following code show the behavior when things are not done correctly" + ] + }, + { + "cell_type": "code", + "execution_count": 92, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "63.99961138371228" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "box1 = G4Box(\"box1\", 1,1,1) # construct boxes\n", + "box2 = G4Box(\"box2\", 2,2,2) \n", + "union = G4UnionSolid(\"union\", CxxPtr(box1), CxxPtr(box2)) # construct a union solid with the same box\n", + "GetCubicVolume(union)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "now force a GC" + ] + }, + { + "cell_type": "code", + "execution_count": 93, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "63.99961138371228" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "box1 = box2 = G4Box(\"box\", 10,10,10)\n", + "#union = nothing\n", + "GC.gc()\n", + "GetCubicVolume(union)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Julia 1.10.0", + "language": "julia", + "name": "julia-1.10" + }, + "language_info": { + "file_extension": ".jl", + "mimetype": "application/julia", + "name": "julia", + "version": "1.10.0" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/tutorial/docs/intro.md b/tutorial/docs/intro.md new file mode 100644 index 0000000..813198b --- /dev/null +++ b/tutorial/docs/intro.md @@ -0,0 +1,22 @@ +# Welcome to Geant4.jl Tutorial + +This is a short introductory tutorial for the [Geant4.jl](https://github.com/JuliaHEP/Geant4.jl) package. + +This tutorial is supported by the [HSF JuliaHEP](https://hepsoftwarefoundation.org/workinggroups/juliahep.html) team and currently it is maintained by [Pere Mato](https://github.com/peremato). + +This material is part of the [HSF Software Training Centre](https://hepsoftwarefoundation.org/training/curriculum.html), a series of training modules that serves HEP newcomers in learning the software skills they need as the enter the field and promotes best practice in writing software. + +

+HEP Software Foundation Logo... +

+ + +## Introduction + + +```{tableofcontents} +``` + +This material is release under a Creative Commons Attribution 4.0 International Public License, [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/). Please see the `LICENSE` file. + + diff --git a/tutorial/environment.yml b/tutorial/environment.yml new file mode 100644 index 0000000..e6a01ba --- /dev/null +++ b/tutorial/environment.yml @@ -0,0 +1,12 @@ +name: julia-intro +channels: + - conda-forge +dependencies: + - python == 3.12.* + - jupyter-book + - jupyterlab + - jupytext + - nbconvert + - pip + - pip: + - jupyterlab-rise