-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added first example algorithm, ready for testing
- Loading branch information
Showing
8 changed files
with
160 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
// Copyright (C) 2022 Sylvester Joosten, Chao, Chao Peng, Whitney Armstrong | ||
|
||
/* | ||
* Reconstruct the cluster with Center of Gravity method | ||
* Logarithmic weighting is used for mimicing energy deposit in transverse direction | ||
* | ||
* Author: Sylvester Joosten, Chao Peng (ANL), 09/20/2022 | ||
*/ | ||
|
||
#include <JugAlgo/Algorithm.h> | ||
#include <algorithms/calorimetry/ClusterRecoCoG.h> | ||
|
||
#include "Gaudi/Property.h" | ||
|
||
namespace Jug::Reco { | ||
|
||
namespace { | ||
using AlgoBase = Jug::Algo::Algorithm<algorithms::calorimetry::ClusterRecoCoG>; | ||
} | ||
|
||
class ClusterRecoCoG : public AlgoBase { | ||
|
||
public: | ||
ClusterRecoCoG(const std::string& name, ISvcLocator* svcLoc) : AlgoBase(name, svcLoc) {} | ||
|
||
virtual StatusCode configure() { | ||
setAlgoProp("samplingFraction", m_sampFrac.value()); | ||
setAlgoProp("logWeightBase", m_logWeightBase.value()); | ||
setAlgoProp("energyWeight", m_energyWeight.value()); | ||
setAlgoProp("moduleDimZName", m_moduleDimZName.value()); | ||
setAlgoProp("enableEtaBounds", m_enableEtaBounds.value()); | ||
return StatusCode::SUCCESS; | ||
} | ||
|
||
private: | ||
Gaudi::Property<double> m_sampFrac{this, "samplingFraction", 1.0}; | ||
Gaudi::Property<double> m_logWeightBase{this, "logWeightBase", 3.6}; | ||
Gaudi::Property<std::string> m_energyWeight{this, "energyWeight", "log"}; | ||
Gaudi::Property<std::string> m_moduleDimZName{this, "moduleDimZName", ""}; | ||
Gaudi::Property<bool> m_enableEtaBounds{this, "enableEtaBounds", false}; | ||
}; | ||
|
||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) | ||
DECLARE_COMPONENT(ClusterRecoCoG) | ||
|
||
} // namespace Jug::Reco | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
|
||
namespace algorithms { | ||
|
||
// Simple name Mixin providing consistent name API | ||
class NameMixin { | ||
public: | ||
NameMixin(std::string_view name) : m_name{name} {} | ||
std::string_view name() const { return m_name; } | ||
|
||
private: | ||
const std::string m_name; | ||
}; | ||
|
||
} // namespace algorithms | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters