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

#include <LArCaliWaveAverage.h>

Inheritance diagram for LArCaliWaveAverage:

Public Member Functions

 LArCaliWaveAverage (const std::string &name, ISvcLocator *pSvcLocator)
 ~LArCaliWaveAverage ()
StatusCode initialize () override final
StatusCode execute (const EventContext &ctx) const override final
StatusCode stop () override final
StatusCode finalize () override final
virtual bool isReEntrant () const override
 Avoid scheduling algorithm multiple times.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
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
virtual void setFilterPassed (bool state, const EventContext &ctx) const
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

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

std::vector< HWIdentifierSymmetricChannels (HWIdentifier ChID, const std::vector< unsigned > &ChannelsNotToUse, const LArOnOffIdMapping *cabling)
LArCaliWave WaveAverage (const std::vector< LArCaliWave > &ToBeAveraged)
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, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"}
SG::ReadCondHandleKey< LArCaliWaveContainerm_keyInput {this, "KeyInput", "LArCaliWave", "SG key of input cali wave container"}
SG::WriteCondHandleKey< LArCaliWaveContainerm_keyOutputCorr {this, "KeyOutputCorr", "LArCaliWaveCorr", "SG key for corrected container"}
SG::WriteCondHandleKey< LArCaliWaveContainerm_keyOutputSymm {this, "KeyOutputSymm", "LArCaliWaveSymm", "SG key for symmetrized container"}
const LArOnlineIDm_onlineHelper
const LArEM_IDm_emId
const LArHEC_IDm_hecId
const LArFCAL_IDm_fcalId
std::string m_groupingType
std::vector< unsigned > m_chids
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 23 of file LArCaliWaveAverage.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LArCaliWaveAverage()

LArCaliWaveAverage::LArCaliWaveAverage ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 20 of file LArCaliWaveAverage.cxx.

20 :
21 AthCondAlgorithm(name, pSvcLocator),
22 m_onlineHelper(nullptr),
23 m_emId(nullptr),
24 m_hecId(nullptr),
25 m_fcalId(nullptr)
26{
27 m_chids.clear();
28 declareProperty("ChannelIDs", m_chids);
29 declareProperty("GroupingType", m_groupingType = "ExtendedFeedThrough"); // SubDetector, Single, FeedThrough, ExtendedFeedThrough
30}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const LArOnlineID * m_onlineHelper
const LArFCAL_ID * m_fcalId
const LArEM_ID * m_emId
const LArHEC_ID * m_hecId
std::vector< unsigned > m_chids

◆ ~LArCaliWaveAverage()

LArCaliWaveAverage::~LArCaliWaveAverage ( )
default

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ 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 }

◆ 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()

StatusCode LArCaliWaveAverage::execute ( const EventContext & ctx) const
finaloverride

Definition at line 70 of file LArCaliWaveAverage.cxx.

70 {
71 ATH_MSG_INFO ( "execute()" );
72 return StatusCode::SUCCESS;
73}
#define ATH_MSG_INFO(x)

◆ 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 & AthCommonReentrantAlgorithm< 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 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

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

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode LArCaliWaveAverage::finalize ( )
inlinefinaloverride

Definition at line 33 of file LArCaliWaveAverage.h.

33{return StatusCode::SUCCESS;}

◆ initialize()

StatusCode LArCaliWaveAverage::initialize ( )
finaloverride

Definition at line 34 of file LArCaliWaveAverage.cxx.

34 {
35 const CaloCell_ID* idHelper = nullptr;
36 ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
37 m_emId = idHelper->em_idHelper();
38 if (!m_emId) {
39 ATH_MSG_ERROR ( "Could not get lar EM ID helper!" );
40 return StatusCode::FAILURE;
41 }
42 m_fcalId=idHelper->fcal_idHelper();
43 if (!m_fcalId) {
44 ATH_MSG_ERROR ( "Could not get lar FCAL ID helper" );
45 return StatusCode::FAILURE;
46 }
47 m_hecId=idHelper->hec_idHelper();
48 if (!m_hecId) {
49 ATH_MSG_ERROR ( "Could not get lar HEC ID helper" );
50 return StatusCode::FAILURE;
51 }
52
53 ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
54
55 ATH_CHECK(m_cablingKey.initialize());
56 ATH_CHECK(m_keyInput.initialize());
57 ATH_CHECK(m_keyOutputCorr.initialize());
58 ATH_CHECK(m_keyOutputSymm.initialize());
59
60 if ( !m_chids.empty() ) {
61 ATH_MSG_INFO ( m_chids.size() << " channels selected for averaging." );
62 } else {
63 ATH_MSG_ERROR ( "No channels selected for averaging!" );
64 return StatusCode::FAILURE;
65 }
66
67 return StatusCode::SUCCESS;
68}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
const ServiceHandle< StoreGateSvc > & detStore() const
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
Definition CaloCell_ID.h:75
const LArEM_ID * em_idHelper() const
access to EM idHelper
Definition CaloCell_ID.h:63
const LArHEC_ID * hec_idHelper() const
access to HEC idHelper
Definition CaloCell_ID.h:69
SG::ReadCondHandleKey< LArCaliWaveContainer > m_keyInput
SG::WriteCondHandleKey< LArCaliWaveContainer > m_keyOutputCorr
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
SG::WriteCondHandleKey< LArCaliWaveContainer > m_keyOutputSymm
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ 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()

◆ isReEntrant()

virtual bool AthCondAlgorithm::isReEntrant ( ) const
inlineoverridevirtualinherited

Avoid scheduling algorithm multiple times.

With multiple concurrent events, conditions objects often expire simultaneously for all slots. To avoid that the scheduler runs the CondAlg in each slot, we declare it as "non-reentrant". This ensures that the conditions objects are only created once.

In case a particular CondAlg should behave differently, it can override this method again and return true.

See also
ATEAM-836

Definition at line 39 of file AthCondAlgorithm.h.

39{ return false; }

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ stop()

StatusCode LArCaliWaveAverage::stop ( )
finaloverride

Definition at line 75 of file LArCaliWaveAverage.cxx.

75 {
76 ATH_MSG_INFO ( "stop()" );
77
78 // Get input LArCaliWaveContainer
79 SG::ReadCondHandle<LArCaliWaveContainer> inHdl(m_keyInput);
80 const LArCaliWaveContainer* theLArCaliWaveContainer = *inHdl;
81 if (! theLArCaliWaveContainer ) {
82 ATH_MSG_ERROR ( "LArCaliWaveContainer (key = " << m_keyInput << ") is empty" );
83 return StatusCode::FAILURE;
84 }
85
86 // create correction LArCaliWaveContainer
87 auto larCaliWaveContainerCorr = std::make_unique<LArCaliWaveContainer>();
88 ATH_CHECK( larCaliWaveContainerCorr->setGroupingType(m_groupingType,msg()) );
89 ATH_CHECK( larCaliWaveContainerCorr->initialize() );
90
91 // create symmetric waves LArCaliWaveContainer
92 auto larCaliWaveContainerSymm = std::make_unique<LArCaliWaveContainer>();
93 ATH_CHECK( larCaliWaveContainerSymm->setGroupingType(m_groupingType,msg()) );
94
95 if (larCaliWaveContainerSymm->initialize()) {
96 ATH_MSG_ERROR ( "Failed to initialize LArCaliWaveContainer object" );
97 return StatusCode::FAILURE;
98 }
99
100 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
101 const LArOnOffIdMapping* cabling{*cablingHdl};
102 if(!cabling) {
103 ATH_MSG_ERROR("Do not have mapping object " << m_cablingKey.key() );
104 return StatusCode::FAILURE;
105 }
106
107 for ( unsigned i=0; i<m_chids.size();++i) { // loop over selected channels
108
109 const HWIdentifier chid(m_chids[i]);
110
111 std::vector<HWIdentifier> theSymmetricChannels = SymmetricChannels(chid,m_chids,cabling);
112
113 if ( theSymmetricChannels.empty()) {
114 ATH_MSG_WARNING ( "No symmetric channels found for channel 0x" << MSG::hex << chid << MSG::dec << ". Cannot average." );
115 continue;
116 }
117
118 ATH_MSG_INFO ( theSymmetricChannels.size() << " symmetric channels indentified for channel 0x" << MSG::hex << chid << MSG::dec );
119
120 for ( unsigned gain = CaloGain::LARHIGHGAIN ; gain < CaloGain::LARNGAIN ; ++ gain ) { // loop over gains
121
122 ATH_MSG_VERBOSE ( "Now processing gain = " << gain );
123
124 // get Wave vector for current ChID/Gain, assuming it exists
125 const LArCaliWaveContainer::LArCaliWaves& theCaliWaves = theLArCaliWaveContainer->get(chid,gain);
126 if ( theCaliWaves.empty() ){
127 ATH_MSG_WARNING ( "No pulses found for channel 0x" << MSG::hex << chid << MSG::dec
128 << " in gain " << gain
129 << ". Are you sure that readout is working? For the time being I'm skipping..." );
130 continue;
131 }
132
133 LArCaliWaveVec theAverageWaves;
134
135 LArCaliWaveVec theSymmetricWavesAll; // vector of symmetric waves for the all DAC
136
137 for (unsigned iDAC=0;iDAC<theCaliWaves.size();++iDAC) { // loop over DAC values
138
139 int theDAC = theCaliWaves[iDAC].getDAC();
140
141 LArCaliWaveVec theSymmetricWavesThisDAC; // vector of symmetric waves for the current DAC
142
143 for (unsigned iSym=0;iSym<theSymmetricChannels.size();++iSym) { // loop over SymmetricChannels and fill LArCaliWave vector corresponding to current DAC
144
145 const LArCaliWaveContainer::LArCaliWaves& theseCaliWaves = theLArCaliWaveContainer->get(HWIdentifier(theSymmetricChannels[iSym]),gain);
146
147 for (unsigned kDAC=0;kDAC<theseCaliWaves.size();++kDAC) {
148 if ( theseCaliWaves[kDAC].getDAC() == theDAC ) {
149 LArCaliWave thisWave = theseCaliWaves[kDAC];
150 // store additional information in LArWave flag, e.g. FT
151 unsigned theFlag = m_onlineHelper->feedthrough(HWIdentifier(theSymmetricChannels[iSym]));
152 thisWave.setFlag(theFlag);
153 // save symmetric wave in vetor to be averaged
154 theSymmetricWavesThisDAC.push_back(thisWave);
155 }
156 }
157
158 }
159
160 if ( !theSymmetricWavesThisDAC.empty() ) {
161
162 ATH_MSG_INFO ( theSymmetricWavesThisDAC.size()
163 << " symmetric LArCaliWaves found for channel 0x" << MSG::hex << chid << MSG::dec
164 << " for DAC " << theDAC << " in gain " << gain
165 << ". Now averaging ... " );
166
167 // Average symmetric waves corresponding to this DAC/gain
168 LArCaliWave theAverageWave = WaveAverage(theSymmetricWavesThisDAC);
169
170 ATH_MSG_VERBOSE ( "... Done. Saving average to LArCaliWave vector." );
171
172 theAverageWaves.push_back(theAverageWave);
173
174 ATH_MSG_VERBOSE ( "Storing symmetric waves for the current DAC..." );
175
176 for (unsigned kSym=0;kSym<theSymmetricWavesThisDAC.size();++kSym) {
177 theSymmetricWavesAll.push_back(theSymmetricWavesThisDAC[kSym]);
178 }
179
180
181 } else {
182 ATH_MSG_WARNING ( "No symmetrich waves found for channel 0x" << MSG::hex << chid << MSG::dec
183 << " for DAC " << theDAC << ": no average will be computed." );
184 }
185
186 } // end of loop over DAC values
187
188 // fill new LArCaliWaveContainer with average wave
189 ATH_MSG_VERBOSE ( "Saving LArCaliWave vector to correction container." );
190 larCaliWaveContainerCorr->setPdata(chid,theAverageWaves,gain);
191
192 // store symmetric waves in other LArCaliWaveContainer (this is working only for a sinle DAC value!)
193 ATH_MSG_VERBOSE ( "Saving LArCaliWave vector to symmetric waves' container (flag contains FT info)" );
194 larCaliWaveContainerSymm->setPdata(chid,theSymmetricWavesAll,gain);
195
196 } // end of loop over gains
197
198 } // end of loop over selected channels
199
200 // Record average LArCaliWaveContainer to DetectorStore
201 // Define validity of the output cond object
202 const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
203 const EventIDBase stop{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
204 EventIDRange rangeW{start, stop};
205 SG::WriteCondHandle<LArCaliWaveContainer> corrHdl(m_keyOutputCorr);
206 const EventIDRange& crangeW(rangeW);
207 if(corrHdl.record(crangeW,larCaliWaveContainerCorr.release()).isFailure()) {
208 ATH_MSG_ERROR("Could not record LArCaliWaveContainer object with " << m_keyOutputCorr.key()
209 << " with EventRange " << crangeW << " into Conditions Store");
210 return StatusCode::FAILURE;
211 }
212 ATH_MSG_INFO("recorded new " << m_keyOutputCorr.key() << " with range " << crangeW << " into Conditions Store");
213 SG::WriteCondHandle<LArCaliWaveContainer> symHdl(m_keyOutputSymm);
214 if(symHdl.record(crangeW,larCaliWaveContainerSymm.release()).isFailure()) {
215 ATH_MSG_ERROR("Could not record LArCaliWaveContainer object with " << m_keyOutputSymm.key()
216 << " with EventRange " << crangeW << " into Conditions Store");
217 return StatusCode::FAILURE;
218 }
219 ATH_MSG_INFO("recorded new " << m_keyOutputCorr.key() << " with range " << crangeW << " into Conditions Store");
220 return StatusCode::SUCCESS;
221}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
LArCaliWave WaveAverage(const std::vector< LArCaliWave > &ToBeAveraged)
std::vector< HWIdentifier > SymmetricChannels(HWIdentifier ChID, const std::vector< unsigned > &ChannelsNotToUse, const LArOnOffIdMapping *cabling)
StatusCode stop() override final
ConstReference get(const HWIdentifier id, unsigned int gain=0) const
get data with online identifier
void setFlag(const unsigned flag)
set flag
Definition LArWave.h:199
@ LARNGAIN
Definition CaloGain.h:19
@ LARHIGHGAIN
Definition CaloGain.h:18

◆ SymmetricChannels()

std::vector< HWIdentifier > LArCaliWaveAverage::SymmetricChannels ( HWIdentifier ChID,
const std::vector< unsigned > & ChannelsNotToUse,
const LArOnOffIdMapping * cabling )
private

Definition at line 227 of file LArCaliWaveAverage.cxx.

228{
229 ATH_MSG_VERBOSE ( "Seeking symmetric cells for channel 0x" << MSG::hex << ChID << MSG::dec );
230
231 std::vector<HWIdentifier> theSymmetricChannels;
232 theSymmetricChannels.resize(0);
233
234 Identifier id;
235 try {
236 id = cabling->cnvToIdentifier(ChID);
237 } catch (LArID_Exception & execpt) {
238 ATH_MSG_ERROR ( "LArCabling exception caught for channel 0x" << MSG::hex << ChID << MSG::dec );
239 return theSymmetricChannels;
240 }
241
242 int detector = -999;
243 int pos_neg = m_onlineHelper->pos_neg(ChID);
244 int barrel_ec = m_onlineHelper->barrel_ec(ChID);
245
246 int FT = m_onlineHelper->feedthrough(ChID);
247 int slot = m_onlineHelper->slot(ChID);
248 int channel = m_onlineHelper->channel(ChID);
249
250 /*
251 int region = -999;
252 int layer = -999;
253 int eta = -999;
254 int phi = -999;
255 */
256
257 if ( m_emId->is_em_barrel(id) || m_emId->is_em_endcap(id) ) {
258 detector = 0;
259 /*
260 eta = m_emId->eta(id);
261 phi = m_emId->phi(id);
262 layer = m_emId->sampling(id);
263 region = m_emId->region(id);
264 */
265 }
266 if ( m_hecId->is_lar_hec(id) ) {
267 detector = 1;
268 /*
269 eta = m_hecId->eta(id);
270 phi = m_hecId->phi(id);
271 layer = m_hecId->sampling(id);
272 region = m_hecId->region(id);
273 */
274 }
275 if ( m_fcalId->is_lar_fcal(id) ) {
276 detector = 2;
277 /*
278 eta = m_fcalId->eta(id);
279 phi = m_fcalId->phi(id);
280 layer = m_fcalId->module(id);
281 region = 0;
282 */
283 }
284
285 ATH_MSG_VERBOSE ( " Detector = " << detector );
286 ATH_MSG_VERBOSE ( " PosNeg = " << pos_neg );
287 ATH_MSG_VERBOSE ( " Barrel/EC = " << barrel_ec );
288
289 ATH_MSG_VERBOSE ( " FT = " << FT );
290 ATH_MSG_VERBOSE ( " Slot = " << slot );
291 ATH_MSG_VERBOSE ( " Channel = " << channel );
292
293 /*
294 ATH_MSG_VERBOSE ( " Region = " << region );
295 ATH_MSG_VERBOSE ( " Layer = " << layer );
296 ATH_MSG_VERBOSE ( " Eta = " << eta );
297 ATH_MSG_VERBOSE ( " Phi = " << phi );
298 */
299
300 unsigned nFT = 0;
301
302 if ( detector != 0 ) {
303 ATH_MSG_ERROR ( "Sorry, still implemented for EM only :-(" );
304 return theSymmetricChannels;
305 } else {
306 nFT = 32;
307 }
308
309 for ( unsigned iFT = 0;iFT<nFT;++iFT) { // loop over all FTs
310
311 // compute ChID fpr channel in iFT in same position
312 bool useThisChannel = true;
313 HWIdentifier thisChID = m_onlineHelper->channel_Id(barrel_ec,pos_neg,iFT,slot,channel);
314
315 // check if channel is allowed...
316 for ( unsigned i=0;i<ChannelsNotToUse.size();++i) {
317 if ( thisChID == HWIdentifier(ChannelsNotToUse[i]) ) {
318 useThisChannel = false;
319 break;
320 }
321 }
322
323 if ( useThisChannel )
324 theSymmetricChannels.push_back(thisChID);
325 }
326
327 return theSymmetricChannels;
328}

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< 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.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< 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 HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
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 }

