Class representing Millepede steering.
More...
#include <PedeSteering.h>
|
| PedeSteering () |
| Default constructor.
|
|
| PedeSteering (const std::string &filename) |
| Constructor to directly import command from file.
|
|
virtual | ~PedeSteering () |
| Destructor.
|
|
void | import (std::string filename) |
| Load commands from existing text file.
|
|
void | command (std::string line) |
| Add command to the steering.
|
|
std::string | make (std::string filename="") |
| Compose and write out steering file.
|
|
void | fixParameters (std::vector< int > labels, std::vector< double > values={}, std::vector< double > presigmas={}) |
| Fix parameter values and set presigmas.
|
|
void | addFile (std::string filename, double weight=1.) |
| Add a file (optionally with weight) to list of binary files.
|
|
void | clearFiles () |
| Clear list of files.
|
|
|
std::vector< std::string > | commands |
| list command lines
|
|
std::vector< std::string > | files |
| list of binary files
|
|
std::string | name |
| Name of steering (used as default filename)
|
|
Class representing Millepede steering.
Definition at line 23 of file PedeSteering.h.
◆ PedeSteering() [1/2]
Default constructor.
Definition at line 26 of file PedeSteering.h.
std::vector< std::string > files
list of binary files
std::string name
Name of steering (used as default filename)
std::vector< std::string > commands
list command lines
◆ PedeSteering() [2/2]
Constructor to directly import command from file.
- Parameters
-
filename | text file with Pede commands |
Definition at line 29 of file PedeSteering.h.
◆ ~PedeSteering()
◆ addFile()
void addFile |
( |
std::string |
filename, |
|
|
double |
weight = 1. |
|
) |
| |
Add a file (optionally with weight) to list of binary files.
Definition at line 69 of file PedeSteering.cc.
70{
71 if (weight != 1.)
72 filename = filename + " -- " + std::to_string(weight);
73 bool exists = false;
74 for (
auto file :
files)
75 if (file == filename)
76 exists = true;
77 if (!exists)
78 files.push_back(filename);
79}
◆ clearFiles()
◆ command()
void command |
( |
std::string |
line | ) |
|
Add command to the steering.
- Parameters
-
line | Line with command to be added |
Definition at line 35 of file PedeSteering.cc.
◆ fixParameters()
void fixParameters |
( |
std::vector< int > |
labels, |
|
|
std::vector< double > |
values = {} , |
|
|
std::vector< double > |
presigmas = {} |
|
) |
| |
Fix parameter values and set presigmas.
- Parameters
-
labels | Vector of Pede labels (see GlobalLabel.h) |
values | Vector (of size labels) with values to be set to parameters in labels |
presigmas | Vector (of size labels) with presigmas for parameters (<0 means fixed parameter) |
Definition at line 51 of file PedeSteering.cc.
52{
54 bool useValues = (labels.size() == values.size());
55 bool usePresigmas = (labels.size() == presigmas.size());
56
57 for (unsigned int i = 0; i < labels.size(); i++) {
58 double value = 0.;
59 double presigma = -1.;
60 if (useValues)
61 value = values[i];
62 if (usePresigmas)
63 presigma = presigmas[i];
64
65 command(to_string(labels[i]) +
" " + to_string(value) +
" " + to_string(presigma));
66 }
67}
void command(std::string line)
Add command to the steering.
◆ import()
void import |
( |
std::string |
filename | ) |
|
Load commands from existing text file.
- Parameters
-
filename | Path to txt file to be loaded |
Definition at line 39 of file PedeSteering.cc.
40{
42 ifstream file(filename);
43 if (!file.is_open())
44 return;
45
46 string commandLine;
47 while (getline(file, commandLine))
49}
◆ make()
string make |
( |
std::string |
filename = "" | ) |
|
Compose and write out steering file.
- Parameters
-
filename | Output steering file name |
Definition at line 16 of file PedeSteering.cc.
17{
19 if (filename == "")
21 ofstream file(filename.c_str());
22 file << "! Steerig file for Pede generated by PedeSteering class !" << endl;
23 file << "Cfiles" << endl;
24 for (
string& cfile :
files)
25 file << cfile << endl;
26
27 file << endl;
28
31
32 file.close();
33 return filename;
34}
◆ commands
std::vector<std::string> commands |
|
private |
◆ files
std::vector<std::string> files |
|
private |
◆ name
Name of steering (used as default filename)
Definition at line 61 of file PedeSteering.h.
The documentation for this class was generated from the following files: