CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
tmtt::TMTrackProducer Class Reference

#include <TMTrackProducer.h>

Inheritance diagram for tmtt::TMTrackProducer:
edm::stream::EDProducer< edm::GlobalCache< GlobalCacheTMTT > >

Public Member Functions

 TMTrackProducer (const edm::ParameterSet &, GlobalCacheTMTT const *globalCacheTMTT)
 
 ~TMTrackProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< GlobalCacheTMTT > >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void globalEndJob (GlobalCacheTMTT *globalCacheTMTT)
 
static std::unique_ptr< GlobalCacheTMTTinitializeGlobalCache (edm::ParameterSet const &iConfig)
 

Private Types

typedef std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > TTTrackCollection
 

Private Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT< TTClusterAssMapclusterTruthToken_
 
bool debug_
 
std::unique_ptr< DegradeBenddegradeBend_
 
std::map< std::string, std::unique_ptr< TrackFitGeneric > > fitterWorkerMap_
 
edm::EDGetTokenT< reco::GenJetCollectiongenJetToken_
 
Histoshists_
 
HTrphi::ErrorMonitorhtRphiErrMon_
 
std::list< TrackerModulelistTrackerModule_
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmagneticFieldToken_
 
bool runRZfilter_
 
Settings settings_
 
const StubAlgorithmOfficialstubAlgo_
 
std::unique_ptr< StubFEWindowsstubFEWindows_
 
edm::EDGetTokenT< TTStubDetSetVecstubToken_
 
edm::EDGetTokenT< TTStubAssMapstubTruthToken_
 
StubWindowSuggeststubWindowSuggest_
 
edm::EDGetTokenT< TrackingParticleCollectiontpToken_
 
const TrackerGeometrytrackerGeometry_
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtrackerGeometryToken_
 
const TrackerTopologytrackerTopology_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtrackerTopologyToken_
 
std::vector< std::string > trackFitters_
 
edm::ESGetToken< StubAlgorithm, TTStubAlgorithmRecordttStubAlgoToken_
 
std::vector< std::string > useRZfilter_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< GlobalCacheTMTT > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 42 of file TMTrackProducer.h.

Member Typedef Documentation

◆ TTTrackCollection

Definition at line 52 of file TMTrackProducer.h.

Constructor & Destructor Documentation

◆ TMTrackProducer()

tmtt::TMTrackProducer::TMTrackProducer ( const edm::ParameterSet iConfig,
GlobalCacheTMTT const *  globalCacheTMTT 
)
explicit

Definition at line 39 of file TMTrackProducer.cc.

40  : settings_(iConfig), // Set configuration parameters
41  stubWindowSuggest_(globalCacheTMTT->stubWindowSuggest()), // For tuning FE stub window sizes
42  hists_(globalCacheTMTT->hists()), // Initialize histograms
43  htRphiErrMon_(globalCacheTMTT->htRphiErrMon()), // rphi HT error monitoring
44  debug_(true) // Debug printout
45  {
46  using namespace edm;
47 
48  // Get tokens for ES data access.
50  esConsumes<MagneticField, IdealMagneticFieldRecord, Transition::BeginRun>(settings_.magneticFieldInputTag());
51  trackerGeometryToken_ = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, Transition::BeginRun>(
54  esConsumes<TrackerTopology, TrackerTopologyRcd, Transition::BeginRun>(settings_.trackerTopologyInputTag());
56  esConsumes<StubAlgorithm, TTStubAlgorithmRecord, Transition::BeginRun>(settings_.ttStubAlgoInputTag());
57 
58  // Get tokens for ED data access.
59  stubToken_ = consumes<TTStubDetSetVec>(settings_.stubInputTag());
60  if (settings_.enableMCtruth()) {
61  // These lines use lots of CPU, even if no use of truth info is made later.
62  tpToken_ = consumes<TrackingParticleCollection>(settings_.tpInputTag());
63  stubTruthToken_ = consumes<TTStubAssMap>(settings_.stubTruthInputTag());
64  clusterTruthToken_ = consumes<TTClusterAssMap>(settings_.clusterTruthInputTag());
65  genJetToken_ = consumes<reco::GenJetCollection>(settings_.genJetInputTag());
66  }
67 
70  runRZfilter_ = (not useRZfilter_.empty()); // Do any fitters require an r-z track filter to be run?
71 
72  // Book histograms.
73  //hists_.book();
74 
75  // Create track fitting algorithm
76  for (const string& fitterName : trackFitters_) {
77  fitterWorkerMap_[fitterName] = trackFitFactory::create(fitterName, &settings_);
78  }
79 
80  //--- Define EDM output to be written to file (if required)
81 
83  // L1 tracks found by Hough Transform
84  produces<TTTrackCollection>("TML1TracksHT").setBranchAlias("TML1TracksHT");
85  // L1 tracks found by r-z track filter.
86  if (runRZfilter_)
87  produces<TTTrackCollection>("TML1TracksRZ").setBranchAlias("TML1TracksRZ");
88  }
89  // L1 tracks after track fit by each of the fitting algorithms under study
90  for (const string& fitterName : trackFitters_) {
91  string edmName = string("TML1Tracks") + fitterName;
92  produces<TTTrackCollection>(edmName).setBranchAlias(edmName);
93  }
94  }

References tmtt::Settings::clusterTruthInputTag(), clusterTruthToken_, tmtt::trackFitFactory::create(), ZCounting_cff::edmName, tmtt::Settings::enableMCtruth(), tmtt::Settings::enableOutputIntermediateTTTracks(), fitterWorkerMap_, tmtt::Settings::genJetInputTag(), genJetToken_, tmtt::Settings::magneticFieldInputTag(), magneticFieldToken_, runRZfilter_, settings_, AlCaHLTBitMon_QueryRunRegistry::string, tmtt::Settings::stubInputTag(), stubToken_, tmtt::Settings::stubTruthInputTag(), stubTruthToken_, tmtt::Settings::tpInputTag(), tpToken_, tmtt::Settings::trackerGeometryInputTag(), trackerGeometryToken_, tmtt::Settings::trackerTopologyInputTag(), trackerTopologyToken_, tmtt::Settings::trackFitters(), trackFitters_, tmtt::Settings::ttStubAlgoInputTag(), ttStubAlgoToken_, tmtt::Settings::useRZfilter(), and useRZfilter_.

◆ ~TMTrackProducer()

tmtt::TMTrackProducer::~TMTrackProducer ( )
inlineoverride

Definition at line 45 of file TMTrackProducer.h.

45 {}

Member Function Documentation

◆ beginRun()

void tmtt::TMTrackProducer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 98 of file TMTrackProducer.cc.

98  {
99  // Get the B-field and store its value in the Settings class.
100  const MagneticField* theMagneticField = &(iSetup.getData(magneticFieldToken_));
101  float bField = theMagneticField->inTesla(GlobalPoint(0, 0, 0)).z(); // B field in Tesla.
103 
104  // Set also B field in GlobalCacheTMTT (used only for Histogramming)
105  globalCache()->settings().setMagneticField(bField);
106 
107  std::stringstream text;
108  text << "\n--- B field = " << bField << " Tesla ---\n";
109  std::call_once(
110  printOnce, [](string t) { PrintL1trk() << t; }, text.str());
111 
112  // Get tracker geometry
115 
116  // Loop over tracker modules to get module info.
117 
118  // Identifies tracker module type for firmware.
119  TrackerModule::ModuleTypeCfg moduleTypeCfg;
120  moduleTypeCfg.pitchVsType = settings_.pitchVsType();
121  moduleTypeCfg.spaceVsType = settings_.spaceVsType();
122  moduleTypeCfg.barrelVsType = settings_.barrelVsType();
123  moduleTypeCfg.psVsType = settings_.psVsType();
124  moduleTypeCfg.tiltedVsType = settings_.tiltedVsType();
125 
126  listTrackerModule_.clear();
127  for (const GeomDet* gd : trackerGeometry_->dets()) {
128  DetId detId = gd->geographicalId();
129  // Phase 2 Outer Tracker uses TOB for entire barrel & TID for entire endcap.
130  if (detId.subdetId() != StripSubdetector::TOB && detId.subdetId() != StripSubdetector::TID)
131  continue;
132  if (trackerTopology_->isLower(detId)) { // Select only lower of the two sensors in a module.
133  // Store info about this tracker module.
134  listTrackerModule_.emplace_back(trackerGeometry_, trackerTopology_, moduleTypeCfg, detId);
135  }
136  }
137 
138  // Takes one copy of this to GlobalCacheTMTT for later histogramming.
139  globalCache()->setListTrackerModule(listTrackerModule_);
140 
141  // Get TTStubProducerAlgorithm algorithm, to adjust stub bend FE encoding.
142  stubAlgo_ = dynamic_cast<const StubAlgorithmOfficial*>(&iSetup.getData(ttStubAlgoToken_));
143  // Get FE stub window size from TTStub producer configuration
144  const edm::ESHandle<StubAlgorithm> stubAlgoHandle = iSetup.getHandle(ttStubAlgoToken_);
145  const edm::ParameterSet& pSetStubAlgo = getParameterSet(stubAlgoHandle.description()->pid_);
146  stubFEWindows_ = std::make_unique<StubFEWindows>(pSetStubAlgo);
147  // Initialize utilities needing FE window size.
149  degradeBend_ = std::make_unique<DegradeBend>(trackerTopology_, stubFEWindows_.get(), stubAlgo_);
150  }

References tmtt::TrackerModule::ModuleTypeCfg::barrelVsType, tmtt::Settings::barrelVsType(), Calorimetry_cff::bField, degradeBend_, TrackerGeometry::dets(), edm::EventSetup::getData(), edm::EventSetup::getHandle(), edm::getParameterSet(), MagneticField::inTesla(), TrackerTopology::isLower(), listTrackerModule_, magneticFieldToken_, tmtt::TrackerModule::ModuleTypeCfg::pitchVsType, tmtt::Settings::pitchVsType(), tmtt::TrackerModule::ModuleTypeCfg::psVsType, tmtt::Settings::psVsType(), tmtt::StubWindowSuggest::setFEWindows(), tmtt::Settings::setMagneticField(), settings_, tmtt::TrackerModule::ModuleTypeCfg::spaceVsType, tmtt::Settings::spaceVsType(), stubAlgo_, stubFEWindows_, stubWindowSuggest_, DetId::subdetId(), submitPVValidationJobs::t, runonSM::text, StripSubdetector::TID, tmtt::TrackerModule::ModuleTypeCfg::tiltedVsType, tmtt::Settings::tiltedVsType(), StripSubdetector::TOB, trackerGeometry_, trackerGeometryToken_, trackerTopology_, trackerTopologyToken_, ttStubAlgoToken_, and PV3DBase< T, PVType, FrameType >::z().

◆ globalEndJob()

void tmtt::TMTrackProducer::globalEndJob ( GlobalCacheTMTT globalCacheTMTT)
static

Definition at line 403 of file TMTrackProducer.cc.

403  {
404  const Settings& settings = globalCacheTMTT->settings();
405 
406  // Print stub window sizes that TMTT recommends CMS uses in FE chips.
407  if (settings.printStubWindows())
408  globalCacheTMTT->stubWindowSuggest().printResults();
409 
410  // Print (once) info about tracker geometry.
411  globalCacheTMTT->hists().trackerGeometryAnalysis(globalCacheTMTT->listTrackerModule());
412 
413  PrintL1trk() << "\n Number of (eta,phi) sectors used = (" << settings.numEtaRegions() << ","
414  << settings.numPhiSectors() << ")";
415 
416  // Print job summary
417  globalCacheTMTT->hists().endJobAnalysis(&(globalCacheTMTT->htRphiErrMon()));
418  }

References tmtt::Histos::endJobAnalysis(), tmtt::GlobalCacheTMTT::hists(), tmtt::GlobalCacheTMTT::htRphiErrMon(), tmtt::GlobalCacheTMTT::listTrackerModule(), tmtt::Settings::numEtaRegions(), tmtt::Settings::numPhiSectors(), tmtt::StubWindowSuggest::printResults(), tmtt::Settings::printStubWindows(), tmtt::GlobalCacheTMTT::settings(), tmtt::GlobalCacheTMTT::stubWindowSuggest(), and tmtt::Histos::trackerGeometryAnalysis().

◆ initializeGlobalCache()

std::unique_ptr< GlobalCacheTMTT > tmtt::TMTrackProducer::initializeGlobalCache ( edm::ParameterSet const &  iConfig)
static

Definition at line 35 of file TMTrackProducer.cc.

35  {
36  return std::make_unique<GlobalCacheTMTT>(iConfig);
37  }

◆ produce()

void tmtt::TMTrackProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 154 of file TMTrackProducer.cc.

154  {
155  // Note useful info about MC truth particles and about reconstructed stubs .
156  InputData inputData(iEvent,
157  iSetup,
158  &settings_,
160  degradeBend_.get(),
164  tpToken_,
165  stubToken_,
168  genJetToken_);
169 
170  const list<TP>& vTPs = inputData.getTPs();
171  const list<Stub*>& vStubs = inputData.stubs();
172 
173  // Creates matrix of Sector objects, which decide which stubs are in which (eta,phi) sector
174  Array2D<unique_ptr<Sector>> mSectors(settings_.numPhiSectors(), settings_.numEtaRegions());
175  // Create matrix of r-phi Hough-Transform arrays, with one-to-one correspondence to sectors.
176  Array2D<unique_ptr<HTrphi>> mHtRphis(settings_.numPhiSectors(), settings_.numEtaRegions());
177  // Create matrix of Make3Dtracks objects, to run optional r-z track filter, with one-to-one correspondence to sectors.
178  Array2D<unique_ptr<Make3Dtracks>> mMake3Dtrks(settings_.numPhiSectors(), settings_.numEtaRegions());
179  // Create matrix of tracks from each fitter in each sector
180  Array2D<map<string, std::list<L1fittedTrack>>> mapmFitTrks(settings_.numPhiSectors(), settings_.numEtaRegions());
181  // Final tracks after duplicate removal from each track fitter in entire tracker.
182  map<string, list<const L1fittedTrack*>> mapFinalTracks;
183 
184  //=== Initialization
185  // Create utility for converting L1 tracks from our private format to official CMSSW EDM format.
186  const ConverterToTTTrack converter(&settings_);
187 
188  // Pointers to TTTrack collections for ED output.
189  auto htTTTracksForOutput = std::make_unique<TTTrackCollection>();
190  auto rzTTTracksForOutput = std::make_unique<TTTrackCollection>();
191  map<string, unique_ptr<TTTrackCollection>> allFitTTTracksForOutput;
192  for (const string& fitterName : trackFitters_) {
193  auto fitTTTracksForOutput = std::make_unique<TTTrackCollection>();
194  allFitTTTracksForOutput[fitterName] = std::move(fitTTTracksForOutput);
195  }
196 
197  //=== Do tracking in the r-phi Hough transform within each sector.
198 
199  // Fill Hough-Transform arrays with stubs.
200  for (unsigned int iPhiSec = 0; iPhiSec < settings_.numPhiSectors(); iPhiSec++) {
201  for (unsigned int iEtaReg = 0; iEtaReg < settings_.numEtaRegions(); iEtaReg++) {
202  // Initialize constants for this sector.
203  mSectors(iPhiSec, iEtaReg) = std::make_unique<Sector>(&settings_, iPhiSec, iEtaReg);
204  Sector* sector = mSectors(iPhiSec, iEtaReg).get();
205 
206  mHtRphis(iPhiSec, iEtaReg) = std::make_unique<HTrphi>(
207  &settings_, iPhiSec, iEtaReg, sector->etaMin(), sector->etaMax(), sector->phiCentre(), &htRphiErrMon_);
208  HTrphi* htRphi = mHtRphis(iPhiSec, iEtaReg).get();
209 
210  // Check sector is enabled (always true, except if user disabled some for special studies).
211  if (settings_.isHTRPhiEtaRegWhitelisted(iEtaReg)) {
212  for (Stub* stub : vStubs) {
213  // Digitize stub as would be at input to GP. This doesn't need the nonant number, since we assumed an integer number of
214  // phi digitisation bins inside an nonant. N.B. This changes the coordinates & bend stored in the stub.
215 
217  stub->digitize(iPhiSec, Stub::DigiStage::GP);
218 
219  // Check if stub is inside this sector
220  bool inside = sector->inside(stub);
221 
222  if (inside) {
223  // Check which eta subsectors within the sector the stub is compatible with (if subsectors being used).
224  const vector<bool> inEtaSubSecs = sector->insideEtaSubSecs(stub);
225 
226  // Digitize stub if as would be at input to HT, which slightly degrades its coord. & bend resolution, affecting the HT performance.
228  stub->digitize(iPhiSec, Stub::DigiStage::HT);
229 
230  // Store stub in Hough transform array for this sector, indicating its compatibility with eta subsectors with sector.
231  htRphi->store(stub, inEtaSubSecs);
232  }
233  }
234  }
235 
236  // Find tracks in r-phi HT array.
237  htRphi->end(); // Calls htArrayRphi_.end() -> HTBase::end()
238  }
239  }
240 
241  if (settings_.muxOutputsHT() > 0) {
242  // Multiplex outputs of several HT onto one pair of output opto-links.
243  // This only affects tracking performance if option busySectorKill is enabled, so that tracks that
244  // can't be sent down the link within the time-multiplexed period are killed.
245  MuxHToutputs muxHT(&settings_);
246  muxHT.exec(mHtRphis);
247  }
248 
249  // Optionally, run 2nd stage mini HT -- WITHOUT TRUNCATION ???
250  if (settings_.miniHTstage()) {
251  MiniHTstage miniHTstage(&settings_);
252  miniHTstage.exec(mHtRphis);
253  }
254 
255  //=== Make 3D tracks, optionally running r-z track filters (such as Seed Filter) & duplicate track removal.
256 
257  for (unsigned int iPhiSec = 0; iPhiSec < settings_.numPhiSectors(); iPhiSec++) {
258  for (unsigned int iEtaReg = 0; iEtaReg < settings_.numEtaRegions(); iEtaReg++) {
259  const Sector* sector = mSectors(iPhiSec, iEtaReg).get();
260 
261  // Get tracks found by r-phi HT.
262  const HTrphi* htRphi = mHtRphis(iPhiSec, iEtaReg).get();
263  const list<L1track2D>& vecTracksRphi = htRphi->trackCands2D();
264 
265  // Initialize utility for making 3D tracks from 2D ones.
266  mMake3Dtrks(iPhiSec, iEtaReg) = std::make_unique<Make3Dtracks>(
267  &settings_, iPhiSec, iEtaReg, sector->etaMin(), sector->etaMax(), sector->phiCentre());
268  Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get();
269 
270  // Convert 2D tracks found by HT to 3D tracks (optionally by running r-z filters & duplicate track removal)
271  make3Dtrk->run(vecTracksRphi);
272 
274  // Convert these tracks to EDM format for output (used for collaborative work outside TMTT group).
275  // Do this for tracks output by HT & optionally also for those output by r-z track filter.
276  const list<L1track3D>& vecTrk3D_ht = make3Dtrk->trackCands3D(false);
277  for (const L1track3D& trk : vecTrk3D_ht) {
278  TTTrack<Ref_Phase2TrackerDigi_> htTTTrack = converter.makeTTTrack(&trk, iPhiSec, iEtaReg);
279  htTTTracksForOutput->push_back(htTTTrack);
280  }
281 
282  if (runRZfilter_) {
283  const list<L1track3D>& vecTrk3D_rz = make3Dtrk->trackCands3D(true);
284  for (const L1track3D& trk : vecTrk3D_rz) {
285  TTTrack<Ref_Phase2TrackerDigi_> rzTTTrack = converter.makeTTTrack(&trk, iPhiSec, iEtaReg);
286  rzTTTracksForOutput->push_back(rzTTTrack);
287  }
288  }
289  }
290  }
291  }
292 
293  //=== Do a helix fit to all the track candidates.
294 
295  // Loop over all the fitting algorithms we are trying.
296  for (const string& fitterName : trackFitters_) {
297  for (unsigned int iPhiSec = 0; iPhiSec < settings_.numPhiSectors(); iPhiSec++) {
298  for (unsigned int iEtaReg = 0; iEtaReg < settings_.numEtaRegions(); iEtaReg++) {
299  const Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get();
300 
301  // Does this fitter require r-z track filter to be run before it?
302  bool useRZfilt = (std::count(useRZfilter_.begin(), useRZfilter_.end(), fitterName) > 0);
303 
304  // Get 3D track candidates found by Hough transform (plus optional r-z filters/duplicate removal) in this sector.
305  const list<L1track3D>& vecTrk3D = make3Dtrk->trackCands3D(useRZfilt);
306 
307  // Find list where fitted tracks will be stored.
308  list<L1fittedTrack>& fitTrksInSec = mapmFitTrks(iPhiSec, iEtaReg)[fitterName];
309 
310  // Fit all tracks in this sector
311  for (const L1track3D& trk : vecTrk3D) {
312  // Ensure stubs assigned to this track is digitized with respect to the phi sector the track is in.
313  if (settings_.enableDigitize()) {
314  const vector<Stub*>& stubsOnTrk = trk.stubs();
315  for (Stub* s : stubsOnTrk) {
316  // Also digitize stub in way this specific track fitter uses it.
317  s->digitize(iPhiSec, Stub::DigiStage::TF);
318  }
319  }
320 
321  L1fittedTrack fitTrk = fitterWorkerMap_[fitterName]->fit(trk);
322 
323  if (fitTrk.accepted()) { // If fitter accepted track, then store it.
324  // Optionally digitize fitted track, degrading slightly resolution.
326  fitTrk.digitizeTrack(fitterName);
327  // Store fitted tracks, such that there is one fittedTracks corresponding to each HT tracks.
328  fitTrksInSec.push_back(fitTrk);
329  }
330  }
331  }
332  }
333  }
334 
335  // Run duplicate track removal on the fitted tracks if requested.
336 
337  // Initialize the duplicate track removal algorithm that can optionally be run after the track fit.
338  DupFitTrkKiller killDupFitTrks(&settings_);
339 
340  // Loop over all the fitting algorithms we used.
341  for (const string& fitterName : trackFitters_) {
342  for (unsigned int iPhiSec = 0; iPhiSec < settings_.numPhiSectors(); iPhiSec++) {
343  for (unsigned int iEtaReg = 0; iEtaReg < settings_.numEtaRegions(); iEtaReg++) {
344  // Get fitted tracks in sector
345  const list<L1fittedTrack>& fitTrksInSec = mapmFitTrks(iPhiSec, iEtaReg)[fitterName];
346 
347  // Run duplicate removal
348  list<const L1fittedTrack*> filteredFitTrksInSec = killDupFitTrks.filter(fitTrksInSec);
349 
350  // Prepare TTTrack collection.
351  for (const L1fittedTrack* fitTrk : filteredFitTrksInSec) {
352  // Convert these fitted tracks to EDM format for output (used for collaborative work outside TMTT group).
353  TTTrack<Ref_Phase2TrackerDigi_> fitTTTrack = converter.makeTTTrack(fitTrk, iPhiSec, iEtaReg);
354  allFitTTTracksForOutput[fitterName]->push_back(fitTTTrack);
355  }
356 
357  // Store fitted tracks from entire tracker.
358  mapFinalTracks[fitterName].insert(
359  mapFinalTracks[fitterName].end(), filteredFitTrksInSec.begin(), filteredFitTrksInSec.end());
360  }
361  }
362  }
363 
364  // Debug printout
365  if (debug_) {
366  PrintL1trk() << "INPUT #TPs = " << vTPs.size() << " #STUBs = " << vStubs.size();
367  unsigned int numHTtracks = 0;
368  for (unsigned int iPhiSec = 0; iPhiSec < settings_.numPhiSectors(); iPhiSec++) {
369  for (unsigned int iEtaReg = 0; iEtaReg < settings_.numEtaRegions(); iEtaReg++) {
370  const Make3Dtracks* make3Dtrk = mMake3Dtrks(iPhiSec, iEtaReg).get();
371  numHTtracks += make3Dtrk->trackCands3D(false).size();
372  }
373  }
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();
379  }
380  }
381 
382  // Allow histogramming to plot undigitized variables.
383  for (Stub* stub : vStubs) {
385  stub->setDigitizeWarningsOn(false);
386  }
387 
388  // Fill histograms to monitor input data & tracking performance.
389  hists_.fill(inputData, mSectors, mHtRphis, mMake3Dtrks, mapFinalTracks);
390 
391  //=== Store output EDM track and hardware stub collections.
393  iEvent.put(std::move(htTTTracksForOutput), "TML1TracksHT");
394  if (runRZfilter_)
395  iEvent.put(std::move(rzTTTracksForOutput), "TML1TracksRZ");
396  }
397  for (const string& fitterName : trackFitters_) {
398  string edmName = string("TML1Tracks") + fitterName;
399  iEvent.put(std::move(allFitTTTracksForOutput[fitterName]), edmName);
400  }
401  }

