Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate IDEA dual-readout calorimeter geometry #292

Closed
wants to merge 25 commits into from

Conversation

swkim95
Copy link
Contributor

@swkim95 swkim95 commented Sep 25, 2023

BEGINRELEASENOTES

  • Added DRC geometry construction code under detector/IDEA directory
  • Added .xml compact files under IDEA directory
  • Fixed CMakeLists to compile detector/IDEA

ENDRELEASENOTES

Purpose

  • PR for adding IDEA dual-readout calorimeter (DRC) detector geometry under k4geo package

Tests

  • Tested compiling k4geo with new code, worked well
  • Tested running simulation using k4run with 2023-09-18 nightly build key4hep-stack setup, also well worked

@jmcarcell
Copy link
Contributor

Could you edit your post and only put the changes in the release notes? The rest you can put outside. This is how the release notes end up looking like:
https://github.com/key4hep/k4geo/releases/tag/v00-18-01
And there we're only interested in what has been changed and maybe why depending on the change

CMakeLists.txt Outdated Show resolved Hide resolved
@andresailer andresailer marked this pull request as draft November 1, 2023 14:10
@BrieucF
Copy link
Contributor

BrieucF commented Nov 15, 2023

Hi Sungwon, thanks a lot for initiating this! Here are a few general comments:

  • the detector builder (C++ part) should be under detector/calorimeter. Since you have several files (and that this folder is already busy), maybe it is worth creating a sub-directory detector/calorimeter/dual-readout. What do you think @andresailer ?
  • can you add a README.md like this one describing briefly the detector builder
  • Maybe some versioning of the detector builder would be useful as well (_ox_vy in the name)
  • the detector segmentation should go under detectorSegmentations

@SanghyunKo
Copy link
Contributor

Hi @swkim95, would you mind pulling this commit?

@swkim95
Copy link
Contributor Author

swkim95 commented Dec 7, 2023

Hi,

I updated the PR with latest k4geo & dual-readout changes applied. (7-Dec-2023)
Here are the changes.

  1. I created dual-readout directory under /detector/calorimeter/ and placed the detector builder codes under it.
  2. Moved compact files under /FCCee/IDEA/compact/IDEA_o1_v02/
  3. Removed duplicated DRC compact xml files & detector builder source code under /IDEA/ and /detector/IDEA
  4. Move detector segmentation codes under /detectorSegmentations/ and matched the convention with other files (adding _k4geo)

I haven't added detector builder README.md yet.


// verify assumptions
if ( std::abs(ymax+ymin) > TGeoShape::Tolerance() )
throw std::runtime_error("Envelop of full length fibers (fullBox) is not located at the centre of the tower!");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like this commit still hasn't been pulled?

Copy link
Contributor

@BrieucF BrieucF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Unfortunately, as such, the detector can not really be integrated in the full IDEA. Building its ROOT geometry alone already takes 14 minutes and 13 GB of RAM. This should be improved, we will provide support (also for the migration to ddsim). Other comments can meanwhile be addressed.

return drDet;
}
} // namespace detector
DECLARE_DETELEMENT(ddDRcalo, ddDRcalo::create_detector) // factory method
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the name so that it does not clash with https://github.com/HEP-FCC/dual-readout/blob/master/Detector/DRcalo/src/DRgeo.cpp#L74 ? In general we try to have the name of the file matching the name of the factory and we version it. Since we have several dual readout calorimeters, may I suggest to rename the file and the factory to something like FiberDualReadoutCalo_o1_v01?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Brieuc, thanks for the comments!

You mean like DRgeo.cpp -> FiberDualReadoutCalo_o1_v01.cpp and
DECLARE_DETELEMENT(ddDRcalo, ddDRcalo::create_detector) ->
DECLARE_DETELEMENT(FiberDualReadoutCalo_o1_v01, ddDRcalo::create_detector), right?

I'll update like that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes :-)

