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

Getting correct stave from dd4hep::VolumeManager for different ILD Hadronic Calorimeter #380

Open
ggrenier opened this issue Aug 23, 2024 · 1 comment

Comments

@ggrenier
Copy link

I'm running PFA within ILCsoft using ILD detector and the standard ILDConfig Marlin reconstruction.
I'm using the ilcsoft build v02-02-03 available on DESY cvmfs. I run on centOS ( more exactly on x86_64_gcc82_centos7 configuration)

I have an issue to get the correct element between dd4hep, lcgeo/k4geo and DDMarlinPandora depending on the used ILD detector.

The DDMarlinPandora CaloHitCreator code has the following debug statement : see https://github.com/iLCSoft/DDMarlinPandora/blob/master/src/DDCaloHitCreator.cc#L696

        auto staveDetElement = m_volumeManager.lookupDetElement( pCaloHit->getCellID0() );
        dd4hep::Position local1(0.0, 0.0, 0.0);
        dd4hep::Position local2(normalVector[0],normalVector[1],normalVector[2]);
        dd4hep::Position global1(0.0, 0.0, 0.0);
        dd4hep::Position global2(0.0, 0.0, 0.0);
        staveDetElement.nominal().localToWorld( local1, global1 );
        staveDetElement.nominal().localToWorld( local2, global2 );
        dd4hep::Position normal( global2-global1 );

        streamlog_out(DEBUG6) << "   detelement: " << staveDetElement.name()
			      << "   parent: " << staveDetElement.parent().name()
			      << "   grandparent: " << staveDetElement.parent().parent().name()
			      << "   cellID: " << pCaloHit->getCellID0()
                              << "   PhiLoc:"  << atan2( global1.y(), global1.x() )*180/M_PI
                              << "   PhiNor:"  << atan2( normal.y(), normal.x() )*180/M_PI
                              << " normal vector "
                              << std::setw(15) << normal.x()
                              << std::setw(15) << normal.y()
                              << std::setw(15) << normal.z()
                              << std::endl;

I'm producing single klong simulation using ddsim.

When running Marlin the code above produces the following kind of output (hit position dependent) :

  1. When using ILD geometry ILD_l5_v02

[ DEBUG6 "MyDDMarlinPandora"] detelement: stave5 parent: HcalBarrel grandparent: world cellID: 9704278 PhiLoc:0 PhiNor:-180 normal vector -1 -3.33067e-16 0

  1. When using ILD geometry ILD_l2_v02

[ DEBUG6 "MyDDMarlinPandora"] detelement: HcalBarrel parent: world grandparent: cellID: 64095606 PhiLoc:0 PhiNor:0 normal vector 0 0 1

  1. For both geometry, for the YokeBarrel hits

[ DEBUG6 "MyDDMarlinPandora"] detelement: stave4layer3module2 parent: module2 grandparent: YokeBarrel cellID: 103515 PhiLoc:3.50835e-15 PhiNor:3.50835e-15 normal vector 1 6.12323e-17 0

So, volumeManager.lookupDetElement( pCaloHit->getCellID0() ) returns stave detector element for detector/calorimeter/Yoke05_Barrel.cpp and for detector/calorimeter/SHcalSc04_Barrel_v04.cpp but returns the parent detector instead of the stave for detector/calorimeter/Hcal_Barrel_SD_v02.cpp

Looking at the 3 codes, I'm not enough familiar with dd4hep syntax to spot how to fix detector/calorimeter/Hcal_Barrel_SD_v02.cpp

@andresailer
Copy link
Contributor

https://github.com/key4hep/k4geo/blob/9e9c87f54addd5149616c5ad1e6974dac2b2ca60/detector/calorimeter/Hcal_Barrel_SD_v02.cpp seems to be missing DetElements at the right levels of the hierarchy.

Something like

const int staveCounter = (stave_id-1)*2+module_id-1;
DetElement stave(sdet, _toString(staveCounter,"stave%d"), staveCounter );
stave.setPlacement(pv);

here

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

No branches or pull requests

2 participants