Commit 688b5ff9 authored by Enrico Bothmann's avatar Enrico Bothmann

Address static analyser warnings in SHERPA

parent 2642da66
......@@ -749,7 +749,7 @@ void Hard_Decay_Handler::AddDecayClustering(ATOOLS::Cluster_Amplitude*& ampl,
size_t ampl_nout=ampl->Legs().size()-ampl->NIn();
if (ampl_nout==1) idk=ampl->Leg(0)->Id();
else {
size_t select=ampl->Legs().size();
size_t select(0);
do {
select=ampl->NIn()+floor(ran->Get()*ampl_nout);
} while (ampl->Leg(select)->Id()&idmother ||
......@@ -825,7 +825,7 @@ void Hard_Decay_Handler::AddDecayClustering(ATOOLS::Cluster_Amplitude*& ampl,
size_t ampl_nout=ampl->Legs().size()-ampl->NIn();
if (ampl_nout==1) idk=ampl->Leg(0)->Id();
else {
size_t select=ampl->Legs().size();
size_t select(0);
do {
select=ampl->NIn()+floor(ran->Get()*ampl_nout);
} while (ampl->Leg(select)->Id()&idmother || select>ampl->Legs().size()-1);
......@@ -970,8 +970,8 @@ void Hard_Decay_Handler::AddPhotonsClustering(Cluster_Amplitude*& ampl,
size_t ampl_nout=ampl->Legs().size()-ampl->NIn();
if (ampl_nout==1) idk=ampl->Leg(0)->Id();
else {
size_t select=ampl->Legs().size();
size_t nvalid=0;
size_t select(0);
size_t nvalid(0);
for (size_t i(ampl->NIn());i<ampl->Legs().size();++i) {
if (!(ampl->Leg(i)->Id()&idmother || i>ampl->Legs().size()-1 ||
ampl->Leg(i)->Flav().Kfcode()==kf_photon)) {
......
......@@ -18,6 +18,8 @@
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Math/Random.H"
#include <cassert>
using namespace SHERPA;
using namespace PHASIC;
using namespace ATOOLS;
......@@ -123,6 +125,7 @@ DefineInitialConditions(ATOOLS::Blob *blob)
}
return Return_Value::Success;
}
assert(p_me != NULL);
p_ampl=p_me->Process()->Get<Single_Process>()->Cluster
(p_me->Process()->Integrator()->Momenta(),m_cmode);
if (p_ampl==NULL) return Return_Value::New_Event;
......
......@@ -67,10 +67,12 @@ Beam_Remnant_Handler::FillBeamAndBunchBlobs(Blob_List *const bloblist)
if (p_shrimps) {
fbc = p_shrimps->FillBeamBlobs(bloblist);
}
else {
else if (p_parametrised) {
fbc = p_parametrised->FillBeamBlobs(bloblist);
if (fbc==Return_Value::New_Event && m_vmode)
THROW(fatal_error,"Four Momentum not conserved.");
} else {
THROW(fatal_error, "No physics model initialised.");
}
if (fbc!=Return_Value::Success) return fbc;
fbc = FillBunchBlobs(bloblist);
......
......@@ -206,19 +206,6 @@ RejectExclusiveChannelsFromFragmentation(Blob* fblob)
decayblob->InParticle(0)->Flav());
for (size_t i=0; i<tmpno.size(); ++i) compflavsno[i+1]=tmpno[i];
}
Blob_Data_Base* data = (*fblob)["dc"];
/*
std::string decname(data->Get<Decay_Channel*>()->Name());
bool outtag(decayblob->InParticle(0)->Flav()==Flavour(kf_B_s));
if (outtag) {
msg_Out()<<om::red
<<METHOD<<" for "<<decayblob->InParticle(0)->Flav()<<" ->";
for (size_t i=0; i<compflavs.size(); i++)
msg_Out()<<" "<<compflavs[i];
msg_Out()<<"\n --> |"<<decname<<"|\n"
<<(*fblob)<<"\n";
}
*/
if (dt->second[0]->GetDecayChannel(compflavs) ||
(tmpno.size()!=tmp.size() &&
dt->second[0]->GetDecayChannel(compflavsno))) {
......@@ -238,17 +225,9 @@ RejectExclusiveChannelsFromFragmentation(Blob* fblob)
Decay_Matrix* D=FillDecayTree(decayblob, sigma);
delete sigma;
delete D;
/*
if (outtag) {
msg_Out()<<".\n"<<"Define new blob:"
<<om::green<<(*decayblob)<<om::reset<<".\n"
<<"=================================================\n";
}
*/
return true;
}
else {
//if (outtag) msg_Out()<<om::green<<" --> accepted.\n"<<om::reset;
DEBUG_INFO("not found as exclusive. accepted.");
Vec4D vertex_position=decayblob->Position();
if (showerblob) showerblob->SetPosition(vertex_position);
......
......@@ -304,11 +304,8 @@ void Primordial_KPerp::FillKPerp(ATOOLS::Particle *cur1,unsigned int beam)
double spn1=sqr(E1+E2)-sqr(pz1+pz2)-sqr((kp1+kp2).Abs());
double spn2=sqr(E1+E2)-sqr(-pz1+pz2)-sqr((kp1+kp2).Abs());
if (ATOOLS::dabs(spn1-spo)>ATOOLS::dabs(spn2-spo)) pz1*=-1.0;
spn1=sqr(E1+E2)-sqr(pz1+pz2)-sqr((kp1+kp2).Abs());
spn2=sqr(E1+E2)-sqr(-pz1+pz2)-sqr((kp1+kp2).Abs());
double ytn=(E1+E2+pz1+pz2)/(E1+E2-pz1-pz2);
if (ATOOLS::dabs(ytn-yto)>ATOOLS::dabs(1./ytn-yto)) { pz1*=-1.0; pz2*=-1.0; }
ytn=(E1+E2+pz1+pz2)/(E1+E2-pz1-pz2);
if (dabs(pz1)>dabs(pz2)) { if (Sign(pz1)==Sign(old1[3])) break; }
else { if (Sign(pz2)==Sign(old2[3])) break; }
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment