ATLAS Offline Software
Loading...
Searching...
No Matches
BStoXAODHelper::MuonHelper Struct Reference
Inheritance diagram for BStoXAODHelper::MuonHelper:
Collaboration diagram for BStoXAODHelper::MuonHelper:

Public Member Functions

 MuonHelper (const ToolHandle< ITrigMuonEFInfoToMuonCnvTool > &tool)
CLID AODContainerClid ()
CLID xAODContainerClid ()
CLID AODElementClid ()
CLID xAODElementClid ()
virtual StatusCode help (const EventContext &, const std::string &label, const std::string &newLabel)
virtual StatusCode help_fillTrigPassBits (const std::string &label, const std::string &newLabel, const TrigPassBits *tpb_aod, xAOD::TrigPassBits *&tpb_xaod)
virtual StatusCode initialize (MsgStream &m, StoreGateSvc &s)
MsgStream & msg (MSG::Level l)
bool msgLvl (const MSG::Level l)
template<typename T>
std::string format (const std::string &label)

Protected Member Functions

ToolHandle< ITrigMuonEFInfoToMuonCnvTool > & tool ()

Protected Attributes

const ToolHandle< ITrigMuonEFInfoToMuonCnvTool > & m_tool
MsgStream * m_msg {nullptr}
StoreGateSvcm_sg {nullptr}
const std::string m_AODprefix = "HLT"

Detailed Description

Definition at line 274 of file TrigBStoxAODTool.cxx.

Constructor & Destructor Documentation

◆ MuonHelper()

BStoXAODHelper::MuonHelper::MuonHelper ( const ToolHandle< ITrigMuonEFInfoToMuonCnvTool > & tool)
inline

Definition at line 275 of file TrigBStoxAODTool.cxx.

275: ToolHolder(tool){;}
ToolHolder(const ToolHandle< ITrigMuonEFInfoToMuonCnvTool > &tool)
ToolHandle< ITrigMuonEFInfoToMuonCnvTool > & tool()

Member Function Documentation

◆ AODContainerClid()

CLID BStoXAODHelper::MuonHelper::AODContainerClid ( )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 277 of file TrigBStoxAODTool.cxx.

277{return getCLID<TrigMuonEFInfoContainer>();}

◆ AODElementClid()

CLID BStoXAODHelper::MuonHelper::AODElementClid ( )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 280 of file TrigBStoxAODTool.cxx.

280{return getCLID<Container2Object_t<TrigMuonEFInfoContainer>>();}

◆ format()

template<typename T>
std::string BStoXAODHelper::IHelper::format ( const std::string & label)
inlineinherited

Definition at line 152 of file TrigBStoxAODTool.cxx.

152 {
154 }
const std::string m_AODprefix
std::string label(const std::string &format, int i)
Definition label.h:19
std::string formatSGkey(const std::string &prefix, const std::string &containername, const std::string &label)
declaration of formatting function.
Definition Holder.cxx:121

◆ help()

virtual StatusCode BStoXAODHelper::MuonHelper::help ( const EventContext & ,
const std::string & label,
const std::string & newLabel )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 283 of file TrigBStoxAODTool.cxx.

283 {
284 xAOD::MuonContainer* xaodMuon = this->m_sg->tryRetrieve<xAOD::MuonContainer>(format<xAOD::MuonContainer>(newLabel));
285 if(!xaodMuon){
286 ATH_MSG_WARNING("muon label: " << format<xAOD::MuonContainer>(newLabel) << " not found for xAOD conversion");
287 return StatusCode::SUCCESS;
288 }
289
290 xAOD::TrackParticleContainer* xaodCombTrackParticles = this->m_sg->tryRetrieve<xAOD::TrackParticleContainer>(format<xAOD::TrackParticleContainer>(newLabel+"_CombTrackParticles"));
291 if(!xaodCombTrackParticles){
292 ATH_MSG_WARNING("muon label: " << format<xAOD::TrackParticleContainer>(newLabel+"_CombTrackParticles") << " not found for xAOD conversion");
293 return StatusCode::SUCCESS;
294 }
295
296 xAOD::TrackParticleContainer* xaodExtrapTrackParticles = this->m_sg->tryRetrieve<xAOD::TrackParticleContainer>(format<xAOD::TrackParticleContainer>(newLabel+"_ExtrapTrackParticles"));
297 if(!xaodCombTrackParticles){
298 ATH_MSG_WARNING("muon label: " << format<xAOD::TrackParticleContainer>(newLabel+"_ExtrapTrackParticles") << " not found for xAOD conversion");
299 return StatusCode::SUCCESS;
300 }
301
302 const TrigMuonEFInfoContainer* aod =
304 if(!aod){
305 ATH_MSG_WARNING("muon label: " << format<TrigMuonEFInfoContainer>(label) << " not found for xAOD conversion");
306 return StatusCode::SUCCESS;
307 }
308
309 CHECK(this->m_tool->convertTrigMuonEFInfoContainer( *aod, *xaodMuon, xaodCombTrackParticles, xaodExtrapTrackParticles));
310
311 ATH_MSG_DEBUG("Muon AOD container has size: " << aod->size());
312 ATH_MSG_DEBUG("Muon xAOD container has size: " << xaodMuon->size());
313
314 return StatusCode::SUCCESS;
315 }
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current TrigMuonEFInfoContainer
const ToolHandle< ITrigMuonEFInfoToMuonCnvTool > & m_tool
size_type size() const noexcept
Returns the number of elements in the collection.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".

◆ help_fillTrigPassBits()

virtual StatusCode BStoXAODHelper::MuonHelper::help_fillTrigPassBits ( const std::string & label,
const std::string & newLabel,
const TrigPassBits * tpb_aod,
xAOD::TrigPassBits *& tpb_xaod )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 317 of file TrigBStoxAODTool.cxx.

317 {
318
319 const TrigMuonEFInfoContainer* aod = this->m_sg->template tryConstRetrieve<TrigMuonEFInfoContainer>(label);
320 if(!aod){
321 ATH_MSG_WARNING("AOD key: " << label << " not found");
322 return StatusCode::SUCCESS;
323 }
324 ATH_MSG_DEBUG( "AOD muon container " << label << " extracted of size " << aod->size() );
325 if( aod->size() != tpb_aod->size() ) {
326 ATH_MSG_WARNING( "sizes of the muon container " << label << " and the corresponding (?) trigpassbits object are different: "
327 << aod->size() << " vs " << tpb_aod->size() << ", will not convert TrigPassBits for this container" );
328 }
329 xAOD::MuonContainer* xaodMuon = this->m_sg->template tryRetrieve<xAOD::MuonContainer>(format<xAOD::MuonContainer>(newLabel));
330 if(!xaodMuon){
331 ATH_MSG_WARNING("xAOD key: " << format<xAOD::MuonContainer>(newLabel) << " not found");
332 return StatusCode::SUCCESS;
333 }
334 ATH_MSG_DEBUG("xAOD muon container " << format<xAOD::MuonContainer>(newLabel) << " extracted of size " << xaodMuon->size());
335
336 if(aod->size() != xaodMuon->size()) {
337 ATH_MSG_ERROR("containers before and after the conversion are of different sizes");
338 return StatusCode::FAILURE;
339 }
340
341 ATH_MSG_DEBUG( "setting muon xaod passbits size to " << tpb_aod->size() );
342 std::unique_ptr<xAOD::TrigPassBits> xBits = xAOD::makeTrigPassBits(xaodMuon);
343
344 for(uint i=0; i<aod->size(); i++) {
345 // if(i < tpb_aod->size() ){
346 ATH_MSG_DEBUG( "looking at muon object " << i+1 << " of " << aod->size() );
347 bool passed = HLT::isPassing( tpb_aod, aod->at(i), aod );
348 ATH_MSG_DEBUG( "muon aod ispassing = " << passed );
349 ATH_MSG_DEBUG( "muon xaod ispassing = " << xBits->isPassing( i ) );
350 if(passed)
351 xBits->markPassing( i );
352 ATH_MSG_DEBUG( "muon xaod ispassing (after update) = " << xBits->isPassing( i ) );
353 /* } else {
354 ATH_MSG_DEBUG( "skipping object " << i+1 << " as it is outside of the array range of the corresponding aod TrigPassBits object" );
355 }*/
356 }
357 tpb_xaod = xBits.release();
358 return StatusCode::SUCCESS;
359 }
#define ATH_MSG_ERROR(x)
bool passed(DecisionID id, const DecisionIDContainer &)
checks if required decision ID is in the set of IDs in the container
unsigned int uint
const T * at(size_type n) const
Access an element, as an rvalue.
unsigned int size() const
gets size of the bits array
bool isPassing(const TrigPassBits *bits, const T *obj, const CONTAINER *container)
Check the bit for the object in the associated bits object.
std::unique_ptr< TrigPassBits_v1 > makeTrigPassBits(const CONT *container, uint32_t containerKey=xAOD::TrigPassBits_v1::DEFAULT_KEY)
Helper function creating a new object to describe a target container.

