34 return StatusCode::SUCCESS;
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;
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;
136 std::vector<Identifier> rdoList;
151 ATH_MSG_DEBUG(
"xAOD pixelCont size: " << pixelCont.
size() <<
" xAOD pixelCont size: " << SCTCont.
size());
153 return StatusCode::SUCCESS;
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;
202 std::vector<Identifier> rdoList;
217 ATH_MSG_DEBUG(
"xAOD pixelCont size: " << pixelCont.
size() <<
" xAOD SCTCont size: " << SCTCont.
size());
219 return StatusCode::SUCCESS;
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;
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() );
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;
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;
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() );
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;
375 cl.setWidthInEta(
static_cast<float>(siWidth.
widthPhiRZ()[1]));
376 cl.setOmegas(omegax, omegay);
378 cl.setSplitProbabilities(splitProb1, splitProb2);
381 return StatusCode::SUCCESS;
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()) );
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;
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()) );
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;
563 ATH_MSG_DEBUG(
"\t Create InDet::PixelCluster from FPGATrackSimCluster");
565 std::vector<Identifier> rdoList;
568 return StatusCode::SUCCESS;
572 ATH_MSG_DEBUG(
"\t Create xAOD::PixelCluster from FPGATrackSimCluster");
574 std::vector<Identifier> rdoList;
577 return StatusCode::SUCCESS;
581 ATH_MSG_DEBUG(
"\t Create InDet::SCT_Cluster from FPGATrackSimCluster");
583 std::vector<Identifier> rdoList;
586 return StatusCode::SUCCESS;
590 ATH_MSG_DEBUG(
"\t Create xAOD::StripCluster from FPGATrackSimCluster");
592 std::vector<Identifier> rdoList;
595 return StatusCode::SUCCESS;
605 int etaIndex =
h.getEtaIndex();
610 rdoList.push_back(hit_id);
615 rdoList.push_back(hit_id);
619 return StatusCode::SUCCESS;
628 int etaIndex =
h.getEtaIndex();
633 rdoList.push_back(hit_id);
638 rdoList.push_back(hit_id);
641 return StatusCode::SUCCESS;