18 #include <boost/numeric/ublas/matrix.hpp>
33 std::once_flag printOnce;
34 std::once_flag callOnce;
37 std::unique_ptr<GlobalCacheTMTT> TMTrackProducer::initializeGlobalCache(
edm::ParameterSet const& iConfig) {
38 return std::make_unique<GlobalCacheTMTT>(iConfig);
43 stubWindowSuggest_(globalCacheTMTT->stubWindowSuggest()),
44 hists_(globalCacheTMTT->
hists()),
45 htRphiErrMon_(globalCacheTMTT->htRphiErrMon()),
86 produces<TTTrackCollection>(
"TML1TracksHT").setBranchAlias(
"TML1TracksHT");
89 produces<TTTrackCollection>(
"TML1TracksRZ").setBranchAlias(
"TML1TracksRZ");
107 globalCache()->settings().setMagneticField(
bField);
109 std::stringstream
text;
110 text <<
"\n--- B field = " <<
bField <<
" Tesla ---\n";
130 DetId detId = gd->geographicalId();
172 const list<TP>& vTPs = inputData.
getTPs();
173 const list<Stub*>& vStubs = inputData.stubs();
184 map<string, list<const L1fittedTrack*>> mapFinalTracks;
191 auto htTTTracksForOutput = std::make_unique<TTTrackCollection>();
192 auto rzTTTracksForOutput = std::make_unique<TTTrackCollection>();
193 map<string, unique_ptr<TTTrackCollection>> allFitTTTracksForOutput;
195 auto fitTTTracksForOutput = std::make_unique<TTTrackCollection>();
196 allFitTTTracksForOutput[fitterName] =
std::move(fitTTTracksForOutput);
205 mSectors(iPhiSec, iEtaReg) = std::make_unique<Sector>(&
settings_, iPhiSec, iEtaReg);
206 Sector* sector = mSectors(iPhiSec, iEtaReg).get();
208 mHtRphis(iPhiSec, iEtaReg) = std::make_unique<HTrphi>(
210 HTrphi* htRphi = mHtRphis(iPhiSec, iEtaReg).get();
214 for (
Stub* stub : vStubs) {
222 bool inside = sector->
inside(stub);
233 htRphi->store(stub, inEtaSubSecs);
248 muxHT.
exec(mHtRphis);
254 miniHTstage.
exec(mHtRphis);
261 const Sector* sector = mSectors(iPhiSec, iEtaReg).get();
264 const HTrphi* htRphi = mHtRphis(iPhiSec, iEtaReg).get();
265 const list<L1track2D>& vecTracksRphi = htRphi->
trackCands2D();
268 mMake3Dtrks(iPhiSec, iEtaReg) = std::make_unique<Make3Dtracks>(
270 Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get();
273 make3Dtrk->
run(vecTracksRphi);
278 const list<L1track3D>& vecTrk3D_ht = make3Dtrk->trackCands3D(
false);
279 for (
const L1track3D& trk : vecTrk3D_ht) {
281 htTTTracksForOutput->push_back(htTTTrack);
285 const list<L1track3D>& vecTrk3D_rz = make3Dtrk->trackCands3D(
true);
286 for (
const L1track3D& trk : vecTrk3D_rz) {
288 rzTTTracksForOutput->push_back(rzTTTrack);
301 const Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get();
307 const list<L1track3D>& vecTrk3D = make3Dtrk->
trackCands3D(useRZfilt);
310 list<L1fittedTrack>& fitTrksInSec = mapmFitTrks(iPhiSec, iEtaReg)[fitterName];
316 const vector<Stub*>& stubsOnTrk = trk.stubs();
317 for (
Stub*
s : stubsOnTrk) {
330 fitTrksInSec.push_back(fitTrk);
347 const list<L1fittedTrack>& fitTrksInSec = mapmFitTrks(iPhiSec, iEtaReg)[fitterName];
350 list<const L1fittedTrack*> filteredFitTrksInSec = killDupFitTrks.
filter(fitTrksInSec);
356 allFitTTTracksForOutput[fitterName]->push_back(fitTTTrack);
360 mapFinalTracks[fitterName].insert(
361 mapFinalTracks[fitterName].
end(), filteredFitTrksInSec.begin(), filteredFitTrksInSec.end());
368 PrintL1trk() <<
"INPUT #TPs = " << vTPs.size() <<
" #STUBs = " << vStubs.size();
369 unsigned int numHTtracks = 0;
372 const Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get();
376 PrintL1trk() <<
"Number of tracks after HT = " << numHTtracks;
377 for (
const auto&
p : mapFinalTracks) {
378 const string& fitName =
p.first;
379 const list<const L1fittedTrack*> fittedTracks =
p.second;
380 PrintL1trk() <<
"Number of tracks after " << fitName <<
" track helix fit = " << fittedTracks.size();
385 for (
Stub* stub : vStubs) {
387 stub->setDigitizeWarningsOn(
false);
391 hists_.
fill(inputData, mSectors, mHtRphis, mMake3Dtrks, mapFinalTracks);