ATLAS Offline Software
StripClusteringTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ACTSTRK_DATAPREPARATION_STRIP_CLUSTERING_TOOL_H
6 #define ACTSTRK_DATAPREPARATION_STRIP_CLUSTERING_TOOL_H
7 
8 #include <optional>
9 #include <vector>
10 
11 #include <Acts/Clusterization/Clusterization.hpp>
12 
16 #include <InDetIdentifier/SCT_ID.h>
22 
23 namespace ActsTrk {
24 
25 
26 class StripClusteringTool : public extends<AthAlgTool, IStripClusteringTool> {
27 public:
29  using StripID = SCT_ID;
30 
31  StripClusteringTool(const std::string& type,
32  const std::string& name,
33  const IInterface* parent);
34 
35  virtual StatusCode initialize() override;
36 
37  virtual StatusCode
38  clusterize(const EventContext& ctx,
40  const InDet::SiDetectorElementStatus& stripDetElStatus,
41  const InDetDD::SiDetectorElement& element,
42  Acts::Ccl::ClusteringData& data,
43  std::vector<typename IStripClusteringTool::ClusterCollection>& collection) const override;
44 
45  virtual StatusCode
46  makeClusters(const EventContext& ctx,
48  const InDetDD::SiDetectorElement& element,
49  typename ClusterContainer::iterator itrContainer) const override;
50 
51 private:
52  std::optional<std::pair<typename IStripClusteringTool::CellCollection, bool>>
53  unpackRDOs(const EventContext& ctx,
54  const RawDataCollection& RDOs,
55  const InDet::SiDetectorElementStatus& stripDetElStatus,
56  const InDetDD::SiDetectorElement& element) const;
57 
58  bool passTiming(const std::bitset<3>& timePattern) const;
59 
61 
62  bool isBadStrip(const EventContext& ctx,
63  const InDet::SiDetectorElementStatus *sctDetElStatus,
64  const StripID& idHelper,
65  IdentifierHash waferHash,
66  Identifier stripId) const;
67 
68  // N.B. the cluster is added to the container
69  StatusCode makeCluster(StripClusteringTool::Cluster &cluster,
70  double LorentzShift,
71  Eigen::Matrix<float,1,1>& localCov,
72  const StripID& stripID,
73  const InDetDD::SiDetectorElement& element,
74  const InDetDD::SiDetectorDesign& design,
75  xAOD::StripCluster& container) const;
76 
77  StringProperty m_timeBinStr{this, "timeBins", ""};
78 
79  ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool {this, "LorentzAngleTool", "",
80  "Tool to retreive Lorentz angle of Si detector module"
81  };
82 
83  // TODO this one should be removed?
85  "SiDetectorElementStatus for strip"};
86 
87  ToolHandle<IInDetConditionsTool> m_conditionsTool {this, "conditionsTool", "",
88  "Conditions summary tool"};
89 
90  Gaudi::Property<bool> m_checkBadModules {this, "checkBadModules", true,
91  "Check bad modules using the conditions summary tool"};
92 
93  Gaudi::Property<unsigned int> m_maxFiredStrips {this, "maxFiredStrips", 384u,
94  "Threshold of number of fired strips per wafer. 0 disables the per-wafer cut."};
95 
96  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_stripDetEleCollKey {this, "StripDetEleCollKey", "ITkStripDetectorElementCollection",
97  "SiDetectorElementCollection key for strip"};
98 
99  Gaudi::Property<bool> m_isITk {this, "isITk", true,
100  "True if running in ITk"};
101 
102  Gaudi::Property<unsigned int> m_errorStrategy{this, "errorStrategy", 0, "Use different error strategies for the strip clusters"};
103 
104  int m_timeBinBits[3]{-1, -1, -1};
105 
106 
107  const StripID* m_stripID {nullptr};
108 };
109 
110 } // namespace ActsTrk
111 
112 #endif
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ActsTrk::StripClusteringTool::unpackRDOs
std::optional< std::pair< typename IStripClusteringTool::CellCollection, bool > > unpackRDOs(const EventContext &ctx, const RawDataCollection &RDOs, const InDet::SiDetectorElementStatus &stripDetElStatus, const InDetDD::SiDetectorElement &element) const
Definition: StripClusteringTool.cxx:319
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
ActsTrk::StripClusteringTool::makeClusters
virtual StatusCode makeClusters(const EventContext &ctx, typename IStripClusteringTool::ClusterCollection &cluster, const InDetDD::SiDetectorElement &element, typename ClusterContainer::iterator itrContainer) const override
Definition: StripClusteringTool.cxx:154
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
IInDetConditionsTool.h
ActsTrk::StripClusteringTool::isBadStrip
bool isBadStrip(const EventContext &ctx, const InDet::SiDetectorElementStatus *sctDetElStatus, const StripID &idHelper, IdentifierHash waferHash, Identifier stripId) const
Definition: StripClusteringTool.cxx:300
ActsTrk::StripClusteringTool::m_stripID
const StripID * m_stripID
Definition: StripClusteringTool.h:107
ActsTrk::StripClusteringTool::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: StripClusteringTool.h:79
SiDetectorElementStatus.h
ActsTrk::StripClusteringTool::m_isITk
Gaudi::Property< bool > m_isITk
Definition: StripClusteringTool.h:99
SCT_RDORawData
Definition: SCT_RDORawData.h:24
SG::ReadHandleKey< InDet::SiDetectorElementStatus >
ActsTrk::StripClusteringTool::m_checkBadModules
Gaudi::Property< bool > m_checkBadModules
Definition: StripClusteringTool.h:90
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
ActsTrk::StripClusteringTool::makeCluster
StatusCode makeCluster(StripClusteringTool::Cluster &cluster, double LorentzShift, Eigen::Matrix< float, 1, 1 > &localCov, const StripID &stripID, const InDetDD::SiDetectorElement &element, const InDetDD::SiDetectorDesign &design, xAOD::StripCluster &container) const
Definition: StripClusteringTool.cxx:239
ActsTrk::StripClusteringTool::m_timeBinBits
int m_timeBinBits[3]
Definition: StripClusteringTool.h:104
ActsTrk::StripClusteringTool::clusterize
virtual StatusCode clusterize(const EventContext &ctx, const InDetRawDataCollection< StripRDORawData > &RDOs, const InDet::SiDetectorElementStatus &stripDetElStatus, const InDetDD::SiDetectorElement &element, Acts::Ccl::ClusteringData &data, std::vector< typename IStripClusteringTool::ClusterCollection > &collection) const override
Definition: StripClusteringTool.cxx:98
InDet::SiDetectorElementStatus
Definition: SiDetectorElementStatus.h:62
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
InDetRawDataCollection
Definition: InDetRawDataCollection.h:31
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::StripCluster_v1
Definition: StripCluster_v1.h:17
ActsTrk::StripClusteringTool::m_errorStrategy
Gaudi::Property< unsigned int > m_errorStrategy
Definition: StripClusteringTool.h:102
ActsTrk::StripClusteringTool::initialize
virtual StatusCode initialize() override
Definition: StripClusteringTool.cxx:54
ActsTrk::StripClusteringTool::m_maxFiredStrips
Gaudi::Property< unsigned int > m_maxFiredStrips
Definition: StripClusteringTool.h:93
SCT_RDORawData.h
ActsTrk::StripClusteringTool::decodeTimeBins
StatusCode decodeTimeBins()
Definition: StripClusteringTool.cxx:78
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ActsTrk::StripClusteringTool::m_timeBinStr
StringProperty m_timeBinStr
Definition: StripClusteringTool.h:77
ActsTrk::StripClusteringTool::m_stripDetElStatus
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_stripDetElStatus
Definition: StripClusteringTool.h:84
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SiDetectorElement.h
ActsTrk::StripClusteringTool::passTiming
bool passTiming(const std::bitset< 3 > &timePattern) const
Definition: StripClusteringTool.cxx:289
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection >
ActsTrk::StripClusteringTool::m_stripDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_stripDetEleCollKey
Definition: StripClusteringTool.h:96
SCT_ID
Definition: SCT_ID.h:68
StripClusterContainer.h
IStripClusteringTool.h
InDetRawDataCollection.h
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MdtCalibInput.h:31
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
InDetDD::SiDetectorDesign
Definition: SiDetectorDesign.h:50
ActsTrk::StripClusteringTool::m_conditionsTool
ToolHandle< IInDetConditionsTool > m_conditionsTool
Definition: StripClusteringTool.h:87
ActsTrk::StripClusteringTool::StripClusteringTool
StripClusteringTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: StripClusteringTool.cxx:48
ActsTrk::StripClusteringTool
Definition: StripClusteringTool.h:26
ActsTrk::IStripClusteringTool::ClusterCollection
std::vector< Cluster > ClusterCollection
Definition: IStripClusteringTool.h:45
Identifier
Definition: IdentifierFieldParser.cxx:14