CMS 3D CMS Logo

LHCInfoPerFillAnalyzer.cc
Go to the documentation of this file.
7 
10 
11 #include <memory>
12 #include <iostream>
13 #include <vector>
14 #include <cassert>
15 
17 public:
20 
21 private:
22  void beginJob() override {}
23  void analyze(const edm::Event&, const edm::EventSetup&) override;
24  void endJob() override {}
25 
27 
29 };
30 
33 
34  LHCInfoPerFill lhcInfoPerFill = iSetup.getData(tokenInfoPerFill_);
35  const float EPS = 1E-4;
36  assert(lhcInfoPerFill.fillNumber() == 3);
37  assert(lhcInfoPerFill.bunchesInBeam1() == 10);
38  assert(lhcInfoPerFill.bunchesInBeam2() == 8);
39  assert(lhcInfoPerFill.collidingBunches() == 5);
40  assert(lhcInfoPerFill.targetBunches() == 4);
41  assert(lhcInfoPerFill.fillType() == lhcInfoPerFill.PROTONS);
42  assert(lhcInfoPerFill.particleTypeForBeam1() == lhcInfoPerFill.PROTON);
43  assert(lhcInfoPerFill.particleTypeForBeam2() == lhcInfoPerFill.PROTON);
44  assert(abs(lhcInfoPerFill.intensityForBeam1() - 1016.5) < EPS);
45  assert(abs(lhcInfoPerFill.intensityForBeam2() - 1096.66) < EPS);
46  assert(abs(lhcInfoPerFill.energy() - 7000) < EPS);
47  assert(abs(lhcInfoPerFill.delivLumi() - 2E-07) < EPS);
48  assert(abs(lhcInfoPerFill.recLumi() - 2E-07) < EPS);
49  assert(abs(lhcInfoPerFill.instLumi() - 0) < EPS);
50  assert(abs(lhcInfoPerFill.instLumiError() - 0) < EPS);
51  assert(lhcInfoPerFill.createTime() == 6561530930997627120);
52  assert(lhcInfoPerFill.beginTime() == 6561530930997627120);
53  assert(lhcInfoPerFill.endTime() == 6561530930997627120);
54  assert(lhcInfoPerFill.injectionScheme() == "None");
55  assert(lhcInfoPerFill.lumiPerBX().size() == 2);
56  assert(abs(lhcInfoPerFill.lumiPerBX()[0] - 0.000114139) < EPS);
57  assert(abs(lhcInfoPerFill.lumiPerBX()[1] - 0.000114139) < EPS);
58  assert(lhcInfoPerFill.lhcState() == "some lhcState");
59  assert(lhcInfoPerFill.lhcComment() == "some lhcComment");
60  assert(lhcInfoPerFill.ctppsStatus() == "some ctppsStatus");
61  edm::LogInfo("LHCInfoPerFillAnalyzer") << "LHCInfoPerFill retrieved:\n" << lhcInfoPerFill;
62 }
63 
LHCInfoPerFillAnalyzer(const edm::ParameterSet &)
#define EPS
assert(be >=bs)
int iEvent
Definition: GenABIO.cc:224
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
bool getData(T &iHolder) const
Definition: EventSetup.h:122
edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcd > tokenInfoPerFill_
Log< level::Info, false > LogInfo
void analyze(const edm::Event &, const edm::EventSetup &) override
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
edm::ESWatcher< LHCInfoPerFillRcd > infoPerFillWatcher_