KaliVeda
Toolkit for HIC analysis
KVFAZIATrigger.h
1 #ifndef __KVFAZIATRIGGER_H
2 #define __KVFAZIATRIGGER_H
3 
4 #include "KVBase.h"
5 #include "KVNameValueList.h"
6 #include <unordered_map>
7 
21 class KVFAZIATrigger : public KVBase {
22 public:
23  enum class TriggerPattern : uint8_t {
24  Mult1,
26  Mult2
27  };
28 private:
29  uint16_t fTriggerPattern;
30  mutable std::unordered_map<std::string, TriggerPattern> fTriggerPatterns = {
31  {"Mult1", TriggerPattern::Mult1},
32  {"Mult1/100", TriggerPattern::Mult1Downscale100},
33  {"Mult2", TriggerPattern::Mult2},
34  };
35  std::unordered_map<std::string, uint16_t> fTriggerNameToBitPattern;
36  mutable std::map<TriggerPattern, uint16_t> fTriggerEnumToBitPattern;
37 public:
38  void SetTriggerPattern(uint16_t tp)
39  {
41  fTriggerPattern = tp;
42  }
43  void AddTriggerPattern(const TString& name, uint16_t value)
44  {
48  }
49  std::vector<std::string> GetTriggerPatterns() const;
50  bool IsTrigger(TriggerPattern tp) const
51  {
54  }
55  bool IsTrigger(const std::string& tp) const
56  {
58  return IsTrigger(fTriggerPatterns[tp]);
59  }
60  void Print(Option_t* = "") const;
61 
62  ClassDef(KVFAZIATrigger, 1) //The trigger pattern for each FAZIA event
63 };
64 
65 #endif
const char Option_t
#define ClassDef(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char name[80]
Base class for KaliVeda framework.
Definition: KVBase.h:142
The trigger pattern for each FAZIA event.
bool IsTrigger(const std::string &tp) const
void AddTriggerPattern(const TString &name, uint16_t value)
bool IsTrigger(TriggerPattern tp) const
std::unordered_map< std::string, TriggerPattern > fTriggerPatterns
@ Mult2
M>=2 multiplicity trigger.
@ Mult1
Minimum bias M>=1 multiplicity trigger.
@ Mult1Downscale100
Downscaled (1/100) minimum bias M>=1 multiplicity trigger.
std::vector< std::string > GetTriggerPatterns() const
Returns the names of all trigger patterns which are known and set for the trigger.
std::map< TriggerPattern, uint16_t > fTriggerEnumToBitPattern
uint16_t fTriggerPattern
std::unordered_map< std::string, uint16_t > fTriggerNameToBitPattern
void Print(Option_t *="") const
Print defined trigger bit patterns with their meanings.
void SetTriggerPattern(uint16_t tp)