ATLAS Offline Software
Loading...
Searching...
No Matches
AccMap Class Reference

#include <AccMap.h>

Collaboration diagram for AccMap:

Public Member Functions

 ~AccMap ()=default
void Reset ()
int Region (int region, int sampling, int eta) const
const CurrMapGetMap (int ifold, int ielecregion) const
const CurrMapGetMap (int ifold, int region, int sampling, int eta) const
float GetXmin (int ifold) const
float GetXmax (int ifold) const
float GetYmin (int ifold) const
float GetYmax (int ifold) const

Static Public Member Functions

static const AccMapGetAccMap ()

Private Member Functions

 AccMap ()

Private Attributes

curr_map m_theMap
const int m_nmax {14}
std::vector< float > m_xmin
std::vector< float > m_xmax
std::vector< float > m_ymin
std::vector< float > m_ymax

Detailed Description

Definition at line 16 of file AccMap.h.

Constructor & Destructor Documentation

◆ ~AccMap()

AccMap::~AccMap ( )
default

◆ AccMap()

AccMap::AccMap ( )
private

Definition at line 12 of file AccMap.cxx.

13{
14 const int i1[10]={0,0,3,2,9,12,10,9,0,2}; // first fold
15 const int i2[10]={2,1,12,12,13,13,13,13,1,4}; // last fold for 10 electronic regions
16
17 m_xmin.resize(m_nmax);
18 m_xmax.resize(m_nmax);
19 m_ymin.resize(m_nmax);
20 m_ymax.resize(m_nmax);
21
22 const double xnorm=14.1591; // nA/MeV normalisation for accordion maps
23
24#ifndef LARG4_STAND_ALONE
25 //std::string larLocation = PathResolver::find_directory("lar","DATAPATH");
26 std::string larLocation = PathResolver::find_directory("LArG4Barrel","ATLASCALDATA");
27#endif
28
29 for (int iregion=0;iregion<10;iregion++) {
30 // accordion folds
31 for (int ifold=i1[iregion]; ifold<=i2[iregion]; ifold++) {
32 std::ostringstream fn;
33 fn << "fold"<<ifold<<"_region"<<iregion<<".map";
34 std::string filename = fn.str();
35 std::string fileLocation;
36#ifdef LARG4_STAND_ALONE
37 fileLocation=m_directory+"/"+filename;
38#else
39 //fileLocation=larLocation+"/calo_data/"+filename;
40 fileLocation=larLocation+"/"+filename;
41#endif
42 CurrMap* cm = new CurrMap(fileLocation,xnorm);
43 int code=10*ifold+iregion;
45
46 // add some rounding safety in edges of map
47 m_xmin[ifold]=cm->GetXmin()+0.1;
48 m_xmax[ifold]=cm->GetXmax()-0.1;
49 m_ymin[ifold]=cm->GetYmin()+0.1;
50 m_ymax[ifold]=cm->GetYmax()-0.1;
51 }
52 // straight section
53 for (int istr=1; istr<=2; istr++) {
54 std::ostringstream fn;
55 fn << "straight"<<istr<<"_region"<<iregion<<".map";
56 std::string filename = fn.str();
57 std::string fileLocation;
58#ifdef LARG4_STAND_ALONE
59 fileLocation=m_directory+"/"+filename;
60#else
61 //fileLocation=larLocation+"/calo_data/"+filename;
62 fileLocation=larLocation+"/"+filename;
63#endif
64 CurrMap* cm = new CurrMap(fileLocation,xnorm);
65 int code=10*(20+istr)+iregion;
67 }
68 }
69
70}
std::vector< float > m_ymin
Definition AccMap.h:43
std::vector< float > m_ymax
Definition AccMap.h:44
std::vector< float > m_xmin
Definition AccMap.h:41
std::vector< float > m_xmax
Definition AccMap.h:42
curr_map m_theMap
Definition AccMap.h:39
const int m_nmax
Definition AccMap.h:40
static std::string find_directory(const std::string &logical_file_name, const std::string &search_path)

Member Function Documentation

◆ GetAccMap()

