46 const double NORBITS_PER_LS = 262144.;
53 show_mechanical_structure_view(
true),
54 show_readout_view(
false),
55 show_control_view(
false),
56 select_all_detectors(
true),
57 reset_each_run(
false),
218 edm::LogInfo(
"SiStripMonitorDigi") <<
"SiStripMonitorDigi::bookHistograms: " 219 <<
" Creating MEs for new Cabling ";
223 edm::LogInfo(
"SiStripMonitorDigi") <<
"SiStripMonitorDigi::bookHistograms: " 224 <<
" Resetting MEs ";
225 for (std::map<uint32_t, ModMEs>::const_iterator idet =
DigiMEs.begin(); idet !=
DigiMEs.end(); idet++) {
255 std::vector<int> FedsInIds = sumFED->
m_fed_in;
256 for (
unsigned int it = 0;
it < FedsInIds.size(); ++
it) {
257 int fedID = FedsInIds[
it];
260 if (fedID >= 50 && fedID <= 133)
262 if (fedID >= 134 && fedID <= 148)
264 if (fedID >= 149 && fedID <= 163)
266 if (fedID >= 164 && fedID <= 259)
268 if (fedID >= 260 && fedID <= 355)
270 if (fedID >= 356 && fedID <= 489)
281 bool isStableBeams =
false;
282 return std::make_shared<bool>(isStableBeams);
288 const bool isStableBeams = luminosityBlockCache(lb.
index());
295 int nFeds[6] = {96, 96, 84, 15, 15, 134};
299 for (
int ibin = 1; ibin < 7; ibin++) {
309 (
float)nFedsConnected[ibin - 1] / nFeds[ibin - 1] > 0.5 &&
value < 50.) {
330 std::vector<uint32_t> activeDets;
335 for (std::vector<uint32_t>::iterator idets = activeDets.begin(); idets != activeDets.end(); idets++) {
337 activeDets.erase(idets);
351 std::make_unique<TkHistoMap>(tkDetMap, ibooker,
topFolderName_,
"TkHMap_NStripApvShots", 0.0,
true);
354 std::make_unique<TkHistoMap>(tkDetMap, ibooker,
topFolderName_,
"TkHMap_MedianChargeApvShots", 0.0,
true);
356 std::vector<uint32_t> tibDetIds;
359 edm::LogInfo(
"SiStripTkDQM|SiStripMonitorDigi") <<
"nr. of activeDets: " << activeDets.size();
360 for (std::vector<uint32_t>::const_iterator detid_iterator = activeDets.begin(); detid_iterator != activeDets.end();
362 uint32_t detid = (*detid_iterator);
381 DigiMEs.insert(std::make_pair(detid, local_modmes));
390 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(
label);
393 int32_t lnumber = det_layer_pair.second;
394 std::vector<uint32_t> layerDetIds;
395 if (det_layer_pair.first ==
"TIB") {
397 }
else if (det_layer_pair.first ==
"TOB") {
399 }
else if (det_layer_pair.first ==
"TID" && lnumber > 0) {
401 }
else if (det_layer_pair.first ==
"TID" && lnumber < 0) {
403 }
else if (det_layer_pair.first ==
"TEC" && lnumber > 0) {
405 }
else if (det_layer_pair.first ==
"TEC" && lnumber < 0) {
419 ibooker.setCurrentFolder(sdet_pair.first);
430 const char*
HistoName =
"Summary Mean Apv shots for SubDets";
444 const char*
HistoName =
"NApv_Shots_vs_Time";
463 const char*
HistoName =
"Number_of_Strips_in_Apv_Shots";
475 const char*
HistoName =
"Number_of_Apv_Shots";
488 const char*
HistoName =
"Apv_Shots_Charge_Median";
501 const char*
HistoName =
"Apv_Shots_Apv_Number";
513 const char*
HistoName =
"NumberOfDigisinFED_v_FEDID";
535 std::stringstream
ss;
538 ibooker.setCurrentFolder(
ss.str());
541 const char*
HistoName =
"NumberOfDigisInLastLS";
559 Parameters.getParameter<int32_t>(
"Nbins") + 1,
595 std::vector<edm::EDGetTokenT<edm::DetSetVector<SiStripDigi> > >::const_iterator iToken =
601 iEvent.getByToken(*iToken, digi_handle);
609 iSubdet->second.totNDigis = 0;
610 iSubdet->second.SubDetApvShots.clear();
613 std::map<int, int> FEDID_v_digisum;
620 std::vector<uint32_t> layer_dets = iterLayer->second;
621 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_label);
629 local_layermes = iLayerME->second;
631 int largest_adc_layer = 0;
632 int smallest_adc_layer = 99999;
641 for (std::vector<uint32_t>::const_iterator iterDets = layer_dets.begin(); iterDets != layer_dets.end();
646 uint32_t detid = (*iterDets);
649 if (subdet_label.empty())
654 std::map<uint32_t, ModMEs>::iterator
pos =
DigiMEs.find(detid);
673 int good_fcc_index = -999;
674 for (
unsigned int x = 0;
x < fedConnections.size();
x++) {
675 if (fedConnections[
x] !=
nullptr) {
680 if (fedConnections[good_fcc_index] !=
nullptr) {
681 int temp_fedid = fedConnections[good_fcc_index]->fedId();
682 if (FEDID_v_digisum.find(temp_fedid) != FEDID_v_digisum.end()) {
683 if (ndigi_det < 1000 && ndigi_det > 0) {
684 FEDID_v_digisum[temp_fedid] = FEDID_v_digisum.find(temp_fedid)->second + ndigi_det;
687 if (ndigi_det < 1000 && ndigi_det > 0) {
688 FEDID_v_digisum[temp_fedid] = ndigi_det;
693 <<
"SiStripMonitorDigi::analyze WARNING! no good connections for detid = " << detid << std::endl;
698 const std::vector<APVShot>& shots = theShotFinder.
getShots();
722 ndigi_layer += ndigi_det;
725 int largest_adc = (digi_detset.
data.begin())->
adc();
726 int smallest_adc = (digi_detset.
data.begin())->
adc();
729 float det_occupancy = 0.0;
732 digiIter != digi_detset.
data.end();
734 int this_adc = digiIter->adc();
739 if (this_adc > largest_adc)
740 largest_adc = this_adc;
741 if (this_adc < smallest_adc)
742 smallest_adc = this_adc;
749 (local_modmes.
DigiADCs)->Fill(static_cast<float>(this_adc));
765 if (nstrips > 0 && det_occupancy > 0) {
766 det_occupancy = det_occupancy / nstrips;
776 if (largest_adc > largest_adc_layer)
777 largest_adc_layer = largest_adc;
778 if (smallest_adc < smallest_adc_layer)
779 smallest_adc_layer = smallest_adc;
807 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
809 iSubdet->second.totNDigis += ndigi_layer;
814 bool& isStableBeams = *luminosityBlockCache(
iEvent.getLuminosityBlock().index());
825 edm::LogInfo(
"DQMProvInfo") <<
" gtfeEvmWord inaccessible";
828 if (gtfeEvmExtWord.
beamMode() == 11)
829 isStableBeams =
true;
834 if (strcmp(
it->first.c_str(),
"TEC__MINUS") == 0) {
836 }
else if (strcmp(
it->first.c_str(),
"TEC__PLUS") == 0) {
838 }
else if (strcmp(
it->first.c_str(),
"TIB") == 0) {
840 }
else if (strcmp(
it->first.c_str(),
"TID__MINUS") == 0) {
842 }
else if (strcmp(
it->first.c_str(),
"TID__PLUS") == 0) {
844 }
else if (strcmp(
it->first.c_str(),
"TOB") == 0) {
850 if (strcmp(
it->first.c_str(),
"TEC__MINUS") == 0) {
852 }
else if (strcmp(
it->first.c_str(),
"TEC__PLUS") == 0) {
854 }
else if (strcmp(
it->first.c_str(),
"TIB") == 0) {
856 }
else if (strcmp(
it->first.c_str(),
"TID__MINUS") == 0) {
858 }
else if (strcmp(
it->first.c_str(),
"TID__PLUS") == 0) {
860 }
else if (strcmp(
it->first.c_str(),
"TOB") == 0) {
878 for (
uint i = 0;
i < ShotsSize;
908 std::map<int, int>::iterator
it;
909 for (
it = FEDID_v_digisum.begin();
it != FEDID_v_digisum.end();
it++) {
930 subdetmes =
it->second;
933 long long tbx_corr = tbx;
940 tbx_corr -= the_phase;
951 std::map<uint32_t, ModMEs>::iterator
pos =
DigiMEs.find(idet);
969 const char* ParameterSetLabel,
987 me->setAxisTitle(
"Lumisection", 1);
989 me->setCanExtend(TH1::kAllAxes);
995 const char* ParameterSetLabel,
1022 hid = hidmanager.
createHistoId(
"NumberOfDigis",
"det", detid);
1030 hid = hidmanager.
createHistoId(
"NumberOfDigisPerStrip",
"det", detid);
1038 hid = hidmanager.
createHistoId(
"ADCsHottestStrip",
"det", detid);
1045 hid = hidmanager.
createHistoId(
"ADCsCoolestStrip",
"det", detid);
1059 hid = hidmanager.
createHistoId(
"StripOccupancy",
"det", detid);
1070 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(
label);
1104 "TH1ADCsHottestStrip",
1109 "TH1ADCsHottestStrip",
1117 "TH1ADCsCoolestStrip",
1122 "TH1ADCsCoolestStrip",
1139 "TH1StripOccupancy",
1144 "TH1StripOccupancy",
1211 double h2ymax = 9999.0;
1212 double yfact =
Parameters.getParameter<
double>(
"yfactor");
1213 if (
label.find(
"TIB") != std::string::npos)
1214 h2ymax = (6984. * 256.) * yfact;
1215 else if (
label.find(
"TID") != std::string::npos)
1216 h2ymax = (2208. * 256.) * yfact;
1217 else if (
label.find(
"TOB") != std::string::npos)
1218 h2ymax = (12906. * 256.) * yfact;
1219 else if (
label.find(
"TEC") != std::string::npos)
1220 h2ymax = (7552. * 2. * 256.) * yfact;
1321 std::vector<APVShot>& subdetShots) {
1322 for (
uint i = 0;
i < moduleShots.size();
i++) {
1323 subdetShots.push_back(moduleShots[
i]);
1328 for (
uint i = 0;
i < shots.size();
i++) {
void ResetModuleMEs(uint32_t idet)
uint32_t second(const DetId &id) const
bool subdetswitchapvcycleth2on
LuminosityBlockNumber_t luminosityBlock() const
T getParameter(std::string const &) const
std::map< std::string, LayerMEs > LayerMEsMap
const cms_uint16_t beamMode() const
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
int integrateNLumisections_
virtual DQM_DEPRECATED void setCanExtend(unsigned int value)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
void createMEs(DQMStore::IBooker &ibooker, const edm::EventSetup &es)
MonitorElement * LayerNumberOfDigisTrend
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
std::pair< const std::string, const char * > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
MonitorElement * SubDetTotDigiProf
MonitorElement * LayerStripOccupancy
bool globalswitchapvshotsonprof
bool layerswitchdigiadcson
MonitorElement * LayerADCsHottestStrip
bool layerswitchnumdigisprofon
bool subdetswitchapvshotsApvon
MonitorElement * SubDetDigiFailures2D
edm::InputTag historyProducer_
MonitorElement * LayerADCsHottestStripTrend
T const * product() const
std::optional< T > tryToGet() const
std::unique_ptr< TkHistoMap > tkmapNstripApvshot
Kind kind() const
Get the type of the monitor element.
const L1GtfeExtWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
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)
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
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
bool globalswitchnapvshotson
long long absoluteBX(const unsigned int ev1) const
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)
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
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
bool subdetswitchapvcycleprofon
MonitorElement * ADCsCoolestStrip
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
std::vector< int > m_fed_in
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< EventWithHistory > historyProducerToken_
MonitorElement * SubDetTotDigiProfLS
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
#define DEFINE_FWK_MODULE(type)
bool layerswitchnumdigison
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)
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
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
LuminosityBlockID id() 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
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::vector< AlignmentParameters * > Parameters
const std::vector< APVShot > & getShots() const
std::unique_ptr< TkHistoMap > tkmapdigi
std::vector< edm::InputTag > digiProducerList
LuminosityBlockIndex index() const
edm::EDGetTokenT< APVCyclePhaseCollection > apvPhaseProducerToken_
const int getPhase(const std::string partition) const
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
void FillApvShotsMap(TkHistoMap *, const std::vector< APVShot > &, uint32_t id, int)
MonitorElement * LayerDigiADCsTrend
MonitorElement * NumberOfFEDDigis
bool show_mechanical_structure_view
bool layerswitchadccooleston
const uint16_t nApvPairs(uint32_t det_id) const
void createModuleMEs(DQMStore::IBooker &ibooker, ModMEs &mod_single, uint32_t detid)
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
uint16_t *__restrict__ uint16_t const *__restrict__ adc
bool subdetswitchnapvshotson
virtual double getBinContent(int binx) const
get content of bin (1-D)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)