MarlinTPC
1.2.0
|
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 FieldMapReader * | READER () |
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... | |
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.
|
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().
|
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().
|
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().
|
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().