23 namespace InlineHadSpecEnv
57 XMLReader paramtop(xml, path);
60 read(paramtop,
"version", version);
68 QDPIO::cerr <<
"Input parameter version " << version <<
" unsupported." << std::endl;
88 write(xml,
"version", version);
106 XMLReader inputtop(xml, path);
127 XMLReader inputtop(xml, path);
155 XMLReader paramtop(xml_in, path);
157 if (paramtop.count(
"Frequency") == 1)
169 if (paramtop.count(
"xml_file") != 0)
176 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
200 struct SinkPropContainer_t
216 struct AllSinkProps_t
224 void readSinkProp(SinkPropContainer_t&
s,
const std::string&
id)
229 const LatticePropagator& foo =
233 s.quark_propagator_id = id;
236 XMLReader prop_file_xml, prop_record_xml;
244 read(prop_record_xml,
"/SinkSmear",
s.prop_header);
246 read(prop_record_xml,
"/SinkSmear/PropSource/Source/SourceType",
s.source_type);
247 xpath =
"/SinkSmear/PropSource/Source/Displacement/DisplacementType";
248 if (prop_record_xml.count(xpath) != 0)
249 read(prop_record_xml, xpath,
s.source_disp_type);
253 read(prop_record_xml,
"/SinkSmear/PropSink/Sink/SinkType",
s.sink_type);
254 xpath =
"/SinkSmear/PropSink/Sink/Displacement/DisplacementType";
255 if (prop_record_xml.count(xpath) != 0)
256 read(prop_record_xml, xpath,
s.sink_disp_type);
261 catch( std::bad_cast )
279 QDPIO::cout <<
"Try action and mass" << std::endl;
280 s.Mass =
getMass(
s.prop_header.prop_header.fermact);
296 <<
": caught exception. No BC found in these headers. Will assume dirichlet: " << e
300 QDPIO::cout <<
"FermAct = " <<
s.prop_header.prop_header.fermact.id << std::endl;
301 QDPIO::cout <<
"Mass = " <<
s.Mass << std::endl;
306 void readAllSinks(AllSinkProps_t&
s,
307 InlineHadSpecParams::NamedObject_t::Props_t sink_pair)
309 QDPIO::cout <<
"Attempt to parse forward propagator = " << sink_pair.first_id << std::endl;
310 readSinkProp(
s.sink_prop_1, sink_pair.first_id);
311 QDPIO::cout <<
"Forward propagator successfully parsed" << std::endl;
313 QDPIO::cout <<
"Attempt to parse forward propagator = " << sink_pair.second_id << std::endl;
314 readSinkProp(
s.sink_prop_2, sink_pair.second_id);
315 QDPIO::cout <<
"Forward propagator successfully parsed" << std::endl;
332 push(xml_out,
"hadspec");
333 write(xml_out,
"update_no", update_no);
334 write(xml_out,
"xml_file", xml_file);
337 XMLFileWriter xml(xml_file);
338 func(update_no, xml);
342 func(update_no, xml_out);
359 XMLBufferWriter gauge_xml;
365 catch( std::bad_cast )
377 const multi1d<LatticeColorMatrix>&
u =
380 push(xml_out,
"hadspec");
381 write(xml_out,
"update_no", update_no);
383 QDPIO::cout <<
" HADSPEC: Spectroscopy for Wilson-like fermions" << std::endl;
384 QDPIO::cout << std::endl <<
" Gauge group: SU(" << Nc <<
")" << std::endl;
385 QDPIO::cout <<
" volume: " << Layout::lattSize()[0];
386 for (
int i=1;
i<
Nd; ++
i) {
387 QDPIO::cout <<
" x " << Layout::lattSize()[
i];
389 QDPIO::cout << std::endl;
397 write(xml_out,
"Config_info", gauge_xml);
399 push(xml_out,
"Output_version");
400 write(xml_out,
"out_version", 15);
405 MesPlq(xml_out,
"Observables",
u);
408 push(xml_out,
"Wilson_hadron_measurements");
415 push(xml_out,
"elem");
417 AllSinkProps_t all_sinks;
418 readAllSinks(all_sinks, named_obj);
422 = all_sinks.sink_prop_1.prop_header.source_header.getTSrce();
423 int j_decay = all_sinks.sink_prop_1.prop_header.source_header.j_decay;
424 int t0 = all_sinks.sink_prop_1.prop_header.source_header.t_source;
428 if (all_sinks.sink_prop_2.prop_header.source_header.j_decay !=
j_decay)
430 QDPIO::cerr <<
"Error!! j_decay must be the same for all propagators " << std::endl;
433 if (all_sinks.sink_prop_2.prop_header.source_header.t_source !=
434 all_sinks.sink_prop_1.prop_header.source_header.t_source)
436 QDPIO::cerr <<
"Error!! t_source must be the same for all propagators " << std::endl;
439 if (all_sinks.sink_prop_1.source_type != all_sinks.sink_prop_2.source_type)
441 QDPIO::cerr <<
"Error!! source_type must be the same in a pair " << std::endl;
444 if (all_sinks.sink_prop_1.sink_type != all_sinks.sink_prop_2.sink_type)
446 QDPIO::cerr <<
"Error!! source_type must be the same in a pair " << std::endl;
458 QDPIO::cerr <<
"Error!! bc must be the same for all propagators " << std::endl;
472 write(xml_out,
"Mass_1", all_sinks.sink_prop_1.Mass);
473 write(xml_out,
"Mass_2", all_sinks.sink_prop_2.Mass);
477 push(xml_out,
"Forward_prop_headers");
478 write(xml_out,
"First_forward_prop", all_sinks.sink_prop_1.prop_header);
479 write(xml_out,
"Second_forward_prop", all_sinks.sink_prop_2.prop_header);
484 push(xml_out,
"Forward_prop_correlator");
497 push(xml_out,
"SourceSinkType");
499 QDPIO::cout <<
"Source_type_1 = " << all_sinks.sink_prop_1.source_type << std::endl;
500 QDPIO::cout <<
"Sink_type_1 = " << all_sinks.sink_prop_1.sink_type << std::endl;
501 QDPIO::cout <<
"Source_type_2 = " << all_sinks.sink_prop_2.source_type << std::endl;
502 QDPIO::cout <<
"Sink_type_2 = " << all_sinks.sink_prop_2.sink_type << std::endl;
504 write(xml_out,
"source_type_1", all_sinks.sink_prop_1.source_type);
505 write(xml_out,
"source_disp_type_1", all_sinks.sink_prop_1.source_disp_type);
506 write(xml_out,
"sink_type_1", all_sinks.sink_prop_1.sink_type);
507 write(xml_out,
"sink_disp_type_1", all_sinks.sink_prop_1.sink_disp_type);
509 write(xml_out,
"source_type_2", all_sinks.sink_prop_2.source_type);
510 write(xml_out,
"source_disp_type_2", all_sinks.sink_prop_2.source_disp_type);
511 write(xml_out,
"sink_type_2", all_sinks.sink_prop_2.sink_type);
512 write(xml_out,
"sink_disp_type_2", all_sinks.sink_prop_2.sink_disp_type);
526 if (all_sinks.sink_prop_1.source_type ==
"POINT_SOURCE")
528 else if (all_sinks.sink_prop_1.source_type ==
"SF_POINT_SOURCE")
530 else if (all_sinks.sink_prop_1.source_type ==
"SHELL_SOURCE")
532 else if (all_sinks.sink_prop_1.source_type ==
"NORM_SHELL_SOURCE")
534 else if (all_sinks.sink_prop_1.source_type ==
"SF_SHELL_SOURCE")
536 else if (all_sinks.sink_prop_1.source_type ==
"WALL_SOURCE")
538 else if (all_sinks.sink_prop_1.source_type ==
"SF_WALL_SOURCE")
540 else if (all_sinks.sink_prop_1.source_type ==
"RAND_ZN_WALL_SOURCE")
544 QDPIO::cerr <<
"Unsupported source type = " << all_sinks.sink_prop_1.source_type << std::endl;
549 if (all_sinks.sink_prop_1.sink_type ==
"POINT_SINK")
551 else if (all_sinks.sink_prop_1.sink_type ==
"SHELL_SINK")
553 else if (all_sinks.sink_prop_1.sink_type ==
"NORM_SHELL_SINK")
555 else if (all_sinks.sink_prop_1.sink_type ==
"WALL_SINK")
559 QDPIO::cerr <<
"Unsupported sink type = " << all_sinks.sink_prop_1.sink_type << std::endl;
563 std::string source_sink_type = src_type +
"_" + snk_type;
564 QDPIO::cout <<
"Source type = " << src_type << std::endl;
565 QDPIO::cout <<
"Sink type = " << snk_type << std::endl;
571 xml_out, source_sink_type +
"_Wilson_Mesons");
579 if (snk_type ==
"Point")
583 xml_out, src_type +
"_Point_Meson_Currents");
593 xml_out, source_sink_type +
"_Wilson_Baryons");
603 << snoop.getTimeInSeconds()
604 <<
" secs" << std::endl;
Inline measurement factory.
Heavy-light baryon 2-pt functions.
Inline measurement of hadron spectrum.
InlineHadSpecParams params
void operator()(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
void func(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
Fourier transform phase factor support.
const Set & getSet() const
The set to be used in sumMulti.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams ¶m)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams ¶m)
Writer parameters.
void curcor2(const multi1d< LatticeColorMatrix > &u, const LatticePropagator &quark_prop_1, const LatticePropagator &quark_prop_2, const SftMom &phases, int t0, int no_vec_cur, XMLWriter &xml, const std::string &xml_group)
Construct current correlators.
void barhqlq(const LatticePropagator &propagator_1, const LatticePropagator &propagator_2, const SftMom &phases, int t0, int bc_spec, bool time_rev, XMLWriter &xml, const std::string &xml_group)
Heavy-light baryon 2-pt functions.
void proginfo(XMLWriter &xml)
Print out basic information about this program.
std::string makeXMLFileName(std::string xml_file, unsigned long update_no)
Return a xml file name for inline measurements.
std::string source_disp_type
std::string quark_propagator_id
SinkPropContainer_t sink_prop_2
SinkPropContainer_t sink_prop_1
ForwardProp_t prop_header
std::string sink_disp_type
Inline hadron spectrum calculations.
Named object function std::map.
static bool registered
Local registration flag.
bool registerAll()
Register all the factories.
std::string getName()
Return the name.
Asqtad Staggered-Dirac operator.
Real getMass(const GroupXML_t &fermact)
Given a fermion action in std::string form, return the Mass.
static multi1d< LatticeColorMatrix > u
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > & Mass
push(xml_out,"Condensates")
multi1d< int > getFermActBoundary(const GroupXML_t &fermact)
Given a fermion action in std::string form, return the boundary.
void mesons2(const LatticePropagator &quark_prop_1, const LatticePropagator &quark_prop_2, const SftMom &phases, int t0, XMLWriter &xml, const std::string &xml_group)
Meson 2-pt functions.
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
void write(XMLWriter &xml, const std::string &path, const InlineHadSpecParams::NamedObject_t &input)
Propagator output.
multi1d< LatticeFermion > s(Ncb)
Various parameter structs and reader/writers.
Print out basic info about this program.
Routines associated with Chroma propagator IO.
Fourier transform phase factor support.
multi1d< Props_t > sink_pairs
void write(XMLWriter &xml_out, const std::string &path)
struct Chroma::InlineHadSpecParams::Param_t param
struct Chroma::InlineHadSpecParams::NamedObject_t named_obj