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

Constructor & Destructor Documentation

◆ MuonHelper()

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

Definition at line 274 of file TrigBStoxAODTool.cxx.

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

276{return getCLID<TrigMuonEFInfoContainer>::ID();}

◆ AODElementClid()

CLID BStoXAODHelper::MuonHelper::AODElementClid ( )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 279 of file TrigBStoxAODTool.cxx.

279{return getCLID<Container2Object<TrigMuonEFInfoContainer>::type>::ID();}
std::vector< Identifier > ID

◆ 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:122

◆ help()

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

Implements BStoXAODHelper::IHelper.

Definition at line 282 of file TrigBStoxAODTool.cxx.

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

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

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

◆ xAODElementClid()

CLID BStoXAODHelper::MuonHelper::xAODElementClid ( )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 280 of file TrigBStoxAODTool.cxx.

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

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: