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

#include <LArRawCalibDataReadingAlg.h>

Inheritance diagram for LArRawCalibDataReadingAlg:

Public Member Functions

 LArRawCalibDataReadingAlg (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize () override
StatusCode execute (const EventContext &ctx) const 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

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< LArCalibLineMappingm_CLKey {this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"}
SG::WriteHandleKey< LArDigitContainerm_DigitKey {this,"LArDigitKey",""}
SG::WriteHandleKey< LArCalibDigitContainerm_calibDigitKey {this,"LArCalibDigitKey",""}
SG::WriteHandleKey< LArAccumulatedDigitContainerm_accDigitKey {this,"LArAccDigitKey",""}
SG::WriteHandleKey< LArAccumulatedCalibDigitContainerm_accCalibDigitKey {this,"LArAccCalibDigitKey",""}
SG::WriteHandleKey< LArFebHeaderContainerm_febHeaderKey {this,"LArFebHeaderKey",""}
ServiceHandle< IROBDataProviderSvcm_robDataProviderSvc {this,"ROBDataProviderSvc","ROBDataProviderSvc"}
BooleanProperty m_verifyChecksum {this,"VerifyChecksum",true,"Calculate and compare checksums to detect data transmission errors"}
BooleanProperty m_failOnCorruption {this,"FailOnCorruption",true,"Return FAILURE if data corruption is found"}
Gaudi::Property< std::string > m_subCaloPreselection {this,"SubCaloPreselection","","One of 'EM', 'HEC' or 'FCAL'"}
Gaudi::Property< std::vector< unsigned > > m_vBEPreselection {this,"BEPreselection",{},"For channel-selection: Barrel=0, Endcap=1"}
Gaudi::Property< std::vector< unsigned > > m_vPosNegPreselection {this,"PosNegPreselection",{}, "For channel-selection: C-Side:0, A-Side: 1"}
Gaudi::Property< std::vector< unsigned > > m_vFTPreselection {this,"FTNumPreselection",{}, "For channel-selection: Feedthrough numbers (e.g. 0 - 31 for barrel)"}
DoubleProperty m_delayScale {this,"DelayScale",(25./240.)*Gaudi::Units::nanosecond,"One calibration step in time"}
std::set< HWIdentifierm_vFinalPreselection
const LArOnlineIDm_onlineId =nullptr
bool m_doDigits =false
bool m_doCalibDigits =false
bool m_doAccDigits =false
bool m_doAccCalibDigits =false
bool m_doFebHeaders =false
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 28 of file LArRawCalibDataReadingAlg.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

◆ LArRawCalibDataReadingAlg()

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

Definition at line 23 of file LArRawCalibDataReadingAlg.cxx.

23 :
24 AthReentrantAlgorithm(name, pSvcLocator) {}

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

StatusCode LArRawCalibDataReadingAlg::execute ( const EventContext & ctx) const
override

Definition at line 169 of file LArRawCalibDataReadingAlg.cxx.

169 {
170 LArDigitContainer* digits=nullptr;
171 LArCalibDigitContainer* cdigits=nullptr;
172 LArAccumulatedDigitContainer* accdigits=nullptr;
173 LArAccumulatedCalibDigitContainer* caccdigits=nullptr;
174 LArFebHeaderContainer* febHeaders=nullptr;
175
176 if (m_doDigits) {
177 SG::WriteHandle<LArDigitContainer> digitsHdl(m_DigitKey,ctx);
178 ATH_CHECK(digitsHdl.record(std::make_unique<LArDigitContainer>()));
179 digits=digitsHdl.ptr();
180 digits->reserve(200000); //Enough space for the full calo
181 }
182
183 if (m_doCalibDigits) {
184 SG::WriteHandle<LArCalibDigitContainer> cdigitsHdl(m_calibDigitKey,ctx);
185 ATH_CHECK(cdigitsHdl.record(std::make_unique<LArCalibDigitContainer>()));
186 cdigits=cdigitsHdl.ptr();
187 cdigits->reserve(200000); //Enough space for the full calo
188 }
189
190 if (m_doAccDigits) {
191 SG::WriteHandle<LArAccumulatedDigitContainer> accdigitsHdl(m_accDigitKey,ctx);
192 ATH_CHECK(accdigitsHdl.record(std::make_unique<LArAccumulatedDigitContainer>()));
193 accdigits=accdigitsHdl.ptr();
194 accdigits->reserve(200000); //Enough space for the full calo
195 }
196
197 if (m_doAccCalibDigits) {
198 SG::WriteHandle<LArAccumulatedCalibDigitContainer> caccdigitsHdl(m_accCalibDigitKey,ctx);
199 ATH_CHECK(caccdigitsHdl.record(std::make_unique<LArAccumulatedCalibDigitContainer>()));
200 caccdigits=caccdigitsHdl.ptr();
201 caccdigits->reserve(200000); //Enough space for the full calo
202 }
203
204 if (m_doFebHeaders) {
205 SG::WriteHandle<LArFebHeaderContainer> febHeadersHdl(m_febHeaderKey,ctx);
206 ATH_CHECK(febHeadersHdl.record(std::make_unique<LArFebHeaderContainer>()));
207 febHeaders=febHeadersHdl.ptr();
208 febHeaders->reserve(1524); //Total number of LAr Front End Boards
209 }
210
211 //Get full events and filter out LAr ROBs
212 const RawEvent* fullEvent=m_robDataProviderSvc->getEvent(ctx);
213 std::map<eformat::SubDetectorGroup, std::vector<const uint32_t*> > rawEventTOC;
214 eformat::helper::build_toc(*fullEvent, rawEventTOC);
215 auto larRobs=rawEventTOC.find(eformat::LAR);
216 if (larRobs==rawEventTOC.end()) {
217 ATH_MSG_DEBUG("No LAr data found in this event.");
218 return StatusCode::SUCCESS;
219 }
220
221
222 std::unique_ptr<LArRodBlockStructure> rodBlock;
223 uint16_t rodMinorVersion=0x0;
224 uint32_t rodBlockType=0x0;
225
226 const LArCalibLineMapping *calibMap=nullptr;
227 if (m_doAccCalibDigits) {
228 SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_CLKey,ctx};
229 calibMap = *clHdl;
230 if(!calibMap) {
231 ATH_MSG_ERROR( "Do not have calib line mapping !!!" );
232 return StatusCode::FAILURE;
233 }
234 }
235
236 for (const uint32_t* robPtr : larRobs->second) {
238 ATH_MSG_VERBOSE("Decoding ROB fragment 0x" << std::hex << rob.rob_source_id () << " with " << std::dec << rob.rod_fragment_size_word() << "ROB words");
239
240 if (rob.rod_fragment_size_word() <3) {
241 ATH_MSG_ERROR("Encountered corrupt ROD fragment, less than 3 words!");
242 if (m_failOnCorruption) {
243 return StatusCode::FAILURE;
244 }else
245 continue; //Jump to next ROD block
246 }else if(rob.rob_source_id()& 0x1000 ){
247 ATH_MSG_VERBOSE(" skip Latome fragment with source ID "<< std::hex << rob.rob_source_id());
248 rodBlock=nullptr;
249 continue;
250 }
251
252 eformat::helper::Version ver(rob.rod_version());
253 //(re-)init rodBlock only once per event or if (very unlikly or even impossible) some FEBs have a differnt firmware
254 if (rodBlock==nullptr || rodMinorVersion !=ver.minor_version() || rodBlockType!=(rob.rod_detev_type()&0xff)) {
255 rodMinorVersion=ver.minor_version();
256 rodBlockType=rob.rod_detev_type()&0xff;
257 ATH_MSG_VERBOSE("Found version " << rodMinorVersion << " of Rod Block Type " << rodBlockType);
258 if (rodBlockType==10) { // Accumulated digits
259 rodBlock.reset(new LArRodBlockAccumulatedV3 (this->msgSvc().get()));
260 }//end of rodBlockType ==10
261 else if (rodBlockType==7 || rodBlockType==2) { // Calib. digits
262 if(rodMinorVersion>=6) { // Accumulated calib. digits
263 rodBlock.reset(new LArRodBlockCalibrationV3 (this->msgSvc().get()));
264 } else {
265 ATH_MSG_ERROR("Found unsupported ROD Block version " << rodMinorVersion
266 << " of ROD block type " << rodBlockType);
267 return m_failOnCorruption ? StatusCode::FAILURE : StatusCode::SUCCESS;
268 }
269 } else {
270 ATH_MSG_ERROR("Found unsupported Rod block type " << rodBlockType << " in ROB sourceId: 0x" << std::hex << rob.rob_source_id () << std::dec
271 << ", ROD source ID: 0x" << rob.rod_source_id() << std::dec);
273 return StatusCode::FAILURE;
274 else
275 continue; //Jump to next ROD block
276 }
277 }//End if need to re-init RodBlock
278
279 const uint32_t* pData=rob.rod_data();
280 const uint32_t nData=rob.rod_ndata();
281 if (!rodBlock->setFragment(pData,nData)) {
282 ATH_MSG_ERROR("Failed to assign fragment pointer to LArRodBlockStructure");
283 return StatusCode::FAILURE;
284 }
285
286 if(m_verifyChecksum) {
287 const uint32_t onsum = rodBlock->onlineCheckSum();
288 const uint32_t offsum = rodBlock->offlineCheckSum();
289 if(onsum!=offsum) {
290 ATH_MSG_ERROR("Checksum error:");
291 ATH_MSG_ERROR("online checksum = 0x" << MSG::hex << onsum);
292 ATH_MSG_ERROR("offline checksum = 0x" << MSG::hex << offsum << MSG::dec);
294 return StatusCode::FAILURE;
295 else
296 continue; //Jump to the next ROD-block
297 }
298 }
299
300 //Loop over FEBs in ROD:
301 do {
302 HWIdentifier fId(Identifier32(rodBlock->getFEBID()));
303 if (!m_onlineId->isValidId(fId)) {
304 ATH_MSG_ERROR("Invalid FEB identifer 0x" << std::hex << fId.get_identifier32().get_compact());
306 return StatusCode::FAILURE;
307 else
308 continue;
309 }
310
311 if (m_vFinalPreselection.size()) {
312 const auto ftId=m_onlineId->feedthrough_Id(fId);
313 if (m_vFinalPreselection.find(ftId)==m_vFinalPreselection.end()) {
314 ATH_MSG_DEBUG("Feedthrough with id 0x" << MSG::hex << ftId << MSG::dec <<" not in preselection. Ignored.");
315 continue;
316 } else {
317 ATH_MSG_DEBUG("Feedthrough with id 0x" << MSG::hex << ftId << MSG::dec <<" is preselected.");
318 }
319 }
320
321
322 const int NthisFebChannel=m_onlineId->channelInSlotMax(fId);
323
324 //Decode LArDigits (if requested)
325 if (m_doDigits) {
327 int fcNb;
328 std::vector<short> samples;
329 while (rodBlock->getNextRawData(fcNb,samples,gain)) {
330 if (fcNb>=NthisFebChannel)
331 continue;
332 if (samples.size()==0) continue; // Ignore missing cells
333 HWIdentifier cId = m_onlineId->channel_Id(fId,fcNb);
334 digits->emplace_back(new LArDigit(cId, (CaloGain::CaloGain)gain, std::move(samples)));
335 samples.clear();
336 }//end getNextRawData loop
337 }//end if m_doDigits
338
339 //Decode LArCalibDigits (if requested)
340 if (m_doCalibDigits) {
344 bool ispulsed;
345 int fcNb;
346 std::vector<short> samples;
347 while (rodBlock->getNextRawData(fcNb,samples,gain)) {
348 if (fcNb>=NthisFebChannel)
349 continue;
350 if (samples.size()==0) continue; // Ignore missing cells
351 dac = rodBlock->getDAC();
352 delay = rodBlock->getDelay();
353 ispulsed = rodBlock->getPulsed(fcNb);
354 HWIdentifier cId = m_onlineId->channel_Id(fId,fcNb);
355 cdigits->emplace_back(new LArCalibDigit(cId, (CaloGain::CaloGain)gain, std::move(samples), dac, delay, ispulsed));
356 samples.clear();
357 }//end getNextRawData loop
358 }//end if m_doCalibDigits
359
360 //Decode LArAccumulatedDigits (if requested)
361 if (m_doAccDigits && rodBlockType==10) {
363 int fcNb;
364 std::vector<uint64_t> samplesSum;
365 std::vector<uint64_t> samples2Sum;
366 uint32_t nTrigger;
367 while (rodBlock->getNextAccumulatedDigit(fcNb,samplesSum,samples2Sum,gain)) {
368 if (fcNb>=NthisFebChannel)
369 continue;
370 if (samplesSum.size()==0 || samples2Sum.size()==0) continue; // Ignore missing cells
371 nTrigger = rodBlock->getNTrigger();
372 HWIdentifier cId = m_onlineId->channel_Id(fId,fcNb);
373 accdigits->emplace_back(new LArAccumulatedDigit(cId, (CaloGain::CaloGain)gain, std::move(samplesSum), std::move(samples2Sum), nTrigger));
374 samplesSum.clear();
375 samples2Sum.clear();
376 }//end getNext loop
377 }//end if m_doAccDigits
378
379 //Decode LArAccumulatedCalibDigits (if requested)
380 if (m_doAccCalibDigits) {
382 uint32_t itmp;
385 uint16_t nstep;
386 uint16_t istep;
387 bool ispulsed=false;
388 uint16_t ispulsed_int;
389 unsigned bitShift;
390 int fcNb;
391 std::vector<uint64_t> samplesSum;
392 std::vector<uint64_t> samples2Sum;
393 uint32_t nTrigger;
394 while (rodBlock->getNextAccumulatedCalibDigit(fcNb,samplesSum,samples2Sum,itmp,gain)) {
395 if (fcNb>=NthisFebChannel)
396 continue;
397 if (samplesSum.size()==0 || samples2Sum.size()==0) continue; // Ignore missing cells
398 ispulsed_int=0;
399 bitShift=0;
400 dac = rodBlock->getDAC();
401 delay = rodBlock->getDelay();
402 nTrigger = rodBlock->getNTrigger();
403 nstep = rodBlock->getNStep();
404 istep = rodBlock->getStepIndex();
405 HWIdentifier cId = m_onlineId->channel_Id(fId,fcNb);
406 const std::vector<HWIdentifier>& calibChannelIDs = calibMap->calibSlotLine(cId);
407 for(std::vector<HWIdentifier>::const_iterator csl_it=calibChannelIDs.begin(); csl_it!=calibChannelIDs.end();++csl_it){
408 uint32_t calibLine = m_onlineId->channel(*csl_it);
409 ispulsed=rodBlock->getPulsed(calibLine);
410 ispulsed_int=( ispulsed_int | ((uint16_t)ispulsed<<bitShift) );
411 bitShift++;
412 }
413 caccdigits->emplace_back(new LArAccumulatedCalibDigit(cId, (CaloGain::CaloGain)gain, std::move(samplesSum), std::move(samples2Sum), nTrigger, dac, delay, ispulsed_int, nstep, istep));
414 }//end getNext loop
415 caccdigits->setDelayScale(m_delayScale);
416 }//end if m_doAccDigits
417
418 //Decode FebHeaders (if requested)
419 if (m_doFebHeaders) {
420 std::unique_ptr<LArFebHeader> larFebHeader(new LArFebHeader(fId));
421 LArFebHeaderReader::fillFebHeader(larFebHeader.get(),rodBlock.get(),rob);
422 febHeaders->push_back(std::move(larFebHeader));
423 }//end if m_doFebHeaders
424
425 }while (rodBlock->nextFEB()); //Get NextFeb
426 } //end loop over ROBs
427 return StatusCode::SUCCESS;
428}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
double delay(std::size_t d)
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Definition RawEvent.h:37
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
value_type emplace_back(value_type pElem)
Add an element to the end of the collection.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
void setDelayScale(const double scale)
set the delay Scale
const std::vector< HWIdentifier > & calibSlotLine(const HWIdentifier id) const
SG::WriteHandleKey< LArAccumulatedCalibDigitContainer > m_accCalibDigitKey
SG::WriteHandleKey< LArDigitContainer > m_DigitKey
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
SG::ReadCondHandleKey< LArCalibLineMapping > m_CLKey
SG::WriteHandleKey< LArAccumulatedDigitContainer > m_accDigitKey
SG::WriteHandleKey< LArFebHeaderContainer > m_febHeaderKey
std::set< HWIdentifier > m_vFinalPreselection
SG::WriteHandleKey< LArCalibDigitContainer > m_calibDigitKey
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:132
void fillFebHeader(LArFebHeader *lfh, const LArRodBlockStructure *bl, const ROBFragment &robFrag)
Fill info for one FEB Header.
eformat::ROBFragment< PointerType > ROBFragment
Definition RawEvent.h:27
setWord1 uint16_t
setEventNumber uint32_t

◆ 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 LArRawCalibDataReadingAlg::initialize ( )
override

Definition at line 26 of file LArRawCalibDataReadingAlg.cxx.

26 {
27
28 if (m_DigitKey.key().size()>0) {
29 ATH_CHECK(m_DigitKey.initialize());
30 m_doDigits=true;
31 }
32 else {
33 m_doDigits=false;
34 }
35
36 if (m_calibDigitKey.key().size()>0) {
37 ATH_CHECK(m_calibDigitKey.initialize());
38 m_doCalibDigits=true;
39 }
40 else {
41 m_doCalibDigits=false;
42 }
43
44 if (m_accDigitKey.key().size()>0) {
45 ATH_CHECK(m_accDigitKey.initialize());
46 m_doAccDigits=true;
47 }
48 else {
49 m_doAccDigits=false;
50 }
51
52 if (m_accCalibDigitKey.key().size()>0) {
53 ATH_CHECK(m_accCalibDigitKey.initialize());
55 }
56 else {
58 }
59
60 if (m_febHeaderKey.key().size()>0) {
61 ATH_CHECK(m_febHeaderKey.initialize());
62 m_doFebHeaders=true;
63 }
64 else {
65 m_doFebHeaders=false;
66 }
67
69 ATH_MSG_FATAL("Needs ether Digits or CalibDigits or AccDigits or AccCalibDigit Key");
70 return StatusCode::FAILURE;
71 }
72
74 ATH_MSG_FATAL("Could not have both CalibDigits, AccCalibDigits Key");
75 return StatusCode::FAILURE;
76 }
77
79 ATH_MSG_FATAL("Could not have AccDigits with Calib Key");
80 return StatusCode::FAILURE;
81 }
82
84 ATH_CHECK(detStore()->retrieve(m_onlineId,"LArOnlineID"));
85
86 ATH_CHECK(m_CLKey.initialize());
87
88
89 //Fill FT list if only Barrel/EC and side is given:
90 if (m_vBEPreselection.size() && m_vPosNegPreselection.size() && m_vFTPreselection.size()==0) {
91 std::set<unsigned> fts;
92 if (std::find(m_vBEPreselection.begin(),m_vBEPreselection.end(),0)!=m_vBEPreselection.end()) { //Barrel selected
93 fts.insert({0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31});
94 }
95 if (std::find(m_vBEPreselection.begin(),m_vBEPreselection.end(),1)!=m_vBEPreselection.end()) { //Endcap selected
96 fts.insert({0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24});
97 }
98 m_vFTPreselection.value().insert(m_vFTPreselection.begin(),fts.begin(),fts.end());
99 }
100
101 //Build list of preselected Feedthroughs
102 if (m_vBEPreselection.size() && m_vPosNegPreselection.size() && m_vFTPreselection.size()) {
103 ATH_MSG_INFO("Building list of selected feedthroughs");
104 for (const unsigned iBE : m_vBEPreselection) {
105 for (const unsigned iPN: m_vPosNegPreselection) {
106 for (const unsigned iFT: m_vFTPreselection) {
107 HWIdentifier finalFTId=m_onlineId->feedthrough_Id(iBE,iPN,iFT);
108 ATH_MSG_INFO("Adding feedthrough Barrel/Endcap=" << iBE << " pos/neg=" << iPN << " FT=" << iFT
109 << " (0x" << std::hex << finalFTId.get_identifier32().get_compact() << std::dec << ")");
110 m_vFinalPreselection.insert(finalFTId);
111 }
112 }
113 }
114 }//end if something set
115
116 if (!m_subCaloPreselection.value().empty()) {
117 ATH_MSG_INFO("Adding list of selected subcalo"<<m_subCaloPreselection.value());
118 std::set<HWIdentifier> subcaloFTs;
119 if (m_subCaloPreselection.value().compare("EM")==0) {
120 for (auto febid : m_onlineId->feb_range()) {
121 if (m_onlineId->isEMBchannel(febid) || m_onlineId->isEMECchannel(febid)) {
122 subcaloFTs.insert(m_onlineId->feedthrough_Id(febid));
123 }
124 }
125 }
126 else if (m_subCaloPreselection.value().find("HEC")!=std::string::npos || m_subCaloPreselection.value().find("FCAL")!=std::string::npos) {
127 if (m_subCaloPreselection.value().find("HEC")!=std::string::npos) {
128 for (auto febid : m_onlineId->feb_range()) {
129 if (m_onlineId->isHECchannel(febid)) {
130 subcaloFTs.insert(m_onlineId->feedthrough_Id(febid));
131 }
132 }
133 }
134 if (m_subCaloPreselection.value().find("FCAL")!=std::string::npos) {
135 for (auto febid : m_onlineId->feb_range()) {
136 if (m_onlineId->isFCALchannel(febid)) {
137 subcaloFTs.insert(m_onlineId->feedthrough_Id(febid));
138 }
139 }
140 }
141 } else {
142 ATH_MSG_ERROR("Configuration problem, property 'SubCaloPreselection' set to " << m_subCaloPreselection.value() << ", expect 'EM', 'HEC' or 'FCAL'");
143 return StatusCode::FAILURE;
144 }
145 if (m_vFinalPreselection.size()>0) {
146 //Form the intersection of the preselection give as subdet and side/FT/slot
147 for(auto it = m_vFinalPreselection.begin(); it != m_vFinalPreselection.end(); ) {
148 if (subcaloFTs.find(*it)==subcaloFTs.end())
149 it=m_vFinalPreselection.erase(it);
150 else
151 ++it;
152 }
153 if (m_vFinalPreselection.empty()) {
154 ATH_MSG_WARNING("Apparently inconistent configuration of FT preselections. No preselection left after intersecting 'SubCaloPreselection' with 'PosNeg/BE/FT' preselection");
155 }
156 }
157 else {
158 m_vFinalPreselection.swap(subcaloFTs);
159 }
160 }//end if subCaloPreselection set
161
162 if (!m_vFinalPreselection.empty()) {
163 ATH_MSG_INFO("Give pre-selection covers " << m_vFinalPreselection.size() << " feedthroughts. Will ignore bytestream data from other feedthroughs.");
164 }
165
166 return StatusCode::SUCCESS;
167}
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
const ServiceHandle< StoreGateSvc > & detStore() const
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.
Gaudi::Property< std::vector< unsigned > > m_vFTPreselection
Gaudi::Property< std::vector< unsigned > > m_vPosNegPreselection
Gaudi::Property< std::string > m_subCaloPreselection
Gaudi::Property< std::vector< unsigned > > m_vBEPreselection

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

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

SG::WriteHandleKey<LArAccumulatedCalibDigitContainer> LArRawCalibDataReadingAlg::m_accCalibDigitKey {this,"LArAccCalibDigitKey",""}
private

Definition at line 42 of file LArRawCalibDataReadingAlg.h.

42{this,"LArAccCalibDigitKey",""};

◆ m_accDigitKey

SG::WriteHandleKey<LArAccumulatedDigitContainer> LArRawCalibDataReadingAlg::m_accDigitKey {this,"LArAccDigitKey",""}
private

Definition at line 41 of file LArRawCalibDataReadingAlg.h.

41{this,"LArAccDigitKey",""};

◆ m_calibDigitKey

SG::WriteHandleKey<LArCalibDigitContainer> LArRawCalibDataReadingAlg::m_calibDigitKey {this,"LArCalibDigitKey",""}
private

Definition at line 40 of file LArRawCalibDataReadingAlg.h.

40{this,"LArCalibDigitKey",""};

◆ m_CLKey

SG::ReadCondHandleKey<LArCalibLineMapping> LArRawCalibDataReadingAlg::m_CLKey {this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"}
private

Definition at line 36 of file LArRawCalibDataReadingAlg.h.

36{this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"};

◆ m_delayScale

DoubleProperty LArRawCalibDataReadingAlg::m_delayScale {this,"DelayScale",(25./240.)*Gaudi::Units::nanosecond,"One calibration step in time"}
private

Definition at line 57 of file LArRawCalibDataReadingAlg.h.

57{this,"DelayScale",(25./240.)*Gaudi::Units::nanosecond,"One calibration step in time"};

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

SG::WriteHandleKey<LArDigitContainer> LArRawCalibDataReadingAlg::m_DigitKey {this,"LArDigitKey",""}
private

Definition at line 39 of file LArRawCalibDataReadingAlg.h.

39{this,"LArDigitKey",""};

◆ m_doAccCalibDigits

bool LArRawCalibDataReadingAlg::m_doAccCalibDigits =false
private

Definition at line 68 of file LArRawCalibDataReadingAlg.h.

◆ m_doAccDigits

bool LArRawCalibDataReadingAlg::m_doAccDigits =false
private

Definition at line 67 of file LArRawCalibDataReadingAlg.h.

◆ m_doCalibDigits

bool LArRawCalibDataReadingAlg::m_doCalibDigits =false
private

Definition at line 66 of file LArRawCalibDataReadingAlg.h.

◆ m_doDigits

bool LArRawCalibDataReadingAlg::m_doDigits =false
private

Definition at line 65 of file LArRawCalibDataReadingAlg.h.

◆ m_doFebHeaders

bool LArRawCalibDataReadingAlg::m_doFebHeaders =false
private

Definition at line 69 of file LArRawCalibDataReadingAlg.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 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_failOnCorruption

BooleanProperty LArRawCalibDataReadingAlg::m_failOnCorruption {this,"FailOnCorruption",true,"Return FAILURE if data corruption is found"}
private

Definition at line 50 of file LArRawCalibDataReadingAlg.h.

50{this,"FailOnCorruption",true,"Return FAILURE if data corruption is found"};

◆ m_febHeaderKey

SG::WriteHandleKey<LArFebHeaderContainer> LArRawCalibDataReadingAlg::m_febHeaderKey {this,"LArFebHeaderKey",""}
private

Definition at line 43 of file LArRawCalibDataReadingAlg.h.

43{this,"LArFebHeaderKey",""};

◆ m_onlineId

const LArOnlineID* LArRawCalibDataReadingAlg::m_onlineId =nullptr
private

Definition at line 62 of file LArRawCalibDataReadingAlg.h.

◆ m_robDataProviderSvc

ServiceHandle<IROBDataProviderSvc> LArRawCalibDataReadingAlg::m_robDataProviderSvc {this,"ROBDataProviderSvc","ROBDataProviderSvc"}
private

Definition at line 46 of file LArRawCalibDataReadingAlg.h.

46{this,"ROBDataProviderSvc","ROBDataProviderSvc"};

◆ m_subCaloPreselection

Gaudi::Property<std::string> LArRawCalibDataReadingAlg::m_subCaloPreselection {this,"SubCaloPreselection","","One of 'EM', 'HEC' or 'FCAL'"}
private

Definition at line 52 of file LArRawCalibDataReadingAlg.h.

52{this,"SubCaloPreselection","","One of 'EM', 'HEC' or 'FCAL'"};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vBEPreselection

Gaudi::Property<std::vector<unsigned> > LArRawCalibDataReadingAlg::m_vBEPreselection {this,"BEPreselection",{},"For channel-selection: Barrel=0, Endcap=1"}
private

Definition at line 54 of file LArRawCalibDataReadingAlg.h.

54{this,"BEPreselection",{},"For channel-selection: Barrel=0, Endcap=1"};

◆ m_verifyChecksum

BooleanProperty LArRawCalibDataReadingAlg::m_verifyChecksum {this,"VerifyChecksum",true,"Calculate and compare checksums to detect data transmission errors"}
private

Definition at line 49 of file LArRawCalibDataReadingAlg.h.

49{this,"VerifyChecksum",true,"Calculate and compare checksums to detect data transmission errors"};

◆ m_vFinalPreselection

std::set<HWIdentifier> LArRawCalibDataReadingAlg::m_vFinalPreselection
private

Definition at line 59 of file LArRawCalibDataReadingAlg.h.

◆ m_vFTPreselection

Gaudi::Property<std::vector<unsigned> > LArRawCalibDataReadingAlg::m_vFTPreselection {this,"FTNumPreselection",{}, "For channel-selection: Feedthrough numbers (e.g. 0 - 31 for barrel)"}
private

Definition at line 56 of file LArRawCalibDataReadingAlg.h.

56{this,"FTNumPreselection",{}, "For channel-selection: Feedthrough numbers (e.g. 0 - 31 for barrel)"};

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_vPosNegPreselection

Gaudi::Property<std::vector<unsigned> > LArRawCalibDataReadingAlg::m_vPosNegPreselection {this,"PosNegPreselection",{}, "For channel-selection: C-Side:0, A-Side: 1"}
private

Definition at line 55 of file LArRawCalibDataReadingAlg.h.

55{this,"PosNegPreselection",{}, "For channel-selection: C-Side:0, A-Side: 1"};

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