ATLAS Offline Software
Loading...
Searching...
No Matches
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}
std::unique_ptr< details::IParticleWriterBase > m_writer
void addInput(T &c, const Primitive &input, A a=defaultAccessor< T >)
bool isCustom(const Primitive &p)
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.

◆ ~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: