Commit b5481dea authored by Valerio Bertone's avatar Valerio Bertone
Browse files

Setting unpolarised PDF as a default for the CollinearDistributionLHAPDF

parent 94e8fc84
......@@ -19,6 +19,7 @@ CollinearDistributionLHAPDF::CollinearDistributionLHAPDF(
CollinearDistributionModule(className), m_setName("UNDEFINED"), m_member(
0), m_type(CollinearDistributionType::Type::UnpolPDF), m_set(
{ }) {
setType(m_type);
}
CollinearDistributionLHAPDF::CollinearDistributionLHAPDF(
......@@ -29,6 +30,7 @@ CollinearDistributionLHAPDF::CollinearDistributionLHAPDF(
m_member = other.getMember();
m_type = other.getType();
m_set = other.getSet();
setType(m_type);
}
CollinearDistributionLHAPDF* CollinearDistributionLHAPDF::clone() const {
......@@ -47,34 +49,19 @@ void CollinearDistributionLHAPDF::configure(
LHAPDF::setVerbosity(0);
//check and set
if (parameters.isAvailable(
CollinearDistributionLHAPDF::PARAM_NAME_SET_NAME)) {
if (parameters.isAvailable(CollinearDistributionLHAPDF::PARAM_NAME_SET_NAME)) {
setSetName(parameters.getLastAvailable().getString());
info(__func__,
ElemUtils::Formatter()
<< CollinearDistributionLHAPDF::PARAM_NAME_SET_NAME
<< " configured with value = " << getSetName());
info(__func__, ElemUtils::Formatter() << CollinearDistributionLHAPDF::PARAM_NAME_SET_NAME << " configured with value = " << getSetName());
}
if (parameters.isAvailable(
CollinearDistributionLHAPDF::PARAM_NAME_SET_MEMBER)) {
if (parameters.isAvailable(CollinearDistributionLHAPDF::PARAM_NAME_SET_MEMBER)) {
setMember(parameters.getLastAvailable().toUInt());
info(__func__,
ElemUtils::Formatter()
<< CollinearDistributionLHAPDF::PARAM_NAME_SET_MEMBER
<< " configured with value = " << getMember());
info(__func__, ElemUtils::Formatter() << CollinearDistributionLHAPDF::PARAM_NAME_SET_MEMBER << " configured with value = " << getMember());
}
if (parameters.isAvailable(
CollinearDistributionLHAPDF::PARAM_NAME_SET_TYPE)) {
setType(
CollinearDistributionType { }.fromString(
parameters.getLastAvailable().getString()));
info(__func__,
ElemUtils::Formatter()
<< CollinearDistributionLHAPDF::PARAM_NAME_SET_TYPE
<< " configured with value = "
<< CollinearDistributionType(getType()).toString());
if (parameters.isAvailable(CollinearDistributionLHAPDF::PARAM_NAME_SET_TYPE)) {
setType(CollinearDistributionType { }.fromString(parameters.getLastAvailable().getString()));
info(__func__, ElemUtils::Formatter() << CollinearDistributionLHAPDF::PARAM_NAME_SET_TYPE << " configured with value = " << CollinearDistributionType(getType()).toString());
}
}
......@@ -357,67 +344,44 @@ void CollinearDistributionLHAPDF::setMember(const int &member) {
m_member = member;
}
void CollinearDistributionLHAPDF::setType(
const CollinearDistributionType::Type &type) {
void CollinearDistributionLHAPDF::setType(const CollinearDistributionType::Type &type) {
m_listCollinearDistributionComputeTypeAvailable.clear();
switch (type) {
case CollinearDistributionType::UnpolPDF: {
m_listCollinearDistributionComputeTypeAvailable.insert(
std::make_pair(CollinearDistributionType::UnpolPDF,
&CollinearDistributionModule::computeUnpolPDF));
m_listCollinearDistributionComputeTypeAvailable.insert(std::make_pair(CollinearDistributionType::UnpolPDF, &CollinearDistributionModule::computeUnpolPDF));
break;
}
case CollinearDistributionType::PolPDF: {
m_listCollinearDistributionComputeTypeAvailable.insert(
std::make_pair(CollinearDistributionType::PolPDF,
&CollinearDistributionModule::computePolPDF));
m_listCollinearDistributionComputeTypeAvailable.insert(std::make_pair(CollinearDistributionType::PolPDF, &CollinearDistributionModule::computePolPDF));
break;
}
case CollinearDistributionType::TransPDF: {
m_listCollinearDistributionComputeTypeAvailable.insert(
std::make_pair(CollinearDistributionType::TransPDF,
&CollinearDistributionModule::computeTransPDF));
m_listCollinearDistributionComputeTypeAvailable.insert(std::make_pair(CollinearDistributionType::TransPDF, &CollinearDistributionModule::computeTransPDF));
break;
}
case CollinearDistributionType::UnpolFF: {
m_listCollinearDistributionComputeTypeAvailable.insert(
std::make_pair(CollinearDistributionType::UnpolFF,
&CollinearDistributionModule::computeUnpolFF));
m_listCollinearDistributionComputeTypeAvailable.insert(std::make_pair(CollinearDistributionType::UnpolFF, &CollinearDistributionModule::computeUnpolFF));
break;
}
case CollinearDistributionType::PolFF: {
m_listCollinearDistributionComputeTypeAvailable.insert(
std::make_pair(CollinearDistributionType::PolFF,
&CollinearDistributionModule::computePolFF));
m_listCollinearDistributionComputeTypeAvailable.insert(std::make_pair(CollinearDistributionType::PolFF, &CollinearDistributionModule::computePolFF));
break;
}
case CollinearDistributionType::TransFF: {
m_listCollinearDistributionComputeTypeAvailable.insert(
std::make_pair(CollinearDistributionType::TransFF,
&CollinearDistributionModule::computeTransFF));
m_listCollinearDistributionComputeTypeAvailable.insert(std::make_pair(CollinearDistributionType::TransFF, &CollinearDistributionModule::computeTransFF));
break;
}
default: {
throw ElemUtils::CustomException(getClassName(), __func__,
ElemUtils::Formatter()
<< "Not able to relate function with type "
<< CollinearDistributionType(type).toString());
throw ElemUtils::CustomException(getClassName(), __func__, ElemUtils::Formatter() << "Not able to relate function with type " << CollinearDistributionType(type).toString());
break;
}
}
......
......@@ -28,8 +28,7 @@ CollinearDistributionModule::CollinearDistributionModule(const std::string &clas
}
CollinearDistributionModule::CollinearDistributionModule(const CollinearDistributionModule &other) :
ModuleObject(other), m_x(other.m_x), m_MuF2(
other.m_MuF2), m_MuR2(other.m_MuR2), m_MuF2_ref(other.m_MuF2_ref) {
ModuleObject(other), m_x(other.m_x), m_MuF2(other.m_MuF2), m_MuR2(other.m_MuR2), m_MuF2_ref(other.m_MuF2_ref) {
if (other.m_pCollinearDistributionEvolutionModule != 0) {
m_pCollinearDistributionEvolutionModule = m_pModuleObjectFactory->cloneModuleObject(
......@@ -123,8 +122,7 @@ void CollinearDistributionModule::prepareSubModules(const std::map<std::string,
}
PartonDistribution CollinearDistributionModule::compute(const CollinearDistributionKinematic &kinematic,
CollinearDistributionType::Type colldistType) {
PartonDistribution CollinearDistributionModule::compute(const CollinearDistributionKinematic &kinematic, CollinearDistributionType::Type colldistType) {
//create list
List<CollinearDistributionType> list;
......@@ -136,8 +134,7 @@ PartonDistribution CollinearDistributionModule::compute(const CollinearDistribut
return compute(kinematic, list).getPartonDistribution(colldistType);
}
CollinearDistributionResult CollinearDistributionModule::compute(const CollinearDistributionKinematic &kinematic,
const List<CollinearDistributionType>& colldistType) {
CollinearDistributionResult CollinearDistributionModule::compute(const CollinearDistributionKinematic &kinematic, const List<CollinearDistributionType>& colldistType) {
//reset kinematics (virtuality)
setKinematics(kinematic);
......@@ -155,8 +152,7 @@ CollinearDistributionResult CollinearDistributionModule::compute(const Collinear
for (size_t i = 0; i < colldistType.size(); i++) {
//search for pointer to function associated to given collinear distribution type
std::map<CollinearDistributionType::Type, PartonDistribution (CollinearDistributionModule::*)()>::iterator m_it =
m_listCollinearDistributionComputeTypeAvailable.find(colldistType[i]);
std::map<CollinearDistributionType::Type, PartonDistribution (CollinearDistributionModule::*)()>::iterator m_it = m_listCollinearDistributionComputeTypeAvailable.find(colldistType[i]);
//check if found
if (m_it != m_listCollinearDistributionComputeTypeAvailable.end()) {
......@@ -200,8 +196,7 @@ List<CollinearDistributionType> CollinearDistributionModule::getListOfAvailableC
std::map<CollinearDistributionType::Type, PartonDistribution (CollinearDistributionModule::*)()>::const_iterator it;
//fill list
for (it = m_listCollinearDistributionComputeTypeAvailable.begin();
it != m_listCollinearDistributionComputeTypeAvailable.end(); it++) {
for (it = m_listCollinearDistributionComputeTypeAvailable.begin(); it != m_listCollinearDistributionComputeTypeAvailable.end(); it++) {
listOfAvailableCollinearDistributionTypeForComputation.add(it->first);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment