Commit ed8374ff authored by Stefan Hoeche's avatar Stefan Hoeche

svn merge -c29023 ^/branches/rel-2-2-0_anl_d2

(accelerated amegic initialization)
parent 714fbea5
......@@ -331,7 +331,7 @@ void Amplitude_Generator::SetProps(Point* pl,int dep,Single_Amplitude* &first,in
}
void Amplitude_Generator::CreateSingleAmplitudes(Single_Amplitude * & first) {
void Amplitude_Generator::CreateSingleAmplitudes(Single_Amplitude * & first,std::set<std::pair<int,int> > &valid) {
int count=0;
Single_Amplitude* n;
......@@ -414,6 +414,7 @@ void Amplitude_Generator::CreateSingleAmplitudes(Single_Amplitude * & first) {
if (CheckOrders(prea_table[i].p) &&
CheckTChannels(prea_table[i].p)) {
gra = new Single_Amplitude(prea_table[i].p,prea_table[i].top,prea_table[i].perm,b,dep,N,top,BS,fl,shand);
valid.insert(std::pair<int,int>(prea_table[i].top,prea_table[i].perm));
count++;
if (first) n->Next = gra;
else first = gra;
......@@ -1017,7 +1018,7 @@ int Amplitude_Generator::CountRealAmplitudes(Single_Amplitude* first)
return ra;
}
Single_Amplitude* Amplitude_Generator::Matching()
Single_Amplitude* Amplitude_Generator::Matching(std::set<std::pair<int,int> > &valid)
{
short int i,j;
int sw1;
......@@ -1025,7 +1026,6 @@ Single_Amplitude* Amplitude_Generator::Matching()
Single_Amplitude* first_amp;
first_amp = 0;
int count = 0;
int start_top = 0;
int end_top = single_top->number;
......@@ -1102,6 +1102,7 @@ Single_Amplitude* Amplitude_Generator::Matching()
}
if (sw1) {
for (j=start_top;j<end_top;j++) {
if (valid.size() && valid.find(std::pair<int,int>(j,i))==valid.end()) continue;
perm++;
int pnum = 100;
Set_End(&single_top->p[j][0],perm,pnum);
......@@ -1110,7 +1111,7 @@ Single_Amplitude* Amplitude_Generator::Matching()
single_top->p[j][0].fl = fl[*perm];
single_top->p[j][0].b = b[*perm];
SetProps(single_top->p[j],2*N-3,first_amp,j,count);
SetProps(single_top->p[j],2*N-3,first_amp,j,i);
//msg_Out()<<"-----------------------------------"<<std::endl;
//msg_Out()<<" "<<single_top->p[j][0].fl<<"("<<single_top->p[j][0].b<<")"<<endl;
......@@ -1119,7 +1120,7 @@ Single_Amplitude* Amplitude_Generator::Matching()
}
}
CreateSingleAmplitudes(first_amp);
CreateSingleAmplitudes(first_amp,valid);
CountOrders(first_amp);
......
......@@ -70,7 +70,7 @@ namespace AMEGIC {
int CompareColors(Point*,Point*);
int Compare5Vertex(Point*,Point*);
void CreateSingleAmplitudes(Single_Amplitude* &);
void CreateSingleAmplitudes(Single_Amplitude* &,std::set<std::pair<int,int> > &);
void CheckFor4Vertices(Single_Amplitude* &);
int EvalPointlist(Point*&, Point*&,Point*&,std::vector<Point*>&);
int ShrinkProps(Point*&,Point*&,Point*&,Point*&,std::vector<Point*>&);
......@@ -85,7 +85,7 @@ namespace AMEGIC {
Amplitude_Generator(int,ATOOLS::Flavour *,int *,Amegic_Model *,Topology *,
std::vector<double>,int,Basic_Sfuncs *,String_Handler *,bool=true);
~Amplitude_Generator();
Single_Amplitude* Matching();
Single_Amplitude* Matching(std::set<std::pair<int,int> > &valid);
inline const std::vector<double> &Order() const { return order; }
};
......
......@@ -26,7 +26,7 @@ Amplitude_Handler::Amplitude_Handler(int N,Flavour* fl,int* b,Process_Tags* pinf
MODEL::Coupling_Map *const cpls,
Basic_Sfuncs* BS,String_Handler* _shand,
std::string print_graph,bool create_4V,
bool cutvecprop)
bool cutvecprop,const std::string &path)
: m_cutvecprop(cutvecprop), shand(_shand), CFCol_Matrix(0), Mi(0),
m_print_graph(print_graph)
{
......@@ -62,7 +62,8 @@ Amplitude_Handler::Amplitude_Handler(int N,Flavour* fl,int* b,Process_Tags* pinf
sfl[0] = *(pi->p_fl);
pi->GetFlavList(sfl+1);
gen = new Amplitude_Generator(1+pi->Nout(),sfl,b_dec,model,top,std::vector<double>(2,99),-99,BS,shand);
subgraphlist[i] = gen->Matching();
subgraphlist[i] = gen->Matching(m_valid);
m_valid.clear();
if (subgraphlist[i]==NULL) {
ndecays = 0;
subgraphlist[0] = NULL;
......@@ -82,8 +83,14 @@ Amplitude_Handler::Amplitude_Handler(int N,Flavour* fl,int* b,Process_Tags* pinf
}
//core process
My_In_File topfile(rpa->gen.Variable("SHERPA_CPP_PATH")+"/Process/Amegic/"+path+"/Top.dat");
if (topfile.Open()) {
int itop, iperm;
for (*topfile>>itop>>iperm;itop>=0;*topfile>>itop>>iperm)
m_valid.insert(std::pair<int,int>(itop,iperm));
}
gen = new Amplitude_Generator(nin+pinfo->Nout(),sfl,b,model,top,_maxcpl,_ntchan,BS,shand,create_4V);
subgraphlist[0] = gen->Matching();
subgraphlist[0] = gen->Matching(m_valid);
_maxcpl=gen->Order();
delete gen;
......@@ -301,6 +308,12 @@ void Amplitude_Handler::CompleteAmplitudes(int N,Flavour* fl,int* b,Polarisation
void Amplitude_Handler::StoreAmplitudeConfiguration(std::string path)
{
My_Out_File topfile(path+"/Top.dat");
topfile.Open();
for (std::set<std::pair<int,int> >::const_iterator
it(m_valid.begin());it!=m_valid.end();++it)
*topfile<<it->first<<" "<<it->second<<" ";
*topfile<<"-1 -1\n";
std::string name = path+"/Cluster.dat";
IO_Handler ioh;
ioh.SetFileName(name);
......@@ -356,6 +369,7 @@ void Amplitude_Handler::RestoreAmplitudes(std::string path)
m_on.resize(graphs.size());
m_aon.resize(graphs.size(),0);
m_cplmatrix.resize(graphs.size());
static Data_Reader read(",",";",")","(");
for (size_t i=0;i<graphs.size();i++) {
int *nums, ci, cj;
std::string ords;
......@@ -364,7 +378,6 @@ void Amplitude_Handler::RestoreAmplitudes(std::string path)
for (size_t j=0;j<graphs.size();j++) {
*sqrcplfile>>ci>>cj>>ords;
if (ci!=i || cj!=j) THROW(fatal_error,"Invalid coupling data");
Data_Reader read(",",";",")","(");
read.SetString(ords);
read.VectorFromString(m_cplmatrix[i][j],"");
for (size_t k=0;k<Min(m_cplmatrix[i][j].size(),m_maxcpl.size());++k)
......@@ -374,7 +387,6 @@ void Amplitude_Handler::RestoreAmplitudes(std::string path)
if (m_on[i][j]) m_aon[i]=1;
}
*cplfile>>ci>>ords;
Data_Reader read(",",";",")","(");
read.SetString(ords);
std::vector<int> ord;
read.VectorFromString(ord,"");
......
......@@ -43,6 +43,7 @@ namespace AMEGIC {
std::vector<int> m_aon;
std::vector<std::vector<std::vector<int> > > m_cplmatrix;
std::vector<std::vector<int> > m_on;
std::set<std::pair<int,int> > m_valid;
int PropProject(Amplitude_Base*,int);
int CompareZfunc(Amplitude_Base*,Zfunc*,Amplitude_Base*,Zfunc*);
......@@ -64,7 +65,7 @@ namespace AMEGIC {
std::vector<double> &,std::vector<double> &,
int &,MODEL::Coupling_Map *const cpls,
Basic_Sfuncs *,String_Handler *,std::string print_graph="", bool create_4V=true,
bool cutvecprop=true);
bool cutvecprop=true,const std::string &path="");
~Amplitude_Handler();
void ConstructSignalAmplitudes(int N,ATOOLS::Flavour* fl,int* b,
Process_Tags* pinfo,Single_Amplitude** sglist,
......
......@@ -212,7 +212,7 @@ int AMEGIC::Single_LOProcess::InitAmplitude(Amegic_Model * model,Topology* top,
int ntchanmin(m_ntchanmin);
bool cvp(ToType<int>(rpa->gen.Variable("AMEGIC_CUT_MASSIVE_VECTOR_PROPAGATORS")));
p_ampl = new Amplitude_Handler(m_nin+m_nout,&m_flavs.front(),p_b,p_pinfo,model,top,m_maxcpl,m_mincpl,ntchanmin,
&m_cpls,p_BS,p_shand,m_print_graphs,!directload,cvp);
&m_cpls,p_BS,p_shand,m_print_graphs,!directload,cvp,m_ptypename+"/"+m_libname);
m_ntchanmin=ntchanmin;
if (p_ampl->GetGraphNumber()==0) {
msg_Tracking()<<"AMEGIC::Single_LOProcess::InitAmplitude : No diagrams for "<<m_name<<"."<<endl;
......@@ -369,7 +369,7 @@ int Single_LOProcess::InitAmplitude(Amegic_Model * model,Topology* top,
int ntchanmin(m_ntchanmin);
bool cvp(ToType<int>(rpa->gen.Variable("AMEGIC_CUT_MASSIVE_VECTOR_PROPAGATORS")));
p_ampl = new Amplitude_Handler(m_nin+m_nout,&m_flavs.front(),p_b,p_pinfo,model,top,m_maxcpl,m_mincpl,ntchanmin,
&m_cpls,p_BS,p_shand,m_print_graphs,!directload,cvp);
&m_cpls,p_BS,p_shand,m_print_graphs,!directload,cvp,m_ptypename+"/"+m_libname);
m_ntchanmin=ntchanmin;
if (p_ampl->GetGraphNumber()==0) {
msg_Tracking()<<"Single_LOProcess::InitAmplitude : No diagrams for "<<m_name<<"."<<endl;
......
......@@ -99,7 +99,7 @@ int Single_LOProcess_MHV::InitAmplitude(Amegic_Model * model,Topology* top,
int ntchanmin(m_ntchanmin);
p_ampl = new Amplitude_Handler(m_nin+m_nout,fl,p_b,p_pinfo,model,top,m_maxcpl,m_mincpl,ntchanmin,
&m_cpls,p_BS,p_shand,m_print_graphs,0,true);
&m_cpls,p_BS,p_shand,m_print_graphs,0,true,m_ptypename+"/"+m_libname);
m_ntchanmin=ntchanmin;
if (p_ampl->GetGraphNumber()==0) {
msg_Tracking()<<"Single_LOProcess_MHV::InitAmplitude : No diagrams for "<<m_name<<"."<<endl;
......@@ -215,7 +215,7 @@ int Single_LOProcess_MHV::InitAmplitude(Amegic_Model * model,Topology* top,
int ntchanmin(m_ntchanmin);
p_ampl = new Amplitude_Handler(m_nin+m_nout,&m_flavs.front(),p_b,p_pinfo,model,top,m_maxcpl,m_mincpl,ntchanmin,
&m_cpls,p_BS,p_shand,m_print_graphs,0,true);
&m_cpls,p_BS,p_shand,m_print_graphs,0,true,m_ptypename+"/"+m_libname);
m_ntchanmin=ntchanmin;
if (p_ampl->GetGraphNumber()==0) {
msg_Tracking()<<"Single_LOProcess_MHV::InitAmplitude : No diagrams for "<<m_name<<"."<<endl;
......
......@@ -147,7 +147,7 @@ int AMEGIC::Single_Process::InitAmplitude(Amegic_Model *model,Topology* top,
int ntchanmin(m_ntchanmin);
bool cvp(ToType<int>(rpa->gen.Variable("AMEGIC_CUT_MASSIVE_VECTOR_PROPAGATORS")));
p_ampl = new Amplitude_Handler(m_nin+m_nout,&m_flavs.front(),p_b,p_pinfo,model,top,m_maxcpl,m_mincpl,ntchanmin,
&m_cpls,p_BS,p_shand,m_print_graphs,!directload,cvp);
&m_cpls,p_BS,p_shand,m_print_graphs,!directload,cvp,m_ptypename+"/"+m_libname);
if (p_ampl->GetGraphNumber()==0) {
msg_Tracking()<<"AMEGIC::Single_Process::InitAmplitude : No diagrams for "<<m_name<<"."<<endl;
return 0;
......
......@@ -153,7 +153,7 @@ int AMEGIC::Single_Process_Combined::InitAmplitude(Amegic_Model * model,Topology
int ntchanmin(m_ntchanmin);
bool cvp(reader.GetValue<int>("AMEGIC_CUT_MASSIVE_VECTOR_PROPAGATORS",1));
p_ampl = new Amplitude_Handler(m_nin+m_nout,&m_flavs.front(),p_b,p_pinfo,model,top,m_maxcpl,m_mincpl,ntchanmin,
&m_cpls,p_BS,p_shand,m_print_graphs,!directload,cvp);
&m_cpls,p_BS,p_shand,m_print_graphs,!directload,cvp,m_ptypename+"/"+m_libname);
if (p_ampl->GetGraphNumber()==0) {
msg_Tracking()<<"AMEGIC::Single_Process_Combined::InitAmplitude : No diagrams for "<<m_name<<"."<<endl;
return 0;
......
......@@ -96,7 +96,7 @@ int AMEGIC::Single_Process_MHV::InitAmplitude(Amegic_Model * model,Topology* top
p_shand = new String_Handler(m_gen_str,p_BS,model->p_model->GetCouplings());
int ntchanmin(m_ntchanmin);
p_ampl = new Amplitude_Handler(m_nin+m_nout,&m_flavs.front(),p_b,p_pinfo,model,top,m_maxcpl,m_mincpl,ntchanmin,
&m_cpls,p_BS,p_shand,m_print_graphs,0,true);
&m_cpls,p_BS,p_shand,m_print_graphs,0,true,m_ptypename+"/"+m_libname);
if (p_ampl->GetGraphNumber()==0) {
msg_Tracking()<<"AMEGIC::Single_Process_MHV::InitAmplitude : No diagrams for "<<m_name<<"."<<endl;
return 0;
......
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