File indexing completed on 2024-12-10 02:31:53
0001 #ifndef IOMC_BetafuncEvtVtxGenerator_H
0002 #define IOMC_BetafuncEvtVtxGenerator_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include "IOMC/EventVertexGenerators/interface/BaseEvtVtxGenerator.h"
0022 #include "FWCore/Framework/interface/ESWatcher.h"
0023 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0024 #include "FWCore/Utilities/interface/ESGetToken.h"
0025 #include "CondFormats/DataRecord/interface/SimBeamSpotObjectsRcd.h"
0026 #include "CondFormats/BeamSpotObjects/interface/SimBeamSpotObjects.h"
0027
0028 namespace CLHEP {
0029 class HepRandomEngine;
0030 }
0031
0032 class BetafuncEvtVtxGenerator : public BaseEvtVtxGenerator {
0033 public:
0034 BetafuncEvtVtxGenerator(const edm::ParameterSet& p);
0035
0036 BetafuncEvtVtxGenerator(const BetafuncEvtVtxGenerator& p) = delete;
0037
0038 BetafuncEvtVtxGenerator& operator=(const BetafuncEvtVtxGenerator& rhs) = delete;
0039 ~BetafuncEvtVtxGenerator() override = default;
0040
0041 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0042
0043 void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0044
0045
0046 ROOT::Math::XYZTVector vertexShift(CLHEP::HepRandomEngine*) const override;
0047
0048 TMatrixD const* GetInvLorentzBoost() const override;
0049
0050
0051 void sigmaZ(double s = 1.0);
0052
0053
0054 void X0(double m = 0) { fX0 = m; }
0055
0056 void Y0(double m = 0) { fY0 = m; }
0057
0058 void Z0(double m = 0) { fZ0 = m; }
0059
0060
0061 void betastar(double m = 0) { fbetastar = m; }
0062
0063 void emittance(double m = 0) { femittance = m; }
0064
0065
0066 double BetaFunction(double z, double z0) const;
0067
0068 private:
0069 void setBoost(double alpha, double phi);
0070
0071 private:
0072 bool readDB_;
0073
0074 double fX0, fY0, fZ0;
0075 double fSigmaZ;
0076
0077 double fbetastar, femittance;
0078
0079 double fTimeOffset;
0080
0081 TMatrixD boost_;
0082
0083 void update(const edm::EventSetup& iEventSetup);
0084 edm::ESWatcher<SimBeamSpotObjectsRcd> parameterWatcher_;
0085 edm::ESGetToken<SimBeamSpotObjects, SimBeamSpotObjectsRcd> beamToken_;
0086 };
0087
0088 #endif