 |
ATLAS Offline Software
|
Go to the documentation of this file.
18 "Test mode activated with additional debug output. Makes only sense if we try to patch a FEB that is actually there, so we have a reference");
21 return StatusCode::SUCCESS;
27 if (!cellCollection) {
28 ATH_MSG_ERROR(
"Cell Correction tool receives invalid cell Collection");
29 return StatusCode::FAILURE;
36 return StatusCode::SUCCESS;
41 if (scToDead.empty()) {
42 return StatusCode::SUCCESS;
52 return StatusCode::SUCCESS;
55 const unsigned int bcid = ctx.eventID().bunch_crossing_id();
59 for (
const auto*
sc : *scells) {
63 auto itr = scToDead.find(scHwid);
64 if (itr == scToDead.end())
67 const std::vector<unsigned short>& bcids =
sc->bcids();
68 const std::vector<int>& energies =
sc->energies();
69 const std::vector<bool>& satur =
sc->satur();
73 const size_t nBCIDs = bcids.size();
75 for (
i = 0;
i < nBCIDs && bcids[
i] !=
bcid;
i++)
81 ATH_MSG_VERBOSE(
"SuperCell value " << scEne <<
" below threshold, ignoring");
85 float patchEneSum = 0;
86 for (
const auto& [
h, convFactor] : itr->second) {
89 const float patchEne = scEne * convFactor;
91 cellESum +=
cell->energy();
92 patchEneSum += patchEne;
94 ATH_MSG_DEBUG(
"Cell id 0x" << std::hex <<
cell->ID().get_identifier32().get_compact() <<
" Replacing energy " <<
cell->energy() <<
" " << patchEne
95 <<
", SCene=" << scEne);
96 cell->setEnergy(patchEne);
101 const float ratio = patchEneSum != 0 ? cellESum / patchEneSum : 0;
103 std::scoped_lock
l(
m_mtx);
104 auto&
entry = m_testMap[scEne];
110 return StatusCode::SUCCESS;
117 std::vector<std::pair<float, float> > avgList;
118 for (
auto& [scEne,
entry] : m_testMap) {
119 avgList.emplace_back(scEne,
entry.first /
entry.second);
121 auto ordering = [](
const std::pair<float, float>&
a, std::pair<float, float>&
b) {
return (
a.first <
b.first); };
122 std::sort(avgList.begin(), avgList.end(),
ordering);
123 for (
auto&
p : avgList) {
124 ATH_MSG_INFO(
"SCEne=" <<
p.first <<
"Avg patching ratio=" <<
p.second);
127 return StatusCode::SUCCESS;
const_pointer_type cptr()
Dereference the pointer.
Container class for LArRawSC.
#define ATH_MSG_VERBOSE(x)
std::map< HWIdentifier, std::vector< std::pair< IdentifierHash, float > > > payload_t
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
StatusCode initialize(bool used=true)
setEventNumber setTimeStamp bcid
Container class for CaloCell.
Data object for each calorimeter readout cell.
#define ATH_MSG_WARNING(x)
bool hasCalo(const CaloCell_ID::SUBCALO caloNum) const
tell wether it has been filled with cells (maybe none) of a given calo