◆ WaveAverage()

LArCaliWave LArCaliWaveAverage::WaveAverage ( const std::vector< LArCaliWave > & ToBeAveraged)
private

Definition at line 331 of file LArCaliWaveAverage.cxx.

332{
333 if ( !ToBeAveraged.empty() ) {
334
335 ATH_MSG_VERBOSE ( "... Averaging wave number 1" );
336 LArWave theWaveAverage = (LArWave)ToBeAveraged[0];
337
338 for (unsigned i=1;i<ToBeAveraged.size();++i) {
339 ATH_MSG_VERBOSE ( "... Averaging wave number " << i+1 );
340 theWaveAverage = theWaveAverage + (LArWave)ToBeAveraged[i];
341 }
342
343 theWaveAverage = theWaveAverage * (1./float(ToBeAveraged.size()));
344
345 LArCaliWave theCaliWaveAverage( theWaveAverage.getWave() ,
346 ToBeAveraged[0].getErrors(),
347 ToBeAveraged[0].getTriggers(),
348 ToBeAveraged[0].getDt(),
349 ToBeAveraged[0].getDAC(),
350 ToBeAveraged[0].getIsPulsedInt(),
351 ToBeAveraged[0].getFlag() );
352
353 return theCaliWaveAverage;
354
355 } else {
356 LArCaliWave emptyWave = LArCaliWave();
357 return emptyWave;
358 }
359
360}
const std::vector< double > & getWave() const
Wave parameters.
Definition LArWave.h:167

Member Data Documentation

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> LArCaliWaveAverage::m_cablingKey {this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"}
private

Definition at line 37 of file LArCaliWaveAverage.h.

37{this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"};

◆ m_chids

std::vector<unsigned> LArCaliWaveAverage::m_chids
private

Definition at line 50 of file LArCaliWaveAverage.h.

◆ 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_emId

const LArEM_ID* LArCaliWaveAverage::m_emId
private

Definition at line 44 of file LArCaliWaveAverage.h.

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_fcalId

const LArFCAL_ID* LArCaliWaveAverage::m_fcalId
private

Definition at line 46 of file LArCaliWaveAverage.h.

◆ m_groupingType

std::string LArCaliWaveAverage::m_groupingType
private

Definition at line 48 of file LArCaliWaveAverage.h.

◆ m_hecId

const LArHEC_ID* LArCaliWaveAverage::m_hecId
private

Definition at line 45 of file LArCaliWaveAverage.h.

◆ m_keyInput

SG::ReadCondHandleKey<LArCaliWaveContainer> LArCaliWaveAverage::m_keyInput {this, "KeyInput", "LArCaliWave", "SG key of input cali wave container"}
private

Definition at line 38 of file LArCaliWaveAverage.h.

38{this, "KeyInput", "LArCaliWave", "SG key of input cali wave container"};

◆ m_keyOutputCorr

SG::WriteCondHandleKey<LArCaliWaveContainer> LArCaliWaveAverage::m_keyOutputCorr {this, "KeyOutputCorr", "LArCaliWaveCorr", "SG key for corrected container"}
private

Definition at line 39 of file LArCaliWaveAverage.h.

39{this, "KeyOutputCorr", "LArCaliWaveCorr", "SG key for corrected container"};

◆ m_keyOutputSymm

SG::WriteCondHandleKey<LArCaliWaveContainer> LArCaliWaveAverage::m_keyOutputSymm {this, "KeyOutputSymm", "LArCaliWaveSymm", "SG key for symmetrized container"}
private

Definition at line 40 of file LArCaliWaveAverage.h.

40{this, "KeyOutputSymm", "LArCaliWaveSymm", "SG key for symmetrized container"};

◆ m_onlineHelper

const LArOnlineID* LArCaliWaveAverage::m_onlineHelper
private

Definition at line 42 of file LArCaliWaveAverage.h.

◆ 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.


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