|
ATLAS Offline Software
|
#include <FPGAClusterConverter.h>
|
| FPGAClusterConverter (const std::string &type, const std::string &name, const IInterface *) |
|
virtual | ~FPGAClusterConverter ()=default |
|
virtual StatusCode | initialize () override final |
|
virtual StatusCode | convertHits (const std::vector< FPGATrackSimHit > &, InDet::PixelClusterCollection &, InDet::SCT_ClusterCollection &) const override final |
|
virtual StatusCode | convertHits (const std::vector< const FPGATrackSimHit * > &, InDet::PixelClusterCollection &, InDet::SCT_ClusterCollection &) const override final |
|
virtual StatusCode | convertHits (const std::vector< FPGATrackSimHit > &hits, xAOD::PixelClusterContainer &pixelCont, xAOD::StripClusterContainer &SCTCont) const override final |
|
virtual StatusCode | convertClusters (const std::vector< FPGATrackSimCluster > &, InDet::PixelClusterCollection &, InDet::SCT_ClusterCollection &) const override final |
|
virtual StatusCode | convertClusters (const std::vector< FPGATrackSimCluster > &cl, xAOD::PixelClusterContainer &pixelCont, xAOD::StripClusterContainer &SCTCont) const override final |
|
virtual StatusCode | convertSpacePoints (const std::vector< FPGATrackSimCluster > &fpgaSPs, const std::vector< FPGATrackSimCluster > &fpgaClusters, xAOD::SpacePointContainer &SPStripCont, xAOD::SpacePointContainer &SPPixelCont, xAOD::StripClusterContainer &stripClusterCont, xAOD::PixelClusterContainer &pixelClusterCont) const override final |
|
virtual StatusCode | createPixelCluster (const FPGATrackSimHit &h, const std::vector< Identifier > &rdoList, std::unique_ptr< InDet::PixelCluster > &) const override final |
|
virtual StatusCode | createPixelCluster (const FPGATrackSimHit &h, const std::vector< Identifier > &rdoList, xAOD::PixelCluster &) const override final |
|
virtual StatusCode | createSCTCluster (const FPGATrackSimHit &h, const std::vector< Identifier > &rdoList, std::unique_ptr< InDet::SCT_Cluster > &) const override final |
|
virtual StatusCode | createSCTCluster (const FPGATrackSimHit &h, const std::vector< Identifier > &rdoList, xAOD::StripCluster &) const override final |
|
virtual StatusCode | createPixelCluster (const FPGATrackSimCluster &, std::unique_ptr< InDet::PixelCluster > &) const override final |
|
virtual StatusCode | createPixelCluster (const FPGATrackSimCluster &, xAOD::PixelCluster &) const override final |
|
virtual StatusCode | createSCTCluster (const FPGATrackSimCluster &, std::unique_ptr< InDet::SCT_Cluster > &) const override final |
|
virtual StatusCode | createSCTCluster (const FPGATrackSimCluster &, xAOD::StripCluster &) const override final |
|
virtual StatusCode | createSP (const FPGATrackSimCluster &cl, xAOD::SpacePoint &sp, xAOD::StripClusterContainer &clustersCont) const override final |
|
virtual StatusCode | createSP (const FPGATrackSimCluster &cl, xAOD::SpacePoint &sp, xAOD::PixelClusterContainer &clustersCont) const override final |
|
virtual StatusCode | getRdoList (std::vector< Identifier > &rdoList, const FPGATrackSimCluster &cluster) const override final |
|
virtual StatusCode | getRdoList (std::vector< Identifier > &rdoList, const FPGATrackSimHit &hit) const override final |
|
virtual StatusCode | getStripsInfo (const xAOD::StripCluster &cl, float &halfStripLength, Amg::Vector3D &stripDirection, Amg::Vector3D &stripCenter) const override final |
|
Definition at line 40 of file FPGAClusterConverter.h.
◆ FPGAClusterConverter()
FPGAClusterConverter::FPGAClusterConverter |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~FPGAClusterConverter()
virtual FPGAClusterConverter::~FPGAClusterConverter |
( |
| ) |
|
|
virtualdefault |
◆ convertClusters() [1/2]
Definition at line 161 of file FPGAClusterConverter.cxx.
171 std::vector<Identifier> rdoList;
174 std::unique_ptr<InDet::PixelCluster> pixelCl{};
175 std::unique_ptr<InDet::SCT_Cluster> SCTCl{};
179 if (pixelCl) pixelColl.push_back(std::move(pixelCl));
183 if (SCTCl) SCTColl.push_back(std::move(SCTCl));
187 ATH_MSG_DEBUG(
"pixelColl size: " << pixelColl.size() <<
" SCTColl size: " << SCTColl.size());
189 return StatusCode::SUCCESS;
◆ convertClusters() [2/2]
◆ convertHits() [1/3]
Definition at line 74 of file FPGAClusterConverter.cxx.
81 if (!FPGAClustersHandle.isValid()) {
82 ATH_MSG_FATAL(
"Failed to retrieve FPGATrackSimClusterCollection");
83 return StatusCode::FAILURE;
106 std::vector<Identifier> rdoList;
109 std::unique_ptr<InDet::PixelCluster> pixelCl{};
110 std::unique_ptr<InDet::SCT_Cluster> SCTCl{};
114 if (pixelCl) pixelColl.push_back(std::move(pixelCl));
118 if (SCTCl) SCTColl.push_back(std::move(SCTCl));
123 ATH_MSG_DEBUG(
"pixelColl size: " << pixelColl.size() <<
" SCTColl size: " << SCTColl.size());
125 return StatusCode::SUCCESS;
◆ convertHits() [2/3]
Definition at line 43 of file FPGAClusterConverter.cxx.
48 pixelColl.reserve(
hits.size());
49 SCTColl.reserve(
hits.size());
52 std::vector<Identifier> rdoList;
55 std::unique_ptr<InDet::PixelCluster> pixelCl{};
56 std::unique_ptr<InDet::SCT_Cluster> SCTCl{};
60 if (pixelCl) pixelColl.push_back(std::move(pixelCl));
64 if (SCTCl) SCTColl.push_back(std::move(SCTCl));
68 ATH_MSG_DEBUG(
"pixelColl size: " << pixelColl.size() <<
" SCTColl size: " << SCTColl.size() );
70 return StatusCode::SUCCESS;
◆ convertHits() [3/3]
◆ convertSpacePoints()
◆ createPixelCluster() [1/4]
Definition at line 587 of file FPGAClusterConverter.cxx.
588 ATH_MSG_DEBUG(
"\t Create InDet::PixelCluster from FPGATrackSimCluster");
590 std::vector<Identifier> rdoList;
593 return StatusCode::SUCCESS;
◆ createPixelCluster() [2/4]
Definition at line 596 of file FPGAClusterConverter.cxx.
597 ATH_MSG_DEBUG(
"\t Create xAOD::PixelCluster from FPGATrackSimCluster");
599 std::vector<Identifier> rdoList;
602 return StatusCode::SUCCESS;
◆ createPixelCluster() [3/4]
Definition at line 250 of file FPGAClusterConverter.cxx.
251 ATH_MSG_DEBUG(
"\tCreate InDet::PixelCluster from FPGATrackSimHit");
255 float etaWidth =
h.getEtaWidth();
258 int etaIndex =
h.getEtaIndex();
264 return StatusCode::FAILURE;
271 if(!
cell.isValid()) {
273 return StatusCode::FAILURE;
279 int colMin =
static_cast<int>(etaIndex-0.5*etaWidth);
280 int colMax = colMin+etaWidth;
285 double etaW = design->widthFromColumnRange(colMin, colMax-1);
286 double phiW = design->widthFromRowRange(rowMin, rowMax-1);
298 localPos = localPosShift;
302 ATH_MSG_DEBUG(
"\t\tLocal position: x=" << localPos.x() <<
" y=" << localPos.y() );
303 ATH_MSG_DEBUG(
"\t\tGlobal position: x=" << globalPos.x() <<
" y=" << globalPos.y() <<
" z=" << globalPos.z() );
308 cov(0,0) = siWidth.phiR()*siWidth.phiR()/12;
309 cov(1,1) = siWidth.z()*siWidth.z()/12;
310 float dummy_omegax = 0.5;
311 float dummy_omegay = 0.5;
313 float splitProb1 = 0;
314 float splitProb2 = 0;
316 cl = std::make_unique<InDet::PixelCluster>(hit_id, localPos, std::vector<Identifier>(rdoList), siWidth, pDE,
Amg::MatrixX(
cov), dummy_omegax, dummy_omegay,
split, splitProb1, splitProb2);
318 return StatusCode::SUCCESS;
◆ createPixelCluster() [4/4]
Definition at line 321 of file FPGAClusterConverter.cxx.
322 ATH_MSG_DEBUG(
"\tCreate xAOD::PixelCluster from FPGATrackSimHit");
326 float etaWidth =
h.getEtaWidth();
329 int etaIndex =
h.getEtaIndex();
335 return StatusCode::FAILURE;
342 if(!
cell.isValid()) {
344 return StatusCode::FAILURE;
350 int colMin =
static_cast<int>(etaIndex-0.5*etaWidth);
351 int colMax = colMin+etaWidth;
356 double etaW = design->widthFromColumnRange(colMin, colMax-1);
357 double phiW = design->widthFromRowRange(rowMin, rowMax-1);
370 localPos = localPosShift;
373 ATH_MSG_DEBUG(
"\t\tLocal position: x=" << localPos.x() <<
" y=" << localPos.y() );
378 cov(0,0) = siWidth.phiR()*siWidth.phiR()/12;
379 cov(1,1) = siWidth.z()*siWidth.z()/12;
384 float splitProb1 = 0;
385 float splitProb2 = 0;
387 Eigen::Matrix<float,2,1> localPosition(localPos.x(), localPos.y());
388 Eigen::Matrix<float,2,2> localCovariance;
389 localCovariance.setZero();
390 localCovariance(0, 0) =
cov(0, 0);
391 localCovariance(1, 1) =
cov(1, 1);
393 Eigen::Matrix<float,3,1> globalPosition(
h.getX(),
h.getY(),
h.getZ());
394 ATH_MSG_DEBUG(
"\t\tGlobal position: x=" << globalPosition.x() <<
" y=" << globalPosition.y() <<
" z=" << globalPosition.z() );
396 cl.setMeasurement<2>(
hash, localPosition, localCovariance);
397 cl.setIdentifier( rdoList.front().get_compact() );
398 cl.setRDOlist(rdoList);
399 cl.globalPosition() = globalPosition;
400 cl.setChannelsInPhiEta(siWidth.colRow()[0], siWidth.colRow()[1]);
401 cl.setWidthInEta(
static_cast<float>(siWidth.widthPhiRZ()[1]));
402 cl.setOmegas(omegax, omegay);
404 cl.setSplitProbabilities(splitProb1, splitProb2);
407 return StatusCode::SUCCESS;
◆ createSCTCluster() [1/4]
Definition at line 605 of file FPGAClusterConverter.cxx.
606 ATH_MSG_DEBUG(
"\t Create InDet::SCT_Cluster from FPGATrackSimCluster");
608 std::vector<Identifier> rdoList;
611 return StatusCode::SUCCESS;
◆ createSCTCluster() [2/4]
Definition at line 614 of file FPGAClusterConverter.cxx.
615 ATH_MSG_DEBUG(
"\t Create xAOD::StripCluster from FPGATrackSimCluster");
617 std::vector<Identifier> rdoList;
620 return StatusCode::SUCCESS;
◆ createSCTCluster() [3/4]
Definition at line 410 of file FPGAClusterConverter.cxx.
411 ATH_MSG_DEBUG(
"\t Create InDet::SCTCluster from FPGATrackSimHit ");
417 int strip =
static_cast<int>(
h.getPhiCoord());
450 const std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition> ends( design->
endsOfStrip(centre) );
451 const double stripLength( std::abs(ends.first.xEta() - ends.second.xEta()) );
456 ATH_MSG_DEBUG(
"\t\tcentre eta: " << centre.xEta() <<
" phi: " << centre.xPhi());
458 ATH_MSG_DEBUG(
"\t\tlocal position before shift: " << localPos.x() <<
" phi: " << localPos.y());
462 localPos = localPosShift;
466 ATH_MSG_DEBUG(
"\t\tLocal position: x=" << localPos.x() <<
" y=" << localPos.y() );
467 ATH_MSG_DEBUG(
"\t\tGlobal position: x=" << globalPos.x() <<
" y=" << globalPos.y() <<
" z=" << globalPos.z() );
470 const double col_x = siWidth.colRow().x();
471 const double col_y = siWidth.colRow().y();
473 double scale_factor = 1.;
474 if ( std::abs(col_x-1) < std::numeric_limits<double>::epsilon() )
476 else if ( std::abs(col_x-2) < std::numeric_limits<double>::epsilon() )
481 cov.fillSymmetric(0, 0, scale_factor * scale_factor * siWidth.phiR() * siWidth.phiR() * (1./12.));
482 cov.fillSymmetric(1, 1, siWidth.z() * siWidth.z() / col_y / col_y * (1./12.));
491 double v1 = (
cov)(1,1);
492 cov.fillSymmetric( 0, 0, cs2 *
v0 + sn2 * v1 );
493 cov.fillSymmetric( 0, 1, sn * std::sqrt(cs2) * (
v0 - v1) );
494 cov.fillSymmetric( 1, 1, sn2 *
v0 + cs2 * v1 );
497 cl = std::make_unique<InDet::SCT_Cluster>(strip_id, localPos, std::vector<Identifier>(rdoList), siWidth, pDE,
Amg::MatrixX(
cov));
499 return StatusCode::SUCCESS;
◆ createSCTCluster() [4/4]
Definition at line 502 of file FPGAClusterConverter.cxx.
503 ATH_MSG_DEBUG(
"\t Create xAOD::StripCluster from FPGATrackSimHit ");
509 int strip =
static_cast<int>(
h.getPhiCoord());
541 const std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition> ends( design->
endsOfStrip(centre) );
542 const double stripLength( std::abs(ends.first.xEta() - ends.second.xEta()) );
546 ATH_MSG_DEBUG(
"\t\tcentre eta: " << centre.xEta() <<
" phi: " << centre.xPhi());
548 ATH_MSG_DEBUG(
"\t\tlocal position before shift: " << localPos.x() <<
" phi: " << localPos.y());
553 localPos = localPosShift;
556 ATH_MSG_DEBUG(
"\t\tLocal position: x=" << localPos.x() <<
" y=" << localPos.y() );
559 Eigen::Matrix<float,1,1> localPosition;
560 Eigen::Matrix<float,1,1> localCovariance;
561 localCovariance.setZero();
564 localPosition(0, 0) = localPos.x();
569 if ( designNew ==
nullptr )
return StatusCode::FAILURE;
571 localPosition(0, 0) = localInPolar.
xPhi();
575 Eigen::Matrix<float,3,1> globalPosition(
h.getX(),
h.getY(),
h.getZ());
576 ATH_MSG_DEBUG(
"\t\tGlobal position: x=" << globalPosition.x() <<
" y=" << globalPosition.y() <<
" z=" << globalPosition.z() );
578 cl.setMeasurement<1>(
hash, localPosition, localCovariance);
579 cl.setIdentifier( rdoList.front().get_compact() );
580 cl.setRDOlist(rdoList);
581 cl.globalPosition() = globalPosition;
582 cl.setChannelsInPhi(siWidth.colRow()[0]);
584 return StatusCode::SUCCESS;
◆ createSP() [1/2]
◆ createSP() [2/2]
Definition at line 623 of file FPGAClusterConverter.cxx.
626 std::vector<Identifier> rdoList;
630 std::unique_ptr<xAOD::PixelClusterContainer> clusterCont = std::make_unique<xAOD::PixelClusterContainer>();
631 std::unique_ptr<xAOD::PixelClusterAuxContainer> clusterAuxCont = std::make_unique<xAOD::PixelClusterAuxContainer>();
632 clusterCont->setStore(clusterAuxCont.get() );
640 Eigen::Matrix<float,3,1> globalPos(clEq.
getX(),clEq.
getY(),clEq.
getZ());
648 std::vector< const xAOD::UncalibratedMeasurement* > measurements;
650 for (
auto orig_cl : clustersCont) {
651 if (clEq.
getIdentifierHash()==orig_cl->identifierHash()) measurements.push_back(orig_cl);
665 return StatusCode::SUCCESS;
◆ getRdoList() [1/2]
Definition at line 765 of file FPGAClusterConverter.cxx.
772 int etaIndex =
h.getEtaIndex();
777 rdoList.push_back(hit_id);
782 rdoList.push_back(hit_id);
786 return StatusCode::SUCCESS;
◆ getRdoList() [2/2]
Definition at line 791 of file FPGAClusterConverter.cxx.
795 int etaIndex =
h.getEtaIndex();
800 rdoList.push_back(hit_id);
805 rdoList.push_back(hit_id);
808 return StatusCode::SUCCESS;
◆ getStripsInfo()
Definition at line 811 of file FPGAClusterConverter.cxx.
823 std::pair<Amg::Vector3D, Amg::Vector3D>
end = (pDE->
endsOfStrip(localPos));
824 stripCenter = 0.5 * (
end.first +
end.second);
827 halfStripLength = 0.5 * stripDir.norm();
828 stripDirection = stripDir / (2. * (halfStripLength));
830 return StatusCode::SUCCESS;
◆ initialize()
StatusCode FPGAClusterConverter::initialize |
( |
| ) |
|
|
finaloverridevirtual |
◆ m_beamSpotKey
◆ m_doShift
bool FPGAClusterConverter::m_doShift = true |
◆ m_FPGAClusterKey
◆ m_lorentzAngleTool
◆ m_pixelId
◆ m_pixelManager
◆ m_SCTId
◆ m_SCTManager
The documentation for this class was generated from the following files:
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
def retrieve(aClass, aKey=None)
virtual double stripPitch(const SiLocalPosition &chargePos) const =0
give the strip pitch (dependence on position needed for forward)
const InDetDD::SCT_DetectorManager * m_SCTManager
SiCellId cellIdOfPosition(const Amg::Vector2D &localPos) const
As in previous method but returns SiCellId.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
hitVector const & getHitList() const
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Eigen::Matrix< double, 2, 1 > Vector2D
SG::ReadHandleKey< FPGATrackSimClusterCollection > m_FPGAClusterKey
virtual DetectorShape shape() const
Shape of element.
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements via Identifier
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
const InDetDD::PixelDetectorManager * m_pixelManager
double xPhi() const
position along phi direction:
const PixelID * m_pixelId
StripCluster_v1 StripCluster
Define the version of the strip cluster class.
double phiPitch() const
Pitch (inline methods)
std::vector< FPGATrackSimCluster > FPGATrackSimClusterCollection
virtual SiCellId cellIdFromIdentifier(const Identifier &identifier) const override final
SiCellId from Identifier.
virtual StatusCode createSCTCluster(const FPGATrackSimHit &h, const std::vector< Identifier > &rdoList, std::unique_ptr< InDet::SCT_Cluster > &) const override final
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.
virtual StatusCode createSP(const FPGATrackSimCluster &cl, xAOD::SpacePoint &sp, xAOD::StripClusterContainer &clustersCont) const override final
int row(const Identifier &id) const
virtual StatusCode getRdoList(std::vector< Identifier > &rdoList, const FPGATrackSimCluster &cluster) const override final
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
void setSpacePoint(DetectorIDHashType idHash, const Eigen::Matrix< float, 3, 1 > &globPos, float cov_r, float cov_z, const std::vector< const xAOD::UncalibratedMeasurement * > &measurementIndexes)
unsigned getIdentifierHash() const
std::pair< Amg::Vector3D, Amg::Vector3D > endsOfStrip(const Amg::Vector2D &position) const
Special method for SCT to retrieve the two ends of a "strip" Returned coordinates are in global frame...
virtual StatusCode createPixelCluster(const FPGATrackSimHit &h, const std::vector< Identifier > &rdoList, std::unique_ptr< InDet::PixelCluster > &) const override final
FPGATrackSimHit const & getClusterEquiv() const
double phiPitchPhi(const SiLocalPosition &localPosition) const
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Eigen::Matrix< double, 3, 1 > Vector3D
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
virtual int strip1Dim(int strip, int row) const override
only relevant for SCT.
int strip(const Identifier &id) const
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
Identifier pixel_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
double sinStereoLocal(const Amg::Vector2D &localPos) const
Angle of strip in local frame with respect to the etaAxis.
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
SiLocalPosition localPositionOfCellPC(const SiCellId &cellId) const
This is for debugging only.
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const override=0
give the ends of strips
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
size_type size() const noexcept
Returns the number of elements in the collection.
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements : via Identifier
Identifier strip_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
For an individual strip.