ATLAS Offline Software
Loading...
Searching...
No Matches
MuonFixedIdPrinter.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <sstream>
8
9namespace MuonCalib {
10
12 MuonFixedIdManipulator::StationIndex stIndex = m_manipulator.stationLayerIndex(id);
13 return stationLayerIdentifier(stIndex);
14 }
15
17 std::string stName = "UnKnown";
18 if (stIndex == MuonFixedIdManipulator::BI)
19 stName = "BI";
20 else if (stIndex == MuonFixedIdManipulator::BM)
21 stName = "BM";
22 else if (stIndex == MuonFixedIdManipulator::BO)
23 stName = "BO";
24 else if (stIndex == MuonFixedIdManipulator::BE)
25 stName = "BE";
26 else if (stIndex == MuonFixedIdManipulator::EIA)
27 stName = "EIA";
28 else if (stIndex == MuonFixedIdManipulator::EMA)
29 stName = "EMA";
30 else if (stIndex == MuonFixedIdManipulator::EOA)
31 stName = "EOA";
32 else if (stIndex == MuonFixedIdManipulator::EEA)
33 stName = "EEA";
34 else if (stIndex == MuonFixedIdManipulator::EIC)
35 stName = "EIC";
36 else if (stIndex == MuonFixedIdManipulator::EMC)
37 stName = "EMC";
38 else if (stIndex == MuonFixedIdManipulator::EOC)
39 stName = "EOC";
40 else if (stIndex == MuonFixedIdManipulator::EEC)
41 stName = "EEC";
42 return stName;
43 }
44
46 std::ostringstream sout;
47 if (!id.isValid()) return " Invalid Identifier";
48 sout << id.technologyString() << " " << id.stationNameString() << " eta " << std::setw(2) << id.eta() << " phi " << std::setw(2)
49 << id.phi();
50 return sout.str();
51 }
52
54 std::ostringstream sout;
55 if (!id.isValid()) return " Invalid Identifier";
56 sout << stationIdentifier(id);
57 if (id.is_rpc()) sout << " doubR " << id.rpcDoubletR();
58
59 return sout.str();
60 }
61
63 std::ostringstream sout;
64 if (!id.isValid()) return " Invalid Identifier";
65 sout << chamberIdentifier(id);
66 if (id.is_rpc())
67 sout << " doubZ " << id.rpcDoubletZ() << " doubPhi " << id.rpcDoubletPhi();
68 else if (id.is_mdt())
69 sout << " ml " << id.mdtMultilayer();
70 return sout.str();
71 }
72
73 std::string MuonFixedIdPrinter::gasGapIdentifier(const MuonFixedId& id, bool includeMeasuresPhi) const {
74 if (!id.isValid()) return " Invalid Identifier";
75
76 std::ostringstream sout;
77 sout << moduleIdentifier(id);
78 bool measuresPhi = false;
79 if (id.is_rpc()) {
80 sout << " gap " << id.rpcGasGap();
81 measuresPhi = id.rpcMeasuresPhi();
82 } else if (id.is_tgc()) {
83 sout << " gap " << id.tgcGasGap();
84 measuresPhi = id.tgcIsStrip();
85 } else if (id.is_csc()) {
86 sout << " lay " << id.cscWireLayer();
87 measuresPhi = id.cscMeasuresPhi();
88 } else {
89 sout << " lay " << id.mdtTubeLayer() << " tube " << std::setw(2) << id.mdtTube();
90 }
91
92 if (measuresPhi && includeMeasuresPhi) sout << " measuresPhi";
93
94 return sout.str();
95 }
96
97 std::string MuonFixedIdPrinter::gasGapIdentifierForMap(const MuonFixedId& id, bool includeMeasuresPhi) const {
98 std::string st = id.stationNumberToFixedStationString(id.stationName());
99 std::ostringstream secondPart;
100 bool measuresPhi = false;
101 bool addSecondPart = false;
102 std::ostringstream station;
103 station << st << "_" << id.phi() << "_" << id.eta();
104 if (id.is_rpc()) {
105 int doublet = 2 * (id.rpcDoubletZ() - 1) + (id.rpcDoubletPhi() - 1);
106
107 if (id.rpcMeasuresPhi()) measuresPhi = true;
108 addSecondPart = true;
109 secondPart << "_d_" << doublet;
110
111 } else if (id.is_tgc()) {
112 if (id.tgcIsStrip()) measuresPhi = true;
113 addSecondPart = true;
114 secondPart << "_gg_" << id.tgcGasGap();
115
116 } else if (id.is_csc()) {
117 if (id.cscMeasuresPhi()) measuresPhi = true;
118 addSecondPart = true;
119 secondPart << "_wl_" << id.cscWireLayer();
120 }
121 std::string rst = station.str();
122 if (addSecondPart) { rst += secondPart.str(); }
123 if (includeMeasuresPhi) {
124 if (measuresPhi)
125 rst += "_phi";
126 else
127 rst += "_eta";
128 }
129 return rst;
130 }
131
132 std::string MuonFixedIdPrinter::fullIdentifier(const MuonFixedId& id) const {
133 std::ostringstream sout;
134 if (!id.isValid()) return " Invalid Identifier";
135 sout << gasGapIdentifier(id, false);
136 bool measuresPhi = m_manipulator.measuresPhi(id);
137 if (id.is_rpc())
138 sout << " strip " << std::setw(2) << id.rpcStrip();
139 else if (id.is_tgc())
140 sout << " strip " << std::setw(2) << id.tgcChannel();
141 else if (id.is_csc())
142 sout << " strip " << std::setw(2) << id.cscStrip();
143
144 if (measuresPhi) sout << " measuresPhi";
145
146 return sout.str();
147 }
148
149} // namespace MuonCalib
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
StationIndex
enum defining station layers
MuonFixedIdManipulator m_manipulator
std::string gasGapIdentifierForMap(const MuonFixedId &id, bool includeMeasuresPhi=false) const
print gapGap Id to be used in map
std::string fullIdentifier(const MuonFixedId &id) const
prints full Identifier for the give id
std::string moduleIdentifier(const MuonFixedId &id) const
prints layer Identifier for the give id MDT: station name/eta/phi/ml/lay RPC: station name/eta/phi/do...
std::string stationLayerIdentifier(const MuonFixedId &id) const
prints a station layer identifier for the give identifier
std::string chamberIdentifier(const MuonFixedId &id) const
prints chamber Identifier for the give id.
std::string stationIdentifier(const MuonFixedId &id) const
prints station Identifier for the give id MDT: station name (BMS)/eta/phi RPC: name of associated MDT...
std::string gasGapIdentifier(const MuonFixedId &id, bool includeMeasuresPhi=false) const
prints gas gap Identifier for the give id MDT: same as tube identifier RPC: station name/eta/phi/doub...
Implements fixed identifiers not dependent upon Athena Identifier for internal use in the calibration...
Definition MuonFixedId.h:50
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
const std::string & stName(StIndex index)
convert StIndex into a string