You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is the reproducibility of g4-copynumbers for volumes placed inside an Assembly volume.
I am placing volumes inside an Assembly volume and assigning g4-copynumbers (j) to them (together with volIDs).
Assembly AssemblyEndcap("DREndcapTubes");
for (std::size_t j = 0; j < static_cast<std::size_t>(NbOfZRot); j++) {
// Placement of right endcap (positive z-coordinate)
RotationZ rotz1(M_PI / 2.);
RotationZ rotz2(j * phi_unit);
RotationX rotx(M_PI);
RotationY roty(M_PI);
Transform3D slice_trnsform(rotz1 * rotz2 * rotx * roty,
Position(0, 0, (innerR)*tan(thetaB) + length / 2.));
PlacedVolume phiERPlaced = AssemblyEndcap.placeVolume(phiERLog, j, slice_trnsform);
// ID this volume with one number, the rotation
phiERPlaced.addPhysVolID("stave", j);
// Placement of left endcap (negative z-coordinate)
RotationY rotyleft(0.);
Transform3D slice_trnsformleft(rotz1 * rotz2 * rotx * rotyleft,
Position(0, 0, -1. * ((innerR)*tan(thetaB) + length / 2.)));
PlacedVolume phiELPlaced = AssemblyEndcap.placeVolume(phiERLog, j+NbOfZRot, slice_trnsformleft);
phiELPlaced.addPhysVolID("stave", j+NbOfZRot);
} // end of slice/stave placement
when I try to access the g4-copynumber in the SDAction code with
auto StaveID = aStep->GetPreStepPoint()->GetTouchable()->GetCopyNumber(4);
this cpno is not the same I set in the geometry code. I believe g4-copynumbers for these volumes are changed by DD4hep in the conversion from TGeo to G4 geometry.
I am running ctest -V -R t_ClientTests_sim_Assemblies with
index c3b734e5..33c96393 100644
--- a/DDG4/plugins/Geant4SDActions.cpp+++ b/DDG4/plugins/Geant4SDActions.cpp@@ -657,6 +657,8 @@ namespace dd4hep {
// << " edep: " << h.deposit() << std::endl ;
void *prePV = h.volume(h.pre), *postPV = h.volume(h.post);
+ std::cout << "Copy Number " << step->GetPreStepPoint()->GetTouchable()->GetCopyNumber()<<std::endl;+
Geant4HitCollection* coll = sensitive->collection(0);
/// If we are handling a new track, then store the content of the previous one.
if ( mustSaveTrack(h.track) ) {
Check duplicate issues.
Goal
The issue is the reproducibility of g4-copynumbers for volumes placed inside an Assembly volume.
I am placing volumes inside an Assembly volume and assigning g4-copynumbers (
j
) to them (together with volIDs).when I try to access the g4-copynumber in the SDAction code with
this cpno is not the same I set in the geometry code. I believe g4-copynumbers for these volumes are changed by DD4hep in the conversion from TGeo to G4 geometry.
This seems similar to #1271 fixed in #1277.
Thank you.
Operating System and Version
Any
compiler
Any
ROOT Version
Any
DD4hep Version
Any
Reproducer
std::cout<<aStep->GetPreStepPoint()->GetTouchable()->GetCopyNumber()<<std::endl;
this would be different w.r.t. the g4-cpno set in the geometry construction code for volumes placed inside an Assembly.
Additional context
This was spotted while reviewing this k4geo PR key4hep/k4geo#411
The text was updated successfully, but these errors were encountered: