MagneticField
Engine
interface
MagneticFieldHelpers.h
Go to the documentation of this file.
1
#ifndef MagneticFieldHelpers_h
2
#define MagneticFieldHelpers_h
3
4
// #include "CondFormats/RunInfo/interface/RunInfo.h"
5
// #include "CondFormats/DataRecord/interface/RunSummaryRcd.h"
6
#include "
FWCore/Framework/interface/ESHandle.h
"
7
#include "
FWCore/Framework/interface/EventSetup.h
"
8
9
namespace
magneticFieldHelpers
{
10
12
int
closerNominalField
(
float
current) {
13
int
zeroFieldThreshold = 1000;
//fixme
14
float
nominalCurrents
[5] = {9558,14416,16819,18268,19262} ;
//FIXME: replace with correct values...
15
int
nominalFields
[5] = {20,30,35,38,40} ;
//in kGauss
16
if
(current < zeroFieldThreshold)
return
0;
17
int
i
=0;
18
for
(;
i
<4;
i
++)
19
{
20
if
(2*current <
nominalCurrents
[
i
]+
nominalCurrents
[
i
+1] )
21
return
nominalFields
[
i
];
22
}
23
return
nominalFields
[
i
];
24
}
25
26
// /// Return the closer nominal field value (kGauss) to the average current stored in the DB.
27
// int closerNominalField(const RunInfo & runInfo) {
28
// return closerNominalField(runInfo.m_avg_current);
29
// }
30
31
// /// Return the closer nominal field value (kGauss) to the average current stored in the DB.
32
// int closerNominalField(const edm::EventSetup& es)
33
// {
34
// edm::ESHandle<RunInfo> sum;
35
// es.get<RunInfoRcd>().get(sum);
36
// return closerNominalField( *sum.product() );
37
// }
38
39
40
}
41
42
#endif // MagneticFieldHelpers_h
mps_fire.i
i
Definition:
mps_fire.py:355
RunInfoPI::nominalCurrents
constexpr std::array< int, 7 > nominalCurrents
Definition:
RunInfoPayloadInspectoHelper.h:16
ESHandle.h
RunInfoPI::nominalFields
constexpr std::array< float, 7 > nominalFields
Definition:
RunInfoPayloadInspectoHelper.h:17
magneticFieldHelpers
Definition:
MagneticFieldHelpers.h:9
magneticFieldHelpers::closerNominalField
int closerNominalField(float current)
Return the closer nominal field value (kGauss) to a given magnet current (A)
Definition:
MagneticFieldHelpers.h:12
EventSetup.h
Generated for CMSSW Reference Manual by
1.8.16