ATLAS Offline Software
Loading...
Searching...
No Matches
TgcRawDataMonitorTool Class Reference

#include <TgcRawDataMonitorTool.h>

Inheritance diagram for TgcRawDataMonitorTool:
Collaboration diagram for TgcRawDataMonitorTool:

Public Member Functions

 TgcRawDataMonitorTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~TgcRawDataMonitorTool ()
virtual StatusCode initialize () override
virtual std::set< std::string > getPassedChambers (const Amg::Vector3D &extVec) const override
virtual bool getMapIndex (const TGC::TgcHit &tgcHit, int &etamapindex, int &phimapindex, int &globalphimapindex) const override
virtual bool getMapIndex (const TGC::TgcChamber &tgcCham, int ilay, int &etamapindex, int &phimapindex, int &globalphimapindex) const override
virtual bool getMapIndexOnline (const std::string &chamber_type_name, int &etamap_index, int &phimap_index, int &phimap_global_index) const override

Private Attributes

DoubleProperty m_fiduciFrame {this,"FiducialFrame",-200.0,"Fidicual Frame size"}
DoubleProperty m_M1Mod1Pl1L1_offsetZ {this,"M1Mod1Pl1L1_offsetZ",13281.3,"Offset in Z of M1Mod1Pl1L1"}
DoubleProperty m_M1Mod2Pl2L3_offsetZ {this,"M1Mod2Pl2L3_offsetZ",13591.7,"Offset in Z of M1Mod2Pl2L3"}
DoubleProperty m_M2Mod1Pl1L1_offsetZ {this,"M2Mod1Pl1L1_offsetZ",14610.1,"Offset in Z of M2Mod1Pl1L1"}
DoubleProperty m_M2Mod2Pl2L2_offsetZ {this,"M2Mod2Pl2L2_offsetZ",14846.3,"Offset in Z of M2Mod2Pl2L2"}
DoubleProperty m_M3Mod1Pl1L1_offsetZ {this,"M3Mod1Pl1L1_offsetZ",15030.1,"Offset in Z of M3Mod1Pl1L1"}
DoubleProperty m_M3Mod2Pl2L2_offsetZ {this,"M3Mod2Pl2L2_offsetZ",15266.3,"Offset in Z of M3Mod2Pl2L2"}
DoubleProperty m_EIMod1Pl1L1_offsetZ {this,"EIMod1Pl1L1_offsetZ",7318.3, "Offset in Z of EIMod1Pl1L1"}
DoubleProperty m_EIMod2Pl1L2_offsetZ {this,"EIMod2Pl1L2_offsetZ",7411.1, "Offset in Z of EIMod2Pl1L2"}
DoubleProperty m_FIMod1Pl1L1_offsetZ {this,"FIMod1Pl1L1_offsetZ",6940.0, "Offset in Z of FIMod1Pl1L1"}
DoubleProperty m_FIMod2Pl1L2_offsetZ {this,"FIMod2Pl1L2_offsetZ",7016.4, "Offset in Z of FIMod2Pl1L2"}
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_DetectorManagerKey {this, "DetectorManagerKey","MuonDetectorManager","Key of input MuonDetectorManager condition data"}

Detailed Description

Definition at line 13 of file TgcRawDataMonitorTool.h.

Constructor & Destructor Documentation

◆ TgcRawDataMonitorTool()

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

Definition at line 9 of file TgcRawDataMonitorTool.cxx.

12 : base_class(type,name,parent)
13{
14}

◆ ~TgcRawDataMonitorTool()

TgcRawDataMonitorTool::~TgcRawDataMonitorTool ( )
virtual

Definition at line 16 of file TgcRawDataMonitorTool.cxx.

16{}

Member Function Documentation

◆ getMapIndex() [1/2]

bool TgcRawDataMonitorTool::getMapIndex ( const TGC::TgcChamber & tgcCham,
int ilay,
int & etamapindex,
int & phimapindex,
int & globalphimapindex ) const
overridevirtual

Definition at line 85 of file TgcRawDataMonitorTool.cxx.

