49 template <
typename TrackerTraits>
78 template <
typename TrackerTraits>
81 tokenTrack_(consumes(iConfig.getParameter<
edm::
InputTag>(
"trackSrc"))),
86 minNumberOfHits_(iConfig.getParameter<
int>(
"minNumberOfHits")),
96 produces<TrackingRecHitCollection>();
97 produces<reco::TrackExtraCollection>();
101 produces<reco::TrackCollection>();
102 produces<IndToEdm>();
105 template <
typename TrackerTraits>
111 desc.add<
int>(
"minNumberOfHits", 0);
116 template <
typename TrackerTraits>
132 auto indToEdmP = std::make_unique<IndToEdm>();
133 auto &indToEdm = *indToEdmP;
135 auto const &idealField = iSetup.
getData(idealMagneticFieldToken_);
139 auto const &httopo = iSetup.
getData(ttTopoToken_);
141 const auto &bsh =
iEvent.get(tBeamSpot_);
145 std::vector<TrackingRecHit const *> hitmap;
146 auto const &rcs =
rechits.data();
147 auto const nhits = rcs.size();
149 hitmap.resize(
nhits,
nullptr);
151 auto const *hitsModuleStart =
iEvent.get(hmsToken_).get();
153 for (
auto const &
hit : rcs) {
155 auto const detI = thit.
det()->
index();
156 auto const &clus = thit.firstClusterRef();
158 auto const idx = hitsModuleStart[detI] + clus.pixelCluster().originalId();
159 if (
idx >= hitmap.size())
160 hitmap.resize(
idx + 256,
nullptr);
166 std::vector<const TrackingRecHit *>
hits;
169 auto const &tsoa =
iEvent.get(tokenTrack_);
170 auto const *
quality = tsoa.view().quality();
171 auto const &hitIndices = tsoa.view().hitIndices();
172 auto nTracks = tsoa.view().nTracks();
179 std::vector<int32_t> sortIdxs(
nTracks);
180 std::iota(sortIdxs.begin(), sortIdxs.end(), 0);
182 std::sort(sortIdxs.begin(), sortIdxs.end(), [&](int32_t
const i1, int32_t
const i2) {
184 return tsoa.view()[
i1].pt() > tsoa.view()[
i2].pt();
190 indToEdm.resize(sortIdxs.size(), -1);
191 for (
const auto &
it : sortIdxs) {
198 if (
nHits < minNumberOfHits_)
204 auto b = hitIndices.begin(
it);
205 for (
int iHit = 0; iHit <
nHits; ++iHit)
206 hits[iHit] = hitmap[*(
b + iHit)];
209 float chi2 = tsoa.view()[
it].chi2();
219 for (
int i = 0;
i < 5; ++
i)
220 for (
int j =
i;
j < 5; ++
j)
221 m(
i,
j) = ocov(
i,
j);
244 auto tkq = recoQuality[
int(
q)];
245 track->setQuality(tkq);
253 track->setQuality(tkq);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
Eigen::Matrix< double, 5, 5 > Matrix5d
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const edm::EDGetTokenT< reco::BeamSpot > tBeamSpot_
const edm::EDGetTokenT< TrackSoAHost > tokenTrack_
Quality qualityByName(std::string const &name)
void storeTracks(Ev &ev, const TWH &tracksWithHits, const TrackerTopology &ttopo)
const edm::EDGetTokenT< SiPixelRecHitCollectionNew > cpuHits_
TrackQuality
track quality
Sin< T >::type sin(const T &t)
~PixelTrackProducerFromSoAT() override=default
int32_t const minNumberOfHits_
Eigen::Matrix< double, 5, 1 > Vector5d
void transformToPerigeePlane(VI5 const &ip, MI5 const &icov, VO5 &op, MO5 &ocov)
const GeomDet * det() const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > idealMagneticFieldToken_
LocalVector momentum() const
Momentum vector in the local frame.
Cos< T >::type cos(const T &t)
def template(fileName, svg, replaceme="REPLACEME")
#define DEFINE_FWK_MODULE(type)
TrackCharge charge() const
Charge (-1, 0 or 1)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
std::vector< uint32_t > IndToEdm
const edm::EDGetTokenT< HMSstorage > hmsToken_
pixelTrack::Quality const minQuality_
XYZVectorD XYZVector
spatial vector with cartesian internal representation
void produce(edm::StreamID streamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
XYZPointD XYZPoint
point in space with cartesian internal representation
PixelTrackProducerFromSoAT(const edm::ParameterSet &iConfig)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
std::vector< TrackWithRecHits > TracksWithRecHits
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > ttTopoToken_
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
LocalPoint position() const
Local x and y position coordinates.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)