Ticket #92: sc-crash.patch
File sc-crash.patch, 2.8 KB (added by , 14 years ago) |
---|
-
SHERPA/Single_Events/Signal_Processes.C
11 11 using namespace ATOOLS; 12 12 13 13 Signal_Processes::Signal_Processes(Matrix_Element_Handler * mehandler) : 14 p_mehandler(mehandler) 14 p_mehandler(mehandler), p_amps(NULL) 15 15 { 16 16 m_name="Signal_Processes"; 17 17 m_type=eph::Perturbative; … … 23 23 24 24 Signal_Processes::~Signal_Processes() 25 25 { 26 if (p_amps) delete p_amps; p_amps=NULL; 26 27 } 27 28 28 29 Return_Value::code Signal_Processes::Treat(Blob_List * bloblist, double & weight) … … 104 105 Particle_Vector outparticles = blob->GetOutParticles(); 105 106 Particle_Vector particles(inparticles.begin(),inparticles.end()); 106 107 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); 108 110 109 111 AMEGIC::Single_Process* aproc = dynamic_cast<AMEGIC::Single_Process*>(proc); 110 112 if (!aproc) { 111 113 THROW(fatal_error, "Spin correlations can only be enabled when using "+ 112 114 std::string("Amegic as matrix element generator.")); 113 115 } 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)); 116 118 } 117 119 118 120 return success; -
SHERPA/Single_Events/Signal_Processes.H
5 5 #include "SHERPA/PerturbativePhysics/Matrix_Element_Handler.H" 6 6 #include "PDF/Remnant/Remnant_Base.H" 7 7 8 namespace METOOLS { 9 class Amplitude_Tensor; 10 } 11 8 12 namespace SHERPA { 9 13 10 14 class Signal_Processes: public Event_Phase_Handler { … … 12 16 13 17 Matrix_Element_Handler *p_mehandler; 14 18 PDF::Remnant_Base *p_remnants[2]; 19 METOOLS::Amplitude_Tensor *p_amps; 15 20 bool FillBlob(ATOOLS::Blob_List *const bl,ATOOLS::Blob *const b); 16 21 17 22 public: -
METOOLS/Main/Spin_Structure.C
248 248 } 249 249 250 250 namespace 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() {} 254 252 template class Blob_Data<Amplitude_Tensor*>; 255 253 template Amplitude_Tensor* &Blob_Data_Base::Get<Amplitude_Tensor*>(); 256 254 }