CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
EventCapture Class Reference

#include <EventCapture.h>

Inheritance diagram for EventCapture:
IOMTFEmulationObserver

Public Member Functions

void beginRun (edm::EventSetup const &eventSetup) override
 
void endJob () override
 
 EventCapture (const edm::ParameterSet &edmCfg, const OMTFConfiguration *omtfConfig, CandidateSimMuonMatcher *candidateSimMuonMatcher, const MuonGeometryTokens &muonGeometryTokens, const GoldenPatternVec< GoldenPattern > *gps=nullptr)
 
void observeEventBegin (const edm::Event &event) override
 
void observeEventEnd (const edm::Event &event, std::unique_ptr< l1t::RegionalMuonCandBxCollection > &finalCandidates) override
 
void observeProcesorEmulation (unsigned int iProcessor, l1t::tftype mtfType, const std::shared_ptr< OMTFinput > &, const AlgoMuons &algoCandidates, const AlgoMuons &gbCandidates, const std::vector< l1t::RegionalMuonCand > &candMuons) override
 
 ~EventCapture () override
 
- Public Member Functions inherited from IOMTFEmulationObserver
virtual void addProcesorData (std::string key, boost::property_tree::ptree &procDataTree)
 
 IOMTFEmulationObserver ()
 
virtual void observeProcesorBegin (unsigned int iProcessor, l1t::tftype mtfType)
 
virtual ~IOMTFEmulationObserver ()
 

Private Attributes

std::vector< AlgoMuonsalgoMuonsInProcs
 
CandidateSimMuonMatchercandidateSimMuonMatcher = nullptr
 
std::vector< AlgoMuonsgbCandidatesInProcs
 
const GoldenPatternVec< GoldenPattern > * goldenPatterns = nullptr
 
std::vector< std::shared_ptr< OMTFinput > > inputInProcs
 
const OMTFConfigurationomtfConfig = nullptr
 
std::vector< edm::Ptr< SimTrack > > simMuons
 
edm::InputTag simTracksTag
 
std::unique_ptr< StubsSimHitsMatcherstubsSimHitsMatcher
 

Detailed Description

Definition at line 20 of file EventCapture.h.

Constructor & Destructor Documentation

◆ EventCapture()

EventCapture::EventCapture ( const edm::ParameterSet edmCfg,
const OMTFConfiguration omtfConfig,
CandidateSimMuonMatcher candidateSimMuonMatcher,
const MuonGeometryTokens muonGeometryTokens,
const GoldenPatternVec< GoldenPattern > *  gps = nullptr 
)

Definition at line 22 of file EventCapture.cc.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), omtfConfig, simTracksTag, and stubsSimHitsMatcher.

28  goldenPatterns(gps),
33  if (edmCfg.exists("simTracksTag"))
34  simTracksTag = edmCfg.getParameter<edm::InputTag>("simTracksTag");
35  else
36  edm::LogImportant("OMTFReconstruction")
37  << "EventCapture::EventCapture: no InputTag simTracksTag found" << std::endl;
38 
39  //stubsSimHitsMatcher works only with the trackingParticle, because only them are stored in the pilup events
40  if (this->candidateSimMuonMatcher && edmCfg.exists("trackingParticleTag"))
41  stubsSimHitsMatcher = std::make_unique<StubsSimHitsMatcher>(edmCfg, omtfConfig, muonGeometryTokens);
42 }
CandidateSimMuonMatcher * candidateSimMuonMatcher
Definition: EventCapture.h:52
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::vector< AlgoMuons > gbCandidatesInProcs
Definition: EventCapture.h:58
bool exists(std::string const &parameterName) const
checks if a parameter exists
const OMTFConfiguration * omtfConfig
Definition: EventCapture.h:48
std::unique_ptr< StubsSimHitsMatcher > stubsSimHitsMatcher
Definition: EventCapture.h:60
edm::InputTag simTracksTag
Definition: EventCapture.h:47
Log< level::Error, true > LogImportant
const GoldenPatternVec< GoldenPattern > * goldenPatterns
Definition: EventCapture.h:50
unsigned int processorCnt() const
std::vector< std::shared_ptr< OMTFinput > > inputInProcs
Definition: EventCapture.h:56
std::vector< AlgoMuons > algoMuonsInProcs
Definition: EventCapture.h:57

◆ ~EventCapture()

EventCapture::~EventCapture ( )
override

Definition at line 44 of file EventCapture.cc.

44  {
45  // TODO Auto-generated destructor stub
46 }

Member Function Documentation

◆ beginRun()

void EventCapture::beginRun ( edm::EventSetup const &  eventSetup)
overridevirtual

Reimplemented from IOMTFEmulationObserver.

Definition at line 48 of file EventCapture.cc.

References options_cfi::eventSetup, and stubsSimHitsMatcher.

48  {
51 }
std::unique_ptr< StubsSimHitsMatcher > stubsSimHitsMatcher
Definition: EventCapture.h:60

◆ endJob()

void EventCapture::endJob ( void  )
overridevirtual

Implements IOMTFEmulationObserver.

Definition at line 413 of file EventCapture.cc.

References stubsSimHitsMatcher.

413  {
415  stubsSimHitsMatcher->endJob();
416 }
std::unique_ptr< StubsSimHitsMatcher > stubsSimHitsMatcher
Definition: EventCapture.h:60

◆ observeEventBegin()

void EventCapture::observeEventBegin ( const edm::Event event)
overridevirtual

Reimplemented from IOMTFEmulationObserver.

Definition at line 53 of file EventCapture.cc.

References funct::abs(), algoMuonsInProcs, gbCandidatesInProcs, input, inputInProcs, edm::InputTag::label(), edm::Handle< T >::product(), simMuons, and simTracksTag.

53  {
54  simMuons.clear();
55 
56  if (!simTracksTag.label().empty()) {
58  event.getByLabel(simTracksTag, simTraksHandle);
59 
60  for (unsigned int iSimTrack = 0; iSimTrack != simTraksHandle->size(); iSimTrack++) {
61  if (std::abs((*simTraksHandle.product())[iSimTrack].type()) == 13)
62  simMuons.emplace_back(simTraksHandle, iSimTrack);
63  }
64  }
65 
66  for (auto& input : inputInProcs)
67  input.reset();
68 
69  for (auto& algoMuonsInProc : algoMuonsInProcs)
70  algoMuonsInProc.clear();
71 
72  for (auto& gbCandidatesInProc : gbCandidatesInProcs)
73  gbCandidatesInProc.clear();
74 }
std::vector< AlgoMuons > gbCandidatesInProcs
Definition: EventCapture.h:58
T const * product() const
Definition: Handle.h:70
std::string const & label() const
Definition: InputTag.h:36
static std::string const input
Definition: EdmProvDump.cc:50
edm::InputTag simTracksTag
Definition: EventCapture.h:47
std::vector< edm::Ptr< SimTrack > > simMuons
Definition: EventCapture.h:54
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< std::shared_ptr< OMTFinput > > inputInProcs
Definition: EventCapture.h:56
std::vector< AlgoMuons > algoMuonsInProcs
Definition: EventCapture.h:57

◆ observeEventEnd()

void EventCapture::observeEventEnd ( const edm::Event event,
std::unique_ptr< l1t::RegionalMuonCandBxCollection > &  finalCandidates 
)
overridevirtual

!!!!!!!!!!!!!!!!!!!!!!! TODO dumps all events!!!!!!!!!!!!!!!!!!!!!!!!!!!!

printing

Reimplemented from IOMTFEmulationObserver.

Definition at line 90 of file EventCapture.cc.

