ATLAS Offline Software
Loading...
Searching...
No Matches
MuonGM Namespace Reference

Ensure that the Athena extensions are properly loaded. More...

Classes

class  AlignPos
class  CbmComponent
struct  ChamberGrp
class  CHV
class  CMI
class  Component
class  CRO
class  CSC
class  Csc
class  CscComponent
class  CscMultiLayer
class  CscReadoutElement
class  Cutout
class  DblQ00Acut
class  DblQ00Alin
class  DblQ00Almn
class  DblQ00Aptp
class  DblQ00Asmp
class  DblQ00Aszt
class  DblQ00Atln
class  DblQ00Atyp
class  DblQ00Awln
class  DblQ00Dbam
class  DblQ00IAcsc
class  DblQ00Wchv
class  DblQ00Wcmi
class  DblQ00Wcro
class  DblQ00Wcsc
class  DblQ00Wded
class  DblQ00Wlbi
class  DblQ00Wmdt
class  DblQ00Wrpc
class  DblQ00Wspa
class  DblQ00Wsup
class  DblQ00Wtgc
class  DblQ00Xtomo
class  DBReader
class  DED
class  Ded
class  DetectorElement
class  DriftTube
class  FPVMAP
class  GeoModelCscTest
class  GeoModelMdtTest
class  GeoModelMmTest
class  GeoModelRpcTest
class  GeoModelsTgcTest
class  GeoModelTgcTest
class  LBI
class  LbiComponent
class  MDT
class  Mdt
class  MdtComponent
class  MdtReadoutElement
class  Micromegas
class  MicromegasComponent
class  MM_Technology
class  MMReadoutElement
 An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station contains: More...
class  MMSpacer
class  MMSpacer_Technology
class  MMSpacerComponent
class  MultiLayer
class  MuonChamber
class  MuonChamberLite
struct  MuonChannelDesign
class  MuonClusterReadoutElement
class  MuonDetectorFactory001
class  MuonDetectorFactoryLite
class  MuonDetectorManager
 The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and provides access to all main blocks of information needed by generic clients of the geometry: XxxReadoutElements, MuonStations, MuonIdHelpers, geometryVersion, etc. More...
struct  MuonPadDesign
 Parameters defining the design of the readout sTGC pads. More...
class  MuonReadoutElement
 Base class for the XxxReadoutElement, with Xxx = Mdt, Rpc, Tgc, Csc. More...
class  MuonStation
struct  MuonStripDesign
class  MuonSystemDescription
class  MYSQL
class  NSWGeoPlottingAlg
class  Position
class  RDBReaderAtlas
class  RPC
class  Rpc
class  RpcComponent
class  RpcLayer
class  RpcReadoutElement
 An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station contains: More...
class  SimpleVolAction
class  SPA
class  Spacer
class  SpacerBeam
class  SpaComponent
class  StandardComponent
class  Station
class  StationSelector
class  sTGC
class  sTGC_Technology
class  sTGCComponent
class  sTgcReadoutElement
 An sTgcReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station contains: More...
class  SUP
class  SupComponent
class  Technology
class  TGC
class  Tgc
struct  TgcChamberLayout
class  TgcComponent
class  TgcReadoutElement
 A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains several TgcReadoutElements. More...
class  TgcReadoutParams

Typedefs

typedef StandardComponent DedComponent
typedef std::map< std::string, GeoVPhysVol * >::const_iterator DetectorIterator
typedef std::map< int, std::string >::const_iterator AllocposIterator
typedef std::map< std::string, int >::const_iterator allocPosIterator
typedef std::map< int, Position, std::less< int > > PositionMap
typedef std::multimap< int, AlignPos, std::less< int > > AlignPosMap
typedef std::map< int, Position, std::less< int > >::const_iterator PositionIterator
typedef std::multimap< int, AlignPos, std::less< int > >::const_iterator AlignPosIterator
using GasGapIntArray = TgcReadoutParams::GasGapIntArray
using GasGapFloatArray = TgcReadoutParams::GasGapFloatArray
using WiregangArray = TgcReadoutParams::WiregangArray
using StripArray = TgcReadoutParams::StripArray

Functions

template<class TYPEdhwmdt, class TYPEwmdt>
static void ProcessMDT (MYSQL &mysql, const TYPEdhwmdt dhwmdt, const TYPEwmdt *wmdt, const std::string &s)
template<class TYPEdhwrpc, class TYPEwrpc, class TYPEdhwrpcall, class TYPEwrpcall>
static void ProcessRPC (MYSQL &mysql, const TYPEdhwrpc dhwrpc, const TYPEwrpc *wrpc, const TYPEdhwrpcall, const TYPEwrpcall *wrpcall, const std::string &s)
template<class TYPEdhwtgc, class TYPEwtgc, class TYPEdhwtgcall, class TYPEwtgcall>
static void ProcessTGC (MYSQL &mysql, const TYPEdhwtgc dhwtgc, const TYPEwtgc *wtgc, const TYPEdhwtgcall dhwtgcall, const TYPEwtgcall *wtgcall, const std::string &s)
template<class TYPEdhwcsc, class TYPEwcsc>
static void ProcessCSC (MYSQL &mysql, const TYPEdhwcsc dhwcsc, const TYPEwcsc *wcsc, const std::string &s)
template<class TYPEdhwspa, class TYPEwspa>
static void ProcessSPA (MYSQL &mysql, const TYPEdhwspa dhwspa, const TYPEwspa *wspa, const std::string &s)
template<class TYPEdhwsup, class TYPEwsup>
static void ProcessSUP (MYSQL &mysql, const TYPEdhwsup dhwsup, const TYPEwsup *wsup, const std::string &s)
template<class TYPEdhwded, class TYPEwded>
static void ProcessDED (MYSQL &mysql, const TYPEdhwded dhwded, const TYPEwded *wded, const std::string &s)
template<class TYPEdhwchv, class TYPEwchv>
static void ProcessCHV (MYSQL &mysql, const TYPEdhwchv dhwchv, const TYPEwchv *wchv, const std::string &s)
template<class TYPEdhwcro, class TYPEwcro>
static void ProcessCRO (MYSQL &mysql, const TYPEdhwcro dhwcro, const TYPEwcro *wcro, const std::string &s)
template<class TYPEdhwcmi, class TYPEwcmi>
static void ProcessCMI (MYSQL &mysql, const TYPEdhwcmi dhwcmi, const TYPEwcmi *wcmi, const std::string &s)
template<class TYPEdhwlbi, class TYPEwlbi>
static void ProcessLBI (MYSQL &mysql, const TYPEdhwlbi dhwlbi, const TYPEwlbi *wlbi, const std::string &s)
template<class TYPEdnaptp, class TYPEaptp>
static void ProcessPositions (MYSQL &mysql, const TYPEdnaptp dnaptp, const TYPEaptp *aptp)
template<class TYPEaptp>
static bool isBarrelLike (const TYPEaptp *, int, int)
template<class TYPEdnaszt, class TYPEaszt>
static void ProcessAlignements (MYSQL &mysql, const TYPEdnaszt dnaszt, const TYPEaszt *aszt)
template<class TYPEdnalmn, class TYPEalmn, class TYPEdnatyp, class TYPEatyp, class TYPEdhwmdt, class TYPEwmdt>
static void ProcessStations (MYSQL &mysql, const TYPEdnalmn dnalmn, const TYPEalmn *almn, const TYPEdnatyp dnatyp, const TYPEatyp *atyp, const TYPEdhwmdt dhwmdt, const TYPEwmdt *wmdt)
template<class TYPEdnacut, class TYPEacut, class TYPEdnalin, class TYPEalin, class TYPEdnatyp, class TYPEatyp>
static void ProcessCutouts (MYSQL &mysql, const TYPEdnacut dnacut, const TYPEacut *acut, const TYPEdnalin dnalin, const TYPEalin *alin, const TYPEdnatyp dnatyp, const TYPEatyp *atyp)
std::ostream & operator<< (std::ostream &os, const AlignPos &p)
std::ostream & operator<< (std::ostream &os, const Cutout &p)
float round (const float toRound, const unsigned int decimals)
std::ostream & operator<< (std::ostream &os, const MicromegasComponent &c)
std::ostream & operator<< (std::ostream &os, const MMSpacerComponent &c)
template<class T>
const T * getIdHelper (StoreGateSvc *pDetStore, const std::string &helperName)
std::ostream & operator<< (std::ostream &os, const Position &p)
std::ostream & operator<< (std::ostream &os, const StandardComponent &c)
std::ostream & operator<< (std::ostream &os, const Station &s)
std::ostream & operator<< (std::ostream &os, const sTGCComponent &c)
std::ostream & operator<< (std::ostream &os, const TgcComponent &c)
std::ostream & operator<< (std::ostream &ostr, const Amg::Transform3D &trans)
template<typename VType>
bool isEqual (const std::vector< VType > &a, const std::vector< VType > &b)
template<typename VType>
std::ostream & operator<< (std::ostream &ostr, const std::vector< VType > &v)
template<typename VType>
std::ostream & operator<< (std::ostream &ostr, const std::set< VType > &s)
int nStrips (const MuonGM::TgcReadoutElement &readoutEle, int layer)
std::string buildString (int i, int ncha)
int strtoint (std::string_view str, unsigned int istart, unsigned int length)
int stationPhiTGC (std::string_view stName, int fi, int zi_input)
 Converts the AMDB phi index to the Identifier phi Index.
int amdbPhiTGC (std::string_view stName, int phiIndex, int eta_index)
 Converts the Identifier phi index to the AMDB phi index.

Variables

static std::atomic< int > nmdt {0}
static std::atomic< int > nrpc {0}
static std::atomic< int > ntgc {0}
static std::atomic< int > ncsc {0}
static std::atomic< int > nspa {0}
static std::atomic< int > nded {0}
static std::atomic< int > nsup {0}
static std::atomic< int > nchv {0}
static std::atomic< int > ncro {0}
static std::atomic< int > ncmi {0}
static std::atomic< int > nlbi {0}
constexpr int maxwlay = 4
constexpr int maxnlayers = 4
 An MdtReadoutElement corresponds to a single MDT multilayer; therefore typicaly a MDT chamber consists of two MdtReadoutElements, each identified by StationName, StationEta, StationPhi, Technology=0, and Multilayer.
constexpr int maxnsteps = 10

Detailed Description

Ensure that the Athena extensions are properly loaded.

Typedef Documentation

◆ AlignPosIterator

typedef std::multimap<int,AlignPos,std::less<int>>::const_iterator MuonGM::AlignPosIterator

Definition at line 38 of file Station.h.

◆ AlignPosMap

typedef std::multimap<int, AlignPos, std::less<int> > MuonGM::AlignPosMap

Definition at line 36 of file Station.h.

◆ AllocposIterator

typedef std::map<int,std::string>::const_iterator MuonGM::AllocposIterator

Definition at line 40 of file MYSQL.h.

◆ allocPosIterator

typedef std::map<std::string,int>::const_iterator MuonGM::allocPosIterator

Definition at line 41 of file MYSQL.h.

◆ DedComponent

Definition at line 10 of file DedComponent.h.

◆ DetectorIterator

typedef std::map<std::string,GeoVPhysVol*>::const_iterator MuonGM::DetectorIterator

Definition at line 15 of file FPVMAP.h.

◆ GasGapFloatArray

◆ GasGapIntArray

◆ PositionIterator

typedef std::map<int,Position,std::less<int>>::const_iterator MuonGM::PositionIterator

Definition at line 37 of file Station.h.

◆ PositionMap

typedef std::map<int, Position, std::less<int> > MuonGM::PositionMap

Definition at line 35 of file Station.h.

◆ StripArray

◆ WiregangArray

Function Documentation

◆ amdbPhiTGC()

int MuonGM::amdbPhiTGC ( std::string_view stName,
int phiIndex,
int eta_index )

Converts the Identifier phi index to the AMDB phi index.

For T4E the devil was certainly involved in the game. The backward conversion does not make any sense at all. Hardcode it...

Definition at line 86 of file GlobalUtilities.cxx.

86 {
87 if (stName != "T4E") {
88 const int nch = 3*( stName[2] == 'E' ? 2 : 1);
89 int fioff = std::abs(eta_index);
90 if (fioff > 3 && stName[2] == 'F') fioff -= 3;
91 if (stName[2] == 'F') fioff -=1;
92 else fioff-=2;
93 int amdbPhi = ( (phiIndex - fioff) / nch + 1 ) % 8;
94 if (amdbPhi <= 0) amdbPhi = 8;
95 return amdbPhi;
96 }
99 switch (phiIndex) {
100 case 21: return 1;
101 case 3 : return 2;
102 case 6: return 3;
103 case 9: return 4;
104 case 11: return 5;
105 case 14: return 6;
106 case 16: return 7;
107 case 19: return 8;
108 default: return 0;
109 }
110 return 0;
111 }

◆ buildString()

std::string MuonGM::buildString ( int i,
int ncha )

Definition at line 20 of file GlobalUtilities.cxx.

20 {
21 if (ncha <= 0) {
22 return std::to_string(i);
23 } else {
24 int ij = i;
25 std::ostringstream ostigg;
26 for (int j = ncha - 1; j >= 0; j--) {
27 ostigg << int(ij / std::pow(10.0, j));
28 ij = int(ij % int(std::pow(10.0, j)));
29 }
30 return ostigg.str();
31 }
32 }

◆ getIdHelper()

template<class T>
const T * MuonGM::getIdHelper ( StoreGateSvc * pDetStore,
const std::string & helperName )

Definition at line 27 of file MuonDetectorFactoryLite.cxx.

27 {
28 const T *helper;
29 StatusCode sc = pDetStore->retrieve(helper, helperName);
30 if (sc.isFailure()) {
31 return nullptr;
32 }
33 else {
34 return helper;
35 }
36 };
static Double_t sc
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.

◆ isBarrelLike()

template<class TYPEaptp>
bool MuonGM::isBarrelLike ( const TYPEaptp * ,
int ,
int  )
static

Definition at line 829 of file DBReader.h.

829 {
830 // this must be specialised
831 return false;
832 }

◆ isEqual()

template<typename VType>
bool MuonGM::isEqual ( const std::vector< VType > & a,
const std::vector< VType > & b )

Definition at line 18 of file MuonDetDescr/MuonGeoModelTest/src/GeoModelTgcTest.cxx.

19 {
20 if (a.size() != b.size()) {
21 return false;
22 }
23 for (size_t k =0 ; k < a.size() ; ++k) {
24 if ( std::abs(a[k] - b[k]) > std::numeric_limits<VType>::epsilon()){
25 return false;
26 }
27 }
28 return true;
29}
static Double_t a

◆ nStrips()

int MuonGM::nStrips ( const MuonGM::TgcReadoutElement & readoutEle,
int layer )
inline

Definition at line 46 of file MuonDetDescr/MuonGeoModelTest/src/GeoModelTgcTest.cxx.

46 {
47 return readoutEle.nStrips(layer) > 1 ? readoutEle.nStrips(layer) : 0;
48}
int nStrips(int gasGap) const
Returns the number of strips in a given gas gap.

◆ operator<<() [1/12]

std::ostream & MuonGM::operator<< ( std::ostream & os,
const AlignPos & p )

Definition at line 8 of file AlignPos.cxx.

8 {
9 os << "phi ind=" << p.phiindex << " z ind=" << p.zindex << " tra_s=" << p.tras << " tra_z=" << p.traz << " tra_t=" << p.trat << " (in mm)"
10 << " rot_s=" << p.rots * 1000. << " rot_z=" << p.rotz * 1000. << " rot_t=" << p.rott * 1000. << " (angles in milli-radians) "
11 << " is barrel? " << p.isBarrel << " station type= " << p.tectype;
12
13 return os;
14 }

◆ operator<<() [2/12]

std::ostream & MuonGM::operator<< ( std::ostream & os,
const Cutout & p )

Definition at line 67 of file Cutout.cxx.

67 {
68 os << " Cutout: "
69 << " x/y/width_s/width_l/length/excent/dead1: " << p.dx << " " << p.dy << " " << p.widthXs << " " << p.widthXl << " " << p.lengthY << " " << p.excent << " " << p.dead1
70 << " component index=" << p.ijob;
71
72 return os;
73 }

◆ operator<<() [3/12]

std::ostream & MuonGM::operator<< ( std::ostream & os,
const MicromegasComponent & c )

Definition at line 10 of file MicromegasComponent.cxx.

10 {
11 os << "Component " << c.name << std::endl;
12 return os;
13 }

◆ operator<<() [4/12]

std::ostream & MuonGM::operator<< ( std::ostream & os,
const MMSpacerComponent & c )

Definition at line 11 of file MMSpacerComponent.cxx.

11 {
12 os << "Component " << c.name << std::endl;
13 return os;
14 }

◆ operator<<() [5/12]

std::ostream & MuonGM::operator<< ( std::ostream & os,
const Position & p )

Definition at line 9 of file Position.cxx.

9 {
10 os << " Position eta/phi index " << p.zindex << "/" << p.phiindex << " phi/z/R/s_shift " << p.phi << " " << p.z << " " << p.radius << " " << p.shift << " alpha/beta/gamma "
11 << p.alpha << " " << p.beta << " " << p.gamma;
12
13 return os;
14 }

◆ operator<<() [6/12]

std::ostream & MuonGM::operator<< ( std::ostream & os,
const StandardComponent & c )

Definition at line 19 of file StandardComponent.cxx.

19 {
20 os << "Component " << c.name << std::endl;
21 os << c.posx << " " << c.posy << " " << c.posz << " " << c.index << " " << c.name;
22 os << " " << c.iswap << " " << c.dx1 << " " << c.dx2 << " " << c.dy << " ";
23 os << c.excent << " " << c.deadx << " " << c.deady << std::endl;
24 return os;
25 }

◆ operator<<() [7/12]

std::ostream & MuonGM::operator<< ( std::ostream & os,
const Station & s )

Definition at line 326 of file Station.cxx.

326 {
327 os << "Station m_name: " << s.m_name << " " << s.m_components.size() << std::endl;
328 for (unsigned int i = 0; i < s.m_components.size(); i++)
329 os << "\t" << s.m_components[i].get() << std::endl;
330
332 for (k = s.begin(); k != s.end(); ++k)
333 os << "\t\t" << (*k).second << std::endl;
334
336 for (ak = s.abegin(); ak != s.aend(); ++ak)
337 os << "\t\t" << (*ak).second << std::endl;
338
339 os << "--------------------------------------------------" << std::endl;
340 return os;
341 }
std::multimap< int, AlignPos, std::less< int > >::const_iterator AlignPosIterator
Definition Station.h:38
std::map< int, Position, std::less< int > >::const_iterator PositionIterator
Definition Station.h:37

◆ operator<<() [8/12]

std::ostream & MuonGM::operator<< ( std::ostream & os,
const sTGCComponent & c )

Definition at line 8 of file sTGCComponent.cxx.

8 {
9 os << "Component " << c.name << std::endl;
10 return os;
11 }

◆ operator<<() [9/12]

std::ostream & MuonGM::operator<< ( std::ostream & os,
const TgcComponent & c )

Definition at line 12 of file TgcComponent.cxx.

12 {
13 os << "Component " << c.name << std::endl;
14 return os;
15 }

◆ operator<<() [10/12]

std::ostream & MuonGM::operator<< ( std::ostream & ostr,
const Amg::Transform3D & trans )

Definition at line 14 of file MuonDetDescr/MuonGeoModelTest/src/GeoModelMdtTest.cxx.

14 {
15 ostr<<Amg::toString(trans, 3);
16 return ostr;
17}
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.

◆ operator<<() [11/12]

template<typename VType>
std::ostream & MuonGM::operator<< ( std::ostream & ostr,
const std::set< VType > & s )

Definition at line 37 of file MuonDetDescr/MuonGeoModelTest/src/GeoModelTgcTest.cxx.

37 {
38 unsigned int k=1;
39 for (const VType& ele : s){
40 ostr<<ele;
41 if (k != s.size()) ostr<<";";
42 ++k;
43 }
44 return ostr;
45}

◆ operator<<() [12/12]

template<typename VType>
std::ostream & MuonGM::operator<< ( std::ostream & ostr,
const std::vector< VType > & v )

Definition at line 30 of file MuonDetDescr/MuonGeoModelTest/src/GeoModelTgcTest.cxx.

30 {
31 for (size_t k = 0 ; k <v.size(); ++k){
32 ostr<<v[k];
33 if ( k+1 != v.size())ostr<<",";
34 }
35 return ostr;
36}

◆ ProcessAlignements()

template<class TYPEdnaszt, class TYPEaszt>
void MuonGM::ProcessAlignements ( MYSQL & mysql,
const TYPEdnaszt dnaszt,
const TYPEaszt * aszt )
static

Definition at line 835 of file DBReader.h.

