Commit bca1535d authored by Stefan Hoeche's avatar Stefan Hoeche

re-added beam remnants and brh_vmode switch

fixed erroneous color conservation warning in ahadic
fixed event counting in main
parent 7b951e1c
......@@ -105,14 +105,7 @@ Return_Value::code Ahadic::Hadronize(Blob_List * blobs)
break;
case Return_Value::Retry_Event :
{
bool badcol(false);
for (Blob_List::iterator blitz=blobs->begin();
blitz!=blobs->end();++blitz) {
if (!(*blitz)->CheckColour()) {
msg_Error()<<"Found bad colour configuration in \n"
<<(**blitz)<<"\n";
}
}
blobs->ColorConservation();
msg_Tracking()<<"ERROR in "<<METHOD<<" : "<<std::endl
<<" Hadronization for blob "
<<"("<<blob<<"; "<<blob->NInP()<<" -> "
......
......@@ -34,7 +34,7 @@ int main(int argc,char* argv[])
Data_Reader read(" ",";","!","=");
msg->SetLevel(read.GetValue<int>("EVT_OUTPUT",msg->Level()));
double starttime=rpa->gen.Timer().RealTime();
for (int i=1;i<=rpa->gen.NumberOfEvents();i++) {
for (size_t i=1;i<=rpa->gen.NumberOfEvents();) {
if (i%100==0 && i<rpa->gen.NumberOfEvents()) {
double diff=rpa->gen.Timer().RealTime()-starttime;
msg_Info()<<" Event "<<i<<" ( "
......@@ -54,8 +54,10 @@ int main(int argc,char* argv[])
if (rpa->gen.BatchMode()&2) { msg_Info()<<std::endl; }
else { msg_Info()<<bm::cr<<std::flush; }
}
if (Generator->GenerateOneEvent())
if (Generator->GenerateOneEvent()) {
msg_Events()<<"Sherpa : Passed "<<i<<" events."<<std::endl;
++i;
}
}
msg_Info()<<" Event "<<rpa->gen.NumberOfEvents()<<" ( "
<<size_t(rpa->gen.Timer().RealTime()-starttime)
......
......@@ -248,7 +248,8 @@ bool Event_Handler::GenerateStandardPerturbativeEvent(eventtype::code &mode)
}
else {
if (!m_blobs.FourMomentumConservation()) {
msg_Error()<<METHOD<<"(): Four moemntum not conserved. Rejecting event."<<std::endl;
msg_Debugging()<<m_blobs<<"\n";
msg_Error()<<METHOD<<"(): Four momentum not conserved. Rejecting event."<<std::endl;
return false;
}
}
......
......@@ -12,6 +12,14 @@ Beam_Remnant_Handler(const std::string path,const std::string file,
p_sinic(softcollisions?softcollisions->GetSinic():NULL),
p_beam(beam), m_fill(true)
{
Data_Reader read(" ",";","!","=");
read.AddComment("#");
read.SetInputPath(path);
read.SetInputFile(file);
if (!read.ReadFromFile(m_fill,"BEAM_REMNANTS")) m_fill=1;
else msg_Info()<<METHOD<<"(): Set remnants "<<m_fill<<"."<<std::endl;
if (!read.ReadFromFile(m_vmode,"BRH_VMODE")) m_vmode=0;
else msg_Info()<<METHOD<<"(): Set check mode "<<m_vmode<<"."<<std::endl;
if (p_sinic==NULL) {
p_parametrised = new Parametrised_Beam_Remnants(path,file,isr,p_beam);
p_parametrised->SetScale(4.0);
......@@ -27,7 +35,22 @@ Beam_Remnant_Handler::~Beam_Remnant_Handler()
Return_Value::code
Beam_Remnant_Handler::FillBeamAndBunchBlobs(Blob_List *const bloblist)
{
if (!m_fill) return Return_Value::Nothing;
if (!m_fill) {
bool set(false);
for (Blob_List::iterator bit=bloblist->begin();
bit!=bloblist->end();++bit) {
if ((*bit)->Has(blob_status::needs_beams)) {
(*bit)->UnsetStatus(blob_status::needs_beams);
(*bit)->UnsetStatus(blob_status::internal_flag);
set=true;
}
}
if (!set) return Return_Value::Nothing;
if (bloblist->FourMomentumConservation())
return Return_Value::Success;
if (m_vmode) abort();
return Return_Value::New_Event;
}
for (Blob_List::iterator bit=bloblist->begin();
bit!=bloblist->end();++bit) {
if ((*bit)->Type()==btp::Beam) {
......@@ -46,6 +69,7 @@ Beam_Remnant_Handler::FillBeamAndBunchBlobs(Blob_List *const bloblist)
}
else {
fbc = p_parametrised->FillBeamBlobs(bloblist);
if (fbc==Return_Value::New_Event && m_vmode) abort();
}
if (fbc!=Return_Value::Success) return fbc;
fbc = FillBunchBlobs(bloblist);
......
......@@ -13,9 +13,7 @@ namespace SHERPA {
BEAM::Beam_Spectra_Handler * p_beam;
ATOOLS::Blob * p_beamblobs[2];
bool m_fill;
int m_beam;
int m_beam, m_fill, m_vmode;
ATOOLS::Blob * InitBeamBlob(const int beam);
ATOOLS::Blob * FillBunchBlob(const int,ATOOLS::Particle *);
......
......@@ -109,7 +109,7 @@ FillBeamBlobs(Blob_List *const bloblist,
}
return Return_Value::Success;
}
return Return_Value::Retry_Event;
return Return_Value::New_Event;
}
......
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