References funct::abs(), algoMuonsInProcs, nano_mu_digi_cff::bx, candidateSimMuonMatcher, GCP_Ntuples_cfg::dump, gbCandidatesInProcs, CandidateSimMuonMatcher::getMatchingResults(), OMTFinputMaker::getProcessorPhiZero(), goldenPatterns, runTauDisplay::gp, OMTFConfiguration::hwPtToGev(), iEvent, inputInProcs, createfilelist::int, edm::InputTag::label(), nano_mu_digi_cff::layer, LogTrace, M_PI, OmtfName::name(), OMTFConfiguration::nProcessors(), l1t::omtf_neg, l1t::omtf_pos, omtfConfig, simMuonQualityAdjusterDigis_cfi::omtfInput, OMTFConfiguration::procHwPhiToGlobalPhi(), simMuons, simTracksTag, and stubsSimHitsMatcher.

91  {
92  std::ostringstream ostr;
93  //filtering
94 
95  bool dump = false;
96 
98  std::vector<MatchingResult> matchingResults = candidateSimMuonMatcher->getMatchingResults();
99  LogTrace("l1tOmtfEventPrint") << "matchingResults.size() " << matchingResults.size() << std::endl;
100 
101  //candidateSimMuonMatcher should use the trackingParticles, because the simTracks are not stored for the pile-up events
102  for (auto& matchingResult : matchingResults) {
103  //TODO choose a condition, to print the desired candidates
104  if (matchingResult.muonCand) {
105  dump = true;
106 
107  bool runStubsSimHitsMatcher = false;
108  if (matchingResult.trackingParticle) {
109  auto trackingParticle = matchingResult.trackingParticle;
110  ostr << "trackingParticle: eventId " << trackingParticle->eventId().event() << " pdgId " << std::setw(3)
111  << trackingParticle->pdgId() << " trackId " << trackingParticle->g4Tracks().at(0).trackId() << " pt "
112  << std::setw(9) << trackingParticle->pt() //<<" Beta "<<simMuon->momentum().Beta()
113  << " eta " << std::setw(9) << trackingParticle->momentum().eta() << " phi " << std::setw(9)
114  << trackingParticle->momentum().phi() << std::endl;
115  } else if (matchingResult.simTrack) {
116  runStubsSimHitsMatcher = true;
117  ostr << "SimMuon: eventId " << matchingResult.simTrack->eventId().event() << " pdgId " << std::setw(3)
118  << matchingResult.simTrack->type() << " pt " << std::setw(9)
119  << matchingResult.simTrack->momentum().pt() //<<" Beta "<<simMuon->momentum().Beta()
120  << " eta " << std::setw(9) << matchingResult.simTrack->momentum().eta() << " phi " << std::setw(9)
121  << matchingResult.simTrack->momentum().phi() << std::endl;
122  } else {
123  ostr << "no simMuon ";
124  runStubsSimHitsMatcher = true;
125  }
126  ostr << "matched to: " << std::endl;
127  auto finalCandidate = matchingResult.muonCand;
128  ostr << " hwPt " << finalCandidate->hwPt() << " hwUPt " << finalCandidate->hwPtUnconstrained() << " hwSign "
129  << finalCandidate->hwSign() << " hwQual " << finalCandidate->hwQual() << " hwEta " << std::setw(4)
130  << finalCandidate->hwEta() << std::setw(4) << " hwPhi " << finalCandidate->hwPhi() << " eta "
131  << std::setw(9) << (finalCandidate->hwEta() * 0.010875) << " phi " << std::endl;
132 
133  if (stubsSimHitsMatcher && runStubsSimHitsMatcher)
134  stubsSimHitsMatcher->match(iEvent, matchingResult.muonCand, matchingResult.procMuon, ostr);
135  }
136  }
137  } else if (!simTracksTag.label().empty()) {
138  dump = false;
139  bool wasSimMuInOmtfPos = false;
140  bool wasSimMuInOmtfNeg = false;
141  for (auto& simMuon : simMuons) {
142  //TODO choose a condition, to print the desired events
143  if (simMuon->eventId().event() == 0 && std::abs(simMuon->momentum().eta()) > 0.82 &&
144  std::abs(simMuon->momentum().eta()) < 1.24 && simMuon->momentum().pt() >= 3.) {
145  ostr << "SimMuon: eventId " << simMuon->eventId().event() << " pdgId " << std::setw(3) << simMuon->type()
146  << " pt " << std::setw(9) << simMuon->momentum().pt() //<<" Beta "<<simMuon->momentum().Beta()
147  << " eta " << std::setw(9) << simMuon->momentum().eta() << " phi " << std::setw(9)
148  << simMuon->momentum().phi() << std::endl;
149 
150  if (simMuon->momentum().eta() > 0)
151  wasSimMuInOmtfPos = true;
152  else
153  wasSimMuInOmtfNeg = true;
154  }
155  }
156 
157  bool wasCandInNeg = false;
158  bool wasCandInPos = false;
159 
160  for (auto& finalCandidate : *finalCandidates) {
161  //TODO choose a condition, to print the desired candidates
162  if (finalCandidate.trackFinderType() == l1t::tftype::omtf_neg && finalCandidate.hwQual() >= 12 &&
163  finalCandidate.hwPt() > 20)
164  wasCandInNeg = true;
165 
166  if (finalCandidate.trackFinderType() == l1t::tftype::omtf_pos && finalCandidate.hwQual() >= 12 &&
167  finalCandidate.hwPt() > 20)
168  wasCandInPos = true;
169  }
170 
171  if ((wasSimMuInOmtfNeg && wasCandInNeg)) //TODO
172  dump = true;
173 
174  if ((wasSimMuInOmtfPos && wasCandInPos)) //TODO
175  dump = true;
176  } else {
177  //TODO choose a condition, to print the desired candidates
178  // an example of a simple cut, only on the canidate pt
179  /*
180  for (auto& finalCandidate : *finalCandidates) {
181  if (finalCandidate.hwPt() < 41) { // finalCandidate.hwQual() >= 1 41
182  dump = true;
183  }
184  } */
186  dump = true; //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
187  }
188 
189  if (!dump)
190  return;
191 
193 
194  edm::LogVerbatim("l1tOmtfEventPrint") << "##################### EventCapture::observeEventEnd - dump of event "
195  << iEvent.id() << " #####################################################"
196  << std::endl;
197 
198  edm::LogVerbatim("l1tOmtfEventPrint") << ostr.str() << endl; //printing sim muons
199 
200  edm::LogVerbatim("l1tOmtfEventPrint") << "finalCandidates " << std::endl;
201  for (int bx = finalCandidates->getFirstBX(); bx <= finalCandidates->getLastBX(); bx++) {
202  for (auto finalCandidateIt = finalCandidates->begin(bx); finalCandidateIt != finalCandidates->end(bx);
203  finalCandidateIt++) {
204  auto& finalCandidate = *finalCandidateIt;
205  int globHwPhi = (finalCandidate.processor()) * 96 + finalCandidate.hwPhi();
206  // first processor starts at CMS phi = 15 degrees (24 in int)... Handle wrap-around with %. Add 576 to make sure the number is positive
207  globHwPhi = (globHwPhi + 600) % 576;
208 
209  double globalPhi = globHwPhi * 2. * M_PI / 576;
210  if (globalPhi > M_PI)
211  globalPhi = globalPhi - (2. * M_PI);
212 
213  int layerHits = (int)finalCandidate.trackAddress().at(0);
214  std::bitset<18> layerHitBits(layerHits);
215 
216  edm::LogVerbatim("l1tOmtfEventPrint")
217  << " bx " << bx << " hwPt " << finalCandidate.hwPt() << " hwUPt " << finalCandidate.hwPtUnconstrained()
218  << " hwSign " << finalCandidate.hwSign() << " hwQual " << finalCandidate.hwQual() << " hwEta " << std::setw(4)
219  << finalCandidate.hwEta() << std::setw(4) << " hwPhi " << finalCandidate.hwPhi() << " eta " << std::setw(9)
220  << (finalCandidate.hwEta() * 0.010875) << " phi " << std::setw(9) << globalPhi << " " << layerHitBits
221  << " processor " << OmtfName(finalCandidate.processor(), finalCandidate.trackFinderType(), omtfConfig)
222  << std::endl;
223 
224  for (auto& trackAddr : finalCandidate.trackAddress()) {
225  if (trackAddr.first >= 10)
226  edm::LogVerbatim("l1tOmtfEventPrint")
227  << "trackAddr first " << trackAddr.first << " second " << trackAddr.second << " ptGeV "
228  << omtfConfig->hwPtToGev(trackAddr.second);
229  }
230  }
231  }
232  edm::LogVerbatim("l1tOmtfEventPrint") << std::endl;
233 
234  for (unsigned int iProc = 0; iProc < inputInProcs.size(); iProc++) {
235  OmtfName board(iProc, omtfConfig);
236 
237  std::ostringstream ostrInput;
238  if (inputInProcs[iProc]) {
239  auto& omtfInput = *inputInProcs[iProc];
240  int layersWithStubs = 0;
241  for (auto& layer : omtfInput.getMuonStubs()) {
242  for (auto& stub : layer) {
243  bool layerFired = false;
244  if (stub && (stub->type != MuonStub::Type::EMPTY)) {
245  layerFired = true;
246 
247  auto globalPhiRad = omtfConfig->procHwPhiToGlobalPhi(
249  ostrInput << (*stub) << " globalPhiRad " << globalPhiRad << std::endl;
250  }
251  if (layerFired)
252  layersWithStubs++;
253  }
254  }
255 
256  if (layersWithStubs != 0) {
257  edm::LogVerbatim("l1tOmtfEventPrint") << "\niProcessor " << iProc << " " << board.name()
258  << " **************************************************" << std::endl;
259  edm::LogVerbatim("l1tOmtfEventPrint") << ostrInput.str() << std::endl;
260  }
261 
262  if (layersWithStubs < 2)
263  continue;
264 
265  edm::LogVerbatim("l1tOmtfEventPrint") << *inputInProcs[iProc] << std::endl;
266 
267  edm::LogVerbatim("l1tOmtfEventPrint") << "algoMuons " << std::endl;
268  //unsigned int procIndx = omtfConfig->getProcIndx(iProcessor, mtfType);
269  for (auto& algoMuon : algoMuonsInProcs[iProc]) {
270  if (algoMuon->isValid()) {
271  edm::LogVerbatim("l1tOmtfEventPrint")
272  << board.name() << " " << *algoMuon << " RefHitNum " << algoMuon->getRefHitNumber() << std::endl;
273  edm::LogVerbatim("l1tOmtfEventPrint") << algoMuon->getGpResultConstr();
274  if (algoMuon->getGpResultUnconstr().isValid())
275  edm::LogVerbatim("l1tOmtfEventPrint")
276  << "GpResultUnconstr " << algoMuon->getGoldenPaternUnconstr()->key() << "\n"
277  << algoMuon->getGpResultUnconstr() << std::endl;
278 
279  if (goldenPatterns) //watch out with the golden patterns
280  for (auto& gp : *goldenPatterns) {
281  if (gp->key().thePt == 0)
282  continue;
283 
284  //printing GoldenPatternResult, uncomment if needed
285  /*auto& gpResult = gp->getResults()[iProc][algoMuon->getRefHitNumber()];
286  edm::LogVerbatim("l1tOmtfEventPrint") << " "<<gp->key() << " "
287  //<< " refLayer: " << gpResult.getRefLayer() << "\t"
288  << " Sum over layers: " << gpResult.getPdfSum() << "\t"
289  << " Number of hits: " << gpResult.getFiredLayerCnt() << "\t"
290  << std::endl;*/
291  }
292  edm::LogVerbatim("l1tOmtfEventPrint") << std::endl << std::endl;
293  }
294  }
295 
296  edm::LogVerbatim("l1tOmtfEventPrint") << "gbCandidates " << std::endl;
297  for (auto& gbCandidate : gbCandidatesInProcs[iProc])
298  if (gbCandidate->isValid())
299  edm::LogVerbatim("l1tOmtfEventPrint") << board.name() << " " << *gbCandidate << std::endl;
300 
301  {
302  edm::LogVerbatim("l1tOmtfEventPrint") << std::endl << std::endl << "\ngb_test " << board.name() << std::endl;
303  for (auto& algoMuon : algoMuonsInProcs[iProc]) {
304  edm::LogVerbatim("l1tOmtfEventPrint")
305  << " (" << std::setw(5) << algoMuon->getHwPatternNumConstr() << "," << std::setw(5)
306  << algoMuon->getHwPatternNumUnconstr() << ","
307 
308  << std::setw(5) << algoMuon->getGpResultConstr().getFiredLayerCnt() << "," << std::setw(5)
309  << algoMuon->getGpResultUnconstr().getFiredLayerCnt()
310  << ","
311 
312  //in the FW there is LSB added for some reason, therefore we multiply by 2 here
313  << std::setw(6) << algoMuon->getGpResultConstr().getFiredLayerBits() * 2 << "," << std::setw(6)
314  << algoMuon->getGpResultUnconstr().getFiredLayerBits() * 2 << ","
315 
316  << std::setw(5) << algoMuon->getGpResultConstr().getPdfSum() << "," << std::setw(5)
317  << algoMuon->getGpResultUnconstr().getPdfSumUnconstr() << ","
318 
319  << std::setw(5) << algoMuon->getGpResultConstr().getPhi() << "," << std::setw(5)
320  << algoMuon->getGpResultUnconstr().getPhi()
321  << ","
322 
323  //<<std::setw(5)<<OMTFConfiguration::eta2Bits(std::abs(algoMuon->getEtaHw()))<<", "
324  << std::setw(5) << algoMuon->getEtaHw()
325  << ", "
326 
327  //<<std::setw(5)<<omtfConfig->getRefToLogicNumber()[algoMuon->getRefLayer()]<<""
328  << std::setw(5) << algoMuon->getRefLayer() << ""
329 
330  << "), " << std::endl;
331  }
332  edm::LogVerbatim("l1tOmtfEventPrint") << "\ngbCandidates" << std::endl;
333  for (auto& gbCandidate : gbCandidatesInProcs[iProc])
334  edm::LogVerbatim("l1tOmtfEventPrint")
335  << " (" << std::setw(5) << gbCandidate->getPtConstr() << "," << std::setw(5)
336  << gbCandidate->getPtUnconstr() << ","
337 
338  << std::setw(5) << gbCandidate->getGpResultConstr().getFiredLayerCnt() << "," << std::setw(5)
339  << gbCandidate->getGpResultUnconstr().getFiredLayerCnt()
340  << ","
341 
342  //in the FW there is LSB added for some reason, therefore we multiply by 2 here
343  << std::setw(6) << gbCandidate->getGpResultConstr().getFiredLayerBits() * 2 << "," << std::setw(6)
344  << gbCandidate->getGpResultUnconstr().getFiredLayerBits() * 2 << ","
345 
346  << std::setw(5) << gbCandidate->getGpResultConstr().getPdfSum() << "," << std::setw(5)
347  << gbCandidate->getGpResultUnconstr().getPdfSumUnconstr() << ","
348 
349  << std::setw(5) << gbCandidate->getGpResultConstr().getPhi() << "," << std::setw(5)
350  << gbCandidate->getGpResultUnconstr().getPhi()
351  << ","
352 
353  //<<std::setw(5)<<OMTFConfiguration::eta2Bits(std::abs(gbCandidate->getEtaHw()))<<", "
354  << std::setw(5) << gbCandidate->getEtaHw()
355  << ", "
356 
357  //<<std::setw(5)<<omtfConfig->getRefToLogicNumber()[gbCandidate->getRefLayer()]<<""
358  << std::setw(5) << gbCandidate->getRefLayer() << ""
359 
360  << "), "
361  << " -- getFiredLayerBits " << std::setw(5) << gbCandidate->getGpResultConstr().getFiredLayerBits()
362  << std::endl;
363 
364  edm::LogVerbatim("l1tOmtfEventPrint") << "finalCandidates " << std::endl;
365 
366  std::ostringstream ostr;
367  if (finalCandidates->size(0) > 0) {
368  int iMu = 1;
369  for (auto finalCandidateIt = finalCandidates->begin(0); finalCandidateIt != finalCandidates->end(0);
370  finalCandidateIt++) {
371  auto& finalCandidate = *finalCandidateIt;
372 
373  auto omtfName = OmtfName(finalCandidate.processor(), finalCandidate.trackFinderType(), omtfConfig);
374 
375  if (omtfName == board.name()) {
376  int layerHits = (int)finalCandidate.trackAddress().at(0);
377  std::bitset<18> layerHitBits(layerHits);
378 
379  unsigned int trackAddr = finalCandidate.trackAddress().at(0);
380  unsigned int uPt = finalCandidate.hwPtUnconstrained();
381  //if(uPt == 0) uPt = 5; //TODO remove when fixed in the FW
382  trackAddr = (uPt << 18) + trackAddr;
383 
384  ostr << "M" << iMu << ":" << std::setw(4) << finalCandidate.hwPt() << "," << std::setw(4)
385  << finalCandidate.hwQual() << "," << std::setw(4) << finalCandidate.hwPhi() << "," << std::setw(4)
386  << std::abs(finalCandidate.hwEta())
387  << ","
388  //<<std::setw(10)<< finalCandidate.trackAddress().at(0)<<""
389  << std::setw(10) << trackAddr << "," << std::setw(4) << 0 << "," //Halo
390  << std::setw(4) << finalCandidate.hwSign() << "," << std::setw(4) << 1 << "; "; //ChValid
391  //<< " -- uPt " << std::setw(10) << uPt << " firedLayers " << finalCandidate.trackAddress().at(0);
392 
393  //<<std::setw(5)<< finalCandidate.hwPtUnconstrained()<<","
394 
395  //<<std::setw(9)<< layerHitBits<<","
396  //<<std::setw(6)<< layerHits<<","
397  iMu++;
398  }
399  }
400  for (; iMu <= 3; iMu++)
401  ostr << "M" << iMu << ": 0, 0, 0, 0, 0, 0, 0, 0; ";
402  edm::LogVerbatim("l1tOmtfEventPrint") << ostr.str() << std::endl;
403  }
404  }
405 
406  edm::LogVerbatim("l1tOmtfEventPrint") << std::endl;
407  }
408  }
409 
410  edm::LogVerbatim("l1tOmtfEventPrint") << std::endl;
411 }
Log< level::Info, true > LogVerbatim
CandidateSimMuonMatcher * candidateSimMuonMatcher
Definition: EventCapture.h:52
std::vector< AlgoMuons > gbCandidatesInProcs
Definition: EventCapture.h:58
const OMTFConfiguration * omtfConfig
Definition: EventCapture.h:48
double procHwPhiToGlobalPhi(int procHwPhi, int procHwPhi0) const
std::string const & label() const
Definition: InputTag.h:36
#define LogTrace(id)
std::unique_ptr< StubsSimHitsMatcher > stubsSimHitsMatcher
Definition: EventCapture.h:60
edm::InputTag simTracksTag
Definition: EventCapture.h:47
int iEvent
Definition: GenABIO.cc:224
std::vector< edm::Ptr< SimTrack > > simMuons
Definition: EventCapture.h:54
static int getProcessorPhiZero(const OMTFConfiguration *config, unsigned int iProcessor)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double hwPtToGev(int hwPt) const override
uGMT pt scale conversion
const GoldenPatternVec< GoldenPattern > * goldenPatterns
Definition: EventCapture.h:50
#define M_PI
std::vector< MatchingResult > getMatchingResults()
std::vector< std::shared_ptr< OMTFinput > > inputInProcs
Definition: EventCapture.h:56
unsigned int nProcessors() const
std::vector< AlgoMuons > algoMuonsInProcs
Definition: EventCapture.h:57

◆ observeProcesorEmulation()

void EventCapture::observeProcesorEmulation ( unsigned int  iProcessor,
l1t::tftype  mtfType,
const std::shared_ptr< OMTFinput > &  input,
const AlgoMuons algoCandidates,
const AlgoMuons gbCandidates,
const std::vector< l1t::RegionalMuonCand > &  candMuons 
)
overridevirtual

Implements IOMTFEmulationObserver.

Definition at line 76 of file EventCapture.cc.

References algoMuonsInProcs, gbCandidatesInProcs, OMTFConfiguration::getProcIndx(), input, inputInProcs, and omtfConfig.

81  {
82  unsigned int procIndx = omtfConfig->getProcIndx(iProcessor, mtfType);
83 
84  inputInProcs[procIndx] = input;
85 
86  algoMuonsInProcs[procIndx] = algoCandidates;
87  gbCandidatesInProcs[procIndx] = gbCandidates;
88 }
std::vector< AlgoMuons > gbCandidatesInProcs
Definition: EventCapture.h:58
const OMTFConfiguration * omtfConfig
Definition: EventCapture.h:48
static std::string const input
Definition: EdmProvDump.cc:50
std::vector< std::shared_ptr< OMTFinput > > inputInProcs
Definition: EventCapture.h:56
unsigned int getProcIndx(unsigned int iProcessor, l1t::tftype mtfType) const
input phi should be in the hardware scale (nPhiBins units for 2pi), can be in range -nPhiBins ...
std::vector< AlgoMuons > algoMuonsInProcs
Definition: EventCapture.h:57

