File indexing completed on 2024-09-27 07:03:39
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #include <iostream>
0035 #include <fstream>
0036 #include <cmath>
0037
0038 #include "eventchannel.h"
0039
0040
0041 using namespace std;
0042
0043
0044
0045 eventChannel::eventChannel(const inputParameters& inputParametersInstance, beamBeamSystem& bbsystem)
0046 : readLuminosity(inputParametersInstance),
0047 _bbs(bbsystem),
0048 _nmbAttempts(0),
0049 _nmbAccepted(0),
0050 _totalChannelCrossSection(0)
0051 {
0052 _ptCutEnabled = inputParametersInstance.ptCutEnabled();
0053 _ptCutMin = inputParametersInstance.ptCutMin();
0054 _ptCutMax = inputParametersInstance.ptCutMax();
0055 _etaCutEnabled = inputParametersInstance.etaCutEnabled();
0056 _etaCutMin = inputParametersInstance.etaCutMin();
0057 _etaCutMax = inputParametersInstance.etaCutMax();
0058 _randy.SetSeed(inputParametersInstance.randomSeed());
0059 }
0060
0061
0062
0063 eventChannel::~eventChannel()
0064 { }
0065
0066
0067
0068 void
0069 eventChannel::transform(const double betax,
0070 const double betay,
0071 const double betaz,
0072 double& E,
0073 double& px,
0074 double& py,
0075 double& pz,
0076 int& iFbadevent)
0077 {
0078
0079 const double E0 = E;
0080 const double px0 = px;
0081 const double py0 = py;
0082 const double pz0 = pz;
0083
0084 const double beta = sqrt(betax * betax + betay * betay + betaz * betaz);
0085 if (beta >= 1)
0086 iFbadevent = 1;
0087 const double gamma = 1. / sqrt(1. - beta * beta);
0088 const double gob = (gamma - 1) / (beta * beta);
0089
0090 E = gamma * (E0 - betax * px0 - betay * py0 - betaz* pz0);
0091 px = -gamma * betax * E0 + (1. + gob * betax * betax) * px0
0092 + gob * betax * betay * py0 + gob * betax * betaz * pz0;
0093 py = -gamma * betay * E0 + gob * betay * betax * px0
0094 + (1. + gob * betay * betay) * py0 + gob * betay * betaz *pz0;
0095 pz = -gamma * betaz * E0 + gob * betaz * betax * px0
0096 + gob * betaz * betay * py0 + (1. + gob * betaz * betaz) * pz0;
0097 }
0098
0099
0100
0101 double
0102 eventChannel::pseudoRapidity(const double px,
0103 const double py,
0104 const double pz)
0105 {
0106 const double pT= sqrt(px * px + py * py);
0107 const double p = sqrt(pz * pz + pT * pT);
0108 double eta = -99.9;
0109 if ((p - pz) != 0)
0110 eta = 0.5 * log((p + pz)/(p - pz));
0111 return eta;
0112 }
0113