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

#include <TGCDatabasePPToSL.h>

Inheritance diagram for MuonTGC_Cabling::TGCDatabasePPToSL:
Collaboration diagram for MuonTGC_Cabling::TGCDatabasePPToSL:

Public Types

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

Public Member Functions

 TGCDatabasePPToSL (const std::string &filename, const std::string &blockname)
 
 TGCDatabasePPToSL (const TGCDatabasePPToSL &)
 
virtual ~TGCDatabasePPToSL (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)
 
 TGCDatabasePPToSL (void)
 
TGCDatabasePPToSLoperator= (const TGCDatabasePPToSL &right)
 hidden assignment operator More...
 

Private Attributes

DatabaseType m_type
 

Detailed Description

Definition at line 13 of file TGCDatabasePPToSL.h.

Member Enumeration Documentation

◆ DatabaseType

Enumerator
NoDatabaseType 
ASDToPP 
InPP 
PPToSL 
SLBToROD 
MaxDatabaseType 

Definition at line 17 of file TGCDatabase.h.

Constructor & Destructor Documentation

◆ TGCDatabasePPToSL() [1/3]

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

Definition at line 13 of file TGCDatabasePPToSL.cxx.

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

◆ TGCDatabasePPToSL() [2/3]

MuonTGC_Cabling::TGCDatabasePPToSL::TGCDatabasePPToSL ( const TGCDatabasePPToSL right)

Definition at line 21 of file TGCDatabasePPToSL.cxx.

22  : TGCDatabase(right)
23 {
24 }

◆ ~TGCDatabasePPToSL()

MuonTGC_Cabling::TGCDatabasePPToSL::~TGCDatabasePPToSL ( void  )
virtual

Definition at line 72 of file TGCDatabasePPToSL.cxx.

73 {
74 }

◆ TGCDatabasePPToSL() [3/3]

MuonTGC_Cabling::TGCDatabasePPToSL::TGCDatabasePPToSL ( void  )
inlineprivate

Definition at line 29 of file TGCDatabasePPToSL.h.

29 {}

Member Function Documentation

◆ find()

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

Reimplemented from MuonTGC_Cabling::TGCDatabase.

Definition at line 95 of file TGCDatabasePPToSL.cxx.

96 {
97  int index=-1;
98  const unsigned int size = m_database.size();
99  for(unsigned int i=0; i<size; i++){
100  if(m_database[i].at(0) == channel.at(0)){
101  index = i;
102  break;
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=()

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

hidden assignment operator

◆ readDB()

void MuonTGC_Cabling::TGCDatabasePPToSL::readDB ( void  )
privatevirtual

Reimplemented from MuonTGC_Cabling::TGCDatabase.

Definition at line 27 of file TGCDatabasePPToSL.cxx.

27  {
28  std::ifstream file(m_filename.c_str());
29  std::string buf;
30 
31  unsigned int space = m_blockname.find(' ');
32  std::string_view module =std::string_view( m_blockname).substr(0,space);
33  std::string_view region = std::string_view(m_blockname).substr(space+1,1);
34  std::string_view type = std::string_view(m_blockname).substr(space+2);
35 
36  int offset=-1;
37  if(type == "WT") offset = 1;
38  if(type == "WD") offset = 2;
39  if(type == "ST") offset = 3;
40  if(type == "SD") offset = 4;
41  if(type == "WI") offset = 5;
42  if(type == "SI") offset = 6;
43  if(type == "W") offset = 1;
44  if(type == "S") offset = 2;
45 
46  while(getline(file,buf)){
47  if(buf.compare(0,1,region)==0) break;
48  }
49 
50  while(getline(file,buf)){
51  if(buf.compare(1,module.size(),module)==0) break;
52  }
53 
54  while(getline(file,buf)){
55  if(buf.compare(0,2," ")!=0) break;
56  if(buf.compare(2,1,"0")==0) offset--;
57  if(offset==0){
58  std::istringstream line(buf);
59  std::vector<int> entry;
60  for(int i=0; i<3; i++){
61  int temp=-1;
62  line >> temp;
63  entry.push_back(temp);
64  }
65  m_database.emplace_back(std::move(entry));
66  }
67  }
68 
69  file.close();
70 }

◆ update()

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

Reimplemented from MuonTGC_Cabling::TGCDatabase.

Definition at line 76 of file TGCDatabasePPToSL.cxx.

77 {
78  int ip = find(input);
79  if(ip<0) return false;
80 
81  const unsigned int input_size = input.size();
82 
83  const unsigned int database_size = m_database[ip].size();
84  for(unsigned int i=1; i<database_size; i++){
85  if(i<input_size){
86  m_database[ip].at(i) = input.at(i);
87  } else {
88  m_database[ip].at(i) = -1;
89  }
90  }
91 
92  return true;
93 }

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
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
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::TGCDatabasePPToSL::readDB
virtual void readDB(void)
Definition: TGCDatabasePPToSL.cxx:27
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:134
lumiFormat.i
int i
Definition: lumiFormat.py:92
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition: DecayParser.py:27
MuonTGC_Cabling::TGCDatabasePPToSL::find
virtual int find(const std::vector< int > &) const
Definition: TGCDatabasePPToSL.cxx:95
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
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:362
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
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