50 unsigned int address = 0;
51 unsigned int iEta, iPt;
53 for (
unsigned int iGP = 0; iGP < nGPs; ++iGP) {
56 iCharge = chargeLUT->
data(address) == 0 ? -1 : 1;
57 iPt =
ptLUT->data(address);
69 meanDistPhi1D[iRefLayer] = meanDistPhiLUT->
data(address) - (1 << (meanDistPhiLUT->
nrBitsData() - 1));
71 meanDistPhi2D[iLayer] = meanDistPhi1D;
79 pdf1D[iPdf] = pdfLUT->
data(address);
81 pdf2D[iRefLayer] = pdf1D;
83 pdf3D[iLayer] = pdf2D;
85 Key aKey(
iEta, iPt, iCharge, iGP);
99 <<
"OMTFProcessor::addGP(...) " 100 <<
" Reading two Golden Patterns with the same key: " << aGP->
key() << std::endl;
107 itRegion[aGP->
key()] = aResult;
127 aGP2 =
theGPs.find(aKey)->second;
134 aGP3 =
theGPs.find(aKey)->second;
140 aGP4 =
theGPs.find(aKey)->second;
161 meanDistPhi[iLayer][iRefLayer] += meanDistPhi2[iLayer][iRefLayer];
162 meanDistPhi[iLayer][iRefLayer] += meanDistPhi3[iLayer][iRefLayer];
163 meanDistPhi[iLayer][iRefLayer] += meanDistPhi4[iLayer][iRefLayer];
164 meanDistPhi[iLayer][iRefLayer] /= 4;
171 shiftGP(aGP1, meanDistPhi, meanDistPhi1);
172 shiftGP(aGP2, meanDistPhi, meanDistPhi2);
173 if (aGP3 != aGP1 && aGP4 != aGP2) {
176 shiftGP(aGP3, meanDistPhi, meanDistPhi3);
177 shiftGP(aGP4, meanDistPhi, meanDistPhi4);
194 indexShift = meanDistPhiOld[iLayer][iRefLayer] - meanDistPhiNew[iLayer][iRefLayer];
195 for (
unsigned int iPdfBin = 0; iPdfBin < nPdfBins; ++iPdfBin)
196 pdfAllRef[iLayer][iRefLayer][iPdfBin] = 0;
197 for (
unsigned int iPdfBin = 0; iPdfBin < nPdfBins; ++iPdfBin) {
198 if ((
int)(iPdfBin) + indexShift >= 0 && iPdfBin + indexShift < nPdfBins)
199 pdfAllRef[iLayer][iRefLayer][iPdfBin + indexShift] = aGP->
pdfValue(iLayer, iRefLayer, iPdfBin);
213 for (
auto &itKey : itRegion)
214 itKey.second.clear();
218 std::bitset<128> refHitsBits = aInput.
getRefHits(iProcessor);
219 if (refHitsBits.none())
224 if (layerHits.empty())
229 if (!refHitsBits[iRefHit])
231 if (nTestedRefHits-- == 0)
238 unsigned int iRegion = aRefHitDef.
iRegion;
243 for (
auto itGP :
theGPs) {
245 itGP.second->process1Layer1RefLayer(aRefHitDef.
iRefLayer, iLayer, phiRef, restrictedLayerHits);
246 int phiRefSt2 = itGP.second->propagateRefPhi(phiRef, etaRef, aRefHitDef.
iRefLayer);
250 aRefHitDef.
iRefLayer, iLayer, aLayerResult.first, phiRefSt2, etaRef);
257 for (
auto &itKey : itRefHit)
258 itKey.second.finalise();
260 std::ostringstream myStr;
261 myStr <<
"iProcessor: " << iProcessor << std::endl;
262 myStr <<
"Input: ------------" << std::endl;
263 myStr << aInput << std::endl;
271 unsigned int iRegion,
279 for (
unsigned int iInput = 0; iInput < 14; ++iInput) {
280 if (iInput < iStart || iInput > iEnd)
301 std::bitset<128> refHitsBits = aInput.
getRefHits(iProcessor);
302 if (refHitsBits.none())
305 std::ostringstream myStr;
306 myStr <<
"iProcessor: " << iProcessor << std::endl;
307 myStr <<
"Input: ------------" << std::endl;
308 myStr << aInput << std::endl;
313 if (layerHits.empty())
317 if (!refHitsBits[iRefHit])
321 unsigned int iRegion = aRefHitDef.
iRegion;
325 for (
auto itGP :
theGPs) {
328 if (itGP.first.thePtCode != iPt)
330 itGP.second->addCount(aRefHitDef.
iRefLayer, iLayer, phiRef, restrictedLayerHits);
void fillCounts(unsigned int iProcessor, const OMTFinput &aInput, const SimTrack *aSimMuon)
std::vector< OMTFProcessor::resultsMap > myResults
const l1t::LUT * chargeLUT() const
Golden Patterns definitions.
std::vector< int > vector1D
unsigned int nrBitsData() const
bool addGP(GoldenPattern *aGP)
void averagePatterns(int charge)
unsigned int iInput
Hit input number within a cone.
const std::vector< std::vector< RefHitDef > > & getRefHitsDefs() const
std::pair< int, bool > layerResult
const std::map< Key, GoldenPattern * > & getPatterns() const
Return map of GoldenPatterns.
std::map< Key, OMTFResult > resultsMap
unsigned int nGoldenPatterns() const
const math::XYZTLorentzVectorD & momentum() const
unsigned int nRefHits() const
int type() const
particle type (HEP PDT convension)
int pdfValue(unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin) const
const vector3D_pair & getConnections() const
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
const vector2D & getMeanDistPhi() const
unsigned int nPhiBins() const
std::vector< vector1D > vector2D
std::vector< vector2D > vector3D
void setPdf(const vector3D &aPdf)
unsigned int nPdfAddrBits() const
void configure(const OMTFConfiguration *omtfConfig)
int data(unsigned int address) const
void shiftGP(GoldenPattern *aGP, const GoldenPattern::vector2D &meanDistPhiNew, const GoldenPattern::vector2D &meanDistPhiOld)
const std::vector< OMTFProcessor::resultsMap > & processInput(unsigned int iProcessor, const OMTFinput &aInput)
const l1t::LUT * pdfLUT() const
Abs< T >::type abs(const T &t)
unsigned int nLayers() const
const std::vector< int > & getRefToLogicNumber() const
OMTFinput::vector1D restrictInput(unsigned int iProcessor, unsigned int iCone, unsigned int iLayer, const OMTFinput::vector1D &layerHits)
static double ptFromIpt(const int ipt)
unsigned int nRefLayers() const
unsigned int nTestRefHits() const
Log< level::Info, false > LogInfo
const std::set< int > & getBendingLayers() const
const ap_uint< BITSPT > ptLUT[1858]
bool configure(const OMTFConfiguration *omtfParams, const L1TMuonOverlapParams *omtfPatterns)
Fill GP map with patterns from CondFormats object.
const OMTFConfiguration * myOmtfConfig
void resetConfiguration()
Reset all configuration parameters.
const vector3D & getPdf() const
void setMeanDistPhi(const vector2D &aMeanDistPhi)
unsigned int iRefLayer
Reference layer logic number (0-7)
const l1t::LUT * meanDistPhiLUT() const
unsigned int iRegion
Region number assigned to this referecne hit.
const l1t::LUT * ptLUT() const
static int iptFromPt(const double pt)
const l1t::LUT * etaLUT() const