86 {
87 ATH_MSG_DEBUG("TgcRawDataMonitorTool::getMapIndex(const TGC::TgcChamber& tgcCham,: Start");
88 if (tgcCham.iM() > 1 && iLay > 2){
89 ATH_MSG_DEBUG("tgcCham.iM() > 1 && iLay > 2");
90 return false;
91 }
92 int nLay = (tgcCham.iM()==1)?(3):(2);
93 if (tgcCham.iM() == 4) { // EI/FI
94 etamap_index = tgcCham.iEta() * nLay + iLay; // 1..4
95 if(tgcCham.iEta() == 0){ //FI
96 phimap_index = tgcCham.iPhi(); // 1..24
97 }else{ // EI
98 phimap_index = tgcCham.iPhi() + int(tgcCham.iSec() / 2) + tgcCham.iSec(); // 1..24
99 }
100 phimap_global_index = tgcCham.iEta() * 24*nLay + (phimap_index - 1) * nLay + iLay; // 1..96
101 }else{ // BigWheel
102 etamap_index = tgcCham.iEta() * nLay + iLay; // 1..15 for M1, 1..12 for M2M3
103 phimap_index = (tgcCham.iSec() - 1) * 4 + tgcCham.iPhi() + 1; // 1..48
104 phimap_global_index = tgcCham.iEta() * 48*nLay + (phimap_index - 1) * nLay + iLay; // 1..720 for M1, 1..576 for M2M3
105 }
106 ATH_MSG_DEBUG("TgcRawDataMonitorTool::getMapIndex(const TGC::TgcChamber& tgcCham,: End");
107 return true;
108}
#define ATH_MSG_DEBUG(x)
const int & iM() const
Definition TgcChamber.h:47
const int & iSec() const
Definition TgcChamber.h:46
const int & iEta() const
Definition TgcChamber.h:49
const int & iPhi() const
Definition TgcChamber.h:48

◆ getMapIndex() [2/2]

bool TgcRawDataMonitorTool::getMapIndex ( const TGC::TgcHit & tgcHit,
int & etamapindex,
int & phimapindex,
int & globalphimapindex ) const
overridevirtual

Definition at line 78 of file TgcRawDataMonitorTool.cxx.

79 {
80
81 ATH_MSG_DEBUG("TgcRawDataMonitorTool::getMapIndex(const TGC::TgcHit& tgcHit,: Start");
82 return getMapIndex(tgcHit,tgcHit.gasGap(),etamap_index,phimap_index,phimap_global_index);
83 ATH_MSG_DEBUG("TgcRawDataMonitorTool::getMapIndex(const TGC::TgcHit& tgcHit,: End");
84}
const int & gasGap() const
Definition TgcHit.h:63
virtual bool getMapIndex(const TGC::TgcHit &tgcHit, int &etamapindex, int &phimapindex, int &globalphimapindex) const override

◆ getMapIndexOnline()

bool TgcRawDataMonitorTool::getMapIndexOnline ( const std::string & chamber_type_name,
int & etamap_index,
int & phimap_index,
int & phimap_global_index ) const
overridevirtual

Definition at line 110 of file TgcRawDataMonitorTool.cxx.

111 {
112 etamap_index=-1;
113 phimap_index=-1;
114 phimap_global_index=-1;
115 if( chamber_type_name.size() != 16 ) return false; // e.g. A01M01f01E01L01S
116
117 const int offset = (chamber_type_name[5]=='1')?(0):((chamber_type_name[5]=='2')?(3):((chamber_type_name[5]=='3')?(5):(7)));
118 const int layerNumber = std::atoi(chamber_type_name.substr(14,1).c_str())-1 + offset;/*0..6..8*/
119 const bool isEndcap = chamber_type_name[9] == 'E';
120 const int phiId =// 0..47 for E, 0..23 for F, A/M1/sector01/phi0/E1 is 0, A/M1/sector01/phi2/F is also 1
121 (chamber_type_name[5]=='4')
122 ?( std::atoi(chamber_type_name.substr(8,1).c_str()) + (std::atoi(chamber_type_name.substr(1,2).c_str())/2)*3 ) /*0..23*/
123 :( (isEndcap)
124 ?( std::atoi(chamber_type_name.substr(8,1).c_str()) + (std::atoi(chamber_type_name.substr(1,2).c_str())-1)*4 ) /*0..47*/
125 :( std::atoi(chamber_type_name.substr(8,1).c_str())/2 + (std::atoi(chamber_type_name.substr(1,2).c_str())-1)*2 ) /*0..23*/ );
126 const int eNumber = std::atoi(chamber_type_name.substr(11,1).c_str())-1;/*0..4*/
127 const bool isStrip = chamber_type_name[15] == 'S';
128
129 int sector = isEndcap ? phiId/4+1 : phiId/2+1;
130 int phi = isEndcap ? phiId%4 : (phiId%2)*2;
131 int efNumber = (isEndcap) ? eNumber : ( (layerNumber<3)?(4):(5)) ; // 0..3 or 4, plus 1 for forward
132
133 phimap_index = (!isEndcap || chamber_type_name[5]=='4') ? (phiId*2+1) : (phiId+1);
134
135 int station = 0;
136 int iLay = 0;
137 if(layerNumber<3){ // M1
138 station=1;
139 iLay = layerNumber+1;
140 etamap_index = ((isStrip)?(2):(3)) * efNumber + ((isStrip)?(iLay/2+1):(iLay));
141 }else if(layerNumber<5){ // M2
142 station=2;
143 iLay = layerNumber+1-3;
144 etamap_index = 2 * efNumber + iLay + ((isStrip)?(10):(15));
145 }else if(layerNumber<7){ // M3
146 station=3;
147 iLay = layerNumber+1-5;
148 etamap_index = 2 * efNumber + iLay + ((isStrip)?(22):(27));
149 }else{ // M4
150 station=4;
151 iLay = layerNumber+1-7;
152 etamap_index = iLay + ((isStrip)?(34):(39));
153 }
154
155 if(layerNumber<7){
156 phimap_global_index = iLay + efNumber*3 + phi*18 + (station-1)*72 + (sector-1)*216;
157 }else{
158 phimap_global_index = 2592 + iLay + phiId*2;
159 }
160
161 return true;
162}
Scalar phi() const
phi method

◆ getPassedChambers()

std::set< std::string > TgcRawDataMonitorTool::getPassedChambers ( const Amg::Vector3D & extVec) const
overridevirtual

Definition at line 23 of file TgcRawDataMonitorTool.cxx.

23 {
24 ATH_MSG_DEBUG("TgcRawDataMonitorTool::getPassedChambers(): Start");
25 double ext_x = extVec[0];
26 double ext_y = extVec[1];
27 double ext_z = extVec[2];
28 std::set<std::string> passed_chambers;
29 SG::ReadCondHandle<MuonGM::MuonDetectorManager> DetectorManagerHandle{m_DetectorManagerKey,Gaudi::Hive::currentContext()};
30 const MuonGM::MuonDetectorManager* muonMgr = DetectorManagerHandle.cptr();
31 if(muonMgr==nullptr){
32 ATH_MSG_ERROR("Null pointer to the read MuonDetectorManager conditions object.");
33 return passed_chambers;
34 }
35 for(int iStationName = 41 ; iStationName <= 48 ; iStationName++){
36 if ( (iStationName==41 || iStationName==42) && // M1
37 ( std::abs(ext_z)<m_M1Mod1Pl1L1_offsetZ-10. || std::abs(ext_z)>m_M1Mod2Pl2L3_offsetZ+10. ) )continue;
38 if ( (iStationName==43 || iStationName==44) && // M2
39 ( std::abs(ext_z)<m_M2Mod1Pl1L1_offsetZ-10. || std::abs(ext_z)>m_M2Mod2Pl2L2_offsetZ+10. ) )continue;
40 if ((iStationName==45 || iStationName==46) && // M3
41 ( std::abs(ext_z)<m_M3Mod1Pl1L1_offsetZ-10. || std::abs(ext_z)>m_M3Mod2Pl2L2_offsetZ+10. ) )continue;
42 if ( iStationName==48 && // EI
43 ( std::abs(ext_z)<m_EIMod1Pl1L1_offsetZ-10. || std::abs(ext_z)>m_EIMod2Pl1L2_offsetZ+10. ) )continue;
44 if ( iStationName==47 && // FI
45 ( std::abs(ext_z)<m_FIMod1Pl1L1_offsetZ-10. || std::abs(ext_z)>m_FIMod2Pl1L2_offsetZ+10. ) )continue;
46 bool endcap = (iStationName%2==0);
47 int maxEta = 1;
48 if(endcap && iStationName==42) maxEta = 4;
49 else if(endcap && (iStationName==44 || iStationName==46)) maxEta = 5;
50 for(int iStationEta = -maxEta ; iStationEta <= maxEta ; iStationEta++){
51 if(iStationEta==0)continue;
52 if(ext_z > 0 && iStationEta < 0)continue;
53 if(ext_z < 0 && iStationEta > 0)continue;
54 for(int iStationPhi = muonMgr->tgcIdHelper()->stationPhiMin(endcap) ;
55 iStationPhi <= muonMgr->tgcIdHelper()->stationPhiMax(endcap) ; iStationPhi++){
56 if(iStationName==48 && iStationPhi>21)continue;
57 TGC::TgcChamber tgcChamber; tgcChamber.initChamber(iStationEta, iStationPhi, iStationName);
58 bool isValid{false};
59 const Identifier id = muonMgr->tgcIdHelper()->elementID(iStationName, iStationEta, iStationPhi, isValid);
60 if (!isValid) continue;
61
62 const MuonGM::TgcReadoutElement* detEle = muonMgr->getTgcReadoutElement(id);
63 const Trk::TrapezoidBounds* tb = static_cast<const Trk::TrapezoidBounds*>(&detEle->bounds());
64 Amg::Vector3D trkLocVec3D = detEle->transform().inverse() * Amg::Vector3D(ext_x,ext_y,ext_z);
65 if(std::abs(trkLocVec3D.x())>1000.)continue;
66 if(std::abs(trkLocVec3D.y())>1500.)continue;
67 Amg::Vector2D trkvec(trkLocVec3D.x(),trkLocVec3D.y());
68 if( tb->minDistance(trkvec) < m_fiduciFrame ) passed_chambers.insert(tgcChamber.cham_name());
69 }
70 }
71 }
72
73 ATH_MSG_DEBUG("TgcRawDataMonitorTool::getPassedChambers(): End");
74 ATH_MSG_DEBUG("Number of passed TGC chambers: " << passed_chambers.size());
75 return passed_chambers;
76}
#define ATH_MSG_ERROR(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
virtual const Trk::SurfaceBounds & bounds() const override
Return the boundaries of the element.
virtual const Amg::Transform3D & transform() const override
Return local to global transform.
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
const_pointer_type cptr()
void initChamber(const std::string &chamber_name)
Definition TgcChamber.cxx:8
const std::string & cham_name() const
Definition TgcChamber.h:43
Identifier elementID(int stationName, int stationEta, int stationPhi) const
static int stationPhiMin(bool endcap)
DoubleProperty m_EIMod1Pl1L1_offsetZ
DoubleProperty m_M1Mod2Pl2L3_offsetZ
DoubleProperty m_M1Mod1Pl1L1_offsetZ
DoubleProperty m_M2Mod1Pl1L1_offsetZ
DoubleProperty m_FIMod2Pl1L2_offsetZ
DoubleProperty m_M3Mod1Pl1L1_offsetZ
DoubleProperty m_FIMod1Pl1L1_offsetZ
DoubleProperty m_M2Mod2Pl2L2_offsetZ
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
DoubleProperty m_M3Mod2Pl2L2_offsetZ
DoubleProperty m_EIMod2Pl1L2_offsetZ
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
constexpr float maxEta

◆ initialize()

StatusCode TgcRawDataMonitorTool::initialize ( )
overridevirtual

Definition at line 17 of file TgcRawDataMonitorTool.cxx.

17 {
18 ATH_MSG_DEBUG("TgcRawDataMonitorTool::initialize(): Start");
19 ATH_CHECK(m_DetectorManagerKey.initialize());
20 ATH_MSG_DEBUG("TgcRawDataMonitorTool::initialize(): End");
21 return StatusCode::SUCCESS;
22}
#define ATH_CHECK
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_DetectorManagerKey

SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> TgcRawDataMonitorTool::m_DetectorManagerKey {this, "DetectorManagerKey","MuonDetectorManager","Key of input MuonDetectorManager condition data"}
private

Definition at line 47 of file TgcRawDataMonitorTool.h.

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

◆ m_EIMod1Pl1L1_offsetZ

DoubleProperty TgcRawDataMonitorTool::m_EIMod1Pl1L1_offsetZ {this,"EIMod1Pl1L1_offsetZ",7318.3, "Offset in Z of EIMod1Pl1L1"}
private

Definition at line 41 of file TgcRawDataMonitorTool.h.

41{this,"EIMod1Pl1L1_offsetZ",7318.3, "Offset in Z of EIMod1Pl1L1"};

◆ m_EIMod2Pl1L2_offsetZ

DoubleProperty TgcRawDataMonitorTool::m_EIMod2Pl1L2_offsetZ {this,"EIMod2Pl1L2_offsetZ",7411.1, "Offset in Z of EIMod2Pl1L2"}
private

Definition at line 42 of file TgcRawDataMonitorTool.h.

42{this,"EIMod2Pl1L2_offsetZ",7411.1, "Offset in Z of EIMod2Pl1L2"};

◆ m_fiduciFrame

DoubleProperty TgcRawDataMonitorTool::m_fiduciFrame {this,"FiducialFrame",-200.0,"Fidicual Frame size"}
private

Definition at line 30 of file TgcRawDataMonitorTool.h.

30{this,"FiducialFrame",-200.0,"Fidicual Frame size"};

◆ m_FIMod1Pl1L1_offsetZ

DoubleProperty TgcRawDataMonitorTool::m_FIMod1Pl1L1_offsetZ {this,"FIMod1Pl1L1_offsetZ",6940.0, "Offset in Z of FIMod1Pl1L1"}
private

Definition at line 44 of file TgcRawDataMonitorTool.h.

44{this,"FIMod1Pl1L1_offsetZ",6940.0, "Offset in Z of FIMod1Pl1L1"};

◆ m_FIMod2Pl1L2_offsetZ

DoubleProperty TgcRawDataMonitorTool::m_FIMod2Pl1L2_offsetZ {this,"FIMod2Pl1L2_offsetZ",7016.4, "Offset in Z of FIMod2Pl1L2"}
private

Definition at line 45 of file TgcRawDataMonitorTool.h.

45{this,"FIMod2Pl1L2_offsetZ",7016.4, "Offset in Z of FIMod2Pl1L2"};

◆ m_M1Mod1Pl1L1_offsetZ

DoubleProperty TgcRawDataMonitorTool::m_M1Mod1Pl1L1_offsetZ {this,"M1Mod1Pl1L1_offsetZ",13281.3,"Offset in Z of M1Mod1Pl1L1"}
private

Definition at line 32 of file TgcRawDataMonitorTool.h.

32{this,"M1Mod1Pl1L1_offsetZ",13281.3,"Offset in Z of M1Mod1Pl1L1"};

◆ m_M1Mod2Pl2L3_offsetZ

DoubleProperty TgcRawDataMonitorTool::m_M1Mod2Pl2L3_offsetZ {this,"M1Mod2Pl2L3_offsetZ",13591.7,"Offset in Z of M1Mod2Pl2L3"}
private

Definition at line 33 of file TgcRawDataMonitorTool.h.

33{this,"M1Mod2Pl2L3_offsetZ",13591.7,"Offset in Z of M1Mod2Pl2L3"};

◆ m_M2Mod1Pl1L1_offsetZ

DoubleProperty TgcRawDataMonitorTool::m_M2Mod1Pl1L1_offsetZ {this,"M2Mod1Pl1L1_offsetZ",14610.1,"Offset in Z of M2Mod1Pl1L1"}
private

Definition at line 35 of file TgcRawDataMonitorTool.h.

35{this,"M2Mod1Pl1L1_offsetZ",14610.1,"Offset in Z of M2Mod1Pl1L1"};

◆ m_M2Mod2Pl2L2_offsetZ

DoubleProperty TgcRawDataMonitorTool::m_M2Mod2Pl2L2_offsetZ {this,"M2Mod2Pl2L2_offsetZ",14846.3,"Offset in Z of M2Mod2Pl2L2"}
private

Definition at line 36 of file TgcRawDataMonitorTool.h.

36{this,"M2Mod2Pl2L2_offsetZ",14846.3,"Offset in Z of M2Mod2Pl2L2"};

◆ m_M3Mod1Pl1L1_offsetZ

DoubleProperty TgcRawDataMonitorTool::m_M3Mod1Pl1L1_offsetZ {this,"M3Mod1Pl1L1_offsetZ",15030.1,"Offset in Z of M3Mod1Pl1L1"}
private

Definition at line 38 of file TgcRawDataMonitorTool.h.

38{this,"M3Mod1Pl1L1_offsetZ",15030.1,"Offset in Z of M3Mod1Pl1L1"};

◆ m_M3Mod2Pl2L2_offsetZ

DoubleProperty TgcRawDataMonitorTool::m_M3Mod2Pl2L2_offsetZ {this,"M3Mod2Pl2L2_offsetZ",15266.3,"Offset in Z of M3Mod2Pl2L2"}
private

Definition at line 39 of file TgcRawDataMonitorTool.h.

39{this,"M3Mod2Pl2L2_offsetZ",15266.3,"Offset in Z of M3Mod2Pl2L2"};

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