|
ATLAS Offline Software
|
Go to the documentation of this file.
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;
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;
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;
123 sc = StatusCode::FAILURE;
134 ATH_MSG_ERROR(
"Do not have Onl-Ofl cabling map for SuperCells !!!!");
147 if (!caloMgrHandle.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) {
206 sc = StatusCode::SUCCESS;
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); };
218 std::sort(avgList.begin(), avgList.end(),
ordering);
219 for (
auto&
p : avgList) {
220 ATH_MSG_INFO(
"SCEne=" <<
p.first <<
"Avg patching ratio=" <<
p.second);
223 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
HWIdentifier createSignalChannelIDFromHash(const IdentifierHash &id_hash) const
create a HWIdentifier from an Identifier (from hash) (inline)
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
const_pointer_type cptr()
Dereference the pointer.
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)
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.
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)
#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.
const_pointer_type cptr()