ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
FPTracker
src
getMagnetConfigFiles.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 "
FPTracker/getMagnetConfigFiles.h
"
6
#include "
FPTracker/getConfigFile.h
"
7
#include "../src/openFile.tpl"
8
#include <sstream>
9
#include <iostream>
10
#include <stdexcept>
11
12
namespace
FPTracker
{
13
14
15
std::string
determineMagnetConfigFileName
(
int
IP,
const
Side
& side,
int
magver)
16
{
17
// Find twiss magnet configuration files used by P Bussey up until 12/08
18
19
bool
argsOK = (IP == 1 || IP == 5) && (side ==
beam1
|| side ==
beam2
);
20
if
(!argsOK)
21
{
22
std::stringstream
ss
;
23
ss
<<
"Legal side arg values = beam1 or beam2, is "
<<side<<
" Legal IP arg values = 1 or 5, is "
<<IP<<
'\n'
;
24
25
throw
std::runtime_error(
ss
.str().c_str());
26
}
27
28
29
if
(magver == 1)
30
{
31
if
(side ==
beam2
){
return
"twiss_65_b2_old.txt"
;}
32
return
"twiss_65_b1_old.txt"
;
33
}
34
else
35
if
( IP==1 )
36
{
37
if
( side==
beam2
) {
return
"LHCB2IR1_6500"
;}
38
return
"LHCB1IR1_6500"
;
39
}
40
else
41
{
42
if
( side==
beam2
) {
return
"LHCB2IR5_6500"
;}
43
return
"LHCB1IR5_6500"
;
44
}
45
46
}
47
48
49
50
51
std::shared_ptr<std::ifstream>
getMagnetConfigFiles
(
const
std::string& dir,
int
IP,
int
magVer,
const
Side
& side)
52
{
53
return
getConfigFile
( dir,
determineMagnetConfigFileName
(IP, side, magVer) );
54
}
55
56
}
57
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
getConfigFile.h
getMagnetConfigFiles.h
FPTracker
Definition
FPTracker/FPTracker/Beamline.h:12
FPTracker::determineMagnetConfigFileName
std::string determineMagnetConfigFileName(int IP, const Side &side, int magver)
Definition
getMagnetConfigFiles.cxx:15
FPTracker::getConfigFile
std::shared_ptr< std::ifstream > getConfigFile(const std::string &dir, const std::string &fn)
Definition
getConfigFile.cxx:11
FPTracker::getMagnetConfigFiles
std::shared_ptr< std::ifstream > getMagnetConfigFiles(const std::string &dir, int IP, int magVer, const Side &side)
Definition
getMagnetConfigFiles.cxx:51
FPTracker::Side
Side
Definition
FPTrackerConstants.h:12
FPTracker::beam2
@ beam2
Definition
FPTrackerConstants.h:12
FPTracker::beam1
@ beam1
Definition
FPTrackerConstants.h:12
Generated on
for ATLAS Offline Software by
1.17.0