ATLAS Offline Software
Loading...
Searching...
No Matches
MdtRegionDefiner.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "MdtRegionDefiner.h"
6
7#include "MdtRegion.h"
11#include "src/MuonRoad.h"
13#include <algorithm>
14#include <cmath>
15
16// --------------------------------------------------------------------------------
17// --------------------------------------------------------------------------------
18
20{
21 ATH_CHECK(m_muDetMgrKey.initialize());
22 ATH_CHECK(m_idHelperSvc.retrieve());
23 return StatusCode::SUCCESS;
24}
25
26// --------------------------------------------------------------------------------
27// --------------------------------------------------------------------------------
28
30 const TrigL2MuonSA::RpcFitResult& rpcFitResult,
31 TrigL2MuonSA::MuonRoad& muonRoad,
32 TrigL2MuonSA::MdtRegion& mdtRegion) const
33{
34 mdtRegion.Clear();
35
37 const MuonGM::MuonDetectorManager* muDetMgr = muDetMgrHandle.cptr();
38
39 for(int i_station=0; i_station<6; i_station++) {
40 int chamber = 0;
41 if (i_station==0) chamber = xAOD::L2MuonParameters::Chamber::BarrelInner;
42 if (i_station==1) chamber = xAOD::L2MuonParameters::Chamber::BarrelMiddle;
43 if (i_station==2) chamber = xAOD::L2MuonParameters::Chamber::BarrelOuter;
44 if (i_station==3) chamber = xAOD::L2MuonParameters::Chamber::BME;
45 if (i_station==4) chamber = xAOD::L2MuonParameters::Chamber::EndcapInner;
46 if (i_station==5) chamber = xAOD::L2MuonParameters::Chamber::Backup; // BMG
47
48 for(int i_sector=0; i_sector<N_SECTOR; i_sector++) { // 0: normal, 1: overlap
49 const int sector = (i_sector == 0) ? muonRoad.MDT_sector_trigger : muonRoad.MDT_sector_overlap;
50 ATH_MSG_DEBUG("--- chamber/sector=" << chamber << "/" << sector);
51 if( sector==99 ) continue;
52
53 float zMin {0}, zMax {0}, rMin {0}, rMax {0};
54 float tmp_zMin {0}, tmp_zMax {0}, tmp_rMin {0}, tmp_rMax {0};
55 float etaMin {0}, etaMax {0}, phiMin {0}, phiMax {0};
56 int ty1 {-1}, ty2 {-1};
57 int sign = 1;
58
59 for(unsigned int sta_iter=0; sta_iter< muonRoad.stationList.size(); sta_iter++){
60
61 Identifier id = muonRoad.stationList[sta_iter];
62 int stationPhi = m_idHelperSvc->mdtIdHelper().stationPhi(id);
63 std::string name = m_idHelperSvc->mdtIdHelper().stationNameString(m_idHelperSvc->mdtIdHelper().stationName(id));
64 int chamber_this = 99;
65 int sector_this = 99;
66 bool isEndcap;
67 find_station_sector(name, stationPhi, isEndcap, chamber_this, sector_this);
68
69 if(chamber_this == chamber && sector_this == sector ){
70
71 if(ty1 == -1) ty1 = m_idHelperSvc->mdtIdHelper().stationNameIndex(name)+1;
72 else if(ty2 == -1) ty2 = m_idHelperSvc->mdtIdHelper().stationNameIndex(name)+1;
73
74 const MuonGM::MuonStation* muonStation = muDetMgr->getMdtReadoutElement(id)->parentMuonStation();
75 Amg::Transform3D trans =muonStation->getNominalAmdbLRSToGlobal();
76 Amg::Vector3D OrigOfMdtInAmdbFrame = muonStation->getBlineFixedPointInAmdbLRS() ;
77
79 tmp_zMin = (trans*OrigOfMdtInAmdbFrame).z();
80 if(tmp_zMin < 0) sign = -1;
81 else if(tmp_zMin > 0) sign = 1;
82 tmp_zMax = tmp_zMin + sign*muonStation->Zsize();
83 if(zMin==0 || tmp_zMin < zMin) zMin = tmp_zMin;
84 if(zMax==0 || tmp_zMax > zMax) zMax = tmp_zMax;
85 }else{
86 tmp_rMin = (trans*OrigOfMdtInAmdbFrame).perp();
87 tmp_rMax = tmp_rMin + muonStation->Rsize();
88 if(rMin==0 || tmp_rMin < rMin) rMin = tmp_rMin;
89 if(rMax==0 || tmp_rMax > rMax) rMax = tmp_rMax;
90 }
91 }
92 }
93
95 find_endcap_road_dim(muonRoad.rWidth[chamber][0],
96 muonRoad.aw[chamber][i_sector],
97 muonRoad.bw[chamber][i_sector],
98 zMin,zMax,
99 rMin,rMax);
100 } else {
101 find_barrel_road_dim(muonRoad.MaxWidth(chamber),
102 muonRoad.aw[chamber][i_sector],
103 muonRoad.bw[chamber][i_sector],
104 rMin, rMax,
105 zMin, zMax);
106 }
107
108 ATH_MSG_DEBUG("...zMin/zMax/ty1/ty2=" << zMin << "/" << zMax << "/" << ty1 << "/" << ty2);
109 ATH_MSG_DEBUG("...rMin/rMax=" << rMin << "/" << rMax);
110
111 find_eta_min_max(zMin, rMin, zMax, rMax, etaMin, etaMax);
112 find_phi_min_max(muonRoad.phiRoI, phiMin, phiMax);
113
114 ATH_MSG_DEBUG("...etaMin/etaMax/phiMin/phiMax=" << etaMin << "/" << etaMax << "/" << phiMin << "/" << phiMax);
115
116 mdtRegion.zMin[chamber][i_sector] = zMin;
117 mdtRegion.zMax[chamber][i_sector] = zMax;
118 mdtRegion.rMin[chamber][i_sector] = rMin;
119 mdtRegion.rMax[chamber][i_sector] = rMax;
120 mdtRegion.etaMin[chamber][i_sector] = etaMin;
121 mdtRegion.etaMax[chamber][i_sector] = etaMax;
122 mdtRegion.phiMin[chamber][i_sector] = phiMin;
123 mdtRegion.phiMax[chamber][i_sector] = phiMax;
124 for(int i_type=0; i_type<2; i_type++) {
125 int type = (i_type==0) ? ty1 : ty2;
126 if( type == -1 ) continue;
127 mdtRegion.chamberType[chamber][i_sector][i_type] = type;
128 }
129 }
130 }
131 // use phi from the fit. If InsideOut, use phi from the RoI
132 double phi = (m_use_rpc && rpcFitResult.isSuccess) ? rpcFitResult.phi : p_roids->phi();
133 for (int i=0; i<6; i++){
134 for (int j=0; j<N_SECTOR; j++){
135 if (i==4) muonRoad.phi[9][j] = phi;
136 else if (i==5) muonRoad.phi[10][j] = phi;
137 else muonRoad.phi[i][j] = phi;
138 }
139 }
140
141 return StatusCode::SUCCESS;
142}
143
144// --------------------------------------------------------------------------------
145// --------------------------------------------------------------------------------
146
148 const TrigL2MuonSA::TgcFitResult& tgcFitResult,
149 TrigL2MuonSA::MuonRoad& muonRoad,
150 TrigL2MuonSA::MdtRegion& mdtRegion) const
151{
152 mdtRegion.Clear();
153
154 int sectors[2];
155
156 sectors[0] = muonRoad.MDT_sector_trigger;
157 sectors[1] = muonRoad.MDT_sector_overlap;
158
162
164 const MuonGM::MuonDetectorManager* muDetMgr = muDetMgrHandle.cptr();
165
166 for(int i_station=0; i_station<7; i_station++) {
167 int chamber = 0;
168 if (i_station==0) chamber = xAOD::L2MuonParameters::Chamber::EndcapInner;
169 if (i_station==1) chamber = xAOD::L2MuonParameters::Chamber::EndcapMiddle;
170 if (i_station==2) chamber = xAOD::L2MuonParameters::Chamber::EndcapOuter;
171 if (i_station==3) chamber = xAOD::L2MuonParameters::Chamber::EndcapExtra;
172 if (i_station==4) chamber = xAOD::L2MuonParameters::Chamber::BarrelInner;
173 if (i_station==5) chamber = xAOD::L2MuonParameters::Chamber::BEE;
174 if (i_station==6) chamber = xAOD::L2MuonParameters::Chamber::Backup;
175 for(int i_sector=0; i_sector<2; i_sector++) { // 0: normal, 1: overlap
176 int sector = sectors[i_sector];
177 ATH_MSG_DEBUG("--- chamber/sector=" << chamber << "/" << sector);
178 if( sector==99 ) continue;
179 float zMin = 0;
180 float zMax = 0;
181 float rMin = 0;
182 float rMax = 0;
183 float etaMin = 0;
184 float etaMax = 0;
185 float phiMin = 0;
186 float phiMax = 0;
187 int types[2];
188 int& ty1 = types[0];
189 int& ty2 = types[1];
190 float sta_zMin = 0;
191 float sta_zMax = 0;
192
193 float tmp_zMin = 0;
194 float tmp_zMax = 0;
195 float tmp_rMin = 0;
196 float tmp_rMax = 0;
197 int sign = 1;
198 ty1 = -1;
199 ty2 = -1;
200
201 for(unsigned int sta_iter=0; sta_iter<muonRoad.stationList.size(); sta_iter++){
202 Identifier id = muonRoad.stationList[sta_iter];
203 int stationPhi = m_idHelperSvc->mdtIdHelper().stationPhi(id);
204 std::string name = m_idHelperSvc->mdtIdHelper().stationNameString(m_idHelperSvc->mdtIdHelper().stationName(id));
205 int chamber_this = 99;
206 int sector_this = 99;
207 bool isEndcap;
208 find_station_sector(name, stationPhi, isEndcap, chamber_this, sector_this);
209 ATH_MSG_DEBUG("name/stationPhi/isEndcap/chamber_this/sector_this=" <<
210 name << "/" << stationPhi << "/" << isEndcap << "/" << chamber_this << "/" << sector_this);
211
212 if(chamber_this == chamber && sector_this == sector){
213 if(ty1 == -1)
214 ty1 = m_idHelperSvc->mdtIdHelper().stationNameIndex(name)+1;
215 else if(ty2 == -1)
216 ty2 = m_idHelperSvc->mdtIdHelper().stationNameIndex(name)+1;
217
218 const MuonGM::MdtReadoutElement* mdtReadout = muDetMgr->getMdtReadoutElement(id);
219 const MuonGM::MuonStation* muonStation = mdtReadout->parentMuonStation();
220
221 float scale = 10.;
222
223 Amg::Transform3D trans = muonStation->getNominalAmdbLRSToGlobal();
224
225 Amg::Vector3D OrigOfMdtInAmdbFrame = muonStation->getBlineFixedPointInAmdbLRS();
226
227 tmp_zMin = (trans*OrigOfMdtInAmdbFrame).z();
228 if(tmp_zMin < 0) sign = -1;
229 else if(tmp_zMin > 0) sign = 1;
230 tmp_zMax = tmp_zMin + sign*muonStation->Zsize();
231
232 if(sta_zMin==0 || tmp_zMin<sta_zMin) sta_zMin = tmp_zMin;
233 if(sta_zMin==0 || tmp_zMax<sta_zMin) sta_zMin = tmp_zMax;
234 if(sta_zMax==0 || tmp_zMax>sta_zMax) sta_zMax = tmp_zMax;
235 if(sta_zMax==0 || tmp_zMin>sta_zMax) sta_zMax = tmp_zMin;
236
237 if (chamber_this==barrel_inner){//barrel inner
238 tmp_rMin = (trans*OrigOfMdtInAmdbFrame).perp()/scale;
239 tmp_rMax = tmp_rMin+muonStation->Rsize()/scale;
240 if(rMin==0 || tmp_rMin < rMin)rMin = tmp_rMin;
241 if(rMax==0 || tmp_rMax > rMax)rMax = tmp_rMax;
242 }
243
244 if (chamber_this==bee){//BEE
245 tmp_rMin = (trans*OrigOfMdtInAmdbFrame).perp()/scale;
246 tmp_rMax = tmp_rMin+muonStation->Rsize()/scale;
247 if(rMin==0 || tmp_rMin < rMin)rMin = tmp_rMin;
248 if(rMax==0 || tmp_rMax > rMax)rMax = tmp_rMax;
249 }
250
251 }
252 }
253
254 if (chamber==endcap_middle) { // endcap middle
255
256 if (tgcFitResult.isSuccess) { // TGC data is properly read
257 if (tgcFitResult.tgcMid1[3] < tgcFitResult.tgcMid2[3]) {
258 zMin = tgcFitResult.tgcMid1[3];
259 zMax = tgcFitResult.tgcMid2[3];
260 } else {
261 zMin = tgcFitResult.tgcMid2[3];
262 zMax = tgcFitResult.tgcMid1[3];
263 }
264
265 } else { // Failed to read TGC data
266
267 zMin = sta_zMin;
268 zMax = sta_zMax;
269 }
270 }
271 else if (chamber==barrel_inner || chamber==bee) { //barrel inner || BEE
272 float max_road = 50 /*muonRoad.MaxWidth(chamber)*/;
273 find_barrel_road_dim(max_road,
274 muonRoad.aw[chamber][i_sector],
275 muonRoad.bw[chamber][i_sector],
276 rMin,rMax,
277 zMin,zMax);
278 }else {// endcap inner,outer,ee
279
280 zMin = sta_zMin;
281 zMax = sta_zMax;
282 }
283
284 if (chamber!=barrel_inner && chamber!=bee){//Endcap chamber
285 find_endcap_road_dim(muonRoad.rWidth[chamber][0],
286 muonRoad.aw[chamber][i_sector],
287 muonRoad.bw[chamber][i_sector],
288 zMin,zMax,
289 rMin, rMax);
290 }
291
292 ATH_MSG_DEBUG("...zMin/zMax/ty1/ty2=" << zMin << "/" << zMax << "/" << types[0] << "/" << types[1]);
293 ATH_MSG_DEBUG("...rMin/rMax=" << rMin << "/" << rMax);
294
295 find_eta_min_max(zMin, rMin, zMax, rMax, etaMin, etaMax);
296
297 find_phi_min_max(muonRoad.phiRoI, phiMin, phiMax);
298
299 ATH_MSG_DEBUG("...etaMin/etaMax/phiMin/phiMax=" << etaMin << "/" << etaMax << "/" << phiMin << "/" << phiMax);
300
301 mdtRegion.zMin[chamber][i_sector] = zMin;
302 mdtRegion.zMax[chamber][i_sector] = zMax;
303 mdtRegion.rMin[chamber][i_sector] = rMin;
304 mdtRegion.rMax[chamber][i_sector] = rMax;
305 mdtRegion.etaMin[chamber][i_sector] = etaMin;
306 mdtRegion.etaMax[chamber][i_sector] = etaMax;
307 mdtRegion.phiMin[chamber][i_sector] = phiMin;
308 mdtRegion.phiMax[chamber][i_sector] = phiMax;
309 for(int i_type=0; i_type<2; i_type++) {
310 int type = types[i_type];
311 if( type == -1 ) continue;
312 mdtRegion.chamberType[chamber][i_sector][i_type] = type;
313 }
314 }
315 }
316
317 StatusCode sc = computePhi(p_roids, tgcFitResult, mdtRegion, muonRoad);
318 if (sc.isFailure()) {
319 ATH_MSG_ERROR("Error in comupting phi");
320 return sc;
321 }
322
323 return StatusCode::SUCCESS;
324}
325
326// --------------------------------------------------------------------------------
327// --------------------------------------------------------------------------------
328
329void TrigL2MuonSA::MdtRegionDefiner::find_station_sector(const std::string& name, int phi, bool& endcap,
330 int& chamber, int& sector)
331{
332 endcap = (name[0]=='E' || name[0]=='F' || (name[0]=='B' && name[1]=='E')) ? true : false;
333
334 int largeSmall=0;
335 if(name[2]=='S' || name[2]=='F' || name[2]=='G') largeSmall = 1;//Small
336 if (name[1]=='E' && name[2]=='E') largeSmall=1;//BEE
337 sector = (phi-1)*2 + largeSmall;
338 if (endcap){
339 if(name[1]=='I') //EI
340 chamber = 3;
341 if(name[1]=='M')
342 chamber = 4;
343 if(name[1]=='O')
344 chamber = 5;
345 if(name[1]=='E')
346 chamber = 6;
347 if(name[1]=='E' && name[2]=='E')//BEE
348 chamber = 8;
349 }else {
350 if(name[1]=='I')
351 chamber = 0;
352 if(name[1]=='M')
353 chamber = 1;
354 if(name[1]=='O')
355 chamber = 2;
356 if(name[1]=='M' && name[2]=='E')//BME
357 chamber = 9;
358 if(name[1]=='M' && name[2]=='G')//BMG
359 chamber = 10;
360 }
361}
362
363// --------------------------------------------------------------------------------
364// --------------------------------------------------------------------------------
365
366void TrigL2MuonSA::MdtRegionDefiner::find_phi_min_max(float phiMiddle, float& phiMin, float& phiMax) const
367{
368 phiMin = phiMiddle - 0.1;
369 phiMax = phiMiddle + 0.1;
370 if ( phiMin < -1.*M_PI ) phiMin += 2.*M_PI;
371 if ( phiMax > 1.*M_PI ) phiMax -= 2.*M_PI;
372}
373
374// --------------------------------------------------------------------------------
375// --------------------------------------------------------------------------------
376
377void TrigL2MuonSA::MdtRegionDefiner::find_eta_min_max(float zMin, float rMin, float zMax, float rMax,
378 float& etaMin, float& etaMax) const{
379 etaMin = 0.;
380 etaMax = 0.;
381
382 if(rMin > 0 && rMax > 0){
383 std::array<float,4> eta{};
384 float theta;
385
386 theta = (std::abs(zMin)>0.1)? std::atan(rMin/std::abs(zMin)): M_PI/2.;
387 eta[0] = (zMin>0.)? -std::log(std::tan(theta/2.)) : std::log(std::tan(theta/2.));
388
389 theta = (std::abs(zMax)>0.1)? std::atan(rMin/std::abs(zMax)): M_PI/2.;
390 eta[1] = (zMax>0.)? -std::log(std::tan(theta/2.)) : std::log(std::tan(theta/2.));
391
392 theta = (std::abs(zMax)>0.1)? std::atan(rMax/std::abs(zMax)): M_PI/2.;
393 eta[2] = (zMax>0.)? -std::log(std::tan(theta/2.)) : std::log(std::tan(theta/2.));
394
395 theta = (std::abs(zMin)>0.1)? std::atan(rMax/std::abs(zMin)): M_PI/2.;
396 eta[3] = (zMin>0.)? -std::log(std::tan(theta/2.)) : std::log(std::tan(theta/2.));
397
398 etaMin = *std::min_element(std::begin(eta), std::end(eta));
399 etaMax = *std::max_element(std::begin(eta), std::end(eta));
400
401 if (etaMin > etaMax) {
402 float tmp = etaMax;
403 etaMax = etaMin;
404 etaMin = tmp;
405 }
406 }
407}
408
409// --------------------------------------------------------------------------------
410// --------------------------------------------------------------------------------
411
412void TrigL2MuonSA::MdtRegionDefiner::find_barrel_road_dim(const float max_road, const float aw, const float bw,
413 const float rMin, const float rMax, float& zMin,float& zMax) const
414{
415 float ia,dz,z1,z2;
416
417 zMin = 9999.;
418 zMax = -9999.;
419
420 if(aw) {
421 ia = 1/aw;
422 } else {
423 ia = 0;
424 }
425
426 dz = max_road*std::sqrt(1.+ia*ia);
427 z1 = (ia)? (rMin-bw)*ia : bw;
428 z2 = (ia)? (rMax-bw)*ia : bw;
429
430 zMin = std::min({z1-dz, z1+dz, z2-dz, z2+dz});
431 zMax = std::max({z1-dz, z1+dz, z2-dz, z2+dz});
432}
433
434// --------------------------------------------------------------------------------
435// --------------------------------------------------------------------------------
436
437void TrigL2MuonSA::MdtRegionDefiner::find_endcap_road_dim(const float road,const float aw, const float bw, const float zMin,
438 const float zMax, float& rMin,float& rMax) const
439{
440 float r1{},r2{};
441
442 rMin = 999999.;
443 rMax = 0.;
444 if(zMin>=99999. && zMax<=-99999.){
445 rMin = 0.;
446 rMax = 0.;
447 return;
448 }
449
450 r1 = zMin*aw + bw;
451 r2 = zMax*aw + bw;
452 rMin = std::min({r1-road, r1+road, r2-road, r2+road});
453 rMax = std::max({r1-road, r1+road, r2-road, r2+road});
454
455 if(rMin<0.) rMin = 0.;
456 if(rMax<0.) rMax = 0.;
457}
458
459// --------------------------------------------------------------------------------
460// --------------------------------------------------------------------------------
461
463{
464 const double PHI_BOUNDARY = 0.2;
465
466 // loop over TGC digits.
467 unsigned int iHit;
468 for (iHit = 0; iHit < tgcHits.size(); iHit++)
469 {
470 // Get the digit point.
471 const TrigL2MuonSA::TgcHitData& hit = tgcHits[iHit];
472
473 // reject width=0 hits
474 const double ZERO_LIMIT = 1e-5;
475 if( std::abs(hit.width) < ZERO_LIMIT ) continue;
476
477 double w = 12.0 / hit.width / hit.width;
478 if (hit.isStrip)
479 {
480 w *= hit.r * hit.r;
481 double phi = hit.phi;
482 if( phi < 0 && ( (M_PI+phi)<PHI_BOUNDARY) ) phi += M_PI*2;
483 if ( hit.sta < 3 ) { m_tgcStripMidPoints.push_back(TgcFit::Point(iHit + 1, hit.sta, hit.z, phi, w)); }
484 else if ( hit.sta ==3 ) { m_tgcStripInnPoints.push_back(TgcFit::Point(iHit + 1, hit.sta, hit.z, phi, w)); }
485 }
486 else
487 {
488 if ( hit.sta < 3 ) { m_tgcWireMidPoints.push_back(TgcFit::Point(iHit + 1, hit.sta, hit.z, hit.r, w)); }
489 else if ( hit.sta ==3 ) { m_tgcWireInnPoints.push_back(TgcFit::Point(iHit + 1, hit.sta, hit.z, hit.r, w)); }
490 }
491 }
492
493 return StatusCode::SUCCESS;
494
495}
496
497// --------------------------------------------------------------------------------
498// --------------------------------------------------------------------------------
499
501 const TrigL2MuonSA::TgcFitResult& tgcFitResult,
502 const TrigL2MuonSA::MdtRegion& mdtRegion,
503 TrigL2MuonSA::MuonRoad& muonRoad) const
504{
509
510 for(int i_station=0; i_station<5; i_station++) {
511 int chamber = 0;
512 if (i_station==0) chamber = xAOD::L2MuonParameters::Chamber::EndcapInner;
513 if (i_station==1) chamber = xAOD::L2MuonParameters::Chamber::EndcapMiddle;
514 if (i_station==2) chamber = xAOD::L2MuonParameters::Chamber::EndcapOuter;
515 if (i_station==3) chamber = xAOD::L2MuonParameters::Chamber::EndcapExtra;
516 if (i_station==4) chamber = xAOD::L2MuonParameters::Chamber::BarrelInner;
517 for( int i_sector=0; i_sector<2; i_sector++) {
518
519 if ( tgcFitResult.isSuccess ) {
520 if (chamber==endcap_middle || !tgcFitResult.isPhiDir) {
521 muonRoad.phi[chamber][i_sector] = tgcFitResult.phi;
522 continue;
523 }
524
525 muonRoad.phi[chamber][i_sector] = 0.;
526 double dz = 0.;
527
528 if (chamber==endcap_outer) {
529
530 double MiddleZ = std::abs(mdtRegion.zMin[endcap_middle][i_sector] + mdtRegion.zMax[endcap_middle][i_sector])/2.;
531 double MiddleR = MiddleZ*muonRoad.aw[endcap_middle][i_sector] + muonRoad.bw[endcap_middle][i_sector];
532
533 double OuterZ = std::abs(mdtRegion.zMin[endcap_outer][i_sector] + mdtRegion.zMax[endcap_outer][i_sector])/2.;
534 double OuterR = OuterZ*muonRoad.aw[endcap_outer][i_sector] + muonRoad.bw[endcap_outer][i_sector];
535 double DrOuter = std::abs(OuterR-MiddleR);
536 dz = std::sqrt((OuterZ-MiddleZ)*(OuterZ-MiddleZ) + DrOuter*DrOuter);
537 dz = (OuterZ-MiddleZ);
538
539 } if (chamber==endcap_inner || chamber==barrel_inner) {
540
541 double MiddleZ = 0;
542 double MiddleR = 0;
543
544 if(tgcFitResult.tgcInn[2] != 0.) {
545 muonRoad.phi[chamber][i_sector] = tgcFitResult.tgcInn[1];
546 continue;
547 }
548 double InnerZ = std::abs(mdtRegion.zMin[endcap_inner][i_sector] + mdtRegion.zMax[endcap_inner][i_sector])/2.;
549 double InnerR = InnerZ*muonRoad.aw[endcap_inner][i_sector] + muonRoad.bw[endcap_inner][i_sector];
550 double DrInner = std::abs(InnerR-MiddleR);
551 dz = -std::sqrt((InnerZ-MiddleZ)*(InnerZ-MiddleZ) + DrInner*DrInner);
552 dz = -std::abs(InnerZ-MiddleZ);
553 }
554
555 muonRoad.phi[chamber][i_sector] = (dz)* tgcFitResult.dPhidZ + tgcFitResult.phi;
556 while (muonRoad.phi[chamber][i_sector] > M_PI) muonRoad.phi[chamber][i_sector] -= 2*M_PI;
557 while (muonRoad.phi[chamber][i_sector] <-M_PI) muonRoad.phi[chamber][i_sector] += 2*M_PI;
558
559 } else {
560 // TGC data is not read -> use RoI
561 muonRoad.phi[chamber][i_sector] = p_roids->phi();
562 }
563 }
564 }
565 return StatusCode::SUCCESS;
566}
#define M_PI
Scalar eta() const
pseudorapidity method
Scalar perp() const
perp method - perpendicular length
Scalar phi() const
phi method
Scalar theta() const
theta method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
static const std::vector< std::string > types
int sign(int a)
#define z
const float ZERO_LIMIT
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
double Zsize() const
const Amg::Transform3D & getNominalAmdbLRSToGlobal() const
const Amg::Vector3D & getBlineFixedPointInAmdbLRS() const
double Rsize() const
virtual double phi() const override final
Methods to retrieve data members.
const_pointer_type cptr()
StatusCode prepareTgcPoints(const TrigL2MuonSA::TgcHits &tgcHits)
StatusCode computePhi(const TrigRoiDescriptor *p_roids, const TrigL2MuonSA::TgcFitResult &tgcFitResult, const TrigL2MuonSA::MdtRegion &mdtRegion, TrigL2MuonSA::MuonRoad &muonRoad) const
void find_phi_min_max(float phiMiddle, float &phiMin, float &phiMax) const
virtual StatusCode initialize() override
StatusCode getMdtRegions(const TrigRoiDescriptor *p_roids, const TrigL2MuonSA::RpcFitResult &rpcFitResult, TrigL2MuonSA::MuonRoad &muonRoad, TrigL2MuonSA::MdtRegion &mdtRegion) const
void find_barrel_road_dim(const float max_road, const float aw, const float bw, const float rMmin, const float rMax, float &zMin, float &zMax) const
static void find_station_sector(const std::string &name, int phi, bool &endcap, int &chamber, int &sector)
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_muDetMgrKey
TrigL2MuonSA::TgcFit::PointArray m_tgcStripMidPoints
void find_endcap_road_dim(const float road, const float aw, const float bw, const float zMin, const float zMax, float &rMin, float &rMax) const
TrigL2MuonSA::TgcFit::PointArray m_tgcWireMidPoints
void find_eta_min_max(float zMin, float rMin, float zMax, float rMax, float &etaMin, float &etaMax) const
TrigL2MuonSA::TgcFit::PointArray m_tgcWireInnPoints
TrigL2MuonSA::TgcFit::PointArray m_tgcStripInnPoints
double phiMin[N_STATION][N_SECTOR]
Definition MdtRegion.h:43
double zMin[N_STATION][N_SECTOR]
Definition MdtRegion.h:37
double rMin[N_STATION][N_SECTOR]
Definition MdtRegion.h:39
double zMax[N_STATION][N_SECTOR]
Definition MdtRegion.h:38
double etaMax[N_STATION][N_SECTOR]
Definition MdtRegion.h:42
double phiMax[N_STATION][N_SECTOR]
Definition MdtRegion.h:44
double etaMin[N_STATION][N_SECTOR]
Definition MdtRegion.h:41
int chamberType[N_STATION][N_SECTOR][2]
Definition MdtRegion.h:45
double rMax[N_STATION][N_SECTOR]
Definition MdtRegion.h:40
std::vector< Identifier > stationList
Definition MuonRoad.h:102
double aw[N_STATION][N_SECTOR]
Definition MuonRoad.h:83
double MaxWidth(int i_station)
Definition MuonRoad.h:60
double bw[N_STATION][N_SECTOR]
Definition MuonRoad.h:84
double phi[N_STATION][N_SECTOR]
Definition MuonRoad.h:85
double rWidth[N_STATION][N_LAYER]
Definition MuonRoad.h:86
nope - should be used for standalone also, perhaps need to protect the class def bits ifndef XAOD_ANA...
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
std::vector< TgcHitData > TgcHits
Definition TgcData.h:43
constexpr int N_SECTOR
Definition MuonRoad.h:16
@ BarrelInner
Inner station in the barrel spectrometer.
@ EndcapOuter
Outer station in the endcap spectrometer.
@ BarrelMiddle
Middle station in the barrel spectrometer.
@ EndcapMiddle
Middle station in the endcap spectrometer.
@ BEE
BEE measurement point.
@ EndcapExtra
Extra station in the endcap spectrometer.
@ BarrelOuter
Outer station in the barrel spectrometer.
@ BME
BME measurement point.
@ EndcapInner
Inner station in the endcap spectrometer.