#include <LArCelldeadOTXTool.h>
|
SG::ReadHandleKey< LArRawSCContainer > | m_SCKey {this, "keySC", "SC_ET","Key for SuperCells container"} |
|
SG::ReadCondHandleKey< LArDeadOTXCorrFactors > | m_factors {this,"SCFactors","LArDeadOTXCorrFactors"} |
|
Gaudi::Property< int > | m_scCut {this,"SCEneCut",70,"Do not use super-cells with values below this cut"} |
|
Gaudi::Property< bool > | m_testMode {this,"TestMode",false} |
|
std::unordered_map< int, std::pair< float, int > > m_testMap | ATLAS_THREAD_SAFE |
|
std::mutex | m_mtx |
|
std::atomic< int > | m_nWarnings {0} |
|
Definition at line 19 of file LArCelldeadOTXTool.h.
◆ ~LArCelldeadOTXTool()
LArCelldeadOTXTool::~LArCelldeadOTXTool |
( |
| ) |
|
|
default |
◆ finalize()
StatusCode LArCelldeadOTXTool::finalize |
( |
| ) |
|
|
finaloverridevirtual |
Definition at line 114 of file LArCelldeadOTXTool.cxx.
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); };
123 for (
auto&
p : avgList) {
124 ATH_MSG_INFO(
"SCEne=" <<
p.first <<
"Avg patching ratio=" <<
p.second);
127 return StatusCode::SUCCESS;
◆ initialize()
StatusCode LArCelldeadOTXTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
Definition at line 11 of file LArCelldeadOTXTool.cxx.
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;
◆ process()
Definition at line 24 of file LArCelldeadOTXTool.cxx.
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;
47 if (!scHdl.isValid()) {
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;
◆ ATLAS_THREAD_SAFE
std::unordered_map<int,std::pair<float,int> > m_testMap LArCelldeadOTXTool::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ m_factors
◆ m_mtx
std::mutex LArCelldeadOTXTool::m_mtx |
|
mutableprivate |
◆ m_nWarnings
std::atomic<int> LArCelldeadOTXTool::m_nWarnings {0} |
|
mutableprivate |
◆ m_scCut
Gaudi::Property<int> LArCelldeadOTXTool::m_scCut {this,"SCEneCut",70,"Do not use super-cells with values below this cut"} |
|
private |
◆ m_SCKey
◆ m_testMode
Gaudi::Property<bool> LArCelldeadOTXTool::m_testMode {this,"TestMode",false} |
|
private |
The documentation for this class was generated from the following files:
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.