20 namespace InlineHeavyHadSpecEnv
54 XMLReader paramtop(xml, path);
57 read(paramtop,
"version", version);
65 QDPIO::cerr <<
"Input parameter version " << version <<
" unsupported." << std::endl;
82 write(xml,
"version", version);
96 XMLReader inputtop(xml, path);
117 XMLReader inputtop(xml, path);
145 XMLReader paramtop(xml_in, path);
147 if (paramtop.count(
"Frequency") == 1)
159 if (paramtop.count(
"xml_file") != 0)
166 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
190 struct SinkPropContainer_t
206 struct AllSinkProps_t
214 void readSinkProp(SinkPropContainer_t&
s,
const std::string&
id)
219 const LatticePropagator& foo =
223 s.quark_propagator_id = id;
226 XMLReader prop_file_xml, prop_record_xml;
234 read(prop_record_xml,
"/SinkSmear",
s.prop_header);
236 read(prop_record_xml,
"/SinkSmear/PropSource/Source/SourceType",
s.source_type);
237 xpath =
"/SinkSmear/PropSource/Source/Displacement/DisplacementType";
238 if (prop_record_xml.count(xpath) != 0)
239 read(prop_record_xml, xpath,
s.source_disp_type);
243 read(prop_record_xml,
"/SinkSmear/PropSink/Sink/SinkType",
s.sink_type);
244 xpath =
"/SinkSmear/PropSink/Sink/Displacement/DisplacementType";
245 if (prop_record_xml.count(xpath) != 0)
246 read(prop_record_xml, xpath,
s.sink_disp_type);
251 catch( std::bad_cast )
269 QDPIO::cout <<
"Try action and mass" << std::endl;
270 s.Mass =
getMass(
s.prop_header.prop_header.fermact);
286 <<
": caught exception. No BC found in these headers. Will assume dirichlet: " << e
290 QDPIO::cout <<
"FermAct = " <<
s.prop_header.prop_header.fermact.id << std::endl;
291 QDPIO::cout <<
"Mass = " <<
s.Mass << std::endl;
296 void readAllSinks(AllSinkProps_t&
s,
297 InlineHeavyHadSpecParams::NamedObject_t::Props_t sink_pair)
299 QDPIO::cout <<
"Attempt to parse forward propagator = " << sink_pair.first_id << std::endl;
300 readSinkProp(
s.sink_prop_1, sink_pair.first_id);
301 QDPIO::cout <<
"Forward propagator successfully parsed" << std::endl;
303 QDPIO::cout <<
"Attempt to parse forward propagator = " << sink_pair.second_id << std::endl;
304 readSinkProp(
s.sink_prop_2, sink_pair.second_id);
305 QDPIO::cout <<
"Forward propagator successfully parsed" << std::endl;
322 push(xml_out,
"heavyhadspec");
323 write(xml_out,
"update_no", update_no);
324 write(xml_out,
"xml_file", xml_file);
327 XMLFileWriter xml(xml_file);
328 func(update_no, xml);
332 func(update_no, xml_out);
349 XMLBufferWriter gauge_xml;
355 catch( std::bad_cast )
367 const multi1d<LatticeColorMatrix>&
u =
370 push(xml_out,
"heavyhadspec");
371 write(xml_out,
"update_no", update_no);
373 QDPIO::cout <<
" HEAVYHADSPEC: SU(3) heavy hadron spectroscopy for Wilson-like fermions" << std::endl;
374 QDPIO::cout << std::endl <<
" Gauge group: SU(" << Nc <<
")" << std::endl;
375 QDPIO::cout <<
" volume: " << Layout::lattSize()[0];
376 for (
int i=1;
i<
Nd; ++
i) {
377 QDPIO::cout <<
" x " << Layout::lattSize()[
i];
379 QDPIO::cout << std::endl;
387 write(xml_out,
"Config_info", gauge_xml);
389 push(xml_out,
"Output_version");
390 write(xml_out,
"out_version", 15);
395 MesPlq(xml_out,
"Observables",
u);
398 push(xml_out,
"Wilson_hadron_measurements");
405 push(xml_out,
"elem");
407 AllSinkProps_t all_sinks;
408 readAllSinks(all_sinks, named_obj);
412 = all_sinks.sink_prop_1.prop_header.source_header.getTSrce();
413 int j_decay = all_sinks.sink_prop_1.prop_header.source_header.j_decay;
414 int t0 = all_sinks.sink_prop_1.prop_header.source_header.t_source;
418 if (all_sinks.sink_prop_2.prop_header.source_header.j_decay !=
j_decay)
420 QDPIO::cerr <<
"Error!! j_decay must be the same for all propagators " << std::endl;
423 if (all_sinks.sink_prop_2.prop_header.source_header.t_source !=
424 all_sinks.sink_prop_1.prop_header.source_header.t_source)
426 QDPIO::cerr <<
"Error!! t_source must be the same for all propagators " << std::endl;
429 if (all_sinks.sink_prop_1.source_type != all_sinks.sink_prop_2.source_type)
431 QDPIO::cerr <<
"Error!! source_type must be the same in a pair " << std::endl;
434 if (all_sinks.sink_prop_1.sink_type != all_sinks.sink_prop_2.sink_type)
436 QDPIO::cerr <<
"Error!! source_type must be the same in a pair " << std::endl;
446 QDPIO::cerr <<
"Error!! bc must be the same for all propagators " << std::endl;
460 write(xml_out,
"Mass_1", all_sinks.sink_prop_1.Mass);
461 write(xml_out,
"Mass_2", all_sinks.sink_prop_2.Mass);
465 push(xml_out,
"Forward_prop_headers");
466 write(xml_out,
"First_forward_prop", all_sinks.sink_prop_1.prop_header);
467 write(xml_out,
"Second_forward_prop", all_sinks.sink_prop_2.prop_header);
472 push(xml_out,
"Forward_prop_correlator");
485 push(xml_out,
"SourceSinkType");
487 QDPIO::cout <<
"Source_type_1 = " << all_sinks.sink_prop_1.source_type << std::endl;
488 QDPIO::cout <<
"Sink_type_1 = " << all_sinks.sink_prop_1.sink_type << std::endl;
489 QDPIO::cout <<
"Source_type_2 = " << all_sinks.sink_prop_2.source_type << std::endl;
490 QDPIO::cout <<
"Sink_type_2 = " << all_sinks.sink_prop_2.sink_type << std::endl;
492 write(xml_out,
"source_type_1", all_sinks.sink_prop_1.source_type);
493 write(xml_out,
"source_disp_type_1", all_sinks.sink_prop_1.source_disp_type);
494 write(xml_out,
"sink_type_1", all_sinks.sink_prop_1.sink_type);
495 write(xml_out,
"sink_disp_type_1", all_sinks.sink_prop_1.sink_disp_type);
497 write(xml_out,
"source_type_2", all_sinks.sink_prop_2.source_type);
498 write(xml_out,
"source_disp_type_2", all_sinks.sink_prop_2.source_disp_type);
499 write(xml_out,
"sink_type_2", all_sinks.sink_prop_2.sink_type);
500 write(xml_out,
"sink_disp_type_2", all_sinks.sink_prop_2.sink_disp_type);
514 if (all_sinks.sink_prop_1.source_type ==
"POINT_SOURCE")
516 else if (all_sinks.sink_prop_1.source_type ==
"SF_POINT_SOURCE")
518 else if (all_sinks.sink_prop_1.source_type ==
"SHELL_SOURCE")
520 else if (all_sinks.sink_prop_1.source_type ==
"SF_SHELL_SOURCE")
522 else if (all_sinks.sink_prop_1.source_type ==
"WALL_SOURCE")
524 else if (all_sinks.sink_prop_1.source_type ==
"SF_WALL_SOURCE")
528 QDPIO::cerr <<
"Unsupported source type = " << all_sinks.sink_prop_1.source_type << std::endl;
533 if (all_sinks.sink_prop_1.sink_type ==
"POINT_SINK")
535 else if (all_sinks.sink_prop_1.sink_type ==
"SHELL_SINK")
537 else if (all_sinks.sink_prop_1.sink_type ==
"WALL_SINK")
541 QDPIO::cerr <<
"Unsupported sink type = " << all_sinks.sink_prop_1.sink_type << std::endl;
545 std::string source_sink_type = src_type +
"_" + snk_type;
546 QDPIO::cout <<
"Source type = " << src_type << std::endl;
547 QDPIO::cout <<
"Sink type = " << snk_type << std::endl;
551 phases_nomom,xml_out,
552 source_sink_type +
"_Heavy_Hadrons_SU3");
561 << snoop.getTimeInSeconds()
562 <<
" secs" << std::endl;
Inline measurement factory.
Inline measurement of hadron spectrum.
void operator()(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
InlineHeavyHadSpecParams params
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 static_light_su3(const multi1d< LatticeColorMatrix > &u, const LatticePropagator &quark1, const LatticePropagator &quark2, const multi1d< int > &src, const SftMom &phases, XMLWriter &xml, const std::string &xml_group)
Heavy hadron spectrum for SU(3) isospin limit.
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.
Potential between 2 heavy hadrons : Detmold Correlators checked independentely by Savage.
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 write(XMLWriter &xml, const std::string &path, const InlineHeavyHadSpecParams::NamedObject_t &input)
Propagator output.
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
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)
InlineHeavyHadSpecParams()
struct Chroma::InlineHeavyHadSpecParams::Param_t param
struct Chroma::InlineHeavyHadSpecParams::NamedObject_t named_obj