CMS 3D CMS Logo

LHCInfoPerFillWriter.cc
Go to the documentation of this file.
6 
9 
11 
14 
15 #include <memory>
16 #include <iostream>
17 
19 public:
21 
22 private:
23  void beginJob() override {}
24  void analyze(const edm::Event&, const edm::EventSetup&) override;
25  void endJob() override {}
26 };
27 
29  LHCInfoPerFill lhcInfoPerFill;
30  lhcInfoPerFill.setFillNumber(3);
31  lhcInfoPerFill.setBunchesInBeam1(10);
32  lhcInfoPerFill.setBunchesInBeam2(8);
33  lhcInfoPerFill.setCollidingBunches(5);
34  lhcInfoPerFill.setTargetBunches(4);
35  lhcInfoPerFill.setFillType(lhcInfoPerFill.PROTONS);
36  lhcInfoPerFill.setParticleTypeForBeam1(lhcInfoPerFill.PROTON);
37  lhcInfoPerFill.setParticleTypeForBeam2(lhcInfoPerFill.PROTON);
38  lhcInfoPerFill.setIntensityForBeam1(1016.5);
39  lhcInfoPerFill.setIntensityForBeam2(1096.66);
40  lhcInfoPerFill.setEnergy(7000);
41  lhcInfoPerFill.setDelivLumi(2E-07);
42  lhcInfoPerFill.setRecLumi(2E-07);
43  lhcInfoPerFill.setInstLumi(0);
44  lhcInfoPerFill.setInstLumiError(0);
45  lhcInfoPerFill.setCreationTime(6561530930997627120);
46  lhcInfoPerFill.setBeginTime(6561530930997627120);
47  lhcInfoPerFill.setEndTime(6561530930997627120);
48  lhcInfoPerFill.setInjectionScheme("None");
49  lhcInfoPerFill.setLumiPerBX({0.000114139, 0.000114139});
50  lhcInfoPerFill.setLhcState("some lhcState");
51  lhcInfoPerFill.setLhcComment("some lhcComment");
52  lhcInfoPerFill.setCtppsStatus("some ctppsStatus");
53 
54  // store the info into a DB object
56  if (poolDbService.isAvailable())
57  poolDbService->writeOneIOV(lhcInfoPerFill, poolDbService->currentTime(), "LHCInfoPerFillRcd");
58  else
59  throw cms::Exception("LHCInfoPerFillWriter") << "PoolDBService required.";
60 }
61 
void setParticleTypeForBeam2(ParticleTypeId const &particleType)
void setInjectionScheme(std::string const &injectionScheme)
LHCInfoPerFillWriter(const edm::ParameterSet &)
void setBeginTime(cond::Time_t const &beginTime)
void setInstLumiError(float const &instLumiError)
void setLhcComment(std::string const &lhcComment)
void setDelivLumi(float const &delivLumi)
void setBunchesInBeam1(unsigned short const &bunches)
void setEndTime(cond::Time_t const &endTime)
void setBunchesInBeam2(unsigned short const &bunches)
void setIntensityForBeam2(float const &intensity)
int iEvent
Definition: GenABIO.cc:224
void setTargetBunches(unsigned short const &targetBunches)
void setRecLumi(float const &recLumi)
void setLhcState(std::string const &lhcState)
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void setFillNumber(unsigned short lhcFill)
void setIntensityForBeam1(float const &intensity)
void setCtppsStatus(std::string const &ctppsStatus)
void setParticleTypeForBeam1(ParticleTypeId const &particleType)
void setCollidingBunches(unsigned short const &collidingBunches)
void setCreationTime(cond::Time_t const &createTime)
void setLumiPerBX(std::vector< float > const &lumiPerBX)
bool isAvailable() const
Definition: Service.h:40
void setInstLumi(float const &instLumi)
void setEnergy(float const &energy)
void setFillType(FillTypeId const &fillType)
void analyze(const edm::Event &, const edm::EventSetup &) override