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

◆ ~IParticleWriter()

IParticleWriter::~IParticleWriter ( )
default

Member Function Documentation

◆ fill()

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

Definition at line 319 of file IParticleWriter.cxx.

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

◆ flush()

void IParticleWriter::flush ( )

Definition at line 324 of file IParticleWriter.cxx.

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

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