CMS 3D CMS Logo

CTPPSBeamParametersFromLHCInfoESSource.cc
Go to the documentation of this file.
1 /****************************************************************************
2  * Authors:
3  * Wagner Carvalho wcarvalh@cern.ch
4  * Jan Kašpar
5  ****************************************************************************/
6 
10 
15 
18 
20 
22 
23 //----------------------------------------------------------------------------------------------------
24 
26 public:
28  ~CTPPSBeamParametersFromLHCInfoESSource() override = default;
29 
30  std::unique_ptr<CTPPSBeamParameters> produce(const CTPPSBeamParametersRcd&);
32 
33 private:
35 
37 };
38 
39 //----------------------------------------------------------------------------------------------------
40 
42  : lhcInfoToken_(
43  setWhatProduced(this).consumes(edm::ESInputTag("", iConfig.getParameter<std::string>("lhcInfoLabel")))) {
44  defaultParameters_.setBeamDivergenceX45(iConfig.getParameter<double>("beamDivX45"));
45  defaultParameters_.setBeamDivergenceY45(iConfig.getParameter<double>("beamDivX56"));
46  defaultParameters_.setBeamDivergenceX56(iConfig.getParameter<double>("beamDivY45"));
47  defaultParameters_.setBeamDivergenceY56(iConfig.getParameter<double>("beamDivY56"));
48 
49  defaultParameters_.setVtxOffsetX45(iConfig.getParameter<double>("vtxOffsetX45"));
50  defaultParameters_.setVtxOffsetY45(iConfig.getParameter<double>("vtxOffsetY45"));
51  defaultParameters_.setVtxOffsetZ45(iConfig.getParameter<double>("vtxOffsetZ45"));
52  defaultParameters_.setVtxOffsetX56(iConfig.getParameter<double>("vtxOffsetX56"));
53  defaultParameters_.setVtxOffsetY56(iConfig.getParameter<double>("vtxOffsetY56"));
54  defaultParameters_.setVtxOffsetZ56(iConfig.getParameter<double>("vtxOffsetZ56"));
55 
56  defaultParameters_.setVtxStddevX(iConfig.getParameter<double>("vtxStddevX"));
57  defaultParameters_.setVtxStddevY(iConfig.getParameter<double>("vtxStddevY"));
58  defaultParameters_.setVtxStddevZ(iConfig.getParameter<double>("vtxStddevZ"));
59 }
60 
61 //----------------------------------------------------------------------------------------------------
62 
63 std::unique_ptr<CTPPSBeamParameters> CTPPSBeamParametersFromLHCInfoESSource::produce(
64  const CTPPSBeamParametersRcd& iRecord) {
65  LHCInfo const& lhcInfo = iRecord.get(lhcInfoToken_);
66 
67  auto bp = std::make_unique<CTPPSBeamParameters>(defaultParameters_);
68 
69  const auto beamMom = lhcInfo.energy();
70  const auto betaStar = lhcInfo.betaStar() * 1E2; // conversion m --> cm
71  const auto xangle = lhcInfo.crossingAngle() * 1E-6; // conversion mu rad --> rad
72 
73  bp->setBeamMom45(beamMom);
74  bp->setBeamMom56(beamMom);
75 
76  bp->setBetaStarX45(betaStar);
77  bp->setBetaStarX56(betaStar);
78  bp->setBetaStarY45(betaStar);
79  bp->setBetaStarY56(betaStar);
80 
81  bp->setHalfXangleX45(xangle);
82  bp->setHalfXangleX56(xangle);
83  bp->setHalfXangleY45(xangle);
84  bp->setHalfXangleY56(xangle);
85 
86  return bp;
87 }
88 
89 //----------------------------------------------------------------------------------------------------
90 
93 
94  desc.add<std::string>("lhcInfoLabel", "");
95 
96  // beam divergence (rad)
97  desc.add<double>("beamDivX45", 0.1);
98  desc.add<double>("beamDivY45", 0.1);
99  desc.add<double>("beamDivX56", 0.1);
100  desc.add<double>("beamDivY56", 0.1);
101 
102  // vertex offset (cm)
103  desc.add<double>("vtxOffsetX45", 1.e-2);
104  desc.add<double>("vtxOffsetY45", 1.e-2);
105  desc.add<double>("vtxOffsetZ45", 1.e-2);
106  desc.add<double>("vtxOffsetX56", 1.e-2);
107  desc.add<double>("vtxOffsetY56", 1.e-2);
108  desc.add<double>("vtxOffsetZ56", 1.e-2);
109 
110  // vertex sigma (cm)
111  desc.add<double>("vtxStddevX", 2.e-2);
112  desc.add<double>("vtxStddevY", 2.e-2);
113  desc.add<double>("vtxStddevZ", 2.e-2);
114 
115  descriptions.add("ctppsBeamParametersFromLHCInfoESSource", desc);
116 }
117 
118 //----------------------------------------------------------------------------------------------------
119 
LHCInfo::energy
const float energy() const
Definition: LHCInfo.cc:190
CTPPSBeamParameters
Definition: CTPPSBeamParameters.h:22
CTPPSBeamParameters::setVtxOffsetY56
void setVtxOffsetY56(double offset)
Definition: CTPPSBeamParameters.cc:112
CTPPSBeamParametersFromLHCInfoESSource::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: CTPPSBeamParametersFromLHCInfoESSource.cc:91
CTPPSBeamParameters.h
CTPPSBeamParameters::setVtxStddevX
void setVtxStddevX(double stddev)
Definition: CTPPSBeamParameters.cc:116
CTPPSBeamParametersRcd.h
MessageLogger.h
ESHandle.h
ESInputTag
BeamSpotFakeParameters_cfi.betaStar
betaStar
Definition: BeamSpotFakeParameters_cfi.py:19
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
LHCInfo.h
ESProducer.h
CTPPSBeamParameters::setVtxOffsetZ45
void setVtxOffsetZ45(double offset)
Definition: CTPPSBeamParameters.cc:109
LHCInfo
Definition: LHCInfo.h:12
CTPPSBeamParameters::setVtxOffsetY45
void setVtxOffsetY45(double offset)
Definition: CTPPSBeamParameters.cc:108
CTPPSBeamParameters::setVtxStddevY
void setVtxStddevY(double stddev)
Definition: CTPPSBeamParameters.cc:117
CTPPSBeamParameters::setBeamDivergenceY56
void setBeamDivergenceY56(double div)
Definition: CTPPSBeamParameters.cc:100
CTPPSBeamParametersFromLHCInfoESSource::CTPPSBeamParametersFromLHCInfoESSource
CTPPSBeamParametersFromLHCInfoESSource(const edm::ParameterSet &)
Definition: CTPPSBeamParametersFromLHCInfoESSource.cc:41
MakerMacros.h
LHCInfo::crossingAngle
const float crossingAngle() const
Definition: LHCInfo.cc:182
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
OpticalFunctionsConfig_cfi.xangle
xangle
Definition: OpticalFunctionsConfig_cfi.py:17
SourceFactory.h
edm::ParameterSet
Definition: ParameterSet.h:47
CTPPSBeamParameters::setBeamDivergenceX56
void setBeamDivergenceX56(double div)
Definition: CTPPSBeamParameters.cc:99
edm::ESGetToken< LHCInfo, LHCInfoRcd >
CTPPSBeamParameters::setVtxOffsetX56
void setVtxOffsetX56(double offset)
Definition: CTPPSBeamParameters.cc:111
CTPPSBeamParametersRcd
Definition: CTPPSBeamParametersRcd.h:14
CTPPSBeamParameters::setBeamDivergenceY45
void setBeamDivergenceY45(double div)
Definition: CTPPSBeamParameters.cc:98
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
std
Definition: JetResolutionObject.h:76
CTPPSBeamParameters::setVtxOffsetZ56
void setVtxOffsetZ56(double offset)
Definition: CTPPSBeamParameters.cc:113
CTPPSBeamParametersFromLHCInfoESSource
Definition: CTPPSBeamParametersFromLHCInfoESSource.cc:25
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
CTPPSBeamParameters::setVtxOffsetX45
void setVtxOffsetX45(double offset)
Definition: CTPPSBeamParameters.cc:107
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESProducer
Definition: ESProducer.h:104
CTPPSBeamParametersFromLHCInfoESSource::produce
std::unique_ptr< CTPPSBeamParameters > produce(const CTPPSBeamParametersRcd &)
Definition: CTPPSBeamParametersFromLHCInfoESSource.cc:63
ParameterSet.h
LHCInfoRcd.h
LHCInfo::betaStar
const float betaStar() const
Definition: LHCInfo.cc:184
CTPPSBeamParameters::setBeamDivergenceX45
void setBeamDivergenceX45(double div)
Definition: CTPPSBeamParameters.cc:97
CTPPSBeamParametersFromLHCInfoESSource::~CTPPSBeamParametersFromLHCInfoESSource
~CTPPSBeamParametersFromLHCInfoESSource() override=default
CTPPSBeamParametersFromLHCInfoESSource::lhcInfoToken_
const edm::ESGetToken< LHCInfo, LHCInfoRcd > lhcInfoToken_
Definition: CTPPSBeamParametersFromLHCInfoESSource.cc:37
CTPPSBeamParameters::setVtxStddevZ
void setVtxStddevZ(double stddev)
Definition: CTPPSBeamParameters.cc:118
CTPPSBeamParametersFromLHCInfoESSource::defaultParameters_
CTPPSBeamParameters defaultParameters_
Definition: CTPPSBeamParametersFromLHCInfoESSource.cc:39