Skip to content

Commit b88fda9

Browse files
authored
Merge pull request cms-sw#33827 from lwang046/HcalDQM-CalibChannels
HcalDQM - Correct LED Calibration Channels List
2 parents 7919fd3 + ba7dc4b commit b88fda9

File tree

11 files changed

+167
-106
lines changed

11 files changed

+167
-106
lines changed

DQM/HcalCommon/src/Container1D.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ namespace hcaldqm {
614614

615615
_logger.debug(_hashmap.getName(did));
616616
_mes.insert(std::make_pair(
617-
hash, ib.book1D(_hashmap.getName(did), _hashmap.getName(did), _qx->nbins(), _qx->min(), _qx->max())));
617+
hash, ib.book1DD(_hashmap.getName(did), _hashmap.getName(did), _qx->nbins(), _qx->min(), _qx->max())));
618618

619619
// customize
620620
customize(_mes[hash]);
@@ -633,7 +633,7 @@ namespace hcaldqm {
633633

634634
_logger.debug(_hashmap.getName(eid));
635635
_mes.insert(std::make_pair(
636-
hash, ib.book1D(_hashmap.getName(eid), _hashmap.getName(eid), _qx->nbins(), _qx->min(), _qx->max())));
636+
hash, ib.book1DD(_hashmap.getName(eid), _hashmap.getName(eid), _qx->nbins(), _qx->min(), _qx->max())));
637637

638638
// customize
639639
customize(_mes[hash]);
@@ -650,7 +650,7 @@ namespace hcaldqm {
650650

651651
_logger.debug(_hashmap.getName(tid));
652652
_mes.insert(std::make_pair(
653-
hash, ib.book1D(_hashmap.getName(tid), _hashmap.getName(tid), _qx->nbins(), _qx->min(), _qx->max())));
653+
hash, ib.book1DD(_hashmap.getName(tid), _hashmap.getName(tid), _qx->nbins(), _qx->min(), _qx->max())));
654654
// customize
655655
customize(_mes[hash]);
656656
}
@@ -687,7 +687,7 @@ namespace hcaldqm {
687687

688688
_logger.debug(_hashmap.getName(did));
689689
_mes.insert(std::make_pair(
690-
hash, ib.book1D(_hashmap.getName(did), _hashmap.getName(did), _qx->nbins(), _qx->min(), _qx->max())));
690+
hash, ib.book1DD(_hashmap.getName(did), _hashmap.getName(did), _qx->nbins(), _qx->min(), _qx->max())));
691691

692692
// customize
693693
customize(_mes[hash]);
@@ -708,7 +708,7 @@ namespace hcaldqm {
708708

709709
_logger.debug(_hashmap.getName(eid));
710710
_mes.insert(std::make_pair(
711-
hash, ib.book1D(_hashmap.getName(eid), _hashmap.getName(eid), _qx->nbins(), _qx->min(), _qx->max())));
711+
hash, ib.book1DD(_hashmap.getName(eid), _hashmap.getName(eid), _qx->nbins(), _qx->min(), _qx->max())));
712712

713713
// customize
714714
customize(_mes[hash]);
@@ -727,7 +727,7 @@ namespace hcaldqm {
727727

728728
_logger.debug(_hashmap.getName(tid));
729729
_mes.insert(std::make_pair(
730-
hash, ib.book1D(_hashmap.getName(tid), _hashmap.getName(tid), _qx->nbins(), _qx->min(), _qx->max())));
730+
hash, ib.book1DD(_hashmap.getName(tid), _hashmap.getName(tid), _qx->nbins(), _qx->min(), _qx->max())));
731731
// customize
732732
customize(_mes[hash]);
733733
}

DQM/HcalCommon/src/ContainerSingle1D.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ namespace hcaldqm {
5656

5757
/* virtual */ void ContainerSingle1D::book(DQMStore::IBooker &ib, std::string subsystem, std::string aux) {
5858
ib.setCurrentFolder(subsystem + "/" + _folder + "/" + _qname);
59-
_me = ib.book1D(_qname + (aux.empty() ? aux : "_" + aux),
60-
_qname + (aux.empty() ? aux : " " + aux),
61-
_qx->nbins(),
62-
_qx->min(),
63-
_qx->max());
59+
_me = ib.book1DD(_qname + (aux.empty() ? aux : "_" + aux),
60+
_qname + (aux.empty() ? aux : " " + aux),
61+
_qx->nbins(),
62+
_qx->min(),
63+
_qx->max());
6464
customize();
6565
}
6666

DQM/HcalTasks/plugins/DigiTask.cc

Lines changed: 81 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -42,38 +42,6 @@ DigiTask::DigiTask(edm::ParameterSet const& ps)
4242
_capidmbx[HcalEndcap] = 1;
4343
_capidmbx[HcalOuter] = 1;
4444
_capidmbx[HcalForward] = 1;
45-
46-
// LED calibration channels
47-
std::vector<edm::ParameterSet> vLedCalibChannels =
48-
ps.getParameter<std::vector<edm::ParameterSet>>("ledCalibrationChannels");
49-
for (int i = 0; i <= 3; ++i) {
50-
HcalSubdetector this_subdet = HcalEmpty;
51-
switch (i) {
52-
case 0:
53-
this_subdet = HcalBarrel;
54-
break;
55-
case 1:
56-
this_subdet = HcalEndcap;
57-
break;
58-
case 2:
59-
this_subdet = HcalOuter;
60-
break;
61-
case 3:
62-
this_subdet = HcalForward;
63-
break;
64-
default:
65-
this_subdet = HcalEmpty;
66-
break;
67-
}
68-
std::vector<int32_t> subdet_calib_ietas = vLedCalibChannels[i].getUntrackedParameter<std::vector<int32_t>>("ieta");
69-
std::vector<int32_t> subdet_calib_iphis = vLedCalibChannels[i].getUntrackedParameter<std::vector<int32_t>>("iphi");
70-
std::vector<int32_t> subdet_calib_depths =
71-
vLedCalibChannels[i].getUntrackedParameter<std::vector<int32_t>>("depth");
72-
for (unsigned int ichannel = 0; ichannel < subdet_calib_ietas.size(); ++ichannel) {
73-
_ledCalibrationChannels[this_subdet].push_back(HcalDetId(
74-
HcalOther, subdet_calib_ietas[ichannel], subdet_calib_iphis[ichannel], subdet_calib_depths[ichannel]));
75-
}
76-
}
7745
}
7846

7947
/* virtual */ void DigiTask::bookHistograms(DQMStore::IBooker& ib, edm::Run const& r, edm::EventSetup const& es) {
@@ -82,6 +50,39 @@ DigiTask::DigiTask(edm::ParameterSet const& ps)
8250
// GET WHAT YOU NEED
8351
edm::ESHandle<HcalDbService> dbs = es.getHandle(hcalDbServiceToken_);
8452
_emap = dbs->getHcalMapping();
53+
54+
// Book LED calibration channels from emap
55+
std::vector<HcalElectronicsId> eids = _emap->allElectronicsId();
56+
for (unsigned i = 0; i < eids.size(); i++) {
57+
HcalElectronicsId eid = eids[i];
58+
DetId id = _emap->lookup(eid);
59+
if (HcalGenericDetId(id.rawId()).isHcalCalibDetId()) {
60+
HcalCalibDetId calibId(id);
61+
if (calibId.calibFlavor() == HcalCalibDetId::CalibrationBox) {
62+
HcalSubdetector this_subdet = HcalEmpty;
63+
switch (calibId.hcalSubdet()) {
64+
case HcalBarrel:
65+
this_subdet = HcalBarrel;
66+
break;
67+
case HcalEndcap:
68+
this_subdet = HcalEndcap;
69+
break;
70+
case HcalOuter:
71+
this_subdet = HcalOuter;
72+
break;
73+
case HcalForward:
74+
this_subdet = HcalForward;
75+
break;
76+
default:
77+
this_subdet = HcalEmpty;
78+
break;
79+
}
80+
_ledCalibrationChannels[this_subdet].push_back(
81+
HcalDetId(HcalOther, calibId.ieta(), calibId.iphi(), calibId.cboxChannel()));
82+
}
83+
}
84+
}
85+
8586
std::vector<uint32_t> vVME;
8687
std::vector<uint32_t> vuTCA;
8788
vVME.push_back(
@@ -787,11 +788,11 @@ DigiTask::DigiTask(edm::ParameterSet const& ps)
787788

788789
// book Number of Events vs LS histogram
789790
ib.setCurrentFolder(_subsystem + "/RunInfo");
790-
meNumEvents1LS = ib.book1D("NumberOfEvents", "NumberOfEvents", 1, 0, 1);
791+
meNumEvents1LS = ib.book1DD("NumberOfEvents", "NumberOfEvents", 1, 0, 1);
791792

792793
// book the flag for unknown ids and the online guy as well
793794
ib.setCurrentFolder(_subsystem + "/" + _name);
794-
meUnknownIds1LS = ib.book1D("UnknownIds", "UnknownIds", 1, 0, 1);
795+
meUnknownIds1LS = ib.book1DD("UnknownIds", "UnknownIds", 1, 0, 1);
795796
_unknownIdsPresent = false;
796797
}
797798
}
@@ -867,7 +868,6 @@ DigiTask::DigiTask(edm::ParameterSet const& ps)
867868
if (did.subdet() == HcalOther) {
868869
HcalOtherDetId hodid(digi.detid());
869870
if (hodid.subdet() == HcalCalibration) {
870-
// New method: use configurable list of channels
871871
if (std::find(_ledCalibrationChannels[HcalEndcap].begin(),
872872
_ledCalibrationChannels[HcalEndcap].end(),
873873
did) != _ledCalibrationChannels[HcalEndcap].end()) {
@@ -885,6 +885,23 @@ DigiTask::DigiTask(edm::ParameterSet const& ps)
885885
_LED_CUCountvsLSmod60_Subdet.fill(HcalDetId(HcalEndcap, 16, 1, 1), _currentLS % 60);
886886
}
887887
}
888+
} else if (std::find(_ledCalibrationChannels[HcalBarrel].begin(),
889+
_ledCalibrationChannels[HcalBarrel].end(),
890+
did) != _ledCalibrationChannels[HcalBarrel].end()) {
891+
bool channelLEDSignalPresent = false;
892+
for (int i = 0; i < digi.samples(); i++) {
893+
_LED_ADCvsBX_Subdet.fill(HcalDetId(HcalBarrel, 1, 1, 1), bx, digi[i].adc());
894+
895+
if (digi[i].adc() > _thresh_led) {
896+
channelLEDSignalPresent = true;
897+
}
898+
}
899+
if (channelLEDSignalPresent) {
900+
_LED_CUCountvsLS_Subdet.fill(HcalDetId(HcalBarrel, 1, 1, 1), _currentLS);
901+
if (_ptype == fOnline) {
902+
_LED_CUCountvsLSmod60_Subdet.fill(HcalDetId(HcalBarrel, 1, 1, 1), _currentLS % 60);
903+
}
904+
}
888905
}
889906
}
890907
}
@@ -1072,9 +1089,35 @@ DigiTask::DigiTask(edm::ParameterSet const& ps)
10721089

