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
Closed
Changes from 11 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f45e63c
with latest dual-readout (2023-09-21) pacakge, migrated DRC geometry …
swkim95 Sep 21, 2023
bd28ad7
Remove cout used for debugging
swkim95 Sep 25, 2023
5c9075a
DRC migration code update with latest dual-readout and k4geo package …
swkim95 Dec 7, 2023
4c8a5be
Merge branch 'DRC_geo_migrate_230918' into DRC_geo_migrate_231113
swkim95 Dec 7, 2023
5280557
Merge pull request #1 from swkim95/DRC_geo_migrate_231113
swkim95 Dec 7, 2023
ccabc2f
remove cout for the debug
swkim95 Dec 7, 2023
9d25eb5
Remove duplicated DRC compact file & source codes under IDEA directory
swkim95 Dec 7, 2023
4ea51dc
Update DRC detetor builder to latest version
swkim95 Dec 7, 2023
4ebaae3
Merge branch 'main' into DRC_geo_migrate_230918
swkim95 Dec 19, 2023
b0bfcf9
Merge branch 'key4hep:main' into DRC_geo_migrate_230918
swkim95 Jan 18, 2024
0a96366
Update branch with latest k4geo & Split FiberDRC xml files
swkim95 Mar 7, 2024
df5d782
remove debugging cout
swkim95 Mar 7, 2024
d09dc81
Merge branch 'DRC_geo_migrate_230918' into PRupdate
swkim95 Mar 7, 2024
369d1ec
Merge pull request #2 from swkim95/PRupdate
swkim95 Mar 7, 2024
ccd166e
Remove unused xml files, remove IDEA directory (which does not exists…
swkim95 Mar 7, 2024
86941a0
Updates in IDEA XML files for implemeting Dual-readout calorimeter, D…
swkim95 Apr 23, 2024
ccd8dfc
Merge branch 'DRC_geo_migrate_230918' into PRupdate_240408
swkim95 Apr 23, 2024
ad54c67
Merge pull request #3 from swkim95/PRupdate_240408
swkim95 Apr 23, 2024
2c222d2
Fix xml files (remove redundant includes, remove DRC material propert…
swkim95 Apr 30, 2024
f5ed2f2
Update branch to latest k4geo master branch
swkim95 Jun 1, 2024
09107f1
Fix units in SD action plugin, add wavelength information in output file
swkim95 Jun 1, 2024
dccbd0a
Add Fiber DRC xml to IDEA v03
swkim95 Jun 1, 2024
9674154
remove debugging message, find EDM4HEP for plugins
swkim95 Jun 1, 2024
806a6af
Remove DRC from IDEA v02
swkim95 Jun 5, 2024
1a6c652
Fix indentation
swkim95 Jun 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -119,13 +119,14 @@ target_include_directories(${PackageName} PRIVATE ${PROJECT_SOURCE_DIR}/detect
target_include_directories(${PackageName}G4 PRIVATE ${PROJECT_SOURCE_DIR}/detector/calorimeter/dual-readout/include )

target_link_libraries(${PackageName} DD4hep::DDCore DD4hep::DDRec DD4hep::DDParsers ROOT::Core detectorSegmentations)
target_link_libraries(${PackageName}G4 DD4hep::DDCore DD4hep::DDRec DD4hep::DDParsers DD4hep::DDG4 ROOT::Core ${Geant4_LIBRARIES} detectorSegmentations)
target_link_libraries(${PackageName}G4 DD4hep::DDCore DD4hep::DDRec DD4hep::DDParsers DD4hep::DDG4 ROOT::Core ${Geant4_LIBRARIES})

if(K4GEO_USE_LCIO)
target_link_libraries(${PackageName} LCIO::lcio)
target_link_libraries(${PackageName}G4 LCIO::lcio)
endif()


#Create this_package.sh file, and install
dd4hep_instantiate_package(${PackageName})

@@ -153,7 +154,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

endif()

# create k4geoConfig and friends
745 changes: 745 additions & 0 deletions FCCee/IDEA/compact/IDEA_o1_v02/DRcalo.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)

Large diffs are not rendered by default.

729 changes: 729 additions & 0 deletions FCCee/IDEA/compact/IDEA_o1_v02/DRcalo_IDEA.xml
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.

Large diffs are not rendered by default.

740 changes: 740 additions & 0 deletions FCCee/IDEA/compact/IDEA_o1_v02/DRcalo_Wratten9_S13615-1025.xml
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

Large diffs are not rendered by default.

75 changes: 75 additions & 0 deletions detector/calorimeter/dual-readout/src/DRgeo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#include "detectorSegmentations/DRparamBarrel_k4geo.h"
#include "detectorSegmentations/DRparamEndcap_k4geo.h"
#include "detectorSegmentations/GridDRcaloHandle_k4geo.h"

#include "DRconstructor.h"

#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/OpticalSurfaces.h"
#include "DD4hep/Printout.h"
#include "DD4hep/Detector.h"

namespace ddDRcalo {
static dd4hep::Ref_t create_detector( dd4hep::Detector &description, xml_h xmlElement, dd4hep::SensitiveDetector sensDet ) {
// Get the detector description from the xml-tree
xml_det_t x_det = xmlElement;
std::string name = x_det.nameStr();
// Create the detector element
dd4hep::DetElement drDet( name, x_det.id() );
// set the sensitive detector type to the DD4hep calorimeter
dd4hep::xml::Dimension sensDetType = xmlElement.child(_Unicode(sensitive));
sensDet.setType(sensDetType.typeStr());
// Get the world volume
dd4hep::Assembly experimentalHall("hall");
// Get the dimensions defined in the xml-tree
xml_comp_t x_barrel ( x_det.child( _Unicode(barrel) ) );
xml_comp_t x_endcap ( x_det.child( _Unicode(endcap) ) );
xml_comp_t x_structure ( x_det.child( _Unicode(structure) ) );
xml_comp_t x_dim ( x_structure.child( _Unicode(dim) ) );
xml_comp_t x_sipmDim ( x_det.child( _Unicode(sipmDim) ) );

dd4hep::OpticalSurfaceManager surfMgr = description.surfaceManager();
dd4hep::OpticalSurface sipmSurfProp = surfMgr.opticalSurface("/world/"+name+"#SiPMSurf");
dd4hep::OpticalSurface mirrorSurfProp = surfMgr.opticalSurface("/world/"+name+"#MirrorSurf");
surfMgr.opticalSurface("/world/"+name+"#FilterSurf"); // actual filtering applied in the stepping action

auto segmentation = dynamic_cast<dd4hep::DDSegmentation::GridDRcalo_k4geo*>( sensDet.readout().segmentation().segmentation() );
segmentation->setGridSize( x_dim.distance() );
segmentation->setSipmSize( x_dim.dx() );

auto paramBarrel = segmentation->paramBarrel();
paramBarrel->SetInnerX(x_barrel.rmin());
paramBarrel->SetTowerH(x_barrel.height());
paramBarrel->SetNumZRot(x_barrel.nphi());
paramBarrel->SetSipmHeight(x_sipmDim.height());

auto paramEndcap = segmentation->paramEndcap();
paramEndcap->SetInnerX(x_endcap.rmin());
paramEndcap->SetTowerH(x_endcap.height());
paramEndcap->SetNumZRot(x_endcap.nphi());
paramEndcap->SetSipmHeight(x_sipmDim.height());

auto constructor = DRconstructor(x_det);
constructor.setExpHall(&experimentalHall);
constructor.setDRparamBarrel(paramBarrel);
constructor.setDRparamEndcap(paramEndcap);
constructor.setDescription(&description);
constructor.setDetElement(&drDet);
constructor.setSipmSurf(&sipmSurfProp);
constructor.setMirrorSurf(&mirrorSurfProp);
constructor.setSensDet(&sensDet);
constructor.construct(); // right

dd4hep::Volume worldVol = description.pickMotherVolume(drDet);
dd4hep::PlacedVolume hallPlace = worldVol.placeVolume(experimentalHall);
hallPlace.addPhysVolID("system",x_det.id());
// connect placed volume and physical volume
drDet.setPlacement( hallPlace );

paramBarrel->finalized();
paramEndcap->finalized();

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 :-)