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

Monolithic fiber DRC memory usage reduction update, using IDEA o1 v03 #346

Merged
merged 11 commits into from
Aug 6, 2024

Conversation

swkim95
Copy link
Contributor

@swkim95 swkim95 commented Jun 28, 2024

BEGINRELEASENOTES

  • Add DRC geometry construction code under detector/calorimeter/dual-readout directory
  • Add .xml compact files under FCCee/IDEA/compact/IDEA_o1_v03 directory
  • Add custom SD action, output file, fast simulation (boosting optical photon transportation) for Monolithic fiber DRC under plugin directory
  • Fixed CMakeLists to compile all above

ENDRELEASENOTES

Purpose

  • PR for adding IDEA monolithic fiber dual-readout calorimeter (DRC) detector geometry

Tests

  • Tested compiling k4geo
  • Tested running simulation using ddsim

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.

The first round of comments (note that assembly box should also be changed - which I know that is ongoing)

detector/calorimeter/dual-readout/src/DRconstructor.cpp Outdated Show resolved Hide resolved
detector/calorimeter/dual-readout/src/DRconstructor.cpp Outdated Show resolved Hide resolved
detector/calorimeter/dual-readout/src/DRconstructor.cpp Outdated Show resolved Hide resolved
detectorSegmentations/src/GridDRcalo_k4geo.cpp Outdated Show resolved Hide resolved
@SanghyunKo
Copy link
Contributor

@BrieucF PR looks good to me. Would you mind reviewing it? Otherwise, I think we can merge this for the sake of material budget studies.

@BrieucF
Copy link
Contributor

BrieucF commented Jul 2, 2024

Thanks @SanghyunKo and @swkim95 ! Alvaro will do the review as soon as possible. I'd just ask for now to add a description of the detector builder here detector/calorimeter/README.md and a "change log" for IDEA_o1_v03 here: FCCee/IDEA/compact/README.md

Copy link
Contributor

@andresailer andresailer left a comment

Choose a reason for hiding this comment

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

I can only give rather superficial comments, because I cannot understand the details of the geometry and implementation.

I would say that all of this needs a lot more comments in the code to understand the intent and for maintainability.

I probably missed some unit less numbers as well.

plugins/FiberDRCaloSDAction.cpp Outdated Show resolved Hide resolved
plugins/FiberDRCaloSDAction.cpp Outdated Show resolved Hide resolved
plugins/FiberDRCaloSDAction.cpp Outdated Show resolved Hide resolved
detector/calorimeter/dual-readout/src/DRconstructor.cpp Outdated Show resolved Hide resolved
detector/calorimeter/dual-readout/src/DRconstructor.cpp Outdated Show resolved Hide resolved
plugins/FiberDRCaloSDAction.cpp Outdated Show resolved Hide resolved
plugins/FiberDRCaloSDAction.cpp Outdated Show resolved Hide resolved
plugins/FiberDRCaloSDAction.cpp Outdated Show resolved Hide resolved
detector/calorimeter/dual-readout/include/DRconstructor.h Outdated Show resolved Hide resolved
detectorSegmentations/src/GridDRcalo_k4geo.cpp Outdated Show resolved Hide resolved
plugins/Geant4Output2EDM4hep_DRC.cpp Outdated Show resolved Hide resolved
plugins/Geant4Output2EDM4hep_DRC.cpp Outdated Show resolved Hide resolved
plugins/Geant4Output2EDM4hep_DRC.cpp Outdated Show resolved Hide resolved
plugins/Geant4Output2EDM4hep_DRC.cpp Outdated Show resolved Hide resolved
plugins/Geant4Output2EDM4hep_DRC.cpp Show resolved Hide resolved
@BrieucF
Copy link
Contributor

BrieucF commented Jul 5, 2024

I see some warnings when compiling this version. Can you try to fix them?

/afs/cern.ch/user/b/brfranco/work/public/check_monolithic_dr/k4geo/detector/calorimeter/dual-readout/src/DRconstructor.cpp: In member function 'void ddDRcalo::DRconstructor::placeAssembly(xml_comp_t&, xml_comp_t&, dd4hep::DDSegmentation::DRparamBase_k4geo*, dd4hep::Volume&, dd4hep::Volume&, dd4hep::Volume&, int, int, bool)':
/afs/cern.ch/user/b/brfranco/work/public/check_monolithic_dr/k4geo/detector/calorimeter/dual-readout/src/DRconstructor.cpp:118:57: warning: unused parameter 'x_theta' [-Wunused-parameter]
  118 | void ddDRcalo::DRconstructor::placeAssembly(xml_comp_t& x_theta, xml_comp_t& x_wafer, dd4hep::DDSegmentation::DRparamBase_k4geo* param,
      |                                             ~~~~~~~~~~~~^~~~~~~
/afs/cern.ch/user/b/brfranco/work/public/check_monolithic_dr/k4geo/detector/calorimeter/dual-readout/src/DRconstructor.cpp:118:78: warning: unused parameter 'x_wafer' [-Wunused-parameter]
  118 | void ddDRcalo::DRconstructor::placeAssembly(xml_comp_t& x_theta, xml_comp_t& x_wafer, dd4hep::DDSegmentation::DRparamBase_k4geo* param,
      |                                                                  ~~~~~~~~~~~~^~~~~~~
/afs/cern.ch/user/b/brfranco/work/public/check_monolithic_dr/k4geo/detector/calorimeter/dual-readout/src/DRconstructor.cpp: In member function 'void ddDRcalo::DRconstructor::implementFibers(xml_comp_t&, dd4hep::Volume&, dd4hep::Trap&, dd4hep::DDSegmentation::DRparamBase_k4geo*, int)':
/afs/cern.ch/user/b/brfranco/work/public/check_monolithic_dr/k4geo/detector/calorimeter/dual-readout/src/DRconstructor.cpp:142:168: warning: unused parameter 'towerNo' [-Wunused-parameter]
  142 | void ddDRcalo::DRconstructor::implementFibers(xml_comp_t& x_theta, dd4hep::Volume& towerVol, dd4hep::Trap& trap, dd4hep::DDSegmentation::DRparamBase_k4geo* param, int towerNo) {
      |                                                                                                                                                                    ~~~~^~~~~~~
/afs/cern.ch/user/b/brfranco/work/public/check_monolithic_dr/k4geo/detector/calorimeter/dual-readout/src/DRconstructor.cpp: In member function 'void ddDRcalo::DRconstructor::implementFiber(dd4hep::Volume&, dd4hep::Trap&, dd4hep::Position, int, int, float)':
/afs/cern.ch/user/b/brfranco/work/public/check_monolithic_dr/k4geo/detector/calorimeter/dual-readout/src/DRconstructor.cpp:237:86: warning: unused parameter 'trap' [-Wunused-parameter]
  237 | void ddDRcalo::DRconstructor::implementFiber(dd4hep::Volume& towerVol, dd4hep::Trap& trap, dd4hep::Position pos, int col, int row, float fiberLen) {
      |                                                                        ~~~~~~~~~~~~~~^~~~
/afs/cern.ch/user/b/brfranco/work/public/check_monolithic_dr/k4geo/detector/calorimeter/dual-readout/src/FiberDualReadoutCalo_o1_v01.cpp: In function 'dd4hep::Ref_t ddDRcalo::create_detector(dd4hep::Detector&, xml_h, dd4hep::SensitiveDetector)':
/afs/cern.ch/user/b/brfranco/work/public/check_monolithic_dr/k4geo/detector/calorimeter/dual-readout/src/FiberDualReadoutCalo_o1_v01.cpp:34:28: warning: variable 'mirrorSurfProp' set but not used [-Wunused-but-set-variable]
   34 |     dd4hep::OpticalSurface mirrorSurfProp = surfMgr.opticalSurface("/world/"+name+"#MirrorSurf");

@BrieucF
Copy link
Contributor

BrieucF commented Jul 5, 2024

@SanghyunKo
Copy link
Contributor

Final remarks before merging the PR

  1. The code lacks comments, especially in the geometry part - this is going to be improved throughout further iterations
  2. Regarding the addition of custom Geant4 output action - this is certainly not ideal, but we'd like to keep it temporarily until we get the persistent list of output variables we need downstream. We could probably add Geant4CalorimeterTimingAction or something similar to DD4hep in the future (I suspect we need timing but not wavelength information).

@BrieucF
Copy link
Contributor

BrieucF commented Jul 31, 2024

Thanks Sanghyun.

For another PR: given the currently large time taken per event, we will disable this detector by default in IDEA_o1_v03, making sure that it remains tested with CTests. But we will take care of that.

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.

Approving this now because

  • having the geometry already unlocks some studies on multiple scattering
  • having it in the central repository makes sure it will be tested from now on and makes life easier for people needing the detector
  • the sensitive action will be improved in subsequent PR

@BrieucF
Copy link
Contributor

BrieucF commented Aug 6, 2024

Can we merge this?

@andresailer
Copy link
Contributor

There are conflicts...

@BrieucF
Copy link
Contributor

BrieucF commented Aug 6, 2024

With what?

@andresailer
Copy link
Contributor

image

@andresailer andresailer merged commit 559f411 into key4hep:main Aug 6, 2024
5 of 6 checks passed
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.

7 participants