10731090
// HO collection
10741091
for (HODigiCollection::const_iterator it = c_ho->begin(); it != c_ho->end(); ++it) {
1092+
const HODataFrame digi = (const HODataFrame)(*it);
10751093
// Explicit check on the DetIds present in the Collection
10761094
HcalDetId const& did = it->id();
10771095
if (did.subdet() != HcalOuter) {
1096+
// LED monitoring from calibration channels
1097+
if (_ptype != fLocal) {
1098+
if (did.subdet() == HcalOther) {
1099+
HcalOtherDetId hodid(did);
1100+
if (hodid.subdet() == HcalCalibration) {
1101+
if (std::find(_ledCalibrationChannels[HcalOuter].begin(), _ledCalibrationChannels[HcalOuter].end(), did) !=
1102+
_ledCalibrationChannels[HcalOuter].end()) {
1103+
bool channelLEDSignalPresent = false;
1104+
for (int i = 0; i < digi.size(); i++) {
1105+
_LED_ADCvsBX_Subdet.fill(HcalDetId(HcalOuter, 1, 1, 4), bx, digi[i].adc());
1106+
1107+
if (digi[i].adc() > _thresh_led) {
1108+
channelLEDSignalPresent = true;
1109+
}
1110+
}
1111+
if (channelLEDSignalPresent) {
1112+
_LED_CUCountvsLS_Subdet.fill(HcalDetId(HcalOuter, 1, 1, 4), _currentLS);
1113+
if (_ptype == fOnline) {
1114+
_LED_CUCountvsLSmod60_Subdet.fill(HcalDetId(HcalOuter, 1, 1, 4), _currentLS % 60);
1115+
}
1116+
}
1117+
}
1118+
}
1119+
}
1120+
}
10781121
continue;
10791122
}
10801123
uint32_t rawid = _ehashmap.lookup(did);
@@ -1220,22 +1263,21 @@ DigiTask::DigiTask(edm::ParameterSet const& ps)
12201263
if (did.subdet() == HcalOther) {
12211264
HcalOtherDetId hodid(digi.detid());
12221265
if (hodid.subdet() == HcalCalibration) {
1223-
// New method: use configurable list of channels
12241266
if (std::find(_ledCalibrationChannels[HcalForward].begin(),
12251267
_ledCalibrationChannels[HcalForward].end(),
12261268
did) != _ledCalibrationChannels[HcalForward].end()) {
12271269
bool channelLEDSignalPresent = false;
12281270
for (int i = 0; i < digi.samples(); i++) {
1229-
_LED_ADCvsBX_Subdet.fill(HcalDetId(HcalForward, 16, 1, 1), bx, digi[i].adc());
1271+
_LED_ADCvsBX_Subdet.fill(HcalDetId(HcalForward, 29, 1, 1), bx, digi[i].adc());
12301272

12311273
if (digi[i].adc() > _thresh_led) {
12321274
channelLEDSignalPresent = true;
12331275
}
12341276
}
12351277
if (channelLEDSignalPresent) {
1236-
_LED_CUCountvsLS_Subdet.fill(HcalDetId(HcalForward, 16, 1, 1), _currentLS);
1278+
_LED_CUCountvsLS_Subdet.fill(HcalDetId(HcalForward, 29, 1, 1), _currentLS);
12371279
if (_ptype == fOnline) {
1238-
_LED_CUCountvsLSmod60_Subdet.fill(HcalDetId(HcalForward, 16, 1, 1), _currentLS % 60);
1280+
_LED_CUCountvsLSmod60_Subdet.fill(HcalDetId(HcalForward, 29, 1, 1), _currentLS % 60);
12391281
}
12401282
}
12411283
}

DQM/HcalTasks/plugins/FCDTask.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ FCDTask::FCDTask(edm::ParameterSet const& ps)
5050
histoname = std::to_string(it_eid.crateId()) + "-" + std::to_string(it_eid.slot()) + "-" +
5151
std::to_string(it_eid.fiberIndex()) + "-" + std::to_string(it_eid.fiberChanId());
5252
ib.setCurrentFolder("Hcal/FCDTask/ADC");
53-
_cADC[it_eid] = ib.book1D(histoname.c_str(), histoname.c_str(), 256, 0, 256);
53+
_cADC[it_eid] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
5454
_cADC[it_eid]->setAxisTitle("ADC", 1);
5555
_cADC[it_eid]->setAxisTitle("N", 2);
5656

@@ -60,11 +60,11 @@ FCDTask::FCDTask(edm::ParameterSet const& ps)
6060
_cADC_vs_TS[it_eid]->setAxisTitle("ADC", 2);
6161

6262
ib.setCurrentFolder("Hcal/FCDTask/TDCTime");
63-
_cTDCTime[it_eid] = ib.book1D(histoname.c_str(), histoname.c_str(), 500, 0., 250.);
63+
_cTDCTime[it_eid] = ib.book1DD(histoname.c_str(), histoname.c_str(), 500, 0., 250.);
6464
_cTDCTime[it_eid]->setAxisTitle("TDC time [ns]", 1);
6565

6666
ib.setCurrentFolder("Hcal/FCDTask/TDC");
67-
_cTDC[it_eid] = ib.book1D(histoname.c_str(), histoname.c_str(), 64, -0.5, 63.5);
67+
_cTDC[it_eid] = ib.book1DD(histoname.c_str(), histoname.c_str(), 64, -0.5, 63.5);
6868
_cTDC[it_eid]->setAxisTitle("TDC", 1);
6969
}
7070
}

DQM/HcalTasks/plugins/HcalOnlineHarvesting.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,19 @@ HcalOnlineHarvesting::HcalOnlineHarvesting(edm::ParameterSet const& ps)
136136
if (meOccupancy_HF_depth && meOccupancyNoTDC_HF_depth && meOccupancy_HF_ieta && meOccupancyNoTDC_HF_ieta) {
137137
TH2F* hOccupancy_HF_depth = meOccupancy_HF_depth->getTH2F();
138138
TH2F* hOccupancyNoTDC_HF_depth = meOccupancyNoTDC_HF_depth->getTH2F();
139-
TH1F* hOccupancy_HF_ieta = meOccupancy_HF_ieta->getTH1F();
140-
TH1F* hOccupancyNoTDC_HF_ieta = meOccupancyNoTDC_HF_ieta->getTH1F();
139+
TH1D* hOccupancy_HF_ieta = meOccupancy_HF_ieta->getTH1D();
140+
TH1D* hOccupancyNoTDC_HF_ieta = meOccupancyNoTDC_HF_ieta->getTH1D();
141141

142142
TH2F* hEfficiency_HF_depth = (TH2F*)hOccupancy_HF_depth->Clone();
143143
hEfficiency_HF_depth->Divide(hOccupancyNoTDC_HF_depth);
144-
TH1F* hEfficiency_HF_ieta = (TH1F*)hOccupancy_HF_ieta->Clone();
144+
TH1D* hEfficiency_HF_ieta = (TH1D*)hOccupancy_HF_ieta->Clone();
145145
hEfficiency_HF_ieta->Divide(hOccupancyNoTDC_HF_ieta);
146146

147147
ib.setCurrentFolder("Hcal/TPTask");
148148

149149
MonitorElement* meEfficiency_HF_depth = ib.book2D("TDCCutEfficiency_depth", hEfficiency_HF_depth);
150150
meEfficiency_HF_depth->setEfficiencyFlag();
151-
MonitorElement* meEfficiency_HF_ieta = ib.book1D("TDCCutEfficiency_ieta", hEfficiency_HF_ieta);
151+
MonitorElement* meEfficiency_HF_ieta = ib.book1DD("TDCCutEfficiency_ieta", hEfficiency_HF_ieta);
152152
meEfficiency_HF_ieta->setEfficiencyFlag();
153153

154154
delete hEfficiency_HF_depth;

0 commit comments

Comments
 (0)