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

#include <LArRawDataReadingAlg.h>

Inheritance diagram for LArRawDataReadingAlg:
Collaboration diagram for LArRawDataReadingAlg:

Public Member Functions

 LArRawDataReadingAlg (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::WriteHandleKey< LArRawChannelContainerm_rawChannelKey
SG::WriteHandleKey< LArDigitContainerm_digitKey {this,"LArDigitKey","FREE"}
SG::WriteHandleKey< LArFebHeaderContainerm_febHeaderKey {this,"LArFebHeaderKey","LArFebHeader"}
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey {this, "eventInfoKey", "EventInfo", "Key for EventInfo object"}
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",false,"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)"}
std::set< HWIdentifierm_vFinalPreselection
const LArOnlineIDm_onlineId =nullptr
bool m_doRawChannels =true
bool m_doDigits =true
bool m_doFebHeaders =true
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 25 of file LArRawDataReadingAlg.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

◆ LArRawDataReadingAlg()

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

Definition at line 23 of file LArRawDataReadingAlg.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 LArRawDataReadingAlg::execute ( const EventContext & ctx) const
override

Definition at line 124 of file LArRawDataReadingAlg.cxx.

124 {
125 LArRawChannelContainer* rawChannels=nullptr;
126 LArDigitContainer* digits=nullptr;
127 LArFebHeaderContainer* febHeaders=nullptr;
128
129 if (m_doRawChannels) {
130 SG::WriteHandle<LArRawChannelContainer> rawChannelsHdl(m_rawChannelKey,ctx);
131 ATH_CHECK(rawChannelsHdl.record(std::make_unique<LArRawChannelContainer>()));
132 rawChannels=rawChannelsHdl.ptr();
133 rawChannels->reserve(182468); //Total number of LAr readout channels
134 }
135
136 if (m_doDigits) {
137 SG::WriteHandle<LArDigitContainer> digitsHdl(m_digitKey,ctx);
138 ATH_CHECK(digitsHdl.record(std::make_unique<LArDigitContainer>()));
139 digits=digitsHdl.ptr();
140 digits->reserve(1000); //Approximate number of Digits above threshold
141 }
142
143 if (m_doFebHeaders) {
144 SG::WriteHandle<LArFebHeaderContainer> febHeadersHdl(m_febHeaderKey,ctx);
145 ATH_CHECK(febHeadersHdl.record(std::make_unique<LArFebHeaderContainer>()));
146 febHeaders=febHeadersHdl.ptr();
147 febHeaders->reserve(1524); //Total number of LAr Front End Boards
148 }
149
150 //Get full events and filter out LAr ROBs
151 const RawEvent* fullEvent=m_robDataProviderSvc->getEvent(ctx);
152 std::map<eformat::SubDetectorGroup, std::vector<const uint32_t*> > rawEventTOC;
153 eformat::helper::build_toc(*fullEvent, rawEventTOC);
154 auto larRobs=rawEventTOC.find(eformat::LAR);
155 if (larRobs==rawEventTOC.end()) {
156 ATH_MSG_DEBUG("No LAr data found in this event. Recording empty LArRawChannelContainer");
157 return StatusCode::SUCCESS;
158 }
159
160
161 std::unique_ptr<LArRodBlockStructure> rodBlock;
162 uint16_t rodMinorVersion=0x0;
163 uint32_t rodBlockType=0x0;
164
165
166 for (const uint32_t* robPtr : larRobs->second) {
168 ATH_MSG_VERBOSE("Decoding ROB fragment 0x" << std::hex << rob.rob_source_id () << " with " << std::dec << rob.rod_fragment_size_word() << " ROB words");
169
170 if (rob.rod_fragment_size_word() <3) {
171 if (m_failOnCorruption) {
172 ATH_MSG_ERROR("Encountered corrupt ROD fragment, less than 3 words!");
173 return StatusCode::FAILURE;
174 }else {
175 continue;
176 }
177 } else if(rob.rob_source_id()& 0x1000 ){
178 //ATH_MSG_DEBUG(" skip Latome fragment with source ID "<< std::hex << rob.rob_source_id()
179 rodBlock=nullptr;
180 continue;
181 } else if(!(rob.rod_source_id()>>12& 0x0F) //0xnn0nnn must be
182 && !((rob.rod_source_id()>>20) == 4) ){ //0x4nnnnn must be
183
184 ATH_MSG_WARNING("Found not LAr fragment " << " event: "<<ctx.eventID().event_number());
185 SG::ReadHandle<xAOD::EventInfo> eventInfo (m_eventInfoKey, ctx);
186 ATH_MSG_WARNING("Rob source id.: 0x"<< std::hex << rob.rob_source_id () <<std::dec <<" ROD Source id: 0x"<<std::hex<<rob.rod_source_id()<<std::dec<<" Lvl1ID: "<<eventInfo->extendedLevel1ID());
187 continue;
188 }
189
190
191 eformat::helper::Version ver(rob.rod_version());
192 //(re-)init rodBlock only once per event or if (very unlikly or even impossible) some FEBs have a different firmware
193 if (rodBlock==nullptr || rodMinorVersion !=ver.minor_version() || rodBlockType!=(rob.rod_detev_type()&0xff)) {
194 rodMinorVersion=ver.minor_version();
195 rodBlockType=rob.rod_detev_type()&0xff;
196 ATH_MSG_VERBOSE("Found version " << rodMinorVersion << " of Rod Block Type " << rodBlockType);
197 if (rodBlockType==4) { //Physics mode
198 switch(rodMinorVersion) {
199 case 12: //Physics mode v6 09.03.2011 for LHC
200 rodBlock.reset(new LArRodBlockPhysicsV6 (this->msgSvc().get()));
201 break;
202 case 11: //Physics mode v5 16.06.2008 for LHC
203 case 10: //Physics mode v5 16.06.2008 for LHC
204 rodBlock.reset(new LArRodBlockPhysicsV5 (this->msgSvc().get()));
205 break;
206 default: // Unknown version of rod block type 4 (Physics mode)
207 if (m_failOnCorruption) {
208 ATH_MSG_ERROR("Found unsupported ROD Block version " << rodMinorVersion
209 << " of ROD block type " << rodBlockType << ". ROD Source id: 0x" <<std::hex<<rob.rod_source_id());
210 return StatusCode::FAILURE;
211 }
212 else {
213 ATH_MSG_WARNING("Found unsupported ROD Block version " << rodMinorVersion
214 << " of ROD block type " << rodBlockType << ". ROD Source id: 0x" <<std::hex<<rob.rod_source_id());
215 continue;
216 }
217 }// end switch(rodMinorVersion)
218 }//end rodBlockType==4 (physics mode)
219 else if (rodBlockType==2) { //Transparent mode
220 switch(rodMinorVersion) {
221 case 4:
222 rodBlock.reset(new LArRodBlockTransparentV0<LArRodBlockHeaderTransparentV0> (this->msgSvc().get()));
223 break;
224 case 12:
225 rodBlock.reset(new LArRodBlockCalibrationV3 (this->msgSvc().get()));
226 break;
227 default:
228 ATH_MSG_WARNING("Found unsupported ROD Block version " << rodMinorVersion
229 << " of ROD block type " << rodBlockType);
230 return m_failOnCorruption ? StatusCode::FAILURE : StatusCode::SUCCESS;
231 }
232 }
233 }//End if need to re-init RodBlock
234
235 const uint32_t* pData=rob.rod_data();
236 const uint32_t nData=rob.rod_ndata();
237 if (nData==0) {
238 if (m_failOnCorruption) {
239 ATH_MSG_ERROR("ROD 0x"<<std::hex<<rob.rod_source_id() << std::dec << " reports data block size 0");
240 return StatusCode::FAILURE;
241 }
242 else {
243 ATH_MSG_WARNING("ROD 0x"<<std::hex<<rob.rod_source_id() << std::dec << " reports data block size 0");
244 continue; //Jump to next ROD
245 }
246 }
247
248 if (!rodBlock || !rodBlock->setFragment(pData,nData)) {
249 if (m_failOnCorruption) {
250 ATH_MSG_ERROR("Failed to assign fragment pointer to LArRodBlockStructure");
251 return StatusCode::FAILURE;
252 }
253 else {
254 ATH_MSG_WARNING("Failed to assign fragment pointer to LArRodBlockStructure");
255 continue; // Jump to next ROD
256 }
257 }
258
259 if(m_verifyChecksum) {
260 const uint32_t onsum = rodBlock->onlineCheckSum();
261 const uint32_t offsum = rodBlock->offlineCheckSum();
262 if(onsum!=offsum) {
263 if (m_failOnCorruption) {
264 ATH_MSG_ERROR("Checksum error:");
265 ATH_MSG_ERROR("online checksum = 0x" << MSG::hex << onsum);
266 ATH_MSG_ERROR("offline checksum = 0x" << MSG::hex << offsum << MSG::dec);
267 return StatusCode::FAILURE;
268 } else {
269 continue; //Jump to the next ROD-block
270 }
271 }
272 }
273
274 //Loop over FEBs in ROD:
275 do {
276 HWIdentifier fId(Identifier32(rodBlock->getFEBID()));
277 if (!m_onlineId->isValidId(fId)) {
278 if (m_failOnCorruption){
279 ATH_MSG_ERROR("Invalid FEB identifer 0x" << std::hex << fId.get_identifier32().get_compact());
280 return StatusCode::FAILURE;
281 } else {
282 ATH_MSG_WARNING("Invalid FEB identifer 0x" << std::hex << fId.get_identifier32().get_compact());
283 continue; //Jump to next FEB
284 }
285 }
286
287 if (m_vFinalPreselection.size()) {
288 const auto ftId=m_onlineId->feedthrough_Id(fId);
289 if (m_vFinalPreselection.find(ftId)==m_vFinalPreselection.end()) {
290 ATH_MSG_DEBUG("Feedthrough with id " << MSG::hex << ftId << MSG::dec <<" not in preselection. Ignored.");
291 continue;
292 } else {
293 ATH_MSG_DEBUG("Feedthrough with id " << MSG::hex << ftId << MSG::dec <<" is preselected.");
294 }
295 }
296
297 const int NthisFebChannel=m_onlineId->channelInSlotMax(fId);
298
299 //Decode RawChanels (if requested)
300 if (m_doRawChannels) {
301 int32_t energy;
302 int32_t time;
303 int32_t quality;
305 int fcNb;
306 while (rodBlock->getNextEnergy(fcNb,energy,time,quality,gain)) {
307 if (fcNb>=NthisFebChannel)
308 continue;
309
310 HWIdentifier cId = m_onlineId->channel_Id(fId,fcNb);
311 uint16_t iquality = 0;
312 uint16_t iprovenance = LArProv::DSPCALC; //0x1000
313 if (quality>0) {
314 iprovenance |= LArProv::QTPRESENT; //0x2000
315 iquality = (quality & 0xFFFF);
316 }
317 rawChannels->emplace_back(cId, energy, time, iquality, iprovenance, (CaloGain::CaloGain)gain);
318 }//end getNextEnergyLoop
319 }//end if m_doRawChannels
320
321 //Decode LArDigits (if requested)
322 if (m_doDigits) {
324 int fcNb;
325 std::vector<short> samples;
326 while (rodBlock->getNextRawData(fcNb,samples,gain)) {
327 if (fcNb>=NthisFebChannel)
328 continue;
329 if (samples.size()==0) continue; // Ignore missing cells
330 HWIdentifier cId = m_onlineId->channel_Id(fId,fcNb);
331 digits->emplace_back(new LArDigit(cId, (CaloGain::CaloGain)gain, std::move(samples)));
332 samples.clear();
333 }//end getNextRawData loop
334 }//end if m_doDigits
335
336 //Decode FebHeaders (if requested)
337 if (m_doFebHeaders) {
338 std::unique_ptr<LArFebHeader> larFebHeader(new LArFebHeader(fId));
339 LArFebHeaderReader::fillFebHeader(larFebHeader.get(),rodBlock.get(),rob);
340 febHeaders->push_back(std::move(larFebHeader));
341 }//end if m_doFebHeaders
342
343 }while (rodBlock->nextFEB()); //Get NextFeb
344 } //end loop over ROBs
345 return StatusCode::SUCCESS;
346}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old LArRawChannelContainer
Definition LArTPCnv.cxx:86
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.
std::set< HWIdentifier > m_vFinalPreselection
BooleanProperty m_failOnCorruption
SG::WriteHandleKey< LArRawChannelContainer > m_rawChannelKey
const LArOnlineID * m_onlineId
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
SG::WriteHandleKey< LArFebHeaderContainer > m_febHeaderKey
BooleanProperty m_verifyChecksum
SG::WriteHandleKey< LArDigitContainer > m_digitKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:132
time(flags, cells_name, *args, **kw)
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 LArRawDataReadingAlg::initialize ( )
override

Definition at line 26 of file LArRawDataReadingAlg.cxx.

26 {
29
30 m_doDigits = !m_digitKey.empty();
31 ATH_CHECK(m_digitKey.initialize(m_doDigits));
32
35
36 ATH_CHECK(m_eventInfoKey.initialize() );
37
39 ATH_CHECK(detStore()->retrieve(m_onlineId,"LArOnlineID"));
40 //
41 //Fill FT list if only Barrel/EC and side is given:
42 if (m_vBEPreselection.size() && m_vPosNegPreselection.size() && m_vFTPreselection.size()==0) {
43 std::set<unsigned> fts;
44 if (std::find(m_vBEPreselection.begin(),m_vBEPreselection.end(),0)!=m_vBEPreselection.end()) { //Barrel selected
45 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});
46 }
47 if (std::find(m_vBEPreselection.begin(),m_vBEPreselection.end(),1)!=m_vBEPreselection.end()) { //Endcap selected
48 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});
49 }
50 m_vFTPreselection.value().insert(m_vFTPreselection.begin(),fts.begin(),fts.end());
51 }
52
53 //Build list of preselected Feedthroughs
54 if (m_vBEPreselection.size() && m_vPosNegPreselection.size() && m_vFTPreselection.size()) {
55 ATH_MSG_INFO("Building list of selected feedthroughs");
56 for (const unsigned iBE : m_vBEPreselection) {
57 for (const unsigned iPN: m_vPosNegPreselection) {
58 for (const unsigned iFT: m_vFTPreselection) {
59 HWIdentifier finalFTId=m_onlineId->feedthrough_Id(iBE,iPN,iFT);
60 //unsigned int finalFTId32 = finalFTId.get_identifier32().get_compact();
61 ATH_MSG_INFO("Adding feedthrough Barrel/Endcap=" << iBE << " pos/neg=" << iPN << " FT=" << iFT
62 //<< " (0x" << std::hex << finalFTId.get_identifier32().get_compact() << std::dec << ")");
63 << " " << std::hex << finalFTId << std::dec << ")");
64 m_vFinalPreselection.insert(finalFTId);
65 }
66 }
67 }
68 }//end if something set
69
70 if (!m_subCaloPreselection.value().empty()) {
71 ATH_MSG_INFO("Adding list of selected subcalo"<<m_subCaloPreselection.value());
72 std::set<HWIdentifier> subcaloFTs;
73 if (m_subCaloPreselection.value().compare("EM")==0) {
74 for (auto febid : m_onlineId->feb_range()) {
75 if (m_onlineId->isEMBchannel(febid) || m_onlineId->isEMECchannel(febid)) {
76 subcaloFTs.insert(m_onlineId->feedthrough_Id(febid));
77 }
78 }
79 }
80 else if (m_subCaloPreselection.value().find("HEC")!=std::string::npos || m_subCaloPreselection.value().find("FCAL")!=std::string::npos) {
81 if (m_subCaloPreselection.value().find("HEC")!=std::string::npos) {
82 for (auto febid : m_onlineId->feb_range()) {
83 if (m_onlineId->isHECchannel(febid)) {
84 subcaloFTs.insert(m_onlineId->feedthrough_Id(febid));
85 }
86 }
87 }
88 if (m_subCaloPreselection.value().find("FCAL")!=std::string::npos) {
89 for (auto febid : m_onlineId->feb_range()) {
90 if (m_onlineId->isFCALchannel(febid)) {
91 subcaloFTs.insert(m_onlineId->feedthrough_Id(febid));
92 }
93 }
94 }
95 } else {
96 ATH_MSG_ERROR("Configuration problem, property 'SubCaloPreselection' set to " << m_subCaloPreselection.value() << ", expect 'EM', 'HEC' or 'FCAL'");
97 return StatusCode::FAILURE;
98 }
99 std::cout << "set sizes:" << subcaloFTs.size() << ", " << m_vFinalPreselection.size() << std::endl;
100 if (m_vFinalPreselection.size()>0) {
101 //Form the intersection of the preselection give as subdet and side/FT/slot
102 for(auto it = m_vFinalPreselection.begin(); it != m_vFinalPreselection.end(); ) {
103 if (subcaloFTs.find(*it)==subcaloFTs.end())
104 it=m_vFinalPreselection.erase(it);
105 else
106 ++it;
107 }
108 if (m_vFinalPreselection.empty()) {
109 ATH_MSG_WARNING("Apparently inconistent configuration of FT preselections. No preselection left after intersecting 'SubCaloPreselection' with 'PosNeg/BE/FT' preselection");
110 }
111 }
112 else {
113 m_vFinalPreselection.swap(subcaloFTs);
114 }
115 }//end if subCaloPreselection set
116
117 if (!m_vFinalPreselection.empty()) {
118 ATH_MSG_INFO("Give pre-selection covers " << m_vFinalPreselection.size() << " feedthroughts. first is: "<< MSG::hex << *(m_vFinalPreselection.begin()) << MSG::dec <<" Will ignore bytestream data from other feedthroughs.");
119 }
120
121 return StatusCode::SUCCESS;
122}
#define ATH_MSG_INFO(x)
const ServiceHandle< StoreGateSvc > & detStore() const
Gaudi::Property< std::vector< unsigned > > m_vPosNegPreselection
Gaudi::Property< std::vector< unsigned > > m_vBEPreselection
Gaudi::Property< std::string > m_subCaloPreselection
Gaudi::Property< std::vector< unsigned > > m_vFTPreselection

◆ 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_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> LArRawDataReadingAlg::m_digitKey {this,"LArDigitKey","FREE"}
private

Definition at line 36 of file LArRawDataReadingAlg.h.

36{this,"LArDigitKey","FREE"};

◆ m_doDigits

bool LArRawDataReadingAlg::m_doDigits =true
private

Definition at line 61 of file LArRawDataReadingAlg.h.

◆ m_doFebHeaders

bool LArRawDataReadingAlg::m_doFebHeaders =true
private

Definition at line 62 of file LArRawDataReadingAlg.h.

◆ m_doRawChannels

bool LArRawDataReadingAlg::m_doRawChannels =true
private

Definition at line 60 of file LArRawDataReadingAlg.h.

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> LArRawDataReadingAlg::m_eventInfoKey {this, "eventInfoKey", "EventInfo", "Key for EventInfo object"}
private

Definition at line 39 of file LArRawDataReadingAlg.h.

39{this, "eventInfoKey", "EventInfo", "Key for EventInfo object"};

◆ 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 LArRawDataReadingAlg::m_failOnCorruption {this,"FailOnCorruption",false,"Return FAILURE if data corruption is found"}
private

Definition at line 46 of file LArRawDataReadingAlg.h.

46{this,"FailOnCorruption",false,"Return FAILURE if data corruption is found"};

◆ m_febHeaderKey

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

Definition at line 37 of file LArRawDataReadingAlg.h.

37{this,"LArFebHeaderKey","LArFebHeader"};

◆ m_onlineId

const LArOnlineID* LArRawDataReadingAlg::m_onlineId =nullptr
private

Definition at line 57 of file LArRawDataReadingAlg.h.

◆ m_rawChannelKey

SG::WriteHandleKey<LArRawChannelContainer> LArRawDataReadingAlg::m_rawChannelKey
private
Initial value:
{this,"LArRawChannelKey","LArRawChannels",
"SG key of the LArRawChannelContainer"}

Definition at line 34 of file LArRawDataReadingAlg.h.

34 {this,"LArRawChannelKey","LArRawChannels",
35 "SG key of the LArRawChannelContainer"};

◆ m_robDataProviderSvc

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

Definition at line 42 of file LArRawDataReadingAlg.h.

42{this,"ROBDataProviderSvc","ROBDataProviderSvc"};

◆ m_subCaloPreselection

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

Definition at line 48 of file LArRawDataReadingAlg.h.

48{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> > LArRawDataReadingAlg::m_vBEPreselection {this,"BEPreselection",{},"For channel-selection: Barrel=0, Endcap=1"}
private

Definition at line 50 of file LArRawDataReadingAlg.h.

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

◆ m_verifyChecksum

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

Definition at line 45 of file LArRawDataReadingAlg.h.

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

◆ m_vFinalPreselection

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

Definition at line 54 of file LArRawDataReadingAlg.h.

◆ m_vFTPreselection

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

Definition at line 52 of file LArRawDataReadingAlg.h.

52{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> > LArRawDataReadingAlg::m_vPosNegPreselection {this,"PosNegPreselection",{}, "For channel-selection: C-Side:0, A-Side: 1"}
private

Definition at line 51 of file LArRawDataReadingAlg.h.

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

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