ATLAS Offline Software
Classes | Public Member Functions | Private Types | List of all members
InDet::SCT_ClusteringTool Class Referencefinal

AlgTool for SCT_Clusterization. Input is from RDOs, assumed to be sorted. They are then scanned in order and neighbouring RDOs are grouped together. More...

#include <SCT_ClusteringTool.h>

Inheritance diagram for InDet::SCT_ClusteringTool:
Collaboration diagram for InDet::SCT_ClusteringTool:

Classes

struct  DimensionAndPosition
 In-class struct to store the centre and width of a cluster. More...
 

Public Member Functions

 SCT_ClusteringTool (const std::string &type, const std::string &name, const IInterface *parent)
 Normal constructor for an AlgTool; 'properties' are also declared here. More...
 
virtual StatusCode initialize () override
 Retrieve the necessary services in initialize. More...
 
virtual ~SCT_ClusteringTool ()=default
 Defaul destructor. More...
 
SCT_ClusterCollectionclusterize (const InDetRawDataCollection< SCT_RDORawData > &RDOs, const SCT_ID &idHelper, const InDet::SiDetectorElementStatus *sctDetElementStatus, SCTClusteringCache &cache, DataPool< SCT_Cluster > *dataItemsPool, const EventContext &ctx) const override
 Clusterize method the SCT RDOs. This method is the main one of this class. More...
 
SCT_ClusterCollectionfastClusterize (const InDetRawDataCollection< SCT_RDORawData > &RDOs, const SCT_ID &idHelper, const InDet::SiDetectorElementStatus *sctDetElementStatus, SCTClusteringCache &cache, DataPool< SCT_Cluster > *dataItemsPool, const EventContext &ctx) const
 A new fast method originally implemented for ITk. More...
 

Private Types

using IdVec_t = std::vector< Identifier >
 

Private Attributes

Tool Handles
ToolHandle< IInDetConditionsToolm_conditionsTool
 
ToolHandle< ClusterMakerToolm_clusterMaker
 
ToolHandle< ISiLorentzAngleToolm_lorentzAngleTool
 
Flags to configure SCT_ClusteringTool
IntegerProperty m_errorStrategy {this, "errorStrategy", 1}
 
BooleanProperty m_checkBadChannels {this, "checkBadChannels", true}
 
StringProperty m_timeBinStr {this, "timeBins", ""}
 
BooleanProperty m_innermostBarrelX1X {this, "innermostBarrelX1X", false}
 
BooleanProperty m_innertwoBarrelX1X {this, "innertwoBarrelX1X", false}
 
BooleanProperty m_majority01X {this, "majority01X", false}
 
BooleanProperty m_useRowInformation {this, "useRowInformation", false}
 
BooleanProperty m_doFastClustering {this, "doFastClustering", true}
 

ReadCondHandleKeys

SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollectionm_SCTDetEleCollKey
 
SG::ReadHandleKey< InDet::SiDetectorElementStatusm_sctDetElStatus
 Optional read handle to get status data to test whether a SCT detector element is good. More...
 
int m_timeBinBits [3] {-1, -1, -1}
 Time bin bits for timing requirement. More...
 
static void addStripsToCluster (const Identifier &firstStripId, unsigned int nStrips, IdVec_t &clusterVector, const SCT_ID &idHelper)
 Add strips to a cluster vector without checking for bad strips. More...
 
static DimensionAndPosition clusterDimensions (int firstStrip, int lastStrip, const InDetDD::SiDetectorElement *element, const SCT_ID &idHelper)
 Calculate the cluster position and width given the first and last strip numbers for this element. More...
 
static DimensionAndPosition clusterDimensionsInclRow (int firstStrip, int lastStrip, int row, const InDetDD::SiDetectorElement *element, const InDetDD::SCT_ModuleSideDesign *design)
 Calculate the cluster position and width given the first,last strip, and row numbers for this element for ITk. More...
 
void addStripsToClusterWithChecks (const Identifier &firstStripId, unsigned int nStrips, IdVec_t &clusterVector, std::vector< IdVec_t > &idGroups, const SCT_ID &idHelper, const InDet::SiDetectorElementStatus *det_el_status, const EventContext &ctx) const
 Add strips to a cluster vector checking for bad strips. More...
 
void addStripsToClusterInclRows (const Identifier &firstStripId, unsigned int nStrips, IdVec_t &clusterVector, std::vector< IdVec_t > &idGroups, const SCT_ID &idHelper, const InDet::SiDetectorElementStatus *det_el_status, const EventContext &ctx) const
 Add strips to a cluster vector including row variable for ITk. More...
 
IdVec_t recluster (IdVec_t &clusterVector, std::vector< IdVec_t > &idGroups) const
 Recluster the current vector, splitting on bad strips, and insert those new groups to the idGroups vector. More...
 
bool isBad (const InDet::SiDetectorElementStatus *sctDetElStatus, const SCT_ID &sctID, const IdentifierHash &waferHash, const Identifier &stripId, const EventContext &ctx) const
 In-class facade on the 'isGood' method for a strip identifier. More...
 
StatusCode decodeTimeBins ()
 Convert time bin string to array of 3 bits. More...
 
StatusCode decodeTimeBin (char timeBin, int &bit) const
 Convert a single time bin char to an int, bit is modified. More...
 

Test the clusters time bin to see if matches pattern

static bool testTimeBins01X (int timeBin)
 
static bool testTimeBinsX1X (int timeBin)
 
bool testTimeBins (int timeBin) const
 
bool testTimeBinsN (const std::bitset< 3 > &timePattern) const
 

Detailed Description

AlgTool for SCT_Clusterization. Input is from RDOs, assumed to be sorted. They are then scanned in order and neighbouring RDOs are grouped together.

Definition at line 47 of file SCT_ClusteringTool.h.

Member Typedef Documentation

◆ IdVec_t

using InDet::SCT_ClusteringTool::IdVec_t = std::vector<Identifier>
private

Definition at line 50 of file SCT_ClusteringTool.h.

Constructor & Destructor Documentation

◆ SCT_ClusteringTool()

InDet::SCT_ClusteringTool::SCT_ClusteringTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Normal constructor for an AlgTool; 'properties' are also declared here.

Definition at line 55 of file SCT_ClusteringTool.cxx.

55  :
56  base_class(type, name, parent)
57  {
58  }

◆ ~SCT_ClusteringTool()

virtual InDet::SCT_ClusteringTool::~SCT_ClusteringTool ( )
virtualdefault

Defaul destructor.

Member Function Documentation

◆ addStripsToCluster()

void InDet::SCT_ClusteringTool::addStripsToCluster ( const Identifier firstStripId,
unsigned int  nStrips,
IdVec_t clusterVector,
const SCT_ID idHelper 
)
staticprivate

Add strips to a cluster vector without checking for bad strips.

Definition at line 174 of file SCT_ClusteringTool.cxx.

175  {
176  const unsigned int firstStripNumber(idHelper.strip(firstStripId));
177  const unsigned int endStripNumber(firstStripNumber + nStrips); // one-past-the-end
178  const Identifier waferId(idHelper.wafer_id(firstStripId));
179  clusterVector.reserve(clusterVector.size() + nStrips);
180 
181  for (unsigned int stripNumber(firstStripNumber); stripNumber not_eq endStripNumber; ++stripNumber) {
182  const Identifier stripId(idHelper.strip_id(waferId, stripNumber));
183  clusterVector.push_back(stripId);
184  }
185  }

◆ addStripsToClusterInclRows()

void InDet::SCT_ClusteringTool::addStripsToClusterInclRows ( const Identifier firstStripId,
unsigned int  nStrips,
IdVec_t clusterVector,
std::vector< IdVec_t > &  idGroups,
const SCT_ID idHelper,
const InDet::SiDetectorElementStatus det_el_status,
const EventContext &  ctx 
) const
private

Add strips to a cluster vector including row variable for ITk.

Definition at line 233 of file SCT_ClusteringTool.cxx.

239  {
240 
241  const unsigned int firstStripNumber(idHelper.strip(firstStripId));
242  const unsigned int firstRowNumber(idHelper.row(firstStripId));
243  const unsigned int endStripNumber(firstStripNumber + nStrips); // one-past-the-end
244  const Identifier waferId(idHelper.wafer_id(firstStripId));
245  IdentifierHash waferHash( idHelper.wafer_hash(waferId) );
246 
247  clusterVector.reserve(clusterVector.size() + nStrips);
248  static const Identifier badId;
249  unsigned int nBadStrips(0);
250  for (unsigned int stripNumber(firstStripNumber); stripNumber not_eq endStripNumber; ++stripNumber) {
251  Identifier stripId(idHelper.strip_id(waferId, firstRowNumber, stripNumber));
252  if (isBad(det_el_status, idHelper, waferHash, stripId, ctx)) {
253  ++nBadStrips;
254  stripId = badId;
255  }
256  clusterVector.push_back(stripId);
257  }
258 
259  // Maybe all the strips are bad, clear the cluster vector
260  if (clusterVector.size() == nBadStrips) {
261  clusterVector.clear();
262  // No need to recluster if vector is empty (same true if empty for other reasons)
263  return;
264  }
265 
266  // Now we have one vector of stripIds, some of which may be 'bad'
267  if (nBadStrips != 0) {
268  clusterVector=recluster(clusterVector, idGroups);
269  // After this, the cluster vector is either empty or has the last good cluster
270  }
271  }

◆ addStripsToClusterWithChecks()

void InDet::SCT_ClusteringTool::addStripsToClusterWithChecks ( const Identifier firstStripId,
unsigned int  nStrips,
IdVec_t clusterVector,
std::vector< IdVec_t > &  idGroups,
const SCT_ID idHelper,
const InDet::SiDetectorElementStatus det_el_status,
const EventContext &  ctx 
) const
private

Add strips to a cluster vector checking for bad strips.

Beware of corner cases: what if all strips are bad? the vector is empty? What if the last strip is bad and contiguous with the next group which is coming? What if its good and contiguous, but there are also some bad?

Definition at line 192 of file SCT_ClusteringTool.cxx.

198  {
199 
200  const unsigned int firstStripNumber(idHelper.strip(firstStripId));
201  const unsigned int endStripNumber(firstStripNumber + nStrips); // one-past-the-end
202  const Identifier waferId(idHelper.wafer_id(firstStripId));
203  IdentifierHash waferHash( idHelper.wafer_hash(waferId) );
204 
205  clusterVector.reserve(clusterVector.size() + nStrips);
206 
207  static const Identifier badId;
208  unsigned int nBadStrips(0);
209  for (unsigned int stripNumber(firstStripNumber); stripNumber not_eq endStripNumber; ++stripNumber) {
210  Identifier stripId(idHelper.strip_id(waferId, stripNumber));
211  if (isBad(det_el_status, idHelper, waferHash, stripId, ctx)) {
212  ++nBadStrips;
213  stripId = badId;
214  }
215  clusterVector.push_back(stripId);
216  }
217 
218  // Maybe all the strips are bad, clear the cluster vector
219  if (clusterVector.size() == nBadStrips) {
220  clusterVector.clear();
221  // No need to recluster if vector is empty (same true if empty for other reasons)
222  return;
223  }
224 
225  // Now we have one vector of stripIds, some of which may be 'bad'
226  if (nBadStrips != 0) {
227 
228  clusterVector=recluster(clusterVector, idGroups);
229  // After this, the cluster vector is either empty or has the last good cluster
230  }
231  }

◆ clusterDimensions()

SCT_ClusteringTool::DimensionAndPosition InDet::SCT_ClusteringTool::clusterDimensions ( int  firstStrip,
int  lastStrip,
const InDetDD::SiDetectorElement element,
const SCT_ID idHelper 
)
staticprivate

Calculate the cluster position and width given the first and last strip numbers for this element.

Definition at line 765 of file SCT_ClusteringTool.cxx.

767  { //since a range check on strip numbers was removed, idHelper is no longer needed here
768  const int nStrips(lastStrip - firstStrip + 1);
769  // Consider strips before and after (in case nStrips=1), both are guaranteed
770  // to return sensible results, even for end strips
771  const InDetDD::SiCellId cell1(firstStrip - 1);
772  const InDetDD::SiCellId cell2(lastStrip + 1);
773  const InDetDD::SiLocalPosition firstStripPos(pElement->rawLocalPositionOfCell(cell1));
774  const InDetDD::SiLocalPosition lastStripPos(pElement->rawLocalPositionOfCell(cell2));
775  const double width((static_cast<double>(nStrips)/static_cast<double>(nStrips+1))*( lastStripPos.xPhi()-firstStripPos.xPhi()));
776  const InDetDD::SiLocalPosition centre((firstStripPos+lastStripPos)*0.5);
777  return SCT_ClusteringTool::DimensionAndPosition(centre, width);
778  }

◆ clusterDimensionsInclRow()

SCT_ClusteringTool::DimensionAndPosition InDet::SCT_ClusteringTool::clusterDimensionsInclRow ( int  firstStrip,
int  lastStrip,
int  row,
const InDetDD::SiDetectorElement element,
const InDetDD::SCT_ModuleSideDesign design 
)
staticprivate

Calculate the cluster position and width given the first,last strip, and row numbers for this element for ITk.

Definition at line 781 of file SCT_ClusteringTool.cxx.

782  {
783  const int nStrips(lastStrip - firstStrip + 1);
784  const int firstStrip1D = design->strip1Dim(firstStrip, row);
785  const int lastStrip1D = design->strip1Dim(lastStrip, row);
786  const double stripPitch = design->stripPitch();
787  const InDetDD::SiCellId cell1(firstStrip1D);
788  const InDetDD::SiCellId cell2(lastStrip1D);
789  const InDetDD::SiLocalPosition firstStripPos(pElement->rawLocalPositionOfCell(cell1));
790  const InDetDD::SiLocalPosition lastStripPos(pElement->rawLocalPositionOfCell(cell2));
791  const double width(nStrips*stripPitch);
792  const InDetDD::SiLocalPosition centre((firstStripPos+lastStripPos)*0.5);
793  return SCT_ClusteringTool::DimensionAndPosition(centre, width);
794  }

◆ clusterize()

SCT_ClusterCollection * InDet::SCT_ClusteringTool::clusterize ( const InDetRawDataCollection< SCT_RDORawData > &  RDOs,
const SCT_ID idHelper,
const InDet::SiDetectorElementStatus sctDetElementStatus,
SCTClusteringCache cache,
DataPool< SCT_Cluster > *  dataItemsPool,
const EventContext &  ctx 
) const
override

Clusterize method the SCT RDOs. This method is the main one of this class.

If clusters have been split due to bad strips, would require a whole lot of new logic to recalculate hitsInThirdTimeBin word - instead, just find when this is the case here, and set hitsInThirdTimeBin to zero later on

clusters had been split - recalculating HitsInThirdTimeBin too difficult to be worthwhile for this rare corner case..

Definition at line 306 of file SCT_ClusteringTool.cxx.

312  {
313  ATH_MSG_VERBOSE ("SCT_ClusteringTool::clusterize()");
314 
315  if (m_doFastClustering) return fastClusterize(collection, idHelper, sctDetElStatus, cache, dataItemsPool, ctx);
316 
317  SCT_ClusterCollection* nullResult(nullptr);
318  if (collection.empty()) {
319  ATH_MSG_DEBUG("Empty RDO collection");
320  return nullResult;
321  }
322 
323  // Make a copy of the collection for sorting (no need to sort if theres only one RDO)
324  std::vector<const SCT_RDORawData*> collectionCopy(collection.begin(), collection.end());
325  if (collection.size() not_eq 1) std::sort(collectionCopy.begin(), collectionCopy.end(), strip_less_than());
326 
327  // Vector of identifiers in a cluster (most likely is that there is one strip in the cluster)
328  // Vector of clusters to make the cluster collection (most likely equal to collection size)
329  cache.currentVector.clear();
330  cache.idGroups.clear();
331  cache.tbinGroups.clear();
332  int n01X(0);
333  int n11X(0);
334  unsigned int previousStrip(0); // Should be ok?
335  uint16_t hitsInThirdTimeBin(0);
336  int stripCount(0);
337  for (const SCT_RDORawData* pRawData: collectionCopy) {
338  const Identifier firstStripId(pRawData->identify());
339  const unsigned int nStrips(pRawData->getGroupSize());
340  const int thisStrip(idHelper.strip(firstStripId));
341  const int BEC(idHelper.barrel_ec(firstStripId));
342  const int layer(idHelper.layer_disk(firstStripId));
343 
344  // Flushes the vector every time a non-adjacent strip is found
345  if (not adjacent(thisStrip, previousStrip) and not(cache.currentVector.empty())) {
346  if (m_majority01X) {
347  if (n01X >= n11X) {
348  cache.idGroups.push_back(cache.currentVector);
349  }
350  } else {
351  // Add this group to existing groups (and flush)
352  cache.idGroups.push_back(cache.currentVector);
353  }
354  cache.currentVector.clear();
355  n01X=0;
356  n11X=0;
357  cache.tbinGroups.push_back(hitsInThirdTimeBin);
358  hitsInThirdTimeBin =0;
359  stripCount = 0;
360  }
361 
362  // Only use clusters with certain time bit patterns if m_timeBinStr set
363  bool passTiming(true);
364  bool pass01X(true);
365  bool passX1X(true);
366  const SCT3_RawData* pRawData3(dynamic_cast<const SCT3_RawData*>(pRawData));
367  if (!pRawData3) {
368  ATH_MSG_ERROR("Casting into SCT3_RawData failed. This is probably caused by use of an old RDO file.");
369  return nullptr;
370  }
371  const int timeBin(pRawData3->getTimeBin());
372  std::bitset<3> timePattern(static_cast<unsigned long>(timeBin));
373  if (not m_timeBinStr.empty()) passTiming = testTimeBins(timeBin);
374 
375  passX1X = testTimeBinsX1X(pRawData3->getTimeBin());
376  if (passX1X) pass01X = testTimeBins01X(pRawData3->getTimeBin());
377  if (pass01X) n01X++;
378  if (passX1X and (not pass01X)) n11X++;
379  if (m_innermostBarrelX1X) {
380  if ((BEC==0) and (layer==0) and passX1X) passTiming=true;
381  else passTiming = pass01X;
382  } else if (m_innertwoBarrelX1X) {
383  if ((BEC==0) and (layer==0 or layer==1) and passX1X) passTiming=true;
384  else passTiming = pass01X;
385  }
386 
387  // Now we are either (a) pushing more contiguous strips onto an existing vector
388  // or (b) pushing a new set of ids onto an empty vector
389  if (passTiming or m_majority01X) {
390  if (m_useRowInformation) {
391  addStripsToClusterInclRows(firstStripId, nStrips, cache.currentVector, cache.idGroups, idHelper,sctDetElStatus, ctx); // Note this takes the current vector only
392  } else if (not m_checkBadChannels) {
393  addStripsToCluster(firstStripId, nStrips, cache.currentVector, idHelper); // Note this takes the current vector only
394  } else {
395  addStripsToClusterWithChecks(firstStripId, nStrips, cache.currentVector, cache.idGroups, idHelper,sctDetElStatus, ctx); // This one includes the groups of vectors as well
396  }
397  for (unsigned int iStrip=0; iStrip<nStrips; iStrip++) {
398  if (stripCount < 16) hitsInThirdTimeBin |= (timePattern.test(0) << stripCount);
399  stripCount++;
400  }
401  }
402  if (not cache.currentVector.empty()) {
403  // Gives the last strip number in the cluster
404  previousStrip = idHelper.strip(cache.currentVector.back());
405  }
406  }
407 
408  // Still need to add this last vector
409  if (not cache.currentVector.empty()) {
410  if ((not m_majority01X) or (n01X >= n11X)) {
411  cache.idGroups.push_back(cache.currentVector);
412  cache.tbinGroups.push_back(hitsInThirdTimeBin);
413  hitsInThirdTimeBin=0;
414  }
415  }
416 
417  // Find detector element for these digits
418  const Identifier elementID(collection.identify());
419  const Identifier waferId{idHelper.wafer_id(elementID)};
420  const IdentifierHash waferHash{idHelper.wafer_hash(waferId)};
422  const InDetDD::SiDetectorElementCollection* sctDetEle(*sctDetEleHandle);
423  if (not sctDetEleHandle.isValid() or sctDetEle==nullptr) {
424  ATH_MSG_FATAL(m_SCTDetEleCollKey.fullKey() << " is not available.");
425  return nullResult;
426  }
427  const InDetDD::SiDetectorElement* element(sctDetEle->getDetectorElement(waferHash));
428  if (!element) {
429  ATH_MSG_WARNING("Element not in the element map, ID = "<< elementID);
430  return nullResult;
431  }
432 
433  const InDetDD::SCT_ModuleSideDesign* design;
434  if (idHelper.is_barrel(elementID)) {
435  design = (static_cast<const InDetDD::SCT_BarrelModuleSideDesign*>(&element->design()));
436  } else {
437  design = (static_cast<const InDetDD::SCT_ForwardModuleSideDesign*>(&element->design()));
438  }
439 
440  IdentifierHash idHash(collection.identifyHash());
441  SCT_ClusterCollection* clusterCollection = new SCT_ClusterCollection(idHash);
442  clusterCollection->setIdentifier(elementID);
443  clusterCollection->reserve(cache.idGroups.size());
444  //DataPool will own the elements
445  if(dataItemsPool){
446  clusterCollection->clear(SG::VIEW_ELEMENTS);
447  }
448 
449  // All strips are assumed to be the same width.
450  std::vector<uint16_t>::iterator tbinIter(cache.tbinGroups.begin());
451 
455  const bool badStripInClusterOnThisModuleSide = (cache.idGroups.size() != cache.tbinGroups.size());
456 
457  for (IdVec_t& stripGroup: cache.idGroups) {
458  const int nStrips(stripGroup.size());
459  if (nStrips == 0) continue;
460  //
461  const InDetDD::SiLocalPosition dummyPos(1, 0);
462  DimensionAndPosition clusterDim(dummyPos, 1.0);//just initialize with arbitrary values, will be set properly in the next two lines...
463  if (m_useRowInformation) clusterDim = clusterDimensionsInclRow(idHelper.strip(stripGroup.front()), idHelper.strip(stripGroup.back()), idHelper.row(stripGroup.front()), element, design);
464  else clusterDim = clusterDimensions(idHelper.strip(stripGroup.front()), idHelper.strip(stripGroup.back()), element, idHelper);
465  const Amg::Vector2D localPos(clusterDim.centre.xPhi(), clusterDim.centre.xEta());
466  // Since clusterId is arbitary (it only needs to be unique) just use ID of first strip
467  //const Identifier clusterId = element->identifierOfPosition(clusterDim.centre);
468  const Identifier clusterId(stripGroup.front());
469  if (!clusterId.is_valid()) ATH_MSG_VERBOSE(clusterId << " is invalid.");
470  //
471  // Find length of strip at centre
472  const std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition> ends(design->endsOfStrip(clusterDim.centre));
473  const double stripLength(std::abs(ends.first.xEta()-ends.second.xEta()));
474  //
475  // Now make a SiCluster
476  const SiWidth siWidth(Amg::Vector2D(nStrips, 1), Amg::Vector2D(clusterDim.width, stripLength));
477 
478  SCT_Cluster* cluster = nullptr;
479  if (dataItemsPool){
480  cluster = dataItemsPool->nextElementPtr();
481  }else{
482  cluster = new SCT_Cluster();
483  }
484 
485  (*cluster) =
487  ? (m_clusterMaker->sctCluster(clusterId, localPos, std::move(stripGroup),
488  siWidth, element, m_errorStrategy))
489  : (SCT_Cluster(clusterId, localPos, std::move(stripGroup), siWidth, element,
490  {}));
491 
492  cluster->setHashAndIndex(clusterCollection->identifyHash(),
493  clusterCollection->size());
494  if (tbinIter != cache.tbinGroups.end()) {
495  cluster->setHitsInThirdTimeBin(*tbinIter);
496  ++tbinIter;
497  }
499  if (badStripInClusterOnThisModuleSide) cluster->setHitsInThirdTimeBin(0);
500  clusterCollection->push_back(cluster);
501  }
502 
503  return clusterCollection;
504  }

