Skip to content

Commit 8e8285b

Browse files
authored
[PWGJE,EMCAL] Add new clusterizer definitions, add new dispersion tables and QA p… (#17948)
1 parent 467bc4f commit 8e8285b

3 files changed

Lines changed: 74 additions & 35 deletions

File tree

PWGJE/DataModel/EMCALClusters.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ inline const EMCALClusterDefinition kV3SmallestTimeDiff(ClusterAlgorithm::kV3, 4
5050
inline const EMCALClusterDefinition kV3MostSplitSmallTimeDiff(ClusterAlgorithm::kV3, 43, 1, "kV3MostSplitSmallTimeDiff", 0.5, 0.1, -10000, 10000, 500, true, 0., false);
5151
inline const EMCALClusterDefinition kV3MostSplitSmallerTimeDiff(ClusterAlgorithm::kV3, 44, 1, "kV3MostSplitSmallerTimeDiff", 0.5, 0.1, -10000, 10000, 100, true, 0., false);
5252
inline const EMCALClusterDefinition kV3MostSplitSmallestTimeDiff(ClusterAlgorithm::kV3, 45, 1, "kV3MostSplitSmallestTimeDiff", 0.5, 0.1, -10000, 10000, 50, true, 0., false);
53+
inline const EMCALClusterDefinition kV3SmallTimeDiffLowestSeed(ClusterAlgorithm::kV3, 46, 1, "kV3SmallTimeDiffLowestSeed", 0.1, 0.1, -10000, 10000, 500, true, 0.03, false);
54+
inline const EMCALClusterDefinition kV3SmallerTimeDiffLowSeed(ClusterAlgorithm::kV3, 47, 1, "kV3SmallerTimeDiffLowSeed", 0.3, 0.1, -10000, 10000, 100, true, 0.03, false);
55+
inline const EMCALClusterDefinition kV3SmallestTimeDiffLowerSeed(ClusterAlgorithm::kV3, 48, 1, "kV3SmallestTimeDiffLowerSeed", 0.2, 0.1, -10000, 10000, 50, true, 0.03, false);
5356
inline const EMCALClusterDefinition kV3MostSplitSmallestTimeDiffLowestSeed(ClusterAlgorithm::kV3, 50, 1, "kV3MostSplitSmallestTimeDiffLowestSeed", 0.1, 0.1, -10000, 10000, 50, true, 0., false);
5457
inline const EMCALClusterDefinition kV3MostSplitSmallestTimeDiffLowSeed(ClusterAlgorithm::kV3, 51, 1, "kV3MostSplitSmallestTimeDiffLowSeed", 0.3, 0.1, -10000, 10000, 50, true, 0., false);
5558
inline const EMCALClusterDefinition kV3MostSplitSmallestTimeDiffLowerSeed(ClusterAlgorithm::kV3, 52, 1, "kV3MostSplitSmallestTimeDiffLowerSeed", 0.2, 0.1, -10000, 10000, 50, true, 0., false);
@@ -94,6 +97,12 @@ inline const EMCALClusterDefinition& getClusterDefinitionFromID(int storageID)
9497
return kV3MostSplitSmallerTimeDiff;
9598
case 45:
9699
return kV3MostSplitSmallestTimeDiff;
100+
case 46:
101+
return kV3SmallTimeDiffLowestSeed;
102+
case 47:
103+
return kV3SmallerTimeDiffLowSeed;
104+
case 48:
105+
return kV3SmallestTimeDiffLowerSeed;
97106
case 50:
98107
return kV3MostSplitSmallestTimeDiffLowestSeed;
99108
case 51:
@@ -128,6 +137,9 @@ inline const EMCALClusterDefinition& getClusterDefinitionFromString(const std::s
128137
{"kV3MostSplitSmallTimeDiff", 43},
129138
{"kV3MostSplitSmallerTimeDiff", 44},
130139
{"kV3MostSplitSmallestTimeDiff", 45},
140+
{"kV3SmallTimeDiffLowestSeed", 46},
141+
{"kV3SmallerTimeDiffLowSeed", 47},
142+
{"kV3SmallestTimeDiffLowerSeed", 48},
131143
{"kV3MostSplitSmallestTimeDiffLowestSeed", 50},
132144
{"kV3MostSplitSmallestTimeDiffLowSeed", 51},
133145
{"kV3MostSplitSmallestTimeDiffLowerSeed", 52},
@@ -156,6 +168,7 @@ DECLARE_SOA_COLUMN(IsExotic, isExotic, bool); //! flag
156168
DECLARE_SOA_COLUMN(DistanceToBadChannel, distanceToBadChannel, float); //! distance to bad channel
157169
DECLARE_SOA_COLUMN(NLM, nlm, int); //! number of local maxima
158170
DECLARE_SOA_COLUMN(Definition, definition, int); //! cluster definition, see EMCALClusterDefinition.h
171+
DECLARE_SOA_COLUMN(Dispersion, dispersion, float); //! cluster energy dispersion (cells)
159172

160173
} // namespace emcalcluster
161174
// table of clusters that could be matched to a collision
@@ -174,6 +187,12 @@ DECLARE_SOA_TABLE(EMCALAmbiguousClusters, "AOD", "EMCALAMBCLUS", //!
174187
using EMCALCluster = EMCALClusters::iterator;
175188
using EMCALAmbiguousCluster = EMCALAmbiguousClusters::iterator;
176189

190+
DECLARE_SOA_TABLE(Dispersions, "AOD", "DISPERSIONS", //!
191+
o2::soa::Index<>, emcalcluster::Dispersion);
192+
193+
DECLARE_SOA_TABLE(AmbigousDispersions, "AOD", "AMBDISPERSIONS", //!
194+
o2::soa::Index<>, emcalcluster::Dispersion);
195+
177196
namespace emcalclustermc
178197
{
179198
DECLARE_SOA_ARRAY_INDEX_COLUMN(McParticle, mcParticle); //! Array of MC particles that deposited energy in this calo cell

PWGJE/TableProducer/emcalCorrectionTask.cxx

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include <Framework/AnalysisDataModel.h>
4646
#include <Framework/AnalysisHelpers.h>
4747
#include <Framework/AnalysisTask.h>
48+
#include <Framework/Concepts.h>
4849
#include <Framework/Configurable.h>
4950
#include <Framework/Expressions.h>
5051
#include <Framework/HistogramRegistry.h>
@@ -96,8 +97,10 @@ enum CellScaleMode {
9697
struct EmcalCorrectionTask {
9798
Produces<o2::aod::EMCALClusters> clusters;
9899
Produces<o2::aod::EMCALMCClusters> mcclusters;
100+
Produces<o2::aod::Dispersions> dispersions;
99101
Produces<o2::aod::EMCALAmbiguousClusters> clustersAmbiguous;
100102
Produces<o2::aod::EMCALAmbiguousMCClusters> mcclustersAmbiguous;
103+
Produces<o2::aod::AmbigousDispersions> ambigousDispersions;
101104
Produces<o2::aod::EMCALClusterCells> clustercells; // cells belonging to given cluster
102105
Produces<o2::aod::EMCALAmbiguousClusterCells> clustercellsambiguous;
103106
Produces<o2::aod::EMCALMatchedTracks> matchedTracks;
@@ -404,7 +407,7 @@ struct EmcalCorrectionTask {
404407
}
405408
}
406409

407-
template <typename BCType>
410+
template <o2::soa::is_iterator BCType>
408411
void initZorroCCDB(const BCType& bc)
409412
{
410413
if (applySoftwareTriggerSelection) {
@@ -422,7 +425,9 @@ struct EmcalCorrectionTask {
422425
{
423426
LOG(debug) << "Starting process full.";
424427
clusters.reserve(MaxClusterPerDFPerClusterizer * mClusterizers.size());
428+
dispersions.reserve(MaxClusterPerDFPerClusterizer * mClusterizers.size());
425429
clustersAmbiguous.reserve(MaxAmbClusterPerDFPerClusterizer * mClusterizers.size());
430+
ambigousDispersions.reserve(MaxAmbClusterPerDFPerClusterizer * mClusterizers.size());
426431
clustercells.reserve(MaxCellsPerClusterPerDFPerClusterizer * mClusterizers.size());
427432
clustercellsambiguous.reserve(MaxCellsPerAmbClusterPerDFPerClusterizer * mClusterizers.size());
428433

@@ -529,7 +534,7 @@ struct EmcalCorrectionTask {
529534

530535
// Store the clusters in the table where a matching collision could
531536
// be identified.
532-
fillClusterTable<CollEventSels::filtered_iterator>(col, vertexPos, iClusterizer, cellIndicesBC, &indexMapPair, &trackGlobalIndex);
537+
fillClusterTable<CollEventSels::filtered_iterator>(col, vertexPos, iClusterizer, cellIndicesBC, &indexMapPair, &trackGlobalIndex, nullptr, nullptr);
533538
} else {
534539
mHistManager.fill(HIST("hBCMatchErrors"), 2);
535540
}
@@ -582,7 +587,9 @@ struct EmcalCorrectionTask {
582587
LOG(debug) << "Starting process full.";
583588

584589
clusters.reserve(MaxClusterPerDFPerClusterizer * mClusterizers.size());
590+
dispersions.reserve(MaxClusterPerDFPerClusterizer * mClusterizers.size());
585591
clustersAmbiguous.reserve(MaxAmbClusterPerDFPerClusterizer * mClusterizers.size());
592+
ambigousDispersions.reserve(MaxAmbClusterPerDFPerClusterizer * mClusterizers.size());
586593
clustercells.reserve(MaxCellsPerClusterPerDFPerClusterizer * mClusterizers.size());
587594
clustercellsambiguous.reserve(MaxCellsPerAmbClusterPerDFPerClusterizer * mClusterizers.size());
588595

@@ -748,8 +755,10 @@ struct EmcalCorrectionTask {
748755

749756
clusters.reserve(MaxClusterPerDFPerClusterizer * mClusterizers.size());
750757
mcclusters.reserve(MaxClusterPerDFPerClusterizer * mClusterizers.size());
758+
dispersions.reserve(MaxClusterPerDFPerClusterizer * mClusterizers.size());
751759
clustersAmbiguous.reserve(MaxAmbClusterPerDFPerClusterizer * mClusterizers.size());
752760
mcclustersAmbiguous.reserve(MaxAmbClusterPerDFPerClusterizer * mClusterizers.size());
761+
ambigousDispersions.reserve(MaxAmbClusterPerDFPerClusterizer * mClusterizers.size());
753762
clustercells.reserve(MaxCellsPerClusterPerDFPerClusterizer * mClusterizers.size());
754763
clustercellsambiguous.reserve(MaxCellsPerAmbClusterPerDFPerClusterizer * mClusterizers.size());
755764

@@ -943,8 +952,10 @@ struct EmcalCorrectionTask {
943952

944953
clusters.reserve(MaxClusterPerDFPerClusterizer * mClusterizers.size());
945954
mcclusters.reserve(MaxClusterPerDFPerClusterizer * mClusterizers.size());
955+
dispersions.reserve(MaxClusterPerDFPerClusterizer * mClusterizers.size());
946956
clustersAmbiguous.reserve(MaxAmbClusterPerDFPerClusterizer * mClusterizers.size());
947957
mcclustersAmbiguous.reserve(MaxAmbClusterPerDFPerClusterizer * mClusterizers.size());
958+
ambigousDispersions.reserve(MaxAmbClusterPerDFPerClusterizer * mClusterizers.size());
948959
clustercells.reserve(MaxCellsPerClusterPerDFPerClusterizer * mClusterizers.size());
949960
clustercellsambiguous.reserve(MaxCellsPerAmbClusterPerDFPerClusterizer * mClusterizers.size());
950961

@@ -1139,7 +1150,9 @@ struct EmcalCorrectionTask {
11391150
LOG(debug) << "Starting process standalone.";
11401151

11411152
clusters.reserve(MaxClusterPerDFPerClusterizer * mClusterizers.size());
1153+
dispersions.reserve(MaxClusterPerDFPerClusterizer * mClusterizers.size());
11421154
clustersAmbiguous.reserve(MaxAmbClusterPerDFPerClusterizer * mClusterizers.size());
1155+
ambigousDispersions.reserve(MaxAmbClusterPerDFPerClusterizer * mClusterizers.size());
11431156
clustercells.reserve(MaxCellsPerClusterPerDFPerClusterizer * mClusterizers.size());
11441157
clustercellsambiguous.reserve(MaxCellsPerAmbClusterPerDFPerClusterizer * mClusterizers.size());
11451158

@@ -1303,12 +1316,11 @@ struct EmcalCorrectionTask {
13031316
LOG(debug) << "Converted to analysis clusters.";
13041317
}
13051318

1306-
template <typename Collision>
1319+
template <o2::soa::is_iterator Collision>
13071320
void fillClusterTable(Collision const& col, math_utils::Point3D<float> const& vertexPos, size_t iClusterizer, const gsl::span<int64_t> cellIndicesBC, MatchResult* indexMapPair = nullptr, const std::vector<int64_t>* trackGlobalIndex = nullptr, MatchResult* indexMapPairSecondaries = nullptr, const std::vector<int64_t>* secondariesGlobalIndex = nullptr)
13081321
{
13091322
// get the clusterType once
13101323
const auto clusterType = static_cast<int>(mClusterDefinitions[iClusterizer]);
1311-
13121324
int cellindex = -1;
13131325
unsigned int iCluster = 0;
13141326
float energy = 0.f;
@@ -1341,11 +1353,11 @@ struct EmcalCorrectionTask {
13411353
cluster.getClusterTime(), cluster.getIsExotic(),
13421354
cluster.getDistanceToBadChannel(), cluster.getNExMax(),
13431355
clusterType);
1356+
dispersions(cluster.getDispersion());
13441357
++nCluster;
13451358
if (!mClusterLabels.empty()) {
13461359
mcclusters(mClusterLabels[iCluster].getLabels(), mClusterLabels[iCluster].getEnergyFractions());
13471360
}
1348-
// loop over cells in cluster and save to table
13491361
for (int ncell = 0; ncell < cluster.getNCells(); ncell++) {
13501362
cellindex = cluster.getCellIndex(ncell);
13511363
LOG(debug) << "trying to find cell index " << cellindex << " in map";
@@ -1391,7 +1403,7 @@ struct EmcalCorrectionTask {
13911403
} // end of cluster loop
13921404
}
13931405

1394-
template <typename BC>
1406+
template <o2::soa::is_iterator BC>
13951407
void fillAmbigousClusterTable(BC const& bc, size_t iClusterizer, const gsl::span<int64_t> cellIndicesBC, bool hasCollision)
13961408
{
13971409
int cellindex = -1;
@@ -1426,6 +1438,7 @@ struct EmcalCorrectionTask {
14261438
cluster.getM20(), cluster.getNCells(), cluster.getClusterTime(),
14271439
cluster.getIsExotic(), cluster.getDistanceToBadChannel(),
14281440
cluster.getNExMax(), static_cast<int>(mClusterDefinitions.at(iClusterizer)));
1441+
ambigousDispersions(cluster.getDispersion());
14291442
++nClusterAmb;
14301443
if (!mClusterLabels.empty()) {
14311444
mcclustersAmbiguous(mClusterLabels[iCluster].getLabels(), mClusterLabels[iCluster].getEnergyFractions());
@@ -1439,7 +1452,7 @@ struct EmcalCorrectionTask {
14391452
} // end of cluster loop
14401453
}
14411454

1442-
template <typename Collision>
1455+
template <o2::soa::is_iterator Collision>
14431456
void doTrackMatching(Collision const& col, MyGlobTracks const& tracks, MatchResult& indexMapPair, std::vector<int64_t>& trackGlobalIndex)
14441457
{
14451458
auto groupedTracks = tracks.sliceBy(perCollision, col.globalIndex());
@@ -1455,7 +1468,7 @@ struct EmcalCorrectionTask {
14551468
indexMapPair = matchTracksToCluster(mClusterPhi, mClusterEta, trackPhi, trackEta, maxMatchingDistance, MaxMatchesPerCluster);
14561469
}
14571470

1458-
template <typename Collision>
1471+
template <o2::soa::is_iterator Collision>
14591472
void doSecondaryTrackMatching(Collision const& col, EMV0Legs const& v0legs, MatchResult& indexMapPair, std::vector<int64_t>& trackGlobalIndex, MyGlobTracks const& tracks)
14601473
{
14611474
auto groupedV0Legs = v0legs.sliceBy(perCollisionEMV0Legs, col.globalIndex());
@@ -1491,7 +1504,7 @@ struct EmcalCorrectionTask {
14911504
indexMapPair = matchTracksToCluster(mClusterPhi, mClusterEta, trackPhi, trackEta, maxMatchingDistance, MaxMatchesPerCluster);
14921505
}
14931506

1494-
template <typename Tracks>
1507+
template <o2::soa::is_table Tracks>
14951508
void fillTrackInfo(Tracks const& tracks, std::vector<float>& trackPhi, std::vector<float>& trackEta, std::vector<int64_t>& trackGlobalIndex)
14961509
{
14971510
for (const auto& track : tracks) {

0 commit comments

Comments
 (0)