HighLAND
Public Member Functions | Protected Attributes | List of all members
DocString Class Reference

#include <DocString.hxx>

Inheritance diagram for DocString:

Public Member Functions

 DocString ()
 Empty constructor to keep ROOT happy when reading in from TClonesArray.
 
 DocString (const std::string &tree, const std::string &name, const std::string &doc, const std::string &type, int size1, const std::string &counter1, int size2, const std::string &counter2, int size3, const std::string &counter3)
 Constructor that actually sets the information.
 
virtual ~DocString ()
 Destructor.
 
void Explain ()
 
std::string Name ()
 Get the name of this variable.
 
std::string Tree ()
 Get the name of the tree this variable was stored in.
 
 ClassDef (DocString, 1)
 

Protected Attributes

std::string _tree
 The name of the tree this variable was stored in.
 
std::string _name
 The name of this variable.
 
std::string _doc
 The documentation string provided by the user.
 
std::string _type
 The type of this variable (I/F/C/D)
 
std::string _counter1
 If a vector, the counter used for the 1st dimension.
 
std::string _counter2
 If a matrix, the counter used for the 2nd dimension.
 
std::string _counter3
 If a 3D matrix, the counter used for the 3rd dimension.
 
int _size1
 If a vector, the size of the 1st dimension.
 
int _size2
 If a matrix, the size of the 2nd dimension.
 
int _size3
 If a 3D matrix, the size of the 3rd dimension.
 

Detailed Description

This class is used to store information about the variables stored in the micro-trees. The DocStringManager is used to create, store and access DocString objects.

Each variable stored in the micro-trees has an associated DocString object, which records the name, type, size and other information about the variable.

This DocString class should not need to be accessed by users. All the functionality is handled automatically.

Definition at line 16 of file DocString.hxx.

Member Function Documentation

§ Explain()

void DocString::Explain ( )

Print out the details of this variable. If it is a track category variable, also print out the track categories.

Definition at line 29 of file DocString.cxx.

29  {
30  std::string dim = "Unknown";
31  std::string nicetype = "Unknown";
32 
33  if (_size3 != 0) {
34  dim = "3D matrix of ";
35  } else if (_size2 != 0) {
36  dim = "Matrix of ";
37  } else if (_size1 != 0) {
38  dim = "Vector of ";
39  } else {
40  dim = "";
41  }
42 
43  if (_type == "F") {
44  nicetype = "float";
45  } else if (_type == "D") {
46  nicetype = "double";
47  } else if (_type == "I") {
48  nicetype = "integer";
49  } else if (_type == "C") {
50  nicetype = "char";
51  }
52 
53  std::cout << "Variable name..... " << _name << std::endl;
54  std::cout << "Stored in tree.... " << _tree << std::endl;
55  std::cout << "Type of variable.. " << dim << nicetype << std::endl;
56  if (_size1 != 0) {
57  std::cout << "Size of variable: " << std::endl;
58  std::cout << " 1st dimension... ";
59  if (_size1>0) {
60  std::cout << abs(_size1) << " (fixed size)" << std::endl;
61  } else {
62  std::cout << _counter1 << " (variable size, up to a maximum of " << abs(_size1) << ")" << std::endl;
63  }
64  if (_size2 != 0) {
65  std::cout << " 2nd dimension... ";
66  if (_size2>0) {
67  std::cout << abs(_size2) << " (fixed size)" << std::endl;
68  } else {
69  std::cout << _counter2 << " (variable size, up to a maximum of " << abs(_size2) << ")" << std::endl;
70  }
71  if (_size3 != 0) {
72  std::cout << " 3rd dimension... ";
73  if (_size3>0) {
74  std::cout << abs(_size3) << " (fixed size)" << std::endl;
75  } else {
76  std::cout << _counter3 << " (variable size, up to a maximum of " << abs(_size3) << ")" << std::endl;
77  }
78  }
79  }
80  }
81  std::cout << "Documentation..... " << _doc << std::endl;
82 
83  // if (ND::categ().HasCategory(_name)) {
84  // ND::categ().DumpTrackCategory(_name);
85  // }
86 }
std::string _counter1
If a vector, the counter used for the 1st dimension.
Definition: DocString.hxx:55
std::string _type
The type of this variable (I/F/C/D)
Definition: DocString.hxx:52
int _size1
If a vector, the size of the 1st dimension.
Definition: DocString.hxx:64
int _size2
If a matrix, the size of the 2nd dimension.
Definition: DocString.hxx:67
std::string _counter2
If a matrix, the counter used for the 2nd dimension.
Definition: DocString.hxx:58
std::string _counter3
If a 3D matrix, the counter used for the 3rd dimension.
Definition: DocString.hxx:61
std::string _name
The name of this variable.
Definition: DocString.hxx:46
std::string _tree
The name of the tree this variable was stored in.
Definition: DocString.hxx:43
std::string _doc
The documentation string provided by the user.
Definition: DocString.hxx:49
int _size3
If a 3D matrix, the size of the 3rd dimension.
Definition: DocString.hxx:70

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