-
Notifications
You must be signed in to change notification settings - Fork 62
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
Changes from 11 commits
f45e63c
bd28ad7
5c9075a
4c8a5be
5280557
ccabc2f
9d25eb5
4ea51dc
4ebaae3
b0bfcf9
0a96366
df5d782
d09dc81
369d1ec
ccd166e
86941a0
ccd8dfc
ad54c67
2c222d2
f5ed2f2
09107f1
dccbd0a
9674154
806a6af
1a6c652
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
Large diffs are not rendered by default.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should be removed and the detector should be integrated to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is compatible but not 100% sure... About various DRcalo xml files, I'm also not sure which one to use. |
Large diffs are not rendered by default.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should be split:
|
Large diffs are not rendered by default.
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Brieuc, thanks for the comments! You mean like I'll update like that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes :-) |
There was a problem hiding this comment.
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