1 #ifndef CategoryManager_h 2 #define CategoryManager_h 9 #include <HLClonesArray.hxx> 11 #include "CategoryClasses.hxx" 22 const UInt_t NMAXCATEG=100;
24 const UInt_t NMAXCATEGCOUNTERS = 10;
28 const std::string NAMESAND =
"sand #mu";
29 const std::string NAMEOUTFV =
"out FV";
30 const std::string NAMENOTRUTH =
"no truth";
31 const std::string NAMEOTHER =
"other";
32 const std::string NAME2P2H =
"2p2h";
33 const std::string NAMEBKG =
"BKG";
36 const int CATSAND = 777;
37 const int CATOUTFV = 7;
38 const int CATNOTRUTH = -1;
39 const int CATOTHER = 999;
40 const int CAT2P2H = 9;
41 const int CATBKG = 888;
44 const int COLSAND = 51;
45 const int COLOUTFV = 1;
46 const int COLNOTRUTH = 92;
47 const int COLOTHER = 48;
48 const int COL2P2H = 874;
80 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);
83 void CopyCategory(
const std::string& categ_name,
const std::string& categ_name2);
114 void SetCode(
const std::string& categ,
int code,
int defaultcode = 0) {
118 std::cout <<
"Code not set: category '" << categ <<
"' not found !!!" << std::endl;
131 int GetCode(
const std::string& categ);
void SetCategoryType(int index, bool ok)
Set the type for the actual 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 SetReady(bool ok)
Set that the categories are ready.
int GetCode(const std::string &categ)
Get the actual code for this category.
void SetCode(const std::string &categ, int code, int defaultcode=0)
bool CheckCategoryType(const std::string &categ, int index)
TrackCategoryDefinition & GetCategory(const std::string &categ)
Get a specific category.
void DumpCategories()
Dump the map of track categories.
bool IsReady() const
Whether the categories are ready.
std::map< std::string, TrackCategoryDefinition * > & GetCategories()
Get the map of track categories.
std::vector< TrackTypeDefinition > & GetCategoryTypes(const std::string &categ)
Get the vector of track types in a given category.
void ResetCurrentCategories()
Reset the properties of the current track.
void SetCode(int code, int defaultcode=-999)
bool _ready
Whether the categories are ready.
void CopyCategory(const std::string &categ_name, const std::string &categ_name2)
Copy an existing Category into another with a different name.
CategoryManager()
Private constructor as this is a singleton.
bool HasCategory(const std::string &categ)
Has this category been added?
void DumpCategory(const std::string &categ)
Dump the options stored for the given category.
std::map< std::string, TrackCategoryDefinition * > _track_category_map
The internal map of categories and the names they were registered with.
This namespace contains useful functions for analyses related to kinematics.
void ReadCategories(const std::string &file)
Build the categories from a root file.
void SetCategoryType(const std::string &categ, int type, bool ok)