ATLAS Offline Software
StripClusteringTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 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) const;
72 
73  bool isBadStrip(const InDet::SiDetectorElementStatus *sctDetElStatus,
74  const StripID& idHelper,
75  IdentifierHash waferHash,
76  Identifier stripId) const;
77 
78  // N.B. the cluster is added to the container
80  double LorentzShift,
81  const StripID& stripID,
82  const InDetDD::SiDetectorElement* element,
83  xAOD::StripCluster& container) const;
84 
85  StringProperty m_timeBinStr{this, "timeBins", ""};
86 
87  ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool {this, "LorentzAngleTool", "",
88  "Tool to retreive Lorentz angle of Si detector module"
89  };
90 
91  // TODO this one should be removed?
93  "SiDetectorElementStatus for strip"};
94 
95  ToolHandle<IInDetConditionsTool> m_conditionsTool {this, "conditionsTool", "",
96  "Conditions summary tool"};
97 
98  Gaudi::Property<bool> m_checkBadModules {this, "checkBadModules", true,
99  "Check bad modules using the conditions summary tool"};
100 
101  Gaudi::Property<unsigned int> m_maxFiredStrips {this, "maxFiredStrips", 384u,
102  "Threshold of number of fired strips per wafer. 0 disables the per-wafer cut."};
103 
104  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_stripDetEleCollKey {this, "StripDetEleCollKey", "ITkStripDetectorElementCollection",
105  "SiDetectorElementCollection key for strip"};
106 
107  int m_timeBinBits[3]{-1, -1, -1};
108 
109 
110 
111 
112 };
113 
114 } // namespace ActsTrk
115 
116 #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::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: StripClusteringTool.h:87
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:83
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::isBadStrip
bool isBadStrip(const InDet::SiDetectorElementStatus *sctDetElStatus, const StripID &idHelper, IdentifierHash waferHash, Identifier stripId) const
Definition: StripClusteringTool.cxx:268
SG::ReadHandleKey< InDet::SiDetectorElementStatus >
ActsTrk::StripClusteringTool::m_checkBadModules
Gaudi::Property< bool > m_checkBadModules
Definition: StripClusteringTool.h:98
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:83
ActsTrk::StripClusteringTool::unpackRDOs
std::optional< std::pair< std::vector< Cell >, bool > > unpackRDOs(const InDetRawDataCollection< StripRDORawData > &RDOs, const StripID &idHelper, const InDet::SiDetectorElementStatus *sctDetElStatus) const
Definition: StripClusteringTool.cxx:287
ActsTrk::StripClusteringTool::m_timeBinBits
int m_timeBinBits[3]
Definition: StripClusteringTool.h:107
ActsTrk::StripClusteringTool::Cluster
Definition: StripClusteringTool.h:42
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
lumiFormat.i
int i
Definition: lumiFormat.py:92
InDet::SiDetectorElementStatus
Definition: SiDetectorElementStatus.h:62
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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:49
ActsTrk::StripClusteringTool::m_maxFiredStrips
Gaudi::Property< unsigned int > m_maxFiredStrips
Definition: StripClusteringTool.h:101
SCT_RDORawData.h
ActsTrk::StripClusteringTool::Cluster::ids
std::vector< Identifier > ids
Definition: StripClusteringTool.h:43
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
ActsTrk::StripClusteringTool::decodeTimeBins
StatusCode decodeTimeBins()
Definition: StripClusteringTool.cxx:63
ActsTrk::StripClusteringTool::Cell
Definition: StripClusteringTool.h:32
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ActsTrk::StripClusteringTool::m_timeBinStr
StringProperty m_timeBinStr
Definition: StripClusteringTool.h:85
ActsTrk::StripClusteringTool::m_stripDetElStatus
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_stripDetElStatus
Definition: StripClusteringTool.h:92
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
ActsTrk::StripClusteringTool::makeCluster
StatusCode makeCluster(const StripClusteringTool::Cluster &cluster, double LorentzShift, const StripID &stripID, const InDetDD::SiDetectorElement *element, xAOD::StripCluster &container) const
Definition: StripClusteringTool.cxx:232
SiDetectorElement.h
ActsTrk::StripClusteringTool::passTiming
bool passTiming(const std::bitset< 3 > &timePattern) const
Definition: StripClusteringTool.cxx:257
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:104
SCT_ID
Definition: SCT_ID.h:68
StripClusterContainer.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IStripClusteringTool.h
InDetRawDataCollection.h
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:34
IdentifierHash
Definition: IdentifierHash.h:38
ActsTrk::StripClusteringTool::m_conditionsTool
ToolHandle< IInDetConditionsTool > m_conditionsTool
Definition: StripClusteringTool.h:95
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:43
ActsTrk::StripClusteringTool::Cell::label
Acts::Ccl::Label label
Definition: StripClusteringTool.h:36
ActsTrk::StripClusteringTool
Definition: StripClusteringTool.h:26