CMakeLists.txt Outdated
@@ -112,7 +116,7 @@ INSTALL(FILES ${hfiles}

#--- install compact files------------------------------
if(INSTALL_COMPACT_FILES)
INSTALL(DIRECTORY CaloTB CLIC FCalTB FCCee ILD fieldmaps SiD DESTINATION share/k4geo )
INSTALL(DIRECTORY CaloTB CLIC FCalTB FCCee ILD fieldmaps SiD IDEA DESTINATION share/k4geo )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be needed anymore

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be removed and the detector should be integrated to FCCee/IDEA/compact/IDEA_o1_v02/IDEA_o1_v02.xml. Can you also make sure that the dimensions are compatible with the one here: https://fcc-ee-detector-full-sim.docs.cern.ch/IDEA/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is compatible but not 100% sure...
I'll ask Sanghyun about it.

About various DRcalo xml files, I'm also not sure which one to use.
I'll also discuss this with Sanghyun and fix which xml file to include.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be split:

  • global "envelope parameters" should go to FCCee/IDEA/compact/IDEA_o1_v02/DectDimensions_IDEA_o1_v01.xml (please profit from this occasion to remove all the other ECAL/HCAL dimensions which will no longer be used in this file)
  • detector specific parameters should go to a dedicated file that I propose to name FCCee/IDEA/compact/IDEA_o1_v02/FiberDualReadoutCalo_o1_v01.xml
  • missing materials/elements should go to FCCee/IDEA/compact/IDEA_o1_v02/elements_o1_v01.xml and FCCee/IDEA/compact/IDEA_o1_v02/materials_o1_v01.xml

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try to keep one file for the detector description (see the other comment on FCCee/IDEA/compact/IDEA_o1_v02/DRcalo_Wratten9_S13615-1025.xml)

swkim95 and others added 11 commits March 7, 2024 16:21
Update k4geo to latest commit & split detector xml files
…) in CMakeList compact file installation part
…RC detector constructors, plugins for running simluation with IDEA DRC using ddsim
PR update with latest k4geo master branch & adding IDEA DRC simulation
…ies in materials_o1_v01.xml and move them to DRC xml file), remove duplicated DRC geo constructor (DRgeo.cpp), update DRconstructor.cpp to remove commented out codes etc..., remove scripts for debug in plugin
Copy link
Contributor

@SanghyunKo SanghyunKo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swkim95 there are some places still need to be cleaned up

<constant name="FiberDRCalo_barrel_inner_radius" value="2.5*m"/>
<constant name="FiberDRCalo_barrel_nphi" value="144"/>
<constant name="FiberDRCalo_endcap_height" value="2.*m"/>
<constant name="FiberDRCalo_endcap_inner_radius" value="2.5*m"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind changing FiberDRCalo_endcap_inner_radius to FiberDRCalo_endcap_z_start? (as discussed in the mattermost)


private:
void implementTowers(xml_comp_t& x_theta, dd4hep::DDSegmentation::DRparamBase_k4geo* param);
// void placeAssembly(xml_comp_t& x_theta, xml_comp_t& x_wafer, dd4hep::DDSegmentation::DRparamBase_k4geo* param,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be better to clean up comments (in other places as well)

namespace ddDRcalo {
static dd4hep::Ref_t create_detector( dd4hep::Detector &description, xml_h xmlElement, dd4hep::SensitiveDetector sensDet ) {
// For Debug
// std::cout << __PRETTY_FUNCTION__ << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

@@ -52,6 +52,9 @@

<!-- Import Endcap plate absorber -->
<include ref="EndPlateAbsorber_o1_v01.xml"/>

<!-- Import fiber-based dual-readout calorimeter -->
<include ref="FiberDualReadoutCalo_o1_v01.xml"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we only need to push to the v03, not v02 (as we discussed in the working meeting)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indents

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above (indents)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above (indents)

@swkim95 swkim95 marked this pull request as ready for review June 3, 2024 08:41
@swkim95
Copy link
Contributor Author

swkim95 commented Jun 5, 2024

Hi, I just updated the codes based on Sanghyun's comments

@@ -52,7 +52,7 @@

<!-- Import Endcap plate absorber -->
<include ref="EndPlateAbsorber_o1_v01.xml"/>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a major comment but it's a good practice to revert your changes using git checkout -- <filename> or equivalent instead of removing texts by hands... (so that you don't screw up commit histories)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants