ATLAS Offline Software
Loading...
Searching...
No Matches
TrigL2MuonSA::MuCalStreamerTool Class Reference

#include <MuCalStreamerTool.h>

Inheritance diagram for TrigL2MuonSA::MuCalStreamerTool:
Collaboration diagram for TrigL2MuonSA::MuCalStreamerTool:

Public Member Functions

 MuCalStreamerTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
const std::string & instanceName () const
void setInstanceName (const std::string &name)
void setBufferName (const std::string &buffName)
StatusCode openStream (int calBufferSize)
StatusCode closeStream ()
bool isStreamOpen ()
StatusCode createRoiFragment (const xAOD::MuonRoI *roi, TrigL2MuonSA::TrackPattern &trackPattern, TrigL2MuonSA::MdtHits &mdtHits, TrigL2MuonSA::RpcHits &rpcHits, TrigL2MuonSA::TgcHits &tgcHits, std::vector< uint32_t > &localBuffer, bool doDataScouting, 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 sysInitialize () override
 Perform system initialization for an algorithm.
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

StatusCode createMdtFragment (TrigL2MuonSA::MdtHits &mdtHits, LVL2_MUON_CALIBRATION::MdtCalibFragment &mdtFragment, float phi) const
StatusCode createRpcFragment (const xAOD::MuonRoI *roi, LVL2_MUON_CALIBRATION::RpcCalibFragment &rpcFragment, const EventContext &ctx) const
StatusCode createTgcFragment (std::vector< uint32_t > &tgcRobIdList, LVL2_MUON_CALIBRATION::TgcCalibFragment &tgcFragment, const EventContext &ctx) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< bool > m_writeToFile { this, "WriteToFile", false, "" }
SG::ReadHandleKey< TgcRdoContainerm_tgcRdoKey {this, "TgcRdoContainer", "TGCRDO", "Tgc RDO Input"}
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey { this, "EventInfoKey", "EventInfo", "" }
SG::ReadHandleKey< RpcPadContainerm_rpcPadKey {this, "RpcPadContainerKey", "RPCPAD", "RpcPad container fro MuCalStreamerTool"}
std::string m_calBufferName
std::string m_algInstanceName
std::ofstream m_outputFile
ToolHandle< IRegSelToolm_regSel_MDT {this, "RegSel_MDT", "RegSelTool/RegSelTool_MDT", "MDT Region Selector Tool"}
ToolHandle< IRegSelToolm_regSel_TGC {this, "RegSel_TGC", "RegSelTool/RegSelTool_TGC", "TGC Region Selector Tool"}
SG::ReadCondHandleKey< RpcCablingCondDatam_readKey {this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"}
TrigL2MuonSA::MuCalCircClientm_circ = nullptr
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 54 of file MuCalStreamerTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuCalStreamerTool()

TrigL2MuonSA::MuCalStreamerTool::MuCalStreamerTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 20 of file MuCalStreamerTool.cxx.

22 :
23 AthAlgTool(type,name,parent)
24{
25}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ closeStream()

StatusCode TrigL2MuonSA::MuCalStreamerTool::closeStream ( )

Definition at line 80 of file MuCalStreamerTool.cxx.

81{
82
83 std::string name = m_calBufferName+"_"+m_algInstanceName;
84 ATH_MSG_DEBUG("I'm going to close the stream "<<name);
85
86 if (m_circ)
87 {
88 delete m_circ;
89 m_circ = nullptr;
90 }
91
92 return StatusCode::SUCCESS;
93
94}
#define ATH_MSG_DEBUG(x)
TrigL2MuonSA::MuCalCircClient * m_circ

◆ createMdtFragment()

StatusCode TrigL2MuonSA::MuCalStreamerTool::createMdtFragment ( TrigL2MuonSA::MdtHits & mdtHits,
LVL2_MUON_CALIBRATION::MdtCalibFragment & mdtFragment,
float phi ) const
private

Definition at line 266 of file MuCalStreamerTool.cxx.

269 {
270
271 TrigL2MuonSA::MdtHits::const_iterator it = mdtHits.begin();
272 for ( ; it != mdtHits.end() ; ++it ) {
273
274 int stationName = (*it).name;
275 int stationEta = (*it).StationEta;
276 int stationPhi = (*it).StationPhi;
277 int multilayer = (*it).Multilayer;
278 int layer = (*it).TubeLayer;
279 int tube = (*it).Tube;
280
281 uint32_t ID = LVL2_MUON_CALIBRATION::MdtIdIntoWord(stationName,
282 stationEta,stationPhi,multilayer,layer,tube);
283
284 uint16_t leadingCoarseTime = (*it).LeadingCoarseTime;
285 uint16_t leadingFineTime = (*it).LeadingFineTime;
286 uint16_t trailingCoarseTime = (*it).TrailingCoarseTime;
287 uint16_t trailingFineTime = (*it).TrailingFineTime;
288 uint16_t adc = (*it).Adc;
289
290 LVL2_MUON_CALIBRATION::MdtCalibData mdt(ID,leadingCoarseTime,leadingFineTime,
291 trailingCoarseTime,trailingFineTime,adc
292 ,trackPhi);
293
294 ATH_MSG_DEBUG("Dumping MDT Hit");
295 ATH_MSG_DEBUG(mdt);
296
297 mdtFragment << mdt;
298 }
299
300 return StatusCode::SUCCESS;
301 }
std::vector< Identifier > ID
constexpr uint8_t stationPhi
station Phi 1 to 8
@ layer
Definition HitInfo.h:79
setWord1 uint16_t
setEventNumber uint32_t

◆ createRoiFragment()

StatusCode TrigL2MuonSA::MuCalStreamerTool::createRoiFragment ( const xAOD::MuonRoI * roi,
TrigL2MuonSA::TrackPattern & trackPattern,
TrigL2MuonSA::MdtHits & mdtHits,
TrigL2MuonSA::RpcHits & rpcHits,
TrigL2MuonSA::TgcHits & tgcHits,
std::vector< uint32_t > & localBuffer,
bool doDataScouting,
const EventContext & ctx ) const

Definition at line 106 of file MuCalStreamerTool.cxx.

114 {
115
116 ATH_MSG_DEBUG("Data scouting is set to"<<doDataScouting);
117
118 // skip the event if it's a noise burst
119 unsigned int totalHits = mdtHits.size()+rpcHits.size()+tgcHits.size();
120 if ( totalHits > 500 ) {
121 ATH_MSG_DEBUG("Too many hits: skip the RoI");
122 return StatusCode::SUCCESS;
123 }
124
125 // init roi pointer
126 if ( !inputroi ) {
127 ATH_MSG_ERROR("Roi not initialized");
128 return StatusCode::FAILURE;
129 }
130
131 // pointer to the muon roi
132 const xAOD::MuonRoI* roi {inputroi};
133
134
135 // retrieve the event and trigger info
136 SG::ReadHandle<xAOD::EventInfo> eventInfo (m_eventInfoKey, ctx);
137 uint32_t runId = ctx.eventID().run_number();
138 uint32_t lvl1Id = eventInfo->extendedLevel1ID();
139
140
141 // get track parameters
142 float eta = (float) track.etaVtx;
143 float phi = (float) track.phiVtx;
144 float pt = (float) track.pt;
145
146 uint32_t mrods[4] = {0, 0, 0, 0};
147 // prepare the header information
148 std::vector<uint32_t> robIdList_MDT;
149 double etaMin = roi->eta()-0.05;
150 double etaMax = roi->eta()+0.05;
151 double phi_roi = roi->phi();
152 double phiMin = roi->phi()-0.05;
153 double phiMax = roi->phi()+0.05;
154 if( phi_roi < 0 ) phi_roi += 2*M_PI;
155 if( phiMin < 0 ) phiMin += 2*M_PI;
156 if( phiMax < 0 ) phiMax += 2*M_PI;
157
158 TrigRoiDescriptor roiDescr( roi->eta(), etaMin, etaMax, phi_roi, phiMin, phiMax );
159
160 const IRoiDescriptor* iroi = (IRoiDescriptor*) &roiDescr;
161 m_regSel_MDT->lookup( ctx )->ROBIDList(*iroi,robIdList_MDT);
162
163 // dump the list of robs for debugging
164 ATH_MSG_DEBUG("Size of the MDT rob list: " << robIdList_MDT.size());
165 int isize = robIdList_MDT.size()<5 ? robIdList_MDT.size() : 4;
166 for (int ii = 0 ; ii<isize ; ++ii ) {
167 ATH_MSG_DEBUG("robId: 0x" << std::hex << robIdList_MDT.at(ii) << std::dec);
168 mrods[ii] = robIdList_MDT.at(ii);
169 }
170
171 // get the list of TGC robs
172 std::vector<uint32_t> robIdList_TGC;
173 m_regSel_TGC->lookup(ctx)->ROBIDList(*iroi,robIdList_TGC);
174 ATH_MSG_DEBUG("Size of the TGC rob list: " << robIdList_TGC.size());
175
176
177 LVL2_MUON_CALIBRATION::CalibEvent event(1,runId,lvl1Id,1,1,mrods,name().c_str(),eta,phi,pt);
178 LVL2_MUON_CALIBRATION::MdtCalibFragment mdtFragment;
179
180 // create the MDT fragment
181 if ( mdtHits.size()>0 ) {
182 ATH_CHECK( createMdtFragment(mdtHits,mdtFragment,phi) );
183
184 // add the mdt fragment to the event
185 event << mdtFragment;
186 }
187 else{
188 // do not write the calib stream
189 return StatusCode::SUCCESS;
190 }
191
192 // create the RPC fragment
193 if ( rpcHits.size() > 0 ) {
194 LVL2_MUON_CALIBRATION::RpcCalibFragment rpcFragment;
195
196 if ( createRpcFragment(roi, rpcFragment, ctx) != StatusCode::SUCCESS ) {
197 ATH_MSG_WARNING("Could not create the Rpc fragment of the calibration stream");
198 }
199 else {
200 ATH_MSG_DEBUG("Adding the RPC fragment to the calibration stream");
201 event << rpcFragment;
202 }
203 }
204
205 if ( tgcHits.size() > 0 ) {
206 LVL2_MUON_CALIBRATION::TgcCalibFragment tgcFragment;
207
208 if ( createTgcFragment(robIdList_TGC, tgcFragment, ctx) != StatusCode::SUCCESS ) {
209 ATH_MSG_ERROR("Could not create the Tgc fragment of the calibration stream");
210 }
211 else {
212 ATH_MSG_DEBUG("Adding the TGC fragment to the calibration stream");
213 event << tgcFragment;
214 }
215 }
216
217
218
219 ATH_MSG_DEBUG("Dumping the event stream");
220 ATH_MSG_DEBUG(event);
221 if (m_circ)
222 {
223 m_circ->dumpToCirc (event);
224 }
225
226
227 if (doDataScouting) {
228 // Perform data scouting specific operations
229 uint16_t eventSize_ds = event.size();
230 if (eventSize_ds>1000) return StatusCode::SUCCESS;
231
232 std::unique_ptr<uint8_t[]> buff_ds = std::make_unique<uint8_t[]>(eventSize_ds);
233
234 // encode the event
235 uint16_t eventSize8bits = eventSize_ds;
236 uint16_t eventSize32bits = eventSize8bits/4;
237 event.dumpWords(buff_ds.get(),eventSize_ds);
238
239 // fill the local buffer
240 // dump the words also in the local buffer
241 // dump the encoded event to the screen
242 ATH_MSG_DEBUG("Size of the DATASCOUTING buffer in 32 bits words: " << eventSize32bits);
243 for ( uint16_t words = 0 ; words != eventSize32bits ; words++) {
244 uint32_t byte1 = buff_ds[words*4];
245 uint32_t byte2 = buff_ds[words*4 + 1];
246 uint32_t byte3 = buff_ds[words*4 + 2];
247 uint32_t byte4 = buff_ds[words*4 + 3];
248
249 // encoding in big-endian for now ( revert order for little-endian )
250 uint32_t dataWord = (byte4 << 24) + (byte3 << 16) + (byte2 << 8) + byte1 ;
251 // std::cout << "Number of data words: " << words << std::endl;
252 ATH_MSG_DEBUG("Data word " << words << " = " << std::hex << "0x" << dataWord << std::dec);
253
254 localBuffer.push_back(dataWord);
255 }
256
257 ATH_MSG_DEBUG("Local buffer size = " << localBuffer.size());
258
259 }
260 return StatusCode::SUCCESS;
261 }
#define M_PI
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
Athena::TPCnvVers::Current TrigRoiDescriptor
StatusCode createTgcFragment(std::vector< uint32_t > &tgcRobIdList, LVL2_MUON_CALIBRATION::TgcCalibFragment &tgcFragment, const EventContext &ctx) const
ToolHandle< IRegSelTool > m_regSel_MDT
StatusCode createMdtFragment(TrigL2MuonSA::MdtHits &mdtHits, LVL2_MUON_CALIBRATION::MdtCalibFragment &mdtFragment, float phi) const
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
StatusCode createRpcFragment(const xAOD::MuonRoI *roi, LVL2_MUON_CALIBRATION::RpcCalibFragment &rpcFragment, const EventContext &ctx) const
ToolHandle< IRegSelTool > m_regSel_TGC
float eta() const
The pseudorapidity ( ) of the muon candidate.
float phi() const
The azimuthal angle ( ) of the muon candidate.
MuonRoI_v1 MuonRoI
Definition MuonRoI.h:15

◆ createRpcFragment()

StatusCode TrigL2MuonSA::MuCalStreamerTool::createRpcFragment ( const xAOD::MuonRoI * roi,
LVL2_MUON_CALIBRATION::RpcCalibFragment & rpcFragment,
const EventContext & ctx ) const
private

Definition at line 308 of file MuCalStreamerTool.cxx.

310{
311
312 // exit if it's not in the barrel
313 //if ( roi->sysID() != 0 ) return StatusCode::SUCCESS;
314 if ( roi->getSource() != 0 ) return StatusCode::SUCCESS;
315
316 // retrieve the padId from the RecMuonRoi
317
318 // decode roIWord
319 unsigned int side = roi->getHemisphere()==xAOD::MuonRoI::Hemisphere::Positive ? 1 : 0;
320 unsigned int sector = roi->getSectorID();
321 unsigned int roiNumber = roi->getRoI();
322
323 // retrieve the pad container
324 SG::ReadHandle<RpcPadContainer> rh_rpcPad{m_rpcPadKey, ctx};
325 const RpcPadContainer* rpcPadContainer=rh_rpcPad.cptr();
326
327 SG::ReadCondHandle<RpcCablingCondData> readHandle{m_readKey,ctx};
328 const RpcCablingCondData* readCdo{*readHandle};
329 unsigned int padIdHash;
330 if (readCdo->give_PAD_address( side, sector, roiNumber, padIdHash)) {
331
332 auto itPad = rpcPadContainer->indexFindPtr(padIdHash);
333 if( itPad==nullptr ) {
334 ATH_MSG_WARNING("Failed to retrieve PAD hash Id " << padIdHash);
335 return StatusCode::FAILURE;
336 }
337 const RpcPad* rpcPad = itPad;
338
339 uint16_t sector = rpcPad->sector();
340 uint16_t sysId = (sector<32)? 0x66 : 0x65;
341 uint16_t secId = sector%32;
342 uint16_t padId = rpcPad->onlineId();
343 uint16_t status = rpcPad->status();
344 uint16_t error = rpcPad->errorCode();
345
346 LVL2_MUON_CALIBRATION::RpcCalibFragment frag(sysId,secId,padId,status,error);
347 rpcFragment = frag;
348 RpcPad::const_iterator it3 = rpcPad->begin();
349 for (; it3!=rpcPad->end() ; ++it3) {
350 const RpcCoinMatrix * cma = (*it3);
351
352 uint16_t cmaId = cma->onlineId();
353 uint16_t fel1Id = cma->fel1Id();
354 uint16_t febcId = cma->febcId();
355 uint16_t crc = cma->crc();
356
357 LVL2_MUON_CALIBRATION::RpcCalibData matrix(cmaId,fel1Id,febcId,crc);
358
359 //for each cma for over fired channels
360 RpcCoinMatrix::const_iterator it5 = (*it3)->begin();
361 for (; it5 != (*it3)->end() ; ++it5) {
362 const RpcFiredChannel * fChannel = (*it5);
363
364 uint16_t bcid = fChannel->bcid();
365 uint16_t time = fChannel->time();
366 uint16_t ijk = fChannel->ijk();
367 uint16_t channel = fChannel->channel();
368 uint16_t ovl = fChannel->ovl();
369 uint16_t thr = fChannel->thr();
370
371 if(ijk!=7) matrix.getHit(bcid,time,ijk,channel);
372 else matrix.getHit(bcid,time,ijk,ovl,thr);
373
374 } // loop on the matrix hits
375
376 rpcFragment << matrix;
377 } // loop on the pad matrices
378
379 }
380 else {
381 ATH_MSG_WARNING("Can't get the pad address from the RpcCablingCondData");
382 return StatusCode::FAILURE;
383 }
384
385 return StatusCode::SUCCESS;
386}
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current RpcCoinMatrix
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current RpcPadContainer
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current RpcPad
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
bool give_PAD_address(unsigned short int SubsystemId, unsigned short int SectorId, unsigned short int RoIId, unsigned int &padIdHash) const
ubit16 crc() const
ubit16 fel1Id() const
ubit16 onlineId() const
ubit16 febcId() const
ubit16 bcid() const
ubit16 thr() const
ubit16 channel() const
ubit16 ovl() const
ubit16 ijk() const
ubit16 time() const
ubit16 onlineId() const
Definition RpcPad.h:107
ubit16 errorCode() const
Definition RpcPad.h:106
int sector() const
Definition RpcPad.h:112
ubit16 status() const
Definition RpcPad.h:105
const_pointer_type cptr()
Dereference the pointer.
SG::ReadCondHandleKey< RpcCablingCondData > m_readKey
SG::ReadHandleKey< RpcPadContainer > m_rpcPadKey
Hemisphere getHemisphere() const
Returns the hemisphere that detected the muon candidate.
RoISource getSource() const
Returns the system that detected the muon candidate.
int getSectorID() const
Get the sector ID number.
@ Positive
The candidate came from the +z side (side A)
Definition MuonRoI_v1.h:40
int getRoI() const
Get the "RoI number" (position inside the sector)
time(flags, cells_name, *args, **kw)
status
Definition merge.py:16
setTeId setLumiBlock setRoiId setRoiSubsystem roiNumber
setEventNumber setTimeStamp bcid

◆ createTgcFragment()

StatusCode TrigL2MuonSA::MuCalStreamerTool::createTgcFragment ( std::vector< uint32_t > & tgcRobIdList,
LVL2_MUON_CALIBRATION::TgcCalibFragment & tgcFragment,
const EventContext & ctx ) const
private

Definition at line 393 of file MuCalStreamerTool.cxx.

396{
397
398
399 if ( robIdList_TGC.size()<1 ) {
400 ATH_MSG_DEBUG("No TGC Rob found");
401 return StatusCode::SUCCESS;
402 }
403
404 // system Id = 1 should correspond to the endcap
405 uint16_t systemId = 1;
406 // this is the subdetector Id
407 uint16_t subSystemId = ( (robIdList_TGC.at(0) & 0xff0000) >> 16 );
408 uint16_t rdoId = ( robIdList_TGC.at(0) & 0xff );
409
411
412 tgcFragment = LVL2_MUON_CALIBRATION::TgcCalibFragment(systemId,subSystemId,rdoId,roiNumber);
413
414 // retrieve the tgcrdo container
415 SG::ReadHandle<TgcRdoContainer> rdoRH(m_tgcRdoKey, ctx);
416 if (!rdoRH.isValid()) {
417 ATH_MSG_ERROR( "No TGC RDO container found!" );
418 return StatusCode::FAILURE;
419 }
420 const TgcRdoContainer* tgcRdoContainer = rdoRH.cptr();
421
422 // now get the list of ROB Ids and from the the subdetector ID ( that corresponds to the
423 // subsystem ID
424
425
426 LVL2_MUON_CALIBRATION::TgcCalibData tgc_payload;
427 TgcRdoContainer::const_iterator it = tgcRdoContainer->begin();
428
429 for ( ; it != tgcRdoContainer->end() ; ++it ) {
430
431 ATH_MSG_DEBUG("Adding the hits from a new TGC chamber");
432
433 // loop on the element of the TGC RDO
434 ATH_MSG_DEBUG("Number of hits: " << (*it)->size());
435
436 TgcRdo::const_iterator itRaw = (*it)->begin();
437 for ( ; itRaw != (*it)->end() ; ++itRaw ) {
438
439 const TgcRawData* raw = (*itRaw);
440 LVL2_MUON_CALIBRATION::TGC_BYTESTREAM_READOUTHIT roh;
441 LVL2_MUON_CALIBRATION::TGC_BYTESTREAM_READOUTTRIPLETSTRIP tps;
442 LVL2_MUON_CALIBRATION::TGC_BYTESTREAM_READOUTTRACKLET rot;
443 LVL2_MUON_CALIBRATION::TGC_BYTESTREAM_HIPT hpt;
444 LVL2_MUON_CALIBRATION::TGC_BYTESTREAM_SL sl;
445
446
447 switch (raw->type()) {
449 {
450 roh.channel = raw->channel()-40;
451 roh.sbId = raw->slbId();
452 roh.sbType = raw->slbType();
453 roh.adj = raw->isAdjacent();
454 roh.ldbId = raw->sswId();
455 roh.bcBitmap = bcBitmap(raw->bcTag());
456 roh.tracklet = raw->tracklet();
457 roh.ok = 1;
458
459 }
460 break;
463 {
464 tps.phi = raw->position();
465 tps.seg = raw->segment();
466 tps.sbId = raw->slbId();
467 tps.ldbId = raw->sswId();
468 tps.bcBitmap = bcBitmap(raw->bcTag());
470 tps.ok = 1;
471 }
472 else
473 {
474 rot.rphi = raw->position();
475 rot.subm = raw->subMatrix();
476 rot.seg = raw->segment();
477 rot.delta = raw->delta();
478 rot.sbId = raw->slbId();
479 rot.ldbId = raw->sswId();
480 rot.bcBitmap = bcBitmap(raw->bcTag());
481 rot.slbType = raw->slbType();
483 rot.slbType = 4;
484 rot.ok = 1;
485 }
486 break;
488 {
489 hpt.delta = raw->delta();
490 hpt.hitId = raw->hitId();
491 hpt.hipt = raw->isHipt();
492 hpt.cand = raw->index();
493 hpt.chip = raw->chip();
494 hpt.sector = raw->sector();
495 hpt.fwd = raw->isForward();
496 hpt.strip = raw->isStrip();
497 hpt.bcBitmap = bcBitmap(raw->bcTag());
498 }
499 break;
501 {
502 sl.roi = raw->roi();
503 sl.overlap = raw->isOverlap();
504 sl.threshold = raw->threshold();
505 sl.sign = raw->isMuplus();
506 sl.cand = raw->index();
507 sl.sector = raw->sector();
508 sl.fwd = raw->isForward();
509 sl.bcBitmap = bcBitmap(raw->bcTag());
510 sl.cand2plus = raw->cand3plus();
511 }
512 break;
513 default:
514 {
515 ATH_MSG_ERROR("Invalid TgcRawData type: " << raw->type());
516 return StatusCode::FAILURE;
517 }
518 }
519
520 tgc_payload.getHit(roh,tps,rot,hpt,sl);
521
522 }
523 }
524
525 tgcFragment << tgc_payload;
526
527 return StatusCode::SUCCESS;
528}
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Current TgcRdoContainer
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current TgcRawData
unsigned bcBitmap(uint16_t bcTag)
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry
uint16_t sswId() const
Definition TgcRawData.h:272
bool isStrip() const
Definition TgcRawData.h:353
@ SLB_TYPE_TRIPLET_STRIP
Definition TgcRawData.h:35
@ SLB_TYPE_INNER_STRIP
Definition TgcRawData.h:37
uint16_t chip() const
Definition TgcRawData.h:337
uint16_t index() const
Definition TgcRawData.h:309
int16_t delta() const
Definition TgcRawData.h:317
uint16_t position() const
Definition TgcRawData.h:313
uint16_t subMatrix() const
Definition TgcRawData.h:329
bool isAdjacent() const
Definition TgcRawData.h:305
SlbType slbType() const
Definition TgcRawData.h:285
uint16_t channel() const
Definition TgcRawData.h:297
bool isMuplus() const
Definition TgcRawData.h:361
DataType type() const
Definition TgcRawData.h:280
bool cand3plus() const
Definition TgcRawData.h:357
uint16_t segment() const
Definition TgcRawData.h:325
uint16_t bcTag() const
Definition TgcRawData.h:251
uint16_t slbId() const
Definition TgcRawData.h:276
uint16_t sector() const
Definition TgcRawData.h:333
uint16_t tracklet() const
Definition TgcRawData.h:301
bool isHipt() const
Definition TgcRawData.h:341
uint16_t roi() const
Definition TgcRawData.h:377
bool isOverlap() const
Definition TgcRawData.h:369
uint16_t hitId() const
Definition TgcRawData.h:345
bool isForward() const
Definition TgcRawData.h:289
uint16_t threshold() const
Definition TgcRawData.h:365
SG::ReadHandleKey< TgcRdoContainer > m_tgcRdoKey

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::evtStore ( )
inlineinherited

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

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ initialize()

StatusCode TrigL2MuonSA::MuCalStreamerTool::initialize ( )
overridevirtual

Definition at line 30 of file MuCalStreamerTool.cxx.

31{
32 // locate the region selector
33 ATH_CHECK( m_regSel_MDT.retrieve() );
34 ATH_CHECK( m_regSel_TGC.retrieve() );
35
36 ATH_CHECK(m_tgcRdoKey.initialize());
37 ATH_CHECK(m_readKey.initialize());
38 ATH_CHECK(m_eventInfoKey.initialize());
39 ATH_CHECK(m_rpcPadKey.initialize());
40
41 return StatusCode::SUCCESS;
42
43}

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ instanceName()

const std::string & TrigL2MuonSA::MuCalStreamerTool::instanceName ( ) const
inline

Definition at line 64 of file MuCalStreamerTool.h.

64{return m_algInstanceName;}

◆ isStreamOpen()

bool TrigL2MuonSA::MuCalStreamerTool::isStreamOpen ( )

Definition at line 100 of file MuCalStreamerTool.cxx.

100{return m_circ!=nullptr;}

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ openStream()

StatusCode TrigL2MuonSA::MuCalStreamerTool::openStream ( int calBufferSize)

Definition at line 49 of file MuCalStreamerTool.cxx.

50{
51
52 std::string name = m_calBufferName;
54
55 if ( m_circ == nullptr ) {
56 try
57 {
58 m_circ = new TrigL2MuonSA::MuCalCircClient (0, name, calBufferSize);
59 }
60
61 catch (TrigL2MuonSA::Circexception &e)
62 {
63 ATH_MSG_WARNING("Could not open muon calibration buffer: name="
64 << name << " buffer size=" << calBufferSize);
65 }
66
67 ATH_MSG_INFO("Opening muon calibration stream. Buffer name: "
68 << name << " buffer size: " << calBufferSize);
69 }
70
71 return StatusCode::SUCCESS;
72}
#define ATH_MSG_INFO(x)

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setBufferName()

void TrigL2MuonSA::MuCalStreamerTool::setBufferName ( const std::string & buffName)
inline

Definition at line 68 of file MuCalStreamerTool.h.

68{m_calBufferName=buffName;}

◆ setInstanceName()

void TrigL2MuonSA::MuCalStreamerTool::setInstanceName ( const std::string & name)
inline

Definition at line 65 of file MuCalStreamerTool.h.

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_algInstanceName

std::string TrigL2MuonSA::MuCalStreamerTool::m_algInstanceName
private

Definition at line 100 of file MuCalStreamerTool.h.

◆ m_calBufferName

std::string TrigL2MuonSA::MuCalStreamerTool::m_calBufferName
private

Definition at line 99 of file MuCalStreamerTool.h.

◆ m_circ

TrigL2MuonSA::MuCalCircClient* TrigL2MuonSA::MuCalStreamerTool::m_circ = nullptr
private

Definition at line 124 of file MuCalStreamerTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> TrigL2MuonSA::MuCalStreamerTool::m_eventInfoKey { this, "EventInfoKey", "EventInfo", "" }
private

Definition at line 94 of file MuCalStreamerTool.h.

94{ this, "EventInfoKey", "EventInfo", "" };

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_outputFile

std::ofstream TrigL2MuonSA::MuCalStreamerTool::m_outputFile
private

Definition at line 103 of file MuCalStreamerTool.h.

◆ m_readKey

SG::ReadCondHandleKey<RpcCablingCondData> TrigL2MuonSA::MuCalStreamerTool::m_readKey {this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"}
private

Definition at line 110 of file MuCalStreamerTool.h.

110{this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"};

◆ m_regSel_MDT

ToolHandle<IRegSelTool> TrigL2MuonSA::MuCalStreamerTool::m_regSel_MDT {this, "RegSel_MDT", "RegSelTool/RegSelTool_MDT", "MDT Region Selector Tool"}
private

Definition at line 107 of file MuCalStreamerTool.h.

107{this, "RegSel_MDT", "RegSelTool/RegSelTool_MDT", "MDT Region Selector Tool"};

◆ m_regSel_TGC

ToolHandle<IRegSelTool> TrigL2MuonSA::MuCalStreamerTool::m_regSel_TGC {this, "RegSel_TGC", "RegSelTool/RegSelTool_TGC", "TGC Region Selector Tool"}
private

Definition at line 108 of file MuCalStreamerTool.h.

108{this, "RegSel_TGC", "RegSelTool/RegSelTool_TGC", "TGC Region Selector Tool"};

◆ m_rpcPadKey

SG::ReadHandleKey<RpcPadContainer> TrigL2MuonSA::MuCalStreamerTool::m_rpcPadKey {this, "RpcPadContainerKey", "RPCPAD", "RpcPad container fro MuCalStreamerTool"}
private

Definition at line 95 of file MuCalStreamerTool.h.

95{this, "RpcPadContainerKey", "RPCPAD", "RpcPad container fro MuCalStreamerTool"};

◆ m_tgcRdoKey

SG::ReadHandleKey<TgcRdoContainer> TrigL2MuonSA::MuCalStreamerTool::m_tgcRdoKey {this, "TgcRdoContainer", "TGCRDO", "Tgc RDO Input"}
private

Definition at line 93 of file MuCalStreamerTool.h.

93{this, "TgcRdoContainer", "TGCRDO", "Tgc RDO Input"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeToFile

Gaudi::Property< bool > TrigL2MuonSA::MuCalStreamerTool::m_writeToFile { this, "WriteToFile", false, "" }
private

Definition at line 92 of file MuCalStreamerTool.h.

92{ this, "WriteToFile", false, "" };

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