24 for(
auto it:
theGPs)
delete it.second;
52 unsigned int address = 0;
53 unsigned int iEta, iPt;
55 for(
unsigned int iGP=0;iGP<nGPs;++iGP){
57 iEta = etaLUT->
data(address);
58 iCharge = chargeLUT->
data(address)==0? -1:1;
59 iPt = ptLUT->
data(address);
70 meanDistPhi1D[iRefLayer] = meanDistPhiLUT->
data(address) - (1<<(meanDistPhiLUT->
nrBitsData() -1));
72 meanDistPhi2D[iLayer] = meanDistPhi1D;
80 pdf1D[iPdf] = pdfLUT->
data(address);
82 pdf2D[iRefLayer] = pdf1D;
84 pdf3D[iLayer] = pdf2D;
86 Key aKey(iEta,iPt,iCharge);
101 <<
"OMTFProcessor::addGP(...) "
102 <<
" Reading two Golden Patterns with the same key: "
103 <<aGP->
key()<<std::endl;
110 itRegion[aGP->
key()] = aResult;
119 Key aKey(0, 9, charge);
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);
195 indexShift = meanDistPhiOld[iLayer][iRefLayer] - meanDistPhiNew[iLayer][iRefLayer];
196 for(
unsigned int iPdfBin=0;iPdfBin<nPdfBins;++iPdfBin) 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 & itRegion:
myResults)
for(
auto & itKey: itRegion) itKey.second.clear();
217 std::bitset<128> refHitsBits = aInput.
getRefHits(iProcessor);
218 if(refHitsBits.none())
return myResults;
222 if(!layerHits.size())
continue;
226 if(!refHitsBits[iRefHit])
continue;
227 if(nTestedRefHits--==0)
break;
232 unsigned int iRegion = aRefHitDef.
iRegion;
239 restrictedLayerHits);
240 int phiRefSt2 = itGP.second->propagateRefPhi(phiRef, etaRef, aRefHitDef.
iRefLayer);
250 for(
auto & itRefHit: myResults)
for(
auto & itKey: itRefHit) itKey.second.finalise();
252 std::ostringstream myStr;
253 myStr<<
"iProcessor: "<<iProcessor<<std::endl;
254 myStr<<
"Input: ------------"<<std::endl;
255 myStr<<aInput<<std::endl;
263 unsigned int iRegion,
272 for(
unsigned int iInput=0;iInput<14;++iInput){
283 int theCharge =
abs(aSimMuon->
type()) == 13 ? -1 : 1;
288 if(iPt>31) iPt=200*2+1;
293 std::bitset<128> refHitsBits = aInput.
getRefHits(iProcessor);
294 if(refHitsBits.none())
return;
296 std::ostringstream myStr;
297 myStr<<
"iProcessor: "<<iProcessor<<std::endl;
298 myStr<<
"Input: ------------"<<std::endl;
299 myStr<<aInput<<std::endl;
304 if(!layerHits.size())
continue;
307 if(!refHitsBits[iRefHit])
continue;
310 unsigned int iRegion = aRefHitDef.
iRegion;
314 if(itGP.first.theCharge!=theCharge)
continue;
315 if(itGP.first.thePtCode!=iPt)
continue;
316 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