835 {
836 MsgStream log(Athena::getMessageSvc(), "MuGM:ProcessAlignements");
837
838
839 if (verbose_alimap) {
840 log << MSG::VERBOSE << " ProcessAlignements:: how many stations there are ? " << mysql.NStations() << endmsg;
841 }
842 int fi = 0;
843 int zi = 0;
845 for (unsigned int ipos = 0; ipos < dnaszt->size(); ipos++) {
846 std::string name = std::string(aszt[ipos].type, 0, 3);
847 fi = aszt[ipos].jff - 1; // jff 1-8; we want 0-7
848 zi = aszt[ipos].jzz;
849 if (verbose_alimap) {
850 log << MSG::VERBOSE << " ProcessAlignements:: --- Alignment for " << name << endmsg;
851 }
852 std::string key = mysql.allocPosBuildKey(name, fi, zi);
853 int subtype = mysql.allocPosFindSubtype(key);
854 int cutout = mysql.allocPosFindCutout(key);
855
856 if (subtype != 0) {
857 if (verbose_alimap) {
858 log << MSG::VERBOSE << " corresponding subtype/cutout are " << subtype << "/" << cutout << endmsg;
859 }
860 std::string stname = name + MuonGM::buildString(subtype, 1);
861
862 Station *stat = mysql.GetStation(stname);
863 if (stat == NULL) {
864 if (verbose_alimap) {
865 log << MSG::VERBOSE << " Station named " << stname << " not found " << endmsg;
866 }
867 continue;
868 } else { // search for the correct position entries in this station:
869 pit = stat->FindPosition(zi, fi);
870 if (pit != stat->end()) {
871 if ((*pit).second.zindex == zi && (*pit).second.phiindex == fi) {
872 AlignPos ap;
873 ap.tras = 0. * Gaudi::Units::cm; // in cm from NOVA...
874 ap.traz = 0. * Gaudi::Units::cm; // in cm
875 ap.trat = 0. * Gaudi::Units::cm; // in cm
876 ap.rots = 0.; // in radians
877 ap.rotz = 0.; // in radians
878 ap.rott = 0.; // in radians
879
880
881 ap.tras = aszt[ipos].tras * Gaudi::Units::cm; // in cm from NOVA...
882 ap.traz = aszt[ipos].traz * Gaudi::Units::cm; // in cm
883 ap.trat = aszt[ipos].trat * Gaudi::Units::cm; // in cm
884 ap.rots = aszt[ipos].rots; // in radians
885 ap.rotz = aszt[ipos].rotz; // in radians
886 ap.rott = aszt[ipos].rott; // in radians
887
888 if (verbose_alimap) {
889 log << MSG::VERBOSE << "A-line: " << ap.tras << " " << ap.traz << " " << ap.trat << " " << ap.rots << " " << ap.rotz << " " << ap.rott
890 << endmsg;
891 }
892
893 ap.phiindex = aszt[ipos].jff - 1; // jff 1-8, not 0-7?
894 ap.jobindex = aszt[ipos].job; // jff 1-8, not 0-7?
895 ap.zindex = aszt[ipos].jzz;
896 ap.tectype = stname;
897 // is this a barrel station? E/T/C = ec, B/R = barrel:
898 if (name.compare(0, 1, "B") == 0 || name.compare(0, 1, "R") == 0) {
899 ap.isBarrel = true;
900 ap.isTrapezoid = false; // Barrel MDTs, RPCs.
901 } else {
902 ap.isBarrel = false;
903 ap.isTrapezoid = true; // EC MDTs, CSCs ?all TGCs?
904 }
905
906 // Deal with Pb-positioner possibility:
907 if ((*pit).second.isBarrelLike) {
908 // std::cout << "Probably a Pb ?" << stname << std::endl;
909 ap.isBarrel = true;
910 }
911 if (verbose_alimap) {
912 log << MSG::VERBOSE << " Setting aligned position for station " << stname << " with key " << key << endmsg;
913 }
914 stat->SetAlignPos(ap);
915 }
916 }
917 }
918 } else {
919 if (verbose_alimap) {
920 log << MSG::VERBOSE << " No Position allocated for key " << key << endmsg;
921 }
922 }
923 }
924 } // end ProcessAlignements
#define endmsg
#define verbose_alimap
Definition DBReader.h:105
const Station * GetStation(const std::string &name) const
Definition MYSQL.cxx:51
int NStations() const
Definition MYSQL.cxx:230
std::string allocPosBuildKey(const std::string &statType, int fi, int zi) const
Definition MYSQL.cxx:184
int allocPosFindCutout(const std::string &statType, int fi, int zi) const
Definition MYSQL.cxx:201
int allocPosFindSubtype(const std::string &statType, int fi, int zi) const
Definition MYSQL.cxx:196
IMessageSvc * getMessageSvc(bool quiet=false)
std::string buildString(int i, int ncha)
str subtype
Definition subproc.py:19

◆ ProcessCHV()

template<class TYPEdhwchv, class TYPEwchv>
void MuonGM::ProcessCHV ( MYSQL & mysql,
const TYPEdhwchv dhwchv,
const TYPEwchv * wchv,
const std::string & s )
static

Definition at line 551 of file DBReader.h.

552 {
553 const Technology *t = mysql.GetTechnology(s);
554 if (t != NULL)
555 return;
556
557 int nStruct = dhwchv->size();
558 CHV *chv = new CHV(mysql, s);
559 nchv++;
560
561 for (int i = 0; i < nStruct; i++) {
562 if (s.compare(3, s.size() - 3, MuonGM::buildString(wchv[i].jsta, 2)) == 0) {
563 chv->thickness = wchv[i].thickness * Gaudi::Units::cm;
564 chv->largeness = wchv[i].largeness * Gaudi::Units::cm;
565 chv->height = wchv[i].heightness * Gaudi::Units::cm;
566 }
567 }
568 } // end of ProcessCHV
Technology * GetTechnology(const std::string &name)
Definition MYSQL.cxx:105
static std::atomic< int > nchv
Definition DBReader.h:147

◆ ProcessCMI()

template<class TYPEdhwcmi, class TYPEwcmi>
void MuonGM::ProcessCMI ( MYSQL & mysql,
const TYPEdhwcmi dhwcmi,
const TYPEwcmi * wcmi,
const std::string & s )
static

Definition at line 590 of file DBReader.h.

591 {
592 const Technology *t = mysql.GetTechnology(s);
593 if (t != NULL)
594 return;
595
596 int nStruct = dhwcmi->size();
597 CMI *cmi = new CMI(mysql, s);
598 ncmi++;
599
600 for (int i = 0; i < nStruct; i++) {
601 if (s.compare(3, s.size() - 3, MuonGM::buildString(wcmi[i].jsta, 2)) == 0) {
602 cmi->thickness = wcmi[i].thickness * Gaudi::Units::cm;
603 cmi->largeness = wcmi[i].largeness * Gaudi::Units::cm;
604 cmi->height = wcmi[i].heightness * Gaudi::Units::cm;
605 }
606 }
607 } // end of ProcessCMI
static std::atomic< int > ncmi
Definition DBReader.h:149

◆ ProcessCRO()

template<class TYPEdhwcro, class TYPEwcro>
void MuonGM::ProcessCRO ( MYSQL & mysql,
const TYPEdhwcro dhwcro,
const TYPEwcro * wcro,
const std::string & s )
static

Definition at line 571 of file DBReader.h.

571 {
572 const Technology *t = mysql.GetTechnology(s);
573 if (t != NULL)
574 return;
575
576 int nStruct = dhwcro->size();
577 CRO *cro = new CRO(mysql, s);
578 ncro++;
579
580 for (int i = 0; i < nStruct; i++) {
581 if (s.compare(3, s.size() - 3, MuonGM::buildString(wcro[i].jsta, 2)) == 0) {
582 cro->thickness = wcro[i].thickness * Gaudi::Units::cm;
583 cro->largeness = wcro[i].largeness * Gaudi::Units::cm;
584 cro->height = wcro[i].heightness * Gaudi::Units::cm;
585 }
586 }
587 } // end of ProcessCRO
static std::atomic< int > ncro
Definition DBReader.h:148

◆ ProcessCSC()

template<class TYPEdhwcsc, class TYPEwcsc>
void MuonGM::ProcessCSC ( MYSQL & mysql,
const TYPEdhwcsc dhwcsc,
const TYPEwcsc * wcsc,
const std::string & s )
static

Definition at line 369 of file DBReader.h.