◆ decodeTimeBin()

StatusCode InDet::SCT_ClusteringTool::decodeTimeBin ( char  timeBin,
int &  bit 
) const
private

Convert a single time bin char to an int, bit is modified.

Definition at line 82 of file SCT_ClusteringTool.cxx.

82  {
83  // Decode individual time char
84  if (timeBin == 'X') {bit = -1; return StatusCode::SUCCESS;}
85  if (timeBin == '0') {bit = 0; return StatusCode::SUCCESS;}
86  if (timeBin == '1') {bit = 1; return StatusCode::SUCCESS;}
87 
88  ATH_MSG_FATAL("Invalid time bin string " << timeBin);
89  return StatusCode::FAILURE;
90  }

◆ decodeTimeBins()

StatusCode InDet::SCT_ClusteringTool::decodeTimeBins ( )
private

Convert time bin string to array of 3 bits.

Definition at line 60 of file SCT_ClusteringTool.cxx.

60  {
61  // Decode time bins from string of form e.g. "01X" to integer bits (-1 means X)
62  m_timeBinBits[0] = -1;
63  m_timeBinBits[1] = -1;
64  m_timeBinBits[2] = -1;
65 
66  if (m_timeBinStr.empty()) return StatusCode::SUCCESS;
67  if (m_timeBinStr.size() != 3) {
68  ATH_MSG_FATAL("Time bin string must only contain 3 bins");
69  return StatusCode::FAILURE;
70  }
71  std::transform(m_timeBinStr.begin(), m_timeBinStr.end(), m_timeBinStr.begin(), ::toupper);
72 
73  for (unsigned int i(0); i<m_timeBinStr.size(); ++i) {
74  int timeBin(-999);
75  if (decodeTimeBin(m_timeBinStr[i], timeBin).isFailure()) return StatusCode::FAILURE;
76  m_timeBinBits[i] = timeBin;
77  }
78 
79  return StatusCode::SUCCESS;
80  }

◆ fastClusterize()

SCT_ClusterCollection * InDet::SCT_ClusteringTool::fastClusterize ( const InDetRawDataCollection< SCT_RDORawData > &  RDOs,
const SCT_ID idHelper,
const InDet::SiDetectorElementStatus sctDetElementStatus,
SCTClusteringCache cache,
DataPool< SCT_Cluster > *  dataItemsPool,
const EventContext &  ctx 
) const

A new fast method originally implemented for ITk.

Can be internally used in clusterize with m_doFastClustering=true.

Definition at line 506 of file SCT_ClusteringTool.cxx.

512  {
513  if (collection.empty()) return nullptr;
514 
515  std::vector<const SCT_RDORawData*> collectionCopy(collection.begin(), collection.end());
516 
517  if (collectionCopy.size() > 1) std::sort(collectionCopy.begin(), collectionCopy.end(), strip_less_than());
518 
519  cache.currentVector.clear();
520  cache.idGroups.clear();
521  cache.tbinGroups.clear();
522 
523  unsigned int previousStrip = 0; // Should be ok?
524  uint16_t hitsInThirdTimeBin = 0;
525  int stripCount = 0;
526  int previousRow = -1;
527  int thisRow = -1;
528 
529  const Identifier badId;
530 
531  for (const SCT_RDORawData* pRawData: collectionCopy) {
532  Identifier firstStripId = pRawData->identify();
533  Identifier waferId = idHelper.wafer_id(firstStripId);
534  IdentifierHash waferHash = idHelper.wafer_hash(waferId);
535  unsigned int nStrips = pRawData->getGroupSize();
536  int thisStrip = idHelper.strip(firstStripId);
537 
538  if (m_useRowInformation) thisRow = idHelper.row(firstStripId);
539 
540  // Flushes the vector every time a non-adjacent strip is found
541  //
542  if (not cache.currentVector.empty() and
543  ((m_useRowInformation and !adjacent(thisStrip, thisRow, previousStrip, previousRow)) or
544  (not m_useRowInformation and !adjacent(thisStrip, previousStrip)))) {
545 
546  // Add this group to existing groups (and flush)
547  //
548  cache.idGroups.push_back(cache.currentVector);
549  cache.currentVector.clear();
550 
551  cache.tbinGroups.push_back(hitsInThirdTimeBin);
552  hitsInThirdTimeBin = 0;
553  stripCount = 0;
554  }
555 
556  // Only use clusters with certain time bit patterns if m_timeBinStr set
557 
558  const SCT3_RawData* pRawData3 = dynamic_cast<const SCT3_RawData*>(pRawData);
559  //sroe: coverity 31562
560  if (!pRawData3) {
561  ATH_MSG_ERROR("Casting into SCT3_RawData failed. This is probably caused by use of an old RDO file.");
562  return nullptr;
563  }
564 
565  int timeBin = pRawData3->getTimeBin();
566  std::bitset<3> timePattern(static_cast<unsigned long>(timeBin));
567 
568  bool passTiming = true;
569 
570  if (!m_timeBinStr.empty()) passTiming = testTimeBinsN(timePattern);
571 
572  // Now we are either (a) pushing more contiguous strips onto an existing vector
573  // or (b) pushing a new set of ids onto an empty vector
574  //
575  if (passTiming) {
576  unsigned int nBadStrips(0);
577  unsigned int max_strip = std::min( static_cast<unsigned int>(thisStrip+nStrips), static_cast<unsigned int>(idHelper.strip_max(waferId)+1) );
578 
579  if (thisStrip+nStrips > max_strip) {
580  ATH_MSG_DEBUG("SCT strip range exceeds bounds: strip range " << thisStrip << " .. + " << nStrips << " = " << (thisStrip+nStrips)
581  << " !<= " << max_strip );
582  }
583  for (unsigned int sn=thisStrip; sn < max_strip; ++sn) {
584  Identifier stripId = m_useRowInformation ? idHelper.strip_id(waferId,thisRow,sn) : idHelper.strip_id(waferId,sn);
585  if (!isBad(sctDetElStatus, idHelper, waferHash, stripId, ctx)) {
586  cache.currentVector.push_back(stripId);
587  } else {
588  cache.currentVector.push_back(badId);
589  ++nBadStrips;
590  }
591  if (stripCount < 16) {
592  hitsInThirdTimeBin = hitsInThirdTimeBin | (timePattern.test(0) << stripCount);
593  }
594  ++stripCount;
595  }
596 
597  if (cache.currentVector.size() == nBadStrips) {
598  cache.currentVector.clear();
599  } else if (nBadStrips) {
600  cache.currentVector=recluster(cache.currentVector, cache.idGroups);
601  }
602  }
603 
604  if (not cache.currentVector.empty()) {
605  // Gives the last strip number in the cluster
606  //
607  previousStrip = idHelper.strip(cache.currentVector.back());
608  if (m_useRowInformation) previousRow = idHelper.row(cache.currentVector.back());
609  }
610  }
611 
612  // Still need to add this last vector
613  //
614  if (not cache.currentVector.empty()) {
615  cache.idGroups.push_back(cache.currentVector);
616  cache.tbinGroups.push_back(hitsInThirdTimeBin);
617  hitsInThirdTimeBin=0;
618  }
619 
620  // Find detector element for these digits
621  //
622  IdentifierHash idHash = collection.identifyHash();
624  const InDetDD::SiDetectorElementCollection* sctDetEle(*sctDetEleHandle);
625  if (not sctDetEleHandle.isValid() or sctDetEle==nullptr) {
626  ATH_MSG_FATAL(m_SCTDetEleCollKey.fullKey() << " is not available.");
627  return nullptr;
628  }
629  const InDetDD::SiDetectorElement* element(sctDetEle->getDetectorElement(idHash));
630  if (!element) {
631  ATH_MSG_WARNING("Element not in the element map, hash = " << idHash);
632  return nullptr;
633  }
634 
635  const InDetDD::SCT_ModuleSideDesign* design = (dynamic_cast<const InDetDD::SCT_ModuleSideDesign*>(&element->design()));
636  if(design==nullptr) return nullptr;
637 
638  SCT_ClusterCollection* clusterCollection = new SCT_ClusterCollection(idHash);
639  Identifier elementID = collection.identify();
640  clusterCollection->setIdentifier(elementID);
641  clusterCollection->reserve(cache.idGroups.size());
642  if(dataItemsPool){
643  clusterCollection->clear(SG::VIEW_ELEMENTS);
644  }
645 
646  int clusterNumber = 0;
647 
648  // All strips are assumed to be the same width.
649  //
650  std::vector<IdVec_t>::iterator pGroup = cache.idGroups.begin();
651  std::vector<IdVec_t>::iterator lastGroup = cache.idGroups.end();
652  std::vector<uint16_t>::iterator tbinIter = cache.tbinGroups.begin();
653 
654  // If clusters have been split due to bad strips, would require a whole lot
655  // of new logic to recalculate hitsInThirdTimeBin word - instead, just find
656  // when this is the case here, and set hitsInThirdTimeBin to zero later on
657  //
658  double iphipitch = 1./element->phiPitch();
659  double shift = m_lorentzAngleTool->getLorentzShift(idHash);
660  double stripPitch = design->stripPitch();
661  bool badStripInClusterOnThisModuleSide = (cache.idGroups.size() != cache.tbinGroups.size());
662  bool rotate = (element->design().shape() == InDetDD::Trapezoid || element->design().shape() == InDetDD::Annulus);
663  double stripL = 0.;
664  double COV11 = 0.;
665 
666  if (not rotate) {
667  stripL = design->etaPitch();
668  COV11 = stripL*stripL*(1./12.);
669  }
670 
671  for (; pGroup!=lastGroup; ++pGroup) {
672  int nStrips = pGroup->size();
673  double dnStrips = static_cast<double>(nStrips);
674  Identifier clusterId = pGroup->front();
675 
676  int firstStrip = idHelper.strip(clusterId);
677  double width = stripPitch;
679  if (m_useRowInformation) {
680  int row = idHelper.row(clusterId);
681  centre = element->rawLocalPositionOfCell(design->strip1Dim(firstStrip, row));
682  if (nStrips > 1) {
683  InDetDD::SiLocalPosition lastStripPos(element->rawLocalPositionOfCell(design->strip1Dim(firstStrip+nStrips-1, row)));
684  centre = (centre+lastStripPos)*.5;
685  width *=dnStrips;
686  }
687  } else {
688  DimensionAndPosition clusterDim = clusterDimensions(idHelper.strip(pGroup->front()), idHelper.strip(pGroup->back()), element, idHelper);
689  centre = clusterDim.centre;
690  width = clusterDim.width;
691  }
692 
693  Amg::Vector2D localPos{centre.xPhi(), centre.xEta()};
694  Amg::Vector2D locpos{centre.xPhi()+shift, centre.xEta()};
695 
696  // Now make a SiCluster
697  //
698  double x = 0.;
699  // single strip - resolution close to pitch/sqrt(12)
700  // two-strip hits: better resolution, approx. 40% lower
701  // lines taken from ClusterMakerTool::sctCluster
702  if (nStrips == 1) {
703  x = 1.05*width;
704  } else {
705  if (nStrips == 2) {
706  x = 0.27*width;
707  } else {
708  x = width;
709  }
710  }
711 
712  double V[4] = {x*x*(1./12.), 0., 0., COV11};
713 
714  if (rotate) {
715  // Find length of strip at centre
716  //
717  std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition> ends(design->endsOfStrip(centre));
718  stripL = std::abs(ends.first.xEta()-ends.second.xEta());
719 
720  double w = element->phiPitch(localPos)*iphipitch;
721  double sn = element->sinStereoLocal(localPos);
722  double sn2 = sn*sn;
723  double cs2 = 1.-sn2;
724  double v0 = V[0]*w*w;
725  double v1 = stripL*stripL*(1./12.);
726  V[0] = cs2*v0+sn2*v1;
727  V[1] = V[2] = sn*sqrt(cs2)*(v0-v1);
728  V[3] = sn2*v0+cs2*v1;
729  }
730 
731  auto errorMatrix = Amg::MatrixX(2,2);
732  errorMatrix<<V[0],V[1],V[2],V[3];
733 
734  SiWidth siWidth{Amg::Vector2D(dnStrips,1.), Amg::Vector2D(width,stripL)};
735 
736  SCT_Cluster* cluster = nullptr;
737  if (dataItemsPool) {
738  cluster = dataItemsPool->nextElementPtr();
739  (*cluster) = SCT_Cluster{clusterId, locpos, std::move(*pGroup),
740  siWidth, element, std::move(errorMatrix)};
741 
742  } else {
743  cluster = new SCT_Cluster{clusterId, locpos, std::move(*pGroup),
744  siWidth, element, std::move(errorMatrix)};
745  }
746 
747  cluster->setHashAndIndex(idHash, clusterNumber);
748 
749  if (tbinIter != cache.tbinGroups.end()) {
750  cluster->setHitsInThirdTimeBin(*tbinIter);
751  ++tbinIter;
752  }
753 
754  // clusters had been split - recalculating HitsInThirdTimeBin too difficult to be worthwhile for this rare corner case..
755  //
756  if (badStripInClusterOnThisModuleSide) cluster->setHitsInThirdTimeBin(0);
757 
758  clusterCollection->push_back(cluster);
759  clusterNumber++;
760  }
761  return clusterCollection;
762  }

◆ initialize()

StatusCode InDet::SCT_ClusteringTool::initialize ( )
overridevirtual

Retrieve the necessary services in initialize.

only one of m_majority01X, m_innermostBarrelX1X and m_innertwoBarrelX1X can be true - check if this is the case If none of them is true, m_timeBinStr is used.

m_sctDetElStatus.empty()

Definition at line 124 of file SCT_ClusteringTool.cxx.

124  {
125  ATH_CHECK(m_clusterMaker.retrieve());
126 
127  if (m_checkBadChannels) {
128  ATH_MSG_DEBUG("Clustering has been asked to look at bad channel info");
129  ATH_CHECK(m_conditionsTool.retrieve());
130  } else {
131  m_conditionsTool.disable();
132  }
133 
134  if (m_doFastClustering and not m_lorentzAngleTool.empty()) {
135  ATH_CHECK(m_lorentzAngleTool.retrieve());
136  } else {
137  m_lorentzAngleTool.disable();
138  }
139 
140  if (decodeTimeBins().isFailure()) return StatusCode::FAILURE;
141 
145  int countTrueSettings(0);
146  if (m_majority01X) countTrueSettings++;
147  if (m_innermostBarrelX1X) countTrueSettings++;
148  if (m_innertwoBarrelX1X) countTrueSettings++;
149  if (countTrueSettings!=1) {
150  if (!m_timeBinStr.empty()) {
151  ATH_MSG_DEBUG("Timing requirement: m_timeBinStr " << m_timeBinStr << " is used for clustering");
152  } else {
153  if (countTrueSettings==0) {
154  ATH_MSG_DEBUG("Timing requirement is not used for clustering");
155  } else {
156  ATH_MSG_FATAL("One and only one of m_majority01X, m_innermostBarrelX1X and m_innertwoBarrelX1X should be set to True!");
157  return StatusCode::FAILURE;
158  }
159  }
160  } else {
161  ATH_MSG_DEBUG("Timing requirement: " <<
162  (m_majority01X ? "m_majority01X" : "") <<
163  (m_innermostBarrelX1X ? "m_innermostBarrelX1X" : "") <<
164  (m_innertwoBarrelX1X ? "m_innertwoBarrelX1X" : "") <<
165  " is true and used for clustering");
166  }
167 
170 
171  return StatusCode::SUCCESS;
172  }

◆ isBad()

bool InDet::SCT_ClusteringTool::isBad ( const InDet::SiDetectorElementStatus sctDetElStatus,
const SCT_ID sctID,
const IdentifierHash waferHash,
const Identifier stripId,
const EventContext &  ctx 
) const
inlineprivate

In-class facade on the 'isGood' method for a strip identifier.

Definition at line 203 of file SCT_ClusteringTool.h.

206  {
207  if (sctDetElStatus) {
208  const int strip_i{sctID.strip(stripId)};
210  sctDetElStatus, sctDetElStatus->isCellGood(waferHash.value(), strip_i),
211  m_conditionsTool->isGood(stripId, InDetConditions::SCT_STRIP, ctx));
212  return !sctDetElStatus->isCellGood(waferHash.value(), strip_i);
213  } else {
214  return (
215  not m_conditionsTool->isGood(stripId, InDetConditions::SCT_STRIP, ctx));
216  }
217 }

◆ recluster()

SCT_ClusteringTool::IdVec_t InDet::SCT_ClusteringTool::recluster ( SCT_ClusteringTool::IdVec_t clusterVector,
std::vector< IdVec_t > &  idGroups 
) const
private

Recluster the current vector, splitting on bad strips, and insert those new groups to the idGroups vector.

recluster starts with a vector of Ids, some of which may be invalid due to them being bad strips, and a vector of these vectors.

The cluster vector referenced will be changed by this, as well as the idGroups

We recursively split the original clustervector, adding to idGroups as we go. It should eventually either return an empty cluster or a cluster of all good strips, to be inserted by the caller.

Definition at line 279 of file SCT_ClusteringTool.cxx.

280  {
281 
282  // Default Identifier constructor gives a sentinel value
283  static const Identifier invalidId;
284  const unsigned int numberOfBadStrips(std::count(clusterVector.begin(), clusterVector.end(), invalidId));
285 
286  // All the strips are good, return the original vector to be put in idGroups by the caller
287  if (numberOfBadStrips==0 or clusterVector.empty()) return clusterVector;
288  // All the strips are bad, clear the vector and return it
289  if (clusterVector.size() == numberOfBadStrips) {
290  clusterVector.clear();
291  return clusterVector;
292  }
293 
294  // Pointer to first bad strip
295  SCT_ClusteringTool::IdVec_t::iterator pBadId(std::find(clusterVector.begin(), clusterVector.end(), invalidId));
296  // Make a new cluster, which could be empty, if the first strip is bad
297  SCT_ClusteringTool::IdVec_t subCluster(clusterVector.begin(), pBadId);
298  // Remove elements including the badId
299  if (pBadId != clusterVector.end()) clusterVector.erase(clusterVector.begin(), ++pBadId);
300  if (not subCluster.empty()) idGroups.push_back(subCluster);
301  return recluster(clusterVector, idGroups);
302  }

◆ testTimeBins()

bool InDet::SCT_ClusteringTool::testTimeBins ( int  timeBin) const
private

Definition at line 92 of file SCT_ClusteringTool.cxx.

92  {
93  // Convert the given timebin to a bit set and test each bit
94  // if bit is -1 (i.e. X) it always passes, other wise require exact match of 0/1
95  // N.B bitset has opposite order to the bit pattern we define
96 
97  const std::bitset<3> timePattern(static_cast<unsigned long>(timeBin));
98  return testTimeBinsN(timePattern);
99  }

◆ testTimeBins01X()

bool InDet::SCT_ClusteringTool::testTimeBins01X ( int  timeBin)
staticprivate

Definition at line 101 of file SCT_ClusteringTool.cxx.

101  {
102  // Convert the given timebin to a bit set and test each bit
103  // if bit is -1 (i.e. X) it always passes, otherwise require exact match of 0/1
104  // N.B bitset has opposite order to the bit pattern we define
105 
106  bool pass(true);
107  const std::bitset<3> timePattern(static_cast<unsigned long>(timeBin));
108  if (timePattern.test(2)) pass=false;
109  if (!timePattern.test(1)) pass=false;
110  return pass;
111  }

◆ testTimeBinsN()

bool InDet::SCT_ClusteringTool::testTimeBinsN ( const std::bitset< 3 > &  timePattern) const
inlineprivate

Definition at line 219 of file SCT_ClusteringTool.h.

220  {
221  // Convert the given timebin to a bit set and test each bit
222  // if bit is -1 (i.e. X) it always passes, other wise require exact match of
223  // 0/1 N.B bitset has opposite order to the bit pattern we define
224 
225  if (m_timeBinBits[0] != -1 and
226  timePattern.test(2) != static_cast<bool>(m_timeBinBits[0]))
227  return false;
228  if (m_timeBinBits[1] != -1 and
229  timePattern.test(1) != static_cast<bool>(m_timeBinBits[1]))
230  return false;
231  if (m_timeBinBits[2] != -1 and
232  timePattern.test(0) != static_cast<bool>(m_timeBinBits[2]))
233  return false;
234  return true;
235 }

◆ testTimeBinsX1X()

bool InDet::SCT_ClusteringTool::testTimeBinsX1X ( int  timeBin)
staticprivate

Definition at line 113 of file SCT_ClusteringTool.cxx.

113  {
114  // Convert the given timebin to a bit set and test each bit
115  // if bit is -1 (i.e. X) it always passes, otherwise require exact match of 0/1
116  // N.B bitset has opposite order to the bit pattern we define
117 
118  bool pass(true);
119  const std::bitset<3> timePattern(static_cast<unsigned long>(timeBin));
120  if (!timePattern.test(1)) pass=false;
121  return pass;
122  }

Member Data Documentation

◆ m_checkBadChannels

BooleanProperty InDet::SCT_ClusteringTool::m_checkBadChannels {this, "checkBadChannels", true}
private

Definition at line 101 of file SCT_ClusteringTool.h.

◆ m_clusterMaker

ToolHandle<ClusterMakerTool> InDet::SCT_ClusteringTool::m_clusterMaker
private
Initial value:
{this, "globalPosAlg",
"InDet::ClusterMakerTool"}

Definition at line 89 of file SCT_ClusteringTool.h.

◆ m_conditionsTool

ToolHandle<IInDetConditionsTool> InDet::SCT_ClusteringTool::m_conditionsTool
private
Initial value:
{
this, "conditionsTool",
"SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool",
"Tool to retrieve SCT Conditions summary"}

Definition at line 85 of file SCT_ClusteringTool.h.

◆ m_doFastClustering

BooleanProperty InDet::SCT_ClusteringTool::m_doFastClustering {this, "doFastClustering", true}
private

Definition at line 107 of file SCT_ClusteringTool.h.

◆ m_errorStrategy

IntegerProperty InDet::SCT_ClusteringTool::m_errorStrategy {this, "errorStrategy", 1}
private

Definition at line 100 of file SCT_ClusteringTool.h.

◆ m_innermostBarrelX1X

BooleanProperty InDet::SCT_ClusteringTool::m_innermostBarrelX1X {this, "innermostBarrelX1X", false}
private

Definition at line 103 of file SCT_ClusteringTool.h.

◆ m_innertwoBarrelX1X

BooleanProperty InDet::SCT_ClusteringTool::m_innertwoBarrelX1X {this, "innertwoBarrelX1X", false}
private

Definition at line 104 of file SCT_ClusteringTool.h.

◆ m_lorentzAngleTool

ToolHandle<ISiLorentzAngleTool> InDet::SCT_ClusteringTool::m_lorentzAngleTool
private
Initial value:
{
this, "LorentzAngleTool", "SiLorentzAngleTool/SCTLorentzAngleTool",
"Tool to retreive Lorentz angle of SCT"}

Definition at line 91 of file SCT_ClusteringTool.h.

◆ m_majority01X

BooleanProperty InDet::SCT_ClusteringTool::m_majority01X {this, "majority01X", false}
private

Definition at line 105 of file SCT_ClusteringTool.h.

◆ m_SCTDetEleCollKey

SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> InDet::SCT_ClusteringTool::m_SCTDetEleCollKey
private
Initial value:
{this, "SCTDetEleCollKey",
"SCT_DetectorElementCollection",
"Key of SiDetectorElementCollection for SCT. "
"Necessary for alignment"}

Definition at line 115 of file SCT_ClusteringTool.h.

◆ m_sctDetElStatus

SG::ReadHandleKey<InDet::SiDetectorElementStatus> InDet::SCT_ClusteringTool::m_sctDetElStatus
private
Initial value:
{
this, "SCTDetElStatus", "", "Key of SiDetectorElementStatus for SCT"}

Optional read handle to get status data to test whether a SCT detector element is good.

If set to e.g. SCTDetectorElementStatus the event data will be used instead of the SCT conditions summary tool.

Definition at line 124 of file SCT_ClusteringTool.h.

◆ m_timeBinBits

int InDet::SCT_ClusteringTool::m_timeBinBits[3] {-1, -1, -1}
private

Time bin bits for timing requirement.

Set by decodeTimeBins() in initialize().

Definition at line 129 of file SCT_ClusteringTool.h.

◆ m_timeBinStr

StringProperty InDet::SCT_ClusteringTool::m_timeBinStr {this, "timeBins", ""}
private

Definition at line 102 of file SCT_ClusteringTool.h.

◆ m_useRowInformation

BooleanProperty InDet::SCT_ClusteringTool::m_useRowInformation {this, "useRowInformation", false}
private

Definition at line 106 of file SCT_ClusteringTool.h.


The documentation for this class was generated from the following files:
InDet::SCT_ClusteringTool::clusterDimensions
static DimensionAndPosition clusterDimensions(int firstStrip, int lastStrip, const InDetDD::SiDetectorElement *element, const SCT_ID &idHelper)
Calculate the cluster position and width given the first and last strip numbers for this element.
Definition: SCT_ClusteringTool.cxx:765
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
InDet::SCT_ClusteringTool::fastClusterize
SCT_ClusterCollection * fastClusterize(const InDetRawDataCollection< SCT_RDORawData > &RDOs, const SCT_ID &idHelper, const InDet::SiDetectorElementStatus *sctDetElementStatus, SCTClusteringCache &cache, DataPool< SCT_Cluster > *dataItemsPool, const EventContext &ctx) const
A new fast method originally implemented for ITk.
Definition: SCT_ClusteringTool.cxx:506
InDet::SCT_ClusteringTool::m_doFastClustering
BooleanProperty m_doFastClustering
Definition: SCT_ClusteringTool.h:107
InDet::SCT_ClusteringTool::testTimeBinsN
bool testTimeBinsN(const std::bitset< 3 > &timePattern) const
Definition: SCT_ClusteringTool.h:219
query_example.row
row
Definition: query_example.py:24
InDet::SCT_ClusteringTool::testTimeBins01X
static bool testTimeBins01X(int timeBin)
Definition: SCT_ClusteringTool.cxx:101
InDetDD::SCT_ModuleSideDesign::stripPitch
virtual double stripPitch(const SiLocalPosition &chargePos) const =0
give the strip pitch (dependence on position needed for forward)
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
InDetDD::SCT_ForwardModuleSideDesign
Definition: SCT_ForwardModuleSideDesign.h:39
InDet::SCT_ClusteringTool::m_sctDetElStatus
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_sctDetElStatus
Optional read handle to get status data to test whether a SCT detector element is good.
Definition: SCT_ClusteringTool.h:124
LArNewCalib_Delay_OFC_Cali.BEC
BEC
Definition: LArNewCalib_Delay_OFC_Cali.py:115
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
rotate
void rotate(double angler, GeoTrf::Vector2D &vector)
Definition: TRTDetectorFactory_Full.cxx:63
InDetDD::SiDetectorElementCollection
Definition: SiDetectorElementCollection.h:30
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
InDet::SCT_ClusteringTool::m_timeBinStr
StringProperty m_timeBinStr
Definition: SCT_ClusteringTool.h:102
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
InDetDD::SCT_ModuleSideDesign
Definition: SCT_ModuleSideDesign.h:40
InDet::SCT_ClusteringTool::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Definition: SCT_ClusteringTool.h:115
InDet::SCT_ClusteringTool::m_clusterMaker
ToolHandle< ClusterMakerTool > m_clusterMaker
Definition: SCT_ClusteringTool.h:89
InDetDD::DetectorDesign::etaPitch
virtual double etaPitch() const =0
InDet::SCT_ClusteringTool::addStripsToCluster
static void addStripsToCluster(const Identifier &firstStripId, unsigned int nStrips, IdVec_t &clusterVector, const SCT_ID &idHelper)
Add strips to a cluster vector without checking for bad strips.
Definition: SCT_ClusteringTool.cxx:174
InDet::adjacent
bool adjacent(unsigned int strip1, unsigned int strip2)
Definition: SCT_ClusteringTool.cxx:45
InDet::SCT_ClusteringTool::clusterDimensionsInclRow
static DimensionAndPosition clusterDimensionsInclRow(int firstStrip, int lastStrip, int row, const InDetDD::SiDetectorElement *element, const InDetDD::SCT_ModuleSideDesign *design)
Calculate the cluster position and width given the first,last strip, and row numbers for this element...
Definition: SCT_ClusteringTool.cxx:781
InDetDD::SCT_BarrelModuleSideDesign
Definition: SCT_BarrelModuleSideDesign.h:34
InDet::SCT_ClusteringTool::m_timeBinBits
int m_timeBinBits[3]
Time bin bits for timing requirement.
Definition: SCT_ClusteringTool.h:129
SCT_RDORawData
Definition: SCT_RDORawData.h:24
SCT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: SCT_ID.h:728
InDet::SCT_ClusteringTool::recluster
IdVec_t recluster(IdVec_t &clusterVector, std::vector< IdVec_t > &idGroups) const
Recluster the current vector, splitting on bad strips, and insert those new groups to the idGroups ve...
Definition: SCT_ClusteringTool.cxx:279
InDet::SiDetectorElementStatus::isCellGood
bool isCellGood(IdentifierHash hash, unsigned short cell_i) const
Definition: SiDetectorElementStatus.h:107
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
x
#define x
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
SCT_Cluster
Definition: Trigger/TrigAccel/TrigCudaFitter/src/SCT_Cluster.h:7
SCT_CalibAlgs::lastStrip
@ lastStrip
Definition: SCT_CalibNumbers.h:10
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
InDetDD::SiLocalPosition::xPhi
double xPhi() const
position along phi direction:
Definition: SiLocalPosition.h:123
InDet::SCT_ClusteringTool::m_innertwoBarrelX1X
BooleanProperty m_innertwoBarrelX1X
Definition: SCT_ClusteringTool.h:104
InDet::SCT_ClusteringTool::m_errorStrategy
IntegerProperty m_errorStrategy
Definition: SCT_ClusteringTool.h:100
InDet::SCT_ClusteringTool::decodeTimeBins
StatusCode decodeTimeBins()
Convert time bin string to array of 3 bits.
Definition: SCT_ClusteringTool.cxx:60
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
parseMapping.v0
def v0
Definition: parseMapping.py:149
VALIDATE_STATUS_ARRAY
#define VALIDATE_STATUS_ARRAY(use_info, info_val, summary_val)
Definition: SiDetectorElementStatus.h:51
lumiFormat.i
int i
Definition: lumiFormat.py:92
InDet::SCT_ClusteringTool::addStripsToClusterInclRows
void addStripsToClusterInclRows(const Identifier &firstStripId, unsigned int nStrips, IdVec_t &clusterVector, std::vector< IdVec_t > &idGroups, const SCT_ID &idHelper, const InDet::SiDetectorElementStatus *det_el_status, const EventContext &ctx) const
Add strips to a cluster vector including row variable for ITk.
Definition: SCT_ClusteringTool.cxx:233
SCT3_RawData
Definition: SCT3_RawData.h:24
InDetDD::SiLocalPosition::xEta
double xEta() const
position along eta direction:
Definition: SiLocalPosition.h:118
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
InDetDD::Annulus
@ Annulus
Definition: DetectorDesign.h:42
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDet::SCT_ClusteringTool::addStripsToClusterWithChecks
void addStripsToClusterWithChecks(const Identifier &firstStripId, unsigned int nStrips, IdVec_t &clusterVector, std::vector< IdVec_t > &idGroups, const SCT_ID &idHelper, const InDet::SiDetectorElementStatus *det_el_status, const EventContext &ctx) const
Add strips to a cluster vector checking for bad strips.
Definition: SCT_ClusteringTool.cxx:192
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
SCT_ID::row
int row(const Identifier &id) const
Definition: SCT_ID.h:758
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SCT3_RawData::getTimeBin
int getTimeBin() const
Definition: SCT3_RawData.h:92
SCT_ID::wafer_hash
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
Definition: SCT_ID.h:492
InDet::SCT_ClusteringTool::m_innermostBarrelX1X
BooleanProperty m_innermostBarrelX1X
Definition: SCT_ClusteringTool.h:103
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DataPool::nextElementPtr
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
InDet::SCT_ClusteringTool::m_majority01X
BooleanProperty m_majority01X
Definition: SCT_ClusteringTool.h:105
min
#define min(a, b)
Definition: cfImp.cxx:40
Identifier::clear
void clear()
Reset to invalid state.
InDet::SCT_ClusteringTool::isBad
bool isBad(const InDet::SiDetectorElementStatus *sctDetElStatus, const SCT_ID &sctID, const IdentifierHash &waferHash, const Identifier &stripId, const EventContext &ctx) const
In-class facade on the 'isGood' method for a strip identifier.
Definition: SCT_ClusteringTool.h:203
MuonGM::nStrips
int nStrips(const MuonGM::TgcReadoutElement &readoutEle, int layer)
Definition: MuonDetDescr/MuonGeoModelTest/src/GeoModelTgcTest.cxx:46
InDet::SCT_ClusteringTool::testTimeBinsX1X
static bool testTimeBinsX1X(int timeBin)
Definition: SCT_ClusteringTool.cxx:113
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
InDet::SCT_ClusteringTool::m_useRowInformation
BooleanProperty m_useRowInformation
Definition: SCT_ClusteringTool.h:106
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
InDetDD::SiCellId
Definition: SiCellId.h:29
InDet::SCT_ClusteringTool::testTimeBins
bool testTimeBins(int timeBin) const
Definition: SCT_ClusteringTool.cxx:92
InDet::SCT_ClusteringTool::m_checkBadChannels
BooleanProperty m_checkBadChannels
Definition: SCT_ClusteringTool.h:101
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
InDetDD::SCT_ModuleSideDesign::strip1Dim
virtual int strip1Dim(int strip, int row) const override
only relevant for SCT.
Definition: SCT_ModuleSideDesign.h:279
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SCT_ID::strip
int strip(const Identifier &id) const
Definition: SCT_ID.h:764
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IdentifierHash::value
unsigned int value(void) const
SCT_ID::strip_max
int strip_max(const Identifier &id) const
Definition: SCT_ID.cxx:186
InDet::SCT_ClusteringTool::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: SCT_ClusteringTool.h:91
InDet::SCT_ClusteringTool::IdVec_t
std::vector< Identifier > IdVec_t
Definition: SCT_ClusteringTool.h:50
SCT_CalibAlgs::firstStrip
@ firstStrip
Definition: SCT_CalibNumbers.h:10
SCT_ID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
Definition: SCT_ID.h:464
IdentifierHash
Definition: IdentifierHash.h:38
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
InDetConditions::SCT_STRIP
@ SCT_STRIP
Definition: InDetHierarchy.h:14
InDet::SCT_ClusterCollection
Trk::PrepRawDataCollection< SCT_Cluster > SCT_ClusterCollection
Definition: SCT_ClusterCollection.h:26
InDetDD::SCT_ModuleSideDesign::endsOfStrip
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const override=0
give the ends of strips
InDetDD::Trapezoid
@ Trapezoid
Definition: DetectorDesign.h:42
InDet::SCT_ClusteringTool::decodeTimeBin
StatusCode decodeTimeBin(char timeBin, int &bit) const
Convert a single time bin char to an int, bit is modified.
Definition: SCT_ClusteringTool.cxx:82
InDet::SCT_ClusteringTool::m_conditionsTool
ToolHandle< IInDetConditionsTool > m_conditionsTool
Definition: SCT_ClusteringTool.h:85
SCT_ID::is_barrel
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be sct id, otherwise answer is not accurate. Use SiliconID for gen...
Definition: SCT_ID.h:721
SCT_ID::strip_id
Identifier strip_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
For an individual strip.
Definition: SCT_ID.h:535