ATLAS Offline Software
Loading...
Searching...
No Matches
LArDSPThresholdFillInline Class Reference

#include <LArDSPThresholdFillInline.h>

Inheritance diagram for LArDSPThresholdFillInline:
Collaboration diagram for LArDSPThresholdFillInline:

Public Member Functions

virtual ~LArDSPThresholdFillInline ()
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &) const override
virtual StatusCode stop () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

enum  mode_t { FIXED , GROUP , NOISE }
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey {this,"CaloDetDescrManager","CaloDetDescrManager","SG Key for CaloDetDescrManager in the Condition Store" }
const LArOnlineIDm_onlineID = nullptr
StringProperty m_nameOfSet { this, "NameOfSet", "" }
StringProperty m_key { this, "Key", "DSPThresholds" }
StringProperty m_mode
StringArrayProperty m_cellGroupStr { this, "ThresholdsPerCellGroup", {} }
FloatProperty m_tqThrsh { this, "tQThreshold", 250 }
FloatProperty m_samplesThrsh { this, "samplesThreshold", 1000 }
FloatProperty m_sigmaNoiseSamples {this, "sigmaNoiseSamples", 0 }
FloatProperty m_sigmaNoiseQt {this, "sigmaNoiseQt", 0 }
BooleanProperty m_usePileupNoiseSamples {this, "usePileupNoiseSamples", false }
BooleanProperty m_usePileupNoiseQt {this, "usePileupNoiseQt", false }
BooleanProperty m_maskBadChannels { this, "MaskBadChannels", false }
FloatProperty m_maskedtqThrsh { this, "MaskedtQThreshold", static_cast<float>(0x7fffffff) }
FloatProperty m_maskedsamplesThrsh { this, "MaskedsamplesThreshold", static_cast<float>(0x7fffffff) }
BooleanProperty m_dump { this, "Dump", false }
StringProperty m_outFileName { this, "OutFile", "out.txt" }
BooleanProperty m_fill { this, "Fill", true }
SG::ReadCondHandleKey< CaloNoisem_totalNoiseKey { this, "TotalNoiseKey", "totalNoise", "SG key for total noise" }
SG::ReadCondHandleKey< CaloNoisem_elecNoiseKey { this, "ElecNoiseKey", "electronicNoise", "SG key for electronic noise" }
LArBadChannelMask m_bcMask
 Handle to bad-channel mask.
SG::ReadCondHandleKey< LArBadChannelContm_bcContKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}
Gaudi::Property< std::vector< std::string > > m_problemsToMask {this,"ProblemsToMask",{}, "Bad-Channel categories to mask"}
Gaudi::Property< float > m_scaleIW {this,"ScaleIW",0.,"if >0 scale EMEC IW, HEC thresholds with this factor"}
mode_t m_workmode {FIXED}
CaloCellGroupList m_thrPerCell
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 20 of file LArDSPThresholdFillInline.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ mode_t

Constructor & Destructor Documentation

◆ ~LArDSPThresholdFillInline()

LArDSPThresholdFillInline::~LArDSPThresholdFillInline ( )
virtualdefault

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

virtual StatusCode LArDSPThresholdFillInline::execute ( const EventContext & ) const
inlineoverridevirtual

Definition at line 25 of file LArDSPThresholdFillInline.h.

25{return StatusCode::SUCCESS;}

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ initialize()

StatusCode LArDSPThresholdFillInline::initialize ( )
overridevirtual

Definition at line 27 of file LArDSPThresholdFillInline.cxx.

27 {
28
29 ATH_MSG_DEBUG ( "start initialize()" );
30
31 ATH_CHECK( detStore()->retrieve(m_onlineID,"LArOnlineID") );
32 ATH_CHECK( m_cablingKey.initialize() );
33 ATH_CHECK( m_caloMgrKey.initialize() );
34
36 ATH_CHECK(m_bcMask.buildBitMask(m_problemsToMask,msg()));
37
38
39 if (m_mode == "fixed") {
41 ATH_MSG_INFO ( "Will used fixed values defined by jobO "
42 << name() <<".tQThreshold and "
43 << name() << ".samplesThreshold for DSP thresholds" );
44 }
45 else if (m_mode == "group") {
47 ATH_MSG_INFO ( "Will used cell groups defined in jobO " << name() << ".CellGroup for DSP thresholds" );
48 const CaloCell_ID* caloCellID = nullptr;
49 ATH_CHECK( detStore()->retrieve(caloCellID,"CaloCell_ID") );
50
51 if (m_thrPerCell.setDefinition(dynamic_cast<const CaloCell_Base_ID*>(caloCellID),m_cellGroupStr,msg())==false)
52 return StatusCode::FAILURE;
53 m_thrPerCell.printDef();
54
55 if (m_thrPerCell.getDefaults().size()!=2) {
56 ATH_MSG_ERROR ( "Expected 2 values per cell group, got " << m_thrPerCell.getDefaults().size() );
57 return StatusCode::FAILURE;
58 }
59 }
60 else if (m_mode == "noise") {
62
64 ATH_MSG_INFO ( "Will used ICaloCellTool::totalNoiseRMS times " << name() << ".sigmaNoiseSamples and" );
65 else
66 ATH_MSG_INFO ( "Will used ICaloCellTool::elecNoiseRMS times " << name() << ".sigmaNoiseSamples and" );
67
69 ATH_MSG_INFO ( "ICaloCellTool::totalNoiseRMS times " << name() << ".sigmaNoiseQt for DSP thresholds" );
70 else
71 ATH_MSG_INFO ( "ICaloCellTool::elecNoiseRMS times " << name() << ".sigmaNoiseQt for DSP thresholds" );
72
73 }
74
75 ATH_CHECK( m_totalNoiseKey.initialize (m_workmode == NOISE) );
76 ATH_CHECK( m_elecNoiseKey.initialize (m_workmode == NOISE) );
77
78 return StatusCode::SUCCESS;
79}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
const ServiceHandle< StoreGateSvc > & detStore() const
SG::ReadCondHandleKey< CaloNoise > m_totalNoiseKey
SG::ReadCondHandleKey< CaloNoise > m_elecNoiseKey
LArBadChannelMask m_bcMask
Handle to bad-channel mask.
Gaudi::Property< std::vector< std::string > > m_problemsToMask
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ stop()

StatusCode LArDSPThresholdFillInline::stop ( )
overridevirtual

Definition at line 81 of file LArDSPThresholdFillInline.cxx.

81 {
82
83 ATH_MSG_DEBUG ( "start stop()" );
84 if( m_scaleIW > 0.) { ATH_MSG_INFO (" Scaling EMECIW by: "<<m_scaleIW);}
85
86 const EventContext& ctx = Gaudi::Hive::currentContext();
87
88 if (m_fill) {
89
90 ATH_MSG_INFO ( "Filling database" );
91
92 unsigned hashMax=m_onlineID->channelHashMax();
93
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");
99
100 AthenaAttributeList* attr=new AthenaAttributeList(*spec);
101
102
103 (*attr)["Name"].setValue(m_nameOfSet);
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>();
107
108 tQThrBlob.resize(hashMax*sizeof(float));
109 samplesThrBlob.resize(hashMax*sizeof(float));
110 trigSumThrBlob.resize(hashMax*sizeof(float));
111
112 float* ptQThrBlob=static_cast<float*>(tQThrBlob.startingAddress());
113 float* psamplesBlob=static_cast<float*>(samplesThrBlob.startingAddress());
114 float* ptrigSumBlob=static_cast<float*>(trigSumThrBlob.startingAddress());
115
116 ATH_CHECK( detStore()->record(attr,m_key) );
117
118 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
119 ATH_CHECK(caloMgrHandle.isValid());
120 const CaloDetDescrManager *theCaloDDM = *caloMgrHandle;
121 ATH_MSG_INFO ( "theCaloDDM retrieved" );
122
123 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl (m_cablingKey, ctx);
124 const LArOnOffIdMapping* cabling{*cablingHdl};
125 if(!cabling) {
126 ATH_MSG_ERROR("Do not have mapping object " << m_cablingKey.key());
127 return StatusCode::FAILURE;
128 }
129
130 const CaloNoise* totalNoise = nullptr;
131 const CaloNoise* elecNoise = nullptr;
132 if (m_workmode == NOISE) {
133 SG::ReadCondHandle<CaloNoise> totalNoiseH (m_totalNoiseKey, ctx);
134 totalNoise = totalNoiseH.cptr();
135 SG::ReadCondHandle<CaloNoise> elecNoiseH (m_elecNoiseKey, ctx);
136 elecNoise = elecNoiseH.cptr();
137 }
138
139 //retrieve BadChannel info:
140 const LArBadChannelCont* bcCont=nullptr;
141 if (m_maskBadChannels) {
142 SG::ReadCondHandle<LArBadChannelCont> bcContHdl{m_bcContKey,ctx};
143 bcCont=(*bcContHdl);
144 }
145
146
147 for (unsigned hs=0;hs<hashMax;++hs) {
148 const HWIdentifier chid=m_onlineID->channel_Id(hs);
149 const Identifier id=cabling->cnvToIdentifier(chid);
150 ATH_MSG_DEBUG ( "cell id: " << id << " " << cabling->isOnlineConnected(chid) );
151
152 if(!cabling->isOnlineConnected(chid)){
153 ATH_MSG_DEBUG ( "cell id: " << id << " not connected channel, skip " );
154 // Same (very high) thresholds for disconnected channels as masked channels
155 ptQThrBlob[hs]=m_maskedtqThrsh;
156 psamplesBlob[hs]=m_maskedsamplesThrsh;
157 ptrigSumBlob[hs]=m_maskedtqThrsh;
158 continue;
159 }
160
161 if(m_maskBadChannels && m_bcMask.cellShouldBeMasked(bcCont,chid)){ // Default gain is CaloGain::UNKNOWNGAIN
162 ATH_MSG_DEBUG ( "cell id: " << id << " is masked; set thresholds to " << m_maskedtqThrsh << ", " << m_maskedsamplesThrsh );
163 ptQThrBlob[hs]=m_maskedtqThrsh;
164 psamplesBlob[hs]=m_maskedsamplesThrsh;
165 ptrigSumBlob[hs]=m_maskedtqThrsh;
166 continue;
167 }
168
169 if (m_workmode==FIXED) {
170 ptQThrBlob[hs]=m_tqThrsh;
171 psamplesBlob[hs]=m_samplesThrsh;
172 ptrigSumBlob[hs]=m_tqThrsh;
173 }
174 else if (m_workmode==GROUP) {
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];
180 }
181 else if (m_workmode==NOISE) {
182 const CaloDetDescrElement *caloDDE = theCaloDDM->get_element(id);
183 if(!caloDDE){
184 ATH_MSG_ERROR ( "Failed to return CaloDetDescrElement" );
185 return StatusCode::FAILURE;
186 }
188
189 if(caloDDE->is_lar_fcal())
191 else
193
194 ATH_MSG_DEBUG ( "hash, eta, phi: " << caloDDE->calo_hash() << ", " << caloDDE->eta() << ", " << caloDDE->phi() << "; noise: " << totalNoise->getNoise(id,igain) );
195
196 float samplesThr = 0.;
197 float QtThr = 0.;
198
200 samplesThr = totalNoise->getNoise(id,igain);
201 else
202 samplesThr = elecNoise->getNoise(id,igain);
203
205 QtThr = totalNoise->getNoise(id,igain);
206 else
207 QtThr = elecNoise->getNoise(id,igain);
208
209 ptQThrBlob[hs]=QtThr*m_sigmaNoiseQt;
210 psamplesBlob[hs]=samplesThr*m_sigmaNoiseSamples;
211 ptrigSumBlob[hs]=QtThr*m_sigmaNoiseQt;
212
213 }// end if NOISE
214
215 if( m_scaleIW > 0.) {
216 int slot = m_onlineID->slot(chid);
217 if (m_onlineID->isEMECIW(chid) ) {
218 ptQThrBlob[hs] *= m_scaleIW;
219 psamplesBlob[hs] *= m_scaleIW;
220 ptrigSumBlob[hs] *= m_scaleIW;
221 } else if ( (m_onlineID->isHECchannel(chid) && (slot==7 || slot==8) ) ||
222 (m_onlineID->isEMECchannel(chid) && (slot==12||slot==13)) ) {
223 ptQThrBlob[hs] *= m_scaleIW/2.;
224 psamplesBlob[hs] *= m_scaleIW/2.;
225 ptrigSumBlob[hs] *= m_scaleIW/2.;
226 }
227 } // scaling IW
228
229 }//end loop over cells
230 }//end if FILL
231
232 if (m_dump) {
233
234 const AthenaAttributeList* attr=0;
235
236 ATH_CHECK( detStore()->retrieve(attr,m_key) );
237
238 LArDSPThresholdsFlat cont(attr);
239 if (!cont.good()){
240 ATH_MSG_ERROR("LArDSPThresholdsFlat did not initialise.");
241 return StatusCode::FAILURE;
242 }
243 std::ofstream outfile;
244 if (!m_outFileName.size()) {
245 ATH_MSG_ERROR("No output file specified");
246 return StatusCode::FAILURE;
247 }
248 outfile.open(m_outFileName,std::ios::out);
249 if (outfile.is_open()) {
250 ATH_MSG_INFO ( "Writing to file " << m_outFileName );
251 }
252 else {
253 ATH_MSG_ERROR ( "Failed to open file " << m_outFileName );
254 return StatusCode::FAILURE;
255 }
256
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) {
260 const HWIdentifier chid=*chanIt;
261 outfile << std::fixed << chid.get_compact() << " " << cont.tQThr(chid) << " " << cont.samplesThr(chid) << " " << cont.trigSumThr(chid)
262 << std::endl;
263
264 } //end if loop over channels
265
266 outfile.close();
267 }// end if m_dump
268
269 return StatusCode::SUCCESS;
270}
LArBadXCont< LArBadChannel > LArBadChannelCont
bool is_lar_fcal() const
cell belongs to FCAL
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
Definition CaloNoise.h:35
value_type get_compact() const
Get the compact id.
Gaudi::Property< float > m_scaleIW
@ LARMEDIUMGAIN
Definition CaloGain.h:18
@ INVALIDGAIN
Definition CaloGain.h:18
@ LARHIGHGAIN
Definition CaloGain.h:18

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_WARNING(x)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_bcContKey

SG::ReadCondHandleKey<LArBadChannelCont> LArDSPThresholdFillInline::m_bcContKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}
private

Definition at line 68 of file LArDSPThresholdFillInline.h.

68{this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"};

◆ m_bcMask

LArBadChannelMask LArDSPThresholdFillInline::m_bcMask
private

Handle to bad-channel mask.

Definition at line 67 of file LArDSPThresholdFillInline.h.

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> LArDSPThresholdFillInline::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 29 of file LArDSPThresholdFillInline.h.

29{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> LArDSPThresholdFillInline::m_caloMgrKey {this,"CaloDetDescrManager","CaloDetDescrManager","SG Key for CaloDetDescrManager in the Condition Store" }
private

Definition at line 30 of file LArDSPThresholdFillInline.h.

30{this,"CaloDetDescrManager","CaloDetDescrManager","SG Key for CaloDetDescrManager in the Condition Store" };

◆ m_cellGroupStr

StringArrayProperty LArDSPThresholdFillInline::m_cellGroupStr { this, "ThresholdsPerCellGroup", {} }
private

Definition at line 40 of file LArDSPThresholdFillInline.h.

40{ this, "ThresholdsPerCellGroup", {} };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dump

BooleanProperty LArDSPThresholdFillInline::m_dump { this, "Dump", false }
private

Definition at line 57 of file LArDSPThresholdFillInline.h.

57{ this, "Dump", false };

◆ m_elecNoiseKey

SG::ReadCondHandleKey<CaloNoise> LArDSPThresholdFillInline::m_elecNoiseKey { this, "ElecNoiseKey", "electronicNoise", "SG key for electronic noise" }
private

Definition at line 63 of file LArDSPThresholdFillInline.h.

64{ this, "ElecNoiseKey", "electronicNoise", "SG key for electronic noise" };

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_fill

BooleanProperty LArDSPThresholdFillInline::m_fill { this, "Fill", true }
private

Definition at line 59 of file LArDSPThresholdFillInline.h.

59{ this, "Fill", true };

◆ m_key

StringProperty LArDSPThresholdFillInline::m_key { this, "Key", "DSPThresholds" }
private

Definition at line 35 of file LArDSPThresholdFillInline.h.

35{ this, "Key", "DSPThresholds" };

◆ m_maskBadChannels

BooleanProperty LArDSPThresholdFillInline::m_maskBadChannels { this, "MaskBadChannels", false }
private

Definition at line 53 of file LArDSPThresholdFillInline.h.

53{ this, "MaskBadChannels", false };

◆ m_maskedsamplesThrsh

FloatProperty LArDSPThresholdFillInline::m_maskedsamplesThrsh { this, "MaskedsamplesThreshold", static_cast<float>(0x7fffffff) }
private

Definition at line 55 of file LArDSPThresholdFillInline.h.

55{ this, "MaskedsamplesThreshold", static_cast<float>(0x7fffffff) };

◆ m_maskedtqThrsh

FloatProperty LArDSPThresholdFillInline::m_maskedtqThrsh { this, "MaskedtQThreshold", static_cast<float>(0x7fffffff) }
private

Definition at line 54 of file LArDSPThresholdFillInline.h.

54{ this, "MaskedtQThreshold", static_cast<float>(0x7fffffff) };

◆ m_mode

StringProperty LArDSPThresholdFillInline::m_mode
private
Initial value:
{ this, "mode", "fixed",
"Select how to set thresholds. Allowed values are 'fixed','group' and 'noise'" }

Definition at line 36 of file LArDSPThresholdFillInline.h.

36 { this, "mode", "fixed",
37 "Select how to set thresholds. Allowed values are 'fixed','group' and 'noise'" };

◆ m_nameOfSet

StringProperty LArDSPThresholdFillInline::m_nameOfSet { this, "NameOfSet", "" }
private

Definition at line 34 of file LArDSPThresholdFillInline.h.

34{ this, "NameOfSet", "" };

◆ m_onlineID

const LArOnlineID* LArDSPThresholdFillInline::m_onlineID = nullptr
private

Definition at line 32 of file LArDSPThresholdFillInline.h.

◆ m_outFileName

StringProperty LArDSPThresholdFillInline::m_outFileName { this, "OutFile", "out.txt" }
private

Definition at line 58 of file LArDSPThresholdFillInline.h.

58{ this, "OutFile", "out.txt" };

◆ m_problemsToMask

Gaudi::Property<std::vector<std::string> > LArDSPThresholdFillInline::m_problemsToMask {this,"ProblemsToMask",{}, "Bad-Channel categories to mask"}
private

Definition at line 69 of file LArDSPThresholdFillInline.h.

69{this,"ProblemsToMask",{}, "Bad-Channel categories to mask"};

◆ m_samplesThrsh

FloatProperty LArDSPThresholdFillInline::m_samplesThrsh { this, "samplesThreshold", 1000 }
private

Definition at line 44 of file LArDSPThresholdFillInline.h.

44{ this, "samplesThreshold", 1000 };

◆ m_scaleIW

Gaudi::Property<float> LArDSPThresholdFillInline::m_scaleIW {this,"ScaleIW",0.,"if >0 scale EMEC IW, HEC thresholds with this factor"}
private

Definition at line 70 of file LArDSPThresholdFillInline.h.

70{this,"ScaleIW",0.,"if >0 scale EMEC IW, HEC thresholds with this factor"};

◆ m_sigmaNoiseQt

FloatProperty LArDSPThresholdFillInline::m_sigmaNoiseQt {this, "sigmaNoiseQt", 0 }
private

Definition at line 48 of file LArDSPThresholdFillInline.h.

48{this, "sigmaNoiseQt", 0 };

◆ m_sigmaNoiseSamples

FloatProperty LArDSPThresholdFillInline::m_sigmaNoiseSamples {this, "sigmaNoiseSamples", 0 }
private

Definition at line 47 of file LArDSPThresholdFillInline.h.

47{this, "sigmaNoiseSamples", 0 };

◆ m_thrPerCell

CaloCellGroupList LArDSPThresholdFillInline::m_thrPerCell
private

Definition at line 79 of file LArDSPThresholdFillInline.h.

◆ m_totalNoiseKey

SG::ReadCondHandleKey<CaloNoise> LArDSPThresholdFillInline::m_totalNoiseKey { this, "TotalNoiseKey", "totalNoise", "SG key for total noise" }
private

Definition at line 61 of file LArDSPThresholdFillInline.h.

62{ this, "TotalNoiseKey", "totalNoise", "SG key for total noise" };

◆ m_tqThrsh

FloatProperty LArDSPThresholdFillInline::m_tqThrsh { this, "tQThreshold", 250 }
private

Definition at line 43 of file LArDSPThresholdFillInline.h.

43{ this, "tQThreshold", 250 };

◆ m_usePileupNoiseQt

BooleanProperty LArDSPThresholdFillInline::m_usePileupNoiseQt {this, "usePileupNoiseQt", false }
private

Definition at line 50 of file LArDSPThresholdFillInline.h.

50{this, "usePileupNoiseQt", false };

◆ m_usePileupNoiseSamples

BooleanProperty LArDSPThresholdFillInline::m_usePileupNoiseSamples {this, "usePileupNoiseSamples", false }
private

Definition at line 49 of file LArDSPThresholdFillInline.h.

49{this, "usePileupNoiseSamples", false };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_workmode

mode_t LArDSPThresholdFillInline::m_workmode {FIXED}
private

Definition at line 77 of file LArDSPThresholdFillInline.h.

77{FIXED};

The documentation for this class was generated from the following files: