Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions GeometryService/inc/ProductionTargetMaker.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ namespace mu2e {
static const int tier1{1};
// version 2 is the low density hayman
static const int hayman_v_2_0{3};
static const int stickman_v_1_0{4};


static std::unique_ptr<ProductionTarget> makeTier1(const SimpleConfig& config, double solenoidOffset);
static std::unique_ptr<ProductionTarget> makeHayman_v_2_0(const SimpleConfig& config, double solenoidOffset);
static std::unique_ptr<ProductionTarget> makeStickman_v_1_0(const SimpleConfig& config, double solenoidOffset);



Expand Down
18 changes: 10 additions & 8 deletions GeometryService/src/GeometryService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,17 @@ namespace mu2e {

//addDetector(PSShieldMaker::make(*_config, ps.psEndRefPoint(), prodTarget.position()));

if (_config->getString("targetPS_model") == "MDC2018"){
// std::cout << "adding Tier1 in GeometryService" << std::endl;
if (_config->getString("targetPS_model") == "MDC2018"){
// std::cout << "adding Tier1 in GeometryService" << std::endl;
addDetector(PSShieldMaker::make(*_config, ps.psEndRefPoint(), prodTarget.position()));
} else
if (_config->getString("targetPS_model") == "Hayman_v_2_0"){
// std::cout << " adding Hayman in GeometryService" << std::endl;
addDetector(PSShieldMaker::make(*_config, ps.psEndRefPoint(), prodTarget.haymanProdTargetPosition()));
} else
{throw cet::exception("GEOM") << " " << static_cast<char const*>(__func__) << " illegal production target version specified in GeometryService_service = " << _config->getString("targetPS_model") << std::endl;}
} else if (_config->getString("targetPS_model") == "Hayman_v_2_0"){
// std::cout << " adding Hayman in GeometryService" << std::endl;
addDetector(PSShieldMaker::make(*_config, ps.psEndRefPoint(), prodTarget.haymanProdTargetPosition()));
} else if (_config->getString("targetPS_model") == "Stickman_v_1_0"){
// std::cout << "adding Stickman in GeometryService" << std::endl;
addDetector(PSShieldMaker::make(*_config, ps.psEndRefPoint(), prodTarget.stickmanProdTargetPosition()));
} else {
throw cet::exception("GEOM") << " " << static_cast<char const*>(__func__) << " illegal production target version specified in GeometryService_service = " << _config->getString("targetPS_model") << std::endl;}



Expand Down
132 changes: 121 additions & 11 deletions GeometryService/src/ProductionTargetMaker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@
namespace mu2e {

std::unique_ptr<ProductionTarget> ProductionTargetMaker::make(const SimpleConfig& c, double solenoidOffset) {


if (c.getString("targetPS_model") == "MDC2018"){
// std::cout << "making Tier1 in maker" << std::endl;
// std::cout << " making Tier1 in maker" << std::endl;
return makeTier1(c, solenoidOffset);
} else
if (c.getString("targetPS_model") == "Hayman_v_2_0"){
// std::cout << " making Hayman in Maker" << std::endl;
return makeHayman_v_2_0(c, solenoidOffset);
} else
{throw cet::exception("GEOM") << " illegal production target version specified = " << c.getInt("targetPS_version") << std::endl;}
return 0;

} else if (c.getString("targetPS_model") == "Hayman_v_2_0"){
// std::cout << " making Hayman in Maker" << std::endl;
return makeHayman_v_2_0(c, solenoidOffset);
} else if (c.getString("targetPS_model") == "Stickman_v_1_0"){
return makeStickman_v_1_0(c, solenoidOffset);
} else{
throw cet::exception("GEOM") << " illegal production target model specified = " << c.getString("targetPS_model") << std::endl;
}
}

std::unique_ptr<ProductionTarget> ProductionTargetMaker::makeTier1(const SimpleConfig& c, double solenoidOffset){
Expand Down Expand Up @@ -390,5 +388,117 @@ namespace mu2e {
return tgtPS;
}

std::unique_ptr<ProductionTarget> ProductionTargetMaker::makeStickman_v_1_0(const SimpleConfig& c, double solenoidOffset){

// Read the plate and fin parameters
std::vector<std::string> plateMaterial;
std::vector<double> plateROut;
std::vector<double> plateFinAngles;
std::vector<double> plateThickness;
std::vector<double> plateLugThickness;

c.getVectorString("targetPS_plateMaterial", plateMaterial);
c.getVectorDouble("targetPS_rOut", plateROut);
c.getVectorDouble("targetPS_plateFinAngles", plateFinAngles);
for_each(plateFinAngles.begin(), plateFinAngles.end(), [](double& elem){elem *= CLHEP::degree;});
c.getVectorDouble("targetPS_plateThickness", plateThickness);
c.getVectorDouble("targetPS_plateLugThickness", plateLugThickness);

std::unique_ptr<ProductionTarget> tgtPS
(new ProductionTarget(
c.getString("targetPS_model","NULL"),
c.getInt("targetPS_version"),
c.getDouble("targetPS_productionTargetMotherOuterRadius"),
c.getDouble("targetPS_productionTargetMotherHalfLength"),
c.getDouble("targetPS_rotX") * CLHEP::degree,
c.getDouble("targetPS_rotY") * CLHEP::degree,
c.getDouble("targetPS_rotZ") * CLHEP::degree,
c.getDouble("targetPS_halfStickmanLength"),
CLHEP::Hep3Vector(solenoidOffset,
0,
c.getDouble("productionTarget.zNominal")
)
+ c.getHep3Vector("productionTarget.offset"),
c.getString("targetPS_targetVacuumMaterial"),
c.getInt("targetPS_numberOfPlates"),
plateMaterial,
plateROut,
c.getInt("targetPS_nStickmanFins"),
plateFinAngles,
c.getDouble("targetPS_plateFinOuterRadius"),
c.getDouble("targetPS_plateFinWidth"),
c.getDouble("targetPS_plateCenterToLugCenter"),
c.getDouble("targetPS_plateLugInnerRadius"),
c.getDouble("targetPS_plateLugOuterRadius"),
plateThickness,
plateLugThickness,
c.getString("targetPS_rodMaterial"),
c.getDouble("targetPS_rodRadius"),
c.getString("targetPS_spacerMaterial"),
c.getDouble("targetPS_spacerHalfLength"),
c.getDouble("targetPS_spacerOuterRadius"),
c.getDouble("targetPS_spacerInnerRadius"),
c.getString("targetPS_supportRingMaterial"),
c.getDouble("targetPS_supportRingLength"),
c.getDouble("targetPS_supportRingInnerRadius"),
c.getDouble("targetPS_supportRingOuterRadius"),
c.getDouble("targetPS_supportRingLugOuterRadius"),
c.getDouble("targetPS_supportRingCutoutOffset")
));

// Configure plate fillet parameters (only if fillets will be used)
tgtPS->_addFilletToPlateCore = c.getBool("targetPS_addFilletToPlateCore");
tgtPS->_addFilletToPlateLug = c.getBool("targetPS_addFilletToPlateLug");
if(tgtPS->_addFilletToPlateCore || tgtPS->_addFilletToPlateLug) {
tgtPS->_plateFilletRadius = c.getDouble("targetPS_plateFilletRadius");
}

// Configure support ring lug fillet parameters (only if fillets will be used)
tgtPS->_addFilletToSupportRingLug = c.getBool("targetPS_addFilletToSupportRingLug");
if(tgtPS->_addFilletToSupportRingLug) {
tgtPS->_supportRingLugFilletRadius = c.getDouble("targetPS_supportRingLugFilletRadius");
}

// Configure support ring cutout parameters (only if cutouts will be used)
tgtPS->_addCutoutToSupportRing = c.getBool("targetPS_addCutoutToSupportRing");
if(tgtPS->_addCutoutToSupportRing) {
tgtPS->_nSupportRingCutouts = c.getInt("targetPS_nSupportRingCutouts");
c.getVectorDouble("targetPS_supportRingCutoutAngles", tgtPS->_supportRingCutoutAngles);
for_each(tgtPS->_supportRingCutoutAngles.begin(), tgtPS->_supportRingCutoutAngles.end(), [](double& elem){elem *= CLHEP::degree;});
tgtPS->_supportRingCutoutInnerRadius = c.getDouble("targetPS_supportRingCutoutInnerRadius");
tgtPS->_supportRingCutoutTilt = c.getDouble("targetPS_supportRingCutoutTilt") * CLHEP::degree;
}

// Configure support wheel/bicycle wheel parameters (reused from Hayman)
tgtPS->_supportsBuild = c.getBool("targetPS.supports.build", false);
if(tgtPS->_supportsBuild) {
//support wheel parameters
tgtPS->_supportWheelRIn = c.getDouble("targetPS.supports.wheel.rIn");
tgtPS->_supportWheelROut = c.getDouble("targetPS.supports.wheel.rOut");
tgtPS->_supportWheelHL = c.getDouble("targetPS.supports.wheel.halfLength");
tgtPS->_supportWheelMaterial = c.getString("targetPS.supports.wheel.material");
//number of support rods and wires
tgtPS->_nSpokesPerSide = c.getInt("targetPS.supports.nSpokes");
//features on the wheel near each support rod
c.getVectorDouble("targetPS.supports.features.angles", tgtPS->_supportWheelFeatureAngles, tgtPS->_nSpokesPerSide);
c.getVectorDouble("targetPS.supports.features.arcs" , tgtPS->_supportWheelFeatureArcs , tgtPS->_nSpokesPerSide);
c.getVectorDouble("targetPS.supports.features.rIns" , tgtPS->_supportWheelFeatureRIns , tgtPS->_nSpokesPerSide);
//support wheel rods parameters
c.getVectorDouble("targetPS.supports.rods.halfLength", tgtPS->_supportWheelRodHL, tgtPS->_nSpokesPerSide);
c.getVectorDouble("targetPS.supports.rods.offset", tgtPS->_supportWheelRodOffset, tgtPS->_nSpokesPerSide);
c.getVectorDouble("targetPS.supports.rods.radius", tgtPS->_supportWheelRodRadius, tgtPS->_nSpokesPerSide);
c.getVectorDouble("targetPS.supports.rods.radialOffset", tgtPS->_supportWheelRodRadialOffset, tgtPS->_nSpokesPerSide);
c.getVectorDouble("targetPS.supports.rods.wireOffset.downstream", tgtPS->_supportWheelRodWireOffsetD, tgtPS->_nSpokesPerSide);
c.getVectorDouble("targetPS.supports.rods.wireOffset.upstream", tgtPS->_supportWheelRodWireOffsetU, tgtPS->_nSpokesPerSide);
c.getVectorDouble("targetPS.supports.rods.angles", tgtPS->_supportWheelRodAngles, tgtPS->_nSpokesPerSide);
//support wire (spokes) parameters
c.getVectorDouble("targetPS.supports.spokes.targetAngles.downstream", tgtPS->_spokeTargetAnglesD, tgtPS->_nSpokesPerSide);
c.getVectorDouble("targetPS.supports.spokes.targetAngles.upstream", tgtPS->_spokeTargetAnglesU, tgtPS->_nSpokesPerSide);
tgtPS->_spokeRadius = 0.5*c.getDouble("targetPS.supports.spokes.diameter");
tgtPS->_spokeMaterial = c.getString("targetPS.supports.spokes.material");
}
return tgtPS;
}


} // namespace mu2e
6 changes: 3 additions & 3 deletions MCDataProducts/inc/GenId.hh
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ namespace mu2e {
cosmicCRY, pbarFlat, fromAscii, ExternalRMC, InternalRMC, CeLeadingLog, cosmicCORSIKA, //44
MuCapProtonGenTool, MuCapDeuteronGenTool, DIOGenTool, MuCapNeutronGenTool, // 48
MuCapPhotonGenTool, MuCapGammaRayGenTool, CeLeadingLogGenTool, MuplusMichelGenTool,// 52
gammaPairProduction, antiproton, Mu2eXGenTool,//55
lastEnum //56
gammaPairProduction, antiproton, Mu2eXGenTool, STMDownStreamGenTool,//56
lastEnum //57
};

#ifndef SWIG
Expand All @@ -64,7 +64,7 @@ namespace mu2e {
"CosmicCRY", "pbarFlat","fromAscii","ExternalRMC","InternalRMC","CeLeadingLog", "CosmicCORSIKA", \
"MuCapProtonGenTool", "MuCapDeuteronGenTool", "DIOGenTool", "MuCapNeutronGenTool", \
"MuCapPhotonGenTool", "MuCapGammaRayGenTool","CeLeadingLogGenTool","MuplusMichelGenTool", \
"gammaPairProduction", "antiproton", "Mu2eXGenTool"
"gammaPairProduction", "antiproton", "Mu2eXGenTool", "STMDownStreamGenTool"
#endif

public:
Expand Down
11 changes: 11 additions & 0 deletions MachineLearningTools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cet_make_library(
SOURCE
src/ScoreBasedDiffusionModel.cc
LIBRARIES PUBLIC
CLHEP::CLHEP
messagefacility::messagefacility
cetlib_except::cetlib_except
)

install_source(SUBDIRS src)
install_headers(USE_PROJECT_NAME SUBDIRS inc)
Loading