ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1MUCTPIPHASE1::OverlapHelper Class Reference
Collaboration diagram for LVL1MUCTPIPHASE1::OverlapHelper:

Public Member Functions

std::string make_key (std::string prefix, int global_sec, int roi)
std::string make_pair (const std::string &lhs, const std::string &rhs) const
void create_indices ()
std::vector< std::string > get_lhs_keys (const std::string &dettype, int roi, int sector) const
std::vector< std::string > get_rhs_keys (const std::string &dettype, int roi, int sector) const
std::vector< std::string > relevant_regions (int side, const std::string &dettype, int roi, int sector) const
void configure (const std::string &lutFile)

Public Attributes

MuctpiXMLHelper xmlHelper
std::map< int, std::set< std::string > > global_pairs
std::array< std::map< std::string, std::vector< std::string > >, 2 > lhs_index
std::array< std::map< std::string, std::vector< std::string > >, 2 > rhs_index

Detailed Description

Definition at line 68 of file MuonSectorProcessor.cxx.

Member Function Documentation

◆ configure()

void LVL1MUCTPIPHASE1::OverlapHelper::configure ( const std::string & lutFile)
inline

Definition at line 132 of file MuonSectorProcessor.cxx.

133 {
135 read_xml(lutFile, inputTree);
136
137 boost::property_tree::ptree topEle = inputTree.get_child("MUCTPI_LUT");
138
139 // iterate through elements of the XML
140 for(const boost::property_tree::ptree::value_type &x: topEle) {
141
142 std::string topElementName = x.first;
143 ptree lut = x.second;
144
145 if (topElementName != "LUT") continue;
146
147 std::string SectorId1 = xmlHelper.getAttribute(lut,"SectorId1");
148 std::string SectorId2 = xmlHelper.getAttribute(lut,"SectorId2");
149
150 unsigned left_mod = 32;
151 unsigned right_mod = 32;
152 if (SectorId1[0] == 'E') left_mod = 48;
153 if (SectorId1[0] == 'F') left_mod = 24;
154 if (SectorId2[0] == 'E') right_mod = 48;
155 if (SectorId2[0] == 'F') right_mod = 24;
156
157 std::string snum_left = std::string(1,SectorId1[1])+std::string(1,SectorId1[2]);
158 int sec_left = std::stoi(snum_left) % left_mod;
159
160 std::string snum_right = std::string(1,SectorId2[1])+std::string(1,SectorId2[2]);
161 int sec_right = std::stoi(snum_right) % right_mod;
162
163 std::string side = xmlHelper.getAttribute(lut,"Side");
164 int active_side = (side == "C") ? 0 : 1;
165
166 std::string System1 = SectorId1.substr(0,1);
167 std::string System2 = SectorId2.substr(0,1);
168
169 for(const boost::property_tree::ptree::value_type &z: lut) {
170 std::string menuElementName = z.first;
171 if(menuElementName!="Element" && menuElementName!="BBElement")continue;
172 ptree ele = z.second;
173 auto roi1 = xmlHelper.getIntAttribute(ele, "RoI1");
174 auto roi2 = xmlHelper.getIntAttribute(ele, "RoI2");
175 auto lhs_key = make_key(System1,sec_left,roi1);
176 auto rhs_key = make_key(System2,sec_right,roi2);
177 auto region = make_pair(lhs_key,rhs_key);
178 global_pairs[active_side].insert(std::move(region));
179 }
180 }
182 }
boost::property_tree::ptree ptree
#define x
#define z
std::string make_key(std::string prefix, int global_sec, int roi)
std::map< int, std::set< std::string > > global_pairs
std::string make_pair(const std::string &lhs, const std::string &rhs) const
constexpr auto lut(Generator &&f)

◆ create_indices()

void LVL1MUCTPIPHASE1::OverlapHelper::create_indices ( )
inline

Definition at line 87 of file MuonSectorProcessor.cxx.

87 {
88 for(const auto& side_regions : global_pairs ){
89 for(const auto& region : side_regions.second){
90 auto split = region.find(':');
91 auto left = region.substr(0,split);
92 auto right = region.substr(split+1,std::string::npos);
93 lhs_index[side_regions.first][left].push_back(right);
94 rhs_index[side_regions.first][right].push_back(std::move(left));
95 }
96 }
97 }
std::array< std::map< std::string, std::vector< std::string > >, 2 > rhs_index
std::array< std::map< std::string, std::vector< std::string > >, 2 > lhs_index
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177

◆ get_lhs_keys()

std::vector< std::string > LVL1MUCTPIPHASE1::OverlapHelper::get_lhs_keys ( const std::string & dettype,
int roi,
int sector ) const
inline

Definition at line 99 of file MuonSectorProcessor.cxx.

99 {
100 std::vector<std::string> r;
101 r.push_back(dettype + std::to_string(sector) + "_" + std::to_string(roi));
102 return r;
103 }
int r
Definition globals.cxx:22

◆ get_rhs_keys()

std::vector< std::string > LVL1MUCTPIPHASE1::OverlapHelper::get_rhs_keys ( const std::string & dettype,
int roi,
int sector ) const
inline

Definition at line 105 of file MuonSectorProcessor.cxx.

105 {
106 std::vector<std::string> r;
107 r.push_back(dettype + std::to_string(sector) + "_" + std::to_string(roi));
108 return r;
109 }

◆ make_key()

std::string LVL1MUCTPIPHASE1::OverlapHelper::make_key ( std::string prefix,
int global_sec,
int roi )
inline

Definition at line 77 of file MuonSectorProcessor.cxx.

77 {
78 prefix += std::to_string(global_sec) + "_" + std::to_string(roi);
79 return prefix;
80 }

◆ make_pair()

std::string LVL1MUCTPIPHASE1::OverlapHelper::make_pair ( const std::string & lhs,
const std::string & rhs ) const
inline

Definition at line 82 of file MuonSectorProcessor.cxx.

82 {
83 return lhs + ":" + rhs;
84 }

◆ relevant_regions()

std::vector< std::string > LVL1MUCTPIPHASE1::OverlapHelper::relevant_regions ( int side,
const std::string & dettype,
int roi,
int sector ) const
inline

Definition at line 111 of file MuonSectorProcessor.cxx.

111 {
112 std::vector<std::string> r;
113 for(const auto& key : get_lhs_keys(dettype,roi,sector)){
114 auto x = lhs_index[side].find(key);
115 if(x != lhs_index[side].end()){
116 for(const auto& rr : x->second){
117 r.push_back(make_pair(key,rr));
118 }
119 }
120 }
121 for(const auto& key : get_rhs_keys(dettype,roi,sector)){
122 auto x = rhs_index[side].find(key);
123 if(x != rhs_index[side].end()){
124 for(const auto& rr : x->second){
125 r.push_back(make_pair(rr,key));
126 }
127 }
128 }
129 return r;
130 }
const boost::regex rr(r_r)
std::vector< std::string > get_rhs_keys(const std::string &dettype, int roi, int sector) const
std::vector< std::string > get_lhs_keys(const std::string &dettype, int roi, int sector) const

Member Data Documentation

◆ global_pairs

std::map<int,std::set<std::string> > LVL1MUCTPIPHASE1::OverlapHelper::global_pairs

Definition at line 72 of file MuonSectorProcessor.cxx.

◆ lhs_index

std::array<std::map<std::string,std::vector<std::string> >,2> LVL1MUCTPIPHASE1::OverlapHelper::lhs_index

Definition at line 74 of file MuonSectorProcessor.cxx.

◆ rhs_index

std::array<std::map<std::string,std::vector<std::string> >,2> LVL1MUCTPIPHASE1::OverlapHelper::rhs_index

Definition at line 75 of file MuonSectorProcessor.cxx.

◆ xmlHelper

MuctpiXMLHelper LVL1MUCTPIPHASE1::OverlapHelper::xmlHelper

Definition at line 71 of file MuonSectorProcessor.cxx.


The documentation for this class was generated from the following file: