sherpa is hosted by Hepforge, IPPP Durham
close Warning:
  • Error with navigation contributor "BrowserModule"
  • Failed to sync with repository "(default)": instance.__dict__ not accessible in restricted mode; repository information may be out of date. Look in the Trac log for more information including mitigation strategies.

Ticket #92: sc-crash.patch

File sc-crash.patch, 2.8 KB (added by Frank Siegert, 14 years ago)
  • SHERPA/Single_Events/Signal_Processes.C

     
    1111using namespace ATOOLS;
    1212
    1313Signal_Processes::Signal_Processes(Matrix_Element_Handler * mehandler) :
    14   p_mehandler(mehandler)
     14  p_mehandler(mehandler), p_amps(NULL)
    1515{
    1616  m_name="Signal_Processes";
    1717  m_type=eph::Perturbative;
     
    2323
    2424Signal_Processes::~Signal_Processes()
    2525{
     26  if (p_amps) delete p_amps; p_amps=NULL;
    2627}
    2728
    2829Return_Value::code Signal_Processes::Treat(Blob_List * bloblist, double & weight)
     
    104105    Particle_Vector outparticles = blob->GetOutParticles();
    105106    Particle_Vector particles(inparticles.begin(),inparticles.end());
    106107    particles.insert(particles.end(),outparticles.begin(),outparticles.end());
    107     METOOLS::Amplitude_Tensor* amps = new METOOLS::Amplitude_Tensor(particles);
     108    if (p_amps) delete p_amps;
     109    p_amps = new METOOLS::Amplitude_Tensor(particles);
    108110   
    109111    AMEGIC::Single_Process* aproc = dynamic_cast<AMEGIC::Single_Process*>(proc);
    110112    if (!aproc) {
    111113      THROW(fatal_error, "Spin correlations can only be enabled when using "+
    112114            std::string("Amegic as matrix element generator."));
    113115    }
    114     aproc->FillAmplitudes(amps);
    115     blob->AddData("amps",new Blob_Data<METOOLS::Amplitude_Tensor*>(amps));
     116    aproc->FillAmplitudes(p_amps);
     117    blob->AddData("amps",new Blob_Data<METOOLS::Amplitude_Tensor*>(p_amps));
    116118  }
    117119
    118120  return success;
  • SHERPA/Single_Events/Signal_Processes.H

     
    55#include "SHERPA/PerturbativePhysics/Matrix_Element_Handler.H"
    66#include "PDF/Remnant/Remnant_Base.H"
    77
     8namespace METOOLS {
     9  class Amplitude_Tensor;
     10}
     11
    812namespace SHERPA {
    913
    1014  class Signal_Processes: public Event_Phase_Handler {
     
    1216
    1317    Matrix_Element_Handler *p_mehandler;
    1418    PDF::Remnant_Base      *p_remnants[2];
     19    METOOLS::Amplitude_Tensor *p_amps;
    1520    bool FillBlob(ATOOLS::Blob_List *const bl,ATOOLS::Blob *const b);
    1621
    1722  public:
  • METOOLS/Main/Spin_Structure.C

     
    248248}
    249249
    250250namespace ATOOLS {
    251   template <> Blob_Data<Amplitude_Tensor*>::~Blob_Data() {
    252     if(m_data) delete m_data; m_data=NULL;
    253   }
     251  template <> Blob_Data<Amplitude_Tensor*>::~Blob_Data() {}
    254252  template class Blob_Data<Amplitude_Tensor*>;
    255253  template Amplitude_Tensor* &Blob_Data_Base::Get<Amplitude_Tensor*>();
    256254}