32 std::vector<ActsTrk::ProtoTrack> & foundProtoTracks,
33 const std::vector<FPGATrackSimRoad>& roads)
const {
35 ATH_MSG_INFO(
"Creating Acts proto-tracks from FPGA roads...");
37 if (roads.size() > 0) {
38 std::unordered_map<xAOD::DetectorIdentType, const xAOD::PixelCluster*> pixelClusterMap;
40 pixelClusterMap.emplace(cluster->identifier(), cluster);
43 std::unordered_map<xAOD::DetectorIdentType, const xAOD::StripCluster*> stripClusterMap;
45 stripClusterMap.emplace(cluster->identifier(), cluster);
49 std::vector<const xAOD::UncalibratedMeasurement* > points;
52 for (
size_t l = 0; l < road.getNLayers(); ++l) {
53 for (
const auto& layerH : road.getHitPtrs(l)) {
54 if (!layerH || !layerH->isReal())
continue;
56 if (layerH->isPixel()) {
58 auto it = pixelClusterMap.find(layerH->getRdoIdentifier());
59 if (it != pixelClusterMap.end()) {
63 else if (layerH->isStrip()) {
65 auto it = stripClusterMap.find(layerH->getRdoIdentifier());
66 if (it != stripClusterMap.end()) {
72 return StatusCode::FAILURE;
78 std::unique_ptr<Acts::BoundTrackParameters> inputPerigee =
makeParams(road);
79 foundProtoTracks.emplace_back(points, std::move(inputPerigee));
80 ATH_MSG_INFO(
"Made a prototrack with " << points.size() <<
" measurements");
85 return StatusCode::SUCCESS;
91 std::vector<ActsTrk::ProtoTrack>& foundProtoTracks,
92 const std::vector<FPGATrackSimTrack>& tracks)
const {
94 ATH_MSG_INFO(
"Creating Acts proto-tracks from FPGA tracks...");
96 std::unordered_map<xAOD::DetectorIdentType, const xAOD::PixelCluster*> pixelClusterMap;
98 pixelClusterMap.emplace(cluster->identifier(), cluster);
101 std::unordered_map<xAOD::DetectorIdentType, const xAOD::StripCluster*> stripClusterMap;
103 stripClusterMap.emplace(cluster->identifier(), cluster);
106 if (not track.passedOR())
continue;
107 std::vector<const xAOD::UncalibratedMeasurement* > points;
108 const auto& hits = track.getFPGATrackSimHitPtrs();
109 for (
const auto& hit : hits) {
110 if (!hit->isReal())
continue;
112 if (hit->isPixel()) {
114 auto it = pixelClusterMap.find(hit->getRdoIdentifier());
115 if (it != pixelClusterMap.end()) {
119 else if (hit->isStrip()) {
121 auto it = stripClusterMap.find(hit->getRdoIdentifier());
122 if (it != stripClusterMap.end()) {
128 return StatusCode::FAILURE;
133 ATH_MSG_DEBUG(
"\tMaking a proto-track with " << points.size() <<
" clusters");
134 std::unique_ptr<Acts::BoundTrackParameters> inputPerigee =
makeParams(track);
135 foundProtoTracks.emplace_back(points, std::move(inputPerigee));
138 return StatusCode::SUCCESS;
162 using namespace Acts::UnitLiterals;
164 std::shared_ptr<const Acts::Surface> actsSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Vector3(0., 0., 0.));
165 Acts::BoundVector params;
167 constexpr double GeVToMeV = 1000;
172 double theta=2*std::atan(std::exp(-
eta));
173 double qop = (std::abs(road.
getY()) > 1E-9) ? road.
getY()/GeVToMeV : 1E-12;
177 params << d0, z0,
phi,
theta, qop, t;
180 Acts::BoundMatrix cov = Acts::BoundMatrix::Identity();
181 cov *= (GeVToMeV*GeVToMeV);
186 Acts::PdgParticle absPdg = Acts::makeAbsolutePdgParticle(Acts::ePionPlus);
187 Acts::ParticleHypothesis actsHypothesis{
190 return std::make_unique<Acts::BoundTrackParameters>(actsSurface, params,
191 cov, actsHypothesis);
198 using namespace Acts::UnitLiterals;
199 std::shared_ptr<const Acts::Surface> actsSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Vector3(0., 0., 0.));
200 Acts::BoundVector params;
202 constexpr double GeVToMeV = 1000.;
203 double d0=track.getD0();
204 double z0=track.getZ0();
205 double phi=track.getPhi();
206 double eta=track.getEta();
207 double theta=track.getTheta();
208 double qopt=track.getQOverPt()*GeVToMeV;
209 double pt=track.getPt()/GeVToMeV;
210 double px=pt*std::cos(
phi);
211 double py=pt*std::sin(
phi);
212 double pz=pt*std::sinh(
eta);
213 double p=std::sqrt(px*px+py*py+pz*pz);
214 double qop=((p > 1e-10) ? (1/p) : 1e10);
215 if (qopt < 0) qop *= -1;
218 params << d0, z0,
phi,
theta, qop, t;
219 ATH_MSG_DEBUG(
"\td0= " << d0 <<
" z0=" <<z0 <<
" phi=" <<
phi <<
" theta=" <<
theta<<
" qoverp=" << qop);
222 Acts::BoundMatrix cov = Acts::BoundMatrix::Identity();
226 (cov)(2,2) *= 0.0008;
227 (cov)(3,3) *= 0.0008;
235 Acts::PdgParticle absPdg = Acts::makeAbsolutePdgParticle(Acts::ePionPlus);
236 Acts::ParticleHypothesis actsHypothesis{
239 return std::make_unique<Acts::BoundTrackParameters>(actsSurface, params,
240 cov, actsHypothesis);
StatusCode matchTrackMeasurements(const EventContext &ctx, const XAOD_CLUSTER &cluster, const FPGATrackSimHit &trackHit, std::vector< const xAOD::UncalibratedMeasurement * > &measurements, const DataVector< XAOD_CLUSTER > &clusterContainer) const
virtual StatusCode findProtoTracks(const EventContext &ctx, const xAOD::PixelClusterContainer &pixelContainer, const xAOD::StripClusterContainer &stripContainer, std::vector< ActsTrk::ProtoTrack > &foundProtoTracks, const std::vector< FPGATrackSimRoad > &roads) const override final
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses