124 std::vector<std::vector<unsigned int>>
const& lstTC_hitIdx = lstOutput.hitIdx();
125 std::vector<unsigned int>
const& lstTC_len = lstOutput.len();
126 std::vector<int>
const& lstTC_seedIdx = lstOutput.seedIdx();
127 std::vector<short>
const& lstTC_trackCandidateType = lstOutput.trackCandidateType();
130 outputTS.reserve(lstTC_len.size());
131 outputpLSTS.reserve(lstTC_len.size());
133 outputTC.reserve(lstTC_len.size());
134 outputpTC.reserve(lstTC_len.size());
135 outputT5TC.reserve(lstTC_len.size());
136 outputNopLSTC.reserve(lstTC_len.size());
137 outputpTTC.reserve(lstTC_len.size());
138 outputpLSTC.reserve(lstTC_len.size());
140 auto const& OTHits = phase2OTRecHits.hits();
142 LogDebug(
"LSTOutputConverter") <<
"lstTC size " << lstTC_len.size();
143 for (
unsigned int i = 0;
i < lstTC_len.size();
i++) {
144 LogDebug(
"LSTOutputConverter") <<
" cand " <<
i <<
" " << lstTC_len[
i] <<
" " << lstTC_seedIdx[
i];
151 for (
auto const&
hit :
seed.recHits())
156 for (
unsigned int j = nPixelHits;
j < lstTC_hitIdx[
i].size();
j++)
157 recHits.push_back(OTHits[lstTC_hitIdx[
i][
j]]->clone());
159 recHits.sort([](
const auto&
a,
const auto&
b) {
160 const auto asub =
a.det()->subDetector();
161 const auto bsub =
b.det()->subDetector();
166 }
else if (asub != bsub) {
169 const auto& apos =
a.surface();
170 const auto& bpos =
b.surface();
172 return apos->rSpan().first < bpos->rSpan().first;
185 std::vector<Hit> hitsForSeed;
186 hitsForSeed.reserve(lstTC_len[
i]);
190 auto hType =
tracker.getDetectorType(
hit.geographicalId());
194 hitsForSeed.emplace_back(dynamic_cast<Hit>(&
hit));
202 <<
"failed to convert a LST object to a seed" <<
i <<
" " << lstTC_len[
i] <<
" " << lstTC_seedIdx[
i];
210 outputTS.emplace_back(trajectorySeed);
211 auto const&
ss = trajectorySeed.startingState();
212 LogDebug(
"LSTOutputConverter") <<
"Created a seed with " <<
seed.nHits() <<
" " <<
ss.detId() <<
" " <<
ss.pt()
213 <<
" " <<
ss.parameters().vector() <<
" " <<
ss.error(0);
216 outputTS.emplace_back(
seed);
217 outputpLSTS.emplace_back(
seed);
223 auto tsosPair = propOppo.propagateWithPath(tsos, *
recHits[0].surface());
224 if (!tsosPair.first.isValid()) {
225 LogDebug(
"LSTOutputConverter") <<
"Propagating to startingState opposite to momentum failed, trying along next";
226 tsosPair = propAlo.propagateWithPath(tsos, *
recHits[0].surface());
228 if (tsosPair.first.isValid()) {
237 outputTC.emplace_back(tc);
238 outputT5TC.emplace_back(tc);
239 outputNopLSTC.emplace_back(tc);
243 outputTC.emplace_back(tc);
244 outputpTC.emplace_back(tc);
246 outputNopLSTC.emplace_back(tc);
247 outputpTTC.emplace_back(tc);
249 outputpLSTC.emplace_back(tc);
253 edm::LogInfo(
"LSTOutputConverter") <<
"Failed to make a candidate initial state. Seed state is " << tsos
254 <<
" TC cand " <<
i <<
" " << lstTC_len[
i] <<
" " << lstTC_seedIdx[
i]
255 <<
" first hit " <<
recHits.front().globalPosition() <<
" last hit " 256 <<
recHits.back().globalPosition();
260 LogDebug(
"LSTOutputConverter") <<
"done with conversion: Track candidate output size = " << outputpTC.size()
261 <<
" (p* objects) + " << outputT5TC.size() <<
" (T5 objects)";
const edm::EDPutTokenT< TrackCandidateCollection > trackCandidateT5TCPutToken_
void rescaleError(double factor)
bool isOuterTracker(GeomDetEnumerators::SubDetector m)
const edm::EDPutTokenT< TrackCandidateCollection > trackCandidatepTTCPutToken_
const edm::EDPutTokenT< TrackCandidateCollection > trackCandidateNopLSTCPutToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const edm::EDPutTokenT< TrajectorySeedCollection > trajectorySeedpLSPutToken_
bool isBarrel(GeomDetEnumerators::SubDetector m)
std::vector< TrackCandidate > TrackCandidateCollection
const edm::EDGetTokenT< LSTOutput > lstOutputToken_
const edm::EDGetTokenT< TrajectorySeedCollection > lstPixelSeedToken_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorOppositeToken_
BaseTrackerRecHit const * ConstRecHitPointer
const edm::EDPutTokenT< TrackCandidateCollection > trackCandidatepLSTCPutToken_
std::vector< TrajectorySeed > TrajectorySeedCollection
const edm::EDPutTokenT< TrackCandidateCollection > trackCandidatePutToken_
const edm::EDPutTokenT< TrackCandidateCollection > trackCandidatepTCPutToken_
Abs< T >::type abs(const T &t)
const edm::EDPutTokenT< std::vector< SeedStopInfo > > seedStopInfoPutToken_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorAlongToken_
Log< level::Info, false > LogInfo
const edm::EDPutTokenT< TrajectorySeedCollection > trajectorySeedPutToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
const edm::EDGetTokenT< LSTPhase2OTHitsInput > lstPhase2OTHitsInputToken_
bool isInnerTracker(GeomDetEnumerators::SubDetector m)
const bool includeNonpLSTSs_
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
std::unique_ptr< SeedCreator > seedCreator_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomToken_