33 std::vector<ActsTrk::ProtoTrack> & foundProtoTracks,
34 const std::vector<FPGATrackSimRoad>& roads)
const {
36 ATH_MSG_INFO(
"Creating Acts proto-tracks from FPGA roads...");
38 if (roads.size() > 0) {
39 std::unordered_map<xAOD::DetectorIdentType, const xAOD::PixelCluster*> pixelClusterMap;
41 pixelClusterMap.emplace(cluster->identifier(), cluster);
44 std::unordered_map<xAOD::DetectorIdentType, const xAOD::StripCluster*> stripClusterMap;
46 stripClusterMap.emplace(cluster->identifier(), cluster);
50 std::vector<ActsTrk::ATLASUncalibSourceLink> points;
53 for (
size_t l = 0; l < road.getNLayers(); ++l) {
54 for (
const auto& layerH : road.getHitPtrs(l)) {
55 if (!layerH || !layerH->isReal())
continue;
57 if (layerH->isPixel()) {
59 auto it = pixelClusterMap.find(layerH->getRdoIdentifier());
60 if (it != pixelClusterMap.end()) {
64 else if (layerH->isStrip()) {
66 auto it = stripClusterMap.find(layerH->getRdoIdentifier());
67 if (it != stripClusterMap.end()) {
73 return StatusCode::FAILURE;
79 std::unique_ptr<Acts::BoundTrackParameters> inputPerigee =
makeParams(road);
80 foundProtoTracks.emplace_back(points, std::move(inputPerigee));
81 ATH_MSG_INFO(
"Made a prototrack with " << points.size() <<
" measurements");
86 return StatusCode::SUCCESS;
92 std::vector<ActsTrk::ProtoTrack>& foundProtoTracks,
93 const std::vector<FPGATrackSimTrack>& tracks)
const {
95 ATH_MSG_INFO(
"Creating Acts proto-tracks from FPGA tracks...");
97 std::unordered_map<xAOD::DetectorIdentType, const xAOD::PixelCluster*> pixelClusterMap;
99 pixelClusterMap.emplace(cluster->identifier(), cluster);
102 std::unordered_map<xAOD::DetectorIdentType, const xAOD::StripCluster*> stripClusterMap;
104 stripClusterMap.emplace(cluster->identifier(), cluster);
107 if (not track.passedOR())
continue;
108 std::vector<ActsTrk::ATLASUncalibSourceLink> points;
109 const auto& hits = track.getFPGATrackSimHitPtrs();
110 for (
const auto& hit : hits) {
111 if (!hit->isReal())
continue;
113 if (hit->isPixel()) {
115 auto it = pixelClusterMap.find(hit->getRdoIdentifier());
116 if (it != pixelClusterMap.end()) {
120 else if (hit->isStrip()) {
122 auto it = stripClusterMap.find(hit->getRdoIdentifier());
123 if (it != stripClusterMap.end()) {
129 return StatusCode::FAILURE;
134 ATH_MSG_DEBUG(
"\tMaking a proto-track with " << points.size() <<
" clusters");
135 std::unique_ptr<Acts::BoundTrackParameters> inputPerigee =
makeParams(track);
136 foundProtoTracks.emplace_back(points, std::move(inputPerigee));
139 return StatusCode::SUCCESS;
163 using namespace Acts::UnitLiterals;
165 std::shared_ptr<const Acts::Surface> actsSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Vector3(0., 0., 0.));
166 Acts::BoundVector params;
168 constexpr double GeVToMeV = 1000;
173 double theta=2*std::atan(std::exp(-
eta));
174 double qop = (std::abs(road.
getY()) > 1E-9) ? road.
getY()/GeVToMeV : 1E-12;
178 params << d0, z0,
phi,
theta, qop, t;
181 Acts::BoundMatrix cov = Acts::BoundMatrix::Identity();
182 cov *= (GeVToMeV*GeVToMeV);
187 Acts::PdgParticle absPdg = Acts::makeAbsolutePdgParticle(Acts::ePionPlus);
188 Acts::ParticleHypothesis actsHypothesis{
189 absPdg, mass, Acts::AnyCharge{1.0f}};
191 return std::make_unique<Acts::BoundTrackParameters>(actsSurface, params,
192 cov, actsHypothesis);
199 using namespace Acts::UnitLiterals;
200 std::shared_ptr<const Acts::Surface> actsSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Vector3(0., 0., 0.));
201 Acts::BoundVector params;
203 constexpr double GeVToMeV = 1000.;
204 double d0=track.getD0();
205 double z0=track.getZ0();
206 double phi=track.getPhi();
207 double eta=track.getEta();
208 double theta=track.getTheta();
209 double qopt=track.getQOverPt()*GeVToMeV;
210 double pt=track.getPt()/GeVToMeV;
211 double px=pt*std::cos(
phi);
212 double py=pt*std::sin(
phi);
213 double pz=pt*std::sinh(
eta);
214 double p=std::sqrt(px*px+py*py+pz*pz);
215 double qop=((p > 1e-10) ? (1/p) : 1e10);
216 if (qopt < 0) qop *= -1;
219 params << d0, z0,
phi,
theta, qop, t;
220 ATH_MSG_DEBUG(
"\td0= " << d0 <<
" z0=" <<z0 <<
" phi=" <<
phi <<
" theta=" <<
theta<<
" qoverp=" << qop);
223 Acts::BoundMatrix cov = Acts::BoundMatrix::Identity();
227 (cov)(2,2) *= 0.0008;
228 (cov)(3,3) *= 0.0008;
236 Acts::PdgParticle absPdg = Acts::makeAbsolutePdgParticle(Acts::ePionPlus);
237 Acts::ParticleHypothesis actsHypothesis{
238 absPdg, mass, Acts::AnyCharge{1.0f}};
240 return std::make_unique<Acts::BoundTrackParameters>(actsSurface, params,
241 cov, actsHypothesis);
StatusCode matchTrackMeasurements(const EventContext &ctx, const XAOD_CLUSTER &cluster, const FPGATrackSimHit &trackHit, std::vector< ActsTrk::ATLASUncalibSourceLink > &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