References tmtt::L1fittedTrack::accepted(), clusterTruthToken_, submitPVResolutionJobs::count, debug_, degradeBend_, tmtt::L1fittedTrack::digitizeTrack(), ZCounting_cff::edmName, tmtt::Settings::enableDigitize(), tmtt::Settings::enableOutputIntermediateTTTracks(), mps_fire::end, tmtt::Sector::etaMax(), tmtt::Sector::etaMin(), tmtt::MiniHTstage::exec(), tmtt::MuxHToutputs::exec(), tmtt::Histos::fill(), tmtt::DupFitTrkKiller::filter(), fitterWorkerMap_, genJetToken_, tmtt::InputData::getTPs(), tmtt::Stub::GP, hists_, tmtt::Stub::HT, htRphiErrMon_, iEvent, tmtt::Sector::inside(), tmtt::Sector::insideEtaSubSecs(), tmtt::Settings::isHTRPhiEtaRegWhitelisted(), listTrackerModule_, tmtt::Settings::miniHTstage(), eostools::move(), tmtt::Settings::muxOutputsHT(), tmtt::Settings::numEtaRegions(), tmtt::Settings::numPhiSectors(), AlCaHLTBitMon_ParallelJobs::p, tmtt::Sector::phiCentre(), tmtt::Make3Dtracks::run(), runRZfilter_, alignCSCRings::s, settings_, AlCaHLTBitMon_QueryRunRegistry::string, stubToken_, stubTruthToken_, stubWindowSuggest_, tmtt::Stub::TF, tpToken_, tmtt::HTbase::trackCands2D(), tmtt::Make3Dtracks::trackCands3D(), trackerGeometry_, trackerTopology_, trackFitters_, and useRZfilter_.

Member Data Documentation

◆ clusterTruthToken_

edm::EDGetTokenT<TTClusterAssMap> tmtt::TMTrackProducer::clusterTruthToken_
private

Definition at line 68 of file TMTrackProducer.h.

Referenced by produce(), and TMTrackProducer().

◆ debug_

bool tmtt::TMTrackProducer::debug_
private

Definition at line 93 of file TMTrackProducer.h.

Referenced by produce().

◆ degradeBend_

std::unique_ptr<DegradeBend> tmtt::TMTrackProducer::degradeBend_
private

Definition at line 86 of file TMTrackProducer.h.

Referenced by beginRun(), and produce().

◆ fitterWorkerMap_

std::map<std::string, std::unique_ptr<TrackFitGeneric> > tmtt::TMTrackProducer::fitterWorkerMap_
private

Definition at line 91 of file TMTrackProducer.h.

Referenced by produce(), and TMTrackProducer().

◆ genJetToken_

edm::EDGetTokenT<reco::GenJetCollection> tmtt::TMTrackProducer::genJetToken_
private

Definition at line 69 of file TMTrackProducer.h.

Referenced by produce(), and TMTrackProducer().

◆ hists_

Histos& tmtt::TMTrackProducer::hists_
private

Definition at line 88 of file TMTrackProducer.h.

Referenced by produce().

◆ htRphiErrMon_

HTrphi::ErrorMonitor& tmtt::TMTrackProducer::htRphiErrMon_
private

Definition at line 89 of file TMTrackProducer.h.

Referenced by produce().

◆ listTrackerModule_

std::list<TrackerModule> tmtt::TMTrackProducer::listTrackerModule_
private

Definition at line 74 of file TMTrackProducer.h.

Referenced by beginRun(), and produce().

◆ magneticFieldToken_

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> tmtt::TMTrackProducer::magneticFieldToken_
private

Definition at line 60 of file TMTrackProducer.h.

Referenced by beginRun(), and TMTrackProducer().

◆ runRZfilter_

bool tmtt::TMTrackProducer::runRZfilter_
private

Definition at line 80 of file TMTrackProducer.h.

Referenced by produce(), and TMTrackProducer().

◆ settings_

Settings tmtt::TMTrackProducer::settings_
private

Definition at line 77 of file TMTrackProducer.h.

Referenced by beginRun(), produce(), and TMTrackProducer().

◆ stubAlgo_

const StubAlgorithmOfficial* tmtt::TMTrackProducer::stubAlgo_
private

Definition at line 83 of file TMTrackProducer.h.

Referenced by beginRun().

◆ stubFEWindows_

std::unique_ptr<StubFEWindows> tmtt::TMTrackProducer::stubFEWindows_
private

Definition at line 84 of file TMTrackProducer.h.

Referenced by beginRun().

◆ stubToken_

edm::EDGetTokenT<TTStubDetSetVec> tmtt::TMTrackProducer::stubToken_
private

Definition at line 65 of file TMTrackProducer.h.

Referenced by produce(), and TMTrackProducer().

◆ stubTruthToken_

edm::EDGetTokenT<TTStubAssMap> tmtt::TMTrackProducer::stubTruthToken_
private

Definition at line 67 of file TMTrackProducer.h.

Referenced by produce(), and TMTrackProducer().

◆ stubWindowSuggest_

StubWindowSuggest& tmtt::TMTrackProducer::stubWindowSuggest_
private

Definition at line 85 of file TMTrackProducer.h.

Referenced by beginRun(), and produce().

◆ tpToken_

edm::EDGetTokenT<TrackingParticleCollection> tmtt::TMTrackProducer::tpToken_
private

Definition at line 66 of file TMTrackProducer.h.

Referenced by produce(), and TMTrackProducer().

◆ trackerGeometry_

const TrackerGeometry* tmtt::TMTrackProducer::trackerGeometry_
private

Definition at line 72 of file TMTrackProducer.h.

Referenced by beginRun(), and produce().

◆ trackerGeometryToken_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> tmtt::TMTrackProducer::trackerGeometryToken_
private

Definition at line 61 of file TMTrackProducer.h.

Referenced by beginRun(), and TMTrackProducer().

◆ trackerTopology_

const TrackerTopology* tmtt::TMTrackProducer::trackerTopology_
private

Definition at line 73 of file TMTrackProducer.h.

Referenced by beginRun(), and produce().

◆ trackerTopologyToken_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tmtt::TMTrackProducer::trackerTopologyToken_
private

Definition at line 62 of file TMTrackProducer.h.

Referenced by beginRun(), and TMTrackProducer().

◆ trackFitters_

std::vector<std::string> tmtt::TMTrackProducer::trackFitters_
private

Definition at line 78 of file TMTrackProducer.h.

Referenced by produce(), and TMTrackProducer().

◆ ttStubAlgoToken_

edm::ESGetToken<StubAlgorithm, TTStubAlgorithmRecord> tmtt::TMTrackProducer::ttStubAlgoToken_
private

Definition at line 63 of file TMTrackProducer.h.

Referenced by beginRun(), and TMTrackProducer().

◆ useRZfilter_

std::vector<std::string> tmtt::TMTrackProducer::useRZfilter_
private

Definition at line 79 of file TMTrackProducer.h.

Referenced by produce(), and TMTrackProducer().

tmtt::TMTrackProducer::stubWindowSuggest_
StubWindowSuggest & stubWindowSuggest_
Definition: TMTrackProducer.h:85
tmtt::Settings::numEtaRegions
unsigned int numEtaRegions() const
Definition: Settings.h:125
MagneticField::inTesla
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
tmtt::TMTrackProducer::degradeBend_
std::unique_ptr< DegradeBend > degradeBend_
Definition: TMTrackProducer.h:86
GeomDet
Definition: GeomDet.h:27
tmtt::TMTrackProducer::genJetToken_
edm::EDGetTokenT< reco::GenJetCollection > genJetToken_
Definition: TMTrackProducer.h:69
tmtt::TMTrackProducer::stubFEWindows_
std::unique_ptr< StubFEWindows > stubFEWindows_
Definition: TMTrackProducer.h:84
TrackerTopology::isLower
bool isLower(const DetId &id) const
Definition: TrackerTopology.cc:195
converter
Definition: CandidateProducer.h:25
tmtt::Settings::trackFitters
const std::vector< std::string > & trackFitters() const
Definition: Settings.h:248
tmtt::TMTrackProducer::useRZfilter_
std::vector< std::string > useRZfilter_
Definition: TMTrackProducer.h:79
edm
HLT enums.
Definition: AlignableModifier.h:19
tmtt::trackFitFactory::create
std::unique_ptr< TrackFitGeneric > create(const std::string &fitterName, const Settings *settings)
Definition: TrackFitFactory.cc:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
tmtt::TMTrackProducer::htRphiErrMon_
HTrphi::ErrorMonitor & htRphiErrMon_
Definition: TMTrackProducer.h:89
tmtt::TMTrackProducer::fitterWorkerMap_
std::map< std::string, std::unique_ptr< TrackFitGeneric > > fitterWorkerMap_
Definition: TMTrackProducer.h:91
tmtt::TMTrackProducer::tpToken_
edm::EDGetTokenT< TrackingParticleCollection > tpToken_
Definition: TMTrackProducer.h:66
tmtt::Settings::enableDigitize
bool enableDigitize() const
Definition: Settings.h:80
TTTrack
Class to store the L1 Track Trigger tracks.
Definition: TTTrack.h:29
tmtt::Settings::trackerTopologyInputTag
edm::ESInputTag trackerTopologyInputTag() const
Definition: Settings.h:28
tmtt::TMTrackProducer::trackerGeometryToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
Definition: TMTrackProducer.h:61
TMTrackProducer_Defaults_cfi.MiniHTstage
MiniHTstage
Definition: TMTrackProducer_Defaults_cfi.py:152
tmtt::Settings::miniHTstage
bool miniHTstage() const
Definition: Settings.h:149
tmtt::Settings::trackerGeometryInputTag
edm::ESInputTag trackerGeometryInputTag() const
Definition: Settings.h:27
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
tmtt::TMTrackProducer::trackerTopology_
const TrackerTopology * trackerTopology_
Definition: TMTrackProducer.h:73
tmtt::Settings::genJetInputTag
edm::InputTag genJetInputTag() const
Definition: Settings.h:35
DetId
Definition: DetId.h:17
tmtt::Histos::fill
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)
Definition: Histos.cc:83
alignCSCRings.s
s
Definition: alignCSCRings.py:92
tmtt::TMTrackProducer::runRZfilter_
bool runRZfilter_
Definition: TMTrackProducer.h:80
tmtt::TMTrackProducer::trackFitters_
std::vector< std::string > trackFitters_
Definition: TMTrackProducer.h:78
tmtt::Settings::useRZfilter
const std::vector< std::string > & useRZfilter() const
Definition: Settings.h:251
tmtt::TMTrackProducer::settings_
Settings settings_
Definition: TMTrackProducer.h:77
tmtt::TMTrackProducer::trackerGeometry_
const TrackerGeometry * trackerGeometry_
Definition: TMTrackProducer.h:72
mps_fire.end
end
Definition: mps_fire.py:242
edm::ESHandle
Definition: DTSurvey.h:22
tmtt::Stub::DigiStage::TF
tmtt::TMTrackProducer::clusterTruthToken_
edm::EDGetTokenT< TTClusterAssMap > clusterTruthToken_
Definition: TMTrackProducer.h:68
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
tmtt::TMTrackProducer::stubTruthToken_
edm::EDGetTokenT< TTStubAssMap > stubTruthToken_
Definition: TMTrackProducer.h:67
tmtt::Settings::psVsType
const std::vector< bool > & psVsType() const
Definition: Settings.h:98
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
tmtt::TMTrackProducer::hists_
Histos & hists_
Definition: TMTrackProducer.h:88
edm::ParameterSet
Definition: ParameterSet.h:47
tmtt::Settings::enableMCtruth
bool enableMCtruth() const
Definition: Settings.h:40
tmtt::TMTrackProducer::trackerTopologyToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
Definition: TMTrackProducer.h:62
iEvent
int iEvent
Definition: GenABIO.cc:224
ZCounting_cff.edmName
edmName
Definition: ZCounting_cff.py:8
tmtt::Settings::stubTruthInputTag
edm::InputTag stubTruthInputTag() const
Definition: Settings.h:33
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
tmtt::Settings::barrelVsType
const std::vector< bool > & barrelVsType() const
Definition: Settings.h:97
tmtt::Settings::numPhiSectors
unsigned int numPhiSectors() const
Definition: Settings.h:110
TrackerGeometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: TrackerGeometry.h:62
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
tmtt::TMTrackProducer::magneticFieldToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
Definition: TMTrackProducer.h:60
tmtt::StubWindowSuggest::setFEWindows
void setFEWindows(const StubFEWindows *sw)
Definition: StubWindowSuggest.cc:18
tmtt::Stub::DigiStage::HT
edm::getParameterSet
ParameterSet const & getParameterSet(ParameterSetID const &id)
Definition: ParameterSet.cc:862
eostools.move
def move(src, dest)
Definition: eostools.py:511
Calorimetry_cff.bField
bField
Definition: Calorimetry_cff.py:284
tmtt::TMTrackProducer::ttStubAlgoToken_
edm::ESGetToken< StubAlgorithm, TTStubAlgorithmRecord > ttStubAlgoToken_
Definition: TMTrackProducer.h:63
tmtt::Settings::spaceVsType
const std::vector< double > & spaceVsType() const
Definition: Settings.h:96
tmtt::Settings::magneticFieldInputTag
edm::ESInputTag magneticFieldInputTag() const
Definition: Settings.h:26
tmtt::TMTrackProducer::debug_
bool debug_
Definition: TMTrackProducer.h:93
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
tmtt::Settings::muxOutputsHT
unsigned int muxOutputsHT() const
Definition: Settings.h:189
tmtt::TMTrackProducer::stubAlgo_
const StubAlgorithmOfficial * stubAlgo_
Definition: TMTrackProducer.h:83
tmtt::Settings::tpInputTag
edm::InputTag tpInputTag() const
Definition: Settings.h:32
runonSM.text
text
Definition: runonSM.py:43
tmtt::Settings::stubInputTag
edm::InputTag stubInputTag() const
Definition: Settings.h:31
tmtt::TMTrackProducer::listTrackerModule_
std::list< TrackerModule > listTrackerModule_
Definition: TMTrackProducer.h:74
tmtt::Settings::ttStubAlgoInputTag
edm::ESInputTag ttStubAlgoInputTag() const
Definition: Settings.h:29
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
MagneticField
Definition: MagneticField.h:19
tmtt::Settings::setMagneticField
void setMagneticField(float magneticField) const
Definition: Settings.h:400
tmtt::Settings::enableOutputIntermediateTTTracks
bool enableOutputIntermediateTTTracks() const
Definition: Settings.h:44
tmtt::Settings::tiltedVsType
const std::vector< bool > & tiltedVsType() const
Definition: Settings.h:99
tmtt::Settings::pitchVsType
const std::vector< double > & pitchVsType() const
Definition: Settings.h:95
tmtt::TMTrackProducer::stubToken_
edm::EDGetTokenT< TTStubDetSetVec > stubToken_
Definition: TMTrackProducer.h:65
tmtt::Stub::DigiStage::GP
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
tmtt::Settings::clusterTruthInputTag
edm::InputTag clusterTruthInputTag() const
Definition: Settings.h:34
tmtt::Settings::isHTRPhiEtaRegWhitelisted
bool isHTRPhiEtaRegWhitelisted(unsigned const iEtaReg) const
Definition: Settings.cc:465