Retrieve all the data.
41 {
42
43
45
46 SG::ReadHandle<Muon::sTgcPrepDataContainer> stgcContainer(
m_sgKey);
47
48 int ndata = 0;
49 for (const auto stgcCollection : *stgcContainer){
50 ndata += stgcCollection->size();
51 }
52
56 DataVect lengthVec; lengthVec.reserve(ndata);
57 DataVect swidthVec; swidthVec.reserve(ndata);
58 DataVect lwidthVec; lwidthVec.reserve(ndata);
59 DataVect idVec; idVec.reserve(ndata);
60 DataVect identifierVec; identifierVec.reserve(ndata);
62
63 for (const auto stgcCollection : *stgcContainer){
64 for (
const auto data : *stgcCollection){
65
66 const MuonGM::sTgcReadoutElement *element =
data->detectorElement();
67 Identifier
id =
data->identify();
68
69 if (!element) {
71 continue;
72 }
73
76 double shortWidth=0, longWidth=0,
length=0;
78 const Trk::PlaneSurface surface = element->
surface(
id);
81
86 shortWidth = (corners.at(1)-corners.at(0)).norm();
87 longWidth = (corners.at(3)-corners.at(2)).norm();
88
89 }
else if (
m_idHelperSvc->stgcIdHelper().channelType(
id)==1) {
90 const MuonGM::MuonChannelDesign* design = element->
getDesign(
id);
93 longWidth = shortWidth;
94
95 } else {
96 const MuonGM::MuonChannelDesign* design = element->
getDesign(
id);
97 if(!design) {
99 continue;
100 }
101
102
103 double fulllength = design->
xSize();
105 if (std::abs(locY) > 0.5 * design->
minYSize()) {
107 length = (0.5 * design->
maxYSize() - std::abs(locY)) / dY * fulllength;
108 if (std::abs(locY) > 873) {
110 }
112 }
113 else {
115 }
116
118 longWidth = shortWidth;
119 }
120
121 x.push_back(
DataType(globalPos.x()/CLHEP::cm));
122 y.push_back(
DataType(globalPos.y()/CLHEP::cm));
123 z.push_back(
DataType(globalPos.z()/CLHEP::cm));
124 swidthVec.push_back(
DataType(shortWidth/CLHEP::cm));
125 lwidthVec.push_back(
DataType(longWidth/CLHEP::cm));
128 idVec.push_back(
DataType(
id.get_compact() ));
130
131 }
132 }
133
138 myDataMap["length"] = lengthVec;
139 myDataMap["swidth"] = swidthVec;
140 myDataMap["lwidth"] = lwidthVec;
141 myDataMap["identifier"] = identifierVec;
142 myDataMap["id"] = idVec;
143 myDataMap[
"barcode"] =
barcode;
144
145
147
148
149
150
151 std::string emptyStr="";
153 }
constexpr std::array< T, N > make_array(const T &def_val)
Helper function to initialize in-place arrays with non-zero values.
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
virtual bool stripPosition(const Identifier &id, Amg::Vector2D &pos) const override final
strip position - should be renamed to channel position If the strip number is outside the range of va...
bool padCorners(const Identifier &id, std::array< Amg::Vector2D, 4 > &corners) const
pad corners
const MuonChannelDesign * getDesign(const Identifier &id) const
returns the MuonChannelDesign class for the given identifier
double channelPitch(const Identifier &id) const
Channel pitch.
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const override final
Specified for PlaneSurface: LocalToGlobal method without dynamic memory allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
std::string getFullID(Identifier id, const MdtIdHelper &mdtHelper)
Get the identifier string for an MDT ID with the sequence: Detector/StationName/StationEta/StationPhi...
std::map< std::string, DataVect > DataMap
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
double firstPos() const
Returns the position of the first strip along the x-axis.
double channelLength(int channel) const
STRIPS ONLY: calculate channel length for a given strip number.