HighLAND
|
Public Member Functions | |
CategoryManager () | |
Private constructor as this is a singleton. | |
void | ResetCurrentCategories () |
Reset the properties of the current track. | |
void | AddCategory (const std::string &name, int ntypes, std::string *names, int *codes, int *colors, bool multi=false, bool noWarning=false, bool addNOTRUTH=true, bool addSAND=true) |
void | CopyCategory (const std::string &categ_name, const std::string &categ_name2) |
Copy an existing Category into another with a different name. | |
bool | HasCategory (const std::string &categ) |
Has this category been added? | |
void | ReadCategories (const std::string &file) |
Build the categories from a root file. | |
std::map< std::string, TrackCategoryDefinition * > & | GetCategories () |
Get the map of track categories. | |
void | DumpCategories () |
Dump the map of track categories. | |
void | DumpCategory (const std::string &categ) |
Dump the options stored for the given category. | |
TrackCategoryDefinition & | GetCategory (const std::string &categ) |
Get a specific category. | |
std::vector< TrackTypeDefinition > & | GetCategoryTypes (const std::string &categ) |
Get the vector of track types in a given category. | |
void | SetCode (const std::string &categ, int code, int defaultcode=0) |
void | SetCategoryType (const std::string &categ, int type, bool ok) |
int | GetCode (const std::string &categ) |
Get the actual code for this category. | |
bool | CheckCategoryType (const std::string &categ, int index) |
bool | IsReady () const |
Whether the categories are ready. | |
void | SetReady (bool ok) |
Set that the categories are ready. | |
![]() | |
HLClonesArray (const std::string &tree_name, const std::string &tcarray_name, const std::string &class_name, const UInt_t size) | |
void | ReadClonesArray (const std::string &file) |
void | WriteClonesArray (TTree &tree) |
Int_t & | GetNObjects () |
Return the number of steps that have been added. | |
TClonesArray * | GetClonesArray () |
const std::string & | GetClonesArrayName () const |
Return the name of the TClonesArray. | |
const std::string & | GetTreeName () const |
Return the name of the tree. | |
Protected Attributes | |
std::map< std::string, TrackCategoryDefinition * > | _track_category_map |
The internal map of categories and the names they were registered with. | |
bool | _ready |
Whether the categories are ready. | |
![]() | |
TChain * | _chain |
TChain used to read the "config" tree from the output file. | |
Int_t | _NObjects |
The number of steps that were added. | |
TClonesArray * | _objects |
std::string | _tcArrayName |
Name of the TClonesArray in the tree. | |
std::string | _treeName |
Name of the Tree. | |
std::string | _fileName |
Name of the last file read. | |
Definition at line 54 of file CategoryManager.hxx.
void CategoryManager::AddCategory | ( | const std::string & | name, |
int | ntypes, | ||
std::string * | names, | ||
int * | codes, | ||
int * | colors, | ||
bool | multi = false , |
||
bool | noWarning = false , |
||
bool | addNOTRUTH = true , |
||
bool | addSAND = true |
||
) |
Add a new track category. This will be automatically saved in the "config" tree, so can be used in the DrawingTools.
name: The name of this category (for example, "particle"). ntypes: The number of types this category permits. names: The names of the types this category permits (e.g. "muon"...). codes: The codes that associate a track with a given type. See SetCode(). colors: The colors to be used when drawing the stacked histogram. multi: Whether the category should allow multiple types to coexist. noWarning: avoid warning when replacing properties, used for drawing with % on the legend (with PUR option) addNOTRUTH: atutomatically add the NOTRUTH type addSAND: atutomatically add the SAND muon type The array variables should all be ntypes in length.
Definition at line 21 of file CategoryManager.cxx.
bool CategoryManager::CheckCategoryType | ( | const std::string & | categ, |
int | index | ||
) |
Check is the specified type is true for a given category (for multitype categories only)
Definition at line 212 of file CategoryManager.cxx.
|
inline |
A category can fulfill multiple types. Set the different bits. For multitype categories only.
Definition at line 124 of file CategoryManager.hxx.
|
inline |
Set the actual code for this category. If the specified code isn't defined for the category, defaultcode is used instead.
Definition at line 114 of file CategoryManager.hxx.