ATLAS Offline Software
Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
MuonTGC_Cabling::TGCDatabaseSLBToROD Class Reference

#include <TGCDatabaseSLBToROD.h>

Inheritance diagram for MuonTGC_Cabling::TGCDatabaseSLBToROD:
Collaboration diagram for MuonTGC_Cabling::TGCDatabaseSLBToROD:

Public Types

enum  DatabaseType {
  NoDatabaseType =-1, ASDToPP, InPP, PPToSL,
  SLBToROD, MaxDatabaseType
}
 

Public Member Functions

 TGCDatabaseSLBToROD (const std::string &filename, const std::string &blockname)
 
 TGCDatabaseSLBToROD (const TGCDatabaseSLBToROD &)
 
virtual ~TGCDatabaseSLBToROD (void)
 
virtual bool update (const std::vector< int > &)
 
virtual int find (const std::vector< int > &) const
 
DatabaseType getDatabaseType (void) const
 
virtual int getEntry (int entry, int column) const
 
virtual int getEntrySize (int entry) const
 
virtual int getMaxEntry (void) const
 
virtual int getIndexDBIn (int *indexIn) const
 
virtual int getIndexDBOut (int *indexOut) const
 

Protected Attributes

std::string m_filename
 
std::string m_blockname
 
std::vector< std::vector< int > > m_database
 

Private Member Functions

virtual void readDB (void)
 
 TGCDatabaseSLBToROD (void)
 
TGCDatabaseSLBToRODoperator= (const TGCDatabaseSLBToROD &right)
 hidden assignment operator More...
 

Private Attributes

DatabaseType m_type
 

Detailed Description

Definition at line 13 of file TGCDatabaseSLBToROD.h.

Member Enumeration Documentation

◆ DatabaseType

Enumerator
NoDatabaseType 
ASDToPP 
InPP 
PPToSL 
SLBToROD 
MaxDatabaseType 

Definition at line 17 of file TGCDatabase.h.

Constructor & Destructor Documentation

◆ TGCDatabaseSLBToROD() [1/3]

MuonTGC_Cabling::TGCDatabaseSLBToROD::TGCDatabaseSLBToROD ( const std::string &  filename,
const std::string &  blockname 
)

Definition at line 13 of file TGCDatabaseSLBToROD.cxx.

16 {
17  // read out ascii file and fill database
19 }

◆ TGCDatabaseSLBToROD() [2/3]

MuonTGC_Cabling::TGCDatabaseSLBToROD::TGCDatabaseSLBToROD ( const TGCDatabaseSLBToROD right)

Definition at line 21 of file TGCDatabaseSLBToROD.cxx.

22  : TGCDatabase(right)
23 {
24 }

◆ ~TGCDatabaseSLBToROD()

MuonTGC_Cabling::TGCDatabaseSLBToROD::~TGCDatabaseSLBToROD ( void  )
virtual

Definition at line 57 of file TGCDatabaseSLBToROD.cxx.

58 {
59 }

◆ TGCDatabaseSLBToROD() [3/3]

MuonTGC_Cabling::TGCDatabaseSLBToROD::TGCDatabaseSLBToROD ( void  )
inlineprivate

Definition at line 31 of file TGCDatabaseSLBToROD.h.

31 {}

Member Function Documentation

◆ find()

int MuonTGC_Cabling::TGCDatabaseSLBToROD::find ( const std::vector< int > &  channel) const
virtual

Reimplemented from MuonTGC_Cabling::TGCDatabase.

Definition at line 78 of file TGCDatabaseSLBToROD.cxx.

79 {
80  int index=-1;
81 
82  const unsigned int size = m_database.size();
83 
84  if(channel.size()<4) {
85  // SSW block
86  for(unsigned int i=0; i<size; i++){
87  if(m_database[i].at(0) == channel.at(0)){
88  index = i;
89  break;
90  }
91  }
92  } else {
93  // SLB block
94  for(unsigned int i=0; i<size; i++){
95  if(m_database[i].at(3) == channel.at(3) &&
96  m_database[i].at(2) == channel.at(2) &&
97  m_database[i].at(1) == channel.at(1) &&
98  m_database[i].at(0) == channel.at(0)){
99  index = i;
100  break;
101  }
102  }
103  }
104 
105  return index;
106 }

◆ getDatabaseType()

DatabaseType MuonTGC_Cabling::TGCDatabase::getDatabaseType ( void  ) const
inlineinherited

Definition at line 35 of file TGCDatabase.h.

35 { return m_type; }

◆ getEntry()

int MuonTGC_Cabling::TGCDatabase::getEntry ( int  entry,
int  column 
) const
virtualinherited

Definition at line 28 of file TGCDatabase.cxx.

28  {
29  return m_database[entry].at(column);
30 }

◆ getEntrySize()

int MuonTGC_Cabling::TGCDatabase::getEntrySize ( int  entry) const
virtualinherited

Definition at line 32 of file TGCDatabase.cxx.

32  {
33  return m_database[entry].size();
34 }

◆ getIndexDBIn()

int MuonTGC_Cabling::TGCDatabase::getIndexDBIn ( int *  indexIn) const
virtualinherited

Reimplemented in MuonTGC_Cabling::TGCDatabaseASDToPP, and MuonTGC_Cabling::TGCDatabaseInPP.

Definition at line 52 of file TGCDatabase.cxx.

53 {
54  // not implemented in the base class
55  if(!indexIn) return -1;
56 
57  return -1;
58 }

◆ getIndexDBOut()

int MuonTGC_Cabling::TGCDatabase::getIndexDBOut ( int *  indexOut) const
virtualinherited

Reimplemented in MuonTGC_Cabling::TGCDatabaseASDToPP.

Definition at line 60 of file TGCDatabase.cxx.

61 {
62  // not implemented in the base class
63  if(!indexOut) return -1;
64 
65  return -1;
66 }

◆ getMaxEntry()

int MuonTGC_Cabling::TGCDatabase::getMaxEntry ( void  ) const
virtualinherited

Definition at line 36 of file TGCDatabase.cxx.

36  {
37  return m_database.size();
38 }

◆ operator=()

TGCDatabaseSLBToROD& MuonTGC_Cabling::TGCDatabaseSLBToROD::operator= ( const TGCDatabaseSLBToROD right)
private

hidden assignment operator

◆ readDB()

void MuonTGC_Cabling::TGCDatabaseSLBToROD::readDB ( void  )
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCDatabase.

Definition at line 26 of file TGCDatabaseSLBToROD.cxx.

26  {
27  std::ifstream file(m_filename.c_str());
28  std::string buf;
29 
30  unsigned int space = m_blockname.find(' ');
31  std::string_view module = std::string_view(m_blockname).substr(0,space);
32  std::string_view type = std::string_view(m_blockname).substr(space+1);
33 
34  while(getline(file,buf)){
35  if(buf.compare(0,module.size(),module)==0) break;
36  }
37 
38  while(getline(file,buf)){
39  if(buf.compare(1,type.size(),type)==0) break;
40  }
41 
42  while(getline(file,buf)){
43  if(buf.compare(0,2," ")!=0) break;
44  std::istringstream line(buf);
45  std::vector<int> entry;
46  for(int i=0; i<6; i++){
47  int temp=-1;
48  line >> temp;
49  entry.push_back(temp);
50  }
51  m_database.emplace_back(std::move(entry));
52  }
53 
54  file.close();
55 }

◆ update()

bool MuonTGC_Cabling::TGCDatabaseSLBToROD::update ( const std::vector< int > &  input)
virtual

Reimplemented from MuonTGC_Cabling::TGCDatabase.

Definition at line 61 of file TGCDatabaseSLBToROD.cxx.

62 {
63  int ip = find(input);
64  if(ip<0) return false;
65 
66  if(input.size()<6) {
67  // SSW block
68  m_database[ip].at(1) = input.at(1);
69  } else {
70  // SLB block
71  m_database[ip].at(4) = input.at(4);
72  m_database[ip].at(5) = input.at(5);
73  }
74 
75  return true;
76 }

Member Data Documentation

◆ m_blockname

std::string MuonTGC_Cabling::TGCDatabase::m_blockname
protectedinherited

Definition at line 53 of file TGCDatabase.h.

◆ m_database

std::vector< std::vector<int> > MuonTGC_Cabling::TGCDatabase::m_database
protectedinherited

Definition at line 54 of file TGCDatabase.h.

◆ m_filename

std::string MuonTGC_Cabling::TGCDatabase::m_filename
protectedinherited

Definition at line 52 of file TGCDatabase.h.

◆ m_type

DatabaseType MuonTGC_Cabling::TGCDatabase::m_type
privateinherited

Definition at line 57 of file TGCDatabase.h.


The documentation for this class was generated from the following files:
MuonTGC_Cabling::TGCDatabase::PPToSL
@ PPToSL
Definition: TGCDatabase.h:18
checkFileSG.line
line
Definition: checkFileSG.py:75
MuonTGC_Cabling::TGCDatabaseSLBToROD::readDB
virtual void readDB(void)
Definition: TGCDatabaseSLBToROD.cxx:26
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
MuonTGC_Cabling::TGCDatabase::ASDToPP
@ ASDToPP
Definition: TGCDatabase.h:18
index
Definition: index.py:1
MuonTGC_Cabling::TGCDatabase::NoDatabaseType
@ NoDatabaseType
Definition: TGCDatabase.h:17
DeMoUpdate.column
dictionary column
Definition: DeMoUpdate.py:1110
MuonTGC_Cabling::TGCDatabase::m_filename
std::string m_filename
Definition: TGCDatabase.h:52
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
python.PyAthena.module
module
Definition: PyAthena.py:131
lumiFormat.i
int i
Definition: lumiFormat.py:85
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition: DecayParser.py:27
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
file
TFile * file
Definition: tile_monitor.h:29
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
python.egammaTruthD3PDObject.blockname
blockname
Definition: egammaTruthD3PDObject.py:64
MuonTGC_Cabling::TGCDatabaseSLBToROD::find
virtual int find(const std::vector< int > &) const
Definition: TGCDatabaseSLBToROD.cxx:78
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
MuonTGC_Cabling::TGCDatabase::m_blockname
std::string m_blockname
Definition: TGCDatabase.h:53
MuonTGC_Cabling::TGCDatabase::MaxDatabaseType
@ MaxDatabaseType
Definition: TGCDatabase.h:19
MuonTGC_Cabling::TGCDatabase::SLBToROD
@ SLBToROD
Definition: TGCDatabase.h:18
DeMoScan.index
string index
Definition: DeMoScan.py:364
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
MuonTGC_Cabling::TGCDatabase::TGCDatabase
TGCDatabase(DatabaseType type=NoDatabaseType)
Definition: TGCDatabase.cxx:10
MuonTGC_Cabling::TGCDatabase::m_database
std::vector< std::vector< int > > m_database
Definition: TGCDatabase.h:54
MuonTGC_Cabling::TGCDatabase::InPP
@ InPP
Definition: TGCDatabase.h:18
MuonTGC_Cabling::TGCDatabase::m_type
DatabaseType m_type
Definition: TGCDatabase.h:57