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,
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  const StripID& stripID,
84  const InDetDD::SiDetectorElement* element,
85  xAOD::StripCluster& container) const;
86 
87  StringProperty m_timeBinStr{this, "timeBins", ""};
88 
89  ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool {this, "LorentzAngleTool", "",
90  "Tool to retreive Lorentz angle of Si detector module"
91  };
92 
93  // TODO this one should be removed?
95  "SiDetectorElementStatus for strip"};
96 
97  ToolHandle<IInDetConditionsTool> m_conditionsTool {this, "conditionsTool", "",
98  "Conditions summary tool"};
99 
100  Gaudi::Property<bool> m_checkBadModules {this, "checkBadModules", true,
101  "Check bad modules using the conditions summary tool"};
102 
103  Gaudi::Property<unsigned int> m_maxFiredStrips {this, "maxFiredStrips", 384u,
104  "Threshold of number of fired strips per wafer. 0 disables the per-wafer cut."};
105 
106  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_stripDetEleCollKey {this, "StripDetEleCollKey", "ITkStripDetectorElementCollection",
107  "SiDetectorElementCollection key for strip"};
108 
109  int m_timeBinBits[3]{-1, -1, -1};
110 
111 
112 
113 
114 };
115 
116 } // namespace ActsTrk
117 
118 #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:268
ActsTrk::StripClusteringTool::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: StripClusteringTool.h:89
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::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:287
SG::ReadHandleKey< InDet::SiDetectorElementStatus >
ActsTrk::StripClusteringTool::m_checkBadModules
Gaudi::Property< bool > m_checkBadModules
Definition: StripClusteringTool.h:100
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
ActsTrk::StripClusteringTool::m_timeBinBits
int m_timeBinBits[3]
Definition: StripClusteringTool.h:109
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:49
ActsTrk::StripClusteringTool::m_maxFiredStrips
Gaudi::Property< unsigned int > m_maxFiredStrips
Definition: StripClusteringTool.h:103
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:63
ActsTrk::StripClusteringTool::Cell
Definition: StripClusteringTool.h:32
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ActsTrk::StripClusteringTool::m_timeBinStr
StringProperty m_timeBinStr
Definition: StripClusteringTool.h:87
ActsTrk::StripClusteringTool::m_stripDetElStatus
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_stripDetElStatus
Definition: StripClusteringTool.h:94
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:106
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:54
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
ActsTrk::StripClusteringTool::m_conditionsTool
ToolHandle< IInDetConditionsTool > m_conditionsTool
Definition: StripClusteringTool.h:97
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
Identifier
Definition: IdentifierFieldParser.cxx:14