ATLAS Offline Software
Loading...
Searching...
No Matches
BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool, withCtx > Struct Template Reference
Inheritance diagram for BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool, withCtx >:
Collaboration diagram for BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool, withCtx >:

Public Types

using xAODAux = Container2Aux_t<XAOD>

Public Member Functions

 DefaultHelper (const ToolHandle< CnvTool > &tool)
CLID AODContainerClid ()
CLID xAODContainerClid ()
CLID AODElementClid ()
CLID xAODElementClid ()
virtual StatusCode help (const EventContext &ctx, 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< CnvTool > & tool ()

Protected Attributes

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

Detailed Description

template<typename AOD, typename XAOD, typename CnvTool, bool withCtx = false>
struct BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool, withCtx >

Definition at line 179 of file TrigBStoxAODTool.cxx.

Member Typedef Documentation

◆ xAODAux

template<typename AOD, typename XAOD, typename CnvTool, bool withCtx = false>
using BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool, withCtx >::xAODAux = Container2Aux_t<XAOD>

Definition at line 180 of file TrigBStoxAODTool.cxx.

Constructor & Destructor Documentation

◆ DefaultHelper()

template<typename AOD, typename XAOD, typename CnvTool, bool withCtx = false>
BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool, withCtx >::DefaultHelper ( const ToolHandle< CnvTool > & tool)
inline

Definition at line 182 of file TrigBStoxAODTool.cxx.

ToolHolder(const ToolHandle< CnvTool > &tool)

Member Function Documentation

◆ AODContainerClid()

template<typename AOD, typename XAOD, typename CnvTool, bool withCtx = false>
CLID BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool, withCtx >::AODContainerClid ( )
inlinevirtual

◆ AODElementClid()

template<typename AOD, typename XAOD, typename CnvTool, bool withCtx = false>
CLID BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool, withCtx >::AODElementClid ( )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 187 of file TrigBStoxAODTool.cxx.

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

template<typename AOD, typename XAOD, typename CnvTool, bool withCtx = false>
virtual StatusCode BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool, withCtx >::help ( const EventContext & ctx,
const std::string & label,
const std::string & newLabel )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 190 of file TrigBStoxAODTool.cxx.

190 {
191 typedef IHelper IH;
195
196 const AOD* aod = this->m_sg->template tryConstRetrieve<AOD>(fmtkey_AOD);
197 if(!aod){
198 ATH_MSG_WARNING("AOD key: " << fmtkey_AOD << " not found for xAOD conversion");
199 return StatusCode::SUCCESS;
200 }
201
202 ATH_MSG_DEBUG("attempting to convert " << fmtkey_AOD << " of size " << aod->size() << " to " << fmtkey_xAOD);
203
204 XAOD* xaod = this->m_sg->template tryRetrieve<XAOD>(fmtkey_xAOD);
205 if(!xaod){
206 ATH_MSG_WARNING("xAOD key: " << fmtkey_xAOD << " not found for xAOD conversion");
207 return StatusCode::SUCCESS;
208 }
209 if constexpr (withCtx) CHECK( this->m_tool->convert(ctx, aod,xaod));
210 else CHECK( this->m_tool->convert(aod,xaod));
211 ATH_MSG_DEBUG("AOD container has size: " << aod->size());
212 ATH_MSG_DEBUG("xAOD container has size: " << xaod->size());
213 if(aod->size() != xaod->size()){
214 ATH_MSG_ERROR("conversion resulted in differently sized containers");
215 return StatusCode::FAILURE;
216 }
217 return StatusCode::SUCCESS;
218 }
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
std::string format(const std::string &label)
const ToolHandle< CnvTool > & m_tool

◆ help_fillTrigPassBits()

template<typename AOD, typename XAOD, typename CnvTool, bool withCtx = false>
virtual StatusCode BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool, withCtx >::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 220 of file TrigBStoxAODTool.cxx.

220 {
221 typedef IHelper IH;
225
226 const AOD* aod = this->m_sg->template tryConstRetrieve<AOD>(fmtkey_AOD);
227 if(!aod){
228 ATH_MSG_WARNING("AOD key: " << fmtkey_AOD << " not found");
229 return StatusCode::SUCCESS;
230 }
231 ATH_MSG_DEBUG( "AOD container " << fmtkey_AOD << " extracted of size " << aod->size() );
232 // it was found out that in Run 1 data for some containers the size of the TrigPassBits object differs from
233 // the size of the corresponding container. It was decided to not convert TrigPassBits->xAOD::TrigPassBits for such cases,
234 // so xAOD::TrigPassBits will be nullptr
235 if( aod->size() != tpb_aod->size() ) {
236 ATH_MSG_WARNING( "sizes of the container " << fmtkey_AOD << " and the corresponding (?) trigpassbits object are different: "
237 << aod->size() << " vs " << tpb_aod->size() << ", will not convert TrigPassBits for this container" );
238 return StatusCode::SUCCESS;
239 }
240
241 XAOD* xaod = this->m_sg->template tryRetrieve<XAOD>(fmtkey_xAOD);
242 if(!xaod){
243 ATH_MSG_WARNING("xAOD key: " << fmtkey_xAOD << " not found");
244 return StatusCode::SUCCESS;
245 }
246 ATH_MSG_DEBUG("xAOD container " << fmtkey_xAOD << " extracted of size " << xaod->size());
247
248 if(aod->size() != xaod->size()) {
249 ATH_MSG_ERROR("containers before and after the conversion are of different sizes");
250 return StatusCode::FAILURE;
251 }
252
253 ATH_MSG_DEBUG( "setting xaod passbits size to " << tpb_aod->size() );
255
256 for(uint i=0; i<aod->size(); i++) {
257 // if(i < tpb_aod->size() ){
258 ATH_MSG_DEBUG( "looking at object " << i+1 << " of " << aod->size() );
259 bool passed = HLT::isPassing( tpb_aod, aod->at(i), aod );
260 ATH_MSG_DEBUG( "aod ispassing = " << passed );
261 ATH_MSG_DEBUG( "xaod ispassing = " << xBits->isPassing( i ) );
262 if(passed)
263 xBits->markPassing( i );
264 ATH_MSG_DEBUG( "xaod ispassing (after update) = " << xBits->isPassing( i ) );
265 /* } else {
266 ATH_MSG_DEBUG( "skipping object " << i+1 << " as it is outside of the array range of the corresponding aod TrigPassBits object" );
267 }*/
268 }
269 tpb_xaod = xBits.release();
270 return StatusCode::SUCCESS;
271 }
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< CnvTool >::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< CnvTool > & BStoXAODHelper::ToolHolder< CnvTool >::tool ( )
inlineprotectedinherited

Definition at line 166 of file TrigBStoxAODTool.cxx.

166{return m_tool;}

◆ xAODContainerClid()

template<typename AOD, typename XAOD, typename CnvTool, bool withCtx = false>
CLID BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool, withCtx >::xAODContainerClid ( )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 185 of file TrigBStoxAODTool.cxx.

185{return getCLID<XAOD>();}

◆ xAODElementClid()

template<typename AOD, typename XAOD, typename CnvTool, bool withCtx = false>
CLID BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool, withCtx >::xAODElementClid ( )
inlinevirtual

Implements BStoXAODHelper::IHelper.

Definition at line 188 of file TrigBStoxAODTool.cxx.

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

const ToolHandle<CnvTool>& BStoXAODHelper::ToolHolder< CnvTool >::m_tool
protectedinherited

Definition at line 165 of file TrigBStoxAODTool.cxx.


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