369 {
370 MsgStream log(Athena::getMessageSvc(), "MuGM:ProcessCSC");
371 log << MSG::DEBUG << " Enter in ProcessCSC" << endmsg;
372
373 const Technology *t = mysql.GetTechnology(s);
374 if (t != NULL)
375 return;
376
377 CSC *csc = new CSC(mysql, s);
378 csc->numOfLayers = 0;
379 ncsc++;
380
381 std::string tname = s;
382 while (tname != "XXXXX") {
383 for (unsigned int i = 0; i < dhwcsc->size(); i++) {
384 if (tname.compare(3, s.size() - 3, MuonGM::buildString(wcsc[i].jsta, 2)) == 0) {
385 csc->numOfLayers = wcsc[i].laycsc;
386 csc->totalThickness = wcsc[i].ttotal * Gaudi::Units::cm;
387 csc->thickness = csc->totalThickness;
388 csc->honeycombthick = wcsc[i].tnomex * Gaudi::Units::cm;
389
390 csc->g10thick = wcsc[i].tlag10 * Gaudi::Units::cm; // csc->g10thick = 0.0820*Gaudi::Units::cm;
391
392 // wire spacing
393 csc->wirespacing = wcsc[i].wispa * Gaudi::Units::cm;
394 // anode-cathode distance
395 csc->anocathodist = wcsc[i].dancat * Gaudi::Units::cm;
396 // gapbetwcathstrips
397 csc->gapbetwcathstrips = wcsc[i].gstrip * Gaudi::Units::cm;
398
399 // precision (Radial) strip pitch
400 csc->cathreadoutpitch = wcsc[i].pcatre * Gaudi::Units::cm; // it was not used before but set by hand in CscReadoutEl.
401 // Azimuthal strip pitch
402
403 // csc->phireadoutpitch = wcsc[i].psndco*Gaudi::Units::cm;
404 csc->phireadoutpitch = wcsc[i].azcat * Gaudi::Units::cm;
405 // std::cerr << " do we come here ??? csc->phireadoutpitch = " << csc->phireadoutpitch << std::endl;
406
407 // std::cerr << " csc->phireadoutpitch = " << csc->phireadoutpitch << " csc->cathreadoutpitch "<< csc->cathreadoutpitch << std::endl;
408 if (csc->phireadoutpitch == 0.) {
409 log << MSG::WARNING << " csc->phireadoutpitch == 0 in layout " << mysql.getGeometryVersion() << endmsg;
410 }
411 // number of strips / layer / view
412
413 csc->nEtastrips = 192;
414 csc->nPhistrips = 48;
415
416 // precision (Radial) strip width
417 csc->readoutstripswidth = wcsc[i].wrestr * Gaudi::Units::cm;
418 // Azimuthal strip width
419 csc->floatingstripswidth = 0.;
420 csc->phistripwidth = wcsc[i].wflstr * Gaudi::Units::cm; // CTB and layout Q interpretation
421
422 // dead materials
423 csc->rectwasherthick = wcsc[i].trrwas * Gaudi::Units::cm;
424 csc->roxacellwith = 54.96 * Gaudi::Units::mm; // CTB, layout Q, R, etc: must be computed
425 csc->roxwirebargap = wcsc[i].groxwi * Gaudi::Units::cm;
426 csc->fullgasgapwirewidth = wcsc[i].wgasba * Gaudi::Units::cm;
427 csc->fullwirefixbarwidth = wcsc[i].wfixwi * Gaudi::Units::cm;
428 csc->wirebarposx = wcsc[i].pba1wi * Gaudi::Units::cm;
429 csc->wirebarposy = wcsc[i].pba2wi * Gaudi::Units::cm;
430 csc->wirebarposz = wcsc[i].pba3wi * Gaudi::Units::cm;
431
432 if (tname == s)
433 return;
434 }
435 }
436
437 if (csc->numOfLayers == 0) {
438 // no entry has been found with the current technology sub-type
439 tname = "CSC" + MuonGM::buildString(MuonGM::strtoint(s, 4, 2) - 1, 2);
440 log << MSG::WARNING << " No DB entry found for the current technology sub-type " << s << "\n using previous sub-type " << tname
441 << " // Layout = " << mysql.getGeometryVersion() << endmsg;
442 } else {
443
444 if (tname == s)
445 return;
446 // update by hand number not available in the DB
447
448 log << MSG::WARNING << " update by hand a few numbers for the current technology sub-type " << s << " // Layout = " << mysql.getGeometryVersion()
449 << " OK if layout is Q02, Q02_initial" << endmsg;
450 // precision (Radial) strip pitch
451 csc->cathreadoutpitch = 5.31 * Gaudi::Units::mm;
452 // Azimuthal strip pitch
453 csc->phireadoutpitch = 21.0 * Gaudi::Units::mm;
454 // precision (Radial) strip width
455 csc->readoutstripswidth = 1.52 * Gaudi::Units::mm;
456 // Azimuthal strip width
457 csc->floatingstripswidth = 0; // layout P interpretation
458 csc->phistripwidth = 20.60 * Gaudi::Units::mm;
459 return;
460 }
461 }
462 }
@ CSC
Definition RegSelEnums.h:34
double wirespacing
double wirebarposz
double gapbetwcathstrips
double floatingstripswidth
double roxacellwith
double phireadoutpitch
double totalThickness
double honeycombthick
double fullgasgapwirewidth
double cathreadoutpitch
double phistripwidth
double rectwasherthick
double anocathodist
double readoutstripswidth
double roxwirebargap
double wirebarposy
double wirebarposx
double fullwirefixbarwidth
const std::string & getGeometryVersion() const
Definition MYSQL.cxx:258
static std::atomic< int > ncsc
Definition DBReader.h:143
int strtoint(std::string_view str, unsigned int istart, unsigned int length)

◆ ProcessCutouts()

template<class TYPEdnacut, class TYPEacut, class TYPEdnalin, class TYPEalin, class TYPEdnatyp, class TYPEatyp>
void MuonGM::ProcessCutouts ( MYSQL & mysql,
const TYPEdnacut dnacut,
const TYPEacut * acut,
const TYPEdnalin dnalin,
const TYPEalin * alin,
const TYPEdnatyp dnatyp,
const TYPEatyp * atyp )
static

Definition at line 1107 of file DBReader.h.

1107 {
1108 MsgStream log(Athena::getMessageSvc(), "MuGM:ProcCutouts");
1109
1110 log << MSG::INFO << " Processing Cutouts for geometry layout " << mysql.getLayoutName() << endmsg;
1111
1112 std::string name = "XXX0", type_name = "XXX";
1113
1114 int countalin = 0;
1115
1116 // loop over the banks of station components with cutouts: ACUT
1117 for (unsigned int icomp = 0; icomp < dnacut->size(); ++icomp) {
1118 log << MSG::VERBOSE << " ------------- this is ACUT = " << icomp + 1 << " out of " << dnacut->size() << " station type index = " << acut[icomp].i
1119 << " cutout index: " << acut[icomp].icut << " there are " << acut[icomp].n << " cutouts in this station" << endmsg;
1120
1121 // loop over the banks of cutouts: ALIN
1122 if (countalin + acut[icomp].n <= (int)dnalin->size()) {
1123 for (int ialin = countalin; ialin < countalin + acut[icomp].n; ++ialin) {
1124 log << MSG::VERBOSE << " this is ALIN = " << ialin + 1 << " out of " << dnalin->size() << " Station type =" << alin[ialin].jtyp << " Index/Cutout-index: ("
1125 << alin[ialin].indx << "," << alin[ialin].icut << ") should match (" << acut[icomp].i << "," << acut[icomp].icut << ")"
1126 << " component with subcut i = " << alin[ialin].i << endmsg;
1127 Cutout *c = new Cutout();
1128 c->dx = alin[ialin].dx * Gaudi::Units::cm;
1129 c->dy = alin[ialin].dy * Gaudi::Units::cm;
1130 c->widthXs = alin[ialin].width_xs * Gaudi::Units::cm;
1131 c->widthXl = alin[ialin].width_xl * Gaudi::Units::cm;
1132
1133 if (alin[ialin].jtyp == 11 && (c->dy > 0.0001 && c->dy < 1.)) {
1134 log << MSG::VERBOSE << "DBREADER redefining dy of the cutout from " << c->dy;
1135 c->dy = 0.000 * Gaudi::Units::mm;
1136 log << " to " << c->dy << endmsg;
1137 }
1138
1139 c->lengthY = alin[ialin].length_y * Gaudi::Units::cm;
1140 c->excent = alin[ialin].excent * Gaudi::Units::cm;
1141 c->dead1 = alin[ialin].dead1;
1142
1143 // temporary fix for bug in Nova/Oracle: 18/05/2006 I don't think this is needed anymore
1144 // c->dead1 = 10.*alin[ialin].dead1;
1145 c->ijob = alin[ialin].i;
1146 c->subtype = alin[ialin].indx;
1147 c->icut = alin[ialin].icut;
1148
1149 // name is the station name (type+subtype) BML2, BIS1,etc.
1150 unsigned int type_ind;
1151 for (type_ind = 0; type_ind < dnatyp->size(); ++type_ind) {
1152 if (alin[ialin].jtyp == atyp[type_ind].jtyp)
1153 break;
1154 }
1155
1156 if (strcmp(atyp[type_ind].type.c_str(), "!") != 0) {
1157 type_name = std::string(atyp[type_ind].type, 0, 3);
1158 name = type_name + MuonGM::buildString(alin[ialin].indx, -1);
1159 Station *stat = mysql.GetStation(name);
1160 if (stat == NULL) {
1161 delete c;
1162 c = NULL;
1163 log << MSG::ERROR << " station " << name << " not found! " << endmsg;
1164 continue;
1165 }
1166
1167 stat->SetCutout(c);
1168 log << MSG::VERBOSE << " adding a new cut-line to station " << stat->GetName() << " cutindex/Stsubtype/component " << c->icut << "/" << c->subtype << "/"
1169 << c->ijob << endmsg;
1170 log << MSG::VERBOSE << " There are now " << stat->GetNrOfCutouts() << " cutouts in station " << stat->GetName() << endmsg;
1171 } else {
1172 delete c;
1173 c = NULL;
1174 log << MSG::ERROR << " ProcessCutouts station-name not well defined " << atyp[type_ind].type << endmsg;
1175 assert(0);
1176 type_name = "XXX"; // just to take care of funny stuff
1177 name = type_name + MuonGM::buildString(0, -1);
1178 }
1179 } // for (int ialin = countalin; ialin<countalin+acut[icomp].n; ++ialin)
1180 } // if (countalin+acut[icomp].n <= (int)dnalin->size())
1181 countalin = countalin + acut[icomp].n;
1182 } // for (unsigned int icomp = 0; icomp<dnacut->size(); ++icomp)
1183
1184 log << MSG::INFO << " Processing Cutouts DONE" << endmsg;
1185
1186 } // end of ProcessCutouts
const std::string & getLayoutName() const
Definition MYSQL.cxx:262

◆ ProcessDED()

template<class TYPEdhwded, class TYPEwded>
void MuonGM::ProcessDED ( MYSQL & mysql,
const TYPEdhwded dhwded,
const TYPEwded * wded,
const std::string & s )
static

Definition at line 531 of file DBReader.h.

531 {
532 const Technology *t = mysql.GetTechnology(s);
533 if (t != NULL)
534 return;
535
536 DED *ded = new DED(mysql, s);
537 nded++;
538
539 for (unsigned int i = 0; i < dhwded->size(); i++) {
540 if (s.compare(3, s.size() - 3, MuonGM::buildString(wded[i].jsta, 2)) == 0) {
541 // a lot of confusion in the various versions of the geometry in nova
542 ded->AlThickness = 0.3 * Gaudi::Units::mm;
543 ded->thickness = (wded[i].auphcb) * Gaudi::Units::cm;
544 ded->HoneyCombThickness = ded->thickness - 2. * ded->AlThickness;
545 break;
546 }
547 }
548 } // end of ProcessDED
double HoneyCombThickness
double AlThickness
static std::atomic< int > nded
Definition DBReader.h:145

◆ ProcessLBI()

template<class TYPEdhwlbi, class TYPEwlbi>
void MuonGM::ProcessLBI ( MYSQL & mysql,
const TYPEdhwlbi dhwlbi,
const TYPEwlbi * wlbi,
const std::string & s )
static

Definition at line 610 of file DBReader.h.

611 {
612 const Technology *t = mysql.GetTechnology(s);
613 if (t != NULL)
614 return;
615
616 int nStruct = dhwlbi->size();
617 LBI *lbi = new LBI(mysql, s);
618 nlbi++;
619
620 for (int i = 0; i < nStruct; i++) {
621 if (s.compare(2, s.size() - 2, MuonGM::buildString(wlbi[i].jsta, 2)) == 0) {
622 lbi->thickness = wlbi[i].thickness * Gaudi::Units::cm;
623 lbi->height = wlbi[i].height * Gaudi::Units::cm;
624 lbi->lowerThickness = wlbi[i].lowerThickness * Gaudi::Units::cm;
625 lbi->yShift = wlbi[i].yShift * Gaudi::Units::cm;
626 }
627 }
628 } // end of ProcessLBI
float lowerThickness
static std::atomic< int > nlbi
Definition DBReader.h:150

◆ ProcessMDT()

template<class TYPEdhwmdt, class TYPEwmdt>
void MuonGM::ProcessMDT ( MYSQL & mysql,
const TYPEdhwmdt dhwmdt,
const TYPEwmdt * wmdt,
const std::string & s )
static

Definition at line 154 of file DBReader.h.

154 {
155 const Technology *t = mysql.GetTechnology(s);
156 if (t != NULL)
157 return;
158
159 MDT *mdt = new MDT(mysql, s);
160 nmdt++;
161
162 for (unsigned int i = 0; i < dhwmdt->size(); i++) {
163 if (s.compare(3, s.size() - 3, MuonGM::buildString(wmdt[i].iw, 2)) == 0) {
164 mdt->numOfLayers = wmdt[i].laymdt;
165 mdt->innerRadius = wmdt[i].tubrad * Gaudi::Units::cm;
166 mdt->totalThickness = wmdt[i].tubsta * Gaudi::Units::cm;
167 mdt->pitch = wmdt[i].tubpit * Gaudi::Units::cm;
168 mdt->thickness = mdt->totalThickness;
169 mdt->tubeDeadLength = 0; // cannot be defined here (it depends on chamber size)
170 // mdt->endPlugLength is not OK in p03
171 // mdt->endPlugLength = wmdt[i].tubdea*Gaudi::Units::cm;
172 mdt->tubeEndPlugLength = wmdt[i].tubdea * Gaudi::Units::cm;
173
174 mdt->tubeWallThickness = wmdt[i].tubwal * Gaudi::Units::cm;
175
176 for (unsigned int k = 0; k < 4; k++)
177 mdt->y[k] = wmdt[i].tubyco[k] * Gaudi::Units::cm;
178 for (unsigned int j = 0; j < 4; j++)
179 mdt->x[j] = wmdt[i].tubxco[j] * Gaudi::Units::cm;
180 }
181 }
182 } // end of ProcessMDT
@ MDT
Definition RegSelEnums.h:31
double tubeEndPlugLength
double tubeWallThickness
double innerRadius
double tubeDeadLength
double totalThickness
std::array< double, 4 > y
std::array< double, 4 > x
static std::atomic< int > nmdt
Definition DBReader.h:140

◆ ProcessPositions()

template<class TYPEdnaptp, class TYPEaptp>
void MuonGM::ProcessPositions ( MYSQL & mysql,
const TYPEdnaptp dnaptp,
const TYPEaptp * aptp )
static

Definition at line 631 of file DBReader.h.

631 {
632 MsgStream log(Athena::getMessageSvc(), "MuGM:ProcPosition");
633
634 const MDT *mdtobj = dynamic_cast<const MDT*>(mysql.GetATechnology("MDT0"));
635 double default_halfpitch = 0.5 * (mdtobj->pitch);
636 double halfpitch = default_halfpitch;
637
638 std::string oldname = "XXX0";
639 std::string oldnamejtyp = "XXX";
640
641 // np counter for station elements in space
642 int np = 0;
643 // nswithpos counter for stations (BML1) with >= element positioned
644 int nswithpos = 0;
645 // njtyp counter for station types (BML) with >= element positioned
646 int njtyp = 0;
647 std::vector<std::string> jtypvec;
648 std::vector<std::string> jtypstvec;
649
650 for (unsigned int ipos = 0; ipos < dnaptp->size(); ipos++) {
651 char stype_name[3];
652 // type is aptp[ipos].type
653 // subtype is aptp[ipos].i
654 int subType = aptp[ipos].i;
655 int iCut = aptp[ipos].icut;
656
657 sprintf(stype_name, "%i", aptp[ipos].i);
658 std::string name = std::string(aptp[ipos].type, 0, 3) + stype_name;
659 bool already_there = false;
660
661 if (name != oldname) {
662 for (auto it = jtypstvec.begin(); it != jtypstvec.end(); ++it) {
663 if (name == (*it))
664 already_there = true;
665 }
666
667 if (!already_there) {
668 jtypstvec.push_back(name);
669 nswithpos++;
670 if (verbose_posmap) {
671 log << MSG::VERBOSE << " Building position map for station " << name << " # of stat.s positioned up to now " << nswithpos << endmsg;
672 }
673 } else {
674 if (verbose_posmap) {
675 log << MSG::VERBOSE << " ... it is an update (!) of the map for " << name << endmsg;
676 }
677 }
678 oldname = name;
679 }
680
681 std::string namejtyp = std::string(aptp[ipos].type, 0, 3);
682 already_there = false;
683
684 if (namejtyp != oldnamejtyp) {
685 for (auto it = jtypvec.begin(); it != jtypvec.end(); ++it) {
686 if (namejtyp == (*it))
687 already_there = true;
688 }
689 if (!already_there) {
690 njtyp++;
691 jtypvec.push_back(std::string(aptp[ipos].type, 0, 3));
692 }
693 oldnamejtyp = namejtyp;
694 }
695
696 Station *stat = mysql.GetStation(name);
697 if (stat == NULL) {
698 log << MSG::ERROR << " station " << name << " not found; no " << name << " element will be located at iz " << aptp[ipos].iz << endmsg;
699 continue;
700 }
701 bool hasMdts = stat->hasMdts();
702
703 if (hasMdts) {
704 halfpitch = default_halfpitch;
705 for (int icomp = 0; icomp < stat->GetNrOfComponents(); ++icomp) {
706 const Component *c = stat->GetComponent(icomp);
707 if (c->name.compare(0, 3,"MDT") != 0)
708 continue;
709 const MDT *mdtobj = dynamic_cast<const MDT*>(mysql.GetATechnology(c->name));
710 if (!mdtobj) {
711 log << MSG::ERROR << "Cannot find MDT definition for component " << c->name << endmsg;
712 continue;
713 }
714 halfpitch = 0.5 * (mdtobj->pitch);
715 log << MSG::DEBUG << "Setting halfpitch " << halfpitch << " for station " << name << endmsg;
716 break;
717 }
718 }
719
720 Position p;
721 p.zindex = aptp[ipos].iz;
722 for (int phiindex = 0; phiindex < 8; ++phiindex) {
723 if (aptp[ipos].iphi[phiindex] == 0)
724 continue;
725 p.phitype = aptp[ipos].iphi[phiindex];
726 p.subtype = subType;
727 p.icut = iCut;
728 p.phiindex = phiindex;
729 p.phi = aptp[ipos].dphi + double(phiindex) * 45.;
730 p.radius = aptp[ipos].r * Gaudi::Units::cm;
731 p.z = aptp[ipos].z * Gaudi::Units::cm;
732 if (p.zindex < 0 && name.compare(0, 1,"B") == 0 && hasMdts)
733 p.z = p.z - halfpitch;
734 p.shift = aptp[ipos].s * Gaudi::Units::cm;
735 if (verbose_posmap) {
736 log << MSG::VERBOSE << "p.zindex,p.phi " << p.zindex << " " << p.phiindex << " shift is " << p.shift << endmsg;
737 }
738 // amdb seems to follow the opposite convention about the sign
739 // of rotation around the azimuthal axis (foro them it is a rotation
740 // around their local x axis)
741 // p.inclination = -aptp[ipos].gamma;
742 // p.gamma = -aptp[ipos].gamma;
743 p.inclination = aptp[ipos].gamma;
744 p.gamma = aptp[ipos].gamma;
745 p.alpha = aptp[ipos].alfa;
746 p.beta = aptp[ipos].beta;
747 p.isMirrored = false;
748 p.isBarrelLike = false;
749 if (isBarrelLike(aptp, ipos, phiindex))
750 p.isBarrelLike = true;
751
752 np++;
753 stat->SetPosition(p);
754
755 mysql.addallocPos(name.substr(0, 3), p.phiindex, p.zindex, subType, iCut);
756 }
757 }
758 log << MSG::INFO << " *** N. of stations positioned in the setup " << nswithpos << endmsg;
759 log << MSG::INFO << " *** N. of stations described in mysql " << mysql.NStations() << endmsg;
760 log << MSG::INFO << " *** N. of types " << njtyp << " size of jtypvec " << jtypvec.size() << endmsg;
761
762 int nstat = 0;
763 int nnodes = 0;
764 for (const auto& [name, stat] : mysql.stationMap()) {
765 nstat++;
766 np = stat->Npositions();
767 if (verbose_posmap) {
768 log << MSG::VERBOSE << " Symmetrizing position map for station " << name << " with " << np << " not mirrored positions " << endmsg;
769 }
770
771 for (PositionIterator ip = stat->begin(); ip != stat->end(); ++ip) {
772 int iz = ((*ip).second).zindex;
773 int iphi = ((*ip).second).phiindex;
774 int phitype = ((*ip).second).phitype;
775
776 std::string skey = " ";
777 if (iz > 0 && phitype != 2) {
778 skey = mysql.allocPosBuildKey(name.substr(0, 3), iphi, -iz);
779 if (verbose_posmap) {
780 log << MSG::VERBOSE << " Looking for skey = " << skey << endmsg;
781 }
782 if (mysql.allocPosFind(skey) == mysql.allocPosEnd()) {
783 Position newp;
784 newp.isMirrored = true;
785 newp.phitype = ((*ip).second).phitype;
786 newp.subtype = ((*ip).second).subtype;
787 newp.icut = ((*ip).second).icut;
788
789 newp.zindex = -iz;
790 newp.phiindex = iphi;
791 newp.phi = ((*ip).second).phi;
792 newp.radius = ((*ip).second).radius;
793 if (name[0] == 'B') {
794 newp.z = -((*ip).second).z - stat->GetLength();
795 } else {
796 newp.z = -((*ip).second).z - stat->GetThickness(mysql);
797 }
798
799 newp.shift = ((*ip).second).shift;
800 newp.inclination = ((*ip).second).inclination;
801 newp.alpha = ((*ip).second).alpha;
802 newp.beta = ((*ip).second).beta;
803 newp.gamma = ((*ip).second).gamma;
804 np++;
805 stat->SetPosition(newp);
806
807 if (verbose_posmap) {
808 log << MSG::VERBOSE << " symmetric pos. created at iz,iphi, z " << newp.zindex << " " << newp.phiindex << " " << newp.z << endmsg;
809 }
810 mysql.addallocPos(name.substr(0, 3), newp.phiindex, newp.zindex, newp.subtype, newp.icut);
811 } else {
812 if (verbose_posmap) {
813 log << MSG::VERBOSE << " position already allocated by subtype/cutout " << mysql.allocPosFindSubtype(skey) << "/" << mysql.allocPosFindCutout(skey)
814 << endmsg;
815 }
816 }
817 }
818 }
819 if (verbose_posmap) {
820 log << MSG::VERBOSE << " *** Position map for station " << name << " has " << stat->Npositions() << " entries" << endmsg;
821 }
822 nnodes += stat->Npositions();
823 }
824
825 log << MSG::INFO << " *** : " << nstat << " kinds of stations (type*sub_type) " << endmsg;
826 log << MSG::INFO << " *** : " << nnodes << " physical stations in space - according to the MuonDD DataBase" << endmsg;
827 }
Scalar phi() const
phi method
#define verbose_posmap
Definition DBReader.h:104
#define z
const Technology * GetATechnology(const std::string &name) const
Definition MYSQL.cxx:162
const StationMap & stationMap() const
Definition MYSQL.cxx:227
allocPosIterator allocPosEnd() const
Definition MYSQL.cxx:238
void addallocPos(const std::string &key, int value)
Definition MYSQL.cxx:254
allocPosIterator allocPosFind(const std::string &key) const
Definition MYSQL.cxx:240
static bool isBarrelLike(const TYPEaptp *, int, int)
Definition DBReader.h:829

