Skip to content
Snippets Groups Projects

z length of the crystal block

Merged Jihee Kim requested to merge jihee.kim/juggler:master into master
2 unresolved threads
3 files
+ 7
4
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -32,6 +32,7 @@ class ClusterRecoCoG : public GaudiAlgorithm
@@ -32,6 +32,7 @@ class ClusterRecoCoG : public GaudiAlgorithm
{
{
public:
public:
Gaudi::Property<double> m_logWeightBase{this, "logWeightBase", 3.6};
Gaudi::Property<double> m_logWeightBase{this, "logWeightBase", 3.6};
 
Gaudi::Property<std::string> m_moduleDimZName{this, "moduleDimZName", "CrystalBox_z_length"};
DataHandle<eic::ClusterCollection>
DataHandle<eic::ClusterCollection>
m_clusterCollection{"clusterCollection", Gaudi::DataHandle::Reader, this};
m_clusterCollection{"clusterCollection", Gaudi::DataHandle::Reader, this};
// Pointer to the geometry service
// Pointer to the geometry service
@@ -110,8 +111,10 @@ private:
@@ -110,8 +111,10 @@ private:
// depth
// depth
// @TODO, assume on the surface
// @TODO, assume on the surface
auto dim = m_geoSvc->cellIDPositionConverter()->cellDimensions(centerID);
auto dim = m_geoSvc->cellIDPositionConverter()->cellDimensions(centerID);
Please register or sign in to reply
double depth = -dim[2]/2.;
// z length of the crystal block
// info() << depth << " (" << dim[0] << ", " << dim[1] << ", " << dim[2] << ")" << endmsg;
double depth = m_geoSvc->detector()->constantAsDouble(m_moduleDimZName);
    • Since it is a constant, the best way is to add a double depth as a data member of this class, and extract the value in the initialize() function.

      • BTW, depth_correction should be -z_length/2. if you are going to bring the cluster to the module surface.

        Edited by Chao Peng
      • Author Maintainer

        When I checked a position of detector, the z position in global coordinates is at the back of crystal block. So to get to surface, it had to use entire length of block.

        Edited by Jihee Kim
      • Please register or sign in to reply
Please register or sign in to reply
 
//info() << "z_length " << depth << endmsg;
 
// info() << depth << " (" << dim[0] << ", " << dim[1] << ", " << dim[2] << ")" << endmsg;
auto gpos = alignment.localToWorld(dd4hep::Position(x/tw, y/tw, z/tw + depth));
auto gpos = alignment.localToWorld(dd4hep::Position(x/tw, y/tw, z/tw + depth));
cl.position({gpos.x(), gpos.y(), gpos.z()});
cl.position({gpos.x(), gpos.y(), gpos.z()});
Loading