50 unsigned int address = 0;
51 unsigned int iEta, iPt;
53 for (
unsigned int iGP = 0; iGP < nGPs; ++iGP) {
55 iEta = etaLUT->
data(address);
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;
115 Key aKey(0, 9, charge);
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);
256 for (
auto &itRefHit : myResults)
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)
288 int theCharge = (
abs(aSimMuon->
type()) == 13) ? aSimMuon->
type() / -13 : 0;
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) {
326 if (itGP.first.theCharge != theCharge)
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)
const std::set< int > & getBendingLayers() const
std::vector< OMTFProcessor::resultsMap > myResults
unsigned int nRefLayers() const
unsigned int nRefHits() const
std::vector< int > vector1D
bool addGP(GoldenPattern *aGP)
const vector2D & getMeanDistPhi() const
unsigned int nLayers() const
unsigned int nPhiBins() const
void averagePatterns(int charge)
unsigned int iInput
Hit input number within a cone.
std::pair< int, bool > layerResult
std::map< Key, OMTFResult > resultsMap
const l1t::LUT * chargeLUT() const
Golden Patterns definitions.
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
unsigned int nrBitsData() const
std::vector< vector1D > vector2D
std::vector< vector2D > vector3D
const vector3D_pair & getConnections() const
void setPdf(const vector3D &aPdf)
unsigned int nPdfAddrBits() const
const std::vector< std::vector< RefHitDef > > & getRefHitsDefs() const
void configure(const OMTFConfiguration *omtfConfig)
if(conf_.getParameter< bool >("UseStripCablingDB"))
void shiftGP(GoldenPattern *aGP, const GoldenPattern::vector2D &meanDistPhiNew, const GoldenPattern::vector2D &meanDistPhiOld)
const std::vector< OMTFProcessor::resultsMap > & processInput(unsigned int iProcessor, const OMTFinput &aInput)
Abs< T >::type abs(const T &t)
OMTFinput::vector1D restrictInput(unsigned int iProcessor, unsigned int iCone, unsigned int iLayer, const OMTFinput::vector1D &layerHits)
static double ptFromIpt(const int ipt)
const l1t::LUT * etaLUT() const
Log< level::Info, false > LogInfo
unsigned int nGoldenPatterns() const
const l1t::LUT * pdfLUT() const
const std::map< Key, GoldenPattern * > & getPatterns() const
Return map of GoldenPatterns.
int pdfValue(unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin) const
const std::vector< int > & getRefToLogicNumber() const
bool configure(const OMTFConfiguration *omtfParams, const L1TMuonOverlapParams *omtfPatterns)
Fill GP map with patterns from CondFormats object.
const l1t::LUT * ptLUT() const
int type() const
particle type (HEP PDT convension)
const OMTFConfiguration * myOmtfConfig
void resetConfiguration()
Reset all configuration parameters.
const math::XYZTLorentzVectorD & momentum() const
void setMeanDistPhi(const vector2D &aMeanDistPhi)
unsigned int iRefLayer
Reference layer logic number (0-7)
int data(unsigned int address) const
unsigned int iRegion
Region number assigned to this referecne hit.
static int iptFromPt(const double pt)
const l1t::LUT * meanDistPhiLUT() const
unsigned int nTestRefHits() const
const vector3D & getPdf() const