202 {
203
206
207
208 const InDetDD::PixelModuleDesign* design = (
dynamic_cast<const InDetDD::PixelModuleDesign*
>(&element->
design()));
209 if (not design){
210 throw std::runtime_error( "Dynamic cast failed for design in ClusterMakerTool.cxx");
211 }
212 int rowMin = design->rows();
213 int rowMax = 0;
214 int colMin = design->columns();
215 int colMax = 0;
216 float qRowMin = 0; float qRowMax = 0;
217 float qColMin = 0; float qColMax = 0;
218 std::vector<float> chargeList;
219 int nRDO=rdoList.size();
220 if (calibData) {
221 chargeList.reserve(nRDO);
223 for (
int i=0;
i<nRDO;
i++) {
224 Identifier pixid=rdoList[
i];
226
229 std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx
232 InDetDD::PixelDiodeTree::DiodeProxy si_param ( design->diodeProxyFromIdx(diode_idx));
233 std::uint32_t feValue = design->getFE(si_param);
234 auto diode_type = design->getDiodeType(si_param);
236 && design->numberOfConnectedCells( design->readoutIdOfCell(InDetDD::SiCellId(diode_idx[0],diode_idx[1])))>1) {
238 }
239
242 charge = ToT/8.0*(8000.0-1200.0)+1200.0;
243 }
244 chargeList.push_back(
charge);
245 }
246 }
247
248 for (
int i=0;
i<nRDO;
i++) {
249 Identifier pixid=rdoList[
i];
251
253 if (calibData) {
charge=chargeList[
i]; }
254
255
258 if (row == rowMin) qRowMin +=
charge;
259 if (row < rowMin){
262 }
263
264 if (row == rowMax) qRowMax +=
charge;
265 if (row > rowMax){
268 }
269 if (col == colMin) qColMin +=
charge;
270 if (col < colMin){
271 colMin = col;
273 }
274
275 if (col == colMax) qColMax +=
charge;
276 if (col > colMax){
277 colMax = col;
279 }
280 }
281
282 Identifier newClusterID = pixelID.
pixel_id(pixelID.
wafer_id(clusterID),rowMin,colMin);
283
284
285 float omegax = -1;
286 float omegay = -1;
287 if(qRowMin+qRowMax > 0) omegax = qRowMax/
float(qRowMin+qRowMax);
288 if(qColMin+qColMax > 0) omegay = qColMax/
float(qColMin+qColMax);
289
291
292
295
297 double Ax[3] = {
T(0,0),
T(1,0),
T(2,0)};
298 double Ay[3] = {
T(0,1),
T(1,1),
T(2,1)};
299 double R [3] = {
T(0,3),
T(1,3),
T(2,3)};
300
302 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]);
303
304
306
308 errorMatrix.setIdentity();
309
310
311
312
313 double eta = std::abs(globalPos.eta());
314 double zPitch =
width.z()/colRow.y();
315
316 const AtlasDetectorID* aid = element->
getIdHelper();
317
319 throw std::runtime_error( "Wrong helper type in ClusterMakerTool.cxx.");
320 }
321 const PixelID*
pid =
static_cast<const PixelID*
>(aid);
322 int layer =
pid->layer_disk(clusterID);
324 switch (errorStrategy){
325 case 0:
326 errorMatrix.fillSymmetric(0,0,square(
width.phiR())*ONE_TWELFTH);
327 errorMatrix.fillSymmetric(1,1,square(
width.z())*ONE_TWELFTH);
328 break;
329 case 1:
330 errorMatrix.fillSymmetric(0,0,square(
width.phiR()/colRow.x())*ONE_TWELFTH);
331 errorMatrix.fillSymmetric(1,1,square(
width.z()/colRow.y())*ONE_TWELFTH);
332 break;
333 case 2:
334
335
336
337 if (!ganged && zPitch>399*micrometer && zPitch<401*micrometer) {
338 if (offlineCalibData) {
343 errorMatrix.fillSymmetric(0,0,
pow(phiError,2));
344 errorMatrix.fillSymmetric(1,1,
pow(etaError,2));
345 }
346 else {
350 errorMatrix.fillSymmetric(0,0,square(phiError));
351 errorMatrix.fillSymmetric(1,1,square(etaError));
352 }
353 }
354 }else{
355 errorMatrix.fillSymmetric(0,0,square(
width.phiR()/colRow.x())*ONE_TWELFTH);
356 errorMatrix.fillSymmetric(1,1,square(zPitch)*ONE_TWELFTH);
357 }
358 break;
359
360 case 10:
362 errorMatrix.fillSymmetric(1,1,square(
width.z()/colRow.y())*ONE_TWELFTH);
363 break;
364
365 default:
366 errorMatrix.fillSymmetric(0,0,square(
width.phiR()/colRow.x())*ONE_TWELFTH);
367 errorMatrix.fillSymmetric(1,1,square(
width.z()/colRow.y())*ONE_TWELFTH);
368 break;
369 }
370
371
372
373
374
375 static_assert(std::is_same_v<ClusterType, PixelCluster> ||
376 std::is_same_v<std::remove_pointer_t<ClusterType>,
378 "Not an InDet::PixelCluster or xAOD::PixelCluster");
379 if constexpr (std::is_same<ClusterType, InDet::PixelCluster>::value) {
380 return newInDetpixelCluster(newClusterID, locpos,
381 globalPos,
382 std::forward<IdentifierVec>(rdoList),
383 lvl1a,
384 std::forward<ToTList>(totList),
385 std::move(chargeList),
387 element,
388 std::move(errorMatrix),
389 omegax,
390 omegay,
392 splitProb1,
393 splitProb2);
394 } else{
395 return AddNewxAODpixelCluster(*cluster)(newClusterID,
396 locpos,
397 globalPos,
398 std::forward<IdentifierVec>(rdoList),
399 lvl1a,
400 std::forward<ToTList>(totList),
401 chargeList,
403 element,
404 errorMatrix,
406 splitProb1,
407 splitProb2);
408 }
409}
Scalar eta() const
pseudorapidity method
#define ATH_MSG_VERBOSE(x)
double charge(const T &p)
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.