Skip to content

Commit 7805123

Browse files
authored
Merge pull request cms-sw#33919 from barvic/cscdqm_esconsumes_migration
CSCMonitorModule migration to ESConsumes
2 parents ec11383 + af039f2 commit 7805123

File tree

6 files changed

+25
-8
lines changed

6 files changed

+25
-8
lines changed

DQM/CSCMonitorModule/plugins/CSCDQM_EventProcessor_processCSC.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,7 @@ namespace cscdqm {
15621562
/** for(int nLayer = 1; nLayer <= N_Layers; ++nLayer) */
15631563
// scaControllerWord[nCFEB][nSample][nLayer-1] = timeSlice(cfebData, nCFEB, nSample)->scaControllerWord(nLayer);
15641564

1565-
TrigTime = (int)(timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).trig_time);
1565+
// TrigTime = (int)(timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).trig_time);
15661566
/** --------------B */
15671567
FreeCells = timeSlice(data, nCFEB, nSample)->get_n_free_sca_blocks();
15681568
LCT_Pipe_Empty = timeSlice(data, nCFEB, nSample)->get_lctpipe_empty();

DQM/CSCMonitorModule/plugins/CSCDQM_EventProcessor_updateEffHistos.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ namespace cscdqm {
140140
{ // Compute DQM information parameters
141141

142142
Address adr;
143+
bzero(&adr, sizeof(Address));
143144
adr.mask.side = adr.mask.station = adr.mask.ring = true;
144145
adr.mask.chamber = adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
145146

@@ -347,6 +348,7 @@ namespace cscdqm {
347348
*/
348349
void EventProcessor::standbyEfficiencyHistos(HWStandbyType& standby) {
349350
Address adr;
351+
bzero(&adr, sizeof(Address));
350352
adr.mask.side = true;
351353
adr.mask.station = adr.mask.ring = adr.mask.chamber = adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
352354

DQM/CSCMonitorModule/plugins/CSCDQM_StripClusterFinder.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ namespace cscdqm {
174174

175175
void StripClusterFinder::Match(void) {
176176
// MATCHING THE OVERLAPING CLASTERS
177-
bool find2match;
178-
find2match = true;
177+
bool find2match = true;
179178
do {
180179
find2match = FindAndMatch();
181180
} while (find2match);

DQM/CSCMonitorModule/plugins/CSCDQM_Summary.cc

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ namespace cscdqm {
3535
*/
3636
void Summary::Reset() {
3737
Address adr;
38+
bzero(&adr, sizeof(Address));
3839

3940
/** Setting Zeros (no data) for each HW element (and beyond) */
4041
adr.mask.side = adr.mask.station = adr.mask.layer = false;
@@ -61,6 +62,7 @@ namespace cscdqm {
6162
if (h2->GetXaxis()->GetXmin() <= 1 && h2->GetXaxis()->GetXmax() >= 36 && h2->GetYaxis()->GetXmin() <= 1 &&
6263
h2->GetYaxis()->GetXmax() >= 18) {
6364
Address adr;
65+
bzero(&adr, sizeof(Address));
6466
double z = 0.0;
6567

6668
for (unsigned int x = 1; x <= 36; x++) {
@@ -114,6 +116,7 @@ namespace cscdqm {
114116
double factor = num / denum;
115117

116118
Address adr;
119+
bzero(&adr, sizeof(Address));
117120
unsigned int N = 0, n = 0;
118121

119122
for (unsigned int x = 1; x <= 36; x++) {
@@ -197,6 +200,7 @@ namespace cscdqm {
197200
evs->GetYaxis()->GetXmax() >= 18 && err->GetXaxis()->GetXmin() <= 1 && err->GetXaxis()->GetXmax() >= 36 &&
198201
err->GetYaxis()->GetXmin() <= 1 && err->GetYaxis()->GetXmax() >= 18) {
199202
Address adr;
203+
bzero(&adr, sizeof(Address));
200204
unsigned int N = 0, n = 0;
201205

202206
for (unsigned int x = 1; x <= 36; x++) {
@@ -225,6 +229,8 @@ namespace cscdqm {
225229
void Summary::Write(TH2*& h2, const unsigned int station) const {
226230
const AddressBox* box;
227231
Address adr, tadr;
232+
bzero(&adr, sizeof(Address));
233+
bzero(&tadr, sizeof(Address));
228234
float area_all = 0.0, area_rep = 0.0;
229235

230236
if (station < 1 || station > N_STATIONS)
@@ -335,6 +341,7 @@ namespace cscdqm {
335341
h2->GetYaxis()->GetXmax() >= 18) {
336342
unsigned int x, y;
337343
Address adr;
344+
bzero(&adr, sizeof(Address));
338345

339346
adr.mask.side = adr.mask.station = adr.mask.ring = adr.mask.chamber = true;
340347
adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
@@ -385,6 +392,7 @@ namespace cscdqm {
385392
*/
386393
void Summary::SetValue(const HWStatusBit bit, const int value) {
387394
Address adr;
395+
bzero(&adr, sizeof(Address));
388396
adr.mask.side = adr.mask.station = adr.mask.ring = adr.mask.chamber = adr.mask.layer = adr.mask.cfeb = adr.mask.hv =
389397
false;
390398
SetValue(adr, bit, value);
@@ -503,6 +511,7 @@ namespace cscdqm {
503511
*/
504512
const double Summary::GetEfficiencyHW() const {
505513
Address adr;
514+
bzero(&adr, sizeof(Address));
506515
adr.mask.side = adr.mask.station = adr.mask.ring = adr.mask.chamber = adr.mask.layer = adr.mask.cfeb = adr.mask.hv =
507516
false;
508517
return GetEfficiencyHW(adr);
@@ -515,6 +524,7 @@ namespace cscdqm {
515524
*/
516525
const double Summary::GetEfficiencyHW(const unsigned int station) const {
517526
Address adr;
527+
bzero(&adr, sizeof(Address));
518528
adr.mask.side = adr.mask.station = adr.mask.ring = adr.mask.chamber = adr.mask.layer = adr.mask.cfeb = adr.mask.hv =
519529
false;
520530

@@ -601,8 +611,9 @@ namespace cscdqm {
601611
return 0.0;
602612

603613
Address adr;
614+
bzero(&adr, sizeof(Address));
604615
adr.mask.side = adr.mask.ring = adr.mask.chamber = adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
605-
adr.station = true;
616+
adr.mask.station = true;
606617
adr.station = station;
607618

608619
return GetEfficiencyArea(adr);
@@ -616,8 +627,8 @@ namespace cscdqm {
616627
const double Summary::GetEfficiencyArea(const Address& adr) const {
617628
double all_area = 1;
618629

619-
if (adr.mask.side == false && adr.mask.ring == false && adr.mask.chamber == false && adr.mask.layer == false &&
620-
adr.mask.cfeb == false && adr.mask.hv == false && adr.mask.station == true)
630+
if ((adr.mask.side == false) && (adr.mask.ring == false) && (adr.mask.chamber == false) &&
631+
(adr.mask.layer == false) && (adr.mask.cfeb == false) && (adr.mask.hv == false) && (adr.mask.station == true))
621632
all_area = detector.Area(adr.station);
622633
else
623634
all_area = detector.Area(adr);
@@ -698,6 +709,7 @@ namespace cscdqm {
698709
unsigned int ring,
699710
unsigned int chamber) const {
700711
Address adr;
712+
bzero(&adr, sizeof(Address));
701713
adr.mask.side = adr.mask.station = adr.mask.ring = adr.mask.chamber = true;
702714
adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
703715
adr.side = side;

DQM/CSCMonitorModule/plugins/CSCMonitorModule.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
* @brief Constructor.
2323
* @param ps Parameters.
2424
*/
25-
CSCMonitorModule::CSCMonitorModule(const edm::ParameterSet& ps) {
25+
CSCMonitorModule::CSCMonitorModule(const edm::ParameterSet& ps)
26+
: hcrateToken_(esConsumes<CSCCrateMap, CSCCrateMapRcd>()) {
2627
edm::FileInPath fp;
2728

2829
inputTag = ps.getUntrackedParameter<edm::InputTag>("InputObjects", (edm::InputTag)INPUT_TAG_LABEL);
@@ -86,7 +87,8 @@ void CSCMonitorModule::beginRun(const edm::Run& r, const edm::EventSetup& c) {
8687
void CSCMonitorModule::analyze(const edm::Event& e, const edm::EventSetup& c) {
8788
// Get crate mapping from database
8889
edm::ESHandle<CSCCrateMap> hcrate;
89-
c.get<CSCCrateMapRcd>().get(hcrate);
90+
/// Use esConsumes to get crate mapping
91+
hcrate = c.getHandle(hcrateToken_);
9092
pcrate = hcrate.product();
9193

9294
cscdqm::HWStandbyType standby;

DQM/CSCMonitorModule/plugins/CSCMonitorModule.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ class CSCMonitorModule : public DQMOneEDAnalyzer<>, public cscdqm::MonitorObject
8888
bool prebookEffParams;
8989
bool processDcsScalers;
9090

91+
const edm::ESGetToken<CSCCrateMap, CSCCrateMapRcd> hcrateToken_;
92+
9193
/** Pointer to crate mapping from database **/
9294
const CSCCrateMap* pcrate;
9395

0 commit comments

Comments
 (0)