61 : changeFrame_(iconf.getParameter<bool>(
"changeToCMSCoordinates")),
62 theMaxZ(iconf.getParameter<double>(
"maxZ")),
63 theSetSigmaZ(iconf.getParameter<double>(
"setSigmaZ")),
64 useTransientRecord_(iconf.getParameter<bool>(
"useTransientRecord")),
69 theBeamShoutMode(iconf.getUntrackedParameter<unsigned int>(
"beamMode", 11)) {
73 produces<reco::BeamSpot>();
78 ps.
add<
bool>(
"changeToCMSCoordinates",
false);
79 ps.
add<
double>(
"maxZ", 40.);
80 ps.
add<
double>(
"setSigmaZ", -1.);
84 ps.
add<
double>(
"maxRadius", 2.0);
85 ps.
add<
bool>(
"useTransientRecord",
false);
91 auto result = std::make_unique<reco::BeamSpot>();
94 bool shoutMODE =
false;
102 bool fallBackToDB =
false;
105 if (spotDB.GetBeamType() != 2) {
108 <<
"Online Beam Spot producer falls back to DB value because the ESProducer returned a fake beamspot ";
121 for (
int i = 0;
i < 7; ++
i) {
122 for (
int j = 0;
j < 7; ++
j) {
126 double sigmaZ = spotDB.GetSigmaZ();
131 aSpot =
reco::BeamSpot(apoint, sigmaZ, spotDB.Getdxdz(), spotDB.Getdydz(), spotDB.GetBeamWidthX(),
matrix);
132 aSpot.setBeamWidthY(spotDB.GetBeamWidthY());
133 aSpot.setEmittanceX(spotDB.GetEmittanceX());
134 aSpot.setEmittanceY(spotDB.GetEmittanceY());
135 aSpot.setbetaStar(spotDB.GetBetaStar());
147 auto result = std::make_unique<reco::BeamSpot>();
149 if (!handleScaler->empty()) {
151 spotOnline = *(handleScaler->begin());
173 aSpot.setBeamWidthY(spotOnline.
width_y());
174 aSpot.setEmittanceX(0.);
175 aSpot.setEmittanceY(0.);
176 aSpot.setbetaStar(0.);
180 if (spotOnline.
x() == 0 && spotOnline.
y() == 0 && spotOnline.
z() == 0 && spotOnline.
width_x() == 0 &&
184 <<
"Online Beam Spot producer falls back to DB value because the scaler values are zero ";
188 double r2 = spotOnline.
x() * spotOnline.
x() + spotOnline.
y() * spotOnline.
y();
192 <<
"Online Beam Spot producer falls back to DB value because the scaler values are too big to be true :"
193 << spotOnline.
x() <<
" " << spotOnline.
y() <<
" " << spotOnline.
z();
211 for (
int i = 0;
i < 7; ++
i) {
212 for (
int j = 0;
j < 7; ++
j) {
double Getdydz() const
get dydz slope, crossing angle in YZ
std::vector< BeamSpotOnline > BeamSpotOnlineCollection
math::Error< dimension >::type CovarianceMatrix
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::ESGetToken< BeamSpotObjects, BeamSpotTransientObjectsRcd > beamTransientToken_
double GetY() const
get Y beam position
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
const double theSetSigmaZ
const edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > l1GtEvmReadoutRecordToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
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_
double GetSigmaZ() const
get sigma Z, RMS bunch length
double GetBeamWidthX() const
get average transverse beam width
math::XYZPoint Point
point in the space
Log< level::Error, false > LogError
double GetBeamWidthY() const
get average transverse beam width
double GetEmittanceX() const
get emittance
bool getData(T &iHolder) const
const edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcd > beamToken_
Abs< T >::type abs(const T &t)
double GetZ() const
get Z beam position
edm::ESWatcher< BeamSpotTransientObjectsRcd > beamTransientRcdESWatcher_
const unsigned int theBeamShoutMode
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double Getdxdz() const
get dxdz slope, crossing angle in XZ
double GetX() const
get X beam position
static void fillDescriptions(edm::ConfigurationDescriptions &iDesc)
Fill descriptor.
const bool useTransientRecord_
T const * product() const
T getParameter(std::string const &) const
double GetBetaStar() const
get beta star
bool check(const edm::EventSetup &iSetup)
double GetCovariance(int i, int j) const
get i,j element of the full covariance matrix 7x7
double GetEmittanceY() const
get emittance
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Log< level::Warning, false > LogWarning
float err_sigma_z() const