61 template <
class Record>
71 const bool isFullPixel =
false);
108 fIsHLT_(iConfig.getParameter<
bool>(
"isHLT")),
109 fullPixel_(iConfig.getParameter<
bool>(
"useFullPixel")),
113 xShift_(iConfig.getParameter<double>(
"xShift")),
114 yShift_(iConfig.getParameter<double>(
"yShift")),
115 zShift_(iConfig.getParameter<double>(
"zShift")) {
116 if (iConfig.
exists(
"IOVStartRun") && iConfig.
exists(
"IOVStartLumi")) {
121 edm::LogPrint(
"BeamSpotOnlineShifter") <<
"useNewSince = True";
124 edm::LogPrint(
"BeamSpotOnlineShifter") <<
"useNewSince = False";
126 fLabel_ = (
fIsHLT_) ?
"BeamSpotOnlineHLTObjectsRcd" :
"BeamSpotOnlineLegacyObjectsRcd";
141 return ((
uint64_t)fIOVStartRun << 32 | fIOVStartLumi);
144 template <
class Record>
169 for (
unsigned int i = 0;
i < 7;
i++) {
170 for (
unsigned int j = 0;
j < 7;
j++) {
199 edm::LogPrint(
"BeamSpotOnlineShifter") <<
" Writing results to DB...";
204 edm::LogPrint(
"BeamSpotOnlineShifter") <<
"poolDBService available";
206 edm::LogPrint(
"BeamSpotOnlineShifter") <<
"new tag requested";
213 edm::LogPrint(
"BeamSpotOnlineShifter") <<
"no new tag requested";
216 iEvent.getLuminosityBlock().luminosityBlock());
217 edm::LogPrint(
"BeamSpotOnlineShifter") <<
"Using a new Since: " << thisSince;
223 edm::LogPrint(
"BeamSpotOnlineShifter") <<
"[BeamSpotOnlineShifter] analyze done \n";
230 const bool isFullPixel) {
231 const std::map<AlignmentPI::coordinate, float> theZero = {
242 return GlobalPoint(tar.x() - ref.x(), tar.y() - ref.y(), tar.z() - ref.z());
247 const bool isFullPixel) {
257 const double BPixFrac = BPixMods / (BPixMods + FPixMMods + FPixPMods);
258 const double FPixMFrac = FPixMMods / (BPixMods + FPixMMods + FPixPMods);
259 const double FPixPFrac = FPixPMods / (BPixMods + FPixMMods + FPixPMods);
262 return GlobalPoint(BPixFrac *
BPix.x() + FPixMFrac * FPixM.x() + FPixPFrac * FPixP.x(),
263 BPixFrac *
BPix.y() + FPixMFrac * FPixM.y() + FPixPFrac * FPixP.y(),
264 BPixFrac *
BPix.z() + FPixMFrac * FPixM.z() + FPixPFrac * FPixP.z());
282 edm::LogPrint(
"BeamSpotOnlineShifter") <<
"[BeamSpotOnlineShifter] applied shift: " <<
theShift_ << std::endl;
302 desc.add<
bool>(
"isHLT",
true);
303 desc.add<
bool>(
"useFullPixel",
false)->setComment(
"use the full pixel detector to compute the barycenter");
304 desc.add<
double>(
"xShift", 0.0)->setComment(
"in cm");
305 desc.add<
double>(
"yShift", 0.0)->setComment(
"in cm");
306 desc.add<
double>(
"zShift", 0.0)->setComment(
"in cm");
307 desc.addOptionalUntracked<uint32_t>(
"IOVStartRun", 1);
308 desc.addOptionalUntracked<uint32_t>(
"IOVStartLumi", 1);
double emittanceX() const
get emittance
const double getNModules(AlignmentPI::PARTITION p)
void setBeamWidthYError(double val)
set beam width Y error
int lastAnalyzedLumi() const
Getters Methods.
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
cond::Time_t pack(uint32_t, uint32_t)
cond::Time_t creationTime() const
void setCovariance(int i, int j, double val)
set i,j element of the full covariance matrix 7x7
double z() const
get Z beam position
void setStartTimeStamp(cond::Time_t val)
double dydz() const
get dydz slope, crossing angle in YZ
~BeamSpotOnlineShifter() override=default
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
void setLastAnalyzedLumi(int val)
void setEmittanceY(double val)
set emittance
double covariance(int i, int j) const
get i,j element of the full covariance matrix 7x7
edm::ESWatcher< BeamSpotOnlineLegacyObjectsRcd > bsLegayWatcher_
const edm::ESGetToken< Alignments, TrackerAlignmentRcd > refAliTokenBR_
void computeBarycenters(const std::vector< AlignTransform > &input, const TrackerTopology &tTopo, const std::map< AlignmentPI::coordinate, float > &GPR)
BeamSpotOnlineShifter(const edm::ParameterSet &)
cond::Time_t beginOfTime() const
void setMeanErrorPV(float val)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void setBetaStar(double val)
set beta star
const GlobalPoint getPixelBarycenter(const AlignmentPI::TkAlBarycenters barycenters, const bool isFullPixel)
Global3DPoint GlobalPoint
void setUsedEvents(int val)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoTokenBR_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::string endTime() const
void setEndTimeStamp(cond::Time_t val)
double beamWidthX() const
get average transverse beam width
std::string lumiRange() const
std::string startTime() const
int beamType() const
get beam type
edm::ESGetToken< BeamSpotOnlineObjects, BeamSpotOnlineHLTObjectsRcd > hltToken_
void setType(int type)
set beam type
void endRun(const edm::Run &, const edm::EventSetup &) override
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
void setEndTime(std::string val)
void beginRun(const edm::Run &, const edm::EventSetup &) override
void writeToDB(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::ESGetToken< BeamSpotOnlineObjects, Record > &token)
T getUntrackedParameter(std::string const &, T const &) const
void setNumTracks(int val)
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
void setLastAnalyzedRun(int val)
void setEmittanceX(double val)
set emittance
double beamWidthYError() const
get average transverse beam width error X = Y
float meanErrorPV() const
unsigned long long Time_t
void setMeanPV(float val)
void setLastAnalyzedFill(int val)
bool isNewTagRequest(const std::string &recordName)
cond::Time_t currentTime() const
void setdydz(double val)
set dydz slope, crossing angle in XZ
cond::Time_t endTimeStamp() const
const edm::ESGetToken< Alignments, TrackerAlignmentRcd > tarAliTokenBR_
double x() const
get X beam position
#define DEFINE_FWK_MODULE(type)
void setRmsErrorPV(float val)
Log< level::Warning, true > LogPrint
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
void setdxdz(double val)
set dxdz slope, crossing angle
edm::ESGetToken< BeamSpotOnlineObjects, BeamSpotOnlineLegacyObjectsRcd > legacyToken_
int lastAnalyzedRun() const
double beamWidthY() const
get average transverse beam width
double y() const
get Y beam position
void analyze(const edm::Event &, const edm::EventSetup &) override
GlobalPoint getPartitionAvg(AlignmentPI::PARTITION p)
cond::Time_t startTimeStamp() const
edm::ESWatcher< BeamSpotOnlineHLTObjectsRcd > bsHLTWatcher_
unsigned long long uint64_t
void setBeamWidthXError(double val)
set beam width X error
const GlobalPoint deltaAlignments(const Alignments *target, const Alignments *reference, const TrackerTopology &tTopo, const bool isFullPixel=false)
void setSigmaZ(double val)
set sigma Z, RMS bunch length
void setLumiRange(std::string val)
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
double beamWidthXError() const
get average transverse beam width error ASSUME the same for X and Y
void setStartTime(std::string val)
void setPosition(double x, double y, double z)
set XYZ position
void setBeamWidthX(double val)
set average transverse beam width X
void setCreationTime(cond::Time_t val)
double dxdz() const
get dxdz slope, crossing angle in XZ
void setBeamWidthY(double val)
set average transverse beam width Y
int lastAnalyzedFill() const