20 template <
class GoldenPatternType>
23 : myOmtfConfig(omtfConfig), theGPs(
std::
move(gps)) {
33 template <
class GoldenPatternType>
40 template <
class GoldenPatternType>
45 myOmtfConfig = omtfConfig;
54 unsigned int nGPs = myOmtfConfig->nGoldenPatterns();
56 <<
"ProcessorBase<>::configure. Building patterns from L1TMuonOverlapParams (LUTs). nGoldenPatterns() " << nGPs
59 unsigned int address = 0;
60 unsigned int iEta, iPt;
64 unsigned int group = 0;
65 unsigned int indexInGroup = 0;
66 for (
unsigned int iGP = 0; iGP < nGPs; ++iGP) {
69 iCharge = chargeLUT->
data(address) == 0 ? -1 : 1;
70 iPt =
ptLUT->data(address);
73 group = iGP / myOmtfConfig->patternsInGroup;
74 indexInGroup = iGP % myOmtfConfig->patternsInGroup + 1;
75 Key aKey(
iEta, iPt, iCharge, theGPs.size(),
group, indexInGroup);
77 LogTrace(
"OMTFReconstruction") <<
"skipping empty pattern " << aKey <<
" " << std::endl;
82 LogTrace(
"OMTFReconstruction") <<
"adding pattern " << aKey <<
" " << std::endl;
85 GoldenPatternType* aGP =
new GoldenPatternType(aKey, myOmtfConfig);
87 for (
unsigned int iLayer = 0; iLayer < myOmtfConfig->nLayers(); ++iLayer) {
88 for (
unsigned int iRefLayer = 0; iRefLayer < myOmtfConfig->nRefLayers(); ++iRefLayer) {
89 address = iRefLayer + iLayer * myOmtfConfig->nRefLayers() +
90 iGP * (myOmtfConfig->nRefLayers() * myOmtfConfig->nLayers());
95 aGP->setMeanDistPhiValue(
value, iLayer, iRefLayer, 0);
106 if (distPhiShiftLUT) {
108 aGP->setDistPhiBitShift(
value, iLayer, iRefLayer);
112 for (
unsigned int iRefLayer = 0; iRefLayer < myOmtfConfig->nRefLayers(); ++iRefLayer) {
113 for (
unsigned int iPdf = 0; iPdf < (
unsigned int)(1 << myOmtfConfig->nPdfAddrBits()); ++iPdf) {
114 address = iPdf + iRefLayer * (1 << myOmtfConfig->nPdfAddrBits()) +
115 iLayer * myOmtfConfig->nRefLayers() * (1 << myOmtfConfig->nPdfAddrBits()) +
116 iGP * myOmtfConfig->nLayers() * myOmtfConfig->nRefLayers() * (1 << myOmtfConfig->nPdfAddrBits());
118 aGP->setPdfValue(
value, iLayer, iRefLayer, iPdf);
128 initPatternPtRange(
true);
137 template <
class GoldenPatternType>
139 theGPs.emplace_back(std::unique_ptr<GoldenPatternType>(aGP));
144 template <
class GoldenPatternType>
146 unsigned int iRegion,
151 unsigned int iStart = myOmtfConfig->getConnections()[iProcessor][iRegion][iLayer].first;
152 unsigned int iEnd = iStart + myOmtfConfig->getConnections()[iProcessor][iRegion][iLayer].second - 1;
154 for (
unsigned int iInput = 0; iInput <
input.getMuonStubs()[iLayer].size(); ++iInput) {
155 if (iInput >= iStart && iInput <= iEnd) {
156 if (this->myOmtfConfig->isBendingLayer(iLayer)) {
157 layerStubs.push_back(
input.getMuonStub(iLayer - 1, iInput));
159 layerStubs.push_back(
input.getMuonStub(iLayer, iInput));
168 template <
class GoldenPatternType>
172 bool firstPos = firstPatFrom0;
173 bool firstNeg = firstPatFrom0;
174 for (
unsigned int iPat = 0; iPat < theGPs.size(); iPat++) {
176 int charge = theGPs[iPat]->key().theCharge;
177 if (theGPs[iPat] ==
nullptr || theGPs[iPat]->
key().thePt == 0) {
178 patternPts.push_back(patternPt);
182 patternPt.
ptFrom = myOmtfConfig->hwPtToGev(theGPs[iPat]->
key().thePt);
192 unsigned int iPat1 = iPat;
195 if (iPat1 == theGPs.size())
197 if (theGPs[iPat1]->
key().thePt != 0 && theGPs[iPat1]->key().theCharge ==
charge)
201 if (iPat1 == theGPs.size())
202 patternPt.
ptTo = 10000;
204 patternPt.
ptTo = myOmtfConfig->hwPtToGev(theGPs[iPat1]->key().thePt);
207 patternPts.push_back(patternPt);
215 edm::LogTrace_(
"OMTFReconstruction") << __FUNCTION__ <<
":" << __LINE__ <<
" patternPts.size() " << patternPts.size()
219 template <
class GoldenPatternType>
221 myOmtfConfig->printConfig();
224 unsigned int patNum = 0;
225 for (
auto&
gp : theGPs) {
227 << std::setw(2) << patNum <<
" " <<
gp->key() <<
" " << myOmtfConfig->getPatternPtRange(patNum).ptFrom <<
" - " 228 << myOmtfConfig->getPatternPtRange(patNum).ptTo <<
" GeV" << std::endl;
GoldenPatternVec< GoldenPatternType > theGPs
vector holding Golden Patterns
virtual bool configure(OMTFConfiguration *omtfParams, const L1TMuonOverlapParams *omtfPatterns)
Fill GP vec with patterns from CondFormats object.
Log< level::Info, true > LogVerbatim
virtual void printInfo() const
const l1t::LUT * chargeLUT() const
Golden Patterns definitions.
unsigned int nrBitsData() const
virtual void addGP(GoldenPatternType *aGP)
Add GoldenPattern to pattern vec.
const std::vector< OMTFConfiguration::PatternPt > & getPatternPtRange() const
const l1t::LUT * distPhiShiftLUT() const
static std::string const input
ProcessorBase(OMTFConfiguration *omtfConfig, const L1TMuonOverlapParams *omtfPatterns)
const OMTFConfiguration * myOmtfConfig
void setPatternPtRange(const std::vector< PatternPt > &patternPts)
virtual MuonStubPtrs1D restrictInput(unsigned int iProcessor, unsigned int iCone, unsigned int iLayer, const OMTFinput &input)
int data(unsigned int address) const
const l1t::LUT * pdfLUT() const
std::vector< MuonStubPtr > MuonStubPtrs1D
virtual void initPatternPtRange(bool firstPatFrom0)
const ap_uint< BITSPT > ptLUT[1858]
std::vector< std::unique_ptr< GoldenPatternType > > GoldenPatternVec
const l1t::LUT * meanDistPhiLUT() const
const l1t::LUT * ptLUT() const
const l1t::LUT * etaLUT() const
virtual void resetConfiguration()
Reset all configuration parameters.