31 std::once_flag printOnce;
32 std::once_flag callOnce;
35 std::unique_ptr<GlobalCacheTMTT> TMTrackProducer::initializeGlobalCache(
edm::ParameterSet const& iConfig) {
36 return std::make_unique<GlobalCacheTMTT>(iConfig);
41 stubWindowSuggest_(globalCacheTMTT->stubWindowSuggest()),
42 hists_(globalCacheTMTT->
hists()),
43 htRphiErrMon_(globalCacheTMTT->htRphiErrMon()),
84 produces<TTTrackCollection>(
"TML1TracksHT").setBranchAlias(
"TML1TracksHT");
87 produces<TTTrackCollection>(
"TML1TracksRZ").setBranchAlias(
"TML1TracksRZ");
105 globalCache()->settings().setMagneticField(
bField);
107 std::stringstream
text;
108 text <<
"\n--- B field = " <<
bField <<
" Tesla ---\n";
128 DetId detId = gd->geographicalId();
170 const list<TP>& vTPs = inputData.
getTPs();
171 const list<Stub*>& vStubs = inputData.stubs();
182 map<string, list<const L1fittedTrack*>> mapFinalTracks;
189 auto htTTTracksForOutput = std::make_unique<TTTrackCollection>();
190 auto rzTTTracksForOutput = std::make_unique<TTTrackCollection>();
191 map<string, unique_ptr<TTTrackCollection>> allFitTTTracksForOutput;
193 auto fitTTTracksForOutput = std::make_unique<TTTrackCollection>();
194 allFitTTTracksForOutput[fitterName] =
std::move(fitTTTracksForOutput);
203 mSectors(iPhiSec, iEtaReg) = std::make_unique<Sector>(&
settings_, iPhiSec, iEtaReg);
204 Sector* sector = mSectors(iPhiSec, iEtaReg).get();
206 mHtRphis(iPhiSec, iEtaReg) = std::make_unique<HTrphi>(
208 HTrphi* htRphi = mHtRphis(iPhiSec, iEtaReg).get();
212 for (
Stub* stub : vStubs) {
220 bool inside = sector->
inside(stub);
231 htRphi->store(stub, inEtaSubSecs);
246 muxHT.
exec(mHtRphis);
252 miniHTstage.
exec(mHtRphis);
259 const Sector* sector = mSectors(iPhiSec, iEtaReg).get();
262 const HTrphi* htRphi = mHtRphis(iPhiSec, iEtaReg).get();
263 const list<L1track2D>& vecTracksRphi = htRphi->
trackCands2D();
266 mMake3Dtrks(iPhiSec, iEtaReg) = std::make_unique<Make3Dtracks>(
268 Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get();
271 make3Dtrk->
run(vecTracksRphi);
276 const list<L1track3D>& vecTrk3D_ht = make3Dtrk->trackCands3D(
false);
277 for (
const L1track3D& trk : vecTrk3D_ht) {
279 htTTTracksForOutput->push_back(htTTTrack);
283 const list<L1track3D>& vecTrk3D_rz = make3Dtrk->trackCands3D(
true);
284 for (
const L1track3D& trk : vecTrk3D_rz) {
286 rzTTTracksForOutput->push_back(rzTTTrack);
299 const Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get();
305 const list<L1track3D>& vecTrk3D = make3Dtrk->
trackCands3D(useRZfilt);
308 list<L1fittedTrack>& fitTrksInSec = mapmFitTrks(iPhiSec, iEtaReg)[fitterName];
314 const vector<Stub*>& stubsOnTrk = trk.stubs();
315 for (
Stub*
s : stubsOnTrk) {
328 fitTrksInSec.push_back(fitTrk);
345 const list<L1fittedTrack>& fitTrksInSec = mapmFitTrks(iPhiSec, iEtaReg)[fitterName];
348 list<const L1fittedTrack*> filteredFitTrksInSec = killDupFitTrks.
filter(fitTrksInSec);
354 allFitTTTracksForOutput[fitterName]->push_back(fitTTTrack);
358 mapFinalTracks[fitterName].insert(
359 mapFinalTracks[fitterName].
end(), filteredFitTrksInSec.begin(), filteredFitTrksInSec.end());
366 PrintL1trk() <<
"INPUT #TPs = " << vTPs.size() <<
" #STUBs = " << vStubs.size();
367 unsigned int numHTtracks = 0;
370 const Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get();
374 PrintL1trk() <<
"Number of tracks after HT = " << numHTtracks;
375 for (
const auto&
p : mapFinalTracks) {
376 const string& fitName =
p.first;
377 const list<const L1fittedTrack*> fittedTracks =
p.second;
378 PrintL1trk() <<
"Number of tracks after " << fitName <<
" track helix fit = " << fittedTracks.size();
383 for (
Stub* stub : vStubs) {
385 stub->setDigitizeWarningsOn(
false);
389 hists_.
fill(inputData, mSectors, mHtRphis, mMake3Dtrks, mapFinalTracks);