Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HcalDQM - Correct LED CU List for P5 (online DQM) #33828

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions DQM/HcalCommon/src/Container1D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ namespace hcaldqm {

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

// customize
customize(_mes[hash]);
Expand All @@ -633,7 +633,7 @@ namespace hcaldqm {

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

// customize
customize(_mes[hash]);
Expand All @@ -650,7 +650,7 @@ namespace hcaldqm {

_logger.debug(_hashmap.getName(tid));
_mes.insert(std::make_pair(
hash, ib.book1D(_hashmap.getName(tid), _hashmap.getName(tid), _qx->nbins(), _qx->min(), _qx->max())));
hash, ib.book1DD(_hashmap.getName(tid), _hashmap.getName(tid), _qx->nbins(), _qx->min(), _qx->max())));
// customize
customize(_mes[hash]);
}
Expand Down Expand Up @@ -687,7 +687,7 @@ namespace hcaldqm {

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

// customize
customize(_mes[hash]);
Expand All @@ -708,7 +708,7 @@ namespace hcaldqm {

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

// customize
customize(_mes[hash]);
Expand All @@ -727,7 +727,7 @@ namespace hcaldqm {

_logger.debug(_hashmap.getName(tid));
_mes.insert(std::make_pair(
hash, ib.book1D(_hashmap.getName(tid), _hashmap.getName(tid), _qx->nbins(), _qx->min(), _qx->max())));
hash, ib.book1DD(_hashmap.getName(tid), _hashmap.getName(tid), _qx->nbins(), _qx->min(), _qx->max())));
// customize
customize(_mes[hash]);
}
Expand Down
10 changes: 5 additions & 5 deletions DQM/HcalCommon/src/ContainerSingle1D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ namespace hcaldqm {

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

Expand Down
118 changes: 80 additions & 38 deletions DQM/HcalTasks/plugins/DigiTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,38 +41,6 @@ DigiTask::DigiTask(edm::ParameterSet const& ps) : DQTask(ps) {
_capidmbx[HcalEndcap] = 1;
_capidmbx[HcalOuter] = 1;
_capidmbx[HcalForward] = 1;

// LED calibration channels
std::vector<edm::ParameterSet> vLedCalibChannels =
ps.getParameter<std::vector<edm::ParameterSet>>("ledCalibrationChannels");
for (int i = 0; i <= 3; ++i) {
HcalSubdetector this_subdet = HcalEmpty;
switch (i) {
case 0:
this_subdet = HcalBarrel;
break;
case 1:
this_subdet = HcalEndcap;
break;
case 2:
this_subdet = HcalOuter;
break;
case 3:
this_subdet = HcalForward;
break;
default:
this_subdet = HcalEmpty;
break;
}
std::vector<int32_t> subdet_calib_ietas = vLedCalibChannels[i].getUntrackedParameter<std::vector<int32_t>>("ieta");
std::vector<int32_t> subdet_calib_iphis = vLedCalibChannels[i].getUntrackedParameter<std::vector<int32_t>>("iphi");
std::vector<int32_t> subdet_calib_depths =
vLedCalibChannels[i].getUntrackedParameter<std::vector<int32_t>>("depth");
for (unsigned int ichannel = 0; ichannel < subdet_calib_ietas.size(); ++ichannel) {
_ledCalibrationChannels[this_subdet].push_back(HcalDetId(
HcalOther, subdet_calib_ietas[ichannel], subdet_calib_iphis[ichannel], subdet_calib_depths[ichannel]));
}
}
}

/* virtual */ void DigiTask::bookHistograms(DQMStore::IBooker& ib, edm::Run const& r, edm::EventSetup const& es) {
Expand All @@ -82,6 +50,39 @@ DigiTask::DigiTask(edm::ParameterSet const& ps) : DQTask(ps) {
edm::ESHandle<HcalDbService> dbs;
es.get<HcalDbRecord>().get(dbs);
_emap = dbs->getHcalMapping();

// Book LED calibration channels from emap
std::vector<HcalElectronicsId> eids = _emap->allElectronicsId();
for (unsigned i = 0; i < eids.size(); i++) {
HcalElectronicsId eid = eids[i];
DetId id = _emap->lookup(eid);
if (HcalGenericDetId(id.rawId()).isHcalCalibDetId()) {
HcalCalibDetId calibId(id);
if (calibId.calibFlavor() == HcalCalibDetId::CalibrationBox) {
HcalSubdetector this_subdet = HcalEmpty;
switch (calibId.hcalSubdet()) {
case HcalBarrel:
this_subdet = HcalBarrel;
break;
case HcalEndcap:
this_subdet = HcalEndcap;
break;
case HcalOuter:
this_subdet = HcalOuter;
break;
case HcalForward:
this_subdet = HcalForward;
break;
default:
this_subdet = HcalEmpty;
break;
}
_ledCalibrationChannels[this_subdet].push_back(
HcalDetId(HcalOther, calibId.ieta(), calibId.iphi(), calibId.cboxChannel()));
}
}
}

std::vector<uint32_t> vVME;
std::vector<uint32_t> vuTCA;
vVME.push_back(
Expand Down Expand Up @@ -787,7 +788,7 @@ DigiTask::DigiTask(edm::ParameterSet const& ps) : DQTask(ps) {

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

// book the flag for unknown ids and the online guy as well
ib.setCurrentFolder(_subsystem + "/" + _name);
Expand Down Expand Up @@ -867,7 +868,6 @@ DigiTask::DigiTask(edm::ParameterSet const& ps) : DQTask(ps) {
if (did.subdet() == HcalOther) {
HcalOtherDetId hodid(digi.detid());
if (hodid.subdet() == HcalCalibration) {
// New method: use configurable list of channels
if (std::find(_ledCalibrationChannels[HcalEndcap].begin(),
_ledCalibrationChannels[HcalEndcap].end(),
did) != _ledCalibrationChannels[HcalEndcap].end()) {
Expand All @@ -885,6 +885,23 @@ DigiTask::DigiTask(edm::ParameterSet const& ps) : DQTask(ps) {
_LED_CUCountvsLSmod60_Subdet.fill(HcalDetId(HcalEndcap, 16, 1, 1), _currentLS % 60);
}
}
} else if (std::find(_ledCalibrationChannels[HcalBarrel].begin(),
_ledCalibrationChannels[HcalBarrel].end(),
did) != _ledCalibrationChannels[HcalBarrel].end()) {
bool channelLEDSignalPresent = false;
for (int i = 0; i < digi.samples(); i++) {
_LED_ADCvsBX_Subdet.fill(HcalDetId(HcalBarrel, 1, 1, 1), bx, digi[i].adc());

if (digi[i].adc() > _thresh_led) {
channelLEDSignalPresent = true;
}
}
if (channelLEDSignalPresent) {
_LED_CUCountvsLS_Subdet.fill(HcalDetId(HcalBarrel, 1, 1, 1), _currentLS);
if (_ptype == fOnline) {
_LED_CUCountvsLSmod60_Subdet.fill(HcalDetId(HcalBarrel, 1, 1, 1), _currentLS % 60);
}
}
}
}
}
Expand Down Expand Up @@ -1072,9 +1089,35 @@ DigiTask::DigiTask(edm::ParameterSet const& ps) : DQTask(ps) {

// HO collection
for (HODigiCollection::const_iterator it = c_ho->begin(); it != c_ho->end(); ++it) {
const HODataFrame digi = (const HODataFrame)(*it);
// Explicit check on the DetIds present in the Collection
HcalDetId const& did = it->id();
if (did.subdet() != HcalOuter) {
// LED monitoring from calibration channels
if (_ptype != fLocal) {
if (did.subdet() == HcalOther) {
HcalOtherDetId hodid(did);
if (hodid.subdet() == HcalCalibration) {
if (std::find(_ledCalibrationChannels[HcalOuter].begin(), _ledCalibrationChannels[HcalOuter].end(), did) !=
_ledCalibrationChannels[HcalOuter].end()) {
bool channelLEDSignalPresent = false;
for (int i = 0; i < digi.size(); i++) {
_LED_ADCvsBX_Subdet.fill(HcalDetId(HcalOuter, 1, 1, 4), bx, digi[i].adc());

if (digi[i].adc() > _thresh_led) {
channelLEDSignalPresent = true;
}
}
if (channelLEDSignalPresent) {
_LED_CUCountvsLS_Subdet.fill(HcalDetId(HcalOuter, 1, 1, 4), _currentLS);
if (_ptype == fOnline) {
_LED_CUCountvsLSmod60_Subdet.fill(HcalDetId(HcalOuter, 1, 1, 4), _currentLS % 60);
}
}
}
}
}
}
continue;
}
uint32_t rawid = _ehashmap.lookup(did);
Expand Down Expand Up @@ -1220,22 +1263,21 @@ DigiTask::DigiTask(edm::ParameterSet const& ps) : DQTask(ps) {
if (did.subdet() == HcalOther) {
HcalOtherDetId hodid(digi.detid());
if (hodid.subdet() == HcalCalibration) {
// New method: use configurable list of channels
if (std::find(_ledCalibrationChannels[HcalForward].begin(),
_ledCalibrationChannels[HcalForward].end(),
did) != _ledCalibrationChannels[HcalForward].end()) {
bool channelLEDSignalPresent = false;
for (int i = 0; i < digi.samples(); i++) {
_LED_ADCvsBX_Subdet.fill(HcalDetId(HcalForward, 16, 1, 1), bx, digi[i].adc());
_LED_ADCvsBX_Subdet.fill(HcalDetId(HcalForward, 29, 1, 1), bx, digi[i].adc());

if (digi[i].adc() > _thresh_led) {
channelLEDSignalPresent = true;
}
}
if (channelLEDSignalPresent) {
_LED_CUCountvsLS_Subdet.fill(HcalDetId(HcalForward, 16, 1, 1), _currentLS);
_LED_CUCountvsLS_Subdet.fill(HcalDetId(HcalForward, 29, 1, 1), _currentLS);
if (_ptype == fOnline) {
_LED_CUCountvsLSmod60_Subdet.fill(HcalDetId(HcalForward, 16, 1, 1), _currentLS % 60);
_LED_CUCountvsLSmod60_Subdet.fill(HcalDetId(HcalForward, 29, 1, 1), _currentLS % 60);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions DQM/HcalTasks/plugins/FCDTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ FCDTask::FCDTask(edm::ParameterSet const& ps) {
histoname = std::to_string(it_eid.crateId()) + "-" + std::to_string(it_eid.slot()) + "-" +
std::to_string(it_eid.fiberIndex()) + "-" + std::to_string(it_eid.fiberChanId());
ib.setCurrentFolder("Hcal/FCDTask/ADC");
_cADC[it_eid] = ib.book1D(histoname.c_str(), histoname.c_str(), 256, 0, 256);
_cADC[it_eid] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
_cADC[it_eid]->setAxisTitle("ADC", 1);
_cADC[it_eid]->setAxisTitle("N", 2);

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

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

ib.setCurrentFolder("Hcal/FCDTask/TDC");
_cTDC[it_eid] = ib.book1D(histoname.c_str(), histoname.c_str(), 64, -0.5, 63.5);
_cTDC[it_eid] = ib.book1DD(histoname.c_str(), histoname.c_str(), 64, -0.5, 63.5);
_cTDC[it_eid]->setAxisTitle("TDC", 1);
}
}
Expand Down
83 changes: 51 additions & 32 deletions DQM/HcalTasks/plugins/LEDTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,6 @@ LEDTask::LEDTask(edm::ParameterSet const& ps) : DQTask(ps) {
_lowHBHE = ps.getUntrackedParameter<double>("lowHBHE", 20);
_lowHO = ps.getUntrackedParameter<double>("lowHO", 20);
_lowHF = ps.getUntrackedParameter<double>("lowHF", 20);

// LED calibration channels
std::vector<edm::ParameterSet> vLedCalibChannels =
ps.getParameter<std::vector<edm::ParameterSet>>("ledCalibrationChannels");
for (int i = 0; i <= 3; ++i) {
HcalSubdetector this_subdet = HcalEmpty;
switch (i) {
case 0:
this_subdet = HcalBarrel;
break;
case 1:
this_subdet = HcalEndcap;
break;
case 2:
this_subdet = HcalOuter;
break;
case 3:
this_subdet = HcalForward;
break;
default:
this_subdet = HcalEmpty;
break;
}
std::vector<int32_t> subdet_calib_ietas = vLedCalibChannels[i].getUntrackedParameter<std::vector<int32_t>>("ieta");
std::vector<int32_t> subdet_calib_iphis = vLedCalibChannels[i].getUntrackedParameter<std::vector<int32_t>>("iphi");
std::vector<int32_t> subdet_calib_depths =
vLedCalibChannels[i].getUntrackedParameter<std::vector<int32_t>>("depth");
for (unsigned int ichannel = 0; ichannel < subdet_calib_ietas.size(); ++ichannel) {
_ledCalibrationChannels[this_subdet].push_back(HcalDetId(
HcalOther, subdet_calib_ietas[ichannel], subdet_calib_iphis[ichannel], subdet_calib_depths[ichannel]));
}
}
}

/* virtual */ void LEDTask::bookHistograms(DQMStore::IBooker& ib, edm::Run const& r, edm::EventSetup const& es) {
Expand All @@ -68,6 +36,38 @@ LEDTask::LEDTask(edm::ParameterSet const& ps) : DQTask(ps) {
es.get<HcalDbRecord>().get(dbService);
_emap = dbService->getHcalMapping();

// Book LED calibration channels from emap
std::vector<HcalElectronicsId> eids = _emap->allElectronicsId();
for (unsigned i = 0; i < eids.size(); i++) {
HcalElectronicsId eid = eids[i];
DetId id = _emap->lookup(eid);
if (HcalGenericDetId(id.rawId()).isHcalCalibDetId()) {
HcalCalibDetId calibId(id);
if (calibId.calibFlavor() == HcalCalibDetId::CalibrationBox) {
HcalSubdetector this_subdet = HcalEmpty;
switch (calibId.hcalSubdet()) {
case HcalBarrel:
this_subdet = HcalBarrel;
break;
case HcalEndcap:
this_subdet = HcalEndcap;
break;
case HcalOuter:
this_subdet = HcalOuter;
break;
case HcalForward:
this_subdet = HcalForward;
break;
default:
this_subdet = HcalEmpty;
break;
}
_ledCalibrationChannels[this_subdet].push_back(
HcalDetId(HcalOther, calibId.ieta(), calibId.iphi(), calibId.cboxChannel()));
}
}
}

std::vector<uint32_t> vhashVME;
std::vector<uint32_t> vhashuTCA;
std::vector<uint32_t> vhashC36;
Expand Down Expand Up @@ -514,6 +514,25 @@ LEDTask::LEDTask(edm::ParameterSet const& ps) : DQTask(ps) {
for (HODigiCollection::const_iterator it = c_ho->begin(); it != c_ho->end(); ++it) {
const HODataFrame digi = (const HODataFrame)(*it);
HcalDetId did = digi.id();
if (did.subdet() != HcalOuter) {
// LED monitoring from calibration channels
if (did.subdet() == HcalOther) {
HcalOtherDetId hodid(did);
if (hodid.subdet() == HcalCalibration) {
if (std::find(_ledCalibrationChannels[HcalOuter].begin(), _ledCalibrationChannels[HcalOuter].end(), did) !=
_ledCalibrationChannels[HcalOuter].end()) {
for (int i = 0; i < digi.size(); i++) {
if (_ptype == fOnline) {
_LED_ADCvsBX_Subdet.fill(HcalDetId(HcalOuter, 1, 1, 4), e.bunchCrossing(), digi[i].adc());
} else if (_ptype == fLocal) {
_LED_ADCvsEvn_Subdet.fill(
HcalDetId(HcalOuter, 1, 1, 4), e.eventAuxiliary().id().event(), digi[i].adc());
}
}
}
}
}
}
HcalElectronicsId eid = digi.elecId();
//double sumQ = hcaldqm::utilities::sumQ<HODataFrame>(digi, 8.5, 0, digi.size()-1);
CaloSamples digi_fC = hcaldqm::utilities::loadADC2fCDB<HODataFrame>(_dbService, did, digi);
Expand Down
Loading