File indexing completed on 2023-03-17 10:47:25
0001 #include "CondFormats/RPCObjects/interface/ChamberLocationSpec.h"
0002 #include <sstream>
0003
0004 std::string ChamberLocationSpec::print(int depth) const {
0005 std::ostringstream str;
0006 std::string subsVal[5] = {"--", "-", "0", "+", "++"};
0007 std::string febZVal[3] = {"-z", "+z"};
0008 std::string febZRVal[3] = {"N/A", "IN", "OUT"};
0009 std::string boeVal[2] = {"Endcap", "Barrel"};
0010 if (depth >= 0) {
0011 str << " ChamberLocationSpec: " << std::endl
0012 << " --->DiskOrWheel: " << diskOrWheel << " Layer: " << layer << " Sector: " << sector
0013 << " Subsector: " << subsVal[subsector + 2] << " ChamberLocationName: " << chamberLocationName()
0014 << " FebZOrnt: " << febZVal[int(febZOrnt)] << " FebZRadOrnt: " << febZRVal[int(febZRadOrnt)]
0015 << " BarrelOrEndcap: " << boeVal[int(barrelOrEndcap)];
0016 }
0017 return str.str();
0018 }
0019
0020 std::string ChamberLocationSpec::chamberLocationName() const {
0021 std::ostringstream ocln;
0022 std::string cln;
0023 if (barrelOrEndcap == 1) {
0024 std::string layerVal[6] = {"RB1in", "RB1out", "RB2in", "RB2out", "RB3", "RB4"};
0025 std::string prefix = "W";
0026 if (diskOrWheel > 0)
0027 prefix = "W+";
0028 std::string subsVal[5] = {"--", "-", "", "+", "++"};
0029 ocln << prefix << diskOrWheel << "/" << layerVal[layer - 1] << "/" << sector << subsVal[subsector + 2];
0030 } else {
0031 std::string prefix = "RE";
0032 if (diskOrWheel > 0)
0033 prefix = "RE+";
0034 ocln << prefix << diskOrWheel << "/" << layer << "/" << sector;
0035 }
0036 cln = ocln.str();
0037 return cln;
0038 }