Changeset View
Changeset View
Standalone View
Standalone View
src/EvtGenBase/EvtMultiChannelParser.cpp
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | void EvtMultiChannelParser::parse( const char* file, const char* model ) | ||||
} | } | ||||
parse( v ); | parse( v ); | ||||
} | } | ||||
void EvtMultiChannelParser::parse( const std::vector<std::string>& v ) | void EvtMultiChannelParser::parse( const std::vector<std::string>& v ) | ||||
{ | { | ||||
// place holder for strtod | // place holder for strtod | ||||
char** tc = 0; | char** tc = nullptr; | ||||
// Get PDF maximum or number of points to | // Get PDF maximum or number of points to | ||||
// use in the scan. | // use in the scan. | ||||
if ( v[0] == std::string( "MAXPDF" ) ) { | if ( v[0] == std::string( "MAXPDF" ) ) { | ||||
_pdfMax = strtod( v[1].c_str(), tc ); | _pdfMax = strtod( v[1].c_str(), tc ); | ||||
if ( _pdfMax <= 0 ) { | if ( _pdfMax <= 0 ) { | ||||
printf( "Bad pdfMax=%f\n", _pdfMax ); | printf( "Bad pdfMax=%f\n", _pdfMax ); | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | void EvtMultiChannelParser::parse( const std::vector<std::string>& v ) | ||||
printf( "%d conj amplitude terms\n", (int)_ampConj.size() ); | printf( "%d conj amplitude terms\n", (int)_ampConj.size() ); | ||||
} | } | ||||
void EvtMultiChannelParser::parseComplexCoef( size_t& i, | void EvtMultiChannelParser::parseComplexCoef( size_t& i, | ||||
const std::vector<std::string>& v, | const std::vector<std::string>& v, | ||||
EvtComplex& c, int& format ) | EvtComplex& c, int& format ) | ||||
{ | { | ||||
// place holder for strtod | // place holder for strtod | ||||
char** tc = 0; | char** tc = nullptr; | ||||
std::string coefString = v[i++]; | std::string coefString = v[i++]; | ||||
assert( coefString == std::string( "COEFFICIENT" ) ); | assert( coefString == std::string( "COEFFICIENT" ) ); | ||||
if ( v[i] == std::string( "POLAR_DEG" ) ) { | if ( v[i] == std::string( "POLAR_DEG" ) ) { | ||||
double mag = strtod( v[i + 1].c_str(), tc ); | double mag = strtod( v[i + 1].c_str(), tc ); | ||||
double phaseRad = strtod( v[i + 2].c_str(), tc ) * EvtConst::pi / 180.0; | double phaseRad = strtod( v[i + 2].c_str(), tc ) * EvtConst::pi / 180.0; | ||||
i += 3; | i += 3; | ||||
Show All 16 Lines | if ( v[i] == std::string( "POLAR_DEG" ) ) { | ||||
exit( 0 ); | exit( 0 ); | ||||
} | } | ||||
} | } | ||||
double EvtMultiChannelParser::parseRealCoef( int& i, | double EvtMultiChannelParser::parseRealCoef( int& i, | ||||
const std::vector<std::string>& v ) | const std::vector<std::string>& v ) | ||||
{ | { | ||||
// place holder for strtod | // place holder for strtod | ||||
char** tc = 0; | char** tc = nullptr; | ||||
double value = 0; | double value = 0; | ||||
if ( v[i] == std::string( "COEFFICIENT" ) ) { | if ( v[i] == std::string( "COEFFICIENT" ) ) { | ||||
value = strtod( v[i + 1].c_str(), tc ); | value = strtod( v[i + 1].c_str(), tc ); | ||||
} else | } else | ||||
assert( 0 ); | assert( 0 ); | ||||
i += 2; | i += 2; | ||||
Show All 15 Lines |