8#include "CaloDetDescr/CaloDetDescrElement.h"
46 return StatusCode::FAILURE;
51 ATH_MSG_ERROR(
"Do not have Onl-Ofl cabling map for SuperCells !!!!");
52 return StatusCode::FAILURE;
57 ATH_MSG_ERROR(
"Do not have CaloSuperCellDetDescrManager !!!!");
58 return StatusCode::FAILURE;
64 return StatusCode::FAILURE;
71 return StatusCode::FAILURE;
79 return StatusCode::SUCCESS;
81 ATH_MSG_DEBUG(
"Reading SuperCell container with key " <<
m_SCKey.key() <<
", size=" << scHdl->size());
88 return StatusCode::SUCCESS;
90 ATH_MSG_DEBUG(
"Reading LArRawChannel container with key " <<
m_RCKey.key() <<
", size=" << rcHdl->size());
96 bcidavgshift = bcidavgshiftHdl.
cptr();
99 const unsigned int bcid = ctx.eventID().bunch_crossing_id();
107 std::vector<std::vector<MonValues>> MonValueVec(
m_layerNames.size());
109 for (
const LArRawSC* rawSC : *scHdl) {
110 const std::vector<unsigned short>& bcids = rawSC->bcids();
111 const std::vector<int>& energies = rawSC->energies();
112 const std::vector<bool>& satur = rawSC->satur();
117 const size_t nBCIDs = bcids.size();
119 for (i = 0; i < nBCIDs && bcids[i] != bcid; i++)
124 if (!bcSCCont->
status(rawSC->hardwareID()).
good())
130 Identifier off_id = cablingSCHdl->cnvToIdentifier(rawSC->hardwareID());
136 return StatusCode::FAILURE;
138 const std::vector<Identifier>& regularIDs =
m_scidtool->superCellToOfflineID(off_id);
139 std::set<HWIdentifier> hwids;
141 hwids.insert(cablingHdl->createSignalChannelID(
id));
145 const size_t nChans = rcHdl->size();
146 bool hasBadChan =
false;
147 for (
size_t i = 0; i < nChans && !hwids.empty(); ++i) {
149 if (hwids.contains(
rc.hardwareID())) {
150 if (
m_bcMask.cellShouldBeMasked(bcCont,
rc.hardwareID())) {
155 eneSum +=
rc.energy();
157 eneSum -= bcidavgshift->
average(
rc.hardwareID());
158 hwids.erase(
rc.hardwareID());
164 <<
" is connected to at least one bad channel. Ignoring SC.");
167 if (!hwids.empty()) {
169 <<
" attached regular RawChannels not found");
173 scEne *= 12.5 / scDDE->
sinTh();
175 <<
"]=" << scEne <<
" Sum of RC energies=" << eneSum <<
", Ratio=" << (eneSum != 0 ? scEne / eneSum : 0.0));
179 <<
"]=" << scEne <<
" Sum of RC energies=" << eneSum);
183 if ( eneSum != 0 and scEne != 0 ){
184 eneFrac = scEne / eneSum;
192 const int side =
m_onlineID->pos_neg(rawSC->hardwareID());
193 const unsigned iLyr=iLyrNS*2+side;
195 auto& lvaluemap = MonValueVec[iLyr];
200 auto& monPair = monVars[iPart];
201 monPair.first = scEne;
202 monPair.second = eneSum;
205 lvaluemap.emplace_back(
eta,
phi, scEne, eneSum, eneFrac);
212 for (
size_t ilayer = 0; ilayer < MonValueVec.size(); ++ilayer) {
213 const auto& tool = MonValueVec[ilayer];
221 part_eta, part_phi, part_scEne, part_eneSum, part_eneFrac);
226 return StatusCode::SUCCESS;
230 const int s =
m_calo_id->calo_sample(
id);
247 const int pNoSide = samplingToPartitonMap[s];
252 return (
m_calo_id->pos_neg(
id) < 0) ? pNoSide + 1 : pNoSide;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
LArBadXCont< LArBadChannel > LArBadChannelCont
const ServiceHandle< StoreGateSvc > & detStore() const
virtual StatusCode initialize() override
initialize
ToolHandleArray< GenericMonitoringTool > m_tools
Array of Generic Monitoring Tools.
float average(const Identifier &id) const
This class groups all DetDescr information related to a CaloCell.
float sinTh() const
for algorithm working in transverse Energy
float eta_raw() const
cell eta_raw
CaloCell_ID::CaloSample getSampling() const
cell sampling
float eta() const
cell eta
float phi_raw() const
cell phi_raw
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
bool good() const
Returns true if no problems at all (all bits at zero)
LArBC_t status(const HWIdentifier channel) const
Query the status of a particular channel or FEB This is the main client access method.
Liquid Argon ROD output object base class.
Liquid Argon SuperCell raw data.
const LArOnlineID * m_onlineID
SG::ReadHandleKey< LArRawChannelContainer > m_RCKey
const CaloCell_ID * m_calo_id
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
StringArrayProperty m_partitionNames
Gaudi::Property< bool > m_warnOffenders
int getPartition(const Identifier &scid) const
SG::ReadHandleKey< CaloBCIDAverage > m_caloBCIDAvg
std::map< std::string, int > m_toolmapPerLayer
SG::ReadCondHandleKey< LArBadChannelCont > m_badChanKey
StringArrayProperty m_layerNames
const std::array< unsigned, CaloSampling::Unknown > m_caloSamplingToLyrNS
virtual StatusCode initialize() override final
initialize
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingSCKey
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > m_caloSuperCellMgrKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Gaudi::Property< int > m_scEneCut
SG::ReadCondHandleKey< LArBadChannelCont > m_badSCKey
SG::ReadHandleKey< LArRawSCContainer > m_SCKey
Gaudi::Property< std::vector< std::string > > m_problemsToMask
Gaudi::Property< std::string > m_MonGroupName
LArBadChannelMask m_bcMask
ToolHandle< ICaloSuperCellIDTool > m_scidtool
Declare a monitored scalar variable.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
std::vector< V > buildToolMap(const ToolHandleArray< GenericMonitoringTool > &tools, const std::string &baseName, int nHist)
Builds an array of indices (base case)
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
void fill(H5::Group &out_file, size_t iterations)