Commit 8122f9a3 authored by Chao Peng's avatar Chao Peng
Browse files

revert change in merger

parent 3c82469e
Pipeline #8073 failed with stages
in 8 minutes and 34 seconds
......@@ -22,12 +22,13 @@ emcaldigi = EcalTungstenSamplingDigi("ecal_digi",
inputTimeUnit=units.ns,
energyResolutions=[0., 0.02, 0.],
dynamicRangeADC=700*units.keV,
pedestalSigma=50,
pedestalSigma=40,
OutputLevel=DEBUG)
emcalreco = EcalTungstenSamplingReco("ecal_reco",
inputHitCollection="DigiEcalBarrelHits",
outputHitCollection="RecoEcalBarrelHits",
dynamicRangeADC=700*units.keV,
pedestalSigma=40,
OutputLevel=DEBUG)
# readout id definition for barrel ecal
# <id>system:8,barrel:3,module:4,layer:10,slice:5,x:32:-16,y:-16</id>
......@@ -45,7 +46,7 @@ emcalcluster = IslandCluster(inputHitCollection="RecoEcalBarrelHitsXY",
outputClusterCollection="EcalBarrelClusters",
minClusterCenterEdep=0.5*units.MeV,
splitCluster=False,
groupRange=10.0)
groupRanges=[5.*units.cm, 5*units.cm, 5.*units.cm])
clusterreco = RecoCoG(clusterCollection="EcalBarrelClusters", logWeightBase=6.2, OutputLevel=DEBUG)
......
......@@ -76,9 +76,10 @@ namespace Jug {
auto rawhits = m_outputHitCollection.createAndPut();
eic::RawCalorimeterHitCollection* rawHitCollection = new eic::RawCalorimeterHitCollection();
for (const auto& ahit : *simhits) {
double resval = m_normDist()*res[0] / sqrt(ahit.energyDeposit()*m_eUnit/GeV)
+ m_normDist()*res[1]
+ m_normDist()*res[2] / (ahit.energyDeposit()*m_eUnit/GeV);
double resval = std::pow(m_normDist()*res[0] / sqrt(ahit.energyDeposit()*m_eUnit/GeV), 2)
+ std::pow(m_normDist()*res[1], 2)
+ std::pow(m_normDist()*res[2] / (ahit.energyDeposit()*m_eUnit/GeV), 2);
resval = std::sqrt(resval);
double ped = m_pedMeanADC + m_normDist()*m_pedSigmaADC;
long long adc = std::llround(ped + ahit.energyDeposit()*(1. + resval) * m_eUnit/m_dyRangeADC*m_capADC);
eic::RawCalorimeterHit rawhit(
......
......@@ -38,6 +38,7 @@ namespace Jug::Reco {
public:
Gaudi::Property<bool> m_splitCluster{this, "splitCluster", true};
Gaudi::Property<double> m_groupRange{this, "groupRange", 1.8};
Gaudi::Property<std::vector<double>> u_groupRanges{this, "groupRanges", {}};
Gaudi::Property<double> m_minClusterCenterEdep{this, "minClusterCenterEdep", 50.0*MeV};
DataHandle<eic::CalorimeterHitCollection>
m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this};
......@@ -100,8 +101,15 @@ private:
// helper function to group hits
inline bool is_neighbor(const eic::ConstCalorimeterHit &h1, const eic::ConstCalorimeterHit &h2) const
{
return (std::abs(h1.local_x() - h2.local_x()) <= (h1.dim_x() + h2.dim_y())/2.*m_groupRange) &&
(std::abs(h1.local_y() - h2.local_y()) <= (h1.dim_y() + h2.dim_y())/2.*m_groupRange);
if (u_groupRanges.size() >= 3) {
return (std::abs(h1.local_x() - h2.local_x()) <= u_groupRanges[0]) &&
(std::abs(h1.local_y() - h2.local_y()) <= u_groupRanges[1]) &&
(std::abs(h1.local_z() - h2.local_z()) <= u_groupRanges[2]);
} else {
return (std::abs(h1.local_x() - h2.local_x()) <= m_groupRange*(h1.dim_x() + h2.dim_x())/2.) &&
(std::abs(h1.local_y() - h2.local_y()) <= m_groupRange*(h1.dim_y() + h2.dim_y())/2.) &&
(std::abs(h1.local_z() - h2.local_z()) <= m_groupRange*(h1.dim_z() + h2.dim_z())/2.);
}
}
// grouping function with Depth-First Search
......
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