CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1TMuonOverlapFwVersionTester.cc
Go to the documentation of this file.
1 #include <iomanip>
2 #include <iostream>
3 
5 
8 
10 
17 
18 using namespace std;
19 
21 private:
23  bool writeToDB;
26 
27 public:
28  void analyze(const edm::Event &, const edm::EventSetup &) override;
29 
30  explicit L1TMuonOverlapFwVersionTester(const edm::ParameterSet &pset) : edm::one::EDAnalyzer<>() {
31  isO2Opayload = pset.getUntrackedParameter<bool>("isO2Opayload", false);
32  writeToDB = pset.getUntrackedParameter<bool>("writeToDB", false);
33  esToken = esConsumes<L1TMuonOverlapFwVersion, L1TMuonOverlapFwVersionRcd>();
34  esToken_O2O = esConsumes<L1TMuonOverlapFwVersion, L1TMuonOverlapFwVersionO2ORcd>();
35  }
36  ~L1TMuonOverlapFwVersionTester(void) override = default;
37 };
38 
41  if (isO2Opayload)
42  data = evSetup.getData(esToken_O2O);
43  else
44  data = evSetup.getData(esToken);
45 
46  edm::LogInfo("L1TMuonOverlapFwVersionTester")
47  << "*** Contents of L1TMuonOverlapFwVersion: algoVersion() = " << data.algoVersion()
48  << ", layersVersion() = " << data.layersVersion() << ", patternsVersion() = " << data.patternsVersion()
49  << ", synthDate() = " << data.synthDate();
50 
51  if (writeToDB) {
53  if (poolDb.isAvailable()) {
54  edm::LogInfo("L1TMuonOverlapFwVersionTester") << "*** Writing payload to DB";
55  cond::Time_t firstSinceTime = poolDb->beginOfTime();
56  poolDb->writeOneIOV(
57  data, firstSinceTime, (isO2Opayload ? "L1TMuonOverlapFwVersionO2ORcd" : "L1TMuonOverlapFwVersionRcd"));
58  }
59  }
60 }
61 
65 
T getUntrackedParameter(std::string const &, T const &) const
L1TMuonOverlapFwVersionTester(const edm::ParameterSet &pset)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
bool getData(T &iHolder) const
Definition: EventSetup.h:128
edm::ESGetToken< L1TMuonOverlapFwVersion, L1TMuonOverlapFwVersionRcd > esToken
int iEvent
Definition: GenABIO.cc:224
unsigned long long Time_t
Definition: Time.h:14
bool isAvailable() const
Definition: Service.h:40
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
void analyze(const edm::Event &, const edm::EventSetup &) override
std::string synthDate() const
Log< level::Info, false > LogInfo
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
tuple writeToDB
process.TPGParamProducer = cms.EDFilter(&quot;EcalTPGParamBuilder&quot;,
edm::ESGetToken< L1TMuonOverlapFwVersion, L1TMuonOverlapFwVersionO2ORcd > esToken_O2O