◆ initialize()

virtual StatusCode BStoXAODHelper::ToolHolder< ITrigMuonEFInfoToMuonCnvTool >::initialize ( MsgStream & m,
StoreGateSvc & s )
inlinevirtualinherited

Reimplemented from BStoXAODHelper::IHelper.

Definition at line 170 of file TrigBStoxAODTool.cxx.

◆ msg()

MsgStream & BStoXAODHelper::IHelper::msg ( MSG::Level l)
inlineinherited

Definition at line 142 of file TrigBStoxAODTool.cxx.

142{return *m_msg << l;}
l
Printing final latex table to .tex output file.

◆ msgLvl()

bool BStoXAODHelper::IHelper::msgLvl ( const MSG::Level l)
inlineinherited

Definition at line 143 of file TrigBStoxAODTool.cxx.

143 {
144 if(m_msg->level() <= l){
145 *m_msg << l; return true;
146 } else {
147 return false;
148 };
149 }

◆ tool()

ToolHandle< ITrigMuonEFInfoToMuonCnvTool > & BStoXAODHelper::ToolHolder< ITrigMuonEFInfoToMuonCnvTool >::tool ( )
inlineprotectedinherited

Definition at line 166 of file TrigBStoxAODTool.cxx.

166{return m_tool;}

◆ xAODContainerClid()

CLID BStoXAODHelper::MuonHelper::xAODContainerClid ( )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 278 of file TrigBStoxAODTool.cxx.

278{return getCLID<xAOD::MuonContainer>();}

◆ xAODElementClid()

CLID BStoXAODHelper::MuonHelper::xAODElementClid ( )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 281 of file TrigBStoxAODTool.cxx.

281{return getCLID<Container2Object_t<xAOD::MuonContainer>>();}

Member Data Documentation

◆ m_AODprefix

const std::string BStoXAODHelper::IHelper::m_AODprefix = "HLT"
protectedinherited

Definition at line 158 of file TrigBStoxAODTool.cxx.

◆ m_msg

MsgStream* BStoXAODHelper::IHelper::m_msg {nullptr}
protectedinherited

Definition at line 156 of file TrigBStoxAODTool.cxx.

156{nullptr};

◆ m_sg

StoreGateSvc* BStoXAODHelper::IHelper::m_sg {nullptr}
protectedinherited

Definition at line 157 of file TrigBStoxAODTool.cxx.

157{nullptr};

◆ m_tool

Definition at line 165 of file TrigBStoxAODTool.cxx.


The documentation for this struct was generated from the following file: