9#include "CaloDetDescr/CaloDetDescrElement.h"
11#include "GaudiKernel/ThreadLocalContext.h"
16#include "CoralBase/Blob.h"
17#include "CoralBase/Attribute.h"
18#include "CoralBase/AttributeList.h"
19#include "CoralBase/AttributeListSpecification.h"
22#include "CoolKernel/StorageType.h"
42 << name() <<
".tQThreshold and "
43 << name() <<
".samplesThreshold for DSP thresholds" );
45 else if (
m_mode ==
"group") {
47 ATH_MSG_INFO (
"Will used cell groups defined in jobO " << name() <<
".CellGroup for DSP thresholds" );
52 return StatusCode::FAILURE;
57 return StatusCode::FAILURE;
60 else if (
m_mode ==
"noise") {
64 ATH_MSG_INFO (
"Will used ICaloCellTool::totalNoiseRMS times " << name() <<
".sigmaNoiseSamples and" );
66 ATH_MSG_INFO (
"Will used ICaloCellTool::elecNoiseRMS times " << name() <<
".sigmaNoiseSamples and" );
69 ATH_MSG_INFO (
"ICaloCellTool::totalNoiseRMS times " << name() <<
".sigmaNoiseQt for DSP thresholds" );
71 ATH_MSG_INFO (
"ICaloCellTool::elecNoiseRMS times " << name() <<
".sigmaNoiseQt for DSP thresholds" );
78 return StatusCode::SUCCESS;
86 const EventContext& ctx = Gaudi::Hive::currentContext();
94 coral::AttributeListSpecification* spec =
new coral::AttributeListSpecification();
95 spec->extend(
"tQThr",
"blob");
96 spec->extend(
"samplesThr",
"blob");
97 spec->extend(
"trigSumThr",
"blob");
98 spec->extend(
"Name",
"string");
104 coral::Blob& tQThrBlob = (*attr)[
"tQThr"].data<coral::Blob>();
105 coral::Blob& samplesThrBlob = (*attr)[
"samplesThr"].data<coral::Blob>();
106 coral::Blob& trigSumThrBlob = (*attr)[
"trigSumThr"].data<coral::Blob>();
108 tQThrBlob.resize(hashMax*
sizeof(
float));
109 samplesThrBlob.resize(hashMax*
sizeof(
float));
110 trigSumThrBlob.resize(hashMax*
sizeof(
float));
112 float* ptQThrBlob=
static_cast<float*
>(tQThrBlob.startingAddress());
113 float* psamplesBlob=
static_cast<float*
>(samplesThrBlob.startingAddress());
114 float* ptrigSumBlob=
static_cast<float*
>(trigSumThrBlob.startingAddress());
127 return StatusCode::FAILURE;
134 totalNoise = totalNoiseH.
cptr();
136 elecNoise = elecNoiseH.
cptr();
147 for (
unsigned hs=0;hs<hashMax;++hs) {
149 const Identifier id=cabling->cnvToIdentifier(chid);
150 ATH_MSG_DEBUG (
"cell id: " <<
id <<
" " << cabling->isOnlineConnected(chid) );
152 if(!cabling->isOnlineConnected(chid)){
153 ATH_MSG_DEBUG (
"cell id: " <<
id <<
" not connected channel, skip " );
175 const std::vector<float>& thrs=
m_thrPerCell.valuesForCell(
id);
176 if(thrs.size()!=2) std::cout <<
"len=" << thrs.size() << std::endl;
177 ptQThrBlob[hs]=thrs[0];
178 psamplesBlob[hs]=thrs[1];
179 ptrigSumBlob[hs]=thrs[0];
185 return StatusCode::FAILURE;
196 float samplesThr = 0.;
200 samplesThr = totalNoise->
getNoise(
id,igain);
202 samplesThr = elecNoise->
getNoise(
id,igain);
205 QtThr = totalNoise->
getNoise(
id,igain);
207 QtThr = elecNoise->
getNoise(
id,igain);
221 }
else if ( (
m_onlineID->isHECchannel(chid) && (slot==7 || slot==8) ) ||
222 (
m_onlineID->isEMECchannel(chid) && (slot==12||slot==13)) ) {
241 return StatusCode::FAILURE;
243 std::ofstream outfile;
246 return StatusCode::FAILURE;
249 if (outfile.is_open()) {
254 return StatusCode::FAILURE;
257 std::vector<HWIdentifier>::const_iterator chanIt=
m_onlineID->channel_begin();
258 std::vector<HWIdentifier>::const_iterator chanIt_e=
m_onlineID->channel_end ();
259 for (;chanIt!=chanIt_e;++chanIt) {
269 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
LArBadXCont< LArBadChannel > LArBadChannelCont
const ServiceHandle< StoreGateSvc > & detStore() const
An AttributeList represents a logical row of attributes in a metadata table.
Helper base class for offline cell identifiers.
Helper class for offline cell identifiers.
This class groups all DetDescr information related to a CaloCell.
IdentifierHash calo_hash() const
cell calo hash
float eta() const
cell eta
float phi() const
cell phi
bool is_lar_fcal() const
cell belongs to FCAL
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
This class provides the client interface for accessing the detector description information common to...
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
value_type get_compact() const
Get the compact id.
Gaudi::Property< float > m_scaleIW
virtual ~LArDSPThresholdFillInline()
FloatProperty m_maskedsamplesThrsh
StringArrayProperty m_cellGroupStr
SG::ReadCondHandleKey< CaloNoise > m_totalNoiseKey
SG::ReadCondHandleKey< CaloNoise > m_elecNoiseKey
LArBadChannelMask m_bcMask
Handle to bad-channel mask.
const LArOnlineID * m_onlineID
Gaudi::Property< std::vector< std::string > > m_problemsToMask
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
BooleanProperty m_usePileupNoiseQt
StringProperty m_outFileName
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
virtual StatusCode stop() override
FloatProperty m_samplesThrsh
virtual StatusCode initialize() override
BooleanProperty m_usePileupNoiseSamples
StringProperty m_nameOfSet
FloatProperty m_sigmaNoiseQt
CaloCellGroupList m_thrPerCell
FloatProperty m_maskedtqThrsh
BooleanProperty m_maskBadChannels
FloatProperty m_sigmaNoiseSamples
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
float trigSumThr(const HWIdentifier &CellID) const
float samplesThr(const HWIdentifier &CellID) const
float tQThr(const HWIdentifier &CellID) const
const_pointer_type cptr()