|
ATLAS Offline Software
|
Go to the documentation of this file.
44 return StatusCode::SUCCESS;
49 return StatusCode::SUCCESS;
68 if (condDataInfo==
nullptr) {
69 ATH_MSG_ERROR(
"In isGood, SCT_AllGoodStripInfo cannot be retrieved");
85 ATH_MSG_WARNING(
"summary(): Module good/bad is not applicable for Calibration data");
91 ATH_MSG_WARNING(
"summary(): Wafer good/bad is not applicable for Calibration data");
97 ATH_MSG_WARNING(
"summary(): Chip good/bad is not applicable for Calibration data");
102 ATH_MSG_INFO(
"Unknown component has been asked for, should be Module/Wafer/Chip or Strip; returning 'good' and continuing");
111 const EventContext& ctx{Gaudi::Hive::currentContext()};
113 return isGood(elementId, ctx,
h);
119 if (not condDataHandle.isValid()) {
131 std::vector<std::vector<unsigned short> > &bad_strips = element_status.
getBadCells();
132 if (bad_strips.empty()) {
133 bad_strips.resize(condDataInfo->size());
135 unsigned int element_i=0;
136 for(
const std::array<bool, SCT_ConditionsData::STRIPS_PER_WAFER> &good_strips : *condDataInfo) {
139 std::vector<unsigned short> &bad_module_strips = bad_strips[element_i];
141 for (
unsigned int strip_i=0; strip_i<good_strips.size(); ++strip_i) {
143 if (geoemtrical_chip_id != last_geoemtrical_chip_id) {
144 last_geoemtrical_chip_id=geoemtrical_chip_id;
145 if (!chip_status.empty() && !(chip_status.at(element_i) &
static_cast<InDet::ChipFlags_t>(1
ul<<geoemtrical_chip_id))) {
150 if (!good_strips[strip_i]) {
151 std::vector<unsigned short>::const_iterator iter = std::lower_bound(bad_module_strips.begin(),bad_module_strips.end(),strip_i);
152 if (iter == bad_module_strips.end() || *iter != strip_i) {
153 bad_module_strips.insert( iter, strip_i);
169 CalibDefectType theseSummaryDefects;
173 if (condDataGain==
nullptr) {
174 ATH_MSG_ERROR(
"In defectType, SCT_CalibDefectData (gain) cannot be retrieved.");
175 return theseSummaryDefects;
178 if (condDataNoise==
nullptr) {
179 ATH_MSG_ERROR(
"In defectType, SCT_CalibDefectData (noise) cannot be retrieved.");
180 return theseSummaryDefects;
185 ATH_MSG_DEBUG(
"Summary wanted for component: " << stripId <<
" on module: " << moduleId);
195 ATH_MSG_WARNING(
"summary(): Module defect summary is not applicable for Calibration data");
202 ATH_MSG_WARNING(
"summary(): Wafer defect summary is not applicable for Calibration data");
209 ATH_MSG_WARNING(
"summary(): Chip defect summary is not applicable for Calibration data");
219 unsigned int stripNum;
221 if (p_element->swapPhiReadoutDirection()) {
232 if (wantedNPGDefects.begDefects.empty()) {
235 for (
unsigned int i{0};
i<wantedNPGDefects.begDefects.size(); ++
i) {
236 if (stripNum>=wantedNPGDefects.begDefects[
i] and stripNum<=wantedNPGDefects.endDefects[
i]) {
237 theseSummaryDefects.scan.emplace_back(
"NPtGain");
238 theseSummaryDefects.defect.push_back(wantedNPGDefects.typeOfDefect[
i]);
239 theseSummaryDefects.value.push_back(wantedNPGDefects.parValue[
i]);
240 ATH_MSG_VERBOSE(
"NPtGain defect summary for strip " << stripNum <<
" filled");
245 if (wantedNODefects.begDefects.empty()) {
248 for (
unsigned int i{0};
i != wantedNODefects.begDefects.size(); ++
i) {
249 if (stripNum>=wantedNODefects.begDefects[
i] and stripNum <= wantedNODefects.endDefects[
i]) {
250 theseSummaryDefects.scan.emplace_back(
"NoiseOccupancy");
251 theseSummaryDefects.defect.push_back(wantedNODefects.typeOfDefect[
i]);
252 theseSummaryDefects.value.push_back(wantedNODefects.parValue[
i]);
253 ATH_MSG_VERBOSE(
"NoiseOccupancy defect summary for strip " << stripNum <<
" filled");
257 if (theseSummaryDefects.scan.empty()) {
258 ATH_MSG_VERBOSE(
"defectSummary(): can't retrieve the defects for this strip: " << stripNum <<
" since strip good");
264 ATH_MSG_INFO(
"Unknown component requested, should be one of Module/Side/Chip or Strip");
265 return theseSummaryDefects;
270 return theseSummaryDefects;
274 const EventContext& ctx{Gaudi::Hive::currentContext()};
284 if (
scan ==
"NPtGain") {
286 if (condDataGain==
nullptr) {
287 ATH_MSG_ERROR(
"In defectType, SCT_CalibDefectData (gain) cannot be retrieved.");
289 wantedDefects = condDataGain->findModule(moduleId);
291 }
else if (
scan ==
"NoiseOccupancy") {
293 if (condDataNoise==
nullptr) {
294 ATH_MSG_ERROR(
"In defectType, SCT_CalibDefectData (noise) cannot be retrieved.");
296 wantedDefects = condDataNoise->findModule(moduleId);
299 ATH_MSG_ERROR(
"defectsSummary(): Module defects for scan" <<
scan <<
" does not exist (only NPtGain or NoiseOccupancy).");
302 return wantedDefects;
306 const EventContext& ctx{Gaudi::Hive::currentContext()};
318 if (condDataGain==
nullptr) {
319 ATH_MSG_ERROR(
"In defectType, SCT_CalibDefectData (gain) cannot be retrieved.");
323 if (condDataNoise==
nullptr) {
324 ATH_MSG_ERROR(
"In defectType, SCT_CalibDefectData (noise) cannot be retrieved.");
332 bool npDefect{
false};
333 bool noDefect{
false};
341 std::vector<std::uint32_t> listOfRODs;
345 for (; rodIter!=rodEnd; ++rodIter) {
346 std::vector<IdentifierHash> listOfHashes;
347 m_cabling->getHashesForRod(listOfHashes, *rodIter, ctx);
350 for (; hashIt != hashEnd; ++hashIt) {
354 if (
side!=0)
continue;
357 wantedDefects = condDataGain->findModule(moduleId);
358 }
else if (noDefect) {
359 wantedDefects = condDataNoise->findModule(moduleId);
362 for (
unsigned int i{0};
i < wantedDefects.
begDefects.size(); ++
i) {
365 int strip_beg{
static_cast<int>(wantedDefects.
begDefects[
i])};
366 int strip_end{
static_cast<int>(wantedDefects.
endDefects[
i])};
401 const EventContext& ctx{Gaudi::Hive::currentContext()};
409 return condData.retrieve();
417 return condData.retrieve();
425 return condData.retrieve();
433 if (not condData.isValid())
return nullptr;
434 return condData->getDetectorElement(waferHash);
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
constexpr unsigned int N_STRIPS_PER_CHIP
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
const std::vector< bool > & getElementStatus() const
const std::vector< std::vector< unsigned short > > & getBadCells() const
Container with a list of defects derived from calibration data and used in SCT_ReadCalibDataCondAlg a...
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
Identifier module_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
std::vector< unsigned int > begDefects
bool swapPhiReadoutDirection() const
Determine if readout direction between online and offline needs swapping.
::StatusCode StatusCode
StatusCode definition for legacy code.
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
int get_other_side(const IdentifierHash &id, IdentifierHash &other) const
Wafer hash on other side.
std::vector< std::string > typeOfDefect
StatusCode initialize(bool used=true)
void scan(TDirectory *td=0, int depth=0)
#define ATH_MSG_WARNING(x)
int strip(const Identifier &id) const
const std::vector< ChipFlags_t > & getElementChipStatus() const
constexpr unsigned int getGeometricalChipID(unsigned int strip)
Get the geometrical chip ID for the given strip.
std::array< SCT_WaferGoodStripInfo, SCT_ConditionsData::NUMBER_OF_WAFERS > SCT_AllGoodStripInfo
SCT_AllGoodStripInfo is std::array of SCT_WaferGoodStripInfo and is used in SCT_ReadCalibDataCondAlg ...
unsigned short ChipFlags_t
int side(const Identifier &id) const
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
constexpr unsigned int N_CHIPS_PER_SIDE
std::vector< unsigned int > endDefects
void addDependency(const EventIDRange &range)
Identifier strip_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
For an individual strip.