ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArG4
LArG4Barrel
src
PsMap.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
PsMap.h
"
6
#include <iostream>
7
#include <sstream>
8
#ifndef LARG4_STAND_ALONE
9
#include "
PathResolver/PathResolver.h
"
10
#endif
11
12
PsMap::PsMap
()
13
{
14
#ifndef LARG4_STAND_ALONE
15
//std::string larLocation = PathResolver::find_directory("lar","DATAPATH");
16
std::string larLocation =
PathResolver::find_directory
(
"LArG4Barrel"
,
"ATLASCALDATA"
);
17
#endif
18
19
const
double
xnorm=15.9;
// nA/MeV normalisation for PS maps
20
21
for
(
int
imap=0;imap<5;imap++) {
22
// accordion folds
23
std::ostringstream fn;
24
fn <<
"presampler_"
<<imap<<
".map"
;
25
std::string filename = fn.str();
26
std::string fileLocation;
27
#ifdef LARG4_STAND_ALONE
28
fileLocation=m_directory+
"/"
+filename;
29
#else
30
//fileLocation=larLocation+"/calo_data/"+filename;
31
fileLocation=larLocation+
"/"
+filename;
32
#endif
33
CurrMap
*
cm
=
new
CurrMap
(fileLocation,xnorm);
34
int
code=imap;
35
m_theMap
[code]=
cm
;
36
}
37
38
}
39
40
const
PsMap
*
PsMap::GetPsMap
()
41
{
42
static
const
PsMap
instance
;
43
return
&
instance
;
44
}
45
46
void
PsMap::Reset
()
47
{
48
curr_map::iterator it=
m_theMap
.begin();
49
while
(it !=
m_theMap
.end()) {
50
delete
(*it).second;
51
m_theMap
.erase(it++);
52
}
53
}
54
55
const
CurrMap
*
PsMap::GetMap
(
int
module)
const
56
{
57
// module 0 and 1 have their own maps (code = 0 and 1)
58
// module 2 and 3 have the same map (same geometry) with code 2
59
// module 4 and 5 have the same map (same geometry) with code 3
60
// module 6 and 7 have the same map (same geometry) with code 4
61
int
code = -1;
62
if
(module==0 || module==1) code=
module
;
63
if
(module > 1 && module < 8) code=(
module
-2)/2 + 2;
64
auto
it =
m_theMap
.find(code);
65
if
(it !=
m_theMap
.end())
66
return
it->second;
67
else
{
68
std::cout <<
" Code "
<< module <<
" not found in map ..."
<< std::endl;
69
return nullptr;
70
}
71
}
PathResolver.h
PsMap.h
instance
std::map< std::string, double > instance
Definition
Run_To_Get_Tags.h:8
cm
const double cm
Definition
Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
CurrMap
Definition
CurrMap.h:10
PathResolver::find_directory
static std::string find_directory(const std::string &logical_file_name, const std::string &search_path)
Definition
PathResolver.cxx:249
PsMap::Reset
void Reset()
Definition
PsMap.cxx:46
PsMap::GetMap
const CurrMap * GetMap(int module) const
Definition
PsMap.cxx:55
PsMap::PsMap
PsMap()
Definition
PsMap.cxx:12
PsMap::m_theMap
curr_map m_theMap
Definition
PsMap.h:24
PsMap::GetPsMap
static const PsMap * GetPsMap()
Definition
PsMap.cxx:40
Generated on
for ATLAS Offline Software by
1.17.0