Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
IParticleWriter Class Reference

#include <IParticleWriter.h>

Collaboration diagram for IParticleWriter:

Public Member Functions

 IParticleWriter (H5::Group &output_group, const IParticleWriterConfig &)
 
 ~IParticleWriter ()
 
void fill (const std::vector< const xAOD::IParticle * > &)
 
void flush ()
 

Private Attributes

std::unique_ptr< details::IParticleWriterBasem_writer
 

Detailed Description

Definition at line 26 of file IParticleWriter.h.

Constructor & Destructor Documentation

◆ IParticleWriter()

IParticleWriter::IParticleWriter ( H5::Group &  output_group,
const IParticleWriterConfig cfg 
)

Definition at line 278 of file IParticleWriter.cxx.

281 {
282  using IPC = xAOD::IParticleContainer;
283  using IP = xAOD::IParticle;
284  Consumer_t c;
285  for (const auto& input: cfg.inputs) {
286  if (input.link_name.empty()) {
287  const auto& primitive = input.input;
288  if (detail::isCustom(primitive.type)) {
289  addCustomType(c, primitive);
290  } else {
291  detail::addInput(c, primitive);
292  }
293  } else {
294  // else we have some association to follow
295  std::string n = input.link_name;
296  // unfortunately we need a special case for b-tagging
297  if (n == "btaggingLink") {
298  LinkGetter<xAOD::BTaggingContainer> getter(n);
299  detail::addInput(c, input.input, getter);
300  } else {
301  // everything else is an IParticle
302  LinkGetter<IPC,IP> getter(n);
303  if (detail::isCustom(input.input.type)) {
304  addCustomType(c, input.input, getter);
305  } else {
306  detail::addInput(c, input.input, getter);
307  }
308  }
309  }
310  }
311  m_writer = getWriter(group, cfg, c);
312 }

◆ ~IParticleWriter()

IParticleWriter::~IParticleWriter ( )
default

Member Function Documentation

◆ fill()

void IParticleWriter::fill ( const std::vector< const xAOD::IParticle * > &  )

Definition at line 318 of file IParticleWriter.cxx.

318  {
319  m_writer->fill(info);
320 }

◆ flush()

void IParticleWriter::flush ( )

Definition at line 323 of file IParticleWriter.cxx.

323  {
324  m_writer->flush();
325 }

Member Data Documentation

◆ m_writer

std::unique_ptr<details::IParticleWriterBase> IParticleWriter::m_writer
private

Definition at line 33 of file IParticleWriter.h.


The documentation for this class was generated from the following files:
grepfile.info
info
Definition: grepfile.py:38
IParticleWriter::m_writer
std::unique_ptr< details::IParticleWriterBase > m_writer
Definition: IParticleWriter.h:33
xAOD::IParticleContainer
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
Definition: xAOD/xAODBase/xAODBase/IParticleContainer.h:32
detail::addInput
void addInput(T &c, const Primitive &input, A a=defaultAccessor< T >)
Definition: PrimitiveHelpers.h:50
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
beamspotman.n
n
Definition: beamspotman.py:731
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
detail::isCustom
bool isCustom(const Primitive &p)
Definition: PrimitiveHelpers.cxx:10
python.compressB64.c
def c
Definition: compressB64.py:93