ATLAS Offline Software
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ActsTrk::HgtdTimedClusteringTool Class Reference

#include <HgtdTimedClusteringTool.h>

Inheritance diagram for ActsTrk::HgtdTimedClusteringTool:
Collaboration diagram for ActsTrk::HgtdTimedClusteringTool:

Classes

struct  Cluster
 

Public Types

using Cell = Hgtd::UnpackedHgtdRDO
 
using CellCollection = std::vector< Cell >
 
using ClusterCollection = std::vector< Cluster >
 

Public Member Functions

 HgtdTimedClusteringTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
virtual StatusCode clusterize (const EventContext &ctx, const RawDataCollection &RDOs, ClusterContainer &container) const override
 

Private Member Functions

StatusCode makeCluster (const EventContext &ctx, const typename HgtdTimedClusteringTool::Cluster &cluster, xAOD::HGTDCluster &xaodcluster) const
 

Private Attributes

const HGTD_DetectorManagerm_hgtd_det_mgr {nullptr}
 
const HGTD_IDm_hgtd_id {nullptr}
 
Gaudi::Property< double > m_timeTollerance {this, "TimeTollerance", 0.035 * Acts::UnitConstants::ns}
 
Gaudi::Property< bool > m_addCorners {this, "AddCorners", true}
 

Detailed Description

Definition at line 33 of file HgtdTimedClusteringTool.h.

Member Typedef Documentation

◆ Cell

Definition at line 42 of file HgtdTimedClusteringTool.h.

◆ CellCollection

Definition at line 43 of file HgtdTimedClusteringTool.h.

◆ ClusterCollection

Definition at line 44 of file HgtdTimedClusteringTool.h.

Constructor & Destructor Documentation

◆ HgtdTimedClusteringTool()

ActsTrk::HgtdTimedClusteringTool::HgtdTimedClusteringTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 34 of file HgtdTimedClusteringTool.cxx.

37  : base_class(type, name, parent)
38  {}

Member Function Documentation

◆ clusterize()

StatusCode ActsTrk::HgtdTimedClusteringTool::clusterize ( const EventContext &  ctx,
const RawDataCollection &  RDOs,
ClusterContainer &  container 
) const
overridevirtual

Definition at line 52 of file HgtdTimedClusteringTool.cxx.

55  {
56  // Unpack RDOs (would need a proper function here)
58  cells.reserve(RDOs.size());
59  for (const HGTD_RDO* rdo : RDOs) {
60  Identifier id = rdo->identify();
61  cells.emplace_back(-1,
62  m_hgtd_id->phi_index(id),
63  m_hgtd_id->eta_index(id),
64  rdo->getTOA(),
65  rdo->getTOT(),
66  id);
67  }
68 
69  ATH_MSG_DEBUG("Clustering on " << RDOs.size() << " RDOs using time information");
71  Acts::Ccl::createClusters<CellCollection, ClusterCollection, 2>
72  (cells, Acts::Ccl::TimedConnect<Cell, 2ul>(m_timeTollerance.value(), m_addCorners.value()));
73  ATH_MSG_DEBUG(" \\_ " << clusters.size() << " clusters reconstructed");
74 
75  // Fast insertion trick
76  std::size_t previousSizeContainer = container.size();
77  std::vector<xAOD::HGTDCluster*> toAdd;
78  toAdd.reserve(clusters.size());
79  for (std::size_t i(0), n(clusters.size()); i < n; ++i)
80  toAdd.push_back( new xAOD::HGTDCluster() );
81  container.insert(container.end(), toAdd.begin(), toAdd.end());
82 
83  for (std::size_t i(0); i<clusters.size(); ++i) {
84  const typename HgtdTimedClusteringTool::Cluster& cluster = clusters[i];
85  ATH_CHECK(makeCluster(ctx, cluster, *container[previousSizeContainer+i]));
86  }
87 
88  return StatusCode::SUCCESS;
89  }

◆ initialize()

StatusCode ActsTrk::HgtdTimedClusteringTool::initialize ( )
overridevirtual

Definition at line 40 of file HgtdTimedClusteringTool.cxx.

41  {
42  ATH_MSG_DEBUG("Initializing " << name() << "...");
43 
45  ATH_CHECK(detStore()->retrieve(m_hgtd_id, "HGTD_ID"));
46 
48 
49  return StatusCode::SUCCESS;
50  }

◆ makeCluster()

StatusCode ActsTrk::HgtdTimedClusteringTool::makeCluster ( const EventContext &  ctx,
const typename HgtdTimedClusteringTool::Cluster cluster,
xAOD::HGTDCluster xaodcluster 
) const
private

Definition at line 91 of file HgtdTimedClusteringTool.cxx.

94  {
95  if (cluster.ids.empty()) return StatusCode::SUCCESS;
96 
97  InDetDD::SiLocalPosition pos_acc(0,0);
98  double tot_time = 0;
99 
100  for (size_t i = 0; i < cluster.ids.size(); i++) {
101  Identifier rdo_id = cluster.ids[i];
102 
104  InDetDD::SiCellId si_cell_id = element->cellIdFromIdentifier(rdo_id);
105  InDetDD::SiLocalPosition si_pos = element->design().localPositionOfCell(si_cell_id);
106 
107  pos_acc += si_pos;
108  tot_time += cluster.times[i];
109  }
110 
111  pos_acc /= cluster.ids.size();
112  tot_time /= cluster.ids.size();
113 
114  // Create the cluster
115  Eigen::Matrix<float, 3, 1> loc_pos(pos_acc.xPhi(), pos_acc.xEta(), tot_time);
116  Eigen::Matrix<float, 3, 3> cov_matrix= Eigen::Matrix<float, 3, 3>::Zero();
117 
118  constexpr float xWidth = 1.3;
119  constexpr float yWidth = 1.3;
120  cov_matrix(0,0) = xWidth * xWidth / 12 / cluster.ids.size(); // i.e. Cov XX
121  cov_matrix(1,1) = yWidth * yWidth / 12 / cluster.ids.size(); // i.e. Cov YY
122  constexpr float time_of_arrival_err = 0.035;
123  cov_matrix(2,2) = time_of_arrival_err * time_of_arrival_err / cluster.ids.size(); // i.e. Cov TT
124 
125  IdentifierHash id_hash = m_hgtd_det_mgr->getDetectorElement(cluster.ids.front())->identifyHash();
126 
127  // Fill
128  xaodcluster.setMeasurement<3>(id_hash,loc_pos,cov_matrix);
129  xaodcluster.setIdentifier(cluster.ids.front().get_compact());
130  xaodcluster.setRDOlist(std::move(cluster.ids));
131  xaodcluster.setToTlist(std::move(cluster.tots));
132 
133  return StatusCode::SUCCESS;
134  }

Member Data Documentation

◆ m_addCorners

Gaudi::Property<bool> ActsTrk::HgtdTimedClusteringTool::m_addCorners {this, "AddCorners", true}
private

Definition at line 68 of file HgtdTimedClusteringTool.h.

◆ m_hgtd_det_mgr

const HGTD_DetectorManager* ActsTrk::HgtdTimedClusteringTool::m_hgtd_det_mgr {nullptr}
private

Definition at line 64 of file HgtdTimedClusteringTool.h.

◆ m_hgtd_id

const HGTD_ID* ActsTrk::HgtdTimedClusteringTool::m_hgtd_id {nullptr}
private

Definition at line 65 of file HgtdTimedClusteringTool.h.

◆ m_timeTollerance

Gaudi::Property<double> ActsTrk::HgtdTimedClusteringTool::m_timeTollerance {this, "TimeTollerance", 0.035 * Acts::UnitConstants::ns}
private

Definition at line 67 of file HgtdTimedClusteringTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ActsTrk::HgtdTimedClusteringTool::m_hgtd_id
const HGTD_ID * m_hgtd_id
Definition: HgtdTimedClusteringTool.h:65
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:271
InDetDD::HGTD_DetectorElement::cellIdFromIdentifier
SiCellId cellIdFromIdentifier(const Identifier &identifier) const override final
SiCellId from Identifier.
Definition: HGTD_DetectorElement.cxx:51
InDetDD::HGTD_ModuleDesign::localPositionOfCell
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const
readout or diode id -> position.
Definition: HGTD_ModuleDesign.cxx:145
ActsTrk::HgtdTimedClusteringTool::m_addCorners
Gaudi::Property< bool > m_addCorners
Definition: HgtdTimedClusteringTool.h:68
xAOD::HGTDCluster_v1::setRDOlist
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
Definition: HGTDCluster_v1.cxx:15
InDetDD::HGTD_DetectorElement
Definition: HGTD_DetectorElement.h:40
ActsTrk::HgtdTimedClusteringTool::m_hgtd_det_mgr
const HGTD_DetectorManager * m_hgtd_det_mgr
Definition: HgtdTimedClusteringTool.h:64
HGTD_ID::eta_index
int eta_index(const Identifier &id) const
Definition: HGTD_ID.h:503
xAOD::HGTDCluster_v1
Definition: HGTDCluster_v1.h:23
HGTD_RDO
Definition: HGTD_RDO.h:53
InDetDD::SolidStateDetectorElementBase::identifyHash
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
InDetDD::HGTD_DetectorElement::design
const HGTD_ModuleDesign & design() const override final
access to the local description:
Definition: HGTD_DetectorElement.h:121
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
HGTD_ID::phi_index
int phi_index(const Identifier &id) const
Definition: HGTD_ID.h:496
ActsTrk::HgtdTimedClusteringTool::ClusterCollection
std::vector< Cluster > ClusterCollection
Definition: HgtdTimedClusteringTool.h:44
xAOD::UncalibratedMeasurement_v1::setIdentifier
void setIdentifier(const DetectorIdentType measId)
Sets the full Identifier of the measurement.
lumiFormat.i
int i
Definition: lumiFormat.py:85
ActsTrk::HgtdTimedClusteringTool::CellCollection
std::vector< Cell > CellCollection
Definition: HgtdTimedClusteringTool.h:43
beamspotman.n
n
Definition: beamspotman.py:731
ActsTrk::HgtdTimedClusteringTool::m_timeTollerance
Gaudi::Property< double > m_timeTollerance
Definition: HgtdTimedClusteringTool.h:67
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::HGTDCluster_v1::setToTlist
void setToTlist(const std::vector< int > &tots)
Sets the list of ToT of the channels building the cluster.
DeMoUpdate.toAdd
bool toAdd
Definition: DeMoUpdate.py:1304
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ActsTrk::HgtdTimedClusteringTool::makeCluster
StatusCode makeCluster(const EventContext &ctx, const typename HgtdTimedClusteringTool::Cluster &cluster, xAOD::HGTDCluster &xaodcluster) const
Definition: HgtdTimedClusteringTool.cxx:91
InDetDD::SiCellId
Definition: SiCellId.h:29
HGTD_DetectorManager::getDetectorElement
InDetDD::HGTD_DetectorElement * getDetectorElement(const Identifier &id) const
access to individual elements : via Identifier
Definition: HGTD_DetectorManager.cxx:57
xAOD::UncalibratedMeasurement_v1::setMeasurement
void setMeasurement(const DetectorIDHashType idHash, MeasVector< N > locPos, MeasMatrix< N > locCov)
Sets IdentifierHash, local position and local covariance of the measurement.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
Identifier
Definition: IdentifierFieldParser.cxx:14