|
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 |
|
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 120 of file LArCelldeadOTXTool.cxx.
123 sc = StatusCode::FAILURE;
126 if (!cablingHdl.isValid()) {
133 if (!cablingSCHdl.isValid()) {
134 ATH_MSG_ERROR(
"Do not have Onl-Ofl cabling map for SuperCells !!!!");
141 if (!mfHdl.isValid()) {
147 if (!caloMgrHandle.isValid()) {
155 if (!bcSCHdl.isValid()) {
161 const auto& badFebs = mfHdl->
fullCont();
163 unsigned nDeadFebs = 0;
164 for (
const auto& idBF : badFebs) {
165 if (idBF.second.deadReadout()) {
170 for (
unsigned ch = 0;
ch < nChans; ++
ch) {
176 if (!bcSCCont->
status(scHwid).good()) {
178 <<
" is ignored b/c of it's bad-channel word. Connected to deadFEB channel " <<
m_onlineID->
channel_name(chid));
181 const unsigned nCell = (
m_scidtool->superCellToOfflineID(scID)).
size();
187 const float convFactor = 12.5 * (1.0 / nCell) * (1.0 / dde->
sinTh());
189 scToHwidMap[scHwid].emplace_back(hashId, convFactor);
197 for (
const auto&
p : scToHwidMap) {
198 ATH_MSG_DEBUG(
" SuperCell with id 0x" << std::hex <<
p.first.get_identifier32().get_compact() << std::dec <<
" connected to " <<
p.second.size()
199 <<
" deadFEB channels.");
200 for (
const auto& [
h, convFactor] :
p.second) {
201 const HWIdentifier hwid = cablingHdl->createSignalChannelIDFromHash(
h);
206 sc = StatusCode::SUCCESS;
◆ finalize()
StatusCode LArCelldeadOTXTool::finalize |
( |
| ) |
|
|
finaloverridevirtual |
Definition at line 210 of file LArCelldeadOTXTool.cxx.
213 std::vector<std::pair<float, float> > avgList;
214 for (
auto& [scEne,
entry] : m_testMap) {
215 avgList.emplace_back(scEne,
entry.first /
entry.second);
217 auto ordering = [](
const std::pair<float, float>&
a, std::pair<float, float>&
b) {
return (
a.first <
b.first); };
219 for (
auto&
p : avgList) {
220 ATH_MSG_INFO(
"SCEne=" <<
p.first <<
"Avg patching ratio=" <<
p.second);
223 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 ATH_MSG_ERROR(
"Call to LArCelldeadOTXTool::buidMap returned an error");
48 return StatusCode::FAILURE;
51 if (m_scToDead.empty()) {
52 return StatusCode::SUCCESS;
57 if (!scHdl.isValid()) {
59 return StatusCode::SUCCESS;
62 const unsigned int bcid = ctx.eventID().bunch_crossing_id();
66 for (
const auto*
sc : *scells) {
70 auto itr = m_scToDead.find(scHwid);
71 if (itr == m_scToDead.end())
74 const std::vector<unsigned short>& bcids =
sc->bcids();
75 const std::vector<int>& energies =
sc->energies();
76 const std::vector<bool>& satur =
sc->satur();
80 const size_t nBCIDs = bcids.size();
82 for (
i = 0;
i < nBCIDs && bcids[
i] !=
bcid;
i++)
92 float patchEneSum = 0;
93 for (
const auto& [
h, convFactor] : itr->second) {
96 const float patchEne = scEne * convFactor;
98 cellESum +=
cell->energy();
99 patchEneSum += patchEne;
101 ATH_MSG_DEBUG(
"Cell id 0x" << std::hex <<
cell->ID().get_identifier32().get_compact() <<
" Replacing energy " <<
cell->energy() <<
" " << patchEne
102 <<
", SCene=" << scEne);
103 cell->setEnergy(patchEne);
108 const float ratio = patchEneSum != 0 ? cellESum / patchEneSum : 0;
110 std::scoped_lock
l(
m_mtx);
111 auto&
entry = m_testMap[scEne];
117 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_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)
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.