151 std::set<TgcChamber> to_ret{};
152 std::cout<<
"Read the Tgc geometry tree dump from "<<
inputFile<<std::endl;
155 std::cerr<<
"runTgcComparison() "<<__LINE__<<
": Failed to open "<<
inputFile<<std::endl;
160 std::cerr<<
"runTgcComparison() "<<__LINE__<<
": The file "<<
inputFile<<
" does not contain the 'TgcGeoModelTree'"<<std::endl;
164 TTreeReaderValue<unsigned short> stationIndex{
treeReader,
"stationIndex"};
167 TTreeReaderValue<std::string> stationDesign{
treeReader,
"stationDesign"};
168 TTreeReaderValue<uint8_t> nGasGaps{
treeReader,
"nGasGaps"};
170 TTreeReaderValue<float> shortWidth{
treeReader,
"ChamberWidthS"};
171 TTreeReaderValue<float> longWidth{
treeReader,
"ChamberWidthL"};
172 TTreeReaderValue<float> height{
treeReader,
"ChamberHeight"};
173 TTreeReaderValue<float> thickness{
treeReader,
"ChamberThickness"};
175 TTreeReaderValue<std::vector<float>> geoModelTransformX{
treeReader,
"GeoModelTransformX"};
176 TTreeReaderValue<std::vector<float>> geoModelTransformY{
treeReader,
"GeoModelTransformY"};
177 TTreeReaderValue<std::vector<float>> geoModelTransformZ{
treeReader,
"GeoModelTransformZ"};
179 TTreeReaderValue<std::vector<float>> alignableNodeX{
treeReader,
"AlignableNodeX"};
180 TTreeReaderValue<std::vector<float>> alignableNodeY{
treeReader,
"AlignableNodeY"};
181 TTreeReaderValue<std::vector<float>> alignableNodeZ{
treeReader,
"AlignableNodeZ"};
184 TTreeReaderValue<std::vector<float>> gangCenterX{
treeReader,
"gangCenterX"};
185 TTreeReaderValue<std::vector<float>> gangCenterY{
treeReader,
"gangCenterY"};
186 TTreeReaderValue<std::vector<float>> gangCenterZ{
treeReader,
"gangCenterZ"};
188 TTreeReaderValue<std::vector<float>> gangLocalPosX{
treeReader,
"gangLocalPosX"};
189 TTreeReaderValue<std::vector<float>> gangLocalPosY{
treeReader,
"gangLocalPosY"};
192 TTreeReaderValue<std::vector<float>> stripCenterX{
treeReader,
"stripCenterX"};
193 TTreeReaderValue<std::vector<float>> stripCenterY{
treeReader,
"stripCenterY"};
194 TTreeReaderValue<std::vector<float>> stripCenterZ{
treeReader,
"stripCenterZ"};
196 TTreeReaderValue<std::vector<float>> stripBottomX{
treeReader,
"stripBottomX"};
197 TTreeReaderValue<std::vector<float>> stripBottomY{
treeReader,
"stripBottomY"};
198 TTreeReaderValue<std::vector<float>> stripBottomZ{
treeReader,
"stripBottomZ"};
200 TTreeReaderValue<std::vector<float>> stripTopX{
treeReader,
"stripTopX"};
201 TTreeReaderValue<std::vector<float>> stripTopY{
treeReader,
"stripTopY"};
202 TTreeReaderValue<std::vector<float>> stripTopZ{
treeReader,
"stripTopZ"};
204 TTreeReaderValue<std::vector<float>> stripLocalCenterX{
treeReader,
"stripLocalCenterX"};
205 TTreeReaderValue<std::vector<float>> stripLocalCenterY{
treeReader,
"stripLocalCenterY"};
206 TTreeReaderValue<std::vector<float>> stripLocalBottomX{
treeReader,
"stripLocalBottomX"};
207 TTreeReaderValue<std::vector<float>> stripLocalBottomY{
treeReader,
"stripLocalBottomY"};
208 TTreeReaderValue<std::vector<float>> stripLocalTopX{
treeReader,
"stripLocalTopX"};
209 TTreeReaderValue<std::vector<float>> stripLocalTopY{
treeReader,
"stripLocalTopY"};
211 TTreeReaderValue<std::vector<uint8_t>> stripGasGap{
treeReader,
"stripGasGap"};
212 TTreeReaderValue<std::vector<unsigned int>> stripNum{
treeReader,
"stripNumber"};
215 TTreeReaderValue<std::vector<uint8_t>> gangGasGap{
treeReader,
"gangGasGap"};
216 TTreeReaderValue<std::vector<unsigned int>> gangNum{
treeReader,
"gangNumber"};
217 TTreeReaderValue<std::vector<uint8_t>> gangNumWires{
treeReader,
"gangNumWires"};
218 TTreeReaderValue<std::vector<float>> gangLength{
treeReader,
"gangLength"};
220 TTreeReaderValue<std::vector<float>> layerCol1X{
treeReader,
"layerLinearCol1X"};
221 TTreeReaderValue<std::vector<float>> layerCol1Y{
treeReader,
"layerLinearCol1Y"};
222 TTreeReaderValue<std::vector<float>> layerCol1Z{
treeReader,
"layerLinearCol1Z"};
224 TTreeReaderValue<std::vector<float>> layerCol2X{
treeReader,
"layerLinearCol2X"};
225 TTreeReaderValue<std::vector<float>> layerCol2Y{
treeReader,
"layerLinearCol2Y"};
226 TTreeReaderValue<std::vector<float>> layerCol2Z{
treeReader,
"layerLinearCol2Z"};
228 TTreeReaderValue<std::vector<float>> layerCol3X{
treeReader,
"layerLinearCol3X"};
229 TTreeReaderValue<std::vector<float>> layerCol3Y{
treeReader,
"layerLinearCol3Y"};
230 TTreeReaderValue<std::vector<float>> layerCol3Z{
treeReader,
"layerLinearCol3Z"};
232 TTreeReaderValue<std::vector<float>> layerTransX{
treeReader,
"layerTranslationX"};
233 TTreeReaderValue<std::vector<float>> layerTransY{
treeReader,
"layerTranslationY"};
234 TTreeReaderValue<std::vector<float>> layerTransZ{
treeReader,
"layerTranslationZ"};
236 TTreeReaderValue<std::vector<bool>> layerMeasPhi{
treeReader,
"layerMeasPhi"};
237 TTreeReaderValue<std::vector<uint8_t>> layerNumber{
treeReader,
"layerNumber"};
239 TTreeReaderValue<std::vector<float>> layShortWidth{
treeReader,
"layerWidthS"};
240 TTreeReaderValue<std::vector<float>> layLongWidth{
treeReader,
"layerWidthL"};
241 TTreeReaderValue<std::vector<float>> layHeight{
treeReader,
"layerHeight"};
242 TTreeReaderValue<std::vector<uint16_t>> layerNumWires{
treeReader,
"layerNumWires"};
247 newchamber.
stIdx = (*stationIndex);
248 newchamber.eta = (*stationEta);
249 newchamber.phi = (*stationPhi);
250 newchamber.techName = (*stationDesign);
251 newchamber.shortWidth = (*shortWidth);
252 newchamber.longWidth= (*longWidth);
253 newchamber.height = (*height);
254 newchamber.thickness = (*thickness);
255 newchamber.nGasGaps = (*nGasGaps);
256 Amg::Vector3D geoTrans{(*geoModelTransformX)[0], (*geoModelTransformY)[0], (*geoModelTransformZ)[0]};
258 geoRot.col(0) =
Amg::Vector3D((*geoModelTransformX)[1], (*geoModelTransformY)[1], (*geoModelTransformZ)[1]);
259 geoRot.col(1) =
Amg::Vector3D((*geoModelTransformX)[2], (*geoModelTransformY)[2], (*geoModelTransformZ)[2]);
260 geoRot.col(2) =
Amg::Vector3D((*geoModelTransformX)[3], (*geoModelTransformY)[3], (*geoModelTransformZ)[3]);
263 geoRot.col(0) =
Amg::Vector3D((*alignableNodeX)[1], (*alignableNodeY)[1], (*alignableNodeZ)[1]);
264 geoRot.col(1) =
Amg::Vector3D((*alignableNodeX)[2], (*alignableNodeY)[2], (*alignableNodeZ)[2]);
265 geoRot.col(2) =
Amg::Vector3D((*alignableNodeX)[3], (*alignableNodeY)[3], (*alignableNodeZ)[3]);
266 geoTrans =
Amg::Vector3D{(*alignableNodeX)[0], (*alignableNodeY)[0], (*alignableNodeZ)[0]};
270 for (
size_t g = 0;
g < gangGasGap->size(); ++
g) {
272 newGang.
gasGap = (*gangGasGap)[
g];
273 newGang.number = (*gangNum)[
g];
274 newGang.numWires =(*gangNumWires)[
g];
275 newGang.position =
Amg::Vector3D{(*gangCenterX)[
g], (*gangCenterY)[
g], (*gangCenterZ)[
g]};
276 newGang.localPos =
Amg::Vector2D{(*gangLocalPosX)[
g], (*gangLocalPosY)[
g]};
277 newGang.length = (*gangLength)[
g];
278 auto insert_itr = newchamber.etaWires.insert(std::move(newGang));
279 if (!insert_itr.second) {
280 std::stringstream
err{};
281 err<<
"runTgcComparison() "<<__LINE__<<
": The wire "<<(*insert_itr.first)
282 <<
" has already been inserted. "<<std::endl;
283 throw std::runtime_error(
err.str());
287 for (
size_t s = 0;
s < stripNum->size(); ++
s) {
289 strip.gasGap = (*stripGasGap)[
s];
290 strip.number = (*stripNum) [
s];
301 auto insert_itr = newchamber.strips.insert(std::move(strip));
302 if (!insert_itr.second) {
303 std::stringstream
err{};
304 err<<
"runTgcComparison() "<<__LINE__<<
": The strip "<<(*insert_itr.first)
305 <<
" has already been inserted. "<<std::endl;
306 throw std::runtime_error(
err.str());
309 for (
size_t l = 0 ;
l < layerMeasPhi->size(); ++
l) {
311 layRot.col(0) =
Amg::Vector3D{(*layerCol1X)[
l], (*layerCol1Y)[
l], (*layerCol1Z)[
l]};
312 layRot.col(1) =
Amg::Vector3D{(*layerCol2X)[
l], (*layerCol2Y)[
l], (*layerCol2Z)[
l]};
313 layRot.col(2) =
Amg::Vector3D{(*layerCol3X)[
l], (*layerCol3Y)[
l], (*layerCol3Z)[
l]};
317 layTrans.gasGap = (*layerNumber)[
l];
318 layTrans.measPhi = (*layerMeasPhi)[
l];
319 layTrans.shortWidth = (*layShortWidth)[
l];
320 layTrans.longWidth = (*layLongWidth)[
l];
321 layTrans.height = (*layHeight)[
l];
322 layTrans.numWires = (*layerNumWires)[
l];
323 auto insert_itr = newchamber.transforms.insert(std::move(layTrans));
324 if (!insert_itr.second) {
325 std::stringstream
err{};
326 err<<
"runTgcComparison() "<<__LINE__<<
": The layer transformation "<<(*insert_itr.first)
327 <<
" has already been inserted. "<<std::endl;
328 throw std::runtime_error(
err.str());
332 auto insert_itr = to_ret.insert(std::move(newchamber));
333 if (!insert_itr.second) {
334 std::stringstream
err{};
335 err<<
"runTgcComparison() "<<__LINE__<<
": The chamber "<<(*insert_itr.first)
336 <<
" has already been inserted. "<<std::endl;
337 throw std::runtime_error(
err.str());