49 unsigned int address = 0;
50 unsigned int iEta, iPt;
52 for (
unsigned int iGP = 0; iGP < nGPs; ++iGP) {
55 iCharge = chargeLUT->
data(address) == 0 ? -1 : 1;
56 iPt =
ptLUT->data(address);
68 meanDistPhi1D[iRefLayer] = meanDistPhiLUT->
data(address) - (1 << (meanDistPhiLUT->
nrBitsData() - 1));
70 meanDistPhi2D[iLayer] = meanDistPhi1D;
78 pdf1D[iPdf] = pdfLUT->
data(address);
80 pdf2D[iRefLayer] = pdf1D;
82 pdf3D[iLayer] = pdf2D;
84 Key aKey(
iEta, iPt, iCharge, iGP);
98 <<
"OMTFProcessor::addGP(...) " 99 <<
" Reading two Golden Patterns with the same key: " << aGP->
key() << std::endl;
106 itRegion[aGP->
key()] = aResult;
126 aGP2 =
theGPs.find(aKey)->second;
133 aGP3 =
theGPs.find(aKey)->second;
139 aGP4 =
theGPs.find(aKey)->second;
160 meanDistPhi[iLayer][iRefLayer] += meanDistPhi2[iLayer][iRefLayer];
161 meanDistPhi[iLayer][iRefLayer] += meanDistPhi3[iLayer][iRefLayer];
162 meanDistPhi[iLayer][iRefLayer] += meanDistPhi4[iLayer][iRefLayer];
163 meanDistPhi[iLayer][iRefLayer] /= 4;
170 shiftGP(aGP1, meanDistPhi, meanDistPhi1);
171 shiftGP(aGP2, meanDistPhi, meanDistPhi2);
172 if (aGP3 != aGP1 && aGP4 != aGP2) {
175 shiftGP(aGP3, meanDistPhi, meanDistPhi3);
176 shiftGP(aGP4, meanDistPhi, meanDistPhi4);
193 indexShift = meanDistPhiOld[iLayer][iRefLayer] - meanDistPhiNew[iLayer][iRefLayer];
194 for (
unsigned int iPdfBin = 0; iPdfBin < nPdfBins; ++iPdfBin)
195 pdfAllRef[iLayer][iRefLayer][iPdfBin] = 0;
196 for (
unsigned int iPdfBin = 0; iPdfBin < nPdfBins; ++iPdfBin) {
197 if ((
int)(iPdfBin) + indexShift >= 0 && iPdfBin + indexShift < nPdfBins)
198 pdfAllRef[iLayer][iRefLayer][iPdfBin + indexShift] = aGP->
pdfValue(iLayer, iRefLayer, iPdfBin);
212 for (
auto &itKey : itRegion)
213 itKey.second.clear();
217 std::bitset<128> refHitsBits = aInput.
getRefHits(iProcessor);
218 if (refHitsBits.none())
223 if (layerHits.empty())
228 if (!refHitsBits[iRefHit])
230 if (nTestedRefHits-- == 0)
237 unsigned int iRegion = aRefHitDef.
iRegion;
242 for (
auto itGP :
theGPs) {
244 itGP.second->process1Layer1RefLayer(aRefHitDef.
iRefLayer, iLayer, phiRef, restrictedLayerHits);
245 int phiRefSt2 = itGP.second->propagateRefPhi(phiRef, etaRef, aRefHitDef.
iRefLayer);
249 aRefHitDef.
iRefLayer, iLayer, aLayerResult.first, phiRefSt2, etaRef);
256 for (
auto &itKey : itRefHit)
257 itKey.second.finalise();
259 std::ostringstream myStr;
260 myStr <<
"iProcessor: " << iProcessor << std::endl;
261 myStr <<
"Input: ------------" << std::endl;
262 myStr << aInput << std::endl;
270 unsigned int iRegion,
278 for (
unsigned int iInput = 0; iInput < 14; ++iInput) {
279 if (iInput < iStart || iInput > iEnd)
300 std::bitset<128> refHitsBits = aInput.
getRefHits(iProcessor);
301 if (refHitsBits.none())
304 std::ostringstream myStr;
305 myStr <<
"iProcessor: " << iProcessor << std::endl;
306 myStr <<
"Input: ------------" << std::endl;
307 myStr << aInput << std::endl;
312 if (layerHits.empty())
316 if (!refHitsBits[iRefHit])
320 unsigned int iRegion = aRefHitDef.
iRegion;
324 for (
auto itGP :
theGPs) {
327 if (itGP.first.thePtCode != iPt)
329 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.
const ap_uint< BITSPT > ptLUT[2251]
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
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
if(threadIdxLocalY==0 &&threadIdxLocalX==0)