208 {
209
212
213
214 const InDetDD::PixelModuleDesign* design = (
dynamic_cast<const InDetDD::PixelModuleDesign*
>(&element->
design()));
215 if (not design){
216 throw std::runtime_error( "Dynamic cast failed for design in ClusterMakerTool.cxx");
217 }
218 int rowMin = design->rows();
219 int rowMax = 0;
220 int colMin = design->columns();
221 int colMax = 0;
222 float qRowMin = 0; float qRowMax = 0;
223 float qColMin = 0; float qColMax = 0;
224 std::vector<float> chargeList;
225 int nRDO=rdoList.size();
226 if (calibData) {
227 chargeList.reserve(nRDO);
229 for (
int i=0;
i<nRDO;
i++) {
230 Identifier pixid=rdoList[
i];
232
235 std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx
238 InDetDD::PixelDiodeTree::DiodeProxy si_param ( design->diodeProxyFromIdx(diode_idx));
239 std::uint32_t feValue = design->getFE(si_param);
240 auto diode_type = design->getDiodeType(si_param);
242 && design->numberOfConnectedCells( design->readoutIdOfCell(InDetDD::SiCellId(diode_idx[0],diode_idx[1])))>1) {
244 }
245
248 charge = ToT/8.0*(8000.0-1200.0)+1200.0;
249 }
250 chargeList.push_back(
charge);
251 }
252 }
253
254 for (
int i=0;
i<nRDO;
i++) {
255 Identifier pixid=rdoList[
i];
257
259 if (calibData) {
charge=chargeList[
i]; }
260
261
264 if (row == rowMin) qRowMin +=
charge;
265 if (row < rowMin){
268 }
269
270 if (row == rowMax) qRowMax +=
charge;
271 if (row > rowMax){
274 }
275 if (col == colMin) qColMin +=
charge;
276 if (col < colMin){
277 colMin = col;
279 }
280
281 if (col == colMax) qColMax +=
charge;
282 if (col > colMax){
283 colMax = col;
285 }
286 }
287
288 Identifier newClusterID = pixelID.
pixel_id(pixelID.
wafer_id(clusterID),rowMin,colMin);
289
290
291 float omegax = -1;
292 float omegay = -1;
293 if(qRowMin+qRowMax > 0) omegax = qRowMax/
float(qRowMin+qRowMax);
294 if(qColMin+qColMax > 0) omegay = qColMax/
float(qColMin+qColMax);
295
297
298
301
303 double Ax[3] = {
T(0,0),
T(1,0),
T(2,0)};
304 double Ay[3] = {
T(0,1),
T(1,1),
T(2,1)};
305 double R [3] = {
T(0,3),
T(1,3),
T(2,3)};
306
308 Amg::Vector3D globalPos(M[0]*Ax[0]+M[1]*Ay[0]+R[0],M[0]*Ax[1]+M[1]*Ay[1]+R[1],M[0]*Ax[2]+M[1]*Ay[2]+R[2]);
309
310
312
314 errorMatrix.setIdentity();
315
316
317
318
319 double eta = std::abs(globalPos.eta());
320 double zPitch =
width.z()/colRow.y();
321
322 const AtlasDetectorID* aid = element->
getIdHelper();
323
325 throw std::runtime_error( "Wrong helper type in ClusterMakerTool.cxx.");
326 }
327 const PixelID*
pid =
static_cast<const PixelID*
>(aid);
328 int layer =
pid->layer_disk(clusterID);
330 switch (errorStrategy){
331 case 0:
332 errorMatrix.fillSymmetric(0,0,square(
width.phiR())*ONE_TWELFTH);
333 errorMatrix.fillSymmetric(1,1,square(
width.z())*ONE_TWELFTH);
334 break;
335 case 1:
336 errorMatrix.fillSymmetric(0,0,square(
width.phiR()/colRow.x())*ONE_TWELFTH);
337 errorMatrix.fillSymmetric(1,1,square(
width.z()/colRow.y())*ONE_TWELFTH);
338 break;
339 case 2:
340
341
342
343 if (!ganged && zPitch>399*micrometer && zPitch<401*micrometer) {
344 if (offlineCalibData) {
349 errorMatrix.fillSymmetric(0,0,
pow(phiError,2));
350 errorMatrix.fillSymmetric(1,1,
pow(etaError,2));
351 }
352 else {
356 errorMatrix.fillSymmetric(0,0,square(phiError));
357 errorMatrix.fillSymmetric(1,1,square(etaError));
358 }
359 }
360 }else{
361 errorMatrix.fillSymmetric(0,0,square(
width.phiR()/colRow.x())*ONE_TWELFTH);
362 errorMatrix.fillSymmetric(1,1,square(zPitch)*ONE_TWELFTH);
363 }
364 break;
365
366 case 10:
368 errorMatrix.fillSymmetric(1,1,square(
width.z()/colRow.y())*ONE_TWELFTH);
369 break;
370
371 default:
372 errorMatrix.fillSymmetric(0,0,square(
width.phiR()/colRow.x())*ONE_TWELFTH);
373 errorMatrix.fillSymmetric(1,1,square(
width.z()/colRow.y())*ONE_TWELFTH);
374 break;
375 }
376
377
378
379
380
381 static_assert(std::is_same_v<ClusterType, PixelCluster> ||
382 std::is_same_v<std::remove_pointer_t<ClusterType>,
384 "Not an InDet::PixelCluster or xAOD::PixelCluster");
385 if constexpr (std::is_same<ClusterType, InDet::PixelCluster>::value) {
386 return newInDetpixelCluster(newClusterID, locpos,
387 globalPos,
388 std::forward<IdentifierVec>(rdoList),
389 lvl1a,
390 std::forward<ToTList>(totList),
391 std::move(chargeList),
393 element,
394 std::move(errorMatrix),
395 omegax,
396 omegay,
398 splitProb1,
399 splitProb2);
400 } else{
401 return AddNewxAODpixelCluster(*cluster)(newClusterID,
402 locpos,
403 globalPos,
404 std::forward<IdentifierVec>(rdoList),
405 lvl1a,
406 std::forward<ToTList>(totList),
407 chargeList,
409 element,
410 errorMatrix,
412 splitProb1,
413 splitProb2);
414 }
415}
Scalar eta() const
pseudorapidity method
#define ATH_MSG_VERBOSE(x)
double charge(const T &p)
constexpr int pow(int base, int exp) noexcept
virtual HelperType helper() const
Type of helper, defaulted to 'Unimplemented'.
static constexpr std::array< PixelDiodeTree::CellIndexType, 2 > makeCellIndex(T local_x_idx, T local_y_idx)
Create a 2D cell index from the indices in local-x (phi, row) and local-y (eta, column) direction.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
const AtlasDetectorID * getIdHelper() const
Returns the id helper (inline)
Trk::Surface & surface()
Element Surface.
float getPixelEndcapRError(int ibin) const
float getPixelBarrelEtaError(int ibin) const
int getBarrelBin(double eta, int etaClusterSize, int phiClusterSize) const
int getEndcapBin(int etaClusterSize, int phiClusterSize) const
float getPixelEndcapPhiError(int ibin) const
float getPixelBarrelPhiError(int ibin) const
PixelClusterErrorData * getPixelClusterErrorData()
float getCharge(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float ToT) const
int eta_index(const Identifier &id) const
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Identifier pixel_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
int phi_index(const Identifier &id) const
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
phimod(flags, cells_name, *args, **kw)
float etaError(const U &p)
row
Appending html table to final .html summary file.
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.