25 declareInterface<IFPGATrackSimTrackExtensionTool>(
this);
40 m_phits_atLayer[j] = std::map<unsigned, std::vector<std::shared_ptr<const FPGATrackSimHit>>>();
43 m_phits_atLayer[j][
i] = std::vector<std::shared_ptr<const FPGATrackSimHit>>();
47 return StatusCode::SUCCESS;
51 const std::vector<std::shared_ptr<const FPGATrackSimTrack>> & tracks,
52 std::vector<std::shared_ptr<const FPGATrackSimRoad>> & roads) {
58 for (
auto&
entry : sliceEntry.second) {
68 for (
const std::shared_ptr<const FPGATrackSimHit>& hit :
hits) {
69 std::shared_ptr<FPGATrackSimHit> hitCopy = std::make_shared<FPGATrackSimHit>(*hit);
70 pmap_2nd->
map(*hitCopy);
80 for (std::shared_ptr<const FPGATrackSimTrack>
track : tracks) {
81 if (
track->passedOR() == 0) {
86 double trackd0 =
track->getD0();
87 double trackphi =
track->getPhi();
88 double trackz0 =
track->getZ0();
89 double tracketa =
track->getEta();
90 double cottracktheta = 0.5*(
exp(tracketa)-
exp(-tracketa));
91 double trackqoverpt =
track->getQOverPt();
95 std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>> road_hits;
99 for (
auto hit :
track->getFPGATrackSimHits()) {
100 road_hits[hit.getLayer()].push_back(std::make_shared<FPGATrackSimHit>(hit));
103 hitLayers |= 1 << hit.getLayer();
120 double hitphi = hit->getGPhi();
121 double hitr = hit->getR();
122 double hitz = hit->getZ();
123 double pred_hitphi = trackphi - asin(hitr * fpgatracksim::A * 1000 * trackqoverpt - trackd0/hitr);
124 double pred_hitz = trackz0 + hitr*cottracktheta;
129 pred_hitphi += fieldCor;
132 double diff = abs(hitphi-pred_hitphi);
133 double diffz = abs(hitz-pred_hitz);
139 road_hits[
layer].push_back(hit);
140 hitLayers |= 1 << hit->getLayer();
146 for (
auto num: numHits) {
147 if(
num > 0) nhit += 1;
159 road.
setY(trackqoverpt);
165 unsigned int wclayers = 0;
166 for (
unsigned i = 0;
i < numHits.size();
i++){
167 if(numHits[
i]==0) wclayers |= (0x1 <<
i);
173 road.
setHits(std::move(road_hits));
180 roads.emplace_back(std::make_shared<const FPGATrackSimRoad>(
r));
184 return StatusCode::SUCCESS;