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 if (
input.getMuonStub(iLayer - 1, iInput) &&
158 input.getMuonStub(iLayer - 1, iInput)->qualityHw >= myOmtfConfig->getMinDtPhiBQuality())
159 layerStubs.push_back(
input.getMuonStub(iLayer - 1, iInput));
161 layerStubs.push_back(
input.getMuonStub(iLayer, iInput));
170 template <
class GoldenPatternType>
174 bool firstPos = firstPatFrom0;
175 bool firstNeg = firstPatFrom0;
176 for (
unsigned int iPat = 0; iPat < theGPs.size(); iPat++) {
178 int charge = theGPs[iPat]->key().theCharge;
179 if (theGPs[iPat] ==
nullptr || theGPs[iPat]->
key().thePt == 0) {
180 patternPts.push_back(patternPt);
184 patternPt.
ptFrom = myOmtfConfig->hwPtToGev(theGPs[iPat]->
key().thePt);
194 unsigned int iPat1 = iPat;
197 if (iPat1 == theGPs.size())
199 if (theGPs[iPat1]->
key().thePt != 0 && theGPs[iPat1]->key().theCharge ==
charge)
203 if (iPat1 == theGPs.size())
204 patternPt.
ptTo = 10000;
206 patternPt.
ptTo = myOmtfConfig->hwPtToGev(theGPs[iPat1]->key().thePt);
209 patternPts.push_back(patternPt);
217 edm::LogTrace_(
"OMTFReconstruction") << __FUNCTION__ <<
":" << __LINE__ <<
" patternPts.size() " << patternPts.size()
221 template <
class GoldenPatternType>
223 myOmtfConfig->printConfig();
226 unsigned int patNum = 0;
227 for (
auto&
gp : theGPs) {
229 << std::setw(2) << patNum <<
" " <<
gp->key() <<
" " << myOmtfConfig->getPatternPtRange(patNum).ptFrom <<
" - " 230 << 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
key
prepare the HTCondor submission files and eventually submit them
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.