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

#include <PsMap.h>

Collaboration diagram for PsMap:

Public Member Functions

 ~PsMap ()=default
void Reset ()
const CurrMapGetMap (int module) const

Static Public Member Functions

static const PsMapGetPsMap ()

Private Member Functions

 PsMap ()

Private Attributes

curr_map m_theMap

Detailed Description

Definition at line 16 of file PsMap.h.

Constructor & Destructor Documentation

◆ ~PsMap()

PsMap::~PsMap ( )
default

◆ PsMap()

PsMap::PsMap ( )
private

Definition at line 12 of file PsMap.cxx.

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;
36 }
37
38}
static std::string find_directory(const std::string &logical_file_name, const std::string &search_path)
curr_map m_theMap
Definition PsMap.h:24

Member Function Documentation

◆ GetMap()

const CurrMap * PsMap::GetMap ( int module) const

Definition at line 55 of file PsMap.cxx.

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}

◆ GetPsMap()

const PsMap * PsMap::GetPsMap ( )
static

Definition at line 40 of file PsMap.cxx.

41{
42 static const PsMap instance;
43 return &instance;
44}
std::map< std::string, double > instance
PsMap()
Definition PsMap.cxx:12

◆ Reset()

void PsMap::Reset ( )

Definition at line 46 of file PsMap.cxx.

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}

Member Data Documentation

◆ m_theMap

curr_map PsMap::m_theMap
private

Definition at line 24 of file PsMap.h.


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