ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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){;}

Member Function Documentation

◆ AODContainerClid()

CLID BStoXAODHelper::MuonHelper::AODContainerClid ( )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 276 of file TrigBStoxAODTool.cxx.

◆ AODElementClid()

CLID BStoXAODHelper::MuonHelper::AODElementClid ( )
inlinevirtual

◆ format()

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

Definition at line 152 of file TrigBStoxAODTool.cxx.

◆ 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 =
302  this->m_sg->tryConstRetrieve<TrigMuonEFInfoContainer>(format<TrigMuonEFInfoContainer>(label));
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  }

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

◆ initialize()

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

Reimplemented from BStoXAODHelper::IHelper.

Definition at line 170 of file TrigBStoxAODTool.cxx.

170  {
172  CHECK(m_tool.retrieve());
173  return StatusCode::SUCCESS;
174  }

◆ msg()

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

Definition at line 142 of file TrigBStoxAODTool.cxx.

142 {return *m_msg << l;}

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

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.

◆ xAODElementClid()

CLID BStoXAODHelper::MuonHelper::xAODElementClid ( )
inlinevirtual

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.

◆ m_sg

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

Definition at line 157 of file TrigBStoxAODTool.cxx.

◆ m_tool

Definition at line 165 of file TrigBStoxAODTool.cxx.


The documentation for this struct was generated from the following file:
getCLID
Definition: TrigBStoxAODTool.cxx:114
xAOD::TrigPassBits_v1::isPassing
bool isPassing(const OBJ *obj, const CONT *container) const
Check if an element of a container is passing/failing.
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
StoreGateSvc::tryRetrieve
T * tryRetrieve() const
Variant of the above which doesn't print a warning message.
initialize
void initialize()
Definition: run_EoverP.cxx:894
BStoXAODHelper::IHelper::m_AODprefix
const std::string m_AODprefix
Definition: TrigBStoxAODTool.cxx:158
TrigPassBits::size
unsigned int size() const
gets size of the bits array
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/TrigPassBits.h:44
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
HLTNavDetails::formatSGkey
std::string formatSGkey(const std::string &prefix, const std::string &containername, const std::string &label)
declaration of formatting function.
Definition: Holder.cxx:122
TrigMuonEFInfoContainer
Definition: TrigMuonEFInfoContainer.h:27
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
BStoXAODHelper::ToolHolder< ITrigMuonEFInfoToMuonCnvTool >::m_tool
const ToolHandle< ITrigMuonEFInfoToMuonCnvTool > & m_tool
Definition: TrigBStoxAODTool.cxx:165
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
xAOD::makeTrigPassBits
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.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
BStoXAODHelper::IHelper::m_msg
MsgStream * m_msg
Definition: TrigBStoxAODTool.cxx:156
HLT::isPassing
bool isPassing(const TrigPassBits *bits, const T *obj, const CONTAINER *container)
Check the bit for the object in the associated bits object.
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/TrigPassBits.h:82
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
StoreGateSvc::tryConstRetrieve
const T * tryConstRetrieve() const
xAOD::TrigPassBits_v1::markPassing
void markPassing(const OBJ *obj, const CONT *container, bool passed=true)
Mark one of the elements of the target container as passing/failing.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
BStoXAODHelper::ToolHolder< ITrigMuonEFInfoToMuonCnvTool >::ToolHolder
ToolHolder(const ToolHandle< ITrigMuonEFInfoToMuonCnvTool > &tool)
Definition: TrigBStoxAODTool.cxx:168
BStoXAODHelper::IHelper::m_sg
StoreGateSvc * m_sg
Definition: TrigBStoxAODTool.cxx:157
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
BStoXAODHelper::ToolHolder< ITrigMuonEFInfoToMuonCnvTool >::tool
ToolHandle< ITrigMuonEFInfoToMuonCnvTool > & tool()
Definition: TrigBStoxAODTool.cxx:166