ATLAS Offline Software
Classes | Public Member Functions | Private Attributes | List of all members
ObjExCellWriter< T > Class Template Reference

#include <ObjExCellWriter.h>

Collaboration diagram for ObjExCellWriter< T >:

Classes

struct  Config
 

Public Member Functions

 ObjExCellWriter (const Config &cfg)
 Constructor. More...
 
void write (const std::vector< Acts::ExtrapolationCell< T >> &ecells)
 The protected writeT method, called by the WriterT base. More...
 

Private Attributes

Config m_cfg
 
size_t m_vCounter
 

Detailed Description

template<class T>
class ObjExCellWriter< T >

Definition at line 24 of file ObjExCellWriter.h.

Constructor & Destructor Documentation

◆ ObjExCellWriter()

template<class T >
ObjExCellWriter< T >::ObjExCellWriter ( const Config cfg)
inline

Constructor.

Parameters
cfgis the configuration object @parm level is the output logging level

Definition at line 43 of file ObjExCellWriter.h.

46  : m_cfg(cfg), m_vCounter(1)
47  {
48  if (!m_cfg.outputStream) {
49  throw std::invalid_argument("Missing output stream");
50  }
51  }

Member Function Documentation

◆ write()

template<class T >
void ObjExCellWriter< T >::write ( const std::vector< Acts::ExtrapolationCell< T >> &  ecells)
inline

The protected writeT method, called by the WriterT base.

Parameters
ctxis the algorithm context for event consistency

step parameters

Definition at line 56 of file ObjExCellWriter.h.

56  {
57 
58  // loop over the cells
59  for (auto& eCell : ecells) {
60  // remember the first counter
61  size_t fCounter = m_vCounter;
62 
63  // increase the vertex counter
64  ++m_vCounter;
65  // the event paramters
66  auto sPosition = eCell.startParameters->position();
67  // write the space point
68  (*(m_cfg.outputStream))
69  << "v " << m_cfg.outputScalor * sPosition.x() << ", "
70  << m_cfg.outputScalor * sPosition.y() << ", "
71  << m_cfg.outputScalor * sPosition.z() << '\n';
72 
73  // loop over extrapolation steps
74  for (auto& es : eCell.extrapolationSteps) {
75  if (es.parameters) {
77  const T& pars = (*es.parameters);
78  auto tPosition = pars.position();
79  // increase the counter
80  ++m_vCounter;
81  // write the space point
82  (*(m_cfg.outputStream))
83  << "v " << m_cfg.outputScalor * tPosition.x() << ", "
84  << m_cfg.outputScalor * tPosition.y() << ", "
85  << m_cfg.outputScalor * tPosition.z() << '\n';
86  }
87  }
88  // write out the line
89  for (size_t i=fCounter+1;i<m_vCounter;i++) {
90  (*(m_cfg.outputStream)) << "l ";
91  (*(m_cfg.outputStream)) << (i-1) << " " << i;
92  (*(m_cfg.outputStream)) << '\n';
93  }
94  //(*(m_cfg.outputStream)) << "l ";
95  //for (size_t iv = fCounter; iv < m_vCounter; ++iv)
96  //(*(m_cfg.outputStream)) << iv << " ";
97 
98  //(*(m_cfg.outputStream)) << '\n';
99  // new line
100  (*(m_cfg.outputStream)) << '\n';
101  }
102  }

Member Data Documentation

◆ m_cfg

template<class T >
Config ObjExCellWriter< T >::m_cfg
private

Definition at line 105 of file ObjExCellWriter.h.

◆ m_vCounter

template<class T >
size_t ObjExCellWriter< T >::m_vCounter
private

Definition at line 106 of file ObjExCellWriter.h.


The documentation for this class was generated from the following file:
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
ObjExCellWriter::Config::outputScalor
double outputScalor
output scalor
Definition: ObjExCellWriter.h:32
lumiFormat.i
int i
Definition: lumiFormat.py:85
ObjExCellWriter::m_cfg
Config m_cfg
Definition: ObjExCellWriter.h:105
ObjExCellWriter::Config::outputStream
std::shared_ptr< std::ofstream > outputStream
the output stream
Definition: ObjExCellWriter.h:36
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
ObjExCellWriter::m_vCounter
size_t m_vCounter
Definition: ObjExCellWriter.h:106
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35