ATLAS Offline Software
Loading...
Searching...
No Matches
TrigL2MuonSA::MdtRegionDefiner Class Reference

#include <MdtRegionDefiner.h>

Inheritance diagram for TrigL2MuonSA::MdtRegionDefiner:
Collaboration diagram for TrigL2MuonSA::MdtRegionDefiner:

Public Member Functions

virtual StatusCode initialize () override
void setRpcGeometry (bool use_rpc)
StatusCode getMdtRegions (const TrigRoiDescriptor *p_roids, const TrigL2MuonSA::RpcFitResult &rpcFitResult, TrigL2MuonSA::MuonRoad &muonRoad, TrigL2MuonSA::MdtRegion &mdtRegion) const
StatusCode getMdtRegions (const TrigRoiDescriptor *p_roids, const TrigL2MuonSA::TgcFitResult &tgcFitResult, TrigL2MuonSA::MuonRoad &muonRoad, TrigL2MuonSA::MdtRegion &mdtRegion) const
 AthAlgTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor with parameters:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static void find_station_sector (const std::string &name, int phi, bool &endcap, int &chamber, int &sector)

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode prepareTgcPoints (const TrigL2MuonSA::TgcHits &tgcHits)
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
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
void find_eta_min_max (float zMin, float rMin, float zMax, float rMax, float &etaMin, float &etaMax) const
void find_phi_min_max (float phiMiddle, float &phiMin, float &phiMax) const
StatusCode computePhi (const TrigRoiDescriptor *p_roids, const TrigL2MuonSA::TgcFitResult &tgcFitResult, const TrigL2MuonSA::MdtRegion &mdtRegion, TrigL2MuonSA::MuonRoad &muonRoad) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_muDetMgrKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}
bool m_use_rpc {true}
TrigL2MuonSA::TgcFit::PointArray m_tgcStripMidPoints
TrigL2MuonSA::TgcFit::PointArray m_tgcWireMidPoints
TrigL2MuonSA::TgcFit::PointArray m_tgcStripInnPoints
TrigL2MuonSA::TgcFit::PointArray m_tgcWireInnPoints
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 37 of file MdtRegionDefiner.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ AthAlgTool()

AthAlgTool::AthAlgTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Constructor with parameters:

Definition at line 31 of file AthAlgTool.cxx.

◆ computePhi()

StatusCode TrigL2MuonSA::MdtRegionDefiner::computePhi ( const TrigRoiDescriptor * p_roids,
const TrigL2MuonSA::TgcFitResult & tgcFitResult,
const TrigL2MuonSA::MdtRegion & mdtRegion,
TrigL2MuonSA::MuonRoad & muonRoad ) const
private

Definition at line 500 of file MdtRegionDefiner.cxx.

504{
509
510 for(int i_station=0; i_station<5; i_station++) {
511 int chamber = 0;
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
virtual double phi() const override final
Methods to retrieve data members.
double zMin[N_STATION][N_SECTOR]
Definition MdtRegion.h:37
double zMax[N_STATION][N_SECTOR]
Definition MdtRegion.h:38
double aw[N_STATION][N_SECTOR]
Definition MuonRoad.h:83
double bw[N_STATION][N_SECTOR]
Definition MuonRoad.h:84
double phi[N_STATION][N_SECTOR]
Definition MuonRoad.h:85
@ BarrelInner
Inner station in the barrel spectrometer.
@ EndcapOuter
Outer station in the endcap spectrometer.
@ EndcapMiddle
Middle station in the endcap spectrometer.
@ EndcapExtra
Extra station in the endcap spectrometer.
@ EndcapInner
Inner station in the endcap spectrometer.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ find_barrel_road_dim()

void TrigL2MuonSA::MdtRegionDefiner::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
private

Definition at line 412 of file MdtRegionDefiner.cxx.

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}

◆ find_endcap_road_dim()

void TrigL2MuonSA::MdtRegionDefiner::find_endcap_road_dim ( const float road,
const float aw,
const float bw,
const float zMin,
const float zMax,
float & rMin,
float & rMax ) const
private

Definition at line 437 of file MdtRegionDefiner.cxx.

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}

◆ find_eta_min_max()

void TrigL2MuonSA::MdtRegionDefiner::find_eta_min_max ( float zMin,
float rMin,
float zMax,
float rMax,
float & etaMin,
float & etaMax ) const
private

Definition at line 377 of file MdtRegionDefiner.cxx.

378 {
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}
Scalar eta() const
pseudorapidity method
Scalar theta() const
theta method

◆ find_phi_min_max()

void TrigL2MuonSA::MdtRegionDefiner::find_phi_min_max ( float phiMiddle,
float & phiMin,
float & phiMax ) const
private

Definition at line 366 of file MdtRegionDefiner.cxx.

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}

◆ find_station_sector()

void TrigL2MuonSA::MdtRegionDefiner::find_station_sector ( const std::string & name,
int phi,
bool & endcap,
int & chamber,
int & sector )
static

Definition at line 329 of file MdtRegionDefiner.cxx.

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}
Scalar phi() const
phi method

◆ getMdtRegions() [1/2]

StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions ( const TrigRoiDescriptor * p_roids,
const TrigL2MuonSA::RpcFitResult & rpcFitResult,
TrigL2MuonSA::MuonRoad & muonRoad,
TrigL2MuonSA::MdtRegion & mdtRegion ) const

Definition at line 29 of file MdtRegionDefiner.cxx.

33{
34 mdtRegion.Clear();
35
36 SG::ReadCondHandle<MuonGM::MuonDetectorManager> muDetMgrHandle{m_muDetMgrKey};
37 const MuonGM::MuonDetectorManager* muDetMgr = muDetMgrHandle.cptr();
38
39 for(int i_station=0; i_station<6; i_station++) {
40 int chamber = 0;
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}
Scalar perp() const
perp method - perpendicular length
#define ATH_MSG_DEBUG(x)
int sign(int a)
#define z
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
const_pointer_type cptr()
void find_phi_min_max(float phiMiddle, float &phiMin, float &phiMax) 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
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
void find_eta_min_max(float zMin, float rMin, float zMax, float rMax, float &etaMin, float &etaMax) const
double phiMin[N_STATION][N_SECTOR]
Definition MdtRegion.h:43
double rMin[N_STATION][N_SECTOR]
Definition MdtRegion.h:39
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 MaxWidth(int i_station)
Definition MuonRoad.h:60
double rWidth[N_STATION][N_LAYER]
Definition MuonRoad.h:86
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
constexpr uint8_t stationPhi
station Phi 1 to 8
constexpr int N_SECTOR
Definition MuonRoad.h:16
@ BarrelMiddle
Middle station in the barrel spectrometer.
@ BarrelOuter
Outer station in the barrel spectrometer.
@ BME
BME measurement point.

◆ getMdtRegions() [2/2]

StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions ( const TrigRoiDescriptor * p_roids,
const TrigL2MuonSA::TgcFitResult & tgcFitResult,
TrigL2MuonSA::MuonRoad & muonRoad,
TrigL2MuonSA::MdtRegion & mdtRegion ) const

Definition at line 147 of file MdtRegionDefiner.cxx.

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
163 SG::ReadCondHandle<MuonGM::MuonDetectorManager> muDetMgrHandle{m_muDetMgrKey};
164 const MuonGM::MuonDetectorManager* muDetMgr = muDetMgrHandle.cptr();
165
166 for(int i_station=0; i_station<7; i_station++) {
167 int chamber = 0;
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}
#define ATH_MSG_ERROR(x)
static Double_t sc
static const std::vector< std::string > types
StatusCode computePhi(const TrigRoiDescriptor *p_roids, const TrigL2MuonSA::TgcFitResult &tgcFitResult, const TrigL2MuonSA::MdtRegion &mdtRegion, TrigL2MuonSA::MuonRoad &muonRoad) const
::StatusCode StatusCode
StatusCode definition for legacy code.
@ BEE
BEE measurement point.

◆ initialize()

StatusCode TrigL2MuonSA::MdtRegionDefiner::initialize ( )
overridevirtual

Definition at line 19 of file MdtRegionDefiner.cxx.

20{
21 ATH_CHECK(m_muDetMgrKey.initialize());
22 ATH_CHECK(m_idHelperSvc.retrieve());
23 return StatusCode::SUCCESS;
24}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ prepareTgcPoints()

StatusCode TrigL2MuonSA::MdtRegionDefiner::prepareTgcPoints ( const TrigL2MuonSA::TgcHits & tgcHits)
private

Definition at line 462 of file MdtRegionDefiner.cxx.

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}
const float ZERO_LIMIT
TrigL2MuonSA::TgcFit::PointArray m_tgcStripMidPoints
TrigL2MuonSA::TgcFit::PointArray m_tgcWireMidPoints
TrigL2MuonSA::TgcFit::PointArray m_tgcWireInnPoints
TrigL2MuonSA::TgcFit::PointArray m_tgcStripInnPoints

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setRpcGeometry()

void TrigL2MuonSA::MdtRegionDefiner::setRpcGeometry ( bool use_rpc)
inline

Definition at line 45 of file MdtRegionDefiner.h.

45{m_use_rpc = use_rpc;};

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> TrigL2MuonSA::MdtRegionDefiner::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 76 of file MdtRegionDefiner.h.

76{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_muDetMgrKey

SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> TrigL2MuonSA::MdtRegionDefiner::m_muDetMgrKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}
private

Definition at line 77 of file MdtRegionDefiner.h.

77{this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"};

◆ m_tgcStripInnPoints

TrigL2MuonSA::TgcFit::PointArray TrigL2MuonSA::MdtRegionDefiner::m_tgcStripInnPoints
private

Definition at line 83 of file MdtRegionDefiner.h.

◆ m_tgcStripMidPoints

TrigL2MuonSA::TgcFit::PointArray TrigL2MuonSA::MdtRegionDefiner::m_tgcStripMidPoints
private

Definition at line 81 of file MdtRegionDefiner.h.

◆ m_tgcWireInnPoints

TrigL2MuonSA::TgcFit::PointArray TrigL2MuonSA::MdtRegionDefiner::m_tgcWireInnPoints
private

Definition at line 84 of file MdtRegionDefiner.h.

◆ m_tgcWireMidPoints

TrigL2MuonSA::TgcFit::PointArray TrigL2MuonSA::MdtRegionDefiner::m_tgcWireMidPoints
private

Definition at line 82 of file MdtRegionDefiner.h.

◆ m_use_rpc

bool TrigL2MuonSA::MdtRegionDefiner::m_use_rpc {true}
private

Definition at line 79 of file MdtRegionDefiner.h.

79{true};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: