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:
28 
30  using StripID = SCT_ID;
31 
32  struct Cell {
33  size_t index;
35  std::bitset<3> timeBits;
36  Acts::Ccl::Label label{Acts::Ccl::NO_LABEL}; // required by ACTS
37 
38  Cell(size_t i, Identifier id, const std::bitset<3>& timeBits)
39  : index(i), id(id), timeBits(timeBits) {}
40  };
41 
42  struct Cluster {
43  std::vector<Identifier> ids;
45  };
46 
47  using CellCollection = std::vector<Cell>;
48  using ClusterCollection = std::vector<Cluster>;
49 
50  StripClusteringTool(const std::string& type,
51  const std::string& name,
52  const IInterface* parent);
53 
54  virtual StatusCode initialize() override;
55 
56  virtual StatusCode
58  const StripID& stripID,
59  const EventContext& ctx,
60  xAOD::StripClusterContainer& container) const override;
61 
62 private:
63 
64  bool passTiming(const std::bitset<3>& timePattern) const;
65 
67 
68  std::optional<std::pair<std::vector<Cell>, bool>>
70  const StripID& idHelper,
71  const InDet::SiDetectorElementStatus *sctDetElStatus,
72  const EventContext& ctx) const;
73 
74  bool isBadStrip(const EventContext& ctx,
75  const InDet::SiDetectorElementStatus *sctDetElStatus,
76  const StripID& idHelper,
77  IdentifierHash waferHash,
78  Identifier stripId) const;
79 
80  // N.B. the cluster is added to the container
82  double LorentzShift,
83  Eigen::Matrix<float,1,1>& localCov,
84  const StripID& stripID,
85  const InDetDD::SiDetectorElement* element,
86  const InDetDD::SiDetectorDesign& design,
87  xAOD::StripCluster& container) const;
88 
89  const InDet::SiDetectorElementStatus *getStripDetElStatus(const EventContext& ctx) const;
90 
91  StringProperty m_timeBinStr{this, "timeBins", ""};
92 
93  ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool {this, "LorentzAngleTool", "",
94  "Tool to retreive Lorentz angle of Si detector module"
95  };
96 
97  // TODO this one should be removed?
99  "SiDetectorElementStatus for strip"};
100 
101  ToolHandle<IInDetConditionsTool> m_conditionsTool {this, "conditionsTool", "",
102  "Conditions summary tool"};
103 
104  Gaudi::Property<bool> m_checkBadModules {this, "checkBadModules", true,
105  "Check bad modules using the conditions summary tool"};
106 
107  Gaudi::Property<unsigned int> m_maxFiredStrips {this, "maxFiredStrips", 384u,
108  "Threshold of number of fired strips per wafer. 0 disables the per-wafer cut."};
109 
110  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_stripDetEleCollKey {this, "StripDetEleCollKey", "ITkStripDetectorElementCollection",
111  "SiDetectorElementCollection key for strip"};
112 
113  int m_timeBinBits[3]{-1, -1, -1};
114 
115 };
116 
117 } // namespace ActsTrk
118 
119 #endif
ActsTrk::StripClusteringTool::Cell::id
Identifier id
Definition: StripClusteringTool.h:34
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:289
ActsTrk::StripClusteringTool::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: StripClusteringTool.h:93
ActsTrk::StripClusteringTool::Cell::timeBits
std::bitset< 3 > timeBits
Definition: StripClusteringTool.h:35
SiDetectorElementStatus.h
index
Definition: index.py:1
ActsTrk::StripClusteringTool::clusterize
virtual StatusCode clusterize(const InDetRawDataCollection< StripRDORawData > &RDOs, const StripID &stripID, const EventContext &ctx, xAOD::StripClusterContainer &container) const override
Definition: StripClusteringTool.cxx:103
ActsTrk::StripClusteringTool::CellCollection
std::vector< Cell > CellCollection
Definition: StripClusteringTool.h:47
ActsTrk::StripClusteringTool::ClusterCollection
std::vector< Cluster > ClusterCollection
Definition: StripClusteringTool.h:48
SCT_RDORawData
Definition: SCT_RDORawData.h:24
ActsTrk::StripClusteringTool::unpackRDOs
std::optional< std::pair< std::vector< Cell >, bool > > unpackRDOs(const InDetRawDataCollection< StripRDORawData > &RDOs, const StripID &idHelper, const InDet::SiDetectorElementStatus *sctDetElStatus, const EventContext &ctx) const
Definition: StripClusteringTool.cxx:308
SG::ReadHandleKey< InDet::SiDetectorElementStatus >
ActsTrk::StripClusteringTool::m_checkBadModules
Gaudi::Property< bool > m_checkBadModules
Definition: StripClusteringTool.h:104
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
ActsTrk::StripClusteringTool::m_timeBinBits
int m_timeBinBits[3]
Definition: StripClusteringTool.h:113
ActsTrk::StripClusteringTool::Cluster
Definition: StripClusteringTool.h:42
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
lumiFormat.i
int i
Definition: lumiFormat.py:85
InDet::SiDetectorElementStatus
Definition: SiDetectorElementStatus.h:62
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ActsTrk::StripClusteringTool::Cell::Cell
Cell(size_t i, Identifier id, const std::bitset< 3 > &timeBits)
Definition: StripClusteringTool.h:38
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::initialize
virtual StatusCode initialize() override
Definition: StripClusteringTool.cxx:52
ActsTrk::StripClusteringTool::m_maxFiredStrips
Gaudi::Property< unsigned int > m_maxFiredStrips
Definition: StripClusteringTool.h:107
SCT_RDORawData.h
ActsTrk::StripClusteringTool::Cluster::ids
std::vector< Identifier > ids
Definition: StripClusteringTool.h:43
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
ActsTrk::StripClusteringTool::decodeTimeBins
StatusCode decodeTimeBins()
Definition: StripClusteringTool.cxx:66
ActsTrk::StripClusteringTool::Cell
Definition: StripClusteringTool.h:32
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ActsTrk::StripClusteringTool::m_timeBinStr
StringProperty m_timeBinStr
Definition: StripClusteringTool.h:91
ActsTrk::StripClusteringTool::m_stripDetElStatus
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_stripDetElStatus
Definition: StripClusteringTool.h:98
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
ActsTrk::StripClusteringTool::makeCluster
StatusCode makeCluster(const 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:253
SiDetectorElement.h
ActsTrk::StripClusteringTool::getStripDetElStatus
const InDet::SiDetectorElementStatus * getStripDetElStatus(const EventContext &ctx) const
Definition: StripClusteringTool.cxx:86
ActsTrk::StripClusteringTool::passTiming
bool passTiming(const std::bitset< 3 > &timePattern) const
Definition: StripClusteringTool.cxx:278
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection >
ActsTrk::StripClusteringTool::Cell::index
size_t index
Definition: StripClusteringTool.h:33
ActsTrk::StripClusteringTool::m_stripDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_stripDetEleCollKey
Definition: StripClusteringTool.h:110
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: MuonDetectorBuilderTool.cxx:55
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:101
ActsTrk::StripClusteringTool::Cluster::hitsInThirdTimeBin
uint16_t hitsInThirdTimeBin
Definition: StripClusteringTool.h:44
FlavorTagDiscriminants::TruthDecoratorHelpers::TruthType::Label
Label
Definition: TruthDecoratorHelpers.h:16
ActsTrk::StripClusteringTool::StripClusteringTool
StripClusteringTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: StripClusteringTool.cxx:46
ActsTrk::StripClusteringTool::Cell::label
Acts::Ccl::Label label
Definition: StripClusteringTool.h:36
ActsTrk::StripClusteringTool
Definition: StripClusteringTool.h:26
Identifier
Definition: IdentifierFieldParser.cxx:14