diff --git a/src/LauNSCCartesianCPCoeffSet.cc b/src/LauNSCCartesianCPCoeffSet.cc index 38da8ca..db94f5b 100644 --- a/src/LauNSCCartesianCPCoeffSet.cc +++ b/src/LauNSCCartesianCPCoeffSet.cc @@ -1,516 +1,516 @@ /* Copyright 2015 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauNSCCartesianCPCoeffSet.cc \brief File containing implementation of LauNSCCartesianCPCoeffSet class. */ #include #include #include #include "TMath.h" #include "TRandom.h" #include "LauNSCCartesianCPCoeffSet.hh" #include "LauComplex.hh" #include "LauConstants.hh" #include "LauJsonTools.hh" #include "LauParameter.hh" #include "LauPrint.hh" #include "LauRandom.hh" ClassImp(LauNSCCartesianCPCoeffSet) LauNSCCartesianCPCoeffSet::LauNSCCartesianCPCoeffSet(const TString& compName, const Bool_t finalStateIsF, const Double_t x, const Double_t y, const Double_t deltaX, const Double_t deltaY, const Bool_t xFixed, const Bool_t yFixed, const Bool_t deltaXFixed, const Bool_t deltaYFixed, const Bool_t deltaXSecondStage, const Bool_t deltaYSecondStage, const Double_t xPrime, const Double_t yPrime, const Double_t deltaXPrime, const Double_t deltaYPrime, const Bool_t xPrimeFixed, const Bool_t yPrimeFixed, const Bool_t deltaXPrimeFixed, const Bool_t deltaYPrimeFixed, const Bool_t deltaXPrimeSecondStage, const Bool_t deltaYPrimeSecondStage ) : LauAbsCoeffSet{ compName }, finalStateIsF_{ finalStateIsF }, x_{ std::make_unique("X", x, minRealImagPart_, maxRealImagPart_, xFixed) }, y_{ std::make_unique("Y", y, minRealImagPart_, maxRealImagPart_, yFixed) }, deltaX_{ std::make_unique("DeltaX", deltaX, minDelta_, maxDelta_, deltaXFixed) }, deltaY_{ std::make_unique("DeltaY", deltaY, minDelta_, maxDelta_, deltaYFixed) }, xPrime_{ std::make_unique("XPrime", xPrime, minRealImagPart_, maxRealImagPart_, xPrimeFixed) }, yPrime_{ std::make_unique("YPrime", yPrime, minRealImagPart_, maxRealImagPart_, yPrimeFixed) }, deltaXPrime_{ std::make_unique("DeltaXPrime", deltaXPrime, minDelta_, maxDelta_, deltaXPrimeFixed) }, deltaYPrime_{ std::make_unique("DeltaYPrime", deltaYPrime, minDelta_, maxDelta_, deltaYPrimeFixed) }, acp_{ "ACP", 0.0, -1.0, 1.0, kTRUE } { if (deltaXSecondStage && !deltaXFixed) { deltaX_->secondStage(kTRUE); deltaX_->initValue(0.0); } if (deltaYSecondStage && !deltaYFixed) { deltaY_->secondStage(kTRUE); deltaY_->initValue(0.0); } if (deltaXPrimeSecondStage && !deltaXPrimeFixed) { deltaXPrime_->secondStage(kTRUE); deltaXPrime_->initValue(0.0); } if (deltaYPrimeSecondStage && !deltaYPrimeFixed) { deltaYPrime_->secondStage(kTRUE); deltaYPrime_->initValue(0.0); } } LauNSCCartesianCPCoeffSet::LauNSCCartesianCPCoeffSet(const LauNSCCartesianCPCoeffSet& rhs, const CloneOption cloneOption, const Double_t constFactor, const nlohmann::json& coeffInfo) : LauAbsCoeffSet{ rhs.name(), rhs.baseName(), &rhs, cloneOption, constFactor }, finalStateIsF_{ rhs.finalStateIsF_ }, coeffAf_{ rhs.coeffAf_ }, coeffAfbar_{ rhs.coeffAfbar_ }, coeffAbarf_{ rhs.coeffAbarf_ }, coeffAbarfbar_{ rhs.coeffAbarfbar_ }, acp_{ rhs.acp_ } { using LauJsonTools::JsonType; using LauJsonTools::getValue; using LauJsonTools::getOptionalValue; if ( cloneOption == CloneOption::All || cloneOption == CloneOption::TieRealPart ) { x_.reset( rhs.x_->createClone(constFactor) ); xPrime_.reset( rhs.xPrime_->createClone(constFactor) ); } else { const auto xVal { getOptionalValue( coeffInfo, "X", JsonType::Number ).value_or( rhs.x_->value() ) }; const auto xFixed { getOptionalValue( coeffInfo, "XFixed", JsonType::Boolean ).value_or( rhs.x_->fixed() ) }; x_ = std::make_unique("X", xVal, minRealImagPart_, maxRealImagPart_, xFixed); if ( getOptionalValue( coeffInfo, "XBlind", JsonType::Boolean ).value_or( kFALSE ) ) { const auto blindingString { getValue( coeffInfo, "XBlindingString" ) }; const auto blindingWidth { getValue( coeffInfo, "XBlindingWidth" ) }; x_->blindParameter( blindingString, blindingWidth ); } else if ( rhs.x_->blind() ) { const LauBlind* blinder { rhs.x_->blinder() }; x_->blindParameter( blinder->blindingString(), blinder->blindingWidth() ); } const auto xPrimeVal { getOptionalValue( coeffInfo, "XPrime", JsonType::Number ).value_or( rhs.xPrime_->value() ) }; const auto xPrimeFixed { getOptionalValue( coeffInfo, "XPrimeFixed", JsonType::Boolean ).value_or( rhs.xPrime_->fixed() ) }; xPrime_ = std::make_unique("XPrime", xPrimeVal, minRealImagPart_, maxRealImagPart_, xPrimeFixed); if ( getOptionalValue( coeffInfo, "XPrimeBlind", JsonType::Boolean ).value_or( kFALSE ) ) { const auto blindingString { getValue( coeffInfo, "XPrimeBlindingString" ) }; const auto blindingWidth { getValue( coeffInfo, "XPrimeBlindingWidth" ) }; xPrime_->blindParameter( blindingString, blindingWidth ); } else if ( rhs.xPrime_->blind() ) { const LauBlind* blinder { rhs.xPrime_->blinder() }; xPrime_->blindParameter( blinder->blindingString(), blinder->blindingWidth() ); } } if ( cloneOption == CloneOption::All || cloneOption == CloneOption::TieImagPart ) { y_.reset( rhs.y_->createClone(constFactor) ); yPrime_.reset( rhs.yPrime_->createClone(constFactor) ); } else { const auto yVal { getOptionalValue( coeffInfo, "Y", JsonType::Number ).value_or( rhs.y_->value() ) }; const auto yFixed { getOptionalValue( coeffInfo, "YFixed", JsonType::Boolean ).value_or( rhs.y_->fixed() ) }; y_ = std::make_unique("Y", yVal, minRealImagPart_, maxRealImagPart_, yFixed); if ( getOptionalValue( coeffInfo, "YBlind", JsonType::Boolean ).value_or( kFALSE ) ) { const auto blindingString { getValue( coeffInfo, "YBlindingString" ) }; const auto blindingWidth { getValue( coeffInfo, "YBlindingWidth" ) }; y_->blindParameter( blindingString, blindingWidth ); } else if ( rhs.y_->blind() ) { const LauBlind* blinder { rhs.y_->blinder() }; y_->blindParameter( blinder->blindingString(), blinder->blindingWidth() ); } const auto yPrimeVal { getOptionalValue( coeffInfo, "YPrime", JsonType::Number ).value_or( rhs.yPrime_->value() ) }; const auto yPrimeFixed { getOptionalValue( coeffInfo, "YPrimeFixed", JsonType::Boolean ).value_or( rhs.yPrime_->fixed() ) }; yPrime_ = std::make_unique("YPrime", yPrimeVal, minRealImagPart_, maxRealImagPart_, yPrimeFixed); if ( getOptionalValue( coeffInfo, "YPrimeBlind", JsonType::Boolean ).value_or( kFALSE ) ) { const auto blindingString { getValue( coeffInfo, "YPrimeBlindingString" ) }; const auto blindingWidth { getValue( coeffInfo, "YPrimeBlindingWidth" ) }; yPrime_->blindParameter( blindingString, blindingWidth ); } else if ( rhs.yPrime_->blind() ) { const LauBlind* blinder { rhs.yPrime_->blinder() }; yPrime_->blindParameter( blinder->blindingString(), blinder->blindingWidth() ); } } if ( cloneOption == CloneOption::All || cloneOption == CloneOption::TieCPPars ) { deltaX_.reset( rhs.deltaX_->createClone(constFactor) ); deltaY_.reset( rhs.deltaY_->createClone(constFactor) ); deltaXPrime_.reset( rhs.deltaXPrime_->createClone(constFactor) ); deltaYPrime_.reset( rhs.deltaYPrime_->createClone(constFactor) ); } else { const auto deltaXVal { getOptionalValue( coeffInfo, "DeltaX", JsonType::Number ).value_or( rhs.deltaX_->value() ) }; const auto deltaXFixed { getOptionalValue( coeffInfo, "DeltaXFixed", JsonType::Boolean ).value_or( rhs.deltaX_->fixed() ) }; const auto deltaXSecondStage { getOptionalValue( coeffInfo, "DeltaXSecondStage", JsonType::Boolean ).value_or( rhs.deltaX_->secondStage() ) }; const auto deltaYVal { getOptionalValue( coeffInfo, "DeltaY", JsonType::Number ).value_or( rhs.deltaY_->value() ) }; const auto deltaYFixed { getOptionalValue( coeffInfo, "DeltaYFixed", JsonType::Boolean ).value_or( rhs.deltaY_->fixed() ) }; const auto deltaYSecondStage { getOptionalValue( coeffInfo, "DeltaYSecondStage", JsonType::Boolean ).value_or( rhs.deltaY_->secondStage() ) }; deltaX_ = std::make_unique("DeltaX", deltaXVal, minDelta_, maxDelta_, deltaXFixed); deltaY_ = std::make_unique("DeltaY", deltaYVal, minDelta_, maxDelta_, deltaYFixed); if ( getOptionalValue( coeffInfo, "DeltaXBlind", JsonType::Boolean ).value_or( kFALSE ) ) { const auto blindingString { getValue( coeffInfo, "DeltaXBlindingString" ) }; const auto blindingWidth { getValue( coeffInfo, "DeltaXBlindingWidth" ) }; deltaX_->blindParameter( blindingString, blindingWidth ); } else if ( rhs.deltaX_->blind() ) { const LauBlind* blinder { rhs.deltaX_->blinder() }; deltaX_->blindParameter( blinder->blindingString(), blinder->blindingWidth() ); } if ( getOptionalValue( coeffInfo, "DeltaYBlind", JsonType::Boolean ).value_or( kFALSE ) ) { const auto blindingString { getValue( coeffInfo, "DeltaYBlindingString" ) }; const auto blindingWidth { getValue( coeffInfo, "DeltaYBlindingWidth" ) }; deltaY_->blindParameter( blindingString, blindingWidth ); } else if ( rhs.deltaY_->blind() ) { const LauBlind* blinder { rhs.deltaY_->blinder() }; deltaY_->blindParameter( blinder->blindingString(), blinder->blindingWidth() ); } const auto deltaXPrimeVal { getOptionalValue( coeffInfo, "DeltaXPrime", JsonType::Number ).value_or( rhs.deltaXPrime_->value() ) }; const auto deltaXPrimeFixed { getOptionalValue( coeffInfo, "DeltaXPrimeFixed", JsonType::Boolean ).value_or( rhs.deltaXPrime_->fixed() ) }; const auto deltaXPrimeSecondStage { getOptionalValue( coeffInfo, "DeltaXPrimeSecondStage", JsonType::Boolean ).value_or( rhs.deltaXPrime_->secondStage() ) }; const auto deltaYPrimeVal { getOptionalValue( coeffInfo, "DeltaYPrime", JsonType::Number ).value_or( rhs.deltaYPrime_->value() ) }; const auto deltaYPrimeFixed { getOptionalValue( coeffInfo, "DeltaYPrimeFixed", JsonType::Boolean ).value_or( rhs.deltaYPrime_->fixed() ) }; const auto deltaYPrimeSecondStage { getOptionalValue( coeffInfo, "DeltaYPrimeSecondStage", JsonType::Boolean ).value_or( rhs.deltaYPrime_->secondStage() ) }; deltaXPrime_ = std::make_unique("DeltaXPrime", deltaXPrimeVal, minDelta_, maxDelta_, deltaXPrimeFixed); deltaYPrime_ = std::make_unique("DeltaYPrime", deltaYPrimeVal, minDelta_, maxDelta_, deltaYPrimeFixed); if ( getOptionalValue( coeffInfo, "DeltaXPrimeBlind", JsonType::Boolean ).value_or( kFALSE ) ) { const auto blindingString { getValue( coeffInfo, "DeltaXPrimeBlindingString" ) }; const auto blindingWidth { getValue( coeffInfo, "DeltaXPrimeBlindingWidth" ) }; deltaXPrime_->blindParameter( blindingString, blindingWidth ); } else if ( rhs.deltaXPrime_->blind() ) { const LauBlind* blinder { rhs.deltaXPrime_->blinder() }; deltaXPrime_->blindParameter( blinder->blindingString(), blinder->blindingWidth() ); } if ( getOptionalValue( coeffInfo, "DeltaYPrimeBlind", JsonType::Boolean ).value_or( kFALSE ) ) { const auto blindingString { getValue( coeffInfo, "DeltaYPrimeBlindingString" ) }; const auto blindingWidth { getValue( coeffInfo, "DeltaYPrimeBlindingWidth" ) }; deltaYPrime_->blindParameter( blindingString, blindingWidth ); } else if ( rhs.deltaYPrime_->blind() ) { const LauBlind* blinder { rhs.deltaYPrime_->blinder() }; deltaYPrime_->blindParameter( blinder->blindingString(), blinder->blindingWidth() ); } if ( deltaXSecondStage && !deltaXFixed ) { deltaX_->secondStage(kTRUE); deltaX_->initValue(0.0); } if ( deltaYSecondStage && !deltaYFixed ) { deltaY_->secondStage(kTRUE); deltaY_->initValue(0.0); } if ( deltaXPrimeSecondStage && !deltaXPrimeFixed ) { deltaXPrime_->secondStage(kTRUE); deltaXPrime_->initValue(0.0); } if ( deltaYPrimeSecondStage && !deltaYPrimeFixed ) { deltaYPrime_->secondStage(kTRUE); deltaYPrime_->initValue(0.0); } } } void LauNSCCartesianCPCoeffSet::printParValues() const { std::cout<<"INFO in LauNSCCartesianCPCoeffSet::printParValues : Component \""<name()<<"\" has "; std::cout<<"X = "<value()<<",\t"; std::cout<<"Y = "<value()<<",\t"; std::cout<<"Delta x = "<value()<<",\t"; std::cout<<"Delta y = "<value()<<",\t"; std::cout<<"XPrime = "<value()<<",\t"; std::cout<<"YPrime = "<value()<<",\t"; std::cout<<"Delta xPrime = "<value()<<",\t"; std::cout<<"Delta yPrime = "<value()<<"."<name() }; resName = resName.ReplaceAll("_", "\\_"); stream<value()); stream<<" \\pm "; print.printFormat(stream, x_->error()); stream<<"$ & $"; print.printFormat(stream, y_->value()); stream<<" \\pm "; print.printFormat(stream, y_->error()); stream<<"$ & $"; print.printFormat(stream, deltaX_->value()); stream<<" \\pm "; print.printFormat(stream, deltaX_->error()); stream<<"$ & $"; print.printFormat(stream, deltaY_->value()); stream<<" \\pm "; print.printFormat(stream, deltaY_->error()); stream<<"$ & $"; print.printFormat(stream, xPrime_->value()); stream<<" \\pm "; print.printFormat(stream, xPrime_->error()); stream<<"$ & $"; print.printFormat(stream, yPrime_->value()); stream<<" \\pm "; print.printFormat(stream, yPrime_->error()); stream<<"$ & $"; print.printFormat(stream, deltaXPrime_->value()); stream<<" \\pm "; print.printFormat(stream, deltaXPrime_->error()); stream<<"$ & $"; print.printFormat(stream, deltaYPrime_->value()); stream<<" \\pm "; print.printFormat(stream, deltaYPrime_->error()); stream<<"$ \\\\"<fixed() == kFALSE) { // Choose a value for "X" between -3.0 and 3.0 const Double_t value { LauRandom::zeroSeedRandom()->Rndm()*6.0 - 3.0 }; x_->initValue(value); x_->value(value); } if (y_->fixed() == kFALSE) { // Choose a value for "Y" between -3.0 and 3.0 const Double_t value { LauRandom::zeroSeedRandom()->Rndm()*6.0 - 3.0 }; y_->initValue(value); y_->value(value); } if (deltaX_->fixed() == kFALSE && deltaX_->secondStage() == kFALSE) { // Choose a value for "Delta X" between -0.5 and 0.5 const Double_t value { LauRandom::zeroSeedRandom()->Rndm()*1.0 - 0.5 }; deltaX_->initValue(value); deltaX_->value(value); } if (deltaY_->fixed() == kFALSE && deltaY_->secondStage() == kFALSE) { // Choose a value for "Delta Y" between -0.5 and 0.5 const Double_t value { LauRandom::zeroSeedRandom()->Rndm()*1.0 - 0.5 }; deltaY_->initValue(value); deltaY_->value(value); } if (xPrime_->fixed() == kFALSE) { // Choose a value for "XPrime" between -3.0 and 3.0 const Double_t value { LauRandom::zeroSeedRandom()->Rndm()*6.0 - 3.0 }; xPrime_->initValue(value); xPrime_->value(value); } if (yPrime_->fixed() == kFALSE) { // Choose a value for "YPrime" between -3.0 and 3.0 const Double_t value { LauRandom::zeroSeedRandom()->Rndm()*6.0 - 3.0 }; yPrime_->initValue(value); yPrime_->value(value); } if (deltaXPrime_->fixed() == kFALSE && deltaXPrime_->secondStage() == kFALSE) { // Choose a value for "Delta XPrime" between -0.5 and 0.5 const Double_t value { LauRandom::zeroSeedRandom()->Rndm()*1.0 - 0.5 }; deltaXPrime_->initValue(value); deltaXPrime_->value(value); } if (deltaYPrime_->fixed() == kFALSE && deltaYPrime_->secondStage() == kFALSE) { // Choose a value for "Delta YPrime" between -0.5 and 0.5 const Double_t value { LauRandom::zeroSeedRandom()->Rndm()*1.0 - 0.5 }; deltaYPrime_->initValue(value); deltaYPrime_->value(value); } } void LauNSCCartesianCPCoeffSet::finaliseValues() { // update the pulls x_->updatePull(); y_->updatePull(); deltaX_->updatePull(); deltaY_->updatePull(); xPrime_->updatePull(); yPrime_->updatePull(); deltaXPrime_->updatePull(); deltaYPrime_->updatePull(); } const LauComplex& LauNSCCartesianCPCoeffSet::particleCoeff() { if ( finalStateIsF_ ) { coeffAf_.setRealImagPart( x_->value() + deltaX_->value(), y_->value() + deltaY_->value() ); return coeffAf_; } else { coeffAfbar_.setRealImagPart( xPrime_->value() + deltaXPrime_->value(), yPrime_->value() + deltaYPrime_->value() ); return coeffAfbar_; } } const LauComplex& LauNSCCartesianCPCoeffSet::antiparticleCoeff() { if ( finalStateIsF_ ) { coeffAbarf_.setRealImagPart( xPrime_->value() - deltaXPrime_->value(), yPrime_->value() - deltaYPrime_->value() ); return coeffAbarf_; } else { coeffAbarfbar_.setRealImagPart( x_->value() - deltaX_->value(), y_->value() - deltaY_->value() ); return coeffAbarfbar_; } } void LauNSCCartesianCPCoeffSet::setCoeffValues( const LauComplex&, const LauComplex&, Bool_t ) { std::cerr << "ERROR in LauNSCCartesianCPCoeffSet::setCoeffValues : Method not supported by this class - too many parameters" << std::endl; } LauParameter LauNSCCartesianCPCoeffSet::acp() { // set the name const TString parName{ this->baseName() + "_ACP" }; acp_.name(parName); // a single ACP parameter doesn't really make much sense here const Double_t value{0.0}; const Double_t error{0.0}; // set the value and error acp_.valueAndErrors(value,error); return acp_; } LauNSCCartesianCPCoeffSet* LauNSCCartesianCPCoeffSet::createClone_impl(const TString& newName, const CloneOption cloneOption, const Double_t constFactor, const nlohmann::json& coeffInfo) const { if ( ! ( cloneOption == CloneOption::All || cloneOption == CloneOption::TieRealPart || cloneOption == CloneOption::TieImagPart || cloneOption == CloneOption::TieCPPars ) ) { std::cerr << "ERROR in LauNSCCartesianCPCoeffSet::createClone : Invalid clone option" << std::endl; return nullptr; } if ( this->clone() ) { const LauNSCCartesianCPCoeffSet* parent { static_cast(this->parent()) }; return parent->createClone_impl( newName, cloneOption, constFactor, coeffInfo ); } auto clone = new LauNSCCartesianCPCoeffSet{ *this, cloneOption, constFactor, coeffInfo }; clone->name( newName ); return clone; } void LauNSCCartesianCPCoeffSet::serialiseToJson( nlohmann::json& j ) const { // Call the base class method to do most of the work LauAbsCoeffSet::serialiseToJson(j); j["finalStateIsF"] = this->finalStateIsF(); } //! \cond DOXYGEN_IGNORE LauNSCCartesianCPCoeffSet nlohmann::adl_serializer::from_json(const json& j) { using LauJsonTools::JsonType; using LauJsonTools::getValue; using LauJsonTools::getOptionalValue; const auto type { getValue( j, "type" ) }; if ( type != LauCoeffType::NSCCartesianCP ) { throw LauWrongCoeffType("Wrong coefficient type given to construct LauNSCCartesianCPCoeffSet"); } const auto clone { getValue( j, "clone" ) }; if ( clone ) { throw LauClonedCoeff{"Cannot build a cloned LauNSCCartesianCPCoeffSet standalone"}; } const std::vector mandatoryElements { std::make_pair("X", JsonType::Number), std::make_pair("Y", JsonType::Number), std::make_pair("DeltaX", JsonType::Number), std::make_pair("DeltaY", JsonType::Number), std::make_pair("XFixed", JsonType::Boolean), std::make_pair("YFixed", JsonType::Boolean), std::make_pair("DeltaXFixed", JsonType::Boolean), std::make_pair("DeltaYFixed", JsonType::Boolean), std::make_pair("XPrime", JsonType::Number), std::make_pair("YPrime", JsonType::Number), std::make_pair("DeltaXPrime", JsonType::Number), std::make_pair("DeltaYPrime", JsonType::Number), std::make_pair("XPrimeFixed", JsonType::Boolean), std::make_pair("YPrimeFixed", JsonType::Boolean), std::make_pair("DeltaXPrimeFixed", JsonType::Boolean), std::make_pair("DeltaYPrimeFixed", JsonType::Boolean), }; if ( ! LauJsonTools::checkObjectElements( j, mandatoryElements ) ) { throw LauJsonTools::MissingJsonElement{"Missing elements needed to construct LauNSCCartesianCPCoeffSet"}; } const auto name { getValue( j, "name" ) }; const auto finalStateIsF { getValue( j, "finalStateIsF" ) }; const auto x { getValue( j, "X" ) }; const auto y { getValue( j, "Y" ) }; const auto deltaX { getValue( j, "DeltaX" ) }; const auto deltaY { getValue( j, "DeltaY" ) }; const auto xFixed { getValue( j, "XFixed" ) }; const auto yFixed { getValue( j, "YFixed" ) }; const auto deltaXFixed { getValue( j, "DeltaXFixed" ) }; const auto deltaYFixed { getValue( j, "DeltaYFixed" ) }; - const auto deltaXSecondStage { getOptionalValue( j, "DeltaXSecondStage", JsonType::Number ).value_or( kFALSE ) }; - const auto deltaYSecondStage { getOptionalValue( j, "DeltaYSecondStage", JsonType::Number ).value_or( kFALSE ) }; + const auto deltaXSecondStage { getOptionalValue( j, "DeltaXSecondStage", JsonType::Boolean ).value_or( kFALSE ) }; + const auto deltaYSecondStage { getOptionalValue( j, "DeltaYSecondStage", JsonType::Boolean ).value_or( kFALSE ) }; const auto xPrime { getValue( j, "XPrime" ) }; const auto yPrime { getValue( j, "YPrime" ) }; const auto deltaXPrime { getValue( j, "DeltaXPrime" ) }; const auto deltaYPrime { getValue( j, "DeltaYPrime" ) }; const auto xPrimeFixed { getValue( j, "XPrimeFixed" ) }; const auto yPrimeFixed { getValue( j, "YPrimeFixed" ) }; const auto deltaXPrimeFixed { getValue( j, "DeltaXPrimeFixed" ) }; const auto deltaYPrimeFixed { getValue( j, "DeltaYPrimeFixed" ) }; - const auto deltaXPrimeSecondStage { getOptionalValue( j, "DeltaXPrimeSecondStage", JsonType::Number ).value_or( kFALSE ) }; - const auto deltaYPrimeSecondStage { getOptionalValue( j, "DeltaYPrimeSecondStage", JsonType::Number ).value_or( kFALSE ) }; + const auto deltaXPrimeSecondStage { getOptionalValue( j, "DeltaXPrimeSecondStage", JsonType::Boolean ).value_or( kFALSE ) }; + const auto deltaYPrimeSecondStage { getOptionalValue( j, "DeltaYPrimeSecondStage", JsonType::Boolean ).value_or( kFALSE ) }; LauNSCCartesianCPCoeffSet coeff{ name, finalStateIsF, x, y, deltaX, deltaY, xFixed, yFixed, deltaXFixed, deltaYFixed, deltaXSecondStage, deltaYSecondStage, xPrime, yPrime, deltaXPrime, deltaYPrime, xPrimeFixed, yPrimeFixed, deltaXPrimeFixed, deltaYPrimeFixed, deltaXPrimeSecondStage, deltaYPrimeSecondStage }; coeff.applyBlinding( j ); return coeff; } //! \endcond DOXYGEN_IGNORE