From 5cc6d81d069099066870f0fc4a52d018817b8299 Mon Sep 17 00:00:00 2001
From: Tong Li
Date: Thu, 14 Dec 2023 00:05:46 +0100
Subject: [PATCH] update with k4geo for SW FCCee
---
.../src/components/CaloTowerToolFCCee.cpp | 20 ++++++++--------
.../src/components/CaloTowerToolFCCee.h | 24 +++++++++++--------
.../CreateCaloClustersSlidingWindowFCCee.cpp | 1 -
.../CreateCaloClustersSlidingWindowFCCee.h | 4 ++--
4 files changed, 26 insertions(+), 23 deletions(-)
diff --git a/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.cpp b/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.cpp
index dd0ec91f..9b589148 100644
--- a/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.cpp
+++ b/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.cpp
@@ -1,9 +1,9 @@
#include "CaloTowerToolFCCee.h"
-// FCCSW
+// k4FWCore
#include "k4Interface/IGeoSvc.h"
-// datamodel
+// edm4hep
#include "edm4hep/CalorimeterHitCollection.h"
#include "edm4hep/Cluster.h"
#include "edm4hep/MutableCluster.h"
@@ -140,12 +140,12 @@ StatusCode CaloTowerToolFCCee::finalize() {
std::pair CaloTowerToolFCCee::retrievePhiThetaExtrema(dd4hep::DDSegmentation::Segmentation* aSegmentation, SegmentationType aType) {
double phiMax = -1;
double thetaMax = -1;
- dd4hep::DDSegmentation::FCCSWGridModuleThetaMerged* segmentation = nullptr;
+ dd4hep::DDSegmentation::FCCSWGridModuleThetaMerged_k4geo* segmentation = nullptr;
if (aSegmentation != nullptr) {
switch (aType) {
case SegmentationType::kModuleTheta: {
info() << "== Retrieving segmentation " << aSegmentation->name() << endmsg;
- segmentation = dynamic_cast(aSegmentation);
+ segmentation = dynamic_cast(aSegmentation);
phiMax = M_PI - M_PI/segmentation->nModules();
thetaMax = M_PI - fabs(segmentation->offsetTheta()) + segmentation->gridSizeTheta() * .5;
break;
@@ -155,7 +155,7 @@ std::pair CaloTowerToolFCCee::retrievePhiThetaExtrema(dd4hep::DD
double theta = -1;
info() << "== Retrieving multi segmentation " << aSegmentation->name() << endmsg;
for (const auto& subSegm: dynamic_cast(aSegmentation)->subSegmentations()) {
- segmentation = dynamic_cast(subSegm.segmentation);
+ segmentation = dynamic_cast(subSegm.segmentation);
phi = M_PI - M_PI/segmentation->nModules();
theta = M_PI - fabs(segmentation->offsetTheta()) + segmentation->gridSizeTheta() * .5;
if (theta > thetaMax) { thetaMax = theta;}
@@ -345,10 +345,10 @@ void CaloTowerToolFCCee::CellsIntoTowers(std::vector>& aTower
// tower index of the borders of the cell
int iTheta = 0;
int iPhi = 0;
- const dd4hep::DDSegmentation::FCCSWGridModuleThetaMerged* segmentation = nullptr;
+ const dd4hep::DDSegmentation::FCCSWGridModuleThetaMerged_k4geo* segmentation = nullptr;
const dd4hep::DDSegmentation::MultiSegmentation* multisegmentation = nullptr;
if( aType == SegmentationType::kModuleTheta) {
- segmentation = dynamic_cast(aSegmentation);
+ segmentation = dynamic_cast(aSegmentation);
} else if( aType == SegmentationType::kMulti) {
multisegmentation = dynamic_cast(aSegmentation);
}
@@ -357,7 +357,7 @@ void CaloTowerToolFCCee::CellsIntoTowers(std::vector>& aTower
pass = true;
// if multisegmentation is used - first find out which segmentation to use
if( aType == SegmentationType::kMulti) {
- segmentation = dynamic_cast(&multisegmentation->subsegmentation(cell.getCellID()));
+ segmentation = dynamic_cast(&multisegmentation->subsegmentation(cell.getCellID()));
}
if (m_useHalfTower) {
uint layerId = m_decoder->get(cell.getCellID(), "layer");
@@ -390,7 +390,7 @@ std::pair(
+ segmentation = dynamic_cast(
m_geoSvc->getDetector()->readout(aReadoutName).segmentation().segmentation());
if (segmentation == nullptr) {
segmentation = dynamic_cast(
@@ -402,7 +402,7 @@ std::pair(segmentation)->subSegmentations()) {
- subsegmentation = dynamic_cast(subSegm.segmentation);
+ subsegmentation = dynamic_cast(subSegm.segmentation);
if (subsegmentation == nullptr) {
warning() << "At least one of the sub-segmentations in MultiSegmentation named " << aReadoutName << " is not a module-theta grid." << endmsg;
return std::make_pair(nullptr, SegmentationType::kWrong);
diff --git a/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.h b/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.h
index 9ee78213..73556066 100644
--- a/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.h
+++ b/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.h
@@ -4,20 +4,16 @@
// from Gaudi
#include "GaudiAlg/GaudiTool.h"
-// FCCSW
-#include "DetSegmentation/FCCSWGridModuleThetaMerged.h"
+// k4geo
+#include "detectorSegmentations/FCCSWGridModuleThetaMerged_k4geo.h"
+
+// k4FWCore
#include "k4FWCore/DataHandle.h"
#include "k4Interface/ITowerToolThetaModule.h"
-
class IGeoSvc;
-#include "DDSegmentation/MultiSegmentation.h"
-// datamodel
-namespace edm4hep {
-class CalorimeterHitCollection;
-class CalorimeterHit;
-class Cluster;
-}
+// dd4hep
+#include "DDSegmentation/MultiSegmentation.h"
namespace dd4hep {
namespace DDSegmentation {
@@ -26,6 +22,14 @@ class BitFieldCoder;
}
}
+// edm4hep
+namespace edm4hep {
+class CalorimeterHitCollection;
+class CalorimeterHit;
+class Cluster;
+}
+
+
/** @class CaloTowerToolFCCee Reconstruction/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.h
*
* Tool building the calorimeter towers for the sliding window algorithm.
diff --git a/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.cpp b/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.cpp
index d00aa2c4..781e05f5 100644
--- a/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.cpp
+++ b/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.cpp
@@ -24,7 +24,6 @@ StatusCode CreateCaloClustersSlidingWindowFCCee::initialize() {
error() << "Unable to retrieve the tower building tool." << endmsg;
return StatusCode::FAILURE;
}
-
// Get number of calorimeter towers
auto towerMapSize = m_towerTool->towersNumber();
m_nThetaTower = towerMapSize.theta;
diff --git a/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.h b/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.h
index 2c184431..65fa4acb 100644
--- a/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.h
+++ b/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.h
@@ -5,11 +5,11 @@
#include "GaudiAlg/GaudiAlgorithm.h"
#include "GaudiKernel/ToolHandle.h"
-// FCCSW
+// k4FWCore
#include "k4FWCore/DataHandle.h"
#include "k4Interface/ITowerToolThetaModule.h"
-// datamodel
+// edm4hep
namespace edm4hep {
class ClusterCollection;
}