24 for(
auto itHit: layerHits){
26 if(
abs(itHit-phiMean-phiRefHit)<
abs(phiDist)) phiDist = itHit-phiMean-phiRefHit;
39 int pdfVal =
pdfAllRef[iLayer][iRefLayer][phiDist];
46 unsigned int iLayer = 2;
60 for(
auto itHit: layerHits){
62 if(
abs(itHit-phiRefHit)<phiDist) phiDist = itHit-phiRefHit;
66 if(nHitsInLayer>1 || nHitsInLayer==0)
return;
84 ++
pdfAllRef[iLayer][iRefLayer][phiDistShift];
90 out <<
"GoldenPattern "<< aPattern.
theKey <<std::endl;
91 out <<
"Number of reference layers: "<<aPattern.
meanDistPhi[0].size()
92 <<
", number of measurement layers: "<<aPattern.
pdfAllRef.size()
96 if(!aPattern.
pdfAllRef.size())
return out;
98 out<<
"Mean dist phi per layer:"<<std::endl;
99 for (
unsigned int iRefLayer=0;iRefLayer<aPattern.
meanDistPhi[0].size();++iRefLayer){
100 out<<
"Ref layer: "<<iRefLayer<<
" (";
101 for (
unsigned int iLayer=0;iLayer<aPattern.
meanDistPhi.size();++iLayer){
102 out<<std::setw(3)<<aPattern.
meanDistPhi[iLayer][iRefLayer]<<
"\t";
108 out<<
"Counts number per layer:"<<std::endl;
109 for (
unsigned int iRefLayer=0;iRefLayer<aPattern.
meanDistPhi[0].size();++iRefLayer){
110 out<<
"Ref layer: "<<iRefLayer<<
" (";
111 for (
unsigned int iLayer=0;iLayer<aPattern.
meanDistPhi.size();++iLayer){
153 for (
unsigned int iRefLayer=0;iRefLayer<
pdfAllRef[0].size();++iRefLayer){
154 for (
unsigned int iLayer=0;iLayer<
pdfAllRef.size();++iLayer){
155 for (
unsigned int iPdf=0;iPdf<
pdfAllRef[iLayer][iRefLayer].size();++iPdf){
165 for (
unsigned int iRefLayer=0;iRefLayer<
meanDistPhi[0].size();++iRefLayer){
166 for (
unsigned int iLayer=0;iLayer<
meanDistPhi.size();++iLayer){
177 int digitisedVal, truncatedValue;
178 for (
unsigned int iRefLayer=0;iRefLayer<
pdfAllRef[0].size();++iRefLayer){
179 for (
unsigned int iLayer=0;iLayer<
pdfAllRef.size();++iLayer){
180 for (
unsigned int iPdf=0;iPdf<
pdfAllRef[iLayer][iRefLayer].size();++iPdf){
182 !
pdfAllRef[iLayer][iRefLayer][iPdf])
continue;
192 digitisedVal = rint((
std::pow(2,nPdfValBits)-1) - (pVal/minPlog)*(
std::pow(2,nPdfValBits)-1));
194 truncatedValue = 0 | (digitisedVal & ((int)
pow(2,nPdfValBits)-1));
195 pdfAllRef[iLayer][iRefLayer][iPdf] = truncatedValue;
203 const unsigned int nPdfAddrBits = 7;
204 for (
unsigned int iRefLayer=0;iRefLayer<
pdfAllRef[0].size();++iRefLayer){
205 for (
unsigned int iLayer=0;iLayer<
pdfAllRef.size();++iLayer){
206 for (
unsigned int iPdf=0;iPdf<
pdfAllRef[iLayer][iRefLayer].size();++iPdf){
210 if(index<0 || index>exp2(nPdfAddrBits)-1)
continue;
211 pdfAllRef[iLayer][iRefLayer][
index] = pdfAllRefTmp[iLayer][iRefLayer][iPdf];
220 for (
unsigned int iRefLayer=0;iRefLayer<
meanDistPhi[0].size();++iRefLayer){
221 for (
unsigned int iLayer=0;iLayer<
meanDistPhi.size();++iLayer){
unsigned int nRefLayers() const
vector2D meanDistPhiCounts
std::vector< int > vector1D
unsigned int nLayers() const
unsigned int nPhiBins() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
const OMTFConfiguration * myOmtfConfig
bool hasCounts()
Check if the GP has any counts in any of referecne layers;.
GoldenPattern::layerResult process1Layer1RefLayer(unsigned int iRefLayer, unsigned int iLayer, const int refPhi, const OMTFinput::vector1D &layerHits)
std::vector< vector1D > vector2D
std::vector< vector2D > vector3D
Key theKey
Pattern kinematical identification (iEta,iPt,iCharge)
unsigned int nPdfAddrBits() const
Abs< T >::type abs(const T &t)
std::pair< int, bool > layerResult
void reset()
Reset contents of all data vectors, keeping the vectors size.
int propagateRefPhi(int phiRef, int etaRef, unsigned int iRefLayer)
const std::vector< int > & getRefToLogicNumber() const
void addCount(unsigned int iRefLayer, unsigned int iLayer, const int refPhi, const OMTFinput::vector1D &layerHits)
Add a single count to the relevant pdf bin in three dimensions.
unsigned int nPdfValBits() const
Power< A, B >::type pow(const A &a, const B &b)