30 std::once_flag printOnce;
33 std::unique_ptr<GlobalCacheTMTT> TMTrackProducer::initializeGlobalCache(
edm::ParameterSet const& iConfig) {
34 return std::make_unique<GlobalCacheTMTT>(iConfig);
39 stubWindowSuggest_(globalCacheTMTT->stubWindowSuggest()),
40 hists_(globalCacheTMTT->
hists()),
41 htRphiErrMon_(globalCacheTMTT->htRphiErrMon()),
82 produces<TTTrackCollection>(
"TML1TracksHT").setBranchAlias(
"TML1TracksHT");
85 produces<TTTrackCollection>(
"TML1TracksRZ").setBranchAlias(
"TML1TracksRZ");
103 globalCache()->settings().setMagneticField(
bField);
105 std::stringstream
text;
106 text <<
"\n--- B field = " <<
bField <<
" Tesla ---\n";
167 const list<TP>& vTPs = inputData.
getTPs();
168 const list<Stub*>& vStubs = inputData.stubs();
179 map<string, list<const L1fittedTrack*>> mapFinalTracks;
186 auto htTTTracksForOutput = std::make_unique<TTTrackCollection>();
187 auto rzTTTracksForOutput = std::make_unique<TTTrackCollection>();
188 map<string, unique_ptr<TTTrackCollection>> allFitTTTracksForOutput;
190 auto fitTTTracksForOutput = std::make_unique<TTTrackCollection>();
191 allFitTTTracksForOutput[fitterName] =
std::move(fitTTTracksForOutput);
200 mSectors(iPhiSec, iEtaReg) = std::make_unique<Sector>(&
settings_, iPhiSec, iEtaReg);
203 mHtRphis(iPhiSec, iEtaReg) = std::make_unique<HTrphi>(
205 HTrphi* htRphi = mHtRphis(iPhiSec, iEtaReg).get();
209 for (
Stub* stub : vStubs) {
217 bool inside =
sector->inside(stub);
221 const vector<bool> inEtaSubSecs =
sector->insideEtaSubSecs(stub);
228 htRphi->store(stub, inEtaSubSecs);
243 muxHT.
exec(mHtRphis);
249 miniHTstage.
exec(mHtRphis);
256 const Sector*
sector = mSectors(iPhiSec, iEtaReg).get();
259 const HTrphi* htRphi = mHtRphis(iPhiSec, iEtaReg).get();
260 const list<L1track2D>& vecTracksRphi = htRphi->
trackCands2D();
263 mMake3Dtrks(iPhiSec, iEtaReg) = std::make_unique<Make3Dtracks>(
265 Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get();
268 make3Dtrk->
run(vecTracksRphi);
273 const list<L1track3D>& vecTrk3D_ht = make3Dtrk->trackCands3D(
false);
276 htTTTracksForOutput->push_back(htTTTrack);
280 const list<L1track3D>& vecTrk3D_rz = make3Dtrk->trackCands3D(
true);
283 rzTTTracksForOutput->push_back(rzTTTrack);
296 const Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get();
302 const list<L1track3D>& vecTrk3D = make3Dtrk->
trackCands3D(useRZfilt);
305 list<L1fittedTrack>& fitTrksInSec = mapmFitTrks(iPhiSec, iEtaReg)[fitterName];
311 const vector<Stub*>& stubsOnTrk =
trk.stubs();
312 for (
Stub*
s : stubsOnTrk) {
325 fitTrksInSec.push_back(fitTrk);
342 const list<L1fittedTrack>& fitTrksInSec = mapmFitTrks(iPhiSec, iEtaReg)[fitterName];
345 list<const L1fittedTrack*> filteredFitTrksInSec = killDupFitTrks.
filter(fitTrksInSec);
351 allFitTTTracksForOutput[fitterName]->push_back(fitTTTrack);
355 mapFinalTracks[fitterName].insert(
356 mapFinalTracks[fitterName].end(), filteredFitTrksInSec.begin(), filteredFitTrksInSec.end());
363 PrintL1trk() <<
"INPUT #TPs = " << vTPs.size() <<
" #STUBs = " << vStubs.size();
364 unsigned int numHTtracks = 0;
367 const Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get();
371 PrintL1trk() <<
"Number of tracks after HT = " << numHTtracks;
372 for (
const auto&
p : mapFinalTracks) {
373 const string& fitName =
p.first;
374 const list<const L1fittedTrack*> fittedTracks =
p.second;
375 PrintL1trk() <<
"Number of tracks after " << fitName <<
" track helix fit = " << fittedTracks.size();
380 for (
Stub* stub : vStubs) {
382 stub->setDigitizeWarningsOn(
false);
386 hists_.
fill(inputData, mSectors, mHtRphis, mMake3Dtrks, mapFinalTracks);
Class for "official" algorithm to be used in TTStubBuilder.
const std::list< TrackerModule > & listTrackerModule() const
const StubAlgorithmOfficial * stubAlgo_
bool enableDigitize() const
const Settings & settings() const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
HTrphi::ErrorMonitor & htRphiErrMon_
std::unique_ptr< DegradeBend > degradeBend_
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
const std::vector< std::string > & useRZfilter() const
StubWindowSuggest & stubWindowSuggest() const
const TrackerTopology * trackerTopology_
void exec(Array2D< std::unique_ptr< HTrphi >> &mHtRphis) const
HTrphi::ErrorMonitor & htRphiErrMon() const
Global3DPoint GlobalPoint
const std::vector< double > & pitchVsType() const
void setFEWindows(const StubFEWindows *sw)
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
std::unique_ptr< StubFEWindows > stubFEWindows_
bool printStubWindows() const
void digitizeTrack(const std::string &fitterName)
virtual void endJobAnalysis(const HTrphi::ErrorMonitor *htRphiErrMon=nullptr)
unsigned int numEtaRegions() const
void setMagneticField(float magneticField) const
const std::list< L1track3D > & trackCands3D(bool rzFiltered) const
std::map< std::string, std::unique_ptr< TrackFitGeneric > > fitterWorkerMap_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
edm::EDGetTokenT< TrackingParticleCollection > tpToken_
edm::ESInputTag trackerGeometryInputTag() const
const std::vector< bool > & psVsType() const
std::vector< bool > tiltedVsType
edm::EDGetTokenT< TTClusterAssMap > clusterTruthToken_
edm::EDGetTokenT< TTStubAssMap > stubTruthToken_
static void globalEndJob(GlobalCacheTMTT *globalCacheTMTT)
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< std::string > trackFitters_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
const std::vector< bool > & barrelVsType() const
#define DEFINE_FWK_MODULE(type)
edm::InputTag tpInputTag() const
void exec(Array2D< std::unique_ptr< HTrphi >> &mHtRphis)
static constexpr auto TOB
std::unique_ptr< TrackFitGeneric > create(const std::string &fitterName, const Settings *settings)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
edm::ESInputTag ttStubAlgoInputTag() const
const TrackerGeometry * trackerGeometry_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
edm::InputTag genJetInputTag() const
void printResults() const
edm::ESGetToken< StubAlgorithm, TTStubAlgorithmRecord > ttStubAlgoToken_
std::vector< bool > psVsType
bool isLower(const DetId &id) const
edm::ESInputTag magneticFieldInputTag() const
bool enableOutputIntermediateTTTracks() const
=== This is the base class for the linearised chi-squared track fit algorithms.
edm::eventsetup::ComponentDescription const * description() const
void run(const std::list< L1track2D > &vecTracksRphi)
Class to store the L1 Track Trigger tracks.
edm::InputTag clusterTruthInputTag() const
void beginRun(const edm::Run &, const edm::EventSetup &) override
virtual const std::list< L1track2D > & trackCands2D() const
edm::InputTag stubTruthInputTag() const
std::list< TrackerModule > listTrackerModule_
std::vector< double > pitchVsType
ParameterSet const & getParameterSet(ParameterSetID const &id)
bool enableMCtruth() const
std::vector< double > spaceVsType
std::list< const L1fittedTrack * > filter(const std::list< L1fittedTrack > &vecTracks) const
unsigned int muxOutputsHT() const
virtual void trackerGeometryAnalysis(const std::list< TrackerModule > &listTrackerModule)
bool isHTRPhiEtaRegWhitelisted(unsigned const iEtaReg) const
StubWindowSuggest & stubWindowSuggest_
const std::vector< std::string > & trackFitters() const
std::vector< bool > barrelVsType
edm::EDGetTokenT< TTStubDetSetVec > stubToken_
const std::vector< double > & spaceVsType() const
unsigned int numPhiSectors() const
virtual void fill(const InputData &inputData, const Array2D< std::unique_ptr< Sector >> &mSectors, const Array2D< std::unique_ptr< HTrphi >> &mHtPhis, const Array2D< std::unique_ptr< Make3Dtracks >> &mGet3Dtrks, const std::map< std::string, std::list< const L1fittedTrack *>> &mapFinalTracks)
static constexpr auto TID
edm::InputTag stubInputTag() const
edm::EDGetTokenT< reco::GenJetCollection > genJetToken_
const std::vector< bool > & tiltedVsType() const
std::vector< std::string > useRZfilter_
edm::ESInputTag trackerTopologyInputTag() const