ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCalibTriggerInfo.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <iostream>
8
10#include "GaudiKernel/MsgStream.h"
11
12namespace MuonCalib {
13
14 std::vector<std::pair<std::vector<int>, std::string> > MuonCalibTriggerTypeHelper::m_typeToBitAndStringMapping;
15
21
27
29
34
36 if (type == L1_MU0_TGC_HALO || type == L1_MU0_TGC || type == L1_MU6_TGC) return true;
37 return false;
38 }
39
44
46 if (type == L1_EM3 || type == L1_TAU5 || type == L1_J5 || type == L1_XE20) return true;
47 return false;
48 }
49
50 void MuonCalibTriggerTypeHelper::addEntry(MuonCalibTriggerType type, int bit, const std::string& name) {
51 if (!validType(type)) {
52 MsgStream log(Athena::getMessageSvc(), "MuonCalibTriggerTypeHelper");
53 log << MSG::WARNING << "MuonCalibTriggerTypeHelper::addEntry -> invalid trigger type" << endmsg;
54 return;
55 }
56 std::vector<int> bits;
57 bits.push_back(bit);
58 m_typeToBitAndStringMapping[type] = std::make_pair(bits, name);
59 }
60
61 void MuonCalibTriggerTypeHelper::addEntry(MuonCalibTriggerType type, std::vector<int>& bits, const std::string& name) {
62 if (!validType(type)) {
63 MsgStream log(Athena::getMessageSvc(), "MuonCalibTriggerTypeHelper");
64 log << MSG::WARNING << "MuonCalibTriggerTypeHelper::addEntry -> invalid trigger type" << endmsg;
65 return;
66 }
67 m_typeToBitAndStringMapping[type] = std::make_pair(bits, name);
68 }
69
71 if (!m_typeToBitAndStringMapping.empty()) return;
73
74 addEntry(L1_EM3, 0, "L1_EM3");
75 addEntry(L1_TAU5, 64, "L1_TAU5");
76 addEntry(L1_J5, 96, "L1_J5");
77 addEntry(L1_XE20, 129, "L1_XE20");
78
79 std::vector<int> bits;
80 bits.push_back(23);
81 for (int i = 30; i <= 45; ++i) bits.push_back(i);
82 addEntry(L1_MBTS_1_COMM, bits, "L1_MBTS_1_COMM");
83
84 bits.clear();
85 bits.push_back(24);
86 for (int i = 46; i <= 61; ++i) bits.push_back(i);
87 addEntry(L1_MBTS_2_COMM, bits, "L1_MBTS_2_COMM");
88 addEntry(L1_MU0_LOW_RPC, 89, "L1_MU0_LOW_RPC");
89 addEntry(L1_MU6_RPC, 90, "L1_MU6_RPC");
90 addEntry(L1_MU0_HIGH_RPC, 93, "L1_MU0_HIGH_RPC");
91 addEntry(L1_MU0_TGC_HALO, 88, "L1_MU0_TGC_HALO");
92 addEntry(L1_MU0_TGC, 91, "L1_MU0_TGC");
93 addEntry(L1_MU6_TGC, 92, "L1_MU6_TGC");
94 addEntry(NUMBEROFKNOWNTRIGGERS, -1, "UNKNOWN");
95 }
96
99
102
103 MuonCalibTriggerInfo::MuonCalibTriggerInfo(int tbpbit, int tapbit, int tavbit, int bcIndex) :
104 m_type(UNKNOWNTRIGGERTYPE), m_tbpbit(tbpbit), m_tapbit(tapbit), m_tavbit(tavbit), m_delay(0.), m_bcIndex(bcIndex) {}
105
107 initMap();
108 MsgStream log(Athena::getMessageSvc(), "MuonCalibTriggerTypeHelper");
109 log << MSG::INFO << "MuonCalibTriggerTypeHelper::dumpMapping, map size " << m_typeToBitAndStringMapping.size() << endmsg;
110 std::vector<std::pair<std::vector<int>, std::string> >::const_iterator it = m_typeToBitAndStringMapping.begin();
111 std::vector<std::pair<std::vector<int>, std::string> >::const_iterator it_end = m_typeToBitAndStringMapping.end();
112 int index = 0;
113 for (; it != it_end; ++it) {
114 log << MSG::INFO << "index " << index++ << " type " << it->second << " nbits " << it->first.size() << " bits " << endmsg;
115 for (unsigned int i = 0; i < it->first.size(); ++i) { log << MSG::INFO << " " << it->first[i] << endmsg; }
116 }
117 }
118
119} // namespace MuonCalib
#define endmsg
MuonCalibTriggerType type() const
destructor
int bcIndex() const
return the bcIndex of the trigger
double m_delay
delay of signal wrt firing trigger
int m_tbpbit
trig bit before pre-scale
int m_tapbit
trig bit after pre-scale
double delay() const
return the delay of the signal wrt firing trigger
static std::vector< std::pair< std::vector< int >, std::string > > m_typeToBitAndStringMapping
static std::string itemName(MuonCalibTriggerType type)
get trigger bit for a given type
static bool isLVL1CaloTrigger(MuonCalibTriggerType type)
check whether type is valid
static bool isMbtsTrigger(MuonCalibTriggerType type)
check whether type is valid
static bool isTgcTrigger(MuonCalibTriggerType type)
check whether type is valid
static std::vector< int > triggerBits(MuonCalibTriggerType type)
get trigger bit for a given type
static bool validType(MuonCalibTriggerType type)
check whether type is valid
static void addEntry(MuonCalibTriggerType type, int bit, const std::string &name)
static bool isRpcTrigger(MuonCalibTriggerType type)
check whether type is valid
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
MuonCalibTriggerType
enum for all trigger type
Definition index.py:1