@@ -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 }
0 commit comments