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 428 of file EventCapture.cc.

References stubsSimHitsMatcher.

428  {
430  stubsSimHitsMatcher->endJob();
431 }
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 93 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.

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