|
ATLAS Offline Software
|
#include <ClusterTimeProjectionMMClusterBuilderTool.h>
|
| 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. More...
|
|
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 . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
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 > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
◆ 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
-
ctx | EventContext used for StoreGate access |
calibratedStrips | Cluster constitutents after the calibration stage |
directionEstimate | Estimate of the direction given in the local frame |
clusterLocalPosition | Vector to which the final cluster position is saved to |
covMatrix | Uncertainty associated with the local position |
Definition at line 48 of file IMMClusterBuilderTool.h.
◆ StoreGateSvc_t
◆ ClusterTimeProjectionMMClusterBuilderTool()
Muon::ClusterTimeProjectionMMClusterBuilderTool::ClusterTimeProjectionMMClusterBuilderTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~ClusterTimeProjectionMMClusterBuilderTool()
virtual Muon::ClusterTimeProjectionMMClusterBuilderTool::~ClusterTimeProjectionMMClusterBuilderTool |
( |
| ) |
|
|
virtualdefault |
◆ channel() [1/2]
◆ 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.
117 int gasGap = idHelper.gasGap(MMPrdsPerLayer.at(0).identify());
121 for (
const auto& prd : MMPrdsPerLayer) {
123 <<
" local positionX " << prd.localPosition().x() <<
" time " << prd.time()
124 <<
" corrected time " << prd.time() <<
" angle to IP "<< prd.globalPosition().theta() <<
" "
128 std::vector<std::vector<uint>> idxClusters{};
130 idxClusters.push_back(std::vector<uint>{0});
131 for (
uint i_strip = 1; i_strip < MMPrdsPerLayer.size(); i_strip++) {
133 idxClusters.back().push_back(i_strip);
135 idxClusters.push_back(std::vector<uint>{i_strip});
139 ATH_MSG_DEBUG(
"Found " << idxClusters.size() <<
" clusters");
140 for (
const auto& idxCluster : idxClusters) {
ATH_MSG_DEBUG(
"cluster: " << idxCluster); }
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ DeclareInterfaceID()
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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()
Implements Muon::IMMClusterBuilderTool.
Definition at line 259 of file ClusterTimeProjectionMMClusterBuilderTool.cxx.
266 if (!errorCalibDB.isValid()) {
268 return RIO_Author::unKnownAuthor;
271 constexpr
uint8_t toolAuthor =
static_cast<uint8_t>(RIO_Author::ClusterTimeProjectionClusterBuilder);
272 std::pair<double, double> posAndErrorSq =
getClusterPositionPRD(*errorCalibDB.cptr(), toolAuthor, calibratedStrips, directionEstimate);
274 clusterLocalPosition[
Trk::locX] = posAndErrorSq.first;
276 covN.coeffRef(0, 0) = posAndErrorSq.second;
279 return RIO_Author::ClusterTimeProjectionClusterBuilder;
◆ getClusterPositionPRD()
divide by 1000 to avoid overflow of variables
Definition at line 146 of file ClusterTimeProjectionMMClusterBuilderTool.cxx.
152 double clusterPosition{0}, clusterPositionErrorSq{0.};
154 double qtot{0}, meanDriftDist{0.}, meanDriftDistError{0.};
155 double meanPosX{0.}, meanPosXError{0.};
158 const double driftDist = clustFeat.distDrift;
163 meanPosX += clustFeat.locPos.x() *
charge;
164 meanPosXError += clustFeat.resLongDistDrift * chargeSq;
165 meanDriftDist += driftDist *
charge;
166 meanDriftDistError += clustFeat.resTransDistDrift * chargeSq;
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);
176 double meanPosXErrorSq = meanPosXError / (qtot * qtot);
177 meanDriftDist /= qtot;
178 double meanDriftDistErrorSq = meanDriftDistError / (qtot * qtot);
180 const double tanTheta =
std::tan(dirEstimate.theta());
181 double correction = tanTheta * (meanDriftDist - halfGapWidth);
185 double correctionErrorSq = tanTheta * tanTheta * meanDriftDistErrorSq;
188 clusterPositionErrorSq = correctionErrorSq + meanPosXErrorSq;
192 errorCalibIn.
stripId = constituents[0].identifier;
193 errorCalibIn.clusterAuthor =
author;
194 errorCalibIn.locPhi = dirEstimate.phi();
195 errorCalibIn.locTheta = dirEstimate.theta();
197 errorCalibIn.clusterSize = constituents.size();
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);
◆ 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
-
ctx | EventContext used for StoreGate access |
stripsVect | Vector of the single Micromega hits. |
clusterVect | Output vector of the merged clusters |
Implements Muon::IMMClusterBuilderTool.
Definition at line 36 of file ClusterTimeProjectionMMClusterBuilderTool.cxx.
42 for (std::vector<MMPrepData>& prdsOfLayer : prdsPerLayer) {
43 if (prdsOfLayer.size() < 2)
continue;
45 std::vector<std::vector<uint>> idxClusters =
clusterLayer(prdsOfLayer);
47 for (std::vector<uint>& clustIds : idxClusters) {
48 DEFINE_VECTOR(MMPrepData, clustConstituents, clustIds.size());
52 for (
unsigned idx : clustIds) {
56 const double q = toMerge.charge();
61 clusFeat.locPos = toMerge.localPosition();
62 clusFeat.distDrift = toMerge.driftDist();
63 clusFeat.resTransDistDrift = toMerge.localCovariance()(0, 0);
64 clusFeat.resLongDistDrift = toMerge.localCovariance()(1, 1);
67 stripFeatures.emplace_back(std::move(clusFeat));
68 clustConstituents.emplace_back(std::move(toMerge));
72 if (!errorCalibDB.isValid()) {
74 return StatusCode::FAILURE;
87 return StatusCode::SUCCESS;
◆ initialize()
StatusCode Muon::ClusterTimeProjectionMMClusterBuilderTool::initialize |
( |
| ) |
|
|
override |
◆ inputHandles()
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() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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()
◆ renounceArray()
◆ sortHitsToLayer()
Definition at line 91 of file ClusterTimeProjectionMMClusterBuilderTool.cxx.
96 for (MMPrepData& prd : MMprds) {
98 int layer = 4 * (idHelper.multilayer(
id) - 1) + (idHelper.gasGap(
id) - 1);
99 prdsPerLayer.at(
layer).push_back(std::move(prd));
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());
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ 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.
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());
229 stripDriftDistErrors.emplace_back(
cov(0,0),
cov(1,1));
230 totalCharge += clustFeat.charge();
235 covN.coeffRef(0, 0) = clusterPositionErrorSq;
236 Amg::Vector2D localClusterPositionV(clusterPosition, constituents[0].localPosition().
y());
237 Identifier idStrip0 = constituents[0].identify();
239 std::unique_ptr<MMPrepData> prdN = std::make_unique<MMPrepData>(idStrip0,
240 constituents[0].collectionHash(),
241 std::move(localClusterPositionV),
244 constituents[0].detectorElement(),
248 std::move(stripNumbers),
249 std::move(stripTimes),
250 std::move(stripCharges));
252 prdN->setDriftDist(std::move(stripDriftDists), std::move(stripDriftDistErrors));
255 mergedClust.push_back(std::move(prdN));
256 return StatusCode::SUCCESS;
◆ m_detStore
◆ m_evtStore
◆ m_idHelperSvc
◆ m_maxHoleSize
Gaudi::Property<uint> Muon::ClusterTimeProjectionMMClusterBuilderTool::m_maxHoleSize {this, "maxHoleSize", 1} |
|
private |
◆ m_uncertCalibKey
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_writeStripProperties
Gaudi::Property<bool> Muon::ClusterTimeProjectionMMClusterBuilderTool::m_writeStripProperties {this, "writeStripProperties" , true} |
|
private |
The documentation for this class was generated from the following files:
Class to represent MM measurements.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
#define ATH_MSG_VERBOSE(x)
virtual void setOwner(IDataHandleHolder *o)=0
double clusterUncertainty(const Input &clustInfo) const
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
double charge(const T &p)
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
@ ClusterTimeProjectionClusterBuilder
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Amg::Vector3D toLocal(const Trk::Surface &surf, const Amg::Vector3D &dir)
Rotates a direction vector into a local frame: x-axis : Parallell to the radial direction of the dete...
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
constexpr int pow(int base, int exp) noexcept
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>