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

Public Types

typedef Container2Aux< XAOD >::type xAODAux

Public Member Functions

 DefaultHelper (const ToolHandle< CnvTool > &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< 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>
struct BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool >

Definition at line 179 of file TrigBStoxAODTool.cxx.

Member Typedef Documentation

◆ xAODAux

template<typename AOD, typename XAOD, typename CnvTool>
typedef Container2Aux<XAOD>::type BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool >::xAODAux

Definition at line 180 of file TrigBStoxAODTool.cxx.

Constructor & Destructor Documentation

◆ DefaultHelper()

template<typename AOD, typename XAOD, typename CnvTool>
BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool >::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>
CLID BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool >::AODContainerClid ( )
inlinevirtual

◆ AODElementClid()

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

Implements BStoXAODHelper::IHelper.

Definition at line 187 of file TrigBStoxAODTool.cxx.

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

template<typename AOD, typename XAOD, typename CnvTool>
virtual StatusCode BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool >::help ( 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 CHECK( this->m_tool->convert(aod,xaod));
210 ATH_MSG_DEBUG("AOD container has size: " << aod->size());
211 ATH_MSG_DEBUG("xAOD container has size: " << xaod->size());
212 if(aod->size() != xaod->size()){
213 ATH_MSG_ERROR("conversion resulted in differently sized containers");
214 return StatusCode::FAILURE;
215 }
216 return StatusCode::SUCCESS;
217 }
#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>
virtual StatusCode BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool >::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 219 of file TrigBStoxAODTool.cxx.

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

Implements BStoXAODHelper::IHelper.

Definition at line 185 of file TrigBStoxAODTool.cxx.

185{return getCLID<XAOD>::ID();}

◆ xAODElementClid()

template<typename AOD, typename XAOD, typename CnvTool>
CLID BStoXAODHelper::DefaultHelper< AOD, XAOD, CnvTool >::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.

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: