Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <LArCelldeadOTXTool.h>
|
SG::ReadHandleKey< LArRawSCContainer > | m_SCKey {this, "keySC", "SC_ET","Key for SuperCells container"} |
|
SG::ReadCondHandleKey< LArBadFebCont > | m_MFKey {this, "keyMF", "LArBadFeb", "Key for missing FEBs"} |
|
SG::ReadCondHandleKey< LArBadChannelCont > | m_badSCKey {this, "BadSCKey", "LArBadChannelSC", "Key of the LArBadChannelCont SC" } |
|
SG::ReadCondHandleKey< LArOnOffIdMapping > | m_cablingKey {this, "keyCabling", "LArOnOffIdMap", "Key for the cabling"} |
|
SG::ReadCondHandleKey< LArOnOffIdMapping > | m_cablingSCKey {this, "keySCCabling", "LArOnOffIdMapSC", "Key for the cabling of the SC"} |
|
SG::ReadCondHandleKey< CaloDetDescrManager > | m_caloMgrKey {this,"CaloDetDescrManager", "CaloDetDescrManager"} |
|
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} |
|
const LArOnlineID * | m_onlineID =nullptr |
|
const CaloCell_ID * | m_calo_id =nullptr |
|
ToolHandle< ICaloSuperCellIDTool > | m_scidtool {this, "CaloSuperCellIDTool", "CaloSuperCellIDTool", "Offline / SuperCell ID mapping tool"} |
|
std::once_flag m_onceFlag | ATLAS_THREAD_SAFE |
|
scToDeadCellMap_t m_scToDead | ATLAS_THREAD_SAFE |
|
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 23 of file LArCelldeadOTXTool.h.
◆ scToDeadCellMap_t
◆ ~LArCelldeadOTXTool()
LArCelldeadOTXTool::~LArCelldeadOTXTool |
( |
| ) |
|
|
default |
◆ buildMap()
void LArCelldeadOTXTool::buildMap |
( |
const EventContext & |
ctx, |
|
|
scToDeadCellMap_t & |
map, |
|
|
StatusCode & |
sc |
|
) |
| const |
|
private |
Definition at line 130 of file LArCelldeadOTXTool.cxx.
133 sc = StatusCode::FAILURE;
136 if (!cablingHdl.isValid()) {
143 if (!cablingSCHdl.isValid()) {
144 ATH_MSG_ERROR(
"Do not have Onl-Ofl cabling map for SuperCells !!!!");
151 if (!mfHdl.isValid()) {
157 if (!caloMgrHandle.isValid()) {
165 if (!bcSCHdl.isValid()) {
171 const auto& badFebs = mfHdl->
fullCont();
173 unsigned nDeadFebs = 0;
174 for (
const auto& idBF : badFebs) {
175 if (idBF.second.deadReadout()) {
180 for (
unsigned ch = 0;
ch < nChans; ++
ch) {
186 if (!bcSCCont->
status(scHwid).good()) {
188 <<
" is ignored b/c of it's bad-channel word. Connected to deadFEB channel " <<
m_onlineID->
channel_name(chid));
191 const unsigned nCell = (
m_scidtool->superCellToOfflineID(scID)).
size();
197 const float convFactor = 12.5 * (1.0 / nCell) * (1.0 / dde->
sinTh());
199 scToHwidMap[scHwid].emplace_back(hashId, convFactor);
205 ATH_MSG_INFO(
"Number of deadReadout FEBs for this run: " << nDeadFebs);
207 for (
const auto&
p : scToHwidMap) {
208 ATH_MSG_DEBUG(
" SuperCell with id 0x" << std::hex <<
p.first.get_identifier32().get_compact() << std::dec <<
" connected to " <<
p.second.size()
209 <<
" deadFEB channels.");
210 for (
const auto& [
h, convFactor] :
p.second) {
211 const HWIdentifier hwid = cablingHdl->createSignalChannelIDFromHash(
h);
216 sc = StatusCode::SUCCESS;
◆ finalize()
StatusCode LArCelldeadOTXTool::finalize |
( |
| ) |
|
|
finaloverridevirtual |
Definition at line 220 of file LArCelldeadOTXTool.cxx.
223 std::vector<std::pair<float, float> > avgList;
224 for (
auto& [scEne,
entry] : m_testMap) {
225 avgList.emplace_back(scEne,
entry.first /
entry.second);
227 auto ordering = [](
const std::pair<float, float>&
a, std::pair<float, float>&
b) {
return (
a.first <
b.first); };
229 for (
auto&
p : avgList) {
230 ATH_MSG_INFO(
"SCEne=" <<
p.first <<
"Avg patching ratio=" <<
p.second);
233 return StatusCode::SUCCESS;
◆ initialize()
StatusCode LArCelldeadOTXTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
Definition at line 13 of file LArCelldeadOTXTool.cxx.
29 "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");
32 return StatusCode::SUCCESS;
◆ process()
Definition at line 35 of file LArCelldeadOTXTool.cxx.
38 if (!cellCollection) {
39 ATH_MSG_ERROR(
"Cell Correction tool receives invalid cell Collection");
40 return StatusCode::FAILURE;
47 return StatusCode::SUCCESS;
54 ATH_MSG_ERROR(
"Call to LArCelldeadOTXTool::buidMap returned an error");
55 return StatusCode::FAILURE;
58 if (m_scToDead.empty()) {
59 return StatusCode::SUCCESS;
64 if (!scHdl.isValid()) {
69 return StatusCode::SUCCESS;
72 const unsigned int bcid = ctx.eventID().bunch_crossing_id();
76 for (
const auto*
sc : *scells) {
80 auto itr = m_scToDead.find(scHwid);
81 if (itr == m_scToDead.end())
84 const std::vector<unsigned short>& bcids =
sc->bcids();
85 const std::vector<int>& energies =
sc->energies();
86 const std::vector<bool>& satur =
sc->satur();
90 const size_t nBCIDs = bcids.size();
92 for (
i = 0;
i < nBCIDs && bcids[
i] !=
bcid;
i++)
102 float patchEneSum = 0;
103 for (
const auto& [
h, convFactor] : itr->second) {
106 const float patchEne = scEne * convFactor;
108 cellESum +=
cell->energy();
109 patchEneSum += patchEne;
111 ATH_MSG_DEBUG(
"Cell id 0x" << std::hex <<
cell->ID().get_identifier32().get_compact() <<
" Replacing energy " <<
cell->energy() <<
" " << patchEne
112 <<
", SCene=" << scEne);
113 cell->setEnergy(patchEne);
118 const float ratio = patchEneSum != 0 ? cellESum / patchEneSum : 0;
120 std::scoped_lock
l(
m_mtx);
121 auto&
entry = m_testMap[scEne];
127 return StatusCode::SUCCESS;
◆ ATLAS_THREAD_SAFE [1/3]
std::once_flag m_onceFlag LArCelldeadOTXTool::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [2/3]
◆ ATLAS_THREAD_SAFE [3/3]
std::unordered_map<int,std::pair<float,int> > m_testMap LArCelldeadOTXTool::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ m_badSCKey
◆ m_cablingKey
◆ m_cablingSCKey
◆ m_calo_id
◆ m_caloMgrKey
◆ m_MFKey
◆ m_mtx
std::mutex LArCelldeadOTXTool::m_mtx |
|
mutableprivate |
◆ m_nWarnings
std::atomic<int> LArCelldeadOTXTool::m_nWarnings {0} |
|
mutableprivate |
◆ m_onlineID
◆ m_scCut
Gaudi::Property<int> LArCelldeadOTXTool::m_scCut {this,"SCEneCut",70,"Do not use super-cells with values below this cut"} |
|
private |
◆ m_scidtool
◆ 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:
def retrieve(aClass, aKey=None)
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
Container class for LArRawSC.
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
#define ATH_MSG_VERBOSE(x)
LArBC_t status(const HWIdentifier channel) const
Query the status of a particular channel or FEB This is the main client access method.
value_type get_compact() const
Get the compact id.
const BadChanVec & fullCont() const
int channelInSlotMax(const HWIdentifier Id) const
Return the Maximum channel number of a given feb slot.
::StatusCode StatusCode
StatusCode definition for legacy code.
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
HWIdentifier createSignalChannelID(const Identifier &id) const
create a HWIdentifier from an Identifier (not inline)
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
StatusCode initialize(bool used=true)
setEventNumber setTimeStamp bcid
This class provides the client interface for accessing the detector description information common to...
Data object for each calorimeter readout cell.
Identifier cnvToIdentifier(const HWIdentifier &sid) const
create an Identifier from a HWIdentifier (inline)
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.
#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
float sinTh() const
for algorithm working in transverse Energy
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.