PS_Output PS(PS_Input In) { PS_Output Out; float z = (In.ViewPos.z - NearFarPlane.x)/(NearFarPlane.y - NearFarPlane.x); float3 n = normalize(In.Normal); Out.Color0.a = WeightFunc(z, In.Color.a) * In.Color.a; Out.Color0.xyz = Phong(0.0, 0.0, In.ViewPos, n, In.Color.xyz) * Out.Color0.a; Out.Color1 = 1.0 - In.Color.a; return Out; }
void Exhume::Event::Generate(){ bool pass = false; do{ SelectValues(); Process->SetKinematics(SqrtsHat, Eta, t1, t2, Phi1, Phi2); Process->SetSubParameters(); Process->SetPartons(); CSi = Process->Differential(); wgt = GetFunc(SqrtsHat); CSMass += wgt; double ebt = exp(B*(t1+t2-t1Max-t2Max))* Process->SubParameterWeight(); wgt = 1.1*wgt*ebt; if(CSi>wgt){//Don't want this to happen very often - it is slow. //Choose your cuts sensibly! Process->MaximiseSubParameters(); wgt = WeightFunc(SqrtsHat); AddPoint(SqrtsHat,wgt); wgt = 1.1*wgt*ebt; Process->SetKinematics(SqrtsHat, Eta, t1, t2, Phi1, Phi2); Process->SetSubParameters(); } CSi = CSi/wgt; Sigmai +=CSi; if(CSi>VonNeu){ if(CSi>1.0){//Then it has cocked it up completely std::map<double, double> FuncMap_ = GetFuncMap(); std::map<double, double> LineShape_ = GetLineShape(); FILE * dat = fopen("FuncMap.dat","w"); for(std::map<double, double>::iterator kk = FuncMap_.begin(); kk !=FuncMap_.end(); kk++){ //fprintf(dat,"%le\t%le\n",kk->first, kk->second); fprintf(dat,"%e\t%e\n",kk->first, kk->second); } fclose(dat); dat = fopen("LineShape.dat","w"); for(std::map<double, double>::iterator kk = LineShape_.begin(); kk!=LineShape_.end(); kk++){ //fprintf(dat, "%le\t%le\n",kk->first, kk->second); fprintf(dat, "%e\t%e\n",kk->first, kk->second); } fclose(dat); std::cout<<" This should never happen"<<std::endl; std::cout<<" m = "<<SqrtsHat<<std::endl; std::cout<<" y = "<<Eta<<std::endl; std::cout<<" t1 = "<<t1<<std::endl; std::cout<<" t2 = "<<t2<<std::endl; std::cout<<" x1 = "<<Process->Getx1()<<std::endl; std::cout<<" x2 = "<<Process->Getx2()<<std::endl; std::cout<<" CSi = "<<CSi*wgt<<std::endl; std::cout<<" wgt = "<<wgt<<std::endl; std::cout<< " Please e-mail the authors."<<std::endl<< " Include the files FuncMap.dat and LineShape.dat"<<std::endl; exit(0); } pass = true; NumberOfEvents++; TotalAttempts++; Var.push_back(std::pair<double, double> (TotalAttempts * TotalIntegral, Sigmai) ); }else{ TotalAttempts++; } }while(!pass); }