ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
FPGATrackSimSectorMap Class Reference

#include <FPGATrackSimSectorMap.h>

Collaboration diagram for FPGATrackSimSectorMap:

Public Member Functions

 FPGATrackSimSectorMap ()=default
 
 FPGATrackSimSectorMap (const char *fname)
 
 ~FPGATrackSimSectorMap ()=default
 
void SetSector (int, int, int)
 
int GetSector (int, int)
 
void LoadFromFile (const char *)
 
void CreateFile (const char *, const char *, const char *)
 
void Dump ()
 

Static Public Member Functions

static std::map< int, int > makeLookup (const char *fname)
 

Private Types

typedef std::map< int, int > mapint
 
typedef std::map< int, mapintmapint2
 

Private Attributes

mapint2 m_data
 

Detailed Description

Definition at line 14 of file FPGATrackSimSectorMap.h.

Member Typedef Documentation

◆ mapint

typedef std::map<int,int> FPGATrackSimSectorMap::mapint
private

Definition at line 15 of file FPGATrackSimSectorMap.h.

◆ mapint2

typedef std::map<int,mapint> FPGATrackSimSectorMap::mapint2
private

Definition at line 16 of file FPGATrackSimSectorMap.h.

Constructor & Destructor Documentation

◆ FPGATrackSimSectorMap() [1/2]

FPGATrackSimSectorMap::FPGATrackSimSectorMap ( )
default

◆ FPGATrackSimSectorMap() [2/2]

FPGATrackSimSectorMap::FPGATrackSimSectorMap ( const char *  fname)
inline

Definition at line 21 of file FPGATrackSimSectorMap.h.

21 { LoadFromFile(fname); }

◆ ~FPGATrackSimSectorMap()

FPGATrackSimSectorMap::~FPGATrackSimSectorMap ( )
default

Member Function Documentation

◆ CreateFile()

void FPGATrackSimSectorMap::CreateFile ( const char *  fname4,
const char *  fname8,
const char *  fname11 
)

Definition at line 56 of file FPGATrackSimSectorMap.cxx.

56  {
57  std::map<int,int> map4=FPGATrackSimSectorMap::makeLookup(fname4);
58  std::map<int,int> map8=FPGATrackSimSectorMap::makeLookup(fname8);
59 
60  ifstream inFile(fname11);
61  if (inFile.is_open()) {
62  ANA_MSG_FATAL("Unable to open file");
63  return;
64  }
65  int ev11, sec11;
66  while(inFile >> ev11 >> sec11) {
67  if(map4.find(ev11)!=map4.end() && map8.find(ev11)!=map8.end())
68  SetSector(map4[ev11], map8[ev11], sec11);
69  }
70  inFile.close();
71 }

◆ Dump()

void FPGATrackSimSectorMap::Dump ( )

Definition at line 73 of file FPGATrackSimSectorMap.cxx.

73  {
74  for (mapint2::iterator i = m_data.begin(); i != m_data.end();++i) {
75  for (mapint::iterator j = (*i).second.begin(); j != (*i).second.end();++j) {
76  ANA_MSG_DEBUG((*i).first << " " << (*j).first << " " << (*j).second);
77  }
78  }
79 }

◆ GetSector()

int FPGATrackSimSectorMap::GetSector ( int  sec1,
int  sec2 
)

Definition at line 36 of file FPGATrackSimSectorMap.cxx.

36  {
37  if (m_data.find(sec1)!=m_data.end())
38  if (m_data[sec1].find(sec2)!=m_data[sec1].end())
39  return m_data[sec1][sec2];
40  return -1;
41 }

◆ LoadFromFile()

void FPGATrackSimSectorMap::LoadFromFile ( const char *  fname)

Definition at line 43 of file FPGATrackSimSectorMap.cxx.

43  {
44 
45  ifstream inFile(fname);
46  if (inFile.is_open()) {
47  ANA_MSG_FATAL("Unable to open file");
48  return;
49  }
50  ANA_MSG_DEBUG("Reading sector map data: " << fname);
51  int sec1,sec2,sec3;
52  while(inFile >> sec1 >> sec2 >> sec3) SetSector(sec1,sec2,sec3);
53  inFile.close();
54 }

◆ makeLookup()

std::map< int, int > FPGATrackSimSectorMap::makeLookup ( const char *  fname)
static

Definition at line 15 of file FPGATrackSimSectorMap.cxx.

16 {
17  std::map<int,int> secLookup;
18  ifstream inFile(fname);
19 
20  if (inFile.is_open()) {
21  ANA_MSG_FATAL("Unable to open file");
22  return secLookup;
23  }
24  int evt,reg;
25  while (inFile >> evt >> reg) {
26  secLookup[evt]=reg;
27  }
28  inFile.close();
29  return secLookup;
30 }

◆ SetSector()

void FPGATrackSimSectorMap::SetSector ( int  sec1,
int  sec2,
int  sec 
)

Definition at line 32 of file FPGATrackSimSectorMap.cxx.

32  {
33  m_data[sec1][sec2]=sec;
34 }

Member Data Documentation

◆ m_data

mapint2 FPGATrackSimSectorMap::m_data
private

Definition at line 18 of file FPGATrackSimSectorMap.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
makeTOC.inFile
string inFile
Definition: makeTOC.py:5
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
FPGATrackSimSectorMap::LoadFromFile
void LoadFromFile(const char *)
Definition: FPGATrackSimSectorMap.cxx:43
FPGATrackSimSectorMap::SetSector
void SetSector(int, int, int)
Definition: FPGATrackSimSectorMap.cxx:32
lumiFormat.i
int i
Definition: lumiFormat.py:85
ANA_MSG_FATAL
#define ANA_MSG_FATAL(xmsg)
Macro printing fatal messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:296
FPGATrackSimSectorMap::makeLookup
static std::map< int, int > makeLookup(const char *fname)
Definition: FPGATrackSimSectorMap.cxx:15
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
FPGATrackSimSectorMap::m_data
mapint2 m_data
Definition: FPGATrackSimSectorMap.h:18
ANA_MSG_DEBUG
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:288