Retrieve all the data.
37 {
38
39
41
42
43 SG::ReadHandle<RpcPadContainer> rdoContainer(
m_sgKey);
44
45 int ndata=0;
46 for (auto containerIt=rdoContainer->begin(); containerIt!=rdoContainer->end(); ++containerIt) {
47 ndata += (*containerIt)->size();
48 }
49
50
54 DataVect lengthVec; lengthVec.reserve(ndata);
55 DataVect widthVec; widthVec.reserve(ndata);
56 DataVect idVec; idVec.reserve(ndata);
57 DataVect identifierVec; identifierVec.reserve(ndata);
59
60 int ipad = 0 ;
62 double time1 = 0. ;
63
65 const MuonGM::MuonDetectorManager* MuonDetMgr = DetectorManagerHandle.
cptr();
66 if(!MuonDetMgr){
67 ATH_MSG_ERROR(
"Null pointer to the read MuonDetectorManager conditions object");
68 return StatusCode::FAILURE;
69 }
70
71
72
73 SG::ReadCondHandle<RpcCablingCondData> readHandle{
m_rpcCab, Gaudi::Hive::currentContext()};
74 const RpcCablingCondData* rpcCabling{*readHandle};
75
76 for (auto itColl=rdoContainer->begin(); itColl!=rdoContainer->end(); ++itColl) {
77 if ( itColl->size() == 0 ) continue;
78
79 ipad++;
81
83 uint16_t sectorId = itColl->sector() ;
84
85
88 for (; itCM != itCM_e ; ++itCM) {
89
90 uint16_t cmaId = (*itCM)->onlineId();
91
92
95 for (; itD != itD_e ; ++itD) {
96 const RpcFiredChannel * rpcChan = (*itD);
98 " sectorId " << sectorId <<
99 " padId " << padId <<
100 " cmId " << cmaId <<
101 " bcid " << rpcChan->
bcid() <<
102 " time " << rpcChan->
time() <<
103 " ijk " << rpcChan->
ijk() <<
105
106 if(rpcChan->
ijk()==6){
107
110 int idata1 = 0;
111 for (; itD1 != itD_e1 ; ++itD1) {
112
113 const RpcFiredChannel * rpcChan1 = (*itD1);
114 if( rpcChan1->
ijk() > 1 && rpcChan1->
ijk() <6){
115
116
117 if(idata1==0){
118 std::vector<Identifier> digitVec{
m_rpcDecoder->getOfflineData(rpcChan, sectorId, padId, cmaId, time, rpcCabling)};
119
122
123
127 std::list<Identifier>::const_iterator it_list;
128 for (it_list=stripList.begin() ; it_list != stripList.end() ; ++it_list) {
129 Identifier stripOfflineId = *it_list;
131
133 char ChID[100];
134 snprintf(ChID, 100, "SL%d-Pad%d-CM%d-ijk%d-ch%d-time%d",sectorId,padId,cmaId,
136
138 int measuresPhi =
m_idHelperSvc->rpcIdHelper().measuresPhi(stripOfflineId);
139 double stripLength = element->
StripLength(measuresPhi);
140 double stripWidth = element->
StripWidth(measuresPhi);
141
142 x.push_back(
DataType(globalPos.x()/CLHEP::cm));
143 y.push_back(
DataType(globalPos.y()/CLHEP::cm));
144 z.push_back(
DataType(globalPos.z()/CLHEP::cm));
145 lengthVec.push_back(
DataType(stripLength/CLHEP::cm));
146 widthVec.push_back(
DataType(stripWidth/CLHEP::cm));
147 identifierVec.push_back(
DataType(ChID));
150 }
151 }
152 idata1++;
153
155 " sectorId1 " << sectorId <<
156 " padId1 " << padId <<
157 " cmId1 " << cmaId <<
158 " bcid1 " << rpcChan1->
bcid() <<
159 " time1 " << rpcChan1->
time() <<
160 " ijk1 " << rpcChan1->
ijk() <<
161 " ch1 " << rpcChan1->
channel());
162
163
164 std::vector<Identifier> digitVec1{
m_rpcDecoder->getOfflineData(rpcChan1, sectorId, padId, cmaId, time1, rpcCabling)};
165
166
168
169
173 std::list<Identifier>::const_iterator it_list1;
174 for (it_list1=stripList1.begin() ; it_list1 != stripList1.end() ; ++it_list1) {
175 Identifier stripOfflineId1 = *it_list1;
177
179
180 char ChID1[100];
181 snprintf(ChID1,100, "SL%d-Pad%d-CM%d-ijk%d-ch%d-time%d",sectorId,padId,cmaId,
183
185 int measuresPhi1 =
m_idHelperSvc->rpcIdHelper().measuresPhi(stripOfflineId1);
186 double stripLength1 = element1->
StripLength(measuresPhi1);
187 double stripWidth1 = element1->
StripWidth(measuresPhi1);
188
189 x.push_back(
DataType(globalPos1.x()/CLHEP::cm));
190 y.push_back(
DataType(globalPos1.y()/CLHEP::cm));
191 z.push_back(
DataType(globalPos1.z()/CLHEP::cm));
192 lengthVec.push_back(
DataType(stripLength1/CLHEP::cm));
193 widthVec.push_back(
DataType(stripWidth1/CLHEP::cm));
194 identifierVec.push_back(
DataType(ChID1));
197 }
198 }
199 }
200 }
201
202 }
203 }
204 }
205
210 myDataMap["length"] = lengthVec;
211 myDataMap["width"] = widthVec;
212 myDataMap["identifier"] = identifierVec;
213 myDataMap["id"] = idVec;
214 myDataMap[
"barcode"] =
barcode;
215
216
218
219
221 }
DataModel_detail::const_iterator< DataVector > const_iterator
virtual std::string dataTypeName() const
Return the name of the data type.
SG::ReadHandleKey< RpcPadContainer > m_sgKey
const RpcReadoutElement * getRpcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
double StripLength(bool measphi) const
returns the strip length for the phi or eta plane
Amg::Vector3D stripPos(const Identifier &id) const
double StripWidth(bool measphi) const
returns the strip width for the phi or eta plane
std::list< Identifier > give_strip_id(unsigned short int SubsystemId, unsigned short int SectorId, unsigned short int PADId, unsigned short int CMAId, unsigned short ijk, unsigned short int Channel, const RpcIdHelper *rpcId) const
const_pointer_type cptr()
Eigen::Matrix< double, 3, 1 > Vector3D
time(flags, cells_name, *args, **kw)
std::map< std::string, DataVect > DataMap
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.