ATLAS Offline Software
Loading...
Searching...
No Matches
EmulatedDefectsToDetectorElementStatusCondAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef INDET_EMULATEDDEFECTSTODETECTORELEMENTSTATUSCONDALG_H
6#define INDET_EMULATEDDEFECTSTODETECTORELEMENTSTATUSCONDALG_H
7
9
10
11namespace InDet {
12
13 namespace details {
14 template <class T_Derived>
16 }
17
18 template <class T_Derived>
20 {
21 public:
25 using T_EmulatedDefectsKey = typename T_ModuleHelper::KEY_TYPE;
27
29
30 virtual StatusCode initialize() override;
31 virtual StatusCode execute(const EventContext& ctx) const override;
32
33 protected:
34 static ChipFlags_t makeChipStatus(const InDetDD::SiDetectorElement &detector_element,
35 const std::vector<T_EmulatedDefectsKey> &emulated_module_defects) {
36 T_ModuleHelper module_helper( detector_element.design() );
37 ChipFlags_t chip_status=(1u<<module_helper.circuitsPerColumn()*module_helper.circuitsPerRow())-1;
38 if constexpr(CHIP_MASK_IDX < T_ModuleHelper::N_MASKS) {
39 if (!emulated_module_defects.empty()) {
40 T_EmulatedDefectsKey last_key = emulated_module_defects.front();
41 for (T_EmulatedDefectsKey key : emulated_module_defects) {
42 if (module_helper.isRangeKey(key)) {
43 // if the range covers entire circuits, treat this as a circuit defect
44 if ( module_helper.getRow(key)==0
45 && module_helper.getColumn(key)==0
46 && (module_helper.getChip(last_key)-module_helper.getChip(key)>0
47 || ( module_helper.getColumn(last_key) >=module_helper.columnsPerCircuit()
48 && module_helper.getRow(last_key) >=module_helper.rowsPerCircuit()))) {
49 unsigned int end_chip = module_helper.getChip(last_key);
50 if ( module_helper.getColumn(last_key) >=module_helper.columnsPerCircuit()
51 && module_helper.getRow(last_key) >= module_helper.rowsPerCircuit()) {
52 ++end_chip;
53 }
54 for (unsigned int chip_i=module_helper.getChip(key); chip_i<end_chip; ++chip_i) {
55 assert( chip_i < 31u && (1u<<chip_i ) < std::numeric_limits<ChipFlags_t>::max());
56 chip_status &= ~(1<<(chip_i));
57 }
58 }
59 }
60 }
61 }
62 }
63 return chip_status;
64 }
65
67 {this, "EmulatedDefectsKey", "", "Key of the emulated defects input collection"};
68
69 };
70}
71
73#endif
Class to hold geometrical description of a silicon detector element.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
EmulatedDefectsToDetectorElementStatusCondAlgBase(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override
details::EmulatedDefectsToDetectorElementStatusTraits< T_Derived >::T_ModuleHelper T_ModuleHelper
details::EmulatedDefectsToDetectorElementStatusTraits< T_Derived >::T_EmulatedDefects T_EmulatedDefects
details::EmulatedDefectsToDetectorElementStatusTraits< T_Derived >::T_ConcreteDetectorElementStatusType T_ConcreteDetectorElementStatusType
EmulatedDefectsToDetectorElementStatusCondAlgBase(const std::string &name, ISvcLocator *pSvcLocator)
static ChipFlags_t makeChipStatus(const InDetDD::SiDetectorElement &detector_element, const std::vector< T_EmulatedDefectsKey > &emulated_module_defects)
Primary Vertex Finder.