Skip to content

Commit

Permalink
[PWGJE,EMCAL-670] Add time differences into the clusterdefinition (#8896
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mhemmer-cern authored Dec 11, 2024
1 parent a3e641d commit ea40bb3
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 24 deletions.
18 changes: 9 additions & 9 deletions PWGJE/DataModel/EMCALClusterDefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

// Class for the cluster definition, i.e. what is considered a cluster by the clusterizer.
// The cluster definition contains information about the used algorithm, seed threshold,
// cell energy, gradient as well as timing cut
//
/// \author Florian Jonas <florian.jonas@cern.ch>
/// \file EMCALClusterDefinition.h
/// \brief Class for the cluster definition, i.e. what is considered a cluster by the clusterizer. The cluster definition contains information about the used algorithm, seed threshold, cell energy, gradient as well as timing cut
/// \author Florian Jonas <florian.jonas@cern.ch>, Marvin Hemmer <marvin.hemmer@cern.ch>

#ifndef PWGJE_DATAMODEL_EMCALCLUSTERDEFINITION_H_
#define PWGJE_DATAMODEL_EMCALCLUSTERDEFINITION_H_
Expand All @@ -38,16 +36,17 @@ struct EMCALClusterDefinition {
std::string name = "kUndefined"; // name of the cluster definition
double seedEnergy = 0.1; // seed threshold (GeV)
double minCellEnergy = 0.05; // minimum cell energy (GeV)
double timeMin = -10000; // minimum time (ns)
double timeMax = 10000; // maximum time (ns)
double timeMin = -10000.; // minimum time (ns)
double timeMax = 10000.; // maximum time (ns)
double timeDiff = 20000.; // maximum time difference (ns) between seed cell and aggregation cell
bool doGradientCut = true; // apply gradient cut if true
double gradientCut = -1; // gradient cut
bool recalcShowerShape5x5 = false; // recalculate shower shape using 5x5 cells

// default constructor
EMCALClusterDefinition() = default;
// constructor
EMCALClusterDefinition(ClusterAlgorithm_t pAlgorithm, int pStorageID, int pSelectedCellType, std::string pName, double pSeedEnergy, double pMinCellEnergy, double pTimeMin, double pTimeMax, bool pDoGradientCut, double pGradientCut, bool precalcShowerShape5x5)
EMCALClusterDefinition(ClusterAlgorithm_t pAlgorithm, int pStorageID, int pSelectedCellType, std::string pName, double pSeedEnergy, double pMinCellEnergy, double pTimeMin, double pTimeMax, double ptimeDiff, bool pDoGradientCut, double pGradientCut, bool precalcShowerShape5x5)
{
algorithm = pAlgorithm;
storageID = pStorageID;
Expand All @@ -57,6 +56,7 @@ struct EMCALClusterDefinition {
minCellEnergy = pMinCellEnergy;
timeMin = pTimeMin;
timeMax = pTimeMax;
timeDiff = ptimeDiff;
doGradientCut = pDoGradientCut;
gradientCut = pGradientCut;
recalcShowerShape5x5 = precalcShowerShape5x5;
Expand All @@ -65,7 +65,7 @@ struct EMCALClusterDefinition {
// implement comparison operators for int std::string and ClusterAlgorithm_t
bool operator==(const EMCALClusterDefinition& rhs) const
{
return (algorithm == rhs.algorithm && storageID == rhs.storageID && name == rhs.name && seedEnergy == rhs.seedEnergy && minCellEnergy == rhs.minCellEnergy && timeMin == rhs.timeMin && timeMax == rhs.timeMax && gradientCut == rhs.gradientCut && doGradientCut == rhs.doGradientCut && recalcShowerShape5x5 == rhs.recalcShowerShape5x5);
return (algorithm == rhs.algorithm && storageID == rhs.storageID && name == rhs.name && seedEnergy == rhs.seedEnergy && minCellEnergy == rhs.minCellEnergy && timeMin == rhs.timeMin && timeMax == rhs.timeMax && timeDiff == rhs.timeDiff && gradientCut == rhs.gradientCut && doGradientCut == rhs.doGradientCut && recalcShowerShape5x5 == rhs.recalcShowerShape5x5);
}
bool operator!=(const EMCALClusterDefinition& rhs) const
{
Expand Down
44 changes: 31 additions & 13 deletions PWGJE/DataModel/EMCALClusters.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

// Table definitions for EMCAL analysis clusters
//
/// \file EMCALClusters.h
/// \brief Table definitions for EMCAL analysis clusters
/// \author Raymond Ehlers <raymond.ehlers@cern.ch>, ORNL

#ifndef PWGJE_DATAMODEL_EMCALCLUSTERS_H_
Expand All @@ -28,17 +28,23 @@ namespace emcalcluster

// define global cluster definitions
// New definitions should be added here!
const EMCALClusterDefinition kV3NoSplit(ClusterAlgorithm_t::kV3, 0, 1, "kV3NoSplit", 0.5, 0.1, -10000, 10000, false, 0., false);
const EMCALClusterDefinition kV3NoSplitLowSeed(ClusterAlgorithm_t::kV3, 1, 1, "kV3NoSplitLowSeed", 0.3, 0.1, -10000, 10000, false, 0., false);
const EMCALClusterDefinition kV3NoSplitLowerSeed(ClusterAlgorithm_t::kV3, 2, 1, "kV3NoSplitLowerSeed", 0.2, 0.1, -10000, 10000, false, 0., false);
const EMCALClusterDefinition kV3Default(ClusterAlgorithm_t::kV3, 10, 1, "kV3Default", 0.5, 0.1, -10000, 10000, true, 0.03, false);
const EMCALClusterDefinition kV3MostSplit(ClusterAlgorithm_t::kV3, 11, 1, "kV3MostSplit", 0.5, 0.1, -10000, 10000, true, 0., false);
const EMCALClusterDefinition kV3LowSeed(ClusterAlgorithm_t::kV3, 12, 1, "kV3LowSeed", 0.3, 0.1, -10000, 10000, true, 0.03, false);
const EMCALClusterDefinition kV3MostSplitLowSeed(ClusterAlgorithm_t::kV3, 13, 1, "kV3MostSplitLowSeed", 0.3, 0.1, -10000, 10000, true, 0., false);
const EMCALClusterDefinition kV3StrictTime(ClusterAlgorithm_t::kV3, 20, 1, "kV3StrictTime", 0.5, 0.1, -500, 500, true, 0.03, false);
const EMCALClusterDefinition kV3StricterTime(ClusterAlgorithm_t::kV3, 21, 1, "kV3StricterTime", 0.5, 0.1, -100, 100, true, 0.03, false);
const EMCALClusterDefinition kV3MostStrictTime(ClusterAlgorithm_t::kV3, 22, 1, "kV3MostStrictTime", 0.5, 0.1, -50, 50, true, 0.03, false);
const EMCALClusterDefinition kV3Default5x5(ClusterAlgorithm_t::kV3, 30, 1, "kV3Default5x5", 0.5, 0.1, -10000, 10000, true, 0.03, true);
const EMCALClusterDefinition kV3NoSplit(ClusterAlgorithm_t::kV3, 0, 1, "kV3NoSplit", 0.5, 0.1, -10000, 10000, 20000, false, 0., false);
const EMCALClusterDefinition kV3NoSplitLowSeed(ClusterAlgorithm_t::kV3, 1, 1, "kV3NoSplitLowSeed", 0.3, 0.1, -10000, 10000, 20000, false, 0., false);
const EMCALClusterDefinition kV3NoSplitLowerSeed(ClusterAlgorithm_t::kV3, 2, 1, "kV3NoSplitLowerSeed", 0.2, 0.1, -10000, 10000, 20000, false, 0., false);
const EMCALClusterDefinition kV3Default(ClusterAlgorithm_t::kV3, 10, 1, "kV3Default", 0.5, 0.1, -10000, 10000, 20000, true, 0.03, false);
const EMCALClusterDefinition kV3MostSplit(ClusterAlgorithm_t::kV3, 11, 1, "kV3MostSplit", 0.5, 0.1, -10000, 10000, 20000, true, 0., false);
const EMCALClusterDefinition kV3LowSeed(ClusterAlgorithm_t::kV3, 12, 1, "kV3LowSeed", 0.3, 0.1, -10000, 10000, 20000, true, 0.03, false);
const EMCALClusterDefinition kV3MostSplitLowSeed(ClusterAlgorithm_t::kV3, 13, 1, "kV3MostSplitLowSeed", 0.3, 0.1, -10000, 10000, 20000, true, 0., false);
const EMCALClusterDefinition kV3StrictTime(ClusterAlgorithm_t::kV3, 20, 1, "kV3StrictTime", 0.5, 0.1, -500, 500, 20000, true, 0.03, false);
const EMCALClusterDefinition kV3StricterTime(ClusterAlgorithm_t::kV3, 21, 1, "kV3StricterTime", 0.5, 0.1, -100, 100, 20000, true, 0.03, false);
const EMCALClusterDefinition kV3MostStrictTime(ClusterAlgorithm_t::kV3, 22, 1, "kV3MostStrictTime", 0.5, 0.1, -50, 50, 20000, true, 0.03, false);
const EMCALClusterDefinition kV3Default5x5(ClusterAlgorithm_t::kV3, 30, 1, "kV3Default5x5", 0.5, 0.1, -10000, 10000, 20000, true, 0.03, true);
const EMCALClusterDefinition kV3SmallTimeDiff(ClusterAlgorithm_t::kV3, 40, 1, "kV3SmallTimeDiff", 0.5, 0.1, -10000, 10000, 500, true, 0.03, false);
const EMCALClusterDefinition kV3SmallerTimeDiff(ClusterAlgorithm_t::kV3, 41, 1, "kV3SmallerTimeDiff", 0.5, 0.1, -10000, 10000, 100, true, 0.03, false);
const EMCALClusterDefinition kV3SmallestTimeDiff(ClusterAlgorithm_t::kV3, 42, 1, "kV3SmallestTimeDiff", 0.5, 0.1, -10000, 10000, 50, true, 0.03, false);
const EMCALClusterDefinition kV3MostSplitSmallTimeDiff(ClusterAlgorithm_t::kV3, 43, 1, "kV3MostSplitSmallTimeDiff", 0.5, 0.1, -10000, 10000, 500, true, 0., false);
const EMCALClusterDefinition kV3MostSplitSmallerTimeDiff(ClusterAlgorithm_t::kV3, 44, 1, "kV3MostSplitSmallerTimeDiff", 0.5, 0.1, -10000, 10000, 100, true, 0., false);
const EMCALClusterDefinition kV3MostSplitSmallestTimeDiff(ClusterAlgorithm_t::kV3, 45, 1, "kV3MostSplitSmallestTimeDiff", 0.5, 0.1, -10000, 10000, 50, true, 0., false);

/// \brief function returns EMCALClusterDefinition for the given name
/// \param name name of the cluster definition
Expand Down Expand Up @@ -67,6 +73,18 @@ const EMCALClusterDefinition getClusterDefinitionFromString(const std::string& c
return kV3MostStrictTime;
} else if (clusterDefinitionName == "kV3Default5x5") {
return kV3Default5x5;
} else if (clusterDefinitionName == "kV3SmallTimeDiff") {
return kV3SmallTimeDiff;
} else if (clusterDefinitionName == "kV3SmallerTimeDiff") {
return kV3SmallerTimeDiff;
} else if (clusterDefinitionName == "kV3SmallestTimeDiff") {
return kV3SmallestTimeDiff;
} else if (clusterDefinitionName == "kV3MostSplitSmallTimeDiff") {
return kV3MostSplitSmallTimeDiff;
} else if (clusterDefinitionName == "kV3MostSplitSmallerTimeDiff") {
return kV3MostSplitSmallerTimeDiff;
} else if (clusterDefinitionName == "kV3MostSplitSmallestTimeDiff") {
return kV3MostSplitSmallestTimeDiff;
} else {
throw std::invalid_argument("Cluster definition name not recognized");
}
Expand Down
5 changes: 3 additions & 2 deletions PWGJE/TableProducer/emcalCorrectionTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,15 @@ struct EmcalCorrectionTask {
mClusterFactories.setExoticCellInCrossMinAmplitude(exoticCellInCrossMinAmplitude);
mClusterFactories.setUseWeightExotic(useWeightExotic);
for (const auto& clusterDefinition : mClusterDefinitions) {
mClusterizers.emplace_back(std::make_unique<o2::emcal::Clusterizer<o2::emcal::Cell>>(1E9, clusterDefinition.timeMin, clusterDefinition.timeMax, clusterDefinition.gradientCut, clusterDefinition.doGradientCut, clusterDefinition.seedEnergy, clusterDefinition.minCellEnergy));
mClusterizers.emplace_back(std::make_unique<o2::emcal::Clusterizer<o2::emcal::Cell>>(clusterDefinition.timeDiff, clusterDefinition.timeMin, clusterDefinition.timeMax, clusterDefinition.gradientCut, clusterDefinition.doGradientCut, clusterDefinition.seedEnergy, clusterDefinition.minCellEnergy));
LOG(info) << "Cluster definition initialized: " << clusterDefinition.toString();
LOG(info) << "timeMin: " << clusterDefinition.timeMin;
LOG(info) << "timeMax: " << clusterDefinition.timeMax;
LOG(info) << "timeDiff: " << clusterDefinition.timeDiff;
LOG(info) << "gradientCut: " << clusterDefinition.gradientCut;
LOG(info) << "seedEnergy: " << clusterDefinition.seedEnergy;
LOG(info) << "minCellEnergy: " << clusterDefinition.minCellEnergy;
LOG(info) << "storageID" << clusterDefinition.storageID;
LOG(info) << "storageID: " << clusterDefinition.storageID;
}
for (const auto& clusterizer : mClusterizers) {
clusterizer->setGeometry(geometry);
Expand Down

0 comments on commit ea40bb3

Please sign in to comment.