105 std::vector<SiCellId> &neighbours)
const
114 neighbours.reserve(8);
123 int phiM = phiIndex-1;
124 int phiP = phiIndex+1;
125 int etaM = etaIndex-1;
126 int etaP = etaIndex+1;
129 if (phiM >= 0) neighbours.emplace_back(phiM,etaIndex);
131 if (phiM >= 0 && etaM >= 0) neighbours.emplace_back(phiM,etaM);
133 if (etaM >= 0) neighbours.emplace_back(phiIndex,etaM);
135 if (phiP <
phiDiodes() && etaM >= 0) neighbours.emplace_back(phiP,etaM);
137 if (phiP <
phiDiodes()) neighbours.emplace_back(phiP,etaIndex);
139 if (phiM >= 0 && etaP <
etaDiodes()) neighbours.emplace_back(phiM,etaP);
141 if (etaP <
etaDiodes()) neighbours.emplace_back(phiIndex,etaP);
150 std::vector<SiCellId> &neighbours)
const
156 const double ¢erColumn=diodeCenter.
xColumn();
157 const double ¢erRow=diodeCenter.
xRow();
158 const double halfSizeColumn=diodeSize.
xColumn()/2;
159 const double halfSizeRow=diodeSize.
xRow()/2;
162 const double epsilon=0.01;
165 const double left1=centerColumn-halfSizeColumn*(1+epsilon);
166 const double right1=centerColumn+halfSizeColumn*(1+epsilon);
167 const double left2=centerColumn-halfSizeColumn*(1-epsilon);
168 const double right2=centerColumn+halfSizeColumn*(1-epsilon);
169 const double top1=centerRow+halfSizeRow*(1+epsilon);
170 const double bot1=centerRow-halfSizeRow*(1+epsilon);
171 const double top2=centerRow+halfSizeRow*(1-epsilon);
172 const double bot2=centerRow-halfSizeRow*(1-epsilon);
175 std::vector<SiLocalPosition> positions;
176 positions.reserve(12);
178 position.
xRow(bot1); position.
xColumn(left2); positions.push_back(position);
179 position.
xRow(bot1); position.
xColumn(left1); positions.push_back(position);
180 position.
xRow(bot2); position.
xColumn(left1); positions.push_back(position);
181 position.
xRow(top2); position.
xColumn(left1); positions.push_back(position);
182 position.
xRow(top1); position.
xColumn(left1); positions.push_back(position);
183 position.
xRow(top1); position.
xColumn(left2); positions.push_back(position);
184 position.
xRow(bot1); position.
xColumn(right2); positions.push_back(position);
185 position.
xRow(bot1); position.
xColumn(right1); positions.push_back(position);
186 position.
xRow(bot2); position.
xColumn(right1); positions.push_back(position);
187 position.
xRow(top2); position.
xColumn(right1); positions.push_back(position);
188 position.
xRow(top1); position.
xColumn(right1); positions.push_back(position);
189 position.
xRow(top1); position.
xColumn(right2); positions.push_back(position);
192 neighbours.reserve(8);
195 for(
const auto & position : positions) {
203 std::vector<SiCellId>::const_iterator foundIter
204 = std::find(neighbours.begin(), neighbours.end(), cellId_neighb );
207 if (foundIter == neighbours.end()) neighbours.push_back(cellId_neighb);
static double intersectionLength1D(const double x1, const double dx1, const double x2, const double dx2)
Compute the intersection length along one direction: return 0 if no intersection x1,...