MarlinTPC  1.2.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
marlintpc::FieldMapReader Class Reference

FieldReader : A reader for field maps. More...

#include <FieldMapReader.h>

Public Member Functions

virtual ~FieldMapReader ()
 destructor
 
virtual EVENT::LCCollection * read_field_map (const std::string)
 reads the field map at the given path and returns it as an LCCollection*. More...
 
void set_verbose (const int)
 sets level of verbose output
 

Static Public Member Functions

static FieldMapReaderREADER ()
 Returns the default instance.
 

Protected Member Functions

virtual void read_Cylindrical2DMagneticField ()
 Reads all lines after "### Start Field Map ###". More...
 
virtual void read_Cylindrical3DMagneticField ()
 Reads all lines after "### Start Field Map ###". More...
 
virtual void read_parameter (const std::string)
 Reads a string, extracts a parameter and adds it to the parameters in the LCCollection. More...
 

Detailed Description

FieldReader : A reader for field maps.

Takes a text file and produces an LCCollection from it. The text file has to provide the type of the field map: "FieldType <FieldMapType>" Any number of Int, Float and String parameters for the LCCollection can be set: "<type> <parameterName> <value>" The actual field map starts after: "### Start Field Map ###" The values are read depending on the type of the field map.

Author
Christian Grefe

Member Function Documentation

void marlintpc::FieldMapReader::read_Cylindrical2DMagneticField ( )
protectedvirtual

Reads all lines after "### Start Field Map ###".

Expects four floats in each line: "<r> <z> <Br> <Bz>" Adds one element to the LCCollection per line.

Referenced by read_field_map().

void marlintpc::FieldMapReader::read_Cylindrical3DMagneticField ( )
protectedvirtual

Reads all lines after "### Start Field Map ###".

Expects six floats in each line: "<r> <phi> <z> <Br> <Bphi> <Bz>" Adds one element to the LCCollection per line.

Referenced by read_field_map().

EVENT::LCCollection * marlintpc::FieldMapReader::read_field_map ( const std::string  filePath)
virtual

reads the field map at the given path and returns it as an LCCollection*.

returns 0 if the input file is not a valid field map.

References read_Cylindrical2DMagneticField(), read_Cylindrical3DMagneticField(), and read_parameter().

void marlintpc::FieldMapReader::read_parameter ( const std::string  line)
protectedvirtual

Reads a string, extracts a parameter and adds it to the parameters in the LCCollection.

The string has to follow the pattern: "<type> <parameterName> <value>". Known types are "String", "Int" and "Float". Only the first value is taken, except for "String" which takes everything after the parameter name. "FieldType <FieldMapType>" sets the type of the field map. It has to be defined before "### Start Field Map ###". Only the last definition is taken.

Referenced by read_field_map().


The documentation for this class was generated from the following files: