45 const double NORBITS_PER_LS = 262144.;
52 show_mechanical_structure_view(
true),
53 show_readout_view(
false),
54 show_control_view(
false),
55 select_all_detectors(
true),
56 reset_each_run(
false),
207 edm::LogInfo(
"SiStripMonitorDigi") <<
"SiStripMonitorDigi::bookHistograms: "
208 <<
" Creating MEs for new Cabling ";
212 edm::LogInfo(
"SiStripMonitorDigi") <<
"SiStripMonitorDigi::bookHistograms: "
213 <<
" Resetting MEs ";
214 for (std::map<uint32_t, ModMEs>::const_iterator idet =
DigiMEs.begin(); idet !=
DigiMEs.end(); idet++) {
244 runInfoRec->get(sumFED);
247 std::vector<int> FedsInIds = sumFED->
m_fed_in;
248 for (
unsigned int it = 0; it < FedsInIds.size(); ++it) {
249 int fedID = FedsInIds[it];
252 if (fedID >= 50 && fedID <= 133)
254 if (fedID >= 134 && fedID <= 148)
256 if (fedID >= 149 && fedID <= 163)
258 if (fedID >= 164 && fedID <= 259)
260 if (fedID >= 260 && fedID <= 355)
262 if (fedID >= 356 && fedID <= 489)
273 bool isStableBeams =
false;
274 return std::make_shared<bool>(isStableBeams);
280 const bool isStableBeams = luminosityBlockCache(lb.
index());
287 int nFeds[6] = {96, 96, 84, 15, 15, 134};
291 for (
int ibin = 1; ibin < 7; ibin++) {
301 (
float)nFedsConnected[ibin - 1] / nFeds[ibin - 1] > 0.5 &&
value < 50.) {
326 std::vector<uint32_t> activeDets;
331 for (std::vector<uint32_t>::iterator idets = activeDets.begin(); idets != activeDets.end(); idets++) {
333 activeDets.erase(idets);
347 std::make_unique<TkHistoMap>(tkDetMap, ibooker,
topFolderName_,
"TkHMap_NStripApvShots", 0.0,
true);
350 std::make_unique<TkHistoMap>(tkDetMap, ibooker,
topFolderName_,
"TkHMap_MedianChargeApvShots", 0.0,
true);
352 std::vector<uint32_t> tibDetIds;
355 edm::LogInfo(
"SiStripTkDQM|SiStripMonitorDigi") <<
"nr. of activeDets: " << activeDets.size();
356 for (std::vector<uint32_t>::const_iterator detid_iterator = activeDets.begin(); detid_iterator != activeDets.end();
358 uint32_t detid = (*detid_iterator);
377 DigiMEs.insert(std::make_pair(detid, local_modmes));
386 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(
label);
389 int32_t lnumber = det_layer_pair.second;
390 std::vector<uint32_t> layerDetIds;
391 if (det_layer_pair.first ==
"TIB") {
393 }
else if (det_layer_pair.first ==
"TOB") {
395 }
else if (det_layer_pair.first ==
"TID" && lnumber > 0) {
397 }
else if (det_layer_pair.first ==
"TID" && lnumber < 0) {
399 }
else if (det_layer_pair.first ==
"TEC" && lnumber > 0) {
401 }
else if (det_layer_pair.first ==
"TEC" && lnumber < 0) {
415 ibooker.setCurrentFolder(sdet_pair.first);
426 const char*
HistoName =
"Summary Mean Apv shots for SubDets";
440 const char*
HistoName =
"NApv_Shots_vs_Time";
459 const char*
HistoName =
"Number_of_Strips_in_Apv_Shots";
471 const char*
HistoName =
"Number_of_Apv_Shots";
484 const char*
HistoName =
"Apv_Shots_Charge_Median";
497 const char*
HistoName =
"Apv_Shots_Apv_Number";
509 const char*
HistoName =
"NumberOfDigisinFED_v_FEDID";
531 std::stringstream
ss;
534 ibooker.setCurrentFolder(
ss.str());
537 const char*
HistoName =
"NumberOfDigisInLastLS";
555 Parameters.getParameter<int32_t>(
"Nbins") + 1,
593 std::vector<edm::EDGetTokenT<edm::DetSetVector<SiStripDigi> > >::const_iterator iToken =
599 iEvent.getByToken(*iToken, digi_handle);
607 iSubdet->second.totNDigis = 0;
608 iSubdet->second.SubDetApvShots.clear();
611 std::map<int, int> FEDID_v_digisum;
618 std::vector<uint32_t> layer_dets = iterLayer->second;
619 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_label);
627 local_layermes = iLayerME->second;
629 int largest_adc_layer = 0;
630 int smallest_adc_layer = 99999;
639 for (std::vector<uint32_t>::const_iterator iterDets = layer_dets.begin(); iterDets != layer_dets.end();
644 uint32_t detid = (*iterDets);
647 if (subdet_label.empty())
652 std::map<uint32_t, ModMEs>::iterator
pos =
DigiMEs.find(detid);
671 int good_fcc_index = -999;
672 for (
unsigned int x = 0;
x < fedConnections.size();
x++) {
673 if (fedConnections[
x] !=
nullptr) {
678 if (fedConnections[good_fcc_index] !=
nullptr) {
679 int temp_fedid = fedConnections[good_fcc_index]->fedId();
680 if (FEDID_v_digisum.find(temp_fedid) != FEDID_v_digisum.end()) {
681 if (ndigi_det < 1000 && ndigi_det > 0) {
682 FEDID_v_digisum[temp_fedid] = FEDID_v_digisum.find(temp_fedid)->second + ndigi_det;
685 if (ndigi_det < 1000 && ndigi_det > 0) {
686 FEDID_v_digisum[temp_fedid] = ndigi_det;
691 <<
"SiStripMonitorDigi::analyze WARNING! no good connections for detid = " << detid << std::endl;
696 const std::vector<APVShot>& shots = theShotFinder.
getShots();
720 ndigi_layer += ndigi_det;
723 int largest_adc = (digi_detset.
data.begin())->
adc();
724 int smallest_adc = (digi_detset.
data.begin())->
adc();
727 float det_occupancy = 0.0;
730 digiIter != digi_detset.
data.end();
732 int this_adc = digiIter->adc();
737 if (this_adc > largest_adc)
738 largest_adc = this_adc;
739 if (this_adc < smallest_adc)
740 smallest_adc = this_adc;
747 (local_modmes.
DigiADCs)->Fill(static_cast<float>(this_adc));
763 if (nstrips > 0 && det_occupancy > 0) {
764 det_occupancy = det_occupancy / nstrips;
774 if (largest_adc > largest_adc_layer)
775 largest_adc_layer = largest_adc;
776 if (smallest_adc < smallest_adc_layer)
777 smallest_adc_layer = smallest_adc;
805 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
807 iSubdet->second.totNDigis += ndigi_layer;
812 bool& isStableBeams = *luminosityBlockCache(
iEvent.getLuminosityBlock().index());
823 edm::LogInfo(
"DQMProvInfo") <<
" gtfeEvmWord inaccessible";
826 if (gtfeEvmExtWord.
beamMode() == 11)
827 isStableBeams =
true;
832 if (strcmp(it->first.c_str(),
"TEC__MINUS") == 0) {
834 }
else if (strcmp(it->first.c_str(),
"TEC__PLUS") == 0) {
836 }
else if (strcmp(it->first.c_str(),
"TIB") == 0) {
838 }
else if (strcmp(it->first.c_str(),
"TID__MINUS") == 0) {
840 }
else if (strcmp(it->first.c_str(),
"TID__PLUS") == 0) {
842 }
else if (strcmp(it->first.c_str(),
"TOB") == 0) {
848 if (strcmp(it->first.c_str(),
"TEC__MINUS") == 0) {
850 }
else if (strcmp(it->first.c_str(),
"TEC__PLUS") == 0) {
852 }
else if (strcmp(it->first.c_str(),
"TIB") == 0) {
854 }
else if (strcmp(it->first.c_str(),
"TID__MINUS") == 0) {
856 }
else if (strcmp(it->first.c_str(),
"TID__PLUS") == 0) {
858 }
else if (strcmp(it->first.c_str(),
"TOB") == 0) {
876 for (
uint i = 0;
i < ShotsSize;
906 std::map<int, int>::iterator it;
907 for (it = FEDID_v_digisum.begin(); it != FEDID_v_digisum.end(); it++) {
928 subdetmes = it->second;
931 long long tbx_corr = tbx;
938 tbx_corr -= the_phase;
949 std::map<uint32_t, ModMEs>::iterator
pos =
DigiMEs.find(idet);
967 const char* ParameterSetLabel,
985 me->setAxisTitle(
"Lumisection", 1);
987 me->getTH1()->SetCanExtend(TH1::kAllAxes);
993 const char* ParameterSetLabel,
1020 hid = hidmanager.
createHistoId(
"NumberOfDigis",
"det", detid);
1021 mod_single.
NumberOfDigis = ibooker.book1D(hid, hid, 21, -0.5, 20.5);
1028 hid = hidmanager.
createHistoId(
"NumberOfDigisPerStrip",
"det", detid);
1036 hid = hidmanager.
createHistoId(
"ADCsHottestStrip",
"det", detid);
1043 hid = hidmanager.
createHistoId(
"ADCsCoolestStrip",
"det", detid);
1057 hid = hidmanager.
createHistoId(
"StripOccupancy",
"det", detid);
1068 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(
label);
1102 "TH1ADCsHottestStrip",
1107 "TH1ADCsHottestStrip",
1115 "TH1ADCsCoolestStrip",
1120 "TH1ADCsCoolestStrip",
1137 "TH1StripOccupancy",
1142 "TH1StripOccupancy",
1154 layerMEs.
LayerDigiADCProfile = ibooker.bookProfile(hid, hid, ndets, 0.5, ndets + 0.5, 64, -0.5, 255.5);
1219 double h2ymax = 9999.0;
1220 double yfact =
Parameters.getParameter<
double>(
"yfactor");
1221 if (
label.find(
"TIB") != std::string::npos)
1222 h2ymax = (6984. * 256.) * yfact;
1223 else if (
label.find(
"TID") != std::string::npos)
1224 h2ymax = (2208. * 256.) * yfact;
1225 else if (
label.find(
"TOB") != std::string::npos)
1226 h2ymax = (12906. * 256.) * yfact;
1227 else if (
label.find(
"TEC") != std::string::npos)
1228 h2ymax = (7552. * 2. * 256.) * yfact;
1329 std::vector<APVShot>& subdetShots) {
1330 for (
uint i = 0;
i < moduleShots.size();
i++) {
1331 subdetShots.push_back(moduleShots[
i]);
1336 for (
uint i = 0;
i < shots.size();
i++) {