24 for(
auto itHit: layerHits){
26 if(
abs(itHit-phiMean-phiRefHit)<
abs(phiDist)) phiDist = itHit-phiMean-phiRefHit;
40 int pdfVal =
pdfAllRef[iLayer][iRefLayer][phiDist];
47 unsigned int iLayer = 2;
62 for(
auto itHit: layerHits){
64 if(
abs(itHit-phiRefHit)<phiDist) phiDist = itHit-phiRefHit;
68 if(nHitsInLayer>1 || nHitsInLayer==0)
return;
85 ++
pdfAllRef[iLayer][iRefLayer][phiDistShift];
91 out <<
"GoldenPattern "<< aPattern.
theKey <<std::endl;
92 out <<
"Number of reference layers: "<<aPattern.
meanDistPhi[0].size()
93 <<
", number of measurement layers: "<<aPattern.
pdfAllRef.size()
97 if(!aPattern.
pdfAllRef.size())
return out;
99 out<<
"Mean dist phi per layer:"<<std::endl;
100 for (
unsigned int iRefLayer=0;iRefLayer<aPattern.
meanDistPhi[0].size();++iRefLayer){
101 out<<
"Ref layer: "<<iRefLayer<<
" (";
102 for (
unsigned int iLayer=0;iLayer<aPattern.
meanDistPhi.size();++iLayer){
103 out<<std::setw(3)<<aPattern.
meanDistPhi[iLayer][iRefLayer]<<
"\t";
109 out<<
"Counts number per layer:"<<std::endl;
110 for (
unsigned int iRefLayer=0;iRefLayer<aPattern.
meanDistPhi[0].size();++iRefLayer){
111 out<<
"Ref layer: "<<iRefLayer<<
" (";
112 for (
unsigned int iLayer=0;iLayer<aPattern.
meanDistPhi.size();++iLayer){
155 for (
unsigned int iRefLayer=0;iRefLayer<
pdfAllRef[0].size();++iRefLayer){
156 for (
unsigned int iLayer=0;iLayer<
pdfAllRef.size();++iLayer){
157 for (
unsigned int iPdf=0;iPdf<
pdfAllRef[iLayer][iRefLayer].size();++iPdf){
167 for (
unsigned int iRefLayer=0;iRefLayer<
meanDistPhi[0].size();++iRefLayer){
168 for (
unsigned int iLayer=0;iLayer<
meanDistPhi.size();++iLayer){
180 int digitisedVal, truncatedValue;
181 for (
unsigned int iRefLayer=0;iRefLayer<
pdfAllRef[0].size();++iRefLayer){
182 for (
unsigned int iLayer=0;iLayer<
pdfAllRef.size();++iLayer){
183 for (
unsigned int iPdf=0;iPdf<
pdfAllRef[iLayer][iRefLayer].size();++iPdf){
185 !
pdfAllRef[iLayer][iRefLayer][iPdf])
continue;
195 digitisedVal = rint((
std::pow(2,nPdfValBits)-1) - (pVal/minPlog)*(
std::pow(2,nPdfValBits)-1));
197 truncatedValue = 0 | (digitisedVal & ((int)
pow(2,nPdfValBits)-1));
198 pdfAllRef[iLayer][iRefLayer][iPdf] = truncatedValue;
206 const unsigned int nPdfAddrBits = 7;
207 for (
unsigned int iRefLayer=0;iRefLayer<
pdfAllRef[0].size();++iRefLayer){
208 for (
unsigned int iLayer=0;iLayer<
pdfAllRef.size();++iLayer){
209 for (
unsigned int iPdf=0;iPdf<
pdfAllRef[iLayer][iRefLayer].size();++iPdf){
213 if(index<0 || index>exp2(nPdfAddrBits)-1)
continue;
214 pdfAllRef[iLayer][iRefLayer][
index] = pdfAllRefTmp[iLayer][iRefLayer][iPdf];
223 for (
unsigned int iRefLayer=0;iRefLayer<
meanDistPhi[0].size();++iRefLayer){
224 for (
unsigned int iLayer=0;iLayer<
meanDistPhi.size();++iLayer){
static unsigned int nLayers
vector2D meanDistPhiCounts
std::vector< int > vector1D
std::ostream & operator<<(std::ostream &out, const ALILine &li)
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)
static unsigned int nPdfAddrBits
std::vector< vector1D > vector2D
std::vector< vector2D > vector3D
Key theKey
Pattern kinematical identification (iEta,iPt,iCharge)
Abs< T >::type abs(const T &t)
static unsigned int nPhiBins
std::pair< int, bool > layerResult
static std::vector< int > refToLogicNumber
void reset()
Reset contents of all data vectors, keeping the vectors size.
static unsigned int nRefLayers
int propagateRefPhi(int phiRef, int etaRef, unsigned int iRefLayer)
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.
Power< A, B >::type pow(const A &a, const B &b)
static unsigned int nPdfValBits