Commit 9ef05bb3 authored by Jihee Kim's avatar Jihee Kim
Browse files

Fixed where z length of the block is obtained

parent ea404f06
......@@ -32,6 +32,7 @@ class ClusterRecoCoG : public GaudiAlgorithm
{
public:
Gaudi::Property<double> m_logWeightBase{this, "logWeightBase", 3.6};
Gaudi::Property<std::string> m_moduleDimZName{this, "moduleDimZName", "CrystalBox_z_length"};
DataHandle<eic::ClusterCollection>
m_clusterCollection{"clusterCollection", Gaudi::DataHandle::Reader, this};
// Pointer to the geometry service
......@@ -110,8 +111,10 @@ private:
// depth
// @TODO, assume on the surface
auto dim = m_geoSvc->cellIDPositionConverter()->cellDimensions(centerID);
double depth = -dim[2]/2.;
// info() << depth << " (" << dim[0] << ", " << dim[1] << ", " << dim[2] << ")" << endmsg;
// z length of the crystal block
double depth = m_geoSvc->detector()->constantAsDouble(m_moduleDimZName);
//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));
cl.position({gpos.x(), gpos.y(), gpos.z()});
......
......@@ -79,7 +79,7 @@ public:
id, energy, time,
{gpos.x(), gpos.y(), gpos.z()},
{pos.x(), pos.y(), pos.z()},
{dim[0], dim[1], dim[2]},
{dim[0], dim[1], 0.0},
0
});
}
......
......@@ -19,7 +19,7 @@ emcalreco = CrystalEndcapsReco(inputHitCollection="RawDigiEcalHits", outputHitCo
minModuleEdep=1.0*units.MeV)
emcalcluster = IslandCluster(inputHitCollection="RecoEcalHits", outputClusterCollection="EcalClusters",
minClusterCenterEdep=30*units.MeV, groupRange=2.0)
clusterreco = RecoCoG(clusterCollection="EcalClusters", logWeightBase=4.2)
clusterreco = RecoCoG(clusterCollection="EcalClusters", logWeightBase=4.2, moduleDimZName="CrystalBox_z_length")
out = PodioOutput("out", filename="reco_emcal_electrons_npsim.root")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment