Skip to content

Commit 17721fb

Browse files
rename fTimeOffset to fTimeOffset_c_light and use correct gamma formula
1 parent d4a9b65 commit 17721fb

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

IOMC/EventVertexGenerators/interface/HLLHCEvtVtxGenerator.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ class HLLHCEvtVtxGenerator : public BaseEvtVtxGenerator {
5050

5151
private:
5252
// Configurable parameters
53-
double fMeanX, fMeanY, fMeanZ, fTimeOffset; //spatial and time offset for mean collision
54-
double fEProton; // proton beam energy
55-
double fCrossingAngle; // crossing angle
56-
double fCrabFrequency; // crab cavity frequency
57-
bool fRF800; // 800 MHz RF?
58-
double fBetaCrossingPlane; // beta crossing plane (m)
59-
double fBetaSeparationPlane; // beta separation plane (m)
60-
double fHorizontalEmittance; // horizontal emittance
61-
double fVerticalEmittance; // vertical emittance
62-
double fBunchLength; // bunch length
63-
double fCrabbingAngleCrossing; // crabbing angle crossing
64-
double fCrabbingAngleSeparation; // crabbing angle separation
53+
double fMeanX, fMeanY, fMeanZ, fTimeOffset_c_light; //spatial and time offset for mean collision
54+
double fEProton; // proton beam energy
55+
double fCrossingAngle; // crossing angle
56+
double fCrabFrequency; // crab cavity frequency
57+
bool fRF800; // 800 MHz RF?
58+
double fBetaCrossingPlane; // beta crossing plane (m)
59+
double fBetaSeparationPlane; // beta separation plane (m)
60+
double fHorizontalEmittance; // horizontal emittance
61+
double fVerticalEmittance; // vertical emittance
62+
double fBunchLength; // bunch length
63+
double fCrabbingAngleCrossing; // crabbing angle crossing
64+
double fCrabbingAngleSeparation; // crabbing angle separation
6565

6666
// Parameters inferred from configurables
6767
double gamma; // beam configurations

IOMC/EventVertexGenerators/src/HLLHCEvtVtxGenerator.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ HLLHCEvtVtxGenerator::HLLHCEvtVtxGenerator(const edm::ParameterSet& p) : BaseEvt
5454
fMeanX = p.getParameter<double>("MeanXIncm") * CLHEP::cm;
5555
fMeanY = p.getParameter<double>("MeanYIncm") * CLHEP::cm;
5656
fMeanZ = p.getParameter<double>("MeanZIncm") * CLHEP::cm;
57-
fTimeOffset = p.getParameter<double>("TimeOffsetInns") * CLHEP::ns * CLHEP::c_light;
57+
fTimeOffset_c_light = p.getParameter<double>("TimeOffsetInns") * CLHEP::ns * CLHEP::c_light;
5858
fEProton = p.getParameter<double>("EprotonInGeV") * 1e9;
5959
fCrossingAngle = p.getParameter<double>("CrossingAngleInurad") * 1e-6;
6060
fCrabFrequency = p.getParameter<double>("CrabFrequencyInMHz") * 1e6;
@@ -67,7 +67,7 @@ HLLHCEvtVtxGenerator::HLLHCEvtVtxGenerator(const edm::ParameterSet& p) : BaseEvt
6767
fCrabbingAngleCrossing = p.getParameter<double>("CrabbingAngleCrossingInurad") * 1e-6;
6868
fCrabbingAngleSeparation = p.getParameter<double>("CrabbingAngleSeparationInurad") * 1e-6;
6969
// Set parameters inferred from configurables
70-
gamma = fEProton / pmass + 1.0;
70+
gamma = fEProton / pmass;
7171
beta = std::sqrt((1.0 - 1.0 / gamma) * ((1.0 + 1.0 / gamma)));
7272
betagamma = beta * gamma;
7373
oncc = fCrabbingAngleCrossing / fCrossingAngle;
@@ -106,9 +106,9 @@ void HLLHCEvtVtxGenerator::update(const edm::EventSetup& iEventSetup) {
106106
fBunchLength = beamhandle->bunchLenght();
107107
fCrabbingAngleCrossing = beamhandle->crabbingAngleCrossing() * 1e-6;
108108
fCrabbingAngleSeparation = beamhandle->crabbingAngleSeparation() * 1e-6;
109-
fTimeOffset = beamhandle->timeOffset() * CLHEP::ns * CLHEP::c_light;
109+
fTimeOffset_c_light = beamhandle->timeOffset() * CLHEP::ns * CLHEP::c_light;
110110
// Set parameters inferred from configurables
111-
gamma = fEProton / pmass + 1.0;
111+
gamma = fEProton / pmass;
112112
beta = std::sqrt((1.0 - 1.0 / gamma) * ((1.0 + 1.0 / gamma)));
113113
betagamma = beta * gamma;
114114
oncc = fCrabbingAngleCrossing / fCrossingAngle;
@@ -153,7 +153,7 @@ HepMC::FourVector HLLHCEvtVtxGenerator::newVertex(CLHEP::HepRandomEngine* engine
153153
x += fMeanX;
154154
y += fMeanY;
155155
z += fMeanZ;
156-
t += fTimeOffset;
156+
t += fTimeOffset_c_light;
157157

158158
return HepMC::FourVector(x, y, z, t);
159159
}

0 commit comments

Comments
 (0)