24 for(
auto it:
theGPs)
delete it.second;
32 for(
auto it:
theGPs)
delete it.second;
53 unsigned int address = 0;
54 unsigned int iEta, iPt;
56 for(
unsigned int iGP=0;iGP<nGPs;++iGP){
58 iEta = etaLUT->
data(address);
59 iCharge = chargeLUT->
data(address)==0? -1:1;
60 iPt = ptLUT->
data(address);
71 meanDistPhi1D[iRefLayer] = meanDistPhiLUT->
data(address) - (1<<(meanDistPhiLUT->
nrBitsData() -1));
73 meanDistPhi2D[iLayer] = meanDistPhi1D;
81 pdf1D[iPdf] = pdfLUT->
data(address);
83 pdf2D[iRefLayer] = pdf1D;
85 pdf3D[iLayer] = pdf2D;
87 Key aKey(iEta,iPt,iCharge,iGP);
102 <<
"OMTFProcessor::addGP(...) " 103 <<
" Reading two Golden Patterns with the same key: " 104 <<aGP->
key()<<std::endl;
111 itRegion[aGP->
key()] = aResult;
120 Key aKey(0, 9, charge);
162 meanDistPhi[iLayer][iRefLayer]+=meanDistPhi2[iLayer][iRefLayer];
163 meanDistPhi[iLayer][iRefLayer]+=meanDistPhi3[iLayer][iRefLayer];
164 meanDistPhi[iLayer][iRefLayer]+=meanDistPhi4[iLayer][iRefLayer];
165 meanDistPhi[iLayer][iRefLayer]/=4;
172 shiftGP(aGP1,meanDistPhi, meanDistPhi1);
173 shiftGP(aGP2,meanDistPhi, meanDistPhi2);
174 if(aGP3!=aGP1 && aGP4!=aGP2){
177 shiftGP(aGP3,meanDistPhi, meanDistPhi3);
178 shiftGP(aGP4,meanDistPhi, meanDistPhi4);
196 indexShift = meanDistPhiOld[iLayer][iRefLayer] - meanDistPhiNew[iLayer][iRefLayer];
197 for(
unsigned int iPdfBin=0;iPdfBin<nPdfBins;++iPdfBin) pdfAllRef[iLayer][iRefLayer][iPdfBin] = 0;
198 for(
unsigned int iPdfBin=0;iPdfBin<nPdfBins;++iPdfBin){
199 if((
int)(iPdfBin)+indexShift>=0 && iPdfBin+indexShift<nPdfBins)
200 pdfAllRef[iLayer][iRefLayer][iPdfBin+indexShift] = aGP->
pdfValue(iLayer, iRefLayer, iPdfBin);
214 for(
auto & itRegion:
myResults)
for(
auto & itKey: itRegion) itKey.second.clear();
218 std::bitset<128> refHitsBits = aInput.
getRefHits(iProcessor);
219 if(refHitsBits.none())
return myResults;
223 if(!layerHits.size())
continue;
227 if(!refHitsBits[iRefHit])
continue;
228 if(nTestedRefHits--==0)
break;
233 unsigned int iRegion = aRefHitDef.
iRegion;
240 restrictedLayerHits);
241 int phiRefSt2 = itGP.second->propagateRefPhi(phiRef, etaRef, aRefHitDef.
iRefLayer);
251 for(
auto & itRefHit: myResults)
for(
auto & itKey: itRefHit) itKey.second.finalise();
253 std::ostringstream myStr;
254 myStr<<
"iProcessor: "<<iProcessor<<std::endl;
255 myStr<<
"Input: ------------"<<std::endl;
256 myStr<<aInput<<std::endl;
265 unsigned int iRegion,
274 for(
unsigned int iInput=0;iInput<14;++iInput){
290 if(iPt>31) iPt=200*2+1;
295 std::bitset<128> refHitsBits = aInput.
getRefHits(iProcessor);
296 if(refHitsBits.none())
return;
298 std::ostringstream myStr;
299 myStr<<
"iProcessor: "<<iProcessor<<std::endl;
300 myStr<<
"Input: ------------"<<std::endl;
301 myStr<<aInput<<std::endl;
306 if(!layerHits.size())
continue;
309 if(!refHitsBits[iRefHit])
continue;
312 unsigned int iRegion = aRefHitDef.
iRegion;
316 if(itGP.first.theCharge!=theCharge)
continue;
317 if(itGP.first.thePtCode!=iPt)
continue;
318 itGP.second->addCount(aRefHitDef.
iRefLayer,iLayer,phiRef,restrictedLayerHits);
const std::set< int > & getBendingLayers() const
void fillCounts(unsigned int iProcessor, const OMTFinput &aInput, const SimTrack *aSimMuon)
void averagePatterns(int charge)
unsigned int nRefLayers() const
unsigned int nRefHits() const
bool configure(const OMTFConfiguration *omtfParams, const L1TMuonOverlapParams *omtfPatterns)
Fill GP map with patterns from CondFormats object.
const OMTFConfiguration * myOmtfConfig
std::vector< int > vector1D
const vector2D & getMeanDistPhi() const
unsigned int nLayers() const
unsigned int nPhiBins() const
unsigned int iInput
Hit input number within a cone.
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
std::map< Key, OMTFResult > resultsMap
const l1t::LUT * chargeLUT() const
Golden Patterns definitions.
bool addGP(GoldenPattern *aGP)
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)
Abs< T >::type abs(const T &t)
std::pair< int, bool > layerResult
static double ptFromIpt(const int ipt)
void resetConfiguration()
Reset all configuration parameters.
const l1t::LUT * etaLUT() const
unsigned int nGoldenPatterns() const
const l1t::LUT * pdfLUT() const
OMTFinput::vector1D restrictInput(unsigned int iProcessor, unsigned int iCone, unsigned int iLayer, const OMTFinput::vector1D &layerHits)
int pdfValue(unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin) const
void shiftGP(GoldenPattern *aGP, const GoldenPattern::vector2D &meanDistPhiNew, const GoldenPattern::vector2D &meanDistPhiOld)
const std::vector< int > & getRefToLogicNumber() const
const l1t::LUT * ptLUT() const
int type() const
particle type (HEP PDT convension)
const math::XYZTLorentzVectorD & momentum() const
void setMeanDistPhi(const vector2D &aMeanDistPhi)
unsigned int iRefLayer
Reference layer logic number (0-7)
const std::vector< OMTFProcessor::resultsMap > & processInput(unsigned int iProcessor, const OMTFinput &aInput)
int data(unsigned int address) const
unsigned int iRegion
Region number assigned to this referecne hit.
static int iptFromPt(const double pt)
const std::map< Key, GoldenPattern * > & getPatterns() const
Return map of GoldenPatterns.
const l1t::LUT * meanDistPhiLUT() const
std::vector< OMTFProcessor::resultsMap > myResults
unsigned int nTestRefHits() const
const vector3D & getPdf() const