ATLAS Offline Software
Loading...
Searching...
No Matches
MuonGM::DblQ00Aszt Class Reference

#include <DblQ00Aszt.h>

Collaboration diagram for MuonGM::DblQ00Aszt:

Classes

struct  ASZT

Public Member Functions

 DblQ00Aszt ()=default
 ~DblQ00Aszt ()=default
 DblQ00Aszt (IRDBAccessSvc *pAccessSvc, const std::string &GeoTag="", const std::string &GeoNode="")
DblQ00Asztoperator= (const DblQ00Aszt &right)=delete
 DblQ00Aszt (const DblQ00Aszt &)=delete
 DblQ00Aszt (const std::string &asciiFileName)
void WriteAsztToAsciiFile (const std::string &filename)
const ASZTdata () const
unsigned int size () const
std::string getName () const
std::string getDirName () const
std::string getObjName () const

Private Attributes

std::vector< ASZTm_d {}
unsigned int m_nObj {0}

Detailed Description

Definition at line 24 of file DblQ00Aszt.h.

Constructor & Destructor Documentation

◆ DblQ00Aszt() [1/4]

MuonGM::DblQ00Aszt::DblQ00Aszt ( )
default

◆ ~DblQ00Aszt()

MuonGM::DblQ00Aszt::~DblQ00Aszt ( )
default

◆ DblQ00Aszt() [2/4]

MuonGM::DblQ00Aszt::DblQ00Aszt ( IRDBAccessSvc * pAccessSvc,
const std::string & GeoTag = "",
const std::string & GeoNode = "" )

Definition at line 22 of file DblQ00Aszt.cxx.

22 {
23
24 IRDBRecordset_ptr aszt = pAccessSvc->getRecordsetPtr(getName(),GeoTag, GeoNode);
25
26 if(aszt->size()>0) {
27 m_nObj = aszt->size();
28 m_d.resize (m_nObj);
29 if (m_nObj == 0) std::cerr<<"NO Aszt banks in the MuonDD Database"<<std::endl;
30
31 for (size_t i=0;i<aszt->size();++i) {
32 m_d[i].version = (*aszt)[i]->getInt("VERS");
33 m_d[i].line = (*aszt)[i]->getInt("LINE");
34 m_d[i].jff = (*aszt)[i]->getInt("JFF");
35 m_d[i].jzz = (*aszt)[i]->getInt("JZZ");
36 m_d[i].job = (*aszt)[i]->getInt("JOB");
37 m_d[i].tras = (*aszt)[i]->getFloat("TRAS");
38 m_d[i].traz = (*aszt)[i]->getFloat("TRAZ");
39 m_d[i].trat = (*aszt)[i]->getFloat("TRAT");
40 m_d[i].rots = (*aszt)[i]->getFloat("ROTS");
41 m_d[i].rotz = (*aszt)[i]->getFloat("ROTZ");
42 m_d[i].rott = (*aszt)[i]->getFloat("ROTT");
43 m_d[i].i = (*aszt)[i]->getInt("I");
44 m_d[i].type = (*aszt)[i]->getString("TYP");
45 }
46 }else {
47 std::cerr<<"NO Aszt banks in the MuonDD Database"<<std::endl;
48 }
49}
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
virtual unsigned int size() const =0
std::string getName() const
Definition DblQ00Aszt.h:55
unsigned int m_nObj
Definition DblQ00Aszt.h:61
std::vector< ASZT > m_d
Definition DblQ00Aszt.h:60

◆ DblQ00Aszt() [3/4]

MuonGM::DblQ00Aszt::DblQ00Aszt ( const DblQ00Aszt & )
delete

◆ DblQ00Aszt() [4/4]

MuonGM::DblQ00Aszt::DblQ00Aszt ( const std::string & asciiFileName)

Definition at line 51 of file DblQ00Aszt.cxx.

51 {
52
53 std::cerr<<"Aszt with asciiFileName = : <"<<asciiFileName<<"> "<<std::endl;
54 // open file and count number of lines
55 m_nObj=0;
56 std::ifstream asztFile(asciiFileName.c_str());
57 if (!asztFile.is_open())
58 std::cerr<<" bad ascii file: "<<asciiFileName<<std::endl;
59
60
61 m_nObj = std::count(std::istreambuf_iterator<char>(asztFile),
62 std::istreambuf_iterator<char>(),'\n');
63 std::cout<<"Number of lines in the A-line file <"<<asciiFileName<<"> is "<< m_nObj <<std::endl;
64
65
66 m_d.resize (m_nObj);
67 if (m_nObj == 0) std::cerr<<"NO Aszt banks in "<<asciiFileName<<std::endl;
68
69 int j=0;
70
71 // close and reopen file for input
72 asztFile.close();
73 asztFile.open(asciiFileName.c_str());
74
75 char AlineMarker;
76 while ( asztFile
77 >> AlineMarker
78 >> m_d[j].type
79 >> m_d[j].jff
80 >> m_d[j].jzz
81 >> m_d[j].job
82 >> m_d[j].tras
83 >> m_d[j].traz
84 >> m_d[j].trat
85 >> m_d[j].rots
86 >> m_d[j].rotz
87 >> m_d[j].rott
88 )
89 {
90 m_d[j].line = j+1;
91 m_d[j].tras = 0.1*m_d[j].tras; // ProcessAlignments expects cm !
92 m_d[j].traz = 0.1*m_d[j].traz; // ProcessAlignments expects cm !
93 m_d[j].trat = 0.1*m_d[j].trat; // ProcessAlignments expects cm !
94 j++;
95 }
96
97
98 if (j!=(int)m_nObj) {
99 std::cerr<<"problem with DblQ00Aszt: j="<<j<<" m_nObj="<<(int)m_nObj<<std::endl;
100 }
101}

Member Function Documentation

◆ data()

const ASZT * MuonGM::DblQ00Aszt::data ( ) const
inline

Definition at line 53 of file DblQ00Aszt.h.

53{ return m_d.data(); };

◆ getDirName()

std::string MuonGM::DblQ00Aszt::getDirName ( ) const
inline

Definition at line 56 of file DblQ00Aszt.h.

56{ return "DblQ00"; };

◆ getName()

std::string MuonGM::DblQ00Aszt::getName ( ) const
inline

Definition at line 55 of file DblQ00Aszt.h.

55{ return "ASZT"; };

◆ getObjName()

std::string MuonGM::DblQ00Aszt::getObjName ( ) const
inline

Definition at line 57 of file DblQ00Aszt.h.

57{ return "ASZT"; };

◆ operator=()

DblQ00Aszt & MuonGM::DblQ00Aszt::operator= ( const DblQ00Aszt & right)
delete

◆ size()

unsigned int MuonGM::DblQ00Aszt::size ( ) const
inline

Definition at line 54 of file DblQ00Aszt.h.

54{ return m_nObj; };

◆ WriteAsztToAsciiFile()

void MuonGM::DblQ00Aszt::WriteAsztToAsciiFile ( const std::string & filename)

Definition at line 103 of file DblQ00Aszt.cxx.

104{
105 std::ofstream asztFile;
106 asztFile.open(filename.c_str());
107 for (int j=0;j<(int)m_nObj;j++) {
108 asztFile
109 <<"A "
110 << m_d[j].type <<" "
111 << m_d[j].jff <<" "
112 << m_d[j].jzz <<" "
113 << m_d[j].job <<" "
114 << m_d[j].tras*10. <<" " // here mm !
115 << m_d[j].traz*10. <<" " // here mm !
116 << m_d[j].trat*10. <<" " // here mm !
117 << m_d[j].rots <<" "
118 << m_d[j].rotz <<" "
119 << m_d[j].rott <<" "
120 << "\n";
121 }
122 asztFile.close();
123}

Member Data Documentation

◆ m_d

std::vector<ASZT> MuonGM::DblQ00Aszt::m_d {}
private

Definition at line 60 of file DblQ00Aszt.h.

60{};

◆ m_nObj

unsigned int MuonGM::DblQ00Aszt::m_nObj {0}
private

Definition at line 61 of file DblQ00Aszt.h.

61{0}; // > 1 if array; 0 if error in retrieve.

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