ATLAS Offline Software
L1CTP.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "TrigConfData/L1CTP.h"
6 
9 {
10  load();
11 }
12 
13 void
15 {
16  if(! isInitialized() || empty() ) {
17  return;
18  }
19  auto inputs = data().get_child("inputs");
20  for(size_t slot = 7; slot<=9; ++slot) {
21  for(size_t conn=0; conn<4; ++conn) {
22  m_ctpin[slot-7][conn] = inputs.get_optional<std::string>("ctpin.slot" + std::to_string(slot) + ".connector" + std::to_string(conn)).get_value_or("");
23  }
24  }
25  auto electrical = inputs.get_child("electrical");
26  for(size_t i=0; i<3; ++i) {
27  m_electrical[i] = electrical.get_optional<std::string>("connector" + std::to_string(i)).get_value_or("");
28  }
29  if(auto optical = inputs.get_child_optional("optical")) {
30  for(size_t i=0; i<12; ++i) {
31  m_optical[i] = optical->get_optional<std::string>("connector" + std::to_string(i)).get_value_or("");
32  }
33  }
34  for( auto & mon : data().get_child("monitoring.ctpmon") ) {
35  std::string monName = mon.first;
36  size_t multiplicity = mon.second.get_child("multiplicity").get_value<size_t>();
37  std::string thr = mon.second.get_child("thr").get_value<std::string>();
38  m_ctpmon.emplace( std::piecewise_construct,
39  std::forward_as_tuple(monName),
40  std::forward_as_tuple(multiplicity, thr)
41  );
42  }
43  auto ctpinMon = data().get_child_optional("monitoring.ctpin");
44  if(ctpinMon) {
45  for( auto & mon : *ctpinMon ) {
46  std::string monName = mon.first;
47  size_t multiplicity = mon.second.get_child("multiplicity").get_value<size_t>();
48  std::string thr = mon.second.get_child("thr").get_value<std::string>();
49  m_ctpinMon.emplace( std::piecewise_construct,
50  std::forward_as_tuple(monName),
51  std::forward_as_tuple(multiplicity, thr)
52  );
53  }
54  }
55 }
56 
57 void
59 {
60  m_ctpmon.clear();
61 }
62 
63 const std::string &
64 TrigConf::L1CTP::ctpin(size_t slot, size_t conn) const
65 {
66  if(slot<7 or slot>9) {
67  throw std::runtime_error("CTPIN slot must be between 7 and 9, but " + std::to_string(slot) + "was specified");
68  }
69  if(conn>3) {
70  throw std::runtime_error("CTPIN connector must be between 0 and 3, but " + std::to_string(conn) + "was specified");
71  }
72  return m_ctpin[slot-7][conn];
73 }
74 
75 
76 const std::string &
78  if(conn>2) {
79  throw std::runtime_error("Electrical connector must be between 0 and 2, but " + std::to_string(conn) + "was specified");
80  }
81  return m_electrical[conn];
82 }
83 
84 const std::string &
86  if(conn>11) {
87  throw std::runtime_error("Optical connector must be between 0 and 11, but " + std::to_string(conn) + "was specified");
88  }
89  return m_optical[conn];
90 }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
checkCorrelInHIST.conn
conn
Definition: checkCorrelInHIST.py:25
TrigConf::L1CTP::load
void load()
Definition: L1CTP.cxx:14
TrigConf::L1CTP::optical
const std::string & optical(size_t conn) const
Definition: L1CTP.cxx:85
TrigConf::L1CTP::L1CTP
L1CTP()=default
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
postInclude.inputs
inputs
Definition: postInclude.SortInput.py:15
TrigConf::L1CTP::clear
virtual void clear() override
Clearing the configuration data.
Definition: L1CTP.cxx:58
lumiFormat.i
int i
Definition: lumiFormat.py:92
L1CTP.h
TrigConf::name
Definition: HLTChainList.h:35
ptree
boost::property_tree::ptree ptree
Definition: JsonFileLoader.cxx:16
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
TrigConf::DataStructure
Base class for Trigger configuration data and wrapper around underlying representation.
Definition: DataStructure.h:37
TrigConf::L1CTP::ctpin
const std::string & ctpin(size_t slot, size_t conn) const
name of ctpin connector
Definition: L1CTP.cxx:64
plotBeamSpotMon.mon
mon
Definition: plotBeamSpotMon.py:67
TrigConf::L1CTP::electrical
const std::string & electrical(size_t conn) const
Definition: L1CTP.cxx:77