37 return StatusCode::SUCCESS;
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;
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;
139 std::vector<Identifier> rdoList;
154 ATH_MSG_DEBUG(
"xAOD pixelCont size: " << pixelCont.
size() <<
" xAOD pixelCont size: " << SCTCont.
size());
156 return StatusCode::SUCCESS;
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;
204 std::vector<Identifier> rdoList;
219 ATH_MSG_DEBUG(
"xAOD pixelCont size: " << pixelCont.
size() <<
" xAOD SCTCont size: " << SCTCont.
size());
221 return StatusCode::SUCCESS;
225 const std::vector<FPGATrackSimCluster>& fpgaClusters,
247 return StatusCode::SUCCESS;
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;
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() );
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;
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;
370 localPos = localPosShift;
373 ATH_MSG_DEBUG(
"\t\tLocal position: x=" << localPos.x() <<
" y=" << localPos.y() );
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;
401 cl.setWidthInEta(
static_cast<float>(siWidth.
widthPhiRZ()[1]));
402 cl.setOmegas(omegax, omegay);
404 cl.setSplitProbabilities(splitProb1, splitProb2);
407 return StatusCode::SUCCESS;
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()) );
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;
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()) );
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;
588 ATH_MSG_DEBUG(
"\t Create InDet::PixelCluster from FPGATrackSimCluster");
590 std::vector<Identifier> rdoList;
593 return StatusCode::SUCCESS;
597 ATH_MSG_DEBUG(
"\t Create xAOD::PixelCluster from FPGATrackSimCluster");
599 std::vector<Identifier> rdoList;
602 return StatusCode::SUCCESS;
606 ATH_MSG_DEBUG(
"\t Create InDet::SCT_Cluster from FPGATrackSimCluster");
608 std::vector<Identifier> rdoList;
611 return StatusCode::SUCCESS;
615 ATH_MSG_DEBUG(
"\t Create xAOD::StripCluster from FPGATrackSimCluster");
617 std::vector<Identifier> rdoList;
620 return StatusCode::SUCCESS;
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;
678 std::vector<Identifier> rdoList;
684 std::unique_ptr<xAOD::StripClusterContainer> clusterCont = std::make_unique<xAOD::StripClusterContainer>();
685 std::unique_ptr<xAOD::StripClusterAuxContainer> clusterAuxCont = std::make_unique<xAOD::StripClusterAuxContainer>();
686 clusterCont->setStore(clusterAuxCont.get() );
694 Eigen::Matrix<float,3,1> globalPos(clEq.
getX(),clEq.
getY(),clEq.
getZ());
700 float covTerm = 1600.*
deltaY;
701 Eigen::Matrix<float, 2, 1> variance(0.1, 8.*covTerm);
705 std::swap( variance(0, 0), variance(1, 0) );
706 float cov_r = variance(0,0);
707 float cov_z = variance(1,0);
712 std::vector<unsigned int> idHashList;
713 std::vector<const xAOD::UncalibratedMeasurement_v1*> measurements;
717 float topHalfStripLength, bottomHalfStripLength;
724 idHashList.push_back(
h.getIdentifierHash());
725 for (
auto orig_cl : clustersCont) {
726 if (
h.getIdentifierHash()==orig_cl->identifierHash()) {
729 measurements.push_back(orig_cl);
737 Amg::Vector3D stripCenterDistance = stripCenter1 - stripCenter2;
739 ATH_MSG_DEBUG(
"topHalfStripLength = " << topHalfStripLength <<
" bottomHalfStripLength = " << bottomHalfStripLength);
740 ATH_MSG_DEBUG(
"topStripDirection = (" << topStripDirection.x() <<
", " << topStripDirection.y() <<
", " << topStripDirection.z() <<
") " <<
"bottomStripDirection = (" << bottomStripDirection.x() <<
", " << bottomStripDirection.y() <<
", " << bottomStripDirection.z() <<
") " );
741 ATH_MSG_DEBUG(
"stripCenterDistance = (" << stripCenterDistance.x() <<
", " << stripCenterDistance.y() <<
", " << stripCenterDistance.z() <<
")" );
742 ATH_MSG_DEBUG(
"topStripCenter = (" << topStripCenter.x() <<
", " << topStripCenter.y() <<
", " << topStripCenter.z() <<
")" );
752 bottomHalfStripLength,
753 topStripDirection.cast<
float>(),
754 bottomStripDirection.cast<
float>(),
755 stripCenterDistance.cast<
float>(),
756 topStripCenter.cast<
float>()
761 return StatusCode::SUCCESS;
772 int etaIndex =
h.getEtaIndex();
777 rdoList.push_back(hit_id);
782 rdoList.push_back(hit_id);
786 return StatusCode::SUCCESS;
795 int etaIndex =
h.getEtaIndex();
800 rdoList.push_back(hit_id);
805 rdoList.push_back(hit_id);
808 return StatusCode::SUCCESS;
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;