14 #ifndef Pythia8_SetLHEDecayProductHooks_H 15 #define Pythia8_SetLHEDecayProductHooks_H 18 #include "Pythia8/Pythia.h" 19 #include "Pythia8/UserHooks.h" 20 #include "Pythia8/Event.h" 38 unsigned long int returnCounter() {
return counter;};
43 double m0powheg(
const int idIn) {
46 case 3: mReturn=0.2;
break;
47 case 4: mReturn=1.5;
break;
48 case 1: mReturn=0.1;
break;
49 case 2: mReturn=0.1;
break;
50 default: mReturn = pdtPtr->m0(idIn);
break;
58 unsigned long int counter;
68 pdtPtr(pdtPtrIn), counter(0) {
69 settings.
addFlag(
"SetLHEDecayProduct:filter",
false);
87 if (!filter)
return false;
92 int newCol = process.nextColTag();
95 for (
int i = 0; i < process.
size(); ++i) {
96 if (process[i].idAbs() == 24 && process[i].status() == -22) {
98 if( countW > 2 )
break;
99 int idFermion = ( hadronW == countW ) ? idQuark : 11 ;
101 int idV = process[i].id();
102 int i1 = process[i].daughter1();
103 int i2 = process[i].daughter2();
104 int id1 = process[i1].idAbs();
105 int id2 = process[i2].idAbs();
106 if( id1 == idFermion || id2 == idFermion )
continue;
108 double mV = process[i].m();
109 Vec4 p1 = process[i1].p();
111 double pMag = p1.pAbs();
115 if (process[i1].
id() * idV > 0) swap( i1, i2);
116 process[i1].id(idFermion * process[i1].
id()/abs(process[i1].
id()) );
117 process[i2].id((idFermion+1) * process[i2].
id()/abs(process[i2].
id()) );
118 if( idFermion != 11 ) {
119 if( process[i1].
id() > 0 ) {
120 process[i1].col(newCol);
121 process[i2].acol(newCol);
124 process[i2].col(newCol);
125 process[i1].acol(newCol);
129 double m1 = m0powheg(process[i1].idAbs());
130 double m2 = m0powheg(process[i2].idAbs());
134 double pA = sqrt(
pow2(e1) -
pow2(m1));
141 p1.
bst( process[i].p() );
142 p2.
bst( process[i].p() );
constexpr double pow2(const double &x)
Powers of small integers - for balance speed/code clarity.
Definition: PythiaStdlib.h:182
bool flag(string keyIn)
Give back current value, with check that key exists.
Definition: Settings.cc:1478
Settings * settingsPtr
Pointer to the settings database.
Definition: PhysicsBase.h:81
void bstback(const Vec4 &pIn)
Boost given by a Vec4 p; boost in opposite direction.
Definition: Basics.cc:509
void rescale3(double fac)
Member functions that perform operations.
Definition: Basics.h:95
Definition: SetLHEDecayProductHook.h:24
The Event class holds all info on the generated event.
Definition: Event.h:453
bool canVetoProcessLevel() override
Override base class methods.
Definition: SetLHEDecayProductHook.h:31
bool initAfterBeams() override
Intialize the user hook after the beams.
Definition: SetLHEDecayProductHook.h:76
Rndm * rndmPtr
Pointer to the random number generator.
Definition: PhysicsBase.h:93
SetLHEDecayProductHook(Settings &settings, const ParticleData *pdtPtrIn)
Constructor.
Definition: SetLHEDecayProductHook.h:66
void bst(double betaX, double betaY, double betaZ)
Boost (simple).
Definition: Basics.cc:434
int size() const
Event record size.
Definition: Event.h:504
double m2(const Vec4 &v1)
The squared invariant mass of one or more four-vectors.
Definition: Basics.cc:605
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
bool checkVetoProcessLevel(Event &process)
Class specific.
Definition: SetLHEDecayProductHook.h:85
UserHooks is base class for user access to program execution.
Definition: UserHooks.h:32
bool doVetoProcessLevel(Event &process) override
Definition: SetLHEDecayProductHook.h:32
double flat()
Generate next random number uniformly between 0 and 1.
Definition: Basics.cc:189
This class holds a map of all ParticleDataEntries.
Definition: ParticleData.h:422
Definition: Settings.h:195
void addFlag(string keyIn, bool defaultIn)
Add new entry.
Definition: Settings.h:267