◆ ProcessRPC()

template<class TYPEdhwrpc, class TYPEwrpc, class TYPEdhwrpcall, class TYPEwrpcall>
void MuonGM::ProcessRPC ( MYSQL & mysql,
const TYPEdhwrpc dhwrpc,
const TYPEwrpc * wrpc,
const TYPEdhwrpcall ,
const TYPEwrpcall * wrpcall,
const std::string & s )
static

Definition at line 185 of file DBReader.h.

185 {
186 MsgStream log(Athena::getMessageSvc(), "MuGM:ProcessRPC");
187
188 const Technology *t = mysql.GetTechnology(s);
189 if (t != NULL)
190 return;
191
192 RPC *rpc = new RPC(mysql, s); // this will enter a new record in the MYSQL technology map
193 nrpc++;
194
195 rpc->centralSupPanelThickness = (wrpcall->tckfsp) * Gaudi::Units::cm;
196 rpc->centralAlSupPanelThickness = (wrpcall->ackfsp) * Gaudi::Units::cm;
197 if (RPCprint) {
198 log << MSG::INFO << "ProcessRPC:: RPC central sup panel: tot & Al " << rpc->centralSupPanelThickness << " " << rpc->centralAlSupPanelThickness << endmsg;
199 }
200
201 rpc->bakeliteThickness = (wrpcall->tckbak) * Gaudi::Units::cm;
202 rpc->bakeliteframesize = 0.5 * (wrpcall->sdedmi) * Gaudi::Units::cm;
203 rpc->gasThickness = (wrpcall->tckgas) * Gaudi::Units::cm;
204 rpc->bakelitePetThickness = 0.190 * Gaudi::Units::mm; // TBM same as Amdb, why hardwired? Not in DblQ00Wrpc!
205 rpc->totalAirThickness = 0.52 * Gaudi::Units::mm; // TBM added
206 rpc->GasGapThickness = 2. * rpc->bakeliteThickness + rpc->gasThickness + 2. * rpc->bakelitePetThickness + rpc->totalAirThickness; // TBM added air thickness;
207 if (RPCprint) {
208 log << MSG::INFO << "ProcessRPC:: Total GasGapThickness " << rpc->GasGapThickness << endmsg;
209
210 log << MSG::INFO << "ProcessRPC:: comes from 2*bak, gas, 2*bakpet " << rpc->bakeliteThickness << " " << rpc->gasThickness << " " << rpc->bakelitePetThickness << endmsg;
211 }
212
214 if (RPCprint) {
215 log << MSG::INFO << "ProcessRPC::WARNING redefining RPC::bakeliteThickness to include pet " << rpc->bakeliteThickness << endmsg;
216 }
217 rpc->spacerDiameter = (wrpcall->spdiam) * Gaudi::Units::cm;
218 rpc->spacerPitch = (wrpcall->sppitc) * Gaudi::Units::cm;
220 rpc->MidChamberDeadRegion_in_z = (wrpcall->zdedmi) * Gaudi::Units::cm;
221
222 if (RPCprint) {
223 log << MSG::INFO << " ProcessRPC:: spacerDiam, pitch, MidChamberDeadRegion_in_s, MidChamberDeadRegion_in_z " << rpc->spacerDiameter << " " << rpc->spacerPitch << " "
225 }
226
227 rpc->petFoilThickness = 0.190 * Gaudi::Units::mm; // TBM this is the same as bakelite PET thickness?
228 if (RPCprint) {
229 log << MSG::INFO << "ProcessRPC:: defining RPC::petfoilThickness = " << rpc->petFoilThickness << endmsg;
230 }
231
232 rpc->stripPanelFoamThickness = (wrpcall->tckssu) * Gaudi::Units::cm;
233 rpc->stripPanelCopperSkinThickness = (wrpcall->tckstr) * Gaudi::Units::cm;
234 rpc->stripPanelStripSidePetThickness = 0.25 * Gaudi::Units::mm; // missing in AmdbNova
235 rpc->stripPanelGroundSidePetThickness = 0.07 * Gaudi::Units::mm; // missing in AmdbNova
236 rpc->frontendBoardWidth = 36. * Gaudi::Units::mm;
237 rpc->backendBoardWidth = 21. * Gaudi::Units::mm;
238 if (RPCprint) {
239 log << MSG::INFO << "ProcessRPC:: stp panel: foam, 2*copper, petg, pets, fe, be " << rpc->stripPanelFoamThickness << " " << rpc->stripPanelCopperSkinThickness << " "
241 << endmsg;
242 }
245 if (RPCprint) {
246 log << MSG::INFO << "ProcessRPC:: stripPanelThickness= " << rpc->stripPanelThickness << endmsg;
247 }
249 if (RPCprint) {
250 log << MSG::INFO << "ProcessRPC::WARNING redefining RPC::stripPanelFoamThickness to include pet on both sides " << rpc->stripPanelFoamThickness << endmsg;
251 }
252
253 rpc->rpcLayerThickness = (wrpcall->tckrla) * Gaudi::Units::cm;
254 double rpcLayerComputedTck = rpc->GasGapThickness + 2 * rpc->stripPanelThickness + rpc->petFoilThickness;
255 if (RPCprint) {
256 log << MSG::INFO << "ProcessRPC:: rpcLayerComputedTck = " << rpcLayerComputedTck << " while rpcLayerThickness in Nova = " << rpc->rpcLayerThickness << endmsg;
257 }
258
259 // until now parameters common to all RPCs
260 int nStruct = dhwrpc->size();
261 bool done = false;
262 for (unsigned int i = 0; (i < dhwrpc->size() && !done); i++) {
263 if (s.compare(3, s.size() - 3, MuonGM::buildString(wrpc[i].jsta, 2)) == 0) {
264 if (RPCprint) {
265 log << MSG::INFO << " ProcessRPC " << s << " index " << i << " jsta =" << wrpc[i].jsta << " strings comparison:: <" << s.substr(3, s.size() - 3) << ">=<"
266 << MuonGM::buildString(wrpc[i].jsta, 2) << ">" << endmsg;
267 }
268
269 done = true;
270
271 rpc->externalSupPanelThickness = (wrpcall->tlohcb) * Gaudi::Units::cm; // TBM
272 rpc->externalAlSupPanelThickness = (wrpcall->alohcb) * Gaudi::Units::cm; // TBM
273 if (RPCprint) {
274 log << MSG::INFO << "ProcessRPC:: RPC external sup panel: tot & Al " << rpc->centralSupPanelThickness << " " << rpc->centralAlSupPanelThickness << endmsg;
275 }
276 rpc->lowerSupPanelThickness = 0;
278 rpc->upperSupPanelThickness = 0;
280
282 if (RPCprint) {
283 log << MSG::INFO << "ProcessRPC:: (computed) Total RPC thickness = " << rpc->TotalThickness << endmsg;
284 }
285 rpc->maxThickness = 46. * Gaudi::Units::mm; // TBM same as (wrpcall->tottck)*Gaudi::Units::cm;
286 rpc->thickness = rpc->maxThickness;
287 if (RPCprint) {
288 log << MSG::INFO << "ProcessRPC:: RPC max thickness " << rpc->maxThickness << endmsg;
289 }
290
291 rpc->stripPitchS = (wrpc[i].spitch) * Gaudi::Units::cm;
292 rpc->stripPitchZ = (wrpc[i].zpitch) * Gaudi::Units::cm;
293 rpc->stripSeparation = (wrpc[i].dedstr) * Gaudi::Units::cm;
294
295 if (RPCprint) {
296 log << MSG::INFO << "ProcessRPC:: s_pitch, z_pitch " << rpc->stripPitchS << " " << rpc->stripPitchZ << endmsg;
297 }
298
299 rpc->NstripPanels_in_s = wrpc[i].nsrest;
300 rpc->NstripPanels_in_z = 1;
301 rpc->NGasGaps_in_s = wrpc[i].nzrest;
302 rpc->NGasGaps_in_z = 1;
303
304 if (RPCprint) {
305 log << MSG::INFO << "ProcessRPC:: ngg, nsp, nzp " << rpc->NGasGaps_in_s << " " << rpc->NstripPanels_in_s << " " << rpc->NstripPanels_in_z << endmsg;
306 }
307 }
308 if (RPCprint) {
309 log << MSG::INFO << " index = " << i << " nstruct " << nStruct << " " << dhwrpc->size() << endmsg;
310 }
311 }
312 } // end of ProcessRPC
#define RPCprint
Definition DBReader.h:106
@ RPC
Definition RegSelEnums.h:32
double lowerAlSupPanelThickness
double spacerDiameter
double maxThickness
double bakeliteThickness
double GasGapThickness
double frontendBoardWidth
double gasThickness
double upperSupPanelThickness
double stripPitchZ
double MidChamberDeadRegion_in_z
double lowerSupPanelThickness
double bakeliteframesize
double stripPanelFoamThickness
double stripPanelCopperSkinThickness
double TotalThickness
double totalAirThickness
double stripPanelStripSidePetThickness
double spacerPitch
double centralAlSupPanelThickness
double stripPanelThickness
double stripSeparation
double stripPanelGroundSidePetThickness
double externalAlSupPanelThickness
double centralSupPanelThickness
double backendBoardWidth
double externalSupPanelThickness
double petFoilThickness
double bakelitePetThickness
double upperAlSupPanelThickness
double MidChamberDeadRegion_in_s
double stripPitchS
double rpcLayerThickness
static std::atomic< int > nrpc
Definition DBReader.h:141

◆ ProcessSPA()

template<class TYPEdhwspa, class TYPEwspa>
void MuonGM::ProcessSPA ( MYSQL & mysql,
const TYPEdhwspa dhwspa,
const TYPEwspa * wspa,
const std::string & s )
static

Definition at line 465 of file DBReader.h.

466 {
467 const Technology *t = mysql.GetTechnology(s);
468 if (t != NULL)
469 return;
470
471 SPA *spa = new SPA(mysql, s);
472 nspa++;
473
474 for (unsigned int i = 0; i < dhwspa->size(); i++) {
475 if (s.compare(3, s.size() - 3, MuonGM::buildString(wspa[i].jsta, 2)) == 0) {
476 spa->thickness = wspa[i].tckspa * Gaudi::Units::cm;
477 }
478 }
479 } // end of ProcessSPA
static std::atomic< int > nspa
Definition DBReader.h:144

