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

this is done in the original (run2) tool; trying to replace this with an include above. More...

#include <MuCTPIPhase1ByteStreamAlgo.h>

Inheritance diagram for MuCTPIPhase1ByteStreamAlgo:
Collaboration diagram for MuCTPIPhase1ByteStreamAlgo:

Public Member Functions

 MuCTPIPhase1ByteStreamAlgo (const std::string &name, ISvcLocator *svcLoc)
 Default constructor.
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &eventContext) const override
virtual StatusCode finalize () override
StatusCode convert (const IROBDataProviderSvc::ROBF *rob, SG::WriteHandle< MuCTPI_Phase1_RDO > &outputHandle) const
 Convert ROBFragment to MuCTPI_RDO.
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

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

Private Attributes

Gaudi::Property< uint32_t > m_robId {this, "ROBID", 0x760000, "MuCTPI DAQ readout ROB ID"}
 Object storing the various IDs of the MuCTPI fragment.
ServiceHandle< IROBDataProviderSvcm_robDataProviderSvc { this, "ROBDataProviderSvc", "ROBDataProviderSvc", "ROB data provider"}
 ROBDataProvider service handle.
SG::WriteHandleKey< MuCTPI_Phase1_RDOm_MuCTPI_Phase1_RDOKey { this, "MuCTPI_Phase1_RDOKey", "MUCTPI_Phase1_RDO" }
std::vector< uint32_t > m_muctpi_Nbits = {3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1}
Gaudi::Property< std::string > m_alias_db {this,"TriggerDBAlias","TRIGGERDB_RUN3","Alias to the TriggerDB to download CTP configuration from"}
Gaudi::Property< bool > m_doTopo
 Other properties.
const std::string m_barrelRoIFile = "TrigConfMuctpi/Data_ROI_Mapping_Barrel_040422.txt"
const std::string m_ecfRoIFile = "TrigConfMuctpi/Data_RoI_Mapping_EF_040422.txt"
const std::string m_side0LUTFile = "TrigConfMuctpi/lookup_0_040422.json"
const std::string m_side1LUTFile = "TrigConfMuctpi/lookup_1_040422.json"
LVL1MUCTPIPHASE1::L1TopoLUT m_l1topoLUT
 Helper members.
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

this is done in the original (run2) tool; trying to replace this with an include above.

Algo doing the ROB -> MuCTPI_Phase1_RDO ByteStream conversion

Definition at line 34 of file MuCTPIPhase1ByteStreamAlgo.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

◆ MuCTPIPhase1ByteStreamAlgo()

MuCTPIPhase1ByteStreamAlgo::MuCTPIPhase1ByteStreamAlgo ( const std::string & name,
ISvcLocator * svcLoc )

Default constructor.

The constructor takes care of correctly constructing the base class and declaring the tool's interface to the framework.

Definition at line 22 of file MuCTPIPhase1ByteStreamAlgo.cxx.

23 : AthReentrantAlgorithm( name, svcLoc) {}

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}

◆ convert()

StatusCode MuCTPIPhase1ByteStreamAlgo::convert ( const IROBDataProviderSvc::ROBF * rob,
SG::WriteHandle< MuCTPI_Phase1_RDO > & outputHandle ) const

Convert ROBFragment to MuCTPI_RDO.

Conversion from eformat::ROBFragment to RDO.

This is called from the MuCTPIByteStreamCnv::createObj method.

Definition at line 135 of file MuCTPIPhase1ByteStreamAlgo.cxx.

135 {
136
137 ATH_MSG_DEBUG("executing convert() from ROBFragment to RDO");
138 // check ROD source ID
139 const uint32_t rodId = rob->rod_source_id();
140 // check BC ID
141 const uint32_t bcId = rob->rod_bc_id();
142
143 ATH_MSG_DEBUG(" expected ROD sub-detector ID: " << std::hex << m_robId << " ID found: " << std::hex << rodId << std::dec);
144
145 if( rodId != m_robId ) {
146 ATH_MSG_ERROR("Wrong ROD ID found in the MuCTPI ROB fragment!");
147 return StatusCode::FAILURE;
148 }
149
150 ATH_MSG_VERBOSE(" ROD Header BCID " << bcId << ", dumping MuCTPI words:");
151
152 const uint32_t* it_data;
153 rob->rod_data( it_data );
154 const uint32_t ndata = rob->rod_ndata();
155 ATH_MSG_DEBUG("MUCTPI DQ DEBUG: number of ROB data words: " << std::dec << ndata);
156
157 //slices
158 std::vector< LVL1::MuCTPIBits::Slice > slices;
159 LVL1::MuCTPIBits::Slice slice;
160 bool firstSlice=true;
161 std::vector<size_t> errorBits;
162 uint64_t sliceMultiplicity=0;//grouping the 3 multiplicity words, to be processed at the end of the slice
163
164 for( uint32_t iWord = 0; iWord < ndata; ++iWord, ++it_data ) {
165
166 //for each word, get it, find type, and add in Slice struct.
167 uint32_t word = static_cast< uint32_t >( *it_data );
168 ATH_MSG_DEBUG("MUCTPI raw word " << iWord << ": 0x" << std::hex << word << std::dec);
170
171 switch (wordType) {
173
174 ATH_MSG_DEBUG(" MUCTPI DQ DEBUG: Timeslice found: "<< std::hex << word);
175
176 //add previous slice if any
177 if(!firstSlice)
178 {
179 ATH_MSG_DEBUG(" MUCTPI DQ DEBUG: new timeslice found (pushing)");
180 slices.push_back(slice);
181 }
182 else
183 firstSlice=false;
184
185 //make new slice (to be improved, since "new" will give pointer)
186 slice = LVL1::MuCTPIBits::Slice();
187
188 const auto header = LVL1::MuCTPIBits::timesliceHeader(word);
189 ATH_MSG_DEBUG("This is a timeslice header word with BCID=" << header.bcid
190 << ", NTOB=" << header.tobCount << ", NCAND=" << header.candCount);
191 slice.bcid = header.bcid;
192 slice.nCand = header.candCount;
193 slice.nTOB = header.tobCount;
194 break;
195 }
198 ATH_MSG_DEBUG("This is a multiplicity word #" << tmNum);
199
200 if(m_muctpi_Nbits.size()==32)
201 {
202 //fill mult word into temp container until 3rd word is found
203 if(tmNum==1)
205 else if(tmNum==2)
207 else if(tmNum==3)
209
210 //flags from third word
211 //AND: process multiplicity for the slice!!!
212 if(tmNum==3)
213 {
216 slice.mlt.bits = sliceMultiplicity;
217
218 //process the long mult word into 32 mlt thr counters
219 for(uint iThr=0;iThr<m_muctpi_Nbits.size();iThr++)
220 {
221 uint thismask=0;
222 if(m_muctpi_Nbits[iThr]==1)
223 thismask=0x1;
224 else if(m_muctpi_Nbits[iThr]==2)
225 thismask=0x3;
226 else if(m_muctpi_Nbits[iThr]==3)
227 thismask=0x7;
228
229 //keep only the part of the 64bit word corresponding to the nbits value
230 slice.mlt.cnt.push_back( sliceMultiplicity & thismask);
231 //"throw away" the part of the 64bit word that we just used
232 sliceMultiplicity >>= m_muctpi_Nbits[iThr];
233 }
234
235 sliceMultiplicity=0;//cleaning just in case..
236 }
237
238 }
239 else
240 {
241 //if nbits size !=32, then it's not set
242 //for now, ignore, and can fill the histos with the Mult bits, as they come
243 //without decoding
244 //=>suppress this warning
245 //ATH_MSG_WARNING("MUCTPI DQ DEBUG: skipping Mult processing, no nbits defined");
246
247 //todo: add code + histos for Mult bits
248 }
249
250 break;
251 }
253 ATH_MSG_DEBUG("This is a RoI candidate word");
254
255 LVL1::MuCTPIBits::Candidate thiscand(word);
256
257 // We calculate eta/phi coordinates for each candidate with the
258 // full resolution available.
259 if(thiscand.type == LVL1::MuCTPIBits::SubsysID::Barrel)
260 {
261 thiscand.eta = m_l1topoLUT.getCoordinates(thiscand.side, thiscand.subsystem, thiscand.num, thiscand.roi).eta;
262 thiscand.phi = m_l1topoLUT.getCoordinates(thiscand.side, thiscand.subsystem, thiscand.num, thiscand.roi).phi;
263 //ATH_MSG_INFO("Candidate Pt " << thiscand.pt);
264 thiscand.mappedPt = LVL1::MuCTPIBits::RPCtoTGC_pt_map[thiscand.pt];
265 //ATH_MSG_INFO("Candidate mapped Pt " << thiscand.mappedPt);
266 }
267 else if(thiscand.type == LVL1::MuCTPIBits::SubsysID::Endcap)
268 {
269 thiscand.eta = m_l1topoLUT.getCoordinates(thiscand.side, thiscand.subsystem, thiscand.num, thiscand.roi).eta;
270 thiscand.phi = m_l1topoLUT.getCoordinates(thiscand.side, thiscand.subsystem, thiscand.num, thiscand.roi).phi;
271 }
272 else if(thiscand.type == LVL1::MuCTPIBits::SubsysID::Forward)
273 {
274 thiscand.eta = m_l1topoLUT.getCoordinates(thiscand.side, thiscand.subsystem, thiscand.num, thiscand.roi).eta;
275 thiscand.phi = m_l1topoLUT.getCoordinates(thiscand.side, thiscand.subsystem, thiscand.num, thiscand.roi).phi;
276 }
277 slice.cand.push_back(thiscand);
278 break;
279 }
281 ATH_MSG_DEBUG("This is a Topo TOB word "<< std::hex << word);
282 LVL1::MuCTPIBits::TopoTOB thistob(word);
283
284 if(thistob.det == 0) // BA
285 {
286 try
287 {
288 thistob.roi = m_l1topoLUT.getBarrelROI(thistob.side, thistob.sec, thistob.barrel_eta_lookup, thistob.barrel_phi_lookup);
289 }
290 catch (const std::out_of_range& e) // Occurs when getBarrelROI fails to find entry in the map
291 {
293 ATH_MSG_WARNING("TopoTOB word not found in LUT!"
294 << " (" << e.what() << " exception)"
295 << " Word info: det = " << thistob.det
296 << ", subsystem = " << thistob.subsystem
297 << ", side = " << thistob.side
298 << ", sector = " << thistob.sec
299 << ", ieta = " << thistob.barrel_eta_lookup
300 << ", iphi = " << thistob.barrel_phi_lookup);
301 break;
302 }
303 thistob.etaDecoded = m_l1topoLUT.getCoordinates(thistob.side, thistob.subsystem, thistob.sec, thistob.roi).eta;
304 thistob.phiDecoded = m_l1topoLUT.getCoordinates(thistob.side, thistob.subsystem, thistob.sec, thistob.roi).phi;
305 }
306 else // FW or EC
307 {
308 // FW and EC have the ROI initialized in the constructor of the Topo word, because it is encoded in eta_raw and phi_raw
309 thistob.etaDecoded = m_l1topoLUT.getCoordinates(thistob.side, thistob.subsystem, thistob.sec, thistob.roi).eta;
310 thistob.phiDecoded = m_l1topoLUT.getCoordinates(thistob.side, thistob.subsystem, thistob.sec, thistob.roi).phi;
311 }
312 slice.tob.push_back(thistob);
313 break;
314 }
316 ATH_MSG_DEBUG("This is a status word"<< std::hex << word);
318 if (!errorBits.empty()) {
319 ATH_MSG_DEBUG("MUCTPI ROD data flagged with errors. The data status word is 0x" << std::hex << word << std::dec);
320 for (size_t bit : errorBits) {
321 ATH_MSG_DEBUG("Error bit " << bit << ": " << LVL1::MuCTPIBits::DataStatusWordErrors.at(bit));
322 }
323 }
324 break;
325 }
326 default: {
327 ATH_MSG_ERROR("The MUCTPI word 0x" << std::hex << word << std::dec << " does not match any known word type");
328 return StatusCode::FAILURE;
329 }//default
330 }//switch
331 }//for each word
332
333 //add last timeslice in vector, since there is no end-slice flag
334 ATH_MSG_DEBUG(" MUCTPI DQ DEBUG: out of words (pushing last slice)");
335 slices.push_back( std::move(slice) );
336
337 // Check that the number of exceptions is below a limit based on the number of slices.
338 // Exceptions can occur if word is present in multiple timeslices for same event.
339 // This allows for cases where we have one or two bad words per event, but not where lots of map errors arise.
340 if (barrelROIFailCounter == slices.size() + 2 )
341 {
342 ATH_MSG_ERROR("TopoTOB word exception count exceeded limit!");
343 return StatusCode::FAILURE;
344 }
345
346 // create MuCTPI RDO
347 ATH_CHECK(outputHandle.record(
348 std::make_unique<MuCTPI_Phase1_RDO>(std::move(slices), std::move(errorBits))
349 ));
350 return StatusCode::SUCCESS;
351}
#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)
unsigned int uint
static std::atomic< unsigned int > barrelROIFailCounter
uint16_t bcId(uint32_t data)
std::vector< uint32_t > m_muctpi_Nbits
LVL1MUCTPIPHASE1::L1TopoLUT m_l1topoLUT
Helper members.
Gaudi::Property< uint32_t > m_robId
Object storing the various IDs of the MuCTPI fragment.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
constexpr uint32_t maskedWord(uint32_t word, uint32_t shift, uint32_t mask)
Extract sub-word from 32-bit word by applying a shift and a mask.
static constexpr uint32_t RUN3_MULTIPLICITY_ENC_PART1_SHIFT
constexpr uint32_t multiplicityWordNumber(uint32_t word)
Decode the index of the multitpicity word, which is 1, 2, or 3.
static constexpr uint32_t RUN3_MULTIPLICITY_PART1_MASK
static constexpr uint32_t RUN3_NSW_MONITORING_TRIGGER_SHIFT
static constexpr std::array< std::string_view, 16 > DataStatusWordErrors
constexpr auto timesliceHeader(uint32_t word)
Decode timeslice word.
static constexpr uint32_t RUN3_MULTIPLICITY_ENC_PART2_SHIFT
static constexpr uint32_t RUN3_NSW_MONITORING_TRIGGER_MASK
static constexpr uint32_t RUN3_MULTIPLICITY_PART1_SHIFT
constexpr WordType getWordType(uint32_t word)
Determine the type of a MUCTPI ROD word.
static constexpr uint32_t RUN3_MULTIPLICITY_ENC_PART3_SHIFT
static constexpr uint32_t RUN3_MULTIPLICITY_OVERFLOW_MASK
static constexpr uint32_t RUN3_MULTIPLICITY_PART2_MASK
std::vector< size_t > getDataStatusWordErrors(uint32_t word)
Decode the data status word (returns a vector of bit indices for the errors set - empty if no errors)
static constexpr uint32_t RUN3_MULTIPLICITY_PART3_SHIFT
const uint32_t RPCtoTGC_pt_map[7]
static constexpr uint32_t RUN3_MULTIPLICITY_PART3_MASK
static constexpr uint32_t RUN3_MULTIPLICITY_PART2_SHIFT
static constexpr uint32_t RUN3_MULTIPLICITY_OVERFLOW_SHIFT
setEventNumber uint32_t

◆ 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 MuCTPIPhase1ByteStreamAlgo::execute ( const EventContext & eventContext) const
overridevirtual

Definition at line 110 of file MuCTPIPhase1ByteStreamAlgo.cxx.

110 {
111 ATH_MSG_DEBUG("Executing " << name());
112
113 // Retrieve the BS data for all tools in one request to parallelise DCM->ROS network requests
115 std::vector<uint32_t> robID = { m_robId };// Source ID of MIROD
116 //get rob fragment(s)
117 m_robDataProviderSvc->getROBData(eventContext, robID, vrobf, name());
118 //should only receive exactly 1 fragment; make sure:
119 if(vrobf.size()!=1)
120 {
121 ATH_MSG_ERROR("Wrong number of MUCTPI fragment in event: vrobf.size()="<<vrobf.size());
122 return StatusCode::FAILURE;
123 }
124
125 //make the conversion, i.e. make the RDO, record it
126 SG::WriteHandle<MuCTPI_Phase1_RDO> outputHandle{m_MuCTPI_Phase1_RDOKey, eventContext};
127 ATH_CHECK(convert(vrobf[0],outputHandle));
128 return StatusCode::SUCCESS;
129}
std::vector< const ROBF * > VROBFRAG
StatusCode convert(const IROBDataProviderSvc::ROBF *rob, SG::WriteHandle< MuCTPI_Phase1_RDO > &outputHandle) const
Convert ROBFragment to MuCTPI_RDO.
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
ROBDataProvider service handle.
SG::WriteHandleKey< MuCTPI_Phase1_RDO > m_MuCTPI_Phase1_RDOKey

◆ 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 MuCTPIPhase1ByteStreamAlgo::finalize ( )
overridevirtual

Definition at line 353 of file MuCTPIPhase1ByteStreamAlgo.cxx.

354{
355 if (barrelROIFailCounter != 0) ATH_MSG_WARNING(barrelROIFailCounter << " TopoTOB words could not retrieve RoIs in the barrel");
356 return StatusCode::SUCCESS;
357}

◆ initialize()

StatusCode MuCTPIPhase1ByteStreamAlgo::initialize ( )
overridevirtual

fetch nbits vector from l1menu (todo: fix) bool success=false; TrigConf::L1CTPFiles ctpfiles; SG::ReadHandleKey<TrigConf::L1Menu> L1MenuKey{this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu", "L1 Menu"};

ATH_CHECK(L1MenuKey.initialize()); if(L1MenuKey.initialize()) { SG::ReadHandle<TrigConf::L1Menu> l1Menu = SG::makeHandle(L1MenuKey);

if (!l1Menu.isValid()) { ATH_MSG_ERROR("MUCTPI DQ DEBUG: CTPFILES L1 menu INvalid! Cannot read nbits for mlt word"); } else { ATH_MSG_DEBUG("MUCTPI DQ DEBUG: CTPFILES L1 menu valid"); uint smk = l1Menu->smk(); TrigConf::TrigDBCTPFilesLoader db_loader(m_alias_db); options below added according to TrigConf::L1CTPFiles header file ATH_MSG_DEBUG("MUCTPI DQ DEBUG: CTPFILES L1 menu load files with smk="<<smk); try{success = db_loader.loadHardwareFiles(smk, ctpfiles,0x08);} catch(std::exception& e){ ATH_MSG_ERROR("MUCTPI DQ DEBUG: CTPFILES loadHardwareFiles exception: "<<e.what()); } catch(...){ ATH_MSG_ERROR("MUCTPI DQ DEBUG: CTPFILES loadHardwareFiles: Unknown exception"); }

ATH_MSG_DEBUG("MUCTPI DQ DEBUG: CTPFILES success="<<success); } if(!ctpfiles.hasCompleteMuctpiData()) { ATH_MSG_ERROR("MUCTPI DQ DEBUG: CTPFILES Incomplete MUCTPI data from TriggerDB"); } else if(success) { ATH_MSG_DEBUG("MUCTPI DQ DEBUG: CTPFILES L1 menu load files success!"); try { m_muctpi_Nbits = (std::vector<uint32_t>) ctpfiles.muctpi_Nbits(); if(m_muctpi_Nbits.size()!=32) ATH_MSG_ERROR("MUCTPI DQ DEBUG: CTPFILES MUCTPI data from TriggerDB - nbits wrong size: "<<std::dec << m_muctpi_Nbits.size()); else ATH_MSG_WARNING("MUCTPI DQ DEBUG: CTPFILES MUCTPI data from TriggerDB - nbits GOOD SIZE!");

ATH_MSG_DEBUG("MUCTPI DQ DEBUG: CTPFILES L1 menu GOT muctpi nbits");

} catch(std::exception& e){ ATH_MSG_ERROR("MUCTPI DQ DEBUG: CTPFILES exception: "<<e.what()); } catch(...){ ATH_MSG_ERROR("MUCTPI DQ DEBUG: CTPFILES: Unknown exception"); } }

} return StatusCode::SUCCESS;

Definition at line 25 of file MuCTPIPhase1ByteStreamAlgo.cxx.

26{
27 ATH_MSG_DEBUG("Initialising " << name());
28
29 ATH_CHECK( m_MuCTPI_Phase1_RDOKey.initialize(/*m_processMuctpi=*/true) );
30
31 //needed to enable the decoding of eta and phi
32 ATH_MSG_INFO("--- ENABLING THE DECODING");
33 const std::string barrelFileName = PathResolverFindCalibFile( m_barrelRoIFile );
34 ATH_MSG_INFO("--- - CHECK BARREL FILE NAME" << barrelFileName);
35 const std::string ecfFileName = PathResolverFindCalibFile( m_ecfRoIFile );
36 ATH_MSG_INFO("--- - CHECK ECF FILE NAME" << ecfFileName);
37 const std::string side0LUTFileName = PathResolverFindCalibFile( m_side0LUTFile );
38 ATH_MSG_INFO("--- - CHECK SIDE0 LUT FILE NAME" << side0LUTFileName);
39 const std::string side1LUTFileName = PathResolverFindCalibFile( m_side1LUTFile );
40 ATH_MSG_INFO("--- - INFO SIDE1 LUT FILE NAME" << side1LUTFileName);
41
42 CHECK( m_l1topoLUT.initializeLUT(barrelFileName,
43 ecfFileName,
44 side0LUTFileName,
45 side1LUTFileName) );
46
47 //return here while looking for fix for this
48 return StatusCode::SUCCESS;
49
50 //this didn't work yet locally (offline). Waiting for feedback and should cleanup or reinclude soon.
51 //not critical; can run without it.
108}
#define ATH_MSG_INFO(x)
#define CHECK(...)
Evaluate an expression and check for errors.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)

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

◆ 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

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

Member Data Documentation

◆ m_alias_db

Gaudi::Property<std::string> MuCTPIPhase1ByteStreamAlgo::m_alias_db {this,"TriggerDBAlias","TRIGGERDB_RUN3","Alias to the TriggerDB to download CTP configuration from"}
private

Definition at line 59 of file MuCTPIPhase1ByteStreamAlgo.h.

59{this,"TriggerDBAlias","TRIGGERDB_RUN3","Alias to the TriggerDB to download CTP configuration from"};

◆ m_barrelRoIFile

const std::string MuCTPIPhase1ByteStreamAlgo::m_barrelRoIFile = "TrigConfMuctpi/Data_ROI_Mapping_Barrel_040422.txt"
private

Definition at line 65 of file MuCTPIPhase1ByteStreamAlgo.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_doTopo

Gaudi::Property<bool> MuCTPIPhase1ByteStreamAlgo::m_doTopo
private
Initial value:
{
this, "DoTopo", false, "Enable decoding/encoding MUCTPI Topo TOBs"}

Other properties.

Definition at line 62 of file MuCTPIPhase1ByteStreamAlgo.h.

62 {
63 this, "DoTopo", false, "Enable decoding/encoding MUCTPI Topo TOBs"};

◆ m_ecfRoIFile

const std::string MuCTPIPhase1ByteStreamAlgo::m_ecfRoIFile = "TrigConfMuctpi/Data_RoI_Mapping_EF_040422.txt"
private

Definition at line 66 of file MuCTPIPhase1ByteStreamAlgo.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_l1topoLUT

LVL1MUCTPIPHASE1::L1TopoLUT MuCTPIPhase1ByteStreamAlgo::m_l1topoLUT
private

Helper members.

Definition at line 71 of file MuCTPIPhase1ByteStreamAlgo.h.

◆ m_muctpi_Nbits

std::vector<uint32_t> MuCTPIPhase1ByteStreamAlgo::m_muctpi_Nbits = {3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1}
private

Definition at line 58 of file MuCTPIPhase1ByteStreamAlgo.h.

58{3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1}; //default value, used for DQ mon

◆ m_MuCTPI_Phase1_RDOKey

SG::WriteHandleKey<MuCTPI_Phase1_RDO> MuCTPIPhase1ByteStreamAlgo::m_MuCTPI_Phase1_RDOKey { this, "MuCTPI_Phase1_RDOKey", "MUCTPI_Phase1_RDO" }
private

Definition at line 56 of file MuCTPIPhase1ByteStreamAlgo.h.

56{ this, "MuCTPI_Phase1_RDOKey", "MUCTPI_Phase1_RDO" };

◆ m_robDataProviderSvc

ServiceHandle<IROBDataProviderSvc> MuCTPIPhase1ByteStreamAlgo::m_robDataProviderSvc { this, "ROBDataProviderSvc", "ROBDataProviderSvc", "ROB data provider"}
private

ROBDataProvider service handle.

Definition at line 54 of file MuCTPIPhase1ByteStreamAlgo.h.

54{ this, "ROBDataProviderSvc", "ROBDataProviderSvc", "ROB data provider"};

◆ m_robId

Gaudi::Property<uint32_t> MuCTPIPhase1ByteStreamAlgo::m_robId {this, "ROBID", 0x760000, "MuCTPI DAQ readout ROB ID"}
private

Object storing the various IDs of the MuCTPI fragment.

Definition at line 51 of file MuCTPIPhase1ByteStreamAlgo.h.

51{this, "ROBID", 0x760000, "MuCTPI DAQ readout ROB ID"};

◆ m_side0LUTFile

const std::string MuCTPIPhase1ByteStreamAlgo::m_side0LUTFile = "TrigConfMuctpi/lookup_0_040422.json"
private

Definition at line 67 of file MuCTPIPhase1ByteStreamAlgo.h.

◆ m_side1LUTFile

const std::string MuCTPIPhase1ByteStreamAlgo::m_side1LUTFile = "TrigConfMuctpi/lookup_1_040422.json"
private

Definition at line 68 of file MuCTPIPhase1ByteStreamAlgo.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: