23 namespace InlineMesonSpecEnv
59 XMLReader paramtop(xml, path);
62 read(paramtop,
"version", version);
70 QDPIO::cerr <<
"Input parameter version " << version <<
" unsupported." << std::endl;
86 write(xml,
"version", version);
99 XMLReader inputtop(xml, path);
129 XMLReader inputtop(xml, path);
158 XMLReader inputtop(xml, path);
184 XMLReader paramtop(xml_in, path);
186 if (paramtop.count(
"Frequency") == 1)
198 if (paramtop.count(
"xml_file") != 0)
205 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
229 struct SinkPropContainer_t
244 struct AllCorrelatorTerms_t
252 void readSinkProp(SinkPropContainer_t&
s,
const std::string&
id)
257 const LatticePropagator& foo =
261 s.quark_propagator_id = id;
264 XMLReader prop_file_xml, prop_record_xml;
271 read(prop_record_xml,
"/SinkSmear",
s.prop_header);
273 read(prop_record_xml,
"/SinkSmear/PropSource/Source/SourceType",
s.source_type);
274 read(prop_record_xml,
"/SinkSmear/PropSource/Source/Displacement/DisplacementType",
277 read(prop_record_xml,
"/SinkSmear/PropSink/Sink/SinkType",
s.sink_type);
278 read(prop_record_xml,
"/SinkSmear/PropSink/Sink/Displacement/DisplacementType",
282 catch( std::bad_cast )
300 QDPIO::cout <<
"Try action and mass" << std::endl;
301 s.Mass =
getMass(
s.prop_header.prop_header.fermact);
303 QDPIO::cout <<
"FermAct = " <<
s.prop_header.prop_header.fermact.id << std::endl;
304 QDPIO::cout <<
"Mass = " <<
s.Mass << std::endl;
309 void readAllSinks(multi1d<AllCorrelatorTerms_t>&
s,
310 const multi1d<InlineMesonSpecParams::NamedObject_t::Correlators_t::CorrelatorTerms_t>& correlator_terms)
312 s.resize(correlator_terms.size());
314 for(
int i=0;
i < correlator_terms.size(); ++
i)
316 QDPIO::cout <<
"Attempt to parse forward propagator = " << correlator_terms[
i].first_id << std::endl;
318 QDPIO::cout <<
"Forward propagator successfully parsed" << std::endl;
320 QDPIO::cout <<
"Attempt to parse forward propagator = " << correlator_terms[
i].second_id << std::endl;
322 QDPIO::cout <<
"Forward propagator successfully parsed" << std::endl;
340 push(xml_out,
"MesonSpectrum");
341 write(xml_out,
"update_no", update_no);
342 write(xml_out,
"xml_file", xml_file);
345 XMLFileWriter xml(xml_file);
346 func(update_no, xml);
350 func(update_no, xml_out);
370 XMLBufferWriter gauge_xml;
376 catch( std::bad_cast )
388 const multi1d<LatticeColorMatrix>&
u =
391 push(xml_out,
"MesonSpectrum");
392 write(xml_out,
"update_no", update_no);
402 write(xml_out,
"Config_info", gauge_xml);
404 push(xml_out,
"Output_version");
405 write(xml_out,
"out_version", 3);
410 MesPlq(xml_out,
"Observables",
u);
413 push(xml_out,
"Wilson_hadron_measurements");
420 push(xml_out,
"elem");
427 multi1d<AllCorrelatorTerms_t> all_sinks;
432 = all_sinks[0].sink_prop_1.prop_header.source_header.getTSrce();
433 int j_decay = all_sinks[0].sink_prop_1.prop_header.source_header.j_decay;
434 int t0 = all_sinks[0].sink_prop_1.prop_header.source_header.t_source;
437 for(
int loop=0; loop < all_sinks.size(); ++loop)
441 QDPIO::cerr <<
"Error!! j_decay must be the same for all propagators " << std::endl;
444 if (all_sinks[loop].
sink_prop_2.prop_header.source_header.t_source !=
445 all_sinks[loop].sink_prop_1.prop_header.source_header.t_source)
447 QDPIO::cerr <<
"Error!! t_source must be the same for all propagators " << std::endl;
466 push(xml_out,
"Forward_prop_headers");
467 for(
int loop=0; loop < all_sinks.size(); ++loop)
469 push(xml_out,
"elem");
470 write(xml_out,
"First_forward_prop", all_sinks[loop].
sink_prop_1.prop_header);
471 write(xml_out,
"Second_forward_prop", all_sinks[loop].
sink_prop_2.prop_header);
478 push(xml_out,
"Forward_prop_correlator");
479 for(
int loop=0; loop < all_sinks.size(); ++loop)
486 push(xml_out,
"elem");
494 push(xml_out,
"SourceSinkType");
495 for(
int loop=0; loop < all_sinks.size(); ++loop)
497 push(xml_out,
"elem");
498 QDPIO::cout <<
"Source_type_1 = " << all_sinks[loop].sink_prop_1.source_type << std::endl;
499 QDPIO::cout <<
"Sink_type_1 = " << all_sinks[loop].sink_prop_1.sink_type << std::endl;
500 QDPIO::cout <<
"Source_type_2 = " << all_sinks[loop].sink_prop_2.source_type << std::endl;
501 QDPIO::cout <<
"Sink_type_2 = " << all_sinks[loop].sink_prop_2.sink_type << std::endl;
504 write(xml_out,
"source_disp_type_1", all_sinks[loop].
sink_prop_1.source_disp_type);
506 write(xml_out,
"sink_disp_type_1", all_sinks[loop].
sink_prop_1.sink_disp_type);
509 write(xml_out,
"source_disp_type_2", all_sinks[loop].
sink_prop_2.source_disp_type);
511 write(xml_out,
"sink_disp_type_2", all_sinks[loop].
sink_prop_2.sink_disp_type);
518 push(xml_out,
"Mesons");
527 LatticeComplex corr_fn =
zero;
529 for(
int loop=0; loop < all_sinks.size(); ++loop)
536 LatticePropagator prop_1, prop_2;
543 std::istringstream xml_s(named_obj.
correlator_terms[loop].source_spin_insertion.xml);
544 XMLReader inserttop(xml_s);
558 std::istringstream xml_s(named_obj.
correlator_terms[loop].sink_spin_insertion.xml);
559 XMLReader inserttop(xml_s);
570 prop_2 = (*sinkSpinInsertion)(prop_tmp);
581 LatticeComplex
tmp = trace(prop_2 * prop_1);
586 multi2d<DComplex> hsum;
587 hsum = phases.
sft(corr_fn);
590 XMLArrayWriter xml_sink_mom(xml_out,phases.
numMom());
591 push(xml_sink_mom,
"momenta");
593 for (
int sink_mom_num=0; sink_mom_num < phases.
numMom(); ++sink_mom_num)
596 write(xml_sink_mom,
"sink_mom_num", sink_mom_num);
597 write(xml_sink_mom,
"sink_mom", phases.
numToMom(sink_mom_num));
599 multi1d<DComplex> mesprop(length);
600 for (
int t=0;
t < length; ++
t)
602 int t_eff = (
t -
t0 + length) % length;
603 mesprop[t_eff] = hsum[sink_mom_num][
t];
606 write(xml_sink_mom,
"mesprop", mesprop);
622 << snoop.getTimeInSeconds()
623 <<
" secs" << std::endl;
Inline measurement factory.
Class for counted reference semantics.
Inline measurement of meson 2-pt functions.
InlineMesonSpecParams 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.
int numSubsets() const
Number of subsets - length in decay direction.
multi1d< int > numToMom(int mom_num) const
Convert momenta id to actual array of momenta.
multi2d< DComplex > sft(const LatticeComplex &cf) const
Do a sumMulti(cf*phases,getSet())
int numMom() const
Number of momenta.
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 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.
GroupXML_t readXMLGroup(XMLReader &xml_in, const std::string &path, const std::string &type_name)
Read group and return as a std::string.
Class for counted reference semantics.
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 meson spectrum calculations.
Named object function std::map.
static bool registered
Local registration flag.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
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")
void write(XMLWriter &xml, const std::string &path, const InlineMesonSpecParams::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.
All spin insertion constructors.
Factory for producing spin insertion objects.
GroupXML_t sink_spin_insertion
GroupXML_t source_spin_insertion
std::string source_wavetype
std::string source_particle
std::string sink_particle
std::string sink_wavetype
multi1d< CorrelatorTerms_t > correlator_terms
multi1d< Correlators_t > correlators
struct Chroma::InlineMesonSpecParams::NamedObject_t named_obj
void write(XMLWriter &xml_out, const std::string &path)
struct Chroma::InlineMesonSpecParams::Param_t param