ATLAS Offline Software
Loading...
Searching...
No Matches
L1DataDef.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TrigConf_L1DataDef
6#define TrigConf_L1DataDef
7
8#include <string>
9#include <map>
10#include <vector>
11
13
14namespace TrigConf {
15
16 class L1DataDef {
17 public:
18
20 EM=1, TAU, MUON, // 1-3
21 JET, FJET, FJ, JE, JF, JB, // 4-9
22 XE, TE, XS, // 10 - 12
23 MBTS, MBTSSI, LUCID, TRT, BCM, ZDC, NIM, // 13 - 19
24 ZB, TH, M, BCMCMB, CALREQ, BPTX, // 20 - 25
25 TOPO, // 26
26 ALFA, // 27
27 BGRP = 100, RNDM, PCLK, // 100 - 102
28 UNDEF = 199 // 199
29 };
30
32 TriggerTypeConfig(TriggerType t=UNDEF, const std::string& n="UNDEF", unsigned int m=0, bool i=false) :
33 type(t), name(n), max(m), internal(i) {};
34 TriggerType type; // the trigger type EM, BGRP, NIM
35 std::string name; // the name "EM", "BGRP", "NIM"
36 unsigned int max; // the maximum number of thresholds
37 bool internal; // true for internal triggers
38 };
39
41
42 typedef std::map<TriggerType, TriggerTypeConfig> TypeConfigMap_t;
43 typedef std::map<std::string, TriggerType> STypeTypeMap_t;
44
45 public:
46
47 static void setMaxThresholdsFromL1Version(unsigned int l1version);
48
49 static void printMaxThresholds();
50
51 static TriggerType stringAsType(const std::string& type) { return g_sTypeType[type]; }
52
53 static std::string& typeAsString(TriggerType tt) { return typeConfig(tt).name; }
54
55 static const std::vector<TriggerType>& types() { return g_Types; }
56
57 static const TypeConfigMap_t& typeConfigs() { return g_typeConfigs; }
58 static TriggerTypeConfig& typeConfig(TriggerType tt);
59
60 static bool addConfig(TriggerType tt, const std::string& name, unsigned int max, bool internal=false) {
61 g_typeConfigs.insert(TypeConfigMap_t::value_type(tt, TriggerTypeConfig(tt, name, max, internal)));
62 g_sTypeType.insert(STypeTypeMap_t::value_type(name,tt));
63 g_Types.push_back(tt);
64 return true;
65 }
66
67 static void setOldJEP3Cabling();
68 static void setNewJEP3Cabling();
69
70 private:
71 // thread-safe because set once during initialize
72 inline static TypeConfigMap_t g_typeConfigs ATLAS_THREAD_SAFE; // maps TriggerType (e.g. L1DataDef::EM) to the TriggerTypeConfig object
73 inline static STypeTypeMap_t g_sTypeType ATLAS_THREAD_SAFE; // maps string to TriggerType (e.g. "EM" -> L1DataDef::EM)
74 inline static std::vector<TriggerType> g_Types ATLAS_THREAD_SAFE;
75 inline static unsigned int g_l1Version ATLAS_THREAD_SAFE {0};
76
77 };
78
79}
80
81#endif
#define max(a, b)
Definition cfImp.cxx:41
Define macros for attributes used to control the static checker.
static TriggerType stringAsType(const std::string &type)
Definition L1DataDef.h:51
TriggerTypeConfig InternalTriggerType
Definition L1DataDef.h:40
std::map< std::string, TriggerType > STypeTypeMap_t
Definition L1DataDef.h:43
static bool addConfig(TriggerType tt, const std::string &name, unsigned int max, bool internal=false)
Definition L1DataDef.h:60
static void setOldJEP3Cabling()
static const TypeConfigMap_t & typeConfigs()
Definition L1DataDef.h:57
static void printMaxThresholds()
Definition L1DataDef.cxx:57
static TriggerTypeConfig & typeConfig(TriggerType tt)
std::map< TriggerType, TriggerTypeConfig > TypeConfigMap_t
Definition L1DataDef.h:42
static const std::vector< TriggerType > & types()
Definition L1DataDef.h:55
static TypeConfigMap_t g_typeConfigs ATLAS_THREAD_SAFE
Definition L1DataDef.h:72
static void setNewJEP3Cabling()
static std::string & typeAsString(TriggerType tt)
Definition L1DataDef.h:53
static void setMaxThresholdsFromL1Version(unsigned int l1version)
Definition L1DataDef.cxx:65
Definition HitInfo.h:33
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22
TriggerTypeConfig(TriggerType t=UNDEF, const std::string &n="UNDEF", unsigned int m=0, bool i=false)
Definition L1DataDef.h:32
TriggerTypeConfig(TriggerType t=UNDEF, const std::string &n="UNDEF", unsigned int m=0, bool i=false)
Definition L1DataDef.h:32