9 #include <generators/bhwide/BHWide.h>
10 #include <framework/gearbox/Unit.h>
12 #include <TDatabasePDG.h>
13 #include <Math/Vector4D.h>
31 void bhwide_(
int* mode,
double* xpar,
int* npar);
32 void glimit_(
int* number);
39 void varran_(
double* drvec,
const int* lengt)
41 for (
int i = 0; i < *lengt; ++i) {
45 drvec[i] = gRandom->Rndm();
46 }
while (drvec[i] >= 1.0);
53 void ranmar_(
double* rvec)
55 *rvec = gRandom->Rndm();
62 for (
int i = 0; i < 100; ++i) {
68 m_crossSectionError = 0.;
80 void BHWide::setDefaultSettings()
83 m_zContribution =
true;
86 m_randomGenerator = RG_RANMAR;
87 m_weakCorrections =
true;
88 m_ewCorrectionLib = EC_ALIBABA;
89 m_hardBremsModel = HM_CALKUL;
90 m_photonVacPol = PP_BURKHARDT;
92 m_cmsEnergy = 10.58 * Unit::GeV;
93 m_ScatteringAngleRangePositron = make_pair(17.0, 150.0);
94 m_ScatteringAngleRangeElectron = make_pair(17.0, 150.0);
95 m_minEnergyFinalStatePos = 0.2 * Unit::GeV;
96 m_minEnergyFinalStateElc = 0.2 * Unit::GeV;
97 m_maxAcollinearity = 10.0;
98 m_infCutCMSEnergy = 1e-5;
99 m_maxRejectionWeight = 3.0;
100 m_massZ = 91.1882 * Unit::GeV;
103 m_massTop = 174.3 * Unit::GeV;
104 m_massHiggs = 115.0 * Unit::GeV;
116 void BHWide::generateEvent(
MCParticleGraph& mcGraph, ROOT::Math::XYZVector vertex, ROOT::Math::LorentzRotation boost)
120 bhwide_(&mode, m_xpar, m_npar);
123 storeParticle(mcGraph, momset_.q1, 11, vertex, boost,
true);
124 storeParticle(mcGraph, momset_.p1, -11, vertex, boost,
true);
127 storeParticle(mcGraph, momset_.q2, 11, vertex, boost);
128 storeParticle(mcGraph, momset_.p2, -11, vertex, boost);
131 for (
int iPhot = 0; iPhot < momset_.nphot; ++iPhot) {
132 double photMom[4] = {momset_.phit[0][iPhot], momset_.phit[1][iPhot], momset_.phit[2][iPhot], momset_.phit[3][iPhot]};
133 storeParticle(mcGraph, photMom, 22, vertex, boost);
141 bhwide_(&mode, m_xpar, m_npar);
144 m_crossSection = m_xpar[9];
145 m_crossSectionError = m_xpar[10];
152 void BHWide::applySettings()
158 if (m_zContribution) keyZof = 0;
160 m_npar[0] = (1000 * keyZof) + (100 * m_channel) + (10 * m_weighted) + m_randomGenerator;
161 m_npar[1] = (1000 * m_weakCorrections) + (100 * m_ewCorrectionLib) + (10 * m_hardBremsModel) + m_photonVacPol;
166 m_xpar[0] = m_cmsEnergy;
167 m_xpar[1] = m_ScatteringAngleRangePositron.first;
168 m_xpar[2] = m_ScatteringAngleRangePositron.second;
169 m_xpar[3] = m_ScatteringAngleRangeElectron.first;
170 m_xpar[4] = m_ScatteringAngleRangeElectron.second;
171 m_xpar[5] = m_minEnergyFinalStatePos;
172 m_xpar[6] = m_minEnergyFinalStateElc;
173 m_xpar[7] = m_maxAcollinearity;
174 m_xpar[8] = m_infCutCMSEnergy;
175 m_xpar[9] = m_maxRejectionWeight;
176 m_xpar[10] = m_massZ;
177 m_xpar[11] = m_widthZ;
178 m_xpar[12] = m_sinW2;
179 m_xpar[13] = m_massTop;
180 m_xpar[14] = m_massHiggs;
183 bhwide_(&mode, m_xpar, m_npar);
187 void BHWide::storeParticle(
MCParticleGraph& mcGraph,
const double* mom,
int pdg, ROOT::Math::XYZVector vertex,
188 ROOT::Math::LorentzRotation boost,
189 bool isVirtual,
bool isInitial)
202 part.setStatus(MCParticle::c_IsVirtual);
203 }
else if (isInitial) {
204 part.setStatus(MCParticle::c_Initial);
208 part.addStatus(MCParticle::c_PrimaryParticle);
211 part.addStatus(MCParticle::c_StableInGenerator);
214 if (pdg == 22 && !isVirtual) {
215 part.addStatus(MCParticle::c_IsISRPhoton);
216 part.addStatus(MCParticle::c_IsFSRPhoton);
220 part.setFirstDaughter(0);
221 part.setLastDaughter(0);
222 part.setMomentum(ROOT::Math::XYZVector(mom[0], mom[1], mom[2]));
223 part.setMass(TDatabasePDG::Instance()->GetParticle(pdg)->Mass());
224 part.setEnergy(mom[3]);
227 ROOT::Math::PxPyPzEVector p4 = part.get4Vector();
228 p4.SetPz(-1.0 * p4.Pz());
234 ROOT::Math::XYZVector v3 = part.getProductionVertex();
236 part.setProductionVertex(v3);
237 part.setValidVertex(
true);
Class to represent Particle data in graph.
Class to build, validate and sort a particle decay chain.
GraphParticle & addParticle()
Add new particle to the graph.
Abstract base class for different kinds of events.