Member Data Documentation

◆ algoMuonsInProcs

std::vector<AlgoMuons> EventCapture::algoMuonsInProcs
private

Definition at line 57 of file EventCapture.h.

Referenced by observeEventBegin(), observeEventEnd(), and observeProcesorEmulation().

◆ candidateSimMuonMatcher

CandidateSimMuonMatcher* EventCapture::candidateSimMuonMatcher = nullptr
private

Definition at line 52 of file EventCapture.h.

Referenced by observeEventEnd().

◆ gbCandidatesInProcs

std::vector<AlgoMuons> EventCapture::gbCandidatesInProcs
private

Definition at line 58 of file EventCapture.h.

Referenced by observeEventBegin(), observeEventEnd(), and observeProcesorEmulation().

◆ goldenPatterns

const GoldenPatternVec<GoldenPattern>* EventCapture::goldenPatterns = nullptr
private

Definition at line 50 of file EventCapture.h.

Referenced by observeEventEnd().

◆ inputInProcs

std::vector<std::shared_ptr<OMTFinput> > EventCapture::inputInProcs
private

Definition at line 56 of file EventCapture.h.

Referenced by observeEventBegin(), observeEventEnd(), and observeProcesorEmulation().

◆ omtfConfig

const OMTFConfiguration* EventCapture::omtfConfig = nullptr
private

Definition at line 48 of file EventCapture.h.

Referenced by EventCapture(), observeEventEnd(), and observeProcesorEmulation().

◆ simMuons

std::vector<edm::Ptr<SimTrack> > EventCapture::simMuons
private

Definition at line 54 of file EventCapture.h.

Referenced by observeEventBegin(), and observeEventEnd().

◆ simTracksTag

edm::InputTag EventCapture::simTracksTag
private

Definition at line 47 of file EventCapture.h.

Referenced by EventCapture(), observeEventBegin(), and observeEventEnd().

◆ stubsSimHitsMatcher

std::unique_ptr<StubsSimHitsMatcher> EventCapture::stubsSimHitsMatcher
private

Definition at line 60 of file EventCapture.h.

Referenced by beginRun(), endJob(), EventCapture(), and observeEventEnd().