27 <<
" event.omtfGpResultsPdfSum.num_elements() " << endl;
41 <<
" CandidateSimMuonMatcher: candidateSimMuonMatcherType " 54 rootTree =
fs->make<TTree>(
"OMTFHitsTree",
"");
92 ptGenPos =
fs->make<TH1I>(
"ptGenPos",
"ptGenPos, eta at vertex 0.8 - 1.24", 400, 0, 200);
93 ptGenNeg =
fs->make<TH1I>(
"ptGenNeg",
"ptGenNeg, eta at vertex 0.8 - 1.24", 400, 0, 200);
98 const std::shared_ptr<OMTFinput>&,
101 const std::vector<l1t::RegionalMuonCand>& candMuons) {}
104 std::unique_ptr<l1t::RegionalMuonCandBxCollection>& finalCandidates) {
133 LogTrace(
"l1tOmtfEventPrint") <<
"\nDataROOTDumper2::observeEventEnd matchingResults.size() " 134 << matchingResults.size() << std::endl;
146 <<
"\nDataROOTDumper2::observeEventEnd matchingResults.size() " << matchingResults.size() << std::endl;
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();
155 edm::LogVerbatim(
"l1tOmtfEventPrint") <<
"dropping the event!!!\n" << std::endl;
159 for (
auto& matchingResult : matchingResults) {
162 if (matchingResult.trackingParticle) {
163 auto trackingParticle = matchingResult.trackingParticle;
174 if (trackingParticle->parentVertex().isNonnull()) {
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()
187 <<
" eta " << std::setw(9) << trackingParticle->momentum().eta() <<
" phi " 188 << std::setw(9) << trackingParticle->momentum().phi() << std::endl;
196 }
else if (matchingResult.simTrack) {
197 auto simTrack = matchingResult.simTrack;
208 if (!
simTrack->noVertex() && matchingResult.simVertex) {
218 LogTrace(
"l1tOmtfEventPrint") <<
"DataROOTDumper2::observeEventEnd simTrack: eventId " 219 <<
simTrack->eventId().event() <<
" pdgId " << std::setw(3)
221 <<
" pt " << std::setw(9)
223 <<
" eta " << std::setw(9) <<
simTrack->momentum().eta() <<
" phi " << std::setw(9)
224 <<
simTrack->momentum().phi() << std::endl;
267 auto& gpResult = (procMuon->getGpResultUnconstr().getPdfSumUnconstr() > procMuon->getGpResultConstr().getPdfSum())
268 ? procMuon->getGpResultUnconstr()
269 : procMuon->getGpResultConstr();
276 for (
unsigned int iLogicLayer = 0; iLogicLayer < gpResult.getStubResults().size(); ++iLogicLayer) {
277 auto& stubResult = gpResult.getStubResults()[iLogicLayer];
284 if (stubResult.getMuonStub()) {
286 hit.layer = iLogicLayer;
287 hit.quality = stubResult.getMuonStub()->qualityHw;
288 hit.eta = stubResult.getMuonStub()->etaHw;
289 hit.valid = stubResult.getValid();
291 int hitPhi = stubResult.getMuonStub()->phiHw;
293 int phiRefHit = gpResult.getStubResults()[refLayerLogicNum].getMuonStub()->phiHw;
296 hitPhi = stubResult.getMuonStub()->phiBHw;
301 hit.phiDist = hitPhi - phiRefHit;
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;
336 if (matchingResult.muonCand && matchingResult.procMuon->getPtConstr() > 0 &&
337 matchingResult.muonCand->hwQual() >= 1) {
345 if (matchingResult.muonCand->trackFinderType() ==
l1t::omtf_neg) {
349 addOmtfCand(matchingResult.procMuon);
353 for (
auto& killedCand : matchingResult.procMuon->getKilledMuons()) {
356 if (killedCand->isKilled() ==
false) {
357 edm::LogVerbatim(
"l1tOmtfEventPrint") <<
" killedCand->isKilled() == false !!!!!!!!";
359 addOmtfCand(killedCand);
364 LogTrace(
"l1tOmtfEventPrint") <<
"DataROOTDumper2::observeEventEnd no matching omtfCand" << std::endl;
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
CandidateSimMuonMatcher * candidateSimMuonMatcher
bool exists(std::string const ¶meterName) const
checks if a parameter exists
virtual double hwEtaToEta(int hwEta) const
center of eta bin
unsigned int omtfFiredLayers
DataROOTDumper2(const edm::ParameterSet &edmCfg, const OMTFConfiguration *omtfConfig, CandidateSimMuonMatcher *candidateSimMuonMatcher)
double hwUPtToGev(int hwPt) const override
Abs< T >::type abs(const T &t)
Log< level::Error, true > LogImportant
const std::vector< int > & getRefToLogicNumber() const
double hwPtToGev(int hwPt) const override
uGMT pt scale conversion
unsigned int nTestRefHits() const
std::vector< MatchingResult > getMatchingResults()
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
std::vector< AlgoMuonPtr > AlgoMuons
std::vector< unsigned long > hits
std::shared_ptr< AlgoMuon > AlgoMuonPtr
const OMTFConfiguration * omtfConfig
void observeEventEnd(const edm::Event &iEvent, std::unique_ptr< l1t::RegionalMuonCandBxCollection > &finalCandidates) override
~DataROOTDumper2() override
bool isBendingLayer(unsigned int iLayer) const override