ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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.

182 : ToolHolder<CnvTool>(tool){;}

Member Function Documentation

◆ AODContainerClid()

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

Implements BStoXAODHelper::IHelper.

Definition at line 184 of file TrigBStoxAODTool.cxx.

184 {return getCLID<AOD>::ID();}

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

◆ format()

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

Definition at line 152 of file TrigBStoxAODTool.cxx.

◆ 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;
192  std::string fmtkey_AOD = IH::template format<AOD>(label);
193  std::string fmtkey_xAOD = IH::template format<XAOD>(newLabel);
194  std::string fmtkey_xAODAux = IH::template format<xAODAux>(newLabel+"Aux.");
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  }

◆ 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;
221  std::string fmtkey_AOD = IH::template format<AOD>(label);
222  std::string fmtkey_xAOD = IH::template format<XAOD>(newLabel);
223  std::string fmtkey_xAODAux = IH::template format<xAODAux>(newLabel+"Aux.");
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() );
253  std::unique_ptr<xAOD::TrigPassBits> xBits = xAOD::makeTrigPassBits(xaod);
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  }

◆ initialize()

virtual StatusCode BStoXAODHelper::ToolHolder< CnvTool >::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()

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.

◆ m_sg

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

Definition at line 157 of file TrigBStoxAODTool.cxx.

◆ 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:
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
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
taskman.template
dictionary template
Definition: taskman.py:317
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
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
BStoXAODHelper::ToolHolder< CnvTool >::m_tool
const ToolHandle< CnvTool > & 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
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::IHelper::m_sg
StoreGateSvc * m_sg
Definition: TrigBStoxAODTool.cxx:157
BStoXAODHelper::ToolHolder< CnvTool >::tool
ToolHandle< CnvTool > & tool()
Definition: TrigBStoxAODTool.cxx:166