|
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 | 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 | getRdoList (std::vector< Identifier > &rdoList, const FPGATrackSimCluster &cluster) const override final |
|
virtual StatusCode | getRdoList (std::vector< Identifier > &rdoList, const FPGATrackSimHit &hit) const override final |
|
Definition at line 36 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 158 of file FPGAClusterConverter.cxx.
168 std::vector<Identifier> rdoList;
171 std::unique_ptr<InDet::PixelCluster> pixelCl{};
172 std::unique_ptr<InDet::SCT_Cluster> SCTCl{};
176 if (pixelCl) pixelColl.push_back(std::move(pixelCl));
180 if (SCTCl) SCTColl.push_back(std::move(SCTCl));
184 ATH_MSG_DEBUG(
"pixelColl size: " << pixelColl.size() <<
" SCTColl size: " << SCTColl.size());
186 return StatusCode::SUCCESS;
◆ convertClusters() [2/2]
◆ convertHits() [1/3]
Definition at line 71 of file FPGAClusterConverter.cxx.
78 if (!FPGAClustersHandle.isValid()) {
79 ATH_MSG_FATAL(
"Failed to retrieve FPGATrackSimClusterCollection");
80 return StatusCode::FAILURE;
103 std::vector<Identifier> rdoList;
106 std::unique_ptr<InDet::PixelCluster> pixelCl{};
107 std::unique_ptr<InDet::SCT_Cluster> SCTCl{};
111 if (pixelCl) pixelColl.push_back(std::move(pixelCl));
115 if (SCTCl) SCTColl.push_back(std::move(SCTCl));
120 ATH_MSG_DEBUG(
"pixelColl size: " << pixelColl.size() <<
" SCTColl size: " << SCTColl.size());
122 return StatusCode::SUCCESS;
◆ convertHits() [2/3]
Definition at line 40 of file FPGAClusterConverter.cxx.
45 pixelColl.reserve(
hits.size());
46 SCTColl.reserve(
hits.size());
49 std::vector<Identifier> rdoList;
52 std::unique_ptr<InDet::PixelCluster> pixelCl{};
53 std::unique_ptr<InDet::SCT_Cluster> SCTCl{};
57 if (pixelCl) pixelColl.push_back(std::move(pixelCl));
61 if (SCTCl) SCTColl.push_back(std::move(SCTCl));
65 ATH_MSG_DEBUG(
"pixelColl size: " << pixelColl.size() <<
" SCTColl size: " << SCTColl.size() );
67 return StatusCode::SUCCESS;
◆ convertHits() [3/3]
◆ createPixelCluster() [1/4]
Definition at line 562 of file FPGAClusterConverter.cxx.
563 ATH_MSG_DEBUG(
"\t Create InDet::PixelCluster from FPGATrackSimCluster");
565 std::vector<Identifier> rdoList;
568 return StatusCode::SUCCESS;
◆ createPixelCluster() [2/4]
Definition at line 571 of file FPGAClusterConverter.cxx.
572 ATH_MSG_DEBUG(
"\t Create xAOD::PixelCluster from FPGATrackSimCluster");
574 std::vector<Identifier> rdoList;
577 return StatusCode::SUCCESS;
◆ createPixelCluster() [3/4]
Definition at line 223 of file FPGAClusterConverter.cxx.
224 ATH_MSG_DEBUG(
"\tCreate InDet::PixelCluster from FPGATrackSimHit");
228 float etaWidth =
h.getEtaWidth();
231 int etaIndex =
h.getEtaIndex();
237 return StatusCode::FAILURE;
244 if(!
cell.isValid()) {
246 return StatusCode::FAILURE;
252 int colMin =
static_cast<int>(etaIndex-0.5*etaWidth);
253 int colMax = colMin+etaWidth;
258 double etaW = design->widthFromColumnRange(colMin, colMax-1);
259 double phiW = design->widthFromRowRange(rowMin, rowMax-1);
271 localPos = localPosShift;
275 ATH_MSG_DEBUG(
"\t\tLocal position: x=" << localPos.x() <<
" y=" << localPos.y() );
276 ATH_MSG_DEBUG(
"\t\tGlobal position: x=" << globalPos.x() <<
" y=" << globalPos.y() <<
" z=" << globalPos.z() );
281 cov(0,0) = siWidth.phiR()*siWidth.phiR()/12;
282 cov(1,1) = siWidth.z()*siWidth.z()/12;
283 float dummy_omegax = 0.5;
284 float dummy_omegay = 0.5;
286 float splitProb1 = 0;
287 float splitProb2 = 0;
289 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);
291 return StatusCode::SUCCESS;
◆ createPixelCluster() [4/4]
Definition at line 294 of file FPGAClusterConverter.cxx.
295 ATH_MSG_DEBUG(
"\tCreate xAOD::PixelCluster from FPGATrackSimHit");
299 float etaWidth =
h.getEtaWidth();
302 int etaIndex =
h.getEtaIndex();
308 return StatusCode::FAILURE;
315 if(!
cell.isValid()) {
317 return StatusCode::FAILURE;
323 int colMin =
static_cast<int>(etaIndex-0.5*etaWidth);
324 int colMax = colMin+etaWidth;
329 double etaW = design->widthFromColumnRange(colMin, colMax-1);
330 double phiW = design->widthFromRowRange(rowMin, rowMax-1);
343 localPos = localPosShift;
347 ATH_MSG_DEBUG(
"\t\tLocal position: x=" << localPos.x() <<
" y=" << localPos.y() );
348 ATH_MSG_DEBUG(
"\t\tGlobal position: x=" << globalPos.x() <<
" y=" << globalPos.y() <<
" z=" << globalPos.z() );
353 cov(0,0) = siWidth.phiR()*siWidth.phiR()/12;
354 cov(1,1) = siWidth.z()*siWidth.z()/12;
359 float splitProb1 = 0;
360 float splitProb2 = 0;
362 Eigen::Matrix<float,2,1> localPosition(localPos.x(), localPos.y());
363 Eigen::Matrix<float,2,2> localCovariance;
364 localCovariance.setZero();
365 localCovariance(0, 0) =
cov(0, 0);
366 localCovariance(1, 1) =
cov(1, 1);
368 Eigen::Matrix<float,3,1> globalPosition(globalPos.x(), globalPos.y(), globalPos.z());
370 cl.setMeasurement<2>(
hash, localPosition, localCovariance);
371 cl.setIdentifier( rdoList.front().get_compact() );
372 cl.setRDOlist(rdoList);
373 cl.globalPosition() = globalPosition;
374 cl.setChannelsInPhiEta(siWidth.colRow()[0], siWidth.colRow()[1]);
375 cl.setWidthInEta(
static_cast<float>(siWidth.widthPhiRZ()[1]));
376 cl.setOmegas(omegax, omegay);
378 cl.setSplitProbabilities(splitProb1, splitProb2);
381 return StatusCode::SUCCESS;
◆ createSCTCluster() [1/4]
Definition at line 580 of file FPGAClusterConverter.cxx.
581 ATH_MSG_DEBUG(
"\t Create InDet::SCT_Cluster from FPGATrackSimCluster");
583 std::vector<Identifier> rdoList;
586 return StatusCode::SUCCESS;
◆ createSCTCluster() [2/4]
Definition at line 589 of file FPGAClusterConverter.cxx.
590 ATH_MSG_DEBUG(
"\t Create xAOD::StripCluster from FPGATrackSimCluster");
592 std::vector<Identifier> rdoList;
595 return StatusCode::SUCCESS;
◆ createSCTCluster() [3/4]
Definition at line 384 of file FPGAClusterConverter.cxx.
385 ATH_MSG_DEBUG(
"\t Create InDet::SCTCluster from FPGATrackSimHit ");
391 int strip =
static_cast<int>(
h.getPhiCoord());
424 const std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition> ends( design->
endsOfStrip(centre) );
425 const double stripLength( std::abs(ends.first.xEta() - ends.second.xEta()) );
430 ATH_MSG_DEBUG(
"\t\tcentre eta: " << centre.xEta() <<
" phi: " << centre.xPhi());
432 ATH_MSG_DEBUG(
"\t\tlocal position before shift: " << localPos.x() <<
" phi: " << localPos.y());
436 localPos = localPosShift;
440 ATH_MSG_DEBUG(
"\t\tLocal position: x=" << localPos.x() <<
" y=" << localPos.y() );
441 ATH_MSG_DEBUG(
"\t\tGlobal position: x=" << globalPos.x() <<
" y=" << globalPos.y() <<
" z=" << globalPos.z() );
444 const double col_x = siWidth.colRow().x();
445 const double col_y = siWidth.colRow().y();
447 double scale_factor = 1.;
448 if ( std::abs(col_x-1) < std::numeric_limits<double>::epsilon() )
450 else if ( std::abs(col_x-2) < std::numeric_limits<double>::epsilon() )
455 cov.fillSymmetric(0, 0, scale_factor * scale_factor * siWidth.phiR() * siWidth.phiR() * (1./12.));
456 cov.fillSymmetric(1, 1, siWidth.z() * siWidth.z() / col_y / col_y * (1./12.));
465 double v1 = (
cov)(1,1);
466 cov.fillSymmetric( 0, 0, cs2 *
v0 + sn2 * v1 );
467 cov.fillSymmetric( 0, 1, sn * std::sqrt(cs2) * (
v0 - v1) );
468 cov.fillSymmetric( 1, 1, sn2 *
v0 + cs2 * v1 );
471 cl = std::make_unique<InDet::SCT_Cluster>(strip_id, localPos, std::vector<Identifier>(rdoList), siWidth, pDE,
Amg::MatrixX(
cov));
473 return StatusCode::SUCCESS;
◆ createSCTCluster() [4/4]
Definition at line 476 of file FPGAClusterConverter.cxx.
477 ATH_MSG_DEBUG(
"\t Create xAOD::StripCluster from FPGATrackSimHit ");
483 int strip =
static_cast<int>(
h.getPhiCoord());
515 const std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition> ends( design->
endsOfStrip(centre) );
516 const double stripLength( std::abs(ends.first.xEta() - ends.second.xEta()) );
520 ATH_MSG_DEBUG(
"\t\tcentre eta: " << centre.xEta() <<
" phi: " << centre.xPhi());
522 ATH_MSG_DEBUG(
"\t\tlocal position before shift: " << localPos.x() <<
" phi: " << localPos.y());
527 localPos = localPosShift;
531 ATH_MSG_DEBUG(
"\t\tLocal position: x=" << localPos.x() <<
" y=" << localPos.y() );
532 ATH_MSG_DEBUG(
"\t\tGlobal position: x=" << globalPos.x() <<
" y=" << globalPos.y() <<
" z=" << globalPos.z() );
535 Eigen::Matrix<float,1,1> localPosition;
536 Eigen::Matrix<float,1,1> localCovariance;
537 localCovariance.setZero();
540 localPosition(0, 0) = localPos.x();
545 if ( designNew ==
nullptr )
return StatusCode::FAILURE;
547 localPosition(0, 0) = localInPolar.
xPhi();
551 Eigen::Matrix<float,3,1> globalPosition(globalPos.x(), globalPos.y(), globalPos.z());
553 cl.setMeasurement<1>(
hash, localPosition, localCovariance);
554 cl.setIdentifier( rdoList.front().get_compact() );
555 cl.setRDOlist(rdoList);
556 cl.globalPosition() = globalPosition;
557 cl.setChannelsInPhi(siWidth.colRow()[0]);
559 return StatusCode::SUCCESS;
◆ getRdoList() [1/2]
Definition at line 598 of file FPGAClusterConverter.cxx.
605 int etaIndex =
h.getEtaIndex();
610 rdoList.push_back(hit_id);
615 rdoList.push_back(hit_id);
619 return StatusCode::SUCCESS;
◆ getRdoList() [2/2]
Definition at line 624 of file FPGAClusterConverter.cxx.
628 int etaIndex =
h.getEtaIndex();
633 rdoList.push_back(hit_id);
638 rdoList.push_back(hit_id);
641 return StatusCode::SUCCESS;
◆ initialize()
StatusCode FPGAClusterConverter::initialize |
( |
| ) |
|
|
finaloverridevirtual |
◆ 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.
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.
unsigned getIdentifierHash() const
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.
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.
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.