CHROMA
inline_stoch_hadron_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Inline measurement of stochastic hadron operator (mesons and baryons).
4  *
5  * spectroscopy
6  */
7 
8 #ifndef __inline_stoch_hadron_h__
9 #define __inline_stoch_hadron_h__
10 
11 #include "chromabase.h"
13 #include "io/qprop_io.h"
14 //#include <map>
15 
16 namespace Chroma
17 {
18  /*! \ingroup inlinehadron */
19  namespace InlineStochHadronEnv
20  {
21  extern const std::string name;
22  bool registerAll();
23 
24  // The flavors
26 
27  //! Parameter structure
28  /*! \ingroup inlinehadron */
29  struct Params
30  {
31  Params();
32  Params(XMLReader& xml_in, const std::string& path);
33 
34  unsigned long frequency;
35 
36  struct Param_t
37  {
38  int mom2_max; /*!< (mom)^2 <= mom2_max */
39 
40  //Operators can be mesons or baryons (quark-antiquark or three quarks).
41  multi1d<GroupXML_t> ops ; /*!< array with hadron operators xml */
42  //Each operator needs its own output file
43  //should be defined in the GroupXML_t
44 
45  GroupXML_t smearing; /*!< xml holding smearing params. only one allowed */
46  // for the moment ignore displacements...
47  multi1d<GroupXML_t> displace; /*!< xml holding displacement params */
48 
49  GroupXML_t link_smear; /*!< link smearing xml one for all*/
50 
51  multi1d<GroupXML_t> quarks ; /*! dilutions */
52 
53  } param;
54 
55 
57  {
59  //std::string meson_db;
60  //std::string baryon_db;
62 
63  std::string xml_file; // Alternate XML file pattern
64 
65  void write(XMLWriter& xml_out, const std::string& path);
66 
67  };
68 
69  struct MesonOp{
70  int g ;
72  } ;
73 
74  struct BaryonOp{
75  int g ;
77  } ;
78 
79 
80  /**
81  void meson(DComplex& corr,
82  const GroupXML_t& grpXML,
83  const LatticeComplex& phase,
84  const LatticeFermion& eta,
85  const LatticeFermion& chi,
86  const Subset& s) ;
87 
88  void baryon(DComplex& corr,
89  const GroupXML_t& grpXML,
90  const LatticeComplex& phase,
91  const LatticeFermion& eta1,
92  const LatticeFermion& eta2,
93  const LatticeFermion& eta3,
94  const Subset& s) ;
95 
96  **/
97  void ParseMeson(MesonOp&,const GroupXML_t&) ;
98  void ParseBaryon(BaryonOp&,const GroupXML_t&) ;
99 
100  //! Inline measurement of stochastic baryon operators
101  /*! \ingroup inlinehadron */
103  protected:
104  //! Do the measurement
105  void func(const unsigned long update_no,
106  XMLWriter& xml_out);
107 
108  private:
109 
110 
112  /**
113  std::map<std::string, void (*)(DComplex& ,
114  const GroupXML_t& ,
115  const LatticeComplex& ,
116  const LatticeFermion& ,
117  const LatticeFermion& ,
118  const Subset& )> mesons ;
119 
120  std::map<std::string, void (*)(DComplex& ,
121  const GroupXML_t& ,
122  const LatticeComplex& ,
123  const LatticeFermion& ,
124  const LatticeFermion& ,
125  const LatticeFermion& ,
126  const Subset& )> baryons ;
127  **/
128  std::map<std::string, void (*)(MesonOp&,const GroupXML_t& )> mesons ;
129 
130  std::map<std::string, void (*)(BaryonOp&, const GroupXML_t&)> baryons ;
131 
132  void setUpMaps(){
133  mesons["PION"] = &ParseMeson ;
134  baryons["NUCLEON"] = &ParseBaryon ;
135  }
136 
137  public:
141 
142  unsigned long getFrequency(void) const {return params.frequency;}
143 
144  //! Do the measurement
145  void operator()(const unsigned long update_no,
146  XMLWriter& xml_out);
147 
148  };
149 
150  } // name space InlineHadronEnv
151 
152 }
153 
154 #endif
Abstract inline measurements.
Primary include file for CHROMA library code.
Inline measurement of stochastic baryon operators.
void func(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
unsigned long getFrequency(void) const
Tell me how often I should measure this beastie.
void operator()(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
std::map< std::string, void(*)(MesonOp &, const GroupXML_t &)> mesons
std::map< std::string, void(*)(BaryonOp &, const GroupXML_t &)> baryons
void ParseMeson(MesonOp &m, const GroupXML_t &grpXML)
void ParseBaryon(BaryonOp &m, const GroupXML_t &grpXML)
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
::std::string string
Definition: gtest.h:1979
Routines associated with Chroma propagator IO.
Hold group xml and type id.
struct Chroma::InlineStochHadronEnv::Params::Param_t param
struct Chroma::InlineStochHadronEnv::Params::NamedObject_t named_obj
void write(XMLWriter &xml_out, const std::string &path)