44 const double NORBITS_PER_LS = 262144.;
51 show_mechanical_structure_view(
true),
52 show_readout_view(
false),
53 show_control_view(
false),
54 select_all_detectors(
true),
55 reset_each_run(
false),
73 for (
auto const&
tag : digiProducerList) {
185 if (subdetswitchtotdigifailureon) {
216 edm::LogInfo(
"SiStripMonitorDigi") <<
"SiStripMonitorDigi::bookHistograms: "
217 <<
" Creating MEs for new Cabling ";
221 edm::LogInfo(
"SiStripMonitorDigi") <<
"SiStripMonitorDigi::bookHistograms: "
222 <<
" Resetting MEs ";
223 for (std::map<uint32_t, ModMEs>::const_iterator idet =
DigiMEs.begin(); idet !=
DigiMEs.end(); idet++) {
253 std::vector<int> FedsInIds = sumFED->m_fed_in;
254 for (
unsigned int it = 0; it < FedsInIds.size(); ++it) {
255 int fedID = FedsInIds[it];
258 if (fedID >= 50 && fedID <= 133)
260 if (fedID >= 134 && fedID <= 148)
262 if (fedID >= 149 && fedID <= 163)
264 if (fedID >= 164 && fedID <= 259)
266 if (fedID >= 260 && fedID <= 355)
268 if (fedID >= 356 && fedID <= 489)
279 bool isStableBeams =
false;
280 return std::make_shared<bool>(isStableBeams);
286 const bool isStableBeams = luminosityBlockCache(lb.
index());
293 int nFeds[6] = {96, 96, 84, 15, 15, 134};
297 for (
int ibin = 1; ibin < 7; ibin++) {
307 (
float)nFedsConnected[ibin - 1] / nFeds[ibin - 1] > 0.5 && value < 50.) {
333 for (std::vector<uint32_t>::iterator idets = activeDets.begin(); idets != activeDets.end(); idets++) {
335 activeDets.erase(idets);
349 std::make_unique<TkHistoMap>(tkDetMap, ibooker,
topFolderName_,
"TkHMap_NStripApvShots", 0.0,
true);
352 std::make_unique<TkHistoMap>(tkDetMap, ibooker,
topFolderName_,
"TkHMap_MedianChargeApvShots", 0.0,
true);
354 std::vector<uint32_t> tibDetIds;
357 edm::LogInfo(
"SiStripTkDQM|SiStripMonitorDigi") <<
"nr. of activeDets: " << activeDets.size();
358 for (std::vector<uint32_t>::const_iterator detid_iterator = activeDets.begin(); detid_iterator != activeDets.end();
360 uint32_t detid = (*detid_iterator);
379 DigiMEs.insert(std::make_pair(detid, local_modmes));
383 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo);
388 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
391 int32_t lnumber = det_layer_pair.second;
392 std::vector<uint32_t> layerDetIds;
393 if (det_layer_pair.first ==
"TIB") {
395 }
else if (det_layer_pair.first ==
"TOB") {
397 }
else if (det_layer_pair.first ==
"TID" && lnumber > 0) {
399 }
else if (det_layer_pair.first ==
"TID" && lnumber < 0) {
401 }
else if (det_layer_pair.first ==
"TEC" && lnumber > 0) {
403 }
else if (det_layer_pair.first ==
"TEC" && lnumber < 0) {
410 folder_organizer.
setLayerFolder(detid, tTopo, det_layer_pair.second);
417 ibooker.setCurrentFolder(sdet_pair.first);
425 ibooker.setCurrentFolder(topFolderName_ +
"/MechanicalView/");
428 const char*
HistoName =
"Summary Mean Apv shots for SubDets";
429 NApvShotsGlobalProf = ibooker.bookProfile(HistoName, HistoName, 6, 0.5, 6.5, 100, 0., 0.,
"");
442 const char*
HistoName =
"NApv_Shots_vs_Time";
461 const char*
HistoName =
"Number_of_Strips_in_Apv_Shots";
473 const char*
HistoName =
"Number_of_Apv_Shots";
486 const char*
HistoName =
"Apv_Shots_Charge_Median";
499 const char*
HistoName =
"Apv_Shots_Apv_Number";
511 const char*
HistoName =
"NumberOfDigisinFED_v_FEDID";
533 std::stringstream
ss;
536 ibooker.setCurrentFolder(ss.str());
539 const char*
HistoName =
"NumberOfDigisInLastLS";
593 std::vector<edm::EDGetTokenT<edm::DetSetVector<SiStripDigi> > >::const_iterator iToken =
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);
653 ModMEs local_modmes = pos->second;
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;
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++) {
923 long long tbx = event_history->absoluteBX();
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);
950 ModMEs mod_me = pos->second;
967 const char* ParameterSetLabel,
985 me->setAxisTitle(
"Lumisection", 1);
987 me->setCanExtend(TH1::kAllAxes);
993 const char* ParameterSetLabel,
996 return ibooker.
book1D(HistoName,
1007 me->
Fill(timeinorbit, value);
1020 hid = hidmanager.
createHistoId(
"NumberOfDigis",
"det", detid);
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);
1090 hidmanager.
createHistoLayer(
"Summary_TotalNumberOfDigis",
"layer", label,
"").c_str());
1095 hidmanager.
createHistoLayer(
"Trend_NumberOfDigis",
"layer", label,
"").c_str());
1102 "TH1ADCsHottestStrip",
1103 hidmanager.
createHistoLayer(
"Summary_ADCsHottestStrip",
"layer", label,
"").c_str());
1107 "TH1ADCsHottestStrip",
1108 hidmanager.
createHistoLayer(
"Trend_ADCsHottestStrip",
"layer", label,
"").c_str());
1115 "TH1ADCsCoolestStrip",
1116 hidmanager.
createHistoLayer(
"Summary_ADCsCoolestStrip",
"layer", label,
"").c_str());
1120 "TH1ADCsCoolestStrip",
1121 hidmanager.
createHistoLayer(
"Trend_ADCsCoolestStrip",
"layer", label,
"").c_str());
1130 ibooker,
"TH1DigiADCs", hidmanager.
createHistoLayer(
"Trend_DigiADCs",
"layer", label,
"").c_str());
1137 "TH1StripOccupancy",
1138 hidmanager.
createHistoLayer(
"Summary_StripOccupancy",
"layer", label,
"").c_str());
1142 "TH1StripOccupancy",
1143 hidmanager.
createHistoLayer(
"Trend_StripOccupancy",
"layer", label,
"").c_str());
1181 HistoName =
"TotalNumberOfDigiProfile__" +
label;
1200 HistoName =
"Digi_vs_ApvCycle__" +
label;
1217 HistoName =
"Digi_vs_ApvCycle_2D__" +
label;
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;
1230 ibooker.
book2D(HistoName,
1245 HistoName =
"Number_of_Apv_Shots_" +
label;
1258 HistoName =
"Number_of_Strips_in_Apv_Shots_" +
label;
1271 HistoName =
"Apv_Shots_Charge_Median_" +
label;
1283 HistoName =
"Apv_Shots_Apv_Number_" +
label;
1295 HistoName =
"NApv_Shots_vs_Time_" +
label;
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++) {
LuminosityBlockID id() const
void ResetModuleMEs(uint32_t idet)
bool subdetswitchapvcycleth2on
std::optional< T > tryToGet() const
std::map< std::string, LayerMEs > LayerMEsMap
void getTIBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tibDetRawIds, const TrackerTopology *trackerTopology, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t int_ext=0, uint32_t string=0)
bool globalswitchNDigisFEDID
bool moduleswitchnumdigison
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
int integrateNLumisections_
virtual DQM_DEPRECATED void setCanExtend(unsigned int value)
void createMEs(DQMStore::IBooker &ibooker, const edm::EventSetup &es)
MonitorElement * LayerNumberOfDigisTrend
std::pair< const std::string, const char * > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
LuminosityBlockIndex index() const
MonitorElement * SubDetTotDigiProf
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
MonitorElement * LayerStripOccupancy
bool globalswitchapvshotsonprof
bool layerswitchdigiadcson
MonitorElement * LayerADCsHottestStrip
bool layerswitchnumdigisprofon
bool subdetswitchapvshotsApvon
MonitorElement * SubDetDigiFailures2D
edm::InputTag historyProducer_
const L1GtfeExtWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
MonitorElement * LayerADCsHottestStripTrend
std::unique_ptr< TkHistoMap > tkmapNstripApvshot
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoTokenRun_
void getTIDDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tidDetRawIds, const TrackerTopology *trackerTopology, uint32_t side=0, uint32_t wheel=0, uint32_t ring=0, uint32_t ster=0)
Kind kind() const
Get the type of the monitor element.
MonitorElement * NApvShotsGlobalProf
std::map< uint32_t, ModMEs > DigiMEs
std::map< std::string, std::string > SubDetPhasePartMap
void getLayerFolderName(std::stringstream &ss, uint32_t rawdetid, const TrackerTopology *tTopo, bool ring_flag=false)
MonitorElement * MedianChargeApvShotsGlobal
MonitorElement * StripMultiplicityApvShotsGlobal
const SiStripDetCabling * SiStripDetCabling_
bool globalsummaryapvshotson
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=false)
bool layerswitchdigiadcprofon
MonitorElement * SubDetDigiApvTH2
MonitorElement * StripOccupancy
bool subdetswitchtotdigiprofon
MonitorElement * SubDetDigiApvProf
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoTokenRun_
void getTECDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tecDetRawIds, const TrackerTopology *trackerTopology, uint32_t side=0, uint32_t wheel=0, uint32_t petal_bkw_frw=0, uint32_t petal=0, uint32_t ring=0, uint32_t ster=0)
edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapTokenRun_
std::unique_ptr< TkHistoMap > tkmapMedianChargeApvshots
MonitorElement * LayerNumberOfDigisProfile
tuple nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bool globalswitchnapvshotson
void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c) override
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
bool subdetswitchchargemedianapvshotson
std::vector< APVShot > SubDetApvShots
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
unsigned long long m_cacheID_
MonitorElement * SubDetNApvShotsNApvTH1
void createSubDetMEs(DQMStore::IBooker &ibooker, std::string label)
bool getData(T &iHolder) const
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
void globalEndLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &iSetup) override
bool getStatus(edm::Event const &e, edm::EventSetup const &eSetup)
MonitorElement * NumberOfDigisPerStrip
const std::vector< APVShot > & getShots() const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
bool subdetswitchapvcycleprofon
MonitorElement * ADCsCoolestStrip
vector< ParameterSet > Parameters
bool moduleswitchadchotteston
bool globalswitchapvshotsApvon
SiStripDCSStatus * dcsStatus_
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
MonitorElement * LayerADCsCoolestStripTrend
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * SubDetNStripsApvShotsTH1
bool shotsstripshistomapon
DigiFailureMEs digiFailureMEs
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< EventWithHistory > historyProducerToken_
MonitorElement * SubDetTotDigiProfLS
std::vector< uint32_t > activeDets
void fillME(MonitorElement *ME, float value1)
MonitorElement * bookME1D(DQMStore::IBooker &ibooker, const char *ParameterSetLabel, const char *HistoName)
MonitorElement * LayerDigiADCs
MonitorElement * LayerNumberOfDigis
MonitorElement * NApvApvShotsGlobal
Abs< T >::type abs(const T &t)
std::vector< float > vecSubDetTotDigiProfLS
bool layerswitchnumdigison
LuminosityBlock const & getLuminosityBlock() const
std::shared_ptr< bool > globalBeginLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &iSetup) const override
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > SiStripDetCablingTokenRun_
bool globalswitchnstripsapvshotson
std::map< std::string, SubDetMEs > SubDetMEsMap
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
MonitorElement * ADCsHottestStrip
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
virtual double getBinContent(int binx) const
get content of bin (1-D)
bool shotschargehistomapon
void createLayerMEs(DQMStore::IBooker &ibooker, std::string label, int ndet)
void fillTrend(MonitorElement *me, float value, float timeinorbit)
MonitorElement * SubDetNApvShotsProf
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmToken_
MonitorElement * NApvShotsGlobal
std::vector< edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > > digiProducerTokenList
MonitorElement * LayerDigiADCProfile
bool moduleswitchstripoccupancyon
SiStripHistoId hidmanager
bool subdetswitchtotdigifailureon
std::vector< const edm::DetSetVector< SiStripDigi > * > digi_detset_handles
~SiStripMonitorDigi() override
Log< level::Info, false > LogInfo
int getDigiSourceIndex(uint32_t id)
void analyze(const edm::Event &, const edm::EventSetup &) override
SiStripMonitorDigi(const edm::ParameterSet &)
edm::InputTag apvPhaseProducer_
std::unique_ptr< TkHistoMap > tkmapNApvshots
MonitorElement * NumberOfDigis
T const * product() const
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
MonitorElement * SubDetChargeMedianApvShotsTH1
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void fill(DetId detid, float value)
bool moduleswitchadccooleston
T getParameter(std::string const &) const
SiStripFolderOrganizer folder_organizer
LuminosityBlockNumber_t luminosityBlock() const
virtual DQM_DEPRECATED void setStatOverflows(bool value)
MonitorElement * bookMETrend(DQMStore::IBooker &ibooker, const char *ParameterSetLabel, const char *HistoName)
std::map< std::string, std::vector< uint32_t > > LayerDetMap
bool globalswitchchargemedianapvshotson
std::string topFolderName_
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=false)
bool subdetswitchnstripsapvshotson
std::unique_ptr< TkHistoMap > tkmapdigi
std::vector< edm::InputTag > digiProducerList
const uint16_t nApvPairs(uint32_t det_id) const
edm::EDGetTokenT< APVCyclePhaseCollection > apvPhaseProducerToken_
bool layerswitchadchotteston
MonitorElement * LayerStripOccupancyTrend
bool moduleswitchnumdigispstripon
MonitorElement * LayerADCsCoolestStrip
int ignoreFirstNLumisections_
bool moduleswitchdigiadcson
bool layerswitchstripoccupancyon
MonitorElement * SubDetNApvShotsTH1
void AddApvShotsToSubDet(const std::vector< APVShot > &, std::vector< APVShot > &)
SiStripFolderOrganizer folder_organizer
bool subdetswitchapvshotsonprof
MonitorElement * ShotsVsTimeApvShotsGlobal
MonitorElement * DigiADCs
void getTOBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tobDetRawIds, const TrackerTopology *trackerTopology, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t rod=0)
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
const cms_uint16_t beamMode() const
void FillApvShotsMap(TkHistoMap *, const std::vector< APVShot > &, uint32_t id, int)
MonitorElement * LayerDigiADCsTrend
MonitorElement * NumberOfFEDDigis
bool show_mechanical_structure_view
bool layerswitchadccooleston
void createModuleMEs(DQMStore::IBooker &ibooker, ModMEs &mod_single, uint32_t detid)
uint16_t *__restrict__ uint16_t const *__restrict__ adc
bool subdetswitchnapvshotson
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)