Skip to content

Commit

Permalink
Merge branch 'master' into Phase2_PbPb_CMSSW_14_1_X
Browse files Browse the repository at this point in the history
  • Loading branch information
stahlleiton authored Aug 18, 2024
2 parents 47ae27e + 9f8ff8e commit d4adc0b
Show file tree
Hide file tree
Showing 23 changed files with 280 additions and 37 deletions.
59 changes: 52 additions & 7 deletions Configuration/Geometry/python/dict2021Geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,7 @@
muonDict = {
"abbrev" : "M",
"name" : "muon",
"default" : 1,
"default" : 4,
"M1" : {
1 : [
'Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml',
Expand Down Expand Up @@ -1530,6 +1530,51 @@
],
"era" : "run3_GEM",
},
"M4" : {
1 : [
'Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml',
'Geometry/MuonCommonData/data/mb1/2021/v1/mb1.xml',
'Geometry/MuonCommonData/data/mb2/2021/v1/mb2.xml',
'Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml',
'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml',
'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml',
'Geometry/MuonCommonData/data/muonYoke/2021/v5/muonYoke.xml',
'Geometry/MuonCommonData/data/mf/2021/v3/mf.xml',
'Geometry/MuonCommonData/data/rpcf/2024/v1/rpcf.xml',
'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml',
'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml',
'Geometry/MuonCommonData/data/gem21/2024/v2/gem21.xml',
'Geometry/MuonCommonData/data/csc/2021/v3/csc.xml',
'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml',
],
2 : [
'Geometry/MuonCommonData/data/muonNumbering/2024/v1/muonNumbering.xml',
],
3 : [
'Geometry/MuonSimData/data/muonSens/2021/v4/muonSens.xml',
'Geometry/DTGeometryBuilder/data/dtSpecsFilter/2021/v1/dtSpecsFilter.xml',
'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml',
'Geometry/CSCGeometryBuilder/data/cscSpecs.xml',
'Geometry/RPCGeometryBuilder/data/2021/v1/RPCSpecs.xml',
'Geometry/GEMGeometryBuilder/data/GEMSpecsFilter/2021/v2/GEMSpecsFilter.xml',
'Geometry/GEMGeometryBuilder/data/GEMSpecs/2021/v2/GEMSpecs.xml',
],
4 : [
'Geometry/MuonSimData/data/muonProdCuts/2021/v3/muonProdCuts.xml',
],
"sim" : [
'from Geometry.MuonNumbering.muonGeometryConstants_cff import *',
'from Geometry.MuonNumbering.muonOffsetESProducer_cff import *',
],
"reco" : [
'from Geometry.MuonNumbering.muonNumberingInitialization_cfi import *',
'from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import *',
'from Geometry.GEMGeometryBuilder.gemGeometry_cff import *',
'from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import *',
'from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import *',
],
"era" : "run3_GEM",
},
}

forwardDict = {
Expand Down Expand Up @@ -1756,12 +1801,12 @@
("O5","T6","C1","M2","F2","P7") : "2023FlatMinus10Percent",
("O5","T7","C1","M2","F2","P7") : "2023FlatPlus05Percent",
("O5","T8","C1","M2","F2","P7") : "2023FlatPlus10Percent",
("O6","T3","C1","M3","F3","P7") : "2024",
("O4","T4","C1","M3","F2","P7") : "2024ZeroMaterial",
("O5","T5","C1","M3","F2","P7") : "2024FlatMinus05Percent",
("O5","T6","C1","M3","F2","P7") : "2024FlatMinus10Percent",
("O5","T7","C1","M3","F2","P7") : "2024FlatPlus05Percent",
("O5","T8","C1","M3","F2","P7") : "2024FlatPlus10Percent",
("O6","T3","C1","M4","F3","P7") : "2024",
("O4","T4","C1","M4","F2","P7") : "2024ZeroMaterial",
("O5","T5","C1","M4","F2","P7") : "2024FlatMinus05Percent",
("O5","T6","C1","M4","F2","P7") : "2024FlatMinus10Percent",
("O5","T7","C1","M4","F2","P7") : "2024FlatPlus05Percent",
("O5","T8","C1","M4","F2","P7") : "2024FlatPlus10Percent",
}

deprecatedSubdets = set([ "T1", "T2", "O1", "O2", "O3", "P1", "P2", "P3",
Expand Down
6 changes: 5 additions & 1 deletion Configuration/PyReleaseValidation/python/MatrixUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,8 @@ def genvalid(fragment,d,suffix='all',fi='',dataSet=''):
c['cfg']=fragment
return c


def check_dups(input):
seen = set()
dups = set(x for x in input if x in seen or seen.add(x))

return dups
6 changes: 3 additions & 3 deletions Configuration/PyReleaseValidation/python/relval_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
step1Up2018HiProdDefaults = merge ([{'--eventcontent':'RAWSIM'},step1Up2018HiDefaults])
# step1 gensim: for 2022 HI prod
step1Up2022HiProdDefaults = merge ([{'--conditions':'auto:phase1_2022_realistic_hi','--era':'Run3_pp_on_PbPb','--beamspot':'Realistic2022PbPbCollision','--eventcontent':'RAWSIM','--geometry':'DB:Extended'},step1Up2018HiDefaults])
step1Up2023HiProdDefaults = merge ([{'--conditions':'auto:phase1_2023_realistic_hi','--era':'Run3_pp_on_PbPb_2023','--beamspot':'Realistic2023PbPbCollision','--eventcontent':'RAWSIM','--geometry':'DB:Extended'},step1Up2018HiDefaults])
step1Up2023HiProdDefaults = merge ([{'--conditions':'auto:phase1_2023_realistic_hi','--era':'Run3_pp_on_PbPb_2023','--beamspot':'DBrealistic','--eventcontent':'RAWSIM','--geometry':'DB:Extended'},step1Up2018HiDefaults])
# step1 gensim: for 2024
step1Up2024Defaults = merge ([{'--conditions':'auto:phase1_2024_realistic','--era':'Run3','--beamspot':'Realistic25ns13p6TeVEarly2023Collision'},step1Up2018Defaults])
step1Up2024Defaults = merge ([{'--conditions':'auto:phase1_2024_realistic','--era':'Run3','--beamspot':'DBrealistic'},step1Up2018Defaults])
# step1 gensim: for 2024 HI prod
step1Up2024HiProdDefaults = merge ([{'--conditions':'auto:phase1_2024_realistic_hi','--era':'Run3_pp_on_PbPb_2024','--beamspot':'Realistic2023PbPbCollision'},step1Up2023HiProdDefaults])
step1Up2024HiProdDefaults = merge ([{'--conditions':'auto:phase1_2024_realistic_hi','--era':'Run3_pp_on_PbPb_2024','--beamspot':'DBrealistic'},step1Up2023HiProdDefaults])

steps = Steps()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from copy import copy, deepcopy
from collections import OrderedDict
from .MatrixUtil import merge, Kby, Mby
from .MatrixUtil import merge, Kby, Mby, check_dups
import re

U2000by1={'--relval': '2000,1'}
Expand Down Expand Up @@ -2844,13 +2844,18 @@ def condition(self, fragment, stepList, key, hasHarvest):
offset = 0.85,
)

# check for duplicate offsets
offsets = [specialWF.offset for specialType,specialWF in upgradeWFs.items()]
seen = set()
dups = set(x for x in offsets if x in seen or seen.add(x))
# check for duplicates in offsets or suffixes
offsets = [specialWF.offset for specialType,specialWF in upgradeWFs.items()]
suffixes = [specialWF.suffix for specialType,specialWF in upgradeWFs.items()]

dups = check_dups(offsets)
if len(dups)>0:
raise ValueError("Duplicate special workflow offsets not allowed: "+','.join([str(x) for x in dups]))

dups = check_dups(suffixes)
if len(dups)>0:
raise ValueError("Duplicate special workflow suffixes not allowed: "+','.join([str(x) for x in dups]))

upgradeProperties = {}

upgradeProperties[2017] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
<Include ref='Geometry/MuonCommonData/data/rpcf/2024/v1/rpcf.xml'/>
<Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem21/2024/v1/gem21.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem21/2024/v2/gem21.xml'/>
<Include ref='Geometry/MuonCommonData/data/csc/2021/v3/csc.xml'/>
<Include ref='Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml'/>
<Include ref='Geometry/MuonCommonData/data/muonNumbering/2024/v1/muonNumbering.xml'/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
<Include ref='Geometry/MuonCommonData/data/rpcf/2024/v1/rpcf.xml'/>
<Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem21/2024/v1/gem21.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem21/2024/v2/gem21.xml'/>
<Include ref='Geometry/MuonCommonData/data/csc/2021/v3/csc.xml'/>
<Include ref='Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml'/>
<Include ref='Geometry/MuonCommonData/data/muonNumbering/2024/v1/muonNumbering.xml'/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
<Include ref='Geometry/MuonCommonData/data/rpcf/2024/v1/rpcf.xml'/>
<Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem21/2024/v1/gem21.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem21/2024/v2/gem21.xml'/>
<Include ref='Geometry/MuonCommonData/data/csc/2021/v3/csc.xml'/>
<Include ref='Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml'/>
<Include ref='Geometry/MuonCommonData/data/muonNumbering/2024/v1/muonNumbering.xml'/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
<Include ref='Geometry/MuonCommonData/data/rpcf/2024/v1/rpcf.xml'/>
<Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem21/2024/v1/gem21.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem21/2024/v2/gem21.xml'/>
<Include ref='Geometry/MuonCommonData/data/csc/2021/v3/csc.xml'/>
<Include ref='Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml'/>
<Include ref='Geometry/MuonCommonData/data/muonNumbering/2024/v1/muonNumbering.xml'/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
<Include ref='Geometry/MuonCommonData/data/rpcf/2024/v1/rpcf.xml'/>
<Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem21/2024/v1/gem21.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem21/2024/v2/gem21.xml'/>
<Include ref='Geometry/MuonCommonData/data/csc/2021/v3/csc.xml'/>
<Include ref='Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml'/>
<Include ref='Geometry/MuonCommonData/data/muonNumbering/2024/v1/muonNumbering.xml'/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
<Include ref='Geometry/MuonCommonData/data/rpcf/2024/v1/rpcf.xml'/>
<Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem21/2024/v1/gem21.xml'/>
<Include ref='Geometry/MuonCommonData/data/gem21/2024/v2/gem21.xml'/>
<Include ref='Geometry/MuonCommonData/data/csc/2021/v3/csc.xml'/>
<Include ref='Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml'/>
<Include ref='Geometry/MuonCommonData/data/muonNumbering/2024/v1/muonNumbering.xml'/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
'Geometry/MuonCommonData/data/rpcf/2024/v1/rpcf.xml',
'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml',
'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml',
'Geometry/MuonCommonData/data/gem21/2024/v1/gem21.xml',
'Geometry/MuonCommonData/data/gem21/2024/v2/gem21.xml',
'Geometry/MuonCommonData/data/csc/2021/v3/csc.xml',
'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml',
)+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
'Geometry/MuonCommonData/data/rpcf/2024/v1/rpcf.xml',
'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml',
'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml',
'Geometry/MuonCommonData/data/gem21/2024/v1/gem21.xml',
'Geometry/MuonCommonData/data/gem21/2024/v2/gem21.xml',
'Geometry/MuonCommonData/data/csc/2021/v3/csc.xml',
'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml',
)+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
'Geometry/MuonCommonData/data/rpcf/2024/v1/rpcf.xml',
'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml',
'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml',
'Geometry/MuonCommonData/data/gem21/2024/v1/gem21.xml',
'Geometry/MuonCommonData/data/gem21/2024/v2/gem21.xml',
'Geometry/MuonCommonData/data/csc/2021/v3/csc.xml',
'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml',
)+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
'Geometry/MuonCommonData/data/rpcf/2024/v1/rpcf.xml',
'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml',
'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml',
'Geometry/MuonCommonData/data/gem21/2024/v1/gem21.xml',
'Geometry/MuonCommonData/data/gem21/2024/v2/gem21.xml',
'Geometry/MuonCommonData/data/csc/2021/v3/csc.xml',
'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml',
)+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
'Geometry/MuonCommonData/data/rpcf/2024/v1/rpcf.xml',
'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml',
'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml',
'Geometry/MuonCommonData/data/gem21/2024/v1/gem21.xml',
'Geometry/MuonCommonData/data/gem21/2024/v2/gem21.xml',
'Geometry/MuonCommonData/data/csc/2021/v3/csc.xml',
'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml',
)+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
'Geometry/MuonCommonData/data/rpcf/2024/v1/rpcf.xml',
'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml',
'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml',
'Geometry/MuonCommonData/data/gem21/2024/v1/gem21.xml',
'Geometry/MuonCommonData/data/gem21/2024/v2/gem21.xml',
'Geometry/MuonCommonData/data/csc/2021/v3/csc.xml',
'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml',
)+
Expand Down
1 change: 1 addition & 0 deletions Geometry/HGCalCommonData/interface/HGCalProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ namespace HGCalProperty {
constexpr int32_t kHGCalTilePhis = 288;
constexpr int32_t kHGCalFineTilePhis = 432;
constexpr int32_t kHGCalTilePhisWord = 24;
constexpr int32_t kHGCalFineTilePhisWord = 36;
constexpr int32_t kHGCalTilePhisBy2 = kHGCalTilePhis / 2;
constexpr int32_t kHGCalTilePhisBy3 = kHGCalTilePhis / 3;
constexpr int32_t kHGCalFineTilePhisBy2 = kHGCalFineTilePhis / 2;
Expand Down
13 changes: 7 additions & 6 deletions Geometry/HGCalCommonData/test/HGCalConvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ void ConvertScintillator::makeTitle(const char* outfile,
int lmax,
bool debug) {
const int zside = 1;
const int phiCassette = 24;
const int phiCassette = HGCalProperty::kHGCalTilePhisWord;
std::vector<tileZone> zones;
for (int layer = lmin; layer <= lmax; ++layer) {
tileZone tile0;
Expand Down Expand Up @@ -1744,10 +1744,11 @@ void ConvertScintillatorV1::makeTitle(std::ofstream& fout,
int mode,
bool debug) {
const int zside = 1;
int tilePhisWord = (mode > 0) ? HGCalProperty::kHGCalFineTilePhisWord : HGCalProperty::kHGCalTilePhisWord;
std::vector<tileZone> zones;
if ((debug % 10) > 0)
std::cout << "makeTile called with Layer:" << lmin << ":" << lmax << " nphi " << nphis << " mode " << mode
<< " nmodules " << module.size() << std::endl;
<< " nmodules " << module.size() << " tilePhisWord " << tilePhisWord << std::endl;
for (int layer = lmin; layer <= lmax; ++layer) {
tileZone tile0;
int kk, irmin, irmax;
Expand Down Expand Up @@ -1783,19 +1784,19 @@ void ConvertScintillatorV1::makeTitle(std::ofstream& fout,
tile0.cassette = (cassette_ == 0) ? 0 : 1;
} else if ((tile0.rmin != irmin) || (tile0.rmax != irmax)) {
if (cassette_ != 0) {
if (tile0.cassette * HGCalProperty::kHGCalTilePhisWord < tile0.phimax) {
if (tile0.cassette * tilePhisWord < tile0.phimax) {
do {
int phimax = tile0.phimax;
tile0.phimax = tile0.cassette * HGCalProperty::kHGCalTilePhisWord;
tile0.phimax = tile0.cassette * tilePhisWord;
zones.push_back(tile0);
tile0.phimin = tile0.phimax + 1;
tile0.phimax = phimax;
++tile0.cassette;
} while (tile0.cassette * HGCalProperty::kHGCalTilePhisWord < tile0.phimax);
} while (tile0.cassette * tilePhisWord < tile0.phimax);
}
}
zones.push_back(tile0);
int cassette = (cassette_ == 0) ? 0 : (1 + ((phi - 1) / HGCalProperty::kHGCalTilePhisWord));
int cassette = (cassette_ == 0) ? 0 : (1 + ((phi - 1) / tilePhisWord));
tile0.layer = layer;
tile0.rmin = irmin;
tile0.rmax = irmax;
Expand Down
4 changes: 2 additions & 2 deletions Geometry/MuonCommonData/data/gem21/2024/v2/gem21.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2369,7 +2369,7 @@
<Numeric name="n" value="1"/>
<Numeric name="startCopyNo" value="([gemf:Layer2Offset]+17)"/>
<Numeric name="incrCopyNo" value="2"/>
<Numeric name="invert" value="1"/>
<Numeric name="invert" value="0"/>
<Numeric name="stepAngle" value="40*deg"/>
<Numeric name="startAngle" value="305*deg"/>
<Numeric name="rPosition" value="[rPosL]"/>
Expand All @@ -2383,7 +2383,7 @@
<Numeric name="n" value="2"/>
<Numeric name="startCopyNo" value="([gemf:Layer2Offset]+16)"/>
<Numeric name="incrCopyNo" value="2"/>
<Numeric name="invert" value="1"/>
<Numeric name="invert" value="0"/>
<Numeric name="stepAngle" value="-40*deg"/>
<Numeric name="startAngle" value="-125*deg"/>
<Numeric name="rPosition" value="[rPosL]"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
Description: Utility function to calculate the Magnetic Field on the GPU. The Vec3 argument of the functions must support access to its components via (), note that e.g. Eigen::Matrix provides such an interface.
*/

#ifndef MagneticField_ParametrizedEngine_interface_ParabolicParametrizedMagneticField_h
#define MagneticField_ParametrizedEngine_interface_ParabolicParametrizedMagneticField_h

namespace magneticFieldParabolicPortable {

struct Parameters {
// These parameters are the best fit of 3.8T to the OAEParametrizedMagneticField parametrization.
// See MagneticField/ParametrizedEngine/src/ParabolicParametrizedMagneticField.cc
static constexpr float c1 = 3.8114;
static constexpr float b0 = -3.94991e-06;
static constexpr float b1 = 7.53701e-06;
static constexpr float a = 2.43878e-11;
static constexpr float max_radius2 = 13225.f; // tracker radius
static constexpr float max_z = 280.f; // tracker z
};

template <typename Vec3>
constexpr float Kr(Vec3 const& vec) {
return Parameters::a * (vec(0) * vec(0) + vec(1) * vec(1)) + 1.f;
}

template <typename Vec3>
constexpr float B0Z(Vec3 const& vec) {
return Parameters::b0 * vec(2) * vec(2) + Parameters::b1 * vec(2) + Parameters::c1;
}

template <typename Vec3>
constexpr bool isValid(Vec3 const& vec) {
return ((vec(0) * vec(0) + vec(1) * vec(1)) < Parameters::max_radius2 && fabs(vec(2)) < Parameters::max_z);
}

template <typename Vec3>
constexpr float magneticFieldAtPoint(Vec3 const& vec) {
if (isValid(vec)) {
return B0Z(vec) * Kr(vec);
} else {
return 0;
}
}

} // namespace magneticFieldParabolicPortable

#endif
9 changes: 9 additions & 0 deletions MagneticField/ParametrizedEngine/test/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<bin file="alpaka/testParabolicParametrizedMagneticField.dev.cc">
<use name="alpaka"/>
<use name="eigen"/>
<use name="DataFormats/GeometryVector"/>
<use name="FWCore/Utilities"/>
<use name="HeterogeneousCore/AlpakaInterface"/>
<use name="MagneticField/ParametrizedEngine" source_only="1"/>
<flags ALPAKA_BACKENDS="1"/>
</bin>
Loading

0 comments on commit d4adc0b

Please sign in to comment.