CMS 3D CMS Logo

Functions
GoldenPatternResult.cc File Reference
#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GoldenPatternResult.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFConfiguration.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include <iostream>
#include <ostream>
#include <iomanip>
#include <cmath>

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &out, const GoldenPatternResult &gpResult)
 

Function Documentation

◆ operator<<()

std::ostream& operator<< ( std::ostream &  out,
const GoldenPatternResult gpResult 
)

Definition at line 441 of file GoldenPatternResult.cc.

References GoldenPatternResult::getFiredLayerCnt(), GoldenPatternResult::getGpProbability1(), GoldenPatternResult::getGpProbability2(), GoldenPatternResult::getPdfSum(), GoldenPatternResult::getPdfSumUnconstr(), GoldenPatternResult::getRefLayer(), OMTFConfiguration::getRefToLogicNumber(), OMTFConfiguration::isBendingLayer(), GoldenPatternResult::isLayerFired(), GoldenPatternResult::omtfConfig, MillePedeFileConverter_cfg::out, and GoldenPatternResult::stubResults.

441  {
442  if (gpResult.omtfConfig == nullptr) {
443  out << "empty GoldenPatternResult" << std::endl;
444  return out;
445  }
446  unsigned int refLayerLogicNum = gpResult.omtfConfig->getRefToLogicNumber()[gpResult.getRefLayer()];
447 
448  unsigned int sumOverFiredLayers = 0;
449  for (unsigned int iLogicLayer = 0; iLogicLayer < gpResult.stubResults.size(); ++iLogicLayer) {
450  out << " layer: " << std::setw(2) << iLogicLayer << " hit: ";
451  if (gpResult.stubResults[iLogicLayer].getMuonStub()) {
452  out << std::setw(4)
453  << (gpResult.omtfConfig->isBendingLayer(iLogicLayer)
454  ? gpResult.stubResults[iLogicLayer].getMuonStub()->phiBHw
455  : gpResult.stubResults[iLogicLayer].getMuonStub()->phiHw);
456 
457  out << " pdfBin: " << std::setw(4) << gpResult.stubResults[iLogicLayer].getPdfBin() << " pdfVal: " << std::setw(3)
458  << gpResult.stubResults[iLogicLayer].getPdfVal() << " fired " << gpResult.isLayerFired(iLogicLayer)
459  << (iLogicLayer == refLayerLogicNum ? " <<< refLayer" : "");
460 
461  if (gpResult.isLayerFired(iLogicLayer))
462  sumOverFiredLayers += gpResult.stubResults[iLogicLayer].getPdfVal();
463  } else if (gpResult.stubResults[iLogicLayer].getPdfVal()) {
464  out << " pdfVal: " << std::setw(3) << gpResult.stubResults[iLogicLayer].getPdfVal();
465  }
466  out << std::endl;
467  }
468 
469  out << " refLayer: ";
470  out << gpResult.getRefLayer() << "\t";
471 
472  out << " Sum over layers: ";
473  out << gpResult.getPdfSum() << "\t";
474 
475  out << " sumOverFiredLayers: ";
476  out << sumOverFiredLayers << "\t";
477 
478  out << " Sum over layers unconstr: ";
479  out << gpResult.getPdfSumUnconstr() << "\t";
480 
481  out << " Number of hits: ";
482  out << gpResult.getFiredLayerCnt() << "\t";
483 
484  out << " GpProbability1: ";
485  out << gpResult.getGpProbability1() << "\t";
486 
487  out << " GpProbability2: ";
488  out << gpResult.getGpProbability2() << "\t";
489 
490  out << std::endl;
491 
492  return out;
493 }
PdfValueType getPdfSumUnconstr() const
double getGpProbability1() const
const OMTFConfiguration * omtfConfig
double getGpProbability2() const
const std::vector< int > & getRefToLogicNumber() const
bool isLayerFired(unsigned int iLayer) const
unsigned int getFiredLayerCnt() const
PdfValueType getPdfSum() const
bool isBendingLayer(unsigned int iLayer) const override