sherpa is hosted by Hepforge, IPPP Durham
close Warning: Can't synchronize with repository "(default)" (/hepforge/svn/sherpa does not appear to be a Subversion repository.). Look in the Trac log for more information.

Ticket #120: ExampleModel.patch

File ExampleModel.patch, 2.2 KB (added by marek, 14 years ago)
  • AddOns/ExampleModel/SM_Zprime.C

     
    1212
    1313namespace MODEL {
    1414 
    15   class SM_Zprime : public Standard_Model {
    16   protected :
     15  class SM_Zprime : public Model_Base {
     16  protected :     
     17    MODEL::Model_Base * p_sm;
     18
    1719    void ParticleInit();
    1820    void FillSpectrum();
     21    bool ModelInit();
     22
    1923  public :
    2024    SM_Zprime(std::string,std::string,bool);
    2125  };
    2226 
    2327 
    2428  SM_Zprime::SM_Zprime(std::string dir, std::string file, bool elementary) :
    25       Standard_Model(dir, file, false)
     29      Model_Base(dir,file,elementary)
    2630  {
    27     m_elementary=elementary;
    28     if (m_elementary) {
    29       msg_Info()<<"Initialize the Standard Model plus dummy Zprime from "
    30           <<m_dir<<" / "<<m_file<<std::endl;
    31     }
    32     m_name      = std::string("SM+Zprime");
     31    p_sm = new Standard_Model(m_dir,m_file,false);
    3332
    3433    ParticleInit();   
    35     FillSpectrum();
    3634    if (m_elementary) {
    3735      ATOOLS::OutputParticles(msg->Info());
    3836      ATOOLS::OutputContainers(msg->Info());
     
    5856    p_dataread->AddWordSeparator("\t");
    5957    p_dataread->SetInputPath(m_dir);
    6058    p_dataread->SetInputFile(m_file);
     59    PRINT_INFO(p_constants);
    6160    p_constants->insert(make_pair(string("Zp_cpl_L"),   
    6261                                  p_dataread->GetValue<double>("Zp_cpl_L",1.)));
    6362    p_constants->insert(make_pair(string("Zp_cpl_R"),   
    6463                                  p_dataread->GetValue<double>("Zp_cpl_R",1.)));
    6564  }
     65
     66  bool SM_Zprime::ModelInit()
     67  {
     68    if (m_elementary) {
     69      msg_Info()<<"Initialize the Standard Model plus dummy Zprime from "
     70          <<m_dir<<" / "<<m_file<<std::endl;
     71    }
     72    m_name      = std::string("SM+Zprime");
     73
     74    p_sm->ModelInit();
     75    p_numbers   = p_sm->ExtractScalarNumbers();
     76    p_constants = p_sm->ExtractScalarConstants();
     77    p_functions = p_sm->ExtractScalarFunctions();
     78    p_matrices  = p_sm->ExtractComplexMatrices();
     79    PRINT_INFO("inited SM::ModelInit");
     80
     81    FillSpectrum();
     82    PRINT_INFO("filled spectrum");
     83
     84    return true;
     85  }
    6686}
    6787
    6888