ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::ClusterTimeProjectionMMClusterBuilderTool Class Reference

#include <ClusterTimeProjectionMMClusterBuilderTool.h>

Inheritance diagram for Muon::ClusterTimeProjectionMMClusterBuilderTool:
Collaboration diagram for Muon::ClusterTimeProjectionMMClusterBuilderTool:

Public Types

using RIO_Author = MMClusterOnTrack::Author
 Refinement of the cluster position after the cluster calibration loop is ran with a complete external constraint (e.g.

Public Member Functions

 ClusterTimeProjectionMMClusterBuilderTool (const std::string &, const std::string &, const IInterface *)
virtual ~ClusterTimeProjectionMMClusterBuilderTool ()=default
StatusCode initialize () override
StatusCode getClusters (const EventContext &ctx, std::vector< Muon::MMPrepData > &&stripsVect, std::vector< std::unique_ptr< Muon::MMPrepData > > &clustersVect) const override
 Standard Interface to produce Micromega clusters from raw Input hits without external contstaint.
virtual RIO_Author getCalibratedClusterPosition (const EventContext &ctx, const std::vector< NSWCalib::CalibratedStrip > &calibratedStrips, const Amg::Vector3D &directionEstimate, Amg::Vector2D &clusterLocalPosition, Amg::MatrixX &covMatrix) const override
 DeclareInterfaceID (Muon::IMMClusterBuilderTool, 1, 0)
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

using LaySortedPrds = std::array<std::vector<Muon::MMPrepData>, 8>
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

LaySortedPrds sortHitsToLayer (std::vector< Muon::MMPrepData > &&MMprds) const
std::vector< std::vector< uint > > clusterLayer (const std::vector< Muon::MMPrepData > &MMPrdsPerLayer) const
std::pair< double, double > getClusterPositionPRD (const NswErrorCalibData &errorCalibDB, uint8_t author, const std::vector< NSWCalib::CalibratedStrip > &features, const Amg::Vector3D &thetaEstimate) const
StatusCode writeClusterPrd (const EventContext &ctx, const std::vector< Muon::MMPrepData > &constituents, const double clustersPosition, const double clustersPositionErrorSq, std::vector< std::unique_ptr< Muon::MMPrepData > > &mergedClust) const
uint channel (const Identifier &id) const
uint channel (const MMPrepData &strip) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 Muon Detector Descriptor.
SG::ReadCondHandleKey< NswErrorCalibDatam_uncertCalibKey
Gaudi::Property< bool > m_writeStripProperties {this, "writeStripProperties" , true}
Gaudi::Property< uintm_maxHoleSize {this, "maxHoleSize", 1}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 17 of file ClusterTimeProjectionMMClusterBuilderTool.h.

Member Typedef Documentation

◆ LaySortedPrds

◆ RIO_Author

Refinement of the cluster position after the cluster calibration loop is ran with a complete external constraint (e.g.

from the track fit). The cluster local position and the associated covariance are updated during this procedure Returns the Author of the ClusterBuilderTool, in case that the calibrated strip passes all internal constraints of the ClusterBuilder, otherwise Unknown author is returned. In the latter case, the Cluster should not be transformed into a calibrated RIO object.

Parameters
ctxEventContext used for StoreGate access
calibratedStripsCluster constitutents after the calibration stage
directionEstimateEstimate of the direction given in the local frame
clusterLocalPositionVector to which the final cluster position is saved to
covMatrixUncertainty associated with the local position

Definition at line 48 of file IMMClusterBuilderTool.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ClusterTimeProjectionMMClusterBuilderTool()

Muon::ClusterTimeProjectionMMClusterBuilderTool::ClusterTimeProjectionMMClusterBuilderTool ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 23 of file ClusterTimeProjectionMMClusterBuilderTool.cxx.

25 :
26 AthAlgTool(t, n, p) {
27 declareInterface<IMMClusterBuilderTool>(this);
28}
AthAlgTool()
Default constructor:

◆ ~ClusterTimeProjectionMMClusterBuilderTool()

virtual Muon::ClusterTimeProjectionMMClusterBuilderTool::~ClusterTimeProjectionMMClusterBuilderTool ( )
virtualdefault

Member Function Documentation

◆ channel() [1/2]

uint Muon::ClusterTimeProjectionMMClusterBuilderTool::channel ( const Identifier & id) const
inlineprivate

Definition at line 61 of file ClusterTimeProjectionMMClusterBuilderTool.h.

61{ return m_idHelperSvc->mmIdHelper().channel(id); }
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Muon Detector Descriptor.

◆ channel() [2/2]

uint Muon::ClusterTimeProjectionMMClusterBuilderTool::channel ( const MMPrepData & strip) const
inlineprivate

◆ clusterLayer()

std::vector< std::vector< uint > > Muon::ClusterTimeProjectionMMClusterBuilderTool::clusterLayer ( const std::vector< Muon::MMPrepData > & MMPrdsPerLayer) const
private

Definition at line 113 of file ClusterTimeProjectionMMClusterBuilderTool.cxx.

113 {
114
115 const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
116 // get gas gap for later correction of the sign of the slope
117 int gasGap = idHelper.gasGap(MMPrdsPerLayer.at(0).identify());
118
119 ATH_MSG_DEBUG("Scanning gas gap " << gasGap);
120 if (msgLvl(MSG::VERBOSE)) {
121 for (const auto& prd : MMPrdsPerLayer) {
122 ATH_MSG_DEBUG("Hit channel " << " " << m_idHelperSvc->toStringDetEl(prd.identify())
123 << " local positionX " << prd.localPosition().x() << " time " << prd.time()
124 << " corrected time " << prd.time() << " angle to IP "<< prd.globalPosition().theta() << " "
125 << prd.globalPosition().theta() / Gaudi::Units::degree);
126 }
127 }
128 std::vector<std::vector<uint>> idxClusters{};
129 // simple grouping of strips using the fact that the strips where ordered by channel
130 idxClusters.push_back(std::vector<uint>{0}); // assumes that mmPrdsPerLayer always has at least one strip
131 for (uint i_strip = 1; i_strip < MMPrdsPerLayer.size(); i_strip++) {
132 if (channel(MMPrdsPerLayer.at(i_strip)) - channel(MMPrdsPerLayer.at(i_strip - 1)) <= m_maxHoleSize + 1) {
133 idxClusters.back().push_back(i_strip);
134 } else {
135 idxClusters.push_back(std::vector<uint>{i_strip});
136 }
137 }
138 if (msgLvl(MSG::VERBOSE)) {
139 ATH_MSG_DEBUG("Found " << idxClusters.size() << " clusters");
140 for (const auto& idxCluster : idxClusters) { ATH_MSG_DEBUG("cluster: " << idxCluster); }
141 }
142 return idxClusters;
143} // end of cluster layer
#define ATH_MSG_DEBUG(x)
unsigned int uint
bool msgLvl(const MSG::Level lvl) const
int gasGap(const Identifier &id) const override
get the hashes

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ DeclareInterfaceID()

Muon::IMMClusterBuilderTool::DeclareInterfaceID ( Muon::IMMClusterBuilderTool ,
1 ,
0  )
inherited

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getCalibratedClusterPosition()

RIO_Author Muon::ClusterTimeProjectionMMClusterBuilderTool::getCalibratedClusterPosition ( const EventContext & ctx,
const std::vector< NSWCalib::CalibratedStrip > & calibratedStrips,
const Amg::Vector3D & directionEstimate,
Amg::Vector2D & clusterLocalPosition,
Amg::MatrixX & covMatrix ) const
overridevirtual

Implements Muon::IMMClusterBuilderTool.

Definition at line 259 of file ClusterTimeProjectionMMClusterBuilderTool.cxx.

263 {
264
265 SG::ReadCondHandle<NswErrorCalibData> errorCalibDB{m_uncertCalibKey, ctx};
266 if (!errorCalibDB.isValid()) {
267 ATH_MSG_FATAL("Failed to retrieve the parameterized errors "<<m_uncertCalibKey.fullKey());
268 return RIO_Author::unKnownAuthor;
269 }
270
271 constexpr uint8_t toolAuthor = static_cast<uint8_t>(RIO_Author::ClusterTimeProjectionClusterBuilder);
272 std::pair<double, double> posAndErrorSq = getClusterPositionPRD(*errorCalibDB.cptr(), toolAuthor, calibratedStrips, directionEstimate);
273
274 clusterLocalPosition[Trk::locX] = posAndErrorSq.first;
275 Amg::MatrixX covN(1, 1);
276 covN.coeffRef(0, 0) = posAndErrorSq.second;
277 covMatrix = covN;
278
279 return RIO_Author::ClusterTimeProjectionClusterBuilder;
280}
#define ATH_MSG_FATAL(x)
std::pair< double, double > getClusterPositionPRD(const NswErrorCalibData &errorCalibDB, uint8_t author, const std::vector< NSWCalib::CalibratedStrip > &features, const Amg::Vector3D &thetaEstimate) const
const_pointer_type cptr()
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
@ locX
Definition ParamDefs.h:37

◆ getClusterPositionPRD()

std::pair< double, double > Muon::ClusterTimeProjectionMMClusterBuilderTool::getClusterPositionPRD ( const NswErrorCalibData & errorCalibDB,
uint8_t author,
const std::vector< NSWCalib::CalibratedStrip > & features,
const Amg::Vector3D & thetaEstimate ) const
private

divide by 1000 to avoid overflow of variables

Definition at line 146 of file ClusterTimeProjectionMMClusterBuilderTool.cxx.

149 {
150
151
152 double clusterPosition{0}, clusterPositionErrorSq{0.};
153
154 double qtot{0}, meanDriftDist{0.}, meanDriftDistError{0.};
155 double meanPosX{0.}, meanPosXError{0.};
156
157 for (const NSWCalib::CalibratedStrip& clustFeat : constituents) {
158 const double driftDist = clustFeat.distDrift;
160 const double charge = clustFeat.charge * Gaudi::Units::perThousand;
161 const double chargeSq = std::pow(charge, 2);
162 qtot += charge;
163 meanPosX += clustFeat.locPos.x() * charge;
164 meanPosXError += clustFeat.resLongDistDrift * chargeSq;
165 meanDriftDist += driftDist * charge;
166 meanDriftDistError += clustFeat.resTransDistDrift * chargeSq;
167 ATH_MSG_VERBOSE("Strip:"<<m_idHelperSvc->toString(clustFeat.identifier)
168 << " drift dist " << driftDist << " +- " << std::sqrt(clustFeat.resTransDistDrift)
169 << " xpos: "<< clustFeat.locPos.x() << " +- " << std::sqrt(clustFeat.resLongDistDrift)
170 << " xMeanPos " << meanPosX / qtot << " +- " << std::sqrt(meanPosXError) / qtot
171 << " meanPosXError " << meanPosXError << " meanDriftDist " << meanDriftDist / qtot
172 << " meanDriftDist Error " << std::sqrt(meanDriftDistError) / qtot
173 << " charge " << charge << " qtot " << qtot);
174 }
175 meanPosX /= qtot;
176 double meanPosXErrorSq = meanPosXError / (qtot * qtot);
177 meanDriftDist /= qtot;
178 double meanDriftDistErrorSq = meanDriftDistError / (qtot * qtot);
179
180 const double tanTheta = std::tan(dirEstimate.theta());
181 double correction = tanTheta * (meanDriftDist - halfGapWidth);
182 if (m_idHelperSvc->mmIdHelper().gasGap(constituents[0].identifier) % 2 == 0) {
183 correction = -1. * correction; // take care of inverted drif direction for even gaps
184 }
185 double correctionErrorSq = tanTheta * tanTheta * meanDriftDistErrorSq;
186
187 clusterPosition = meanPosX + correction;
188 clusterPositionErrorSq = correctionErrorSq + meanPosXErrorSq;
189
190
191 NswErrorCalibData::Input errorCalibIn{};
192 errorCalibIn.stripId = constituents[0].identifier;
193 errorCalibIn.clusterAuthor = author;
194 errorCalibIn.locPhi = dirEstimate.phi();
195 errorCalibIn.locTheta = dirEstimate.theta();
196 errorCalibIn.localPos = Amg::Vector2D{clusterPosition, 0.};
197 errorCalibIn.clusterSize = constituents.size();
198
199 const double localUncertainty = errorCalibDB.clusterUncertainty(errorCalibIn);
200
201 ATH_MSG_DEBUG("Cluster Properties"
202 << " meanX " << meanPosX << " +-" << std::sqrt(meanPosXErrorSq) << " mean drift dist " << meanDriftDist << " +- "
203 << std::sqrt(meanDriftDistErrorSq) << " correction " << correction << " +- " << std::sqrt(correctionErrorSq)
204 << " final position " << clusterPosition << " +- " << std::sqrt(clusterPositionErrorSq));
205 return std::make_pair(clusterPosition, localUncertainty*localUncertainty);
206}
#define ATH_MSG_VERBOSE(x)
double charge(const T &p)
Definition AtlasPID.h:997
double clusterUncertainty(const Input &clustInfo) const
Eigen::Matrix< double, 2, 1 > Vector2D
correction(mu, runmode, campaign, run=None)
Definition zlumi_mc_cf.py:4
unsigned int clusterSize
Cluster size.
double locTheta
Direction of the muon in the local coordinate frame.
Amg::Vector2D localPos
Local position on the surface.
Identifier stripId
Identifier of the strip.
uint8_t clusterAuthor
Author of the cluster.
double locPhi
Azimuthal angle in the local frame.

◆ getClusters()

StatusCode Muon::ClusterTimeProjectionMMClusterBuilderTool::getClusters ( const EventContext & ctx,
std::vector< Muon::MMPrepData > && stripsVect,
std::vector< std::unique_ptr< Muon::MMPrepData > > & clustersVect ) const
overridevirtual

Standard Interface to produce Micromega clusters from raw Input hits without external contstaint.

Executes the clusterization algorithm & fills the results in the clusterVect Returns a failure in case of conditions or unexpected problems

Parameters
ctxEventContext used for StoreGate access
stripsVectVector of the single Micromega hits.
clusterVectOutput vector of the merged clusters

Implements Muon::IMMClusterBuilderTool.

Definition at line 36 of file ClusterTimeProjectionMMClusterBuilderTool.cxx.

38 {
39 LaySortedPrds prdsPerLayer = sortHitsToLayer(std::move(MMprds));
40
41
42 for (std::vector<MMPrepData>& prdsOfLayer : prdsPerLayer) {
43 if (prdsOfLayer.size() < 2) continue; // require at least two strips per layer
44
45 std::vector<std::vector<uint>> idxClusters = clusterLayer(prdsOfLayer);
46
47 for (std::vector<uint>& clustIds : idxClusters) {
48 DEFINE_VECTOR(MMPrepData, clustConstituents, clustIds.size());
49 DEFINE_VECTOR(NSWCalib::CalibratedStrip, stripFeatures, clustIds.size());
50
51 Amg::Vector3D clustDir{Amg::Vector3D::Zero()};
52 for (unsigned idx : clustIds) {
53 MMPrepData& toMerge{prdsOfLayer[idx]};
54
55 const Amg::Vector3D lDir{NswClustering::toLocal(toMerge)};
56 const double q = toMerge.charge();
57
58 clustDir += q * lDir;
59 NSWCalib::CalibratedStrip clusFeat{};
60 clusFeat.identifier = toMerge.identify();
61 clusFeat.locPos = toMerge.localPosition();
62 clusFeat.distDrift = toMerge.driftDist();
63 clusFeat.resTransDistDrift = toMerge.localCovariance()(0, 0);
64 clusFeat.resLongDistDrift = toMerge.localCovariance()(1, 1);
65 clusFeat.charge = q;
66
67 stripFeatures.emplace_back(std::move(clusFeat));
68 clustConstituents.emplace_back(std::move(toMerge));
69 }
70
71 SG::ReadCondHandle<NswErrorCalibData> errorCalibDB{m_uncertCalibKey, ctx};
72 if (!errorCalibDB.isValid()) {
73 ATH_MSG_FATAL("Failed to retrieve the parameterized errors "<<m_uncertCalibKey.fullKey());
74 return StatusCode::FAILURE;
75 }
76
78 std::pair<double, double> posAndErrorSq = getClusterPositionPRD(**errorCalibDB,
79 toolAuthor,
80 stripFeatures,
81 clustDir.unit());
82
83 ATH_CHECK(writeClusterPrd(ctx, clustConstituents, posAndErrorSq.first, posAndErrorSq.second, clustersVec));
84
85 }
86 }
87 return StatusCode::SUCCESS;
88}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define DEFINE_VECTOR(dType, varName, nEles)
std::array< std::vector< Muon::MMPrepData >, 8 > LaySortedPrds
StatusCode writeClusterPrd(const EventContext &ctx, const std::vector< Muon::MMPrepData > &constituents, const double clustersPosition, const double clustersPositionErrorSq, std::vector< std::unique_ptr< Muon::MMPrepData > > &mergedClust) const
std::vector< std::vector< uint > > clusterLayer(const std::vector< Muon::MMPrepData > &MMPrdsPerLayer) const
LaySortedPrds sortHitsToLayer(std::vector< Muon::MMPrepData > &&MMprds) const
Eigen::Matrix< double, 3, 1 > Vector3D
Amg::Vector3D toLocal(const Amg::Transform3D &toLocalTrans, const Amg::Vector3D &dir)
Rotates a direction vector into a local frame: x-axis : Parallell to the radial direction of the dete...

◆ initialize()

StatusCode Muon::ClusterTimeProjectionMMClusterBuilderTool::initialize ( )
override

Definition at line 30 of file ClusterTimeProjectionMMClusterBuilderTool.cxx.

30 {
31 ATH_CHECK(m_idHelperSvc.retrieve());
32 ATH_CHECK(m_uncertCalibKey.initialize());
33 return StatusCode::SUCCESS;
34}

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sortHitsToLayer()

ClusterTimeProjectionMMClusterBuilderTool::LaySortedPrds Muon::ClusterTimeProjectionMMClusterBuilderTool::sortHitsToLayer ( std::vector< Muon::MMPrepData > && MMprds) const
private

Definition at line 91 of file ClusterTimeProjectionMMClusterBuilderTool.cxx.

91 {
92
93 LaySortedPrds prdsPerLayer{};
94 const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
95 // sorting hits by gas gap
96 for (MMPrepData& prd : MMprds) {
97 const Identifier id = prd.identify();
98 int layer = 4 * (idHelper.multilayer(id) - 1) + (idHelper.gasGap(id) - 1);
99 prdsPerLayer.at(layer).push_back(std::move(prd));
100 }
101 ATH_MSG_DEBUG("sorted hist");
102 // sort MMPrds by channel
103 for (std::vector<MMPrepData>& prdsInLay : prdsPerLayer) {
104 std::sort(prdsInLay.begin(), prdsInLay.end(), [&idHelper](const MMPrepData& a, const MMPrepData& b) {
105 return idHelper.channel(a.identify()) <
106 idHelper.channel(b.identify());
107 });
108 }
109 return prdsPerLayer;
110}
static Double_t a
int multilayer(const Identifier &id) const
@ layer
Definition HitInfo.h:79
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ writeClusterPrd()

StatusCode Muon::ClusterTimeProjectionMMClusterBuilderTool::writeClusterPrd ( const EventContext & ctx,
const std::vector< Muon::MMPrepData > & constituents,
const double clustersPosition,
const double clustersPositionErrorSq,
std::vector< std::unique_ptr< Muon::MMPrepData > > & mergedClust ) const
private

Definition at line 208 of file ClusterTimeProjectionMMClusterBuilderTool.cxx.

212 {
213
214 DEFINE_VECTOR(Identifier, rdoList, constituents.size());
215 DEFINE_VECTOR(int, stripCharges, constituents.size());
216 DEFINE_VECTOR(short int, stripTimes, constituents.size());
217 DEFINE_VECTOR(uint16_t, stripNumbers, constituents.size());
218 DEFINE_VECTOR(float, stripDriftDists, constituents.size());
219 DEFINE_VECTOR(AmgVector(2), stripDriftDistErrors, constituents.size());
220
221 int totalCharge{0};
222 for (const Muon::MMPrepData& clustFeat : constituents) {
223 rdoList.push_back(clustFeat.identify());
224 stripNumbers.push_back(channel(clustFeat));
225 stripTimes.push_back(clustFeat.time());
226 stripCharges.push_back(clustFeat.charge());
227 stripDriftDists.push_back(clustFeat.driftDist());
228 const Amg::MatrixX cov{clustFeat.localCovariance()};
229 stripDriftDistErrors.emplace_back(cov(0,0), cov(1,1));
230 totalCharge += clustFeat.charge();
231 }
232 if (!m_writeStripProperties) { stripNumbers.clear(); }
233
234 auto covN = Amg::MatrixX(1, 1);
235 covN.coeffRef(0, 0) = clusterPositionErrorSq;
236 Amg::Vector2D localClusterPositionV(clusterPosition, constituents[0].localPosition().y());
237 Identifier idStrip0 = constituents[0].identify();
238
239 std::unique_ptr<MMPrepData> prdN = std::make_unique<MMPrepData>(idStrip0,
240 constituents[0].collectionHash(),
241 std::move(localClusterPositionV),
242 std::move(rdoList),
243 std::move(covN),
244 constituents[0].detectorElement(),
245 0, // drift dist
246 totalCharge,
247 0.0 /*drift dist*/,
248 std::move(stripNumbers),
249 std::move(stripTimes),
250 std::move(stripCharges));
251
252 prdN->setDriftDist(std::move(stripDriftDists), std::move(stripDriftDistErrors));
254
255 mergedClust.push_back(std::move(prdN));
256 return StatusCode::SUCCESS;
257}
#define AmgVector(rows)
#define y

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::ClusterTimeProjectionMMClusterBuilderTool::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Muon Detector Descriptor.

Definition at line 37 of file ClusterTimeProjectionMMClusterBuilderTool.h.

37{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_maxHoleSize

Gaudi::Property<uint> Muon::ClusterTimeProjectionMMClusterBuilderTool::m_maxHoleSize {this, "maxHoleSize", 1}
private

Definition at line 44 of file ClusterTimeProjectionMMClusterBuilderTool.h.

44{this, "maxHoleSize", 1};

◆ m_uncertCalibKey

SG::ReadCondHandleKey<NswErrorCalibData> Muon::ClusterTimeProjectionMMClusterBuilderTool::m_uncertCalibKey
private
Initial value:
{this, "ErrorCalibKey", "NswUncertData",
"Key of the parametrized NSW uncertainties"}

Definition at line 40 of file ClusterTimeProjectionMMClusterBuilderTool.h.

40 {this, "ErrorCalibKey", "NswUncertData",
41 "Key of the parametrized NSW uncertainties"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeStripProperties

Gaudi::Property<bool> Muon::ClusterTimeProjectionMMClusterBuilderTool::m_writeStripProperties {this, "writeStripProperties" , true}
private

Definition at line 43 of file ClusterTimeProjectionMMClusterBuilderTool.h.

43{this, "writeStripProperties" , true};

The documentation for this class was generated from the following files: