38 beamSpotOutputBase_ (iConfig.getParameter<
ParameterSet>(
"AlcaBeamSpotHarvesterParameters").getUntrackedParameter<
std::
string>(
"BeamSpotOutputBase")),
39 outputrecordName_ (iConfig.getParameter<
ParameterSet>(
"AlcaBeamSpotHarvesterParameters").getUntrackedParameter<
std::
string>(
"outputRecordName",
"BeamSpotObjectsRcd")),
40 sigmaZValue_ (iConfig.getParameter<
ParameterSet>(
"AlcaBeamSpotHarvesterParameters").getUntrackedParameter<double>(
"SigmaZValue")),
41 sigmaZCut_ (iConfig.getParameter<
ParameterSet>(
"AlcaBeamSpotHarvesterParameters").getUntrackedParameter<double>(
"SigmaZCut")),
42 dumpTxt_ (iConfig.getParameter<
ParameterSet>(
"AlcaBeamSpotHarvesterParameters").getUntrackedParameter<bool>(
"DumpTxt")),
43 outTxtFileName_ (iConfig.getParameter<
ParameterSet>(
"AlcaBeamSpotHarvesterParameters").getUntrackedParameter<
std::
string>(
"TxtFileName")),
44 theAlcaBeamSpotManager_(iConfig, consumesCollector()) {
78 outFile.open(outTxt.c_str());
83 aBeamSpot->
SetType(it->second.type());
84 aBeamSpot->
SetPosition(it->second.x0(),it->second.y0(),it->second.z0());
86 aBeamSpot->
SetSigmaZ(it->second.sigmaZ());
91 aBeamSpot->
Setdxdz(it->second.dxdz());
92 aBeamSpot->
Setdydz(it->second.dydz());
99 for (
int i=0;
i<7; ++
i) {
100 for (
int j=0; j<7; ++j) {
128 std::time_t lumi_t_begin = thisIOV;
129 std::time_t lumi_t_end = thisIOV;
130 char ts[] =
"yyyy.mn.dd hh:mm:ss zzz ";
131 char* fbeginTime = ts;
132 strftime(fbeginTime,
sizeof(ts),
"%Y.%m.%d %H:%M:%S GMT", gmtime(&lumi_t_begin));
136 strftime(fendTime,
sizeof(ts),
"%Y.%m.%d %H:%M:%S GMT", gmtime(&lumi_t_end));
139 currentBS.
reftime[0] = lumi_t_begin;
140 currentBS.
reftime[1] = lumi_t_end;
145 <<
"new tag requested" << std::endl;
156 <<
"no new tag requested, appending IOV" << std::endl;
virtual void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
std::string beamSpotOutputBase_
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
#define DEFINE_FWK_MODULE(type)
void SetSigmaZ(double val)
set sigma Z, RMS bunch length
std::string outTxtFileName_
virtual void endJob(void)
std::map< edm::LuminosityBlockNumber_t, reco::BeamSpot >::iterator bsMap_iterator
void SetCovariance(int i, int j, double val)
set i,j element of the full covariance matrix 7x7
void Setdydz(double val)
set dydz slope, crossing angle in XZ
virtual void beginJob(void)
AlcaBeamSpotHarvester(const edm::ParameterSet &)
Constructor.
const std::map< edm::LuminosityBlockNumber_t, reco::BeamSpot > & getPayloads(void)
U second(std::pair< T, U > const &p)
unsigned long long Time_t
bool isNewTagRequest(const std::string &recordName)
void SetEmittanceX(double val)
set emittance
virtual void endRun(const edm::Run &, const edm::EventSetup &)
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
void Setdxdz(double val)
set dxdz slope, crossing angle
void createWeightedPayloads(void)
void SetBetaStar(double val)
set beta star
virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
void readLumi(const edm::LuminosityBlock &)
void SetType(int type)
set beam type
virtual ~AlcaBeamSpotHarvester()
Destructor.
void SetEmittanceY(double val)
set emittance
void SetBeamWidthX(double val)
set average transverse beam width X
void SetBeamWidthY(double val)
set average transverse beam width Y
AlcaBeamSpotManager theAlcaBeamSpotManager_
void dumpBeamSpotTxt(std::ofstream &outFile, BeamSpotContainer const &bsContainer)
std::string outputrecordName_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void SetPosition(double x, double y, double z)
set XYZ position