62 : changeFrame_(iconf.getParameter<
bool>(
"changeToCMSCoordinates")),
63 theMaxZ(iconf.getParameter<double>(
"maxZ")),
64 theSetSigmaZ(iconf.getParameter<double>(
"setSigmaZ")),
65 useTransientRecord_(iconf.getParameter<
bool>(
"useTransientRecord")),
71 theBeamShoutMode(iconf.getUntrackedParameter<unsigned
int>(
"beamMode", 11)) {
75 produces<reco::BeamSpot>();
80 ps.
add<
bool>(
"changeToCMSCoordinates",
false);
81 ps.
add<
double>(
"maxZ", 40.);
82 ps.
add<
double>(
"setSigmaZ", -1.);
86 ps.
add<
double>(
"maxRadius", 2.0);
87 ps.
add<
bool>(
"useTransientRecord",
false);
93 auto result = std::make_unique<reco::BeamSpot>();
96 bool shoutMODE =
false;
104 bool fallBackToDB =
false;
107 if (spotDB.beamType() != 2) {
110 <<
"Online Beam Spot producer falls back to DB value because the ESProducer returned a fake beamspot ";
128 double sigmaZ = spotDB.sigmaZ();
134 aSpot.setBeamWidthY(spotDB.beamWidthY());
135 aSpot.setEmittanceX(spotDB.emittanceX());
136 aSpot.setEmittanceY(spotDB.emittanceY());
137 aSpot.setbetaStar(spotDB.betaStar());
149 auto result = std::make_unique<reco::BeamSpot>();
151 if (!handleScaler->empty()) {
153 spotOnline = *(handleScaler->begin());
175 aSpot.setBeamWidthY(spotOnline.
width_y());
176 aSpot.setEmittanceX(0.);
177 aSpot.setEmittanceY(0.);
178 aSpot.setbetaStar(0.);
182 if (spotOnline.
x() == 0 && spotOnline.
y() == 0 && spotOnline.
z() == 0 && spotOnline.
width_x() == 0 &&
186 <<
"Online Beam Spot producer falls back to DB value because the scaler values are zero ";
190 double r2 = spotOnline.
x() * spotOnline.
x() + spotOnline.
y() * spotOnline.
y();
194 <<
"Online Beam Spot producer falls back to DB value because the scaler values are too big to be true :" 195 << spotOnline.
x() <<
" " << spotOnline.
y() <<
" " << spotOnline.
z();
224 aSpot.setbetaStar(spotDB->
betaStar());
228 if ((bse.cxx() <= 0.) || (bse.cyy() <= 0.) || (bse.czz() <= 0.)) {
229 edm::LogError(
"UnusableBeamSpot") <<
"Beamspot from fallback to DB with invalid errors: " << aSpot.covariance();
double emittanceX() const
get emittance
std::vector< BeamSpotOnline > BeamSpotOnlineCollection
math::Error< dimension >::type CovarianceMatrix
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
double z() const
get Z beam position
const edm::ESGetToken< BeamSpotObjects, BeamSpotTransientObjectsRcd > beamTransientToken_
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
const cms_uint16_t beamMode() const
double dydz() const
get dydz slope, crossing angle in YZ
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
double covariance(int i, int j) const
get i,j element of the full covariance matrix 7x7
const double theSetSigmaZ
const edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > l1GtEvmReadoutRecordToken_
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
produce a beam spot class
BeamSpotOnlineProducer(const edm::ParameterSet &iConf)
constructor
const edm::EDGetTokenT< BeamSpotOnlineCollection > scalerToken_
const L1GtfeExtWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
math::XYZPoint Point
point in the space
double beamWidthX() const
get average transverse beam width
Log< level::Error, false > LogError
float err_sigma_z() const
const edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcd > beamToken_
T const * product() const
Abs< T >::type abs(const T &t)
double x() const
get X beam position
edm::ESWatcher< BeamSpotTransientObjectsRcd > beamTransientRcdESWatcher_
#define DEFINE_FWK_MODULE(type)
const unsigned int theBeamShoutMode
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
double beamWidthY() const
get average transverse beam width
double y() const
get Y beam position
static void fillDescriptions(edm::ConfigurationDescriptions &iDesc)
Fill descriptor.
const bool useTransientRecord_
double sigmaZ() const
get sigma Z, RMS bunch length
bool check(const edm::EventSetup &iSetup)
double emittanceY() const
get emittance
double betaStar() const
get beta star
Log< level::Warning, false > LogWarning
double dxdz() const
get dxdz slope, crossing angle in XZ