1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
// system include files
#include <iostream>
#include <cstdio>
#include <sys/time.h>
// user include files
#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h"
#include "CondFormats/SiStripObjects/interface/SiStripDetVOff.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
//
//
// class decleration
//
class SiStripDetVOffReader : public edm::one::EDAnalyzer<> {
public:
explicit SiStripDetVOffReader(const edm::ParameterSet&);
~SiStripDetVOffReader() override = default;
void analyze(const edm::Event&, const edm::EventSetup&) override;
private:
const bool printdebug_;
const edm::ESGetToken<SiStripDetVOff, SiStripDetVOffRcd> detVOffToken_;
std::vector<uint32_t> detids;
};
SiStripDetVOffReader::SiStripDetVOffReader(const edm::ParameterSet& iConfig)
: printdebug_(iConfig.getUntrackedParameter<bool>("printDebug", true)), detVOffToken_(esConsumes()) {}
void SiStripDetVOffReader::analyze(const edm::Event& e, const edm::EventSetup& iSetup) {
const auto& detVOff = iSetup.getData(detVOffToken_);
edm::LogInfo("SiStripDetVOffReader") << "[SiStripDetVOffReader::analyze] End Reading SiStripDetVOff" << std::endl;
// put here a vector of DetIds to compare
// Here we just take the vector with all modules that have HV OFF
// replace this code, with Your own detids
std::vector<uint32_t> detid;
detVOff.getDetIds(detid);
//
if (printdebug_) {
for (uint32_t id = 0; id <= detid.size(); id++) {
bool hvflag = detVOff.IsModuleHVOff(detid[id]);
bool lvflag = detVOff.IsModuleLVOff(detid[id]);
bool vflag = detVOff.IsModuleVOff(detid[id]);
if (hvflag == true) {
edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " HV\t OFF\n";
} else {
edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " HV\t ON\n";
}
if (lvflag == true) {
edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " LV\t OFF\n";
} else {
edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " LV\t ON\n";
}
if (vflag == true) {
edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " V\t OFF\n";
} else {
edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " V\t ON\n";
}
}
}
}
#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "FWCore/Framework/interface/MakerMacros.h"
DEFINE_FWK_MODULE(SiStripDetVOffReader);
|