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

#include <CategoryClasses.hxx>

Inheritance diagram for TrackCategoryDefinition:

Public Member Functions

 TrackCategoryDefinition (bool multi=false)
 
unsigned int GetNTypes ()
 Number of types defined for this category.
 
std::vector< TrackTypeDefinition > & GetCategoryTypes ()
 Get the types defined for this category.
 
void AddType (TrackTypeDefinition &type)
 Add a new type to this category.
 
bool IsMultiType ()
 Is this a multi-type category ? (Can several types coexist?)
 
int GetCode ()
 Get the code for the actual track in this category.
 
bool CheckCategoryType (int index)
 Check if the actual track is of this type.
 
void SetCode (int code, int defaultcode=-999)
 
void SetCategoryType (int index, bool ok)
 Set the type for the actual track.
 
void Reset ()
 
std::string * GetNames (std::string names[])
 
Int_t * GetColors (Int_t colors[])
 
Int_t * GetCodes (Int_t codes[])
 
 ClassDef (TrackCategoryDefinition, 1)
 

Public Attributes

std::string _name
 The name of this category (e.g. "particle").
 
bool _isMultiType
 Whether this is this a multi-type category (can several types coexist?).
 
std::vector< TrackTypeDefinition_types
 The types defined for this category.
 

Protected Attributes

std::vector< bool > _typesOK
 The types for the actual track.
 
int _code
 The code for the actual track.
 

Detailed Description

A TrackCategoryDefinition allows the plotting of stacked histograms in the DrawingTools. For example, a histogram may be broken down by the true particle of the selected track. This "particle" category has types such as "electron", "muon" and so on. The "particle" variable in the analysis micro-tree would then be filled with the appropriate code.

Categories are managed using the CategoryManager, and are saved to the "config" tree of the output file. This means that custom categories can be defined by the analyser, and automatically used in the DrawingTools. See CategoryManager::AddTrackCategory() for how to do this.

Definition at line 51 of file CategoryClasses.hxx.

Constructor & Destructor Documentation

§ TrackCategoryDefinition()

TrackCategoryDefinition::TrackCategoryDefinition ( bool  multi = false)
inline

Create a new track category. Setting "multi" to true means that several types can coexist.

Definition at line 57 of file CategoryClasses.hxx.

57  {
58  _isMultiType = multi;
59  }
bool _isMultiType
Whether this is this a multi-type category (can several types coexist?).

Member Function Documentation

§ SetCode()

void TrackCategoryDefinition::SetCode ( int  code,
int  defaultcode = -999 
)
inline

Set the code for the actual track. Use defaultcode if code isn't defined for this category.

Definition at line 95 of file CategoryClasses.hxx.

95  {
96  bool ok = false;
97 
98  for (std::vector<TrackTypeDefinition>::iterator it = _types.begin(); it != _types.end(); it++) {
99  if (it->_code == code) {
100  ok = true;
101  break;
102  }
103  }
104 
105  if (!ok) {
106  code = defaultcode;
107  }
108 
109  _code = code;
110  }
std::vector< TrackTypeDefinition > _types
The types defined for this category.
int _code
The code for the actual track.

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