CMS 3D CMS Logo

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

#include <DataROOTDumper2.h>

Inheritance diagram for DataROOTDumper2:
EmulationObserverBase IOMTFEmulationObserver

Public Member Functions

 DataROOTDumper2 (const edm::ParameterSet &edmCfg, const OMTFConfiguration *omtfConfig, CandidateSimMuonMatcher *candidateSimMuonMatcher)
 
void endJob () override
 
void observeEventEnd (const edm::Event &iEvent, 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
 
 ~DataROOTDumper2 () override
 
- Public Member Functions inherited from EmulationObserverBase
 EmulationObserverBase (const edm::ParameterSet &edmCfg, const OMTFConfiguration *omtfConfig)
 
const std::vector< const reco::GenParticle * > findGenMuon (const edm::Event &event)
 
const SimTrackfindSimMuon (const edm::Event &event, const SimTrack *previous=nullptr)
 
void observeEventBegin (const edm::Event &iEvent) override
 
void 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) override
 
 ~EmulationObserverBase () override
 
- Public Member Functions inherited from IOMTFEmulationObserver
virtual void addProcesorData (std::string key, boost::property_tree::ptree &procDataTree)
 
virtual void beginRun (edm::EventSetup const &eventSetup)
 
 IOMTFEmulationObserver ()
 
virtual void observeProcesorBegin (unsigned int iProcessor, l1t::tftype mtfType)
 
virtual ~IOMTFEmulationObserver ()
 

Private Member Functions

void initializeTTree ()
 

Private Attributes

CandidateSimMuonMatchercandidateSimMuonMatcher = nullptr
 
bool dumpKilledOmtfCands = false
 
unsigned int evntCnt = 0
 
std::vector< TH2 * > hitVsPt
 
OmtfEvent omtfEvent
 
TH1I * ptGenNeg = nullptr
 
TH1I * ptGenPos = nullptr
 
TTree * rootTree = nullptr
 
bool usePropagation = false
 

Additional Inherited Members

- Protected Attributes inherited from EmulationObserverBase
unsigned int candProcIndx = 0
 
edm::ParameterSet edmCfg
 
AlgoMuons::value_type omtfCand
 
const OMTFConfigurationomtfConfig
 
l1t::RegionalMuonCand regionalMuonCand
 
const SimTracksimMuon = nullptr
 

Detailed Description

Definition at line 78 of file DataROOTDumper2.h.

Constructor & Destructor Documentation

◆ DataROOTDumper2()

DataROOTDumper2::DataROOTDumper2 ( const edm::ParameterSet edmCfg,
const OMTFConfiguration omtfConfig,
CandidateSimMuonMatcher candidateSimMuonMatcher 
)

Definition at line 22 of file DataROOTDumper2.cc.

References dumpKilledOmtfCands, EmulationObserverBase::edmCfg, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), initializeTTree(), OMTFConfiguration::nTestRefHits(), EmulationObserverBase::omtfConfig, AlCaHLTBitMon_QueryRunRegistry::string, and usePropagation.

26  edm::LogVerbatim("l1tOmtfEventPrint") << " omtfConfig->nTestRefHits() " << omtfConfig->nTestRefHits()
27  << " event.omtfGpResultsPdfSum.num_elements() " << endl;
29 
30  if (edmCfg.exists("dumpKilledOmtfCands"))
31  if (edmCfg.getParameter<bool>("dumpKilledOmtfCands"))
32  dumpKilledOmtfCands = true;
33 
34  if (edmCfg.exists("candidateSimMuonMatcherType")) {
35  if (edmCfg.getParameter<std::string>("candidateSimMuonMatcherType") == "propagation")
36  usePropagation = true;
37  else if (edmCfg.getParameter<std::string>("candidateSimMuonMatcherType") == "matchSimple")
38  usePropagation = false;
39 
40  edm::LogImportant("l1tOmtfEventPrint")
41  << " CandidateSimMuonMatcher: candidateSimMuonMatcherType "
42  << edmCfg.getParameter<std::string>("candidateSimMuonMatcherType") << std::endl;
43  }
44 
45  edm::LogVerbatim("l1tOmtfEventPrint") << " DataROOTDumper2 created. dumpKilledOmtfCands " << dumpKilledOmtfCands
46  << std::endl;
47 }
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
CandidateSimMuonMatcher * candidateSimMuonMatcher
EmulationObserverBase(const edm::ParameterSet &edmCfg, const OMTFConfiguration *omtfConfig)
bool exists(std::string const &parameterName) const
checks if a parameter exists
Log< level::Error, true > LogImportant
unsigned int nTestRefHits() const
const OMTFConfiguration * omtfConfig

◆ ~DataROOTDumper2()

DataROOTDumper2::~DataROOTDumper2 ( )
override

Definition at line 49 of file DataROOTDumper2.cc.

49 {}

Member Function Documentation

◆ endJob()

void DataROOTDumper2::endJob ( void  )
overridevirtual

Implements IOMTFEmulationObserver.

Definition at line 391 of file DataROOTDumper2.cc.

References evntCnt.

391 { edm::LogVerbatim("l1tOmtfEventPrint") << " evntCnt " << evntCnt << endl; }
Log< level::Info, true > LogVerbatim
unsigned int evntCnt

◆ initializeTTree()

void DataROOTDumper2::initializeTTree ( )
private

Definition at line 51 of file DataROOTDumper2.cc.

References OmtfEvent::deltaEta, OmtfEvent::deltaPhi, OmtfEvent::eventNum, make_classfiles::fs, OmtfEvent::hits, OmtfEvent::killed, OmtfEvent::muonCharge, OmtfEvent::muonDxy, OmtfEvent::muonEta, OmtfEvent::muonEvent, OmtfEvent::muonPhi, OmtfEvent::muonPropEta, OmtfEvent::muonPropPhi, OmtfEvent::muonPt, OmtfEvent::muonRho, OmtfEvent::omtfCharge, OmtfEvent::omtfEta, omtfEvent, OmtfEvent::omtfFiredLayers, OmtfEvent::omtfHwEta, OmtfEvent::omtfPhi, OmtfEvent::omtfProcessor, OmtfEvent::omtfPt, OmtfEvent::omtfQuality, OmtfEvent::omtfRefHitNum, OmtfEvent::omtfRefLayer, OmtfEvent::omtfScore, OmtfEvent::omtfUPt, ptGenNeg, ptGenPos, and rootTree.

Referenced by DataROOTDumper2().

51  {
53 
54  rootTree = fs->make<TTree>("OMTFHitsTree", "");
55 
56  rootTree->Branch("eventNum", &omtfEvent.eventNum);
57  rootTree->Branch("muonEvent", &omtfEvent.muonEvent);
58 
59  rootTree->Branch("muonPt", &omtfEvent.muonPt);
60  rootTree->Branch("muonEta", &omtfEvent.muonEta);
61  rootTree->Branch("muonPhi", &omtfEvent.muonPhi);
62  rootTree->Branch("muonPropEta", &omtfEvent.muonPropEta);
63  rootTree->Branch("muonPropPhi", &omtfEvent.muonPropPhi);
64  rootTree->Branch("muonCharge", &omtfEvent.muonCharge);
65 
66  rootTree->Branch("muonDxy", &omtfEvent.muonDxy);
67  rootTree->Branch("muonRho", &omtfEvent.muonRho);
68 
69  rootTree->Branch("omtfPt", &omtfEvent.omtfPt);
70  rootTree->Branch("omtfUPt", &omtfEvent.omtfUPt);
71  rootTree->Branch("omtfEta", &omtfEvent.omtfEta);
72  rootTree->Branch("omtfPhi", &omtfEvent.omtfPhi);
73  rootTree->Branch("omtfCharge", &omtfEvent.omtfCharge);
74 
75  rootTree->Branch("omtfHwEta", &omtfEvent.omtfHwEta);
76 
77  rootTree->Branch("omtfProcessor", &omtfEvent.omtfProcessor);
78  rootTree->Branch("omtfScore", &omtfEvent.omtfScore);
79  rootTree->Branch("omtfQuality", &omtfEvent.omtfQuality);
80  rootTree->Branch("omtfRefLayer", &omtfEvent.omtfRefLayer);
81  rootTree->Branch("omtfRefHitNum", &omtfEvent.omtfRefHitNum);
82 
83  rootTree->Branch("omtfFiredLayers", &omtfEvent.omtfFiredLayers); //<<<<<<<<<<<<<<<<<<<<<<!!!!TODOO
84 
85  rootTree->Branch("killed", &omtfEvent.killed);
86 
87  rootTree->Branch("hits", &omtfEvent.hits);
88 
89  rootTree->Branch("deltaEta", &omtfEvent.deltaEta);
90  rootTree->Branch("deltaPhi", &omtfEvent.deltaPhi);
91 
92  ptGenPos = fs->make<TH1I>("ptGenPos", "ptGenPos, eta at vertex 0.8 - 1.24", 400, 0, 200); //TODO
93  ptGenNeg = fs->make<TH1I>("ptGenNeg", "ptGenNeg, eta at vertex 0.8 - 1.24", 400, 0, 200);
94 }
short muonEvent
float muonPropEta
char omtfRefHitNum
char omtfQuality
unsigned int omtfFiredLayers
float deltaPhi
unsigned int eventNum
float muonPropPhi
short omtfScore
float deltaEta
char omtfRefLayer
std::vector< unsigned long > hits
short omtfHwEta
char omtfProcessor

◆ observeEventEnd()

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

Reimplemented from IOMTFEmulationObserver.

Definition at line 103 of file DataROOTDumper2.cc.

References funct::abs(), candidateSimMuonMatcher, CSCDetId::chamber(), MuonSubdetId::CSC, OmtfEvent::deltaEta, OmtfEvent::deltaPhi, hcalRecHitTable_cff::detId, dumpKilledOmtfCands, OmtfEvent::eventNum, evntCnt, CandidateSimMuonMatcher::getMatchingResults(), OMTFConfiguration::getRefToLogicNumber(), OmtfEvent::hits, OMTFConfiguration::hwEtaToEta(), OMTFConfiguration::hwPtToGev(), OMTFConfiguration::hwUPtToGev(), iEvent, OMTFConfiguration::isBendingLayer(), OmtfEvent::killed, LogTrace, OmtfEvent::muonCharge, OmtfEvent::muonDxy, OmtfEvent::muonEta, OmtfEvent::muonEvent, OmtfEvent::muonPhi, OmtfEvent::muonPropEta, OmtfEvent::muonPropPhi, OmtfEvent::muonPt, OmtfEvent::muonRho, l1t::omtf_neg, OmtfEvent::omtfCharge, EmulationObserverBase::omtfConfig, OmtfEvent::omtfEta, omtfEvent, OmtfEvent::omtfFiredLayers, OmtfEvent::omtfHwEta, OmtfEvent::omtfPhi, OmtfEvent::omtfProcessor, OmtfEvent::omtfPt, OmtfEvent::omtfQuality, OmtfEvent::omtfRefHitNum, OmtfEvent::omtfRefLayer, OmtfEvent::omtfScore, OmtfEvent::omtfUPt, ptGenNeg, ptGenPos, rootTree, cscDigiValidation_cfi::simTrack, usePropagation, and hit::z.

104  {
105  /*
106  int muonCharge = 0;
107  if (simMuon) {
108  if (std::abs(simMuon->momentum().eta()) < 0.8 || std::abs(simMuon->momentum().eta()) > 1.24)
109  return;
110 
111  muonCharge = (std::abs(simMuon->type()) == 13) ? simMuon->type() / -13 : 0;
112  if (muonCharge > 0)
113  ptGenPos->Fill(simMuon->momentum().pt());
114  else
115  ptGenNeg->Fill(simMuon->momentum().pt());
116  }
117 
118  if (simMuon == nullptr || !omtfCand->isValid()) //no sim muon or empty candidate
119  return;
120 
121  omtfEvent.muonPt = simMuon->momentum().pt();
122  omtfEvent.muonEta = simMuon->momentum().eta();
123 
124  //TODO add cut on ete if needed
125  if(std::abs(event.muonEta) < 0.8 || std::abs(event.muonEta) > 1.24)
126  return;
127 
128  omtfEvent.muonPhi = simMuon->momentum().phi();
129  omtfEvent.muonCharge = muonCharge; //TODO
130  */
131 
132  std::vector<MatchingResult> matchingResults = candidateSimMuonMatcher->getMatchingResults();
133  LogTrace("l1tOmtfEventPrint") << "\nDataROOTDumper2::observeEventEnd matchingResults.size() "
134  << matchingResults.size() << std::endl;
135 
136  //candidateSimMuonMatcher should use the trackingParticles, because the simTracks are not stored for the pile-up events
137 
138  //for some events there are more than one matchingResults,
139  //Usually at least one them has genPt 0, which means no simMuon was matched, so candidate is ghost (or fake)
140  //so better is to to drop such event, as it is not sue if the correct simMuon was matched to the candidate.
141  //So we assume here that when the propagation is not used it is a single mu sample and this filter has sense
142  //the propagation is used for multi-muon sample, so then this fitler cannot be used
143  //TODO add a flag to enable this filter? Disable it if not needed
144  if (!usePropagation && matchingResults.size() > 1) { //omtfConfig->cleanStubs() &&
145  edm::LogVerbatim("l1tOmtfEventPrint")
146  << "\nDataROOTDumper2::observeEventEnd matchingResults.size() " << matchingResults.size() << std::endl;
147 
148  for (auto& matchingResult : matchingResults) {
149  edm::LogVerbatim("l1tOmtfEventPrint") << "matchingResult: genPt " << matchingResult.genPt;
150  if (matchingResult.procMuon)
151  edm::LogVerbatim("l1tOmtfEventPrint") << " procMuon.PtConstr " << matchingResult.procMuon->getPtConstr();
152  else
153  edm::LogVerbatim("l1tOmtfEventPrint") << " no procMuon" << std::endl;
154  }
155  edm::LogVerbatim("l1tOmtfEventPrint") << "dropping the event!!!\n" << std::endl;
156  return;
157  }
158 
159  for (auto& matchingResult : matchingResults) {
160  omtfEvent.eventNum = iEvent.id().event();
161 
162  if (matchingResult.trackingParticle) {
163  auto trackingParticle = matchingResult.trackingParticle;
164 
165  omtfEvent.muonEvent = trackingParticle->eventId().event();
166 
167  omtfEvent.muonPt = trackingParticle->pt();
168  omtfEvent.muonEta = trackingParticle->momentum().eta();
169  omtfEvent.muonPhi = trackingParticle->momentum().phi();
170  omtfEvent.muonPropEta = matchingResult.propagatedEta;
171  omtfEvent.muonPropPhi = matchingResult.propagatedPhi;
172  omtfEvent.muonCharge = (std::abs(trackingParticle->pdgId()) == 13) ? trackingParticle->pdgId() / -13 : 0;
173 
174  if (trackingParticle->parentVertex().isNonnull()) {
175  omtfEvent.muonDxy = trackingParticle->dxy();
176  omtfEvent.muonRho = trackingParticle->parentVertex()->position().Rho();
177  }
178 
179  omtfEvent.deltaEta = matchingResult.deltaEta;
180  omtfEvent.deltaPhi = matchingResult.deltaPhi;
181 
182  LogTrace("l1tOmtfEventPrint") << "DataROOTDumper2::observeEventEnd trackingParticle: eventId "
183  << trackingParticle->eventId().event() << " pdgId " << std::setw(3)
184  << trackingParticle->pdgId() << " trackId "
185  << trackingParticle->g4Tracks().at(0).trackId() << " pt " << std::setw(9)
186  << trackingParticle->pt() //<<" Beta "<<simMuon->momentum().Beta()
187  << " eta " << std::setw(9) << trackingParticle->momentum().eta() << " phi "
188  << std::setw(9) << trackingParticle->momentum().phi() << std::endl;
189 
190  if (std::abs(omtfEvent.muonEta) > 0.8 && std::abs(omtfEvent.muonEta) < 1.24) {
191  if (omtfEvent.muonCharge > 0)
192  ptGenPos->Fill(omtfEvent.muonPt);
193  else
194  ptGenNeg->Fill(omtfEvent.muonPt);
195  }
196  } else if (matchingResult.simTrack) {
197  auto simTrack = matchingResult.simTrack;
198 
199  omtfEvent.muonEvent = simTrack->eventId().event();
200 
201  omtfEvent.muonPt = simTrack->momentum().pt();
202  omtfEvent.muonEta = simTrack->momentum().eta();
203  omtfEvent.muonPhi = simTrack->momentum().phi();
204  omtfEvent.muonPropEta = matchingResult.propagatedEta;
205  omtfEvent.muonPropPhi = matchingResult.propagatedPhi;
206  omtfEvent.muonCharge = simTrack->charge();
207 
208  if (!simTrack->noVertex() && matchingResult.simVertex) {
209  const math::XYZTLorentzVectorD& vtxPos = matchingResult.simVertex->position();
210  omtfEvent.muonDxy = (-vtxPos.X() * simTrack->momentum().py() + vtxPos.Y() * simTrack->momentum().px()) /
211  simTrack->momentum().pt();
212  omtfEvent.muonRho = vtxPos.Rho();
213  }
214 
215  omtfEvent.deltaEta = matchingResult.deltaEta;
216  omtfEvent.deltaPhi = matchingResult.deltaPhi;
217 
218  LogTrace("l1tOmtfEventPrint") << "DataROOTDumper2::observeEventEnd simTrack: eventId "
219  << simTrack->eventId().event() << " pdgId " << std::setw(3)
220  << simTrack->type() //<< " trackId " << simTrack->g4Tracks().at(0).trackId()
221  << " pt " << std::setw(9)
222  << simTrack->momentum().pt() //<<" Beta "<<simMuon->momentum().Beta()
223  << " eta " << std::setw(9) << simTrack->momentum().eta() << " phi " << std::setw(9)
224  << simTrack->momentum().phi() << std::endl;
225 
226  if (std::abs(omtfEvent.muonEta) > 0.8 && std::abs(omtfEvent.muonEta) < 1.24) {
227  if (omtfEvent.muonCharge > 0)
228  ptGenPos->Fill(omtfEvent.muonPt);
229  else
230  ptGenNeg->Fill(omtfEvent.muonPt);
231  }
232  } else {
233  omtfEvent.muonEvent = -1;
234 
235  omtfEvent.muonPt = 0;
236 
237  omtfEvent.muonEta = 0;
238  omtfEvent.muonPhi = 0;
239 
242 
243  omtfEvent.muonCharge = 0; //TODO
244 
245  omtfEvent.muonDxy = 0;
246  omtfEvent.muonRho = 0;
247  }
248 
249  auto addOmtfCand = [&](AlgoMuonPtr& procMuon) {
250  omtfEvent.omtfPt = omtfConfig->hwPtToGev(procMuon->getPtConstr());
251  omtfEvent.omtfUPt = omtfConfig->hwUPtToGev(procMuon->getPtUnconstr());
252  omtfEvent.omtfEta = omtfConfig->hwEtaToEta(procMuon->getEtaHw());
253  omtfEvent.omtfPhi = procMuon->getPhi();
254  omtfEvent.omtfCharge = procMuon->getChargeConstr();
255  omtfEvent.omtfScore = procMuon->getPdfSum();
256 
257  omtfEvent.omtfHwEta = procMuon->getEtaHw();
258 
259  omtfEvent.omtfFiredLayers = procMuon->getFiredLayerBits();
260  omtfEvent.omtfRefLayer = procMuon->getRefLayer();
261  omtfEvent.omtfRefHitNum = procMuon->getRefHitNumber();
262 
263  omtfEvent.hits.clear();
264 
265  //TODO choose, which gpResult should be dumped
266  //auto& gpResult = procMuon->getGpResultConstr();
267  auto& gpResult = (procMuon->getGpResultUnconstr().getPdfSumUnconstr() > procMuon->getGpResultConstr().getPdfSum())
268  ? procMuon->getGpResultUnconstr()
269  : procMuon->getGpResultConstr();
270 
271  /*
272  edm::LogVerbatim("l1tOmtfEventPrint")<<"DataROOTDumper2:;observeEventEnd muonPt "<<event.muonPt<<" muonCharge "<<event.muonCharge
273  <<" omtfPt "<<event.omtfPt<<" RefLayer "<<event.omtfRefLayer<<" omtfPtCont "<<event.omtfPtCont
274  <<std::endl; */
275 
276  for (unsigned int iLogicLayer = 0; iLogicLayer < gpResult.getStubResults().size(); ++iLogicLayer) {
277  auto& stubResult = gpResult.getStubResults()[iLogicLayer];
278 
279  //TODO it is to have the hit if it is below the quality cut
280  /*if (omtfConfig->isBendingLayer(iLogicLayer) && !stubResult.getMuonStub()) {
281  auto& stubResult = gpResult.getStubResults()[iLogicLayer-1];
282  }*/
283 
284  if (stubResult.getMuonStub()) { //&& stubResult.getValid() //TODO!!!!!!!!!!!!!!!!1
286  hit.layer = iLogicLayer;
287  hit.quality = stubResult.getMuonStub()->qualityHw;
288  hit.eta = stubResult.getMuonStub()->etaHw; //in which scale?
289  hit.valid = stubResult.getValid();
290 
291  int hitPhi = stubResult.getMuonStub()->phiHw;
292  unsigned int refLayerLogicNum = omtfConfig->getRefToLogicNumber()[procMuon->getRefLayer()];
293  int phiRefHit = gpResult.getStubResults()[refLayerLogicNum].getMuonStub()->phiHw;
294 
295  if (omtfConfig->isBendingLayer(iLogicLayer)) {
296  hitPhi = stubResult.getMuonStub()->phiBHw;
297  phiRefHit = 0; //phi ref hit for the bending layer set to 0, since it should not be included in the phiDist
298  }
299 
300  //phiDist = hitPhi - phiRefHit;
301  hit.phiDist = hitPhi - phiRefHit;
302 
303  /* LogTrace("l1tOmtfEventPrint")<<" muonPt "<<event.muonPt<<" omtfPt "<<event.omtfPt<<" RefLayer "<<event.omtfRefLayer
304  <<" layer "<<int(hit.layer)<<" PdfBin "<<stubResult.getPdfBin()<<" hit.phiDist "<<hit.phiDist<<" valid "<<stubResult.getValid()<<" " //<<" phiDist "<<phiDist
305  <<" getDistPhiBitShift "<<procMuon->getGoldenPatern()->getDistPhiBitShift(iLogicLayer, procMuon->getRefLayer())
306  <<" meanDistPhiValue "<<procMuon->getGoldenPatern()->meanDistPhiValue(iLogicLayer, procMuon->getRefLayer())//<<(phiDist != hit.phiDist? "!!!!!!!<<<<<" : "")
307  <<endl;*/
308 
309  /*if (hit.phiDist > 504 || hit.phiDist < -512) {
310  edm::LogVerbatim("l1tOmtfEventPrint")
311  << " muonPt " << omtfEvent.muonPt << " omtfPt " << omtfEvent.omtfPt << " RefLayer "
312  << (int)omtfEvent.omtfRefLayer << " layer " << int(hit.layer) << " hit.phiDist " << hit.phiDist
313  << " valid " << stubResult.getValid() << " !!!!!!!!!!!!!!!!!!!!!!!!" << endl;
314  }*/
315 
316  DetId detId(stubResult.getMuonStub()->detId);
317  if (detId.subdetId() == MuonSubdetId::CSC) {
318  CSCDetId cscId(detId);
319  hit.z = cscId.chamber() % 2;
320  }
321 
322  omtfEvent.hits.push_back(hit.rawData);
323  }
324  }
325 
326  LogTrace("l1tOmtfEventPrint") << "DataROOTDumper2::observeEventEnd adding omtfCand : " << std::endl;
327  auto finalCandidate = matchingResult.muonCand;
328  LogTrace("l1tOmtfEventPrint") << " hwPt " << finalCandidate->hwPt() << " hwSign " << finalCandidate->hwSign()
329  << " hwQual " << finalCandidate->hwQual() << " hwEta " << std::setw(4)
330  << finalCandidate->hwEta() << std::setw(4) << " hwPhi " << finalCandidate->hwPhi()
331  << " eta " << std::setw(9) << (finalCandidate->hwEta() * 0.010875)
332  << " isKilled " << procMuon->isKilled() << " tRefLayer " << procMuon->getRefLayer()
333  << " RefHitNumber " << procMuon->getRefHitNumber() << std::endl;
334  };
335 
336  if (matchingResult.muonCand && matchingResult.procMuon->getPtConstr() > 0 &&
337  matchingResult.muonCand->hwQual() >= 1) {
338  //TODO set the quality, quality 0 has the candidates with eta > 1.3(?) EtaHw >= 121
339  //&& matchingResult.genPt < 20
340 
341  omtfEvent.omtfQuality = matchingResult.muonCand->hwQual(); //procMuon->getQ();
342  omtfEvent.killed = false;
343  omtfEvent.omtfProcessor = matchingResult.muonCand->processor();
344 
345  if (matchingResult.muonCand->trackFinderType() == l1t::omtf_neg) {
346  omtfEvent.omtfProcessor *= -1;
347  }
348 
349  addOmtfCand(matchingResult.procMuon);
350  rootTree->Fill();
351 
352  if (dumpKilledOmtfCands) {
353  for (auto& killedCand : matchingResult.procMuon->getKilledMuons()) {
355  omtfEvent.killed = true;
356  if (killedCand->isKilled() == false) {
357  edm::LogVerbatim("l1tOmtfEventPrint") << " killedCand->isKilled() == false !!!!!!!!";
358  }
359  addOmtfCand(killedCand);
360  rootTree->Fill();
361  }
362  }
363  } else if (omtfEvent.muonPt > 0) { //checking if there was a simMuon
364  LogTrace("l1tOmtfEventPrint") << "DataROOTDumper2::observeEventEnd no matching omtfCand" << std::endl;
365 
366  omtfEvent.omtfPt = 0;
367  omtfEvent.omtfUPt = 0;
368  omtfEvent.omtfEta = 0;
369  omtfEvent.omtfPhi = 0;
370  omtfEvent.omtfCharge = 0;
371  omtfEvent.omtfScore = 0;
372 
373  omtfEvent.omtfHwEta = 0;
374 
379 
381  omtfEvent.killed = false;
382 
383  omtfEvent.hits.clear();
384 
385  rootTree->Fill();
386  }
387  }
388  evntCnt++;
389 }
short muonEvent
Log< level::Info, true > LogVerbatim
float muonPropEta
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
CandidateSimMuonMatcher * candidateSimMuonMatcher
char omtfRefHitNum
char omtfQuality
virtual double hwEtaToEta(int hwEta) const
center of eta bin
unsigned int omtfFiredLayers
#define LogTrace(id)
float deltaPhi
unsigned int evntCnt
int iEvent
Definition: GenABIO.cc:224
double hwUPtToGev(int hwPt) const override
unsigned int eventNum
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float muonPropPhi
const std::vector< int > & getRefToLogicNumber() const
double hwPtToGev(int hwPt) const override
uGMT pt scale conversion
short omtfScore
std::vector< MatchingResult > getMatchingResults()
float deltaEta
Definition: DetId.h:17
char omtfRefLayer
std::vector< unsigned long > hits
short omtfHwEta
std::shared_ptr< AlgoMuon > AlgoMuonPtr
Definition: AlgoMuon.h:175
static constexpr int CSC
Definition: MuonSubdetId.h:12
char omtfProcessor
const OMTFConfiguration * omtfConfig
bool isBendingLayer(unsigned int iLayer) const override

◆ observeProcesorEmulation()

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

Implements IOMTFEmulationObserver.

Definition at line 96 of file DataROOTDumper2.cc.

101  {}

Member Data Documentation

◆ candidateSimMuonMatcher

CandidateSimMuonMatcher* DataROOTDumper2::candidateSimMuonMatcher = nullptr
private

Definition at line 101 of file DataROOTDumper2.h.

Referenced by observeEventEnd().

◆ dumpKilledOmtfCands

bool DataROOTDumper2::dumpKilledOmtfCands = false
private

Definition at line 114 of file DataROOTDumper2.h.

Referenced by DataROOTDumper2(), and observeEventEnd().

◆ evntCnt

unsigned int DataROOTDumper2::evntCnt = 0
private

Definition at line 107 of file DataROOTDumper2.h.

Referenced by endJob(), and observeEventEnd().

◆ hitVsPt

std::vector<TH2*> DataROOTDumper2::hitVsPt
private

Definition at line 112 of file DataROOTDumper2.h.

◆ omtfEvent

OmtfEvent DataROOTDumper2::omtfEvent
private

Definition at line 105 of file DataROOTDumper2.h.

Referenced by initializeTTree(), and observeEventEnd().

◆ ptGenNeg

TH1I* DataROOTDumper2::ptGenNeg = nullptr
private

Definition at line 110 of file DataROOTDumper2.h.

Referenced by initializeTTree(), and observeEventEnd().

◆ ptGenPos

TH1I* DataROOTDumper2::ptGenPos = nullptr
private

Definition at line 109 of file DataROOTDumper2.h.

Referenced by initializeTTree(), and observeEventEnd().

◆ rootTree

TTree* DataROOTDumper2::rootTree = nullptr
private

Definition at line 103 of file DataROOTDumper2.h.

Referenced by initializeTTree(), and observeEventEnd().

◆ usePropagation

bool DataROOTDumper2::usePropagation = false
private

Definition at line 116 of file DataROOTDumper2.h.

Referenced by DataROOTDumper2(), and observeEventEnd().