Commit 4e9e4a73 authored by Chao Peng's avatar Chao Peng
Browse files

add units for digitization, correct weighting for cluster reconstruction

parent 50ee2ee6
......@@ -4,6 +4,7 @@
#include "GaudiAlg/GaudiTool.h"
#include "GaudiKernel/RndmGenerators.h"
#include "GaudiKernel/Property.h"
#include "GaudiKernel/PhysicalConstants.h"
// FCCSW
#include "JugBase/DataHandle.h"
......@@ -52,7 +53,8 @@ namespace Jug {
eic::RawCalorimeterHitCollection* rawHitCollection = new eic::RawCalorimeterHitCollection();
for(const auto& ahit : *simhits){
eic::RawCalorimeterHit rawhit((long long)ahit.cellID(), (long long)ahit.cellID(),
(long long)(ahit.energyDeposit() + m_gaussDist*sqrt(ahit.energyDeposit())) * 100.0, (double)ahit.truth().time);
(long long)(ahit.energyDeposit() + m_gaussDist*sqrt(ahit.energyDeposit()))/Gaudi::Units::MeV * 100.0,
(double)ahit.truth().time);
rawhits->push_back(rawhit);
}
return StatusCode::SUCCESS;
......
......@@ -31,7 +31,7 @@ namespace Jug::Reco {
class ClusterRecoCoG : public GaudiAlgorithm
{
public:
Gaudi::Property<double> m_logWeightThres{this, "logWeightThres", 4.2};
Gaudi::Property<double> m_logWeightBase{this, "logWeightBase", 3.6};
DataHandle<eic::ClusterCollection>
m_clusterCollection{"clusterCollection", Gaudi::DataHandle::Reader, this};
......@@ -75,7 +75,8 @@ private:
// center of gravity with logarithmic weighting
float totalW = 0., x = 0., y = 0., z = 0.;
for (auto &hit : cl.hits()) {
float weight = m_logWeightThres + std::log(hit.energy()/totalE);
// suppress low energy contributions
float weight = std::max(0., m_logWeightBase + std::log(hit.energy()/totalE));
totalW += weight;
x += hit.position().x * weight;
y += hit.position().y * weight;
......
......@@ -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", logWeightThres=4.2)
clusterreco = RecoCoG(clusterCollection="EcalClusters", logWeightBase=4.2)
out = PodioOutput("out", filename="reco_emcal_electrons_npsim.root")
......@@ -30,6 +30,6 @@ ApplicationMgr(
EvtSel = 'NONE',
EvtMax = 100,
ExtSvc = [podioevent],
OutputLevel=DEBUG
OutputLevel=ERROR
)
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