const AccMap * AccMap::GetAccMap ( )
static

Definition at line 72 of file AccMap.cxx.

73{
74 static const AccMap instance;
75 return &instance;
76}
std::map< std::string, double > instance
AccMap()
Definition AccMap.cxx:12

◆ GetMap() [1/2]

const CurrMap * AccMap::GetMap ( int ifold,
int ielecregion ) const

Definition at line 92 of file AccMap.cxx.

93{
94 const int code=10*ifold+ielecregion;
95 const auto mapIter = m_theMap.find(code);
96 if (mapIter != m_theMap.end())
97 return mapIter->second;
98 else {
99 std::cout << " Code " << code << " not found in map ..." << std::endl;
100 return nullptr;
101 }
102}

◆ GetMap() [2/2]

const CurrMap * AccMap::GetMap ( int ifold,
int region,
int sampling,
int eta ) const

Definition at line 87 of file AccMap.cxx.

88{
89 return this->GetMap(ifold,this->Region(region,sampling,eta));
90}
Scalar eta() const
pseudorapidity method
const CurrMap * GetMap(int ifold, int ielecregion) const
Definition AccMap.cxx:92

◆ GetXmax()

float AccMap::GetXmax ( int ifold) const
inline

Definition at line 28 of file AccMap.h.

28 {
29 if (ifold<m_nmax && ifold >=0) return m_xmax[ifold];
30 else return -999.;}

◆ GetXmin()

float AccMap::GetXmin ( int ifold) const
inline

Definition at line 25 of file AccMap.h.

25 {
26 if (ifold<m_nmax && ifold >=0) return m_xmin[ifold];
27 else return -999.;}

◆ GetYmax()

float AccMap::GetYmax ( int ifold) const
inline

Definition at line 34 of file AccMap.h.

34 {
35 if (ifold<m_nmax && ifold >=0) return m_ymax[ifold];
36 else return -999.;}

◆ GetYmin()

float AccMap::GetYmin ( int ifold) const
inline

Definition at line 31 of file AccMap.h.

31 {
32 if (ifold<m_nmax && ifold >=0) return m_ymin[ifold];
33 else return -999.;}

◆ Region()

int AccMap::Region ( int region,
int sampling,
int eta ) const

Definition at line 104 of file AccMap.cxx.

105{
106 int elecregion=0;
107 // logic to compute region vs eta and sampling...
108 if (region==0) {
109 if (sampling==1) {
110 if (eta<256) elecregion=0;
111 else elecregion=1;
112 }
113 else if (sampling==2) {
114 if (eta<32) elecregion=2;
115 else elecregion=3;
116 }
117 else {
118 if (eta<9 || eta==26) elecregion=4;
119 if ((eta>8 && eta<13) || (eta>15 && eta<19)) elecregion=5;
120 if ((eta>12 && eta < 16) || (eta>18 && eta<21)) elecregion=6;
121 if ((eta>20 && eta < 26)) elecregion=7;
122 }
123 }
124 else {
125 if (sampling==1) elecregion=8;
126 else elecregion=9;
127 }
128 return elecregion;
129}

◆ Reset()

void AccMap::Reset ( )

Definition at line 78 of file AccMap.cxx.

79{
80 curr_map::iterator it = m_theMap.begin();
81 while (it != m_theMap.end()) {
82 delete (*it).second;
83 m_theMap.erase(it++);
84 }
85}

Member Data Documentation

◆ m_nmax

const int AccMap::m_nmax {14}
private

Definition at line 40 of file AccMap.h.

40{14};

◆ m_theMap

curr_map AccMap::m_theMap
private

Definition at line 39 of file AccMap.h.

◆ m_xmax

std::vector<float> AccMap::m_xmax
private

Definition at line 42 of file AccMap.h.

◆ m_xmin

std::vector<float> AccMap::m_xmin
private

Definition at line 41 of file AccMap.h.

◆ m_ymax

std::vector<float> AccMap::m_ymax
private

Definition at line 44 of file AccMap.h.

◆ m_ymin

std::vector<float> AccMap::m_ymin
private

Definition at line 43 of file AccMap.h.


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