◆ ProcessStations()

template<class TYPEdnalmn, class TYPEalmn, class TYPEdnatyp, class TYPEatyp, class TYPEdhwmdt, class TYPEwmdt>
void MuonGM::ProcessStations ( MYSQL & mysql,
const TYPEdnalmn dnalmn,
const TYPEalmn * almn,
const TYPEdnatyp dnatyp,
const TYPEatyp * atyp,
const TYPEdhwmdt dhwmdt,
const TYPEwmdt * wmdt )
static

Definition at line 927 of file DBReader.h.

927 {
928 MsgStream log(Athena::getMessageSvc(), "MuGM:ProcStations");
929 log << MSG::INFO << " Processing Stations and Components" << endmsg;
930
931 std::string cartec;
932 Station *stat = NULL, *previous_stat = NULL, *previous_stored = NULL;
933
934 // control on new stations/subtypes
935 int previous_jtyp = 0;
936 int previous_subt = 0;
937 int nstat = 0;
938 std::string name = "XXX0", type_name = "XXX";
939
940 // that doesn't seem right for BME/BMG chambers - no idea if has an impact at the end
941 // in any case it was wrong since every and would have been wrong also in previous code
942 double default_halfpitch = 15.0175 * Gaudi::Units::mm;
943 double halfpitch = default_halfpitch;
944
945 // loop over the banks of station components: ALMN
946 for (unsigned int icomp = 0; icomp < dnalmn->size(); ++icomp) {
947 if (almn[icomp].jtyp != previous_jtyp || almn[icomp].indx != previous_subt) {
948 // a new jtyp and subtyp = almn.indx; then a new station starts here
949 if (previous_stat != NULL && previous_stat != previous_stored) {
950 // define positions of the previous station
951 previous_stored = previous_stat;
952 }
953 // here define a new station
954 // std::cout << "A new station " << std::endl;
955 unsigned int type_ind = 0;
956 // log << MSG::DEBUG << " Look for the index of the type " << endmsg;
957 for (type_ind = 0; type_ind < dnatyp->size(); ++type_ind) {
958 if (almn[icomp].jtyp == atyp[type_ind].jtyp)
959 break;
960 }
961 // name is the station name (type+subtype) BML2, BIS1, EOL2, T1F1, etc
962 if (strcmp(atyp[type_ind].type.c_str(), "!") != 0) {
963 type_name = std::string(atyp[type_ind].type, 0, 3);
964 name = type_name + MuonGM::buildString(almn[icomp].indx, -1);
965 } else {
966 log << MSG::ERROR << " ProcessStations station-name not well defined " << atyp[type_ind].type << endmsg;
967 assert(0);
968 type_name = "XXX"; // just to take care of funny stuff
969 name = type_name + MuonGM::buildString(0, -1);
970 }
971
972 stat = new Station(mysql, name);
973 previous_stat = stat;
974 nstat++;
975 log << MSG::DEBUG << " a new station has been built with name " << name << " nstat = " << nstat << endmsg;
976
977 // ahead loop to determine halfpitch
978 halfpitch = default_halfpitch;
979 for (unsigned int ic = icomp; ic < dnalmn->size(); ++ic) {
980 if (almn[icomp].jtyp != almn[ic].jtyp || almn[icomp].indx != almn[ic].indx)
981 break;
982 int jtech = almn[ic].iw;
983 cartec = std::string(almn[ic].tec, 0, 3);
984 if (cartec == "MDT") {
985 if (((unsigned int)(jtech - 1)) > dhwmdt->size()) {
986 log << MSG::ERROR << "MDT jtech index not found in W MDT table, cannot determine half pitch"
987 << " for " << name << endmsg;
988 continue;
989 }
990 halfpitch = 0.5 * wmdt[jtech - 1].tubpit * Gaudi::Units::cm;
991 log << MSG::DEBUG << "Found new halfpitch: " << halfpitch << " for " << name << endmsg;
992 break;
993 }
994 }
995 }
996
997 bool known_comp = true;
998 int jtech = almn[icomp].iw;
999 cartec = std::string(almn[icomp].tec, 0, 3);
1000
1001 StandardComponent *c = NULL;
1002 if (cartec == "CSC") {
1003 c = new CscComponent;
1004 } else if (cartec == "SPA") {
1005 c = new SpaComponent;
1006 } else if (cartec == "MDT") {
1007 c = new MdtComponent;
1008 } else if (cartec == "RPC") {
1009 c = new RpcComponent;
1010 } else if (cartec == "TGC") {
1011 c = new TgcComponent;
1012 } else if (cartec == "CRO" || cartec == "CMI" || cartec == "CHV") {
1013 c = new CbmComponent;
1014 } else if (cartec.compare(0, 2, "LB") == 0) {
1015 c = new LbiComponent;
1016 } else {
1017 c = new StandardComponent;
1018 }
1019
1020 // define here common properties
1021 c->posx = almn[icomp].dx * Gaudi::Units::cm;
1022 c->posy = almn[icomp].dy * Gaudi::Units::cm;
1023 c->posz = almn[icomp].dz * Gaudi::Units::cm;
1024 c->index = almn[icomp].job;
1025 c->name = cartec + MuonGM::buildString(almn[icomp].iw, 2);
1026 c->iswap = almn[icomp].ishape;
1027 c->dx1 = almn[icomp].width_xs * Gaudi::Units::cm;
1028 c->dx2 = almn[icomp].width_xl * Gaudi::Units::cm;
1029 c->dy = almn[icomp].length_y * Gaudi::Units::cm;
1030 c->excent = almn[icomp].excent * Gaudi::Units::cm;
1031 c->deadx = almn[icomp].dead1 * Gaudi::Units::cm;
1032 c->deady = almn[icomp].dead2 * Gaudi::Units::cm;
1033 c->dead3 = almn[icomp].dead3 * Gaudi::Units::cm;
1034
1035 if (cartec == "CSC") {
1036 CscComponent *derc = static_cast<CscComponent *>(c);
1037 if (derc == NULL) {
1038 log << MSG::WARNING << " There is a problem" << endmsg;
1039 }
1040 if (name[2] == 'L') {
1041 derc->dy = 1129.20 * Gaudi::Units::mm; // AMDB-Q and CTB
1042 // DHW: fix values from AMDB
1043 // else derc->dy = 1111.5*Gaudi::Units::mm;
1044 derc->maxwdy = almn[icomp].length_y * Gaudi::Units::cm;
1045 } else {
1046 derc->maxwdy = c->dy;
1047 }
1048 } else if (cartec == "SPA") {
1049 SpaComponent *derc = static_cast<SpaComponent *>(c);
1050 derc->maxwdy = derc->dy;
1051 if (jtech == 6 && name.compare(0, 3, "CSL") == 0) {
1052 derc->dy = 1129.20 * Gaudi::Units::mm; // AMDB-Q and CTB
1053 }
1054 } else if (cartec == "MDT") {
1055 MdtComponent *derc = static_cast<MdtComponent *>(c);
1056 // relevant only for endcap MDTs
1057 derc->tubelenStepSize = derc->dead3;
1058 // long width for MDTs is the length of the longest tubes
1059 // long width of a trapezoid enclosing everything must be larger ( derc->dx2 )
1060 derc->dx2 = derc->dx2 + (derc->tubelenStepSize + halfpitch) * (derc->dx2 - derc->dx1) / (derc->dy - derc->tubelenStepSize);
1061 // length for MDTs is the length of a tube layer;
1062 // length of a trapezoid enclosing the multilayer must be larger by halfpitch
1063 derc->dy = derc->dy + halfpitch;
1064 } else if (cartec == "RPC") {
1065 RpcComponent *derc = static_cast<RpcComponent *>(c);
1066 derc->ndivy = 1;
1067 derc->ndivz = 1;
1068 // DHW 4 Feb 09 : no longer needed, read in above: derc->iswap = 1;
1069 } else if (cartec == "DED") {
1070
1071 } else if (cartec == "SUP" || cartec == "TGC" || cartec == "CHV" || cartec == "CRO" || cartec == "CMI" || cartec.compare(0, 2, "LB") == 0) {
1072
1073 if (cartec.compare(0, 2, "LB") == 0) {
1074 LbiComponent *derc = static_cast<LbiComponent *>(c);
1075 derc->associated_CMIsubtype = "";
1076 if ((name == "BMF1" || name == "BMF2" || name == "BMF3" || name == "BMF4" || name == "BMF5" || name == "BMF6") && derc->name == "LB02") {
1077
1078 log << MSG::DEBUG << "In this layout Station" << name << " has LB of type = " << derc->name << " ---- A problem in primary NUMBERS ? ---- resetting to LB01"
1079 << endmsg;
1080 derc->name = "LB01";
1081 }
1082 }
1083 // these are standard components: do nothing
1084 } else {
1085 known_comp = false;
1086 log << MSG::WARNING << " Unknown technology - component " << c->name << " will not be added to station " << stat->GetName() << endmsg;
1087 }
1088
1089 if (known_comp && stat != NULL)
1090 stat->SetComponent(c);
1091 else {
1092 delete c;
1093 c = NULL;
1094 }
1095 if (cartec == "MDT" && stat != NULL)
1096 stat->setHasMdts(true);
1097 // here is the end - define the previous stuff
1098 previous_jtyp = almn[icomp].jtyp;
1099 previous_subt = almn[icomp].indx;
1100 previous_stat = stat;
1101 }
1102 log << MSG::INFO << " Processing Stations and Components DONE" << endmsg;
1103
1104 } // end of ProcessStations
std::string associated_CMIsubtype
int ic
Definition grepfile.py:33

◆ ProcessSUP()

template<class TYPEdhwsup, class TYPEwsup>
void MuonGM::ProcessSUP ( MYSQL & mysql,
const TYPEdhwsup dhwsup,
const TYPEwsup * wsup,
const std::string & s )
static

Definition at line 482 of file DBReader.h.

482 {
483 const Technology *t = mysql.GetTechnology(s);
484 if (t != NULL)
485 return;
486
487 SUP *sup = new SUP(mysql, s);
488 nsup++;
489
490 for (unsigned int i = 0; i < dhwsup->size(); i++) {
491 if (s.compare(3, s.size() - 3, MuonGM::buildString(wsup[i].jsta, 2)) == 0) {
492 sup->alFlangeThickness = wsup[i].xxsup[0] * Gaudi::Units::cm;
493
494 if (s.compare(3, s.size() - 3, "03") == 0) {
495 sup->alHorFlangeLength = (fabs)(wsup[i].zzsup[1]) * Gaudi::Units::cm;
496 sup->alVerFlangeLength = wsup[i].xxsup[1] * Gaudi::Units::cm - wsup[i].xxsup[0] * Gaudi::Units::cm;
497 sup->alVerProfileThickness = wsup[i].zzsup[3] * Gaudi::Units::cm;
498 sup->alHorProfileThickness = wsup[i].xxsup[3] * Gaudi::Units::cm - wsup[i].xxsup[2] * Gaudi::Units::cm;
499 sup->largeVerClearance = wsup[i].xxsup[3] * Gaudi::Units::cm;
500 sup->smallVerClearance = wsup[i].xxsup[2] * Gaudi::Units::cm;
501 sup->HorClearance = wsup[i].zzsup[2] * Gaudi::Units::cm;
502 sup->xAMDB0 = -sup->largeVerClearance - sup->alHorProfileThickness / 2.;
503 sup->yAMDB0 = 0.;
504 sup->zAMDB0 = -sup->alVerProfileThickness - (sup->HorClearance - sup->alVerProfileThickness) / 2.;
506 } else { // SUP1 and SUP2
507 sup->alHorFlangeLength = wsup[i].zzsup[0] * Gaudi::Units::cm;
508 sup->alVerFlangeLength = 0.;
509 sup->alVerProfileThickness = wsup[i].xxsup[0] * Gaudi::Units::cm;
510 sup->alHorProfileThickness = 0.;
511 sup->largeVerClearance = wsup[i].xxsup[1] * Gaudi::Units::cm;
512 sup->smallVerClearance = 0.;
513 sup->HorClearance = 0.;
514 double totzgm = 2. * sup->alHorFlangeLength + sup->alVerProfileThickness + sup->HorClearance;
515 double totxgm = 2. * sup->alFlangeThickness + 2. * sup->alVerFlangeLength + sup->largeVerClearance + sup->smallVerClearance;
516 sup->zAMDB0 = -totzgm / 2. + sup->alVerProfileThickness;
517 sup->xAMDB0 = -totxgm / 2. + sup->alFlangeThickness;
518 sup->yAMDB0 = 0.;
519 if (s[3] == '2') // SUP2
520 sup->zAMDB0 = -sup->zAMDB0;
522 }
525 sup->thickness = sup->totalThickness;
526 }
527 }
528 } // end of ProcessSUP
double alHorProfileThickness
double alHorFlangeLength
double bottomsizewrtAMDB0
double totalThickness
double smallVerClearance
double largeVerClearance
double alFlangeThickness
double alVerFlangeLength
double HorClearance
double topsizewrtAMDB0
double alVerProfileThickness
static std::atomic< int > nsup
Definition DBReader.h:146

◆ ProcessTGC()

template<class TYPEdhwtgc, class TYPEwtgc, class TYPEdhwtgcall, class TYPEwtgcall>
void MuonGM::ProcessTGC ( MYSQL & mysql,
const TYPEdhwtgc dhwtgc,
const TYPEwtgc * wtgc,
const TYPEdhwtgcall dhwtgcall,
const TYPEwtgcall * wtgcall,
const std::string & s )
static

Definition at line 315 of file DBReader.h.

316 {
317 const Technology *tech = mysql.GetTechnology(s);
318 if (tech != NULL)
319 return;
320
321 TGC *tgc = new TGC(mysql, s);
322 ntgc++;
323 std::string v[] = {"muo::TGCGas", "std::G10", "muo::Honeycomb", "std::Copper"};
324 int mat;
325 double p, t;
326
327 for (unsigned int i = 0; i < dhwtgcall->size(); i++) {
328 if (s.compare(3, s.size() - 3,MuonGM::buildString(wtgcall[i].jsta, 2)) ==0 ) {
329 tgc->nlayers = wtgcall[i].nbevol;
330 tgc->thickness = wtgcall[i].widchb * Gaudi::Units::cm;
331 tgc->frame_h = wtgcall[i].fwirch * Gaudi::Units::cm;
332 tgc->frame_ab = wtgcall[i].fwixch * Gaudi::Units::cm;
333
334 int firstj;
335 firstj = 0;
336
337 for (unsigned int j = firstj; j < dhwtgc->size(); j++) {
338 if (wtgc[j].jsta != wtgcall[i].jsta)
339 continue;
340
341 mat = (int)wtgc[j].icovol;
342 p = wtgc[j].zpovol * Gaudi::Units::cm;
343 t = wtgc[j].widvol * Gaudi::Units::cm;
344 tgc->materials.push_back(v[mat - 1]);
345 tgc->positions.push_back(p);
346 tgc->tck.push_back(t);
347 }
348 // parameters for inner structure of TGC,
349 // filled by RDBReaderAtlas::TgcReadoutParameter if available
350 tgc->widthWireSupport = 0.;
351 tgc->widthGasChannel = 0.;
352 tgc->distanceWireSupport = 0.;
353 for (int ilyr = 0; ilyr < 3; ilyr++) {
354 tgc->offsetWireSupport[ilyr] = 0.;
355 }
356 tgc->angleTilt = 0.;
357 tgc->radiusButton = 0.;
358 for (int idir = 0; idir < 2; idir++) {
359 tgc->pitchButton[idir] = 0.;
360 }
361 tgc->angleButton = 0.;
362
363 break;
364 }
365 }
366 } // end of ProcessTGC
double widthGasChannel
std::array< double, 2 > pitchButton
std::array< double, 3 > offsetWireSupport
double angleButton
std::vector< std::string > materials
double widthWireSupport
double distanceWireSupport
std::vector< double > tck
double radiusButton
std::vector< double > positions
static std::atomic< int > ntgc
Definition DBReader.h:142
Definition TgcBase.h:6

◆ round()

float MuonGM::round ( const float toRound,
const unsigned int decimals )

Definition at line 27 of file Mdt.cxx.

27 {
28 unsigned int factor = std::pow(10, decimals);
29 return std::round(toRound * factor) / factor;
30 }

◆ stationPhiTGC()

int MuonGM::stationPhiTGC ( std::string_view stName,
int fi,
int zi_input )

Converts the AMDB phi index to the Identifier phi Index.

Definition at line 41 of file GlobalUtilities.cxx.

41 {
42 // fi and zi_imput are the amdb indices (1, ... 8) and (-8, 8) are their ranges
43 std::string_view stName3 = stName.substr(0, 3);
44 int stphi = 0;
45
46 int zi = std::abs(zi_input);
47 --fi; // start from 0
48
49 if (stName3 == "T4E") {
50 switch (fi) {
51 case 0: stphi = zi; break;
52 case 1: stphi = zi + 3; break;
53 case 2: stphi = zi + 6; break;
54 case 3:
55 stphi = zi + 9; // zi are numbered in order, i.e. 1 and 2
56 break;
57 case 4: stphi = zi + 11; break;
58 case 5: stphi = zi + 14; break;
59 case 6: stphi = zi + 16; break;
60 case 7: stphi = zi + 19; break;
61 default: stphi = 0;
62 }
63 // minumum stPhi at phi 0
64 stphi = stphi - 1;
65 if (stphi < 1) stphi = stphi + 21;
66 } else {
67 int nch = 3;
68 if (stName[2] == 'E') nch = 6;
69 int fioff = std::abs(zi);
70 if (fioff > 3 && stName[2] == 'F') fioff = fioff - 3;
71 // minumum stPhi at phi 0
72 if (stName[2] == 'F')
73 fioff = fioff - 1;
74 else
75 fioff = fioff - 2;
76 stphi = fi * nch + fioff;
77 if (stphi < 1) {
78 if (stName[2] == 'F')
79 stphi = stphi + 24;
80 else
81 stphi = stphi + 48;
82 }
83 }
84 return stphi;
85 }

◆ strtoint()

int MuonGM::strtoint ( std::string_view str,
unsigned int istart,
unsigned int length )

Definition at line 34 of file GlobalUtilities.cxx.

34 {
35 std::string_view s(str.substr(istart, length));
36 int result = -999;
37 std::from_chars(s.data(), s.data() + s.size(), result);
38 return result;
39 }
double length(const pvec &v)

Variable Documentation

◆ maxnlayers

int MuonGM::maxnlayers = 4
constexpr

An MdtReadoutElement corresponds to a single MDT multilayer; therefore typicaly a MDT chamber consists of two MdtReadoutElements, each identified by StationName, StationEta, StationPhi, Technology=0, and Multilayer.

Pointers to all MdtReadoutElements are created in the build() method of the MuonChamber class, and are held in arrays by the MuonDetectorManager, which is responsible for storing, deleting and providing access to these objects.

An MdtReadoutElement holds properties related to its internal structure (i.e. wire pitch) and general geometrical properties (size); it implements tracking interfaces and provides access to typical readout-geometry information: i.e. number of tubes, position of the tubes, distance of a point to the readout side, etc.

The globalToLocalCoords and globalToLocalTransform methods (+ their opposite) define the link between the ATLAS global reference frame and the internal (geo-model defined) local reference frame of any drift tube (which is the frame where local coordinates of SimHits, in output from G4, are expressed).

Definition at line 48 of file MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h.

◆ maxnsteps

int MuonGM::maxnsteps = 10
constexpr

◆ maxwlay

int MuonGM::maxwlay = 4
constexpr

Definition at line 29 of file CscReadoutElement.h.

◆ nchv

std::atomic<int> MuonGM::nchv {0}
static

Definition at line 147 of file DBReader.h.

147{0};

◆ ncmi

std::atomic<int> MuonGM::ncmi {0}
static

Definition at line 149 of file DBReader.h.

149{0};

◆ ncro

std::atomic<int> MuonGM::ncro {0}
static

Definition at line 148 of file DBReader.h.

148{0};

◆ ncsc

std::atomic<int> MuonGM::ncsc {0}
static

Definition at line 143 of file DBReader.h.

143{0};

◆ nded

std::atomic<int> MuonGM::nded {0}
static

Definition at line 145 of file DBReader.h.

145{0};

◆ nlbi

std::atomic<int> MuonGM::nlbi {0}
static

Definition at line 150 of file DBReader.h.

150{0};

◆ nmdt

std::atomic<int> MuonGM::nmdt {0}
static

Definition at line 140 of file DBReader.h.

140{0};

◆ nrpc

std::atomic<int> MuonGM::nrpc {0}
static

Definition at line 141 of file DBReader.h.

141{0};

◆ nspa

std::atomic<int> MuonGM::nspa {0}
static

Definition at line 144 of file DBReader.h.

144{0};

◆ nsup

std::atomic<int> MuonGM::nsup {0}
static

Definition at line 146 of file DBReader.h.

146{0};

◆ ntgc

std::atomic<int> MuonGM::ntgc {0}
static

Definition at line 142 of file DBReader.h.

142{0};