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 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 276 of file TrigBStoxAODTool.cxx.

Constructor & Destructor Documentation

◆ MuonHelper()

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

Definition at line 277 of file TrigBStoxAODTool.cxx.

277: 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 279 of file TrigBStoxAODTool.cxx.

279{return getCLID<TrigMuonEFInfoContainer>();}

◆ AODElementClid()

CLID BStoXAODHelper::MuonHelper::AODElementClid ( )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 282 of file TrigBStoxAODTool.cxx.

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

◆ format()

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

Definition at line 155 of file TrigBStoxAODTool.cxx.

155 {
157 }
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 std::string & label,
const std::string & newLabel )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 285 of file TrigBStoxAODTool.cxx.

285 {
286 xAOD::MuonContainer* xaodMuon = this->m_sg->tryRetrieve<xAOD::MuonContainer>(format<xAOD::MuonContainer>(newLabel));
287 if(!xaodMuon){
288 ATH_MSG_WARNING("muon label: " << format<xAOD::MuonContainer>(newLabel) << " not found for xAOD conversion");
289 return StatusCode::SUCCESS;
290 }
291
292 xAOD::TrackParticleContainer* xaodCombTrackParticles = this->m_sg->tryRetrieve<xAOD::TrackParticleContainer>(format<xAOD::TrackParticleContainer>(newLabel+"_CombTrackParticles"));
293 if(!xaodCombTrackParticles){
294 ATH_MSG_WARNING("muon label: " << format<xAOD::TrackParticleContainer>(newLabel+"_CombTrackParticles") << " not found for xAOD conversion");
295 return StatusCode::SUCCESS;
296 }
297
298 xAOD::TrackParticleContainer* xaodExtrapTrackParticles = this->m_sg->tryRetrieve<xAOD::TrackParticleContainer>(format<xAOD::TrackParticleContainer>(newLabel+"_ExtrapTrackParticles"));
299 if(!xaodCombTrackParticles){
300 ATH_MSG_WARNING("muon label: " << format<xAOD::TrackParticleContainer>(newLabel+"_ExtrapTrackParticles") << " not found for xAOD conversion");
301 return StatusCode::SUCCESS;
302 }
303
304 const TrigMuonEFInfoContainer* aod =
306 if(!aod){
307 ATH_MSG_WARNING("muon label: " << format<TrigMuonEFInfoContainer>(label) << " not found for xAOD conversion");
308 return StatusCode::SUCCESS;
309 }
310
311 CHECK(this->m_tool->convertTrigMuonEFInfoContainer( *aod, *xaodMuon, xaodCombTrackParticles, xaodExtrapTrackParticles));
312
313 ATH_MSG_DEBUG("Muon AOD container has size: " << aod->size());
314 ATH_MSG_DEBUG("Muon xAOD container has size: " << xaodMuon->size());
315
316 return StatusCode::SUCCESS;
317 }
#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 319 of file TrigBStoxAODTool.cxx.

319 {
320
321 const TrigMuonEFInfoContainer* aod = this->m_sg->template tryConstRetrieve<TrigMuonEFInfoContainer>(label);
322 if(!aod){
323 ATH_MSG_WARNING("AOD key: " << label << " not found");
324 return StatusCode::SUCCESS;
325 }
326 ATH_MSG_DEBUG( "AOD muon container " << label << " extracted of size " << aod->size() );
327 if( aod->size() != tpb_aod->size() ) {
328 ATH_MSG_WARNING( "sizes of the muon container " << label << " and the corresponding (?) trigpassbits object are different: "
329 << aod->size() << " vs " << tpb_aod->size() << ", will not convert TrigPassBits for this container" );
330 }
331 xAOD::MuonContainer* xaodMuon = this->m_sg->template tryRetrieve<xAOD::MuonContainer>(format<xAOD::MuonContainer>(newLabel));
332 if(!xaodMuon){
333 ATH_MSG_WARNING("xAOD key: " << format<xAOD::MuonContainer>(newLabel) << " not found");
334 return StatusCode::SUCCESS;
335 }
336 ATH_MSG_DEBUG("xAOD muon container " << format<xAOD::MuonContainer>(newLabel) << " extracted of size " << xaodMuon->size());
337
338 if(aod->size() != xaodMuon->size()) {
339 ATH_MSG_ERROR("containers before and after the conversion are of different sizes");
340 return StatusCode::FAILURE;
341 }
342
343 ATH_MSG_DEBUG( "setting muon xaod passbits size to " << tpb_aod->size() );
344 std::unique_ptr<xAOD::TrigPassBits> xBits = xAOD::makeTrigPassBits(xaodMuon);
345
346 for(uint i=0; i<aod->size(); i++) {
347 // if(i < tpb_aod->size() ){
348 ATH_MSG_DEBUG( "looking at muon object " << i+1 << " of " << aod->size() );
349 bool passed = HLT::isPassing( tpb_aod, aod->at(i), aod );
350 ATH_MSG_DEBUG( "muon aod ispassing = " << passed );
351 ATH_MSG_DEBUG( "muon xaod ispassing = " << xBits->isPassing( i ) );
352 if(passed)
353 xBits->markPassing( i );
354 ATH_MSG_DEBUG( "muon xaod ispassing (after update) = " << xBits->isPassing( i ) );
355 /* } else {
356 ATH_MSG_DEBUG( "skipping object " << i+1 << " as it is outside of the array range of the corresponding aod TrigPassBits object" );
357 }*/
358 }
359 tpb_xaod = xBits.release();
360 return StatusCode::SUCCESS;
361 }
#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 173 of file TrigBStoxAODTool.cxx.

◆ msg()

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

Definition at line 145 of file TrigBStoxAODTool.cxx.

145{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 146 of file TrigBStoxAODTool.cxx.

146 {
147 if(m_msg->level() <= l){
148 *m_msg << l; return true;
149 } else {
150 return false;
151 };
152 }

◆ tool()

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

Definition at line 169 of file TrigBStoxAODTool.cxx.

169{return m_tool;}

◆ xAODContainerClid()

CLID BStoXAODHelper::MuonHelper::xAODContainerClid ( )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 280 of file TrigBStoxAODTool.cxx.

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

◆ xAODElementClid()

CLID BStoXAODHelper::MuonHelper::xAODElementClid ( )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 283 of file TrigBStoxAODTool.cxx.

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

Member Data Documentation

◆ m_AODprefix

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

Definition at line 161 of file TrigBStoxAODTool.cxx.

◆ m_msg

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

Definition at line 159 of file TrigBStoxAODTool.cxx.

159{nullptr};

◆ m_sg

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

Definition at line 160 of file TrigBStoxAODTool.cxx.

160{nullptr};

◆ m_tool

Definition at line 168 of file TrigBStoxAODTool.cxx.


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