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),
75 for (
auto const&
tag : digiProducerList) {
206 edm::LogInfo(
"SiStripMonitorDigi") <<
"SiStripMonitorDigi::bookHistograms: " 207 <<
" Creating MEs for new Cabling ";
211 edm::LogInfo(
"SiStripMonitorDigi") <<
"SiStripMonitorDigi::bookHistograms: " 212 <<
" Resetting MEs ";
213 for (std::map<uint32_t, ModMEs >::const_iterator idet =
DigiMEs.begin() ; idet!=
DigiMEs.end() ; idet++) {
250 runInfoRec->get(sumFED);
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 ) ++
nFedTIB;
259 if ( fedID >= 134 && fedID <= 148 ) ++
nFedTIDm;
260 if ( fedID >= 149 && fedID <= 163 ) ++
nFedTIDp;
261 if ( fedID >= 164 && fedID <= 259 ) ++
nFedTECm;
262 if ( fedID >= 260 && fedID <= 355 ) ++
nFedTECp;
263 if ( fedID >= 356 && fedID <= 489 ) ++
nFedTOB;
296 int nFeds [6] = { 96 , 96 , 84 , 15 , 15 , 134 };
301 for (
int ibin = 1; ibin<7;ibin++){
309 && (
float)nFedsConnected[ibin-1] / nFeds[ibin-1] > 0.5
340 std::vector<uint32_t> activeDets;
345 for(std::vector<uint32_t>::iterator idets = activeDets.begin(); idets != activeDets.end(); idets++){
346 if(*idets == 0) activeDets.erase(idets);
359 std::vector<uint32_t> tibDetIds;
362 edm::LogInfo(
"SiStripTkDQM|SiStripMonitorDigi")<<
"nr. of activeDets: "<<activeDets.size();
363 for(std::vector<uint32_t>::const_iterator detid_iterator = activeDets.begin(); detid_iterator!=activeDets.end(); detid_iterator++){
365 uint32_t detid = (*detid_iterator);
384 DigiMEs.insert( std::make_pair(detid, local_modmes));
388 std::pair<std::string,int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo);
393 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
396 int32_t lnumber = det_layer_pair.second;
397 std::vector<uint32_t> layerDetIds;
398 if (det_layer_pair.first ==
"TIB") {
400 }
else if (det_layer_pair.first ==
"TOB") {
402 }
else if (det_layer_pair.first ==
"TID" && lnumber > 0) {
404 }
else if (det_layer_pair.first ==
"TID" && lnumber < 0) {
406 }
else if (det_layer_pair.first ==
"TEC" && lnumber > 0) {
408 }
else if (det_layer_pair.first ==
"TEC" && lnumber < 0) {
415 folder_organizer.
setLayerFolder(detid,tTopo,det_layer_pair.second);
422 ibooker.setCurrentFolder(sdet_pair.first);
430 ibooker.setCurrentFolder(topFolderName_+
"/MechanicalView/");
433 const char*
HistoName =
"Summary Mean Apv shots for SubDets";
449 const char*
HistoName =
"NApv_Shots_vs_Time";
466 const char*
HistoName =
"Number_of_Strips_in_Apv_Shots";
477 const char*
HistoName =
"Number_of_Apv_Shots";
489 const char*
HistoName =
"Apv_Shots_Charge_Median";
501 const char*
HistoName =
"Apv_Shots_Apv_Number";
512 const char*
HistoName =
"NumberOfDigisinFED_v_FEDID";
533 std::stringstream ss;
536 ibooker.setCurrentFolder(ss.str());
539 const char*
HistoName =
"NumberOfDigisInLastLS";
595 std::vector<edm::EDGetTokenT<edm::DetSetVector<SiStripDigi> > >::const_iterator iToken =
digiProducerTokenList.begin();
597 iter != iEnd; ++iter, ++iToken) {
604 for (std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.begin();
606 iSubdet->second.totNDigis = 0;
607 iSubdet->second.SubDetApvShots.clear();
610 std::map<int,int> FEDID_v_digisum;
617 std::vector< uint32_t > layer_dets = iterLayer->second;
618 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_label);
624 else local_layermes = iLayerME->second;
626 int largest_adc_layer= 0;
627 int smallest_adc_layer= 99999;
636 for (std::vector< uint32_t >::const_iterator iterDets = layer_dets.begin() ;
637 iterDets != layer_dets.end() ; iterDets++) {
641 uint32_t detid = (*iterDets);
648 std::map<uint32_t, ModMEs >::iterator
pos =
DigiMEs.find(detid);
649 ModMEs local_modmes = pos->second;
667 int good_fcc_index = -999;
668 for(
unsigned int x=0;
x<fedConnections.size();
x++){
669 if(fedConnections[
x]!=
nullptr){
674 if(fedConnections[good_fcc_index]!=
nullptr){
675 int temp_fedid = fedConnections[good_fcc_index]->fedId();
676 if(FEDID_v_digisum.find(temp_fedid) != FEDID_v_digisum.end()){
677 if(ndigi_det <1000 && ndigi_det>0){
678 FEDID_v_digisum[temp_fedid] = FEDID_v_digisum.find(temp_fedid)->second + ndigi_det;
682 if(ndigi_det < 1000 && ndigi_det >0){
683 FEDID_v_digisum[temp_fedid] = ndigi_det;
688 edm::LogInfo(
"SiStripMonitorDigi") <<
"SiStripMonitorDigi::analyze WARNING! no good connections for detid = " << detid << std::endl;
693 const std::vector<APVShot>& shots = theShotFinder.
getShots();
708 if (ndigi_det == 0)
continue;
712 ndigi_layer += ndigi_det;
715 int largest_adc=(digi_detset.
data.begin())->
adc();
716 int smallest_adc=(digi_detset.
data.begin())->
adc();
720 float det_occupancy = 0.0;
723 digiIter!= digi_detset.
data.end(); digiIter++ ){
725 int this_adc = digiIter->adc();
727 if (this_adc > 0.0) det_occupancy++;
729 if(this_adc>largest_adc) largest_adc = this_adc;
730 if(this_adc<smallest_adc) smallest_adc = this_adc;
736 (local_modmes.
DigiADCs)->Fill(static_cast<float>(this_adc));
751 if (nstrips > 0 && det_occupancy > 0 ) {
752 det_occupancy = det_occupancy/nstrips;
761 if (largest_adc > largest_adc_layer) largest_adc_layer = largest_adc;
762 if (smallest_adc < smallest_adc_layer) smallest_adc_layer = smallest_adc;
787 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
789 iSubdet->second.totNDigis += ndigi_layer;
807 edm::LogInfo(
"DQMProvInfo") <<
" gtfeEvmWord inaccessible" ;
810 if ( gtfeEvmExtWord.
beamMode() == 11 )
814 for (std::map<std::string, SubDetMEs>::iterator it =
SubDetMEsMap.begin();
818 if (strcmp(it->first.c_str(),
"TEC__MINUS")==0){
820 }
else if (strcmp(it->first.c_str(),
"TEC__PLUS")==0){
822 }
else if (strcmp(it->first.c_str(),
"TIB")==0){
824 }
else if (strcmp(it->first.c_str(),
"TID__MINUS")==0){
826 }
else if (strcmp(it->first.c_str(),
"TID__PLUS")==0){
828 }
else if (strcmp(it->first.c_str(),
"TOB")==0){
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){
860 for (
uint i=0;
i< ShotsSize; ++
i){
881 std::map<int,int>::iterator it;
882 for(it=FEDID_v_digisum.begin(); it!=FEDID_v_digisum.end(); it++){
898 && apv_phase_collection.
isValid()
905 for (std::map<std::string, SubDetMEs>::iterator it =
SubDetMEsMap.begin();
910 subdetmes = it->second;
913 long long tbx_corr = tbx;
919 tbx_corr -= the_phase;
928 std::map<uint32_t, ModMEs >::iterator
pos =
DigiMEs.find(idet);
929 ModMEs mod_me = pos->second;
964 return ibooker.
book1D(HistoName,HistoName,
975 me->
Fill(timeinorbit,value);
998 hid = hidmanager.
createHistoId(
"NumberOfDigisPerStrip",
"det",detid);
1007 hid = hidmanager.
createHistoId(
"ADCsHottestStrip",
"det",detid);
1015 hid = hidmanager.
createHistoId(
"ADCsCoolestStrip",
"det",detid);
1031 hid = hidmanager.
createHistoId(
"StripOccupancy",
"det",detid);
1045 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
1130 HistoName =
"TotalNumberOfDigiProfile__" +
label;
1147 HistoName =
"Digi_vs_ApvCycle__" +
label;
1163 HistoName =
"Digi_vs_ApvCycle_2D__" +
label;
1165 double h2ymax = 9999.0;
1166 double yfact = Parameters.
getParameter<
double>(
"yfactor");
1167 if(label.find(
"TIB") != std::string::npos) h2ymax = (6984.*256.)*yfact;
1168 else if (label.find(
"TID") != std::string::npos) h2ymax = (2208.*256.)*yfact;
1169 else if (label.find(
"TOB") != std::string::npos) h2ymax = (12906.*256.)*yfact;
1170 else if (label.find(
"TEC") != std::string::npos) h2ymax = (7552.*2.*256.)*yfact;
1185 HistoName =
"Number_of_Apv_Shots_" +
label;
1197 HistoName =
"Number_of_Strips_in_Apv_Shots_" +
label;
1209 HistoName =
"Apv_Shots_Charge_Median_" +
label;
1221 HistoName =
"Apv_Shots_Apv_Number_" +
label;
1236 HistoName =
"NApv_Shots_vs_Time_" +
label;
1275 for (
uint i=0;
i<moduleShots.size();
i++){
1276 subdetShots.push_back(moduleShots[
i]);
1282 for (
uint i=0;
i<shots.size();
i++){
1283 if (mode==1) the_map->
fill(
id,shots[
i].nStrips());
MonitorElement * bookME1D(DQMStore::IBooker &ibooker, const char *ParameterSetLabel, const char *HistoName)
LuminosityBlockID id() const
void ResetModuleMEs(uint32_t idet)
T getParameter(std::string const &) const
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_
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)
MonitorElement * bookProfile(Args &&...args)
MonitorElement * SubDetTotDigiProf
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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
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)
long long absoluteBX(const unsigned int ev1) const
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
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
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)
std::unique_ptr< TkHistoMap > tkmapMedianChargeApvshots
MonitorElement * LayerNumberOfDigisProfile
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bool globalswitchnapvshotson
void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c) override
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)
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
bool getStatus(edm::Event const &e, edm::EventSetup const &eSetup)
MonitorElement * NumberOfDigisPerStrip
const std::vector< APVShot > & getShots() const
bool subdetswitchapvcycleprofon
#define DEFINE_FWK_MODULE(type)
MonitorElement * ADCsCoolestStrip
const int getPhase(const std::string partition) const
vector< ParameterSet > Parameters
bool moduleswitchadchotteston
bool globalswitchapvshotsApvon
SiStripDCSStatus * dcsStatus_
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
MonitorElement * LayerADCsCoolestStripTrend
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * SubDetNStripsApvShotsTH1
bool shotsstripshistomapon
DigiFailureMEs digiFailureMEs
std::vector< int > m_fed_in
edm::EDGetTokenT< EventWithHistory > historyProducerToken_
MonitorElement * SubDetTotDigiProfLS
void fillME(MonitorElement *ME, float value1)
MonitorElement * LayerDigiADCs
MonitorElement * LayerNumberOfDigis
MonitorElement * NApvApvShotsGlobal
MonitorElement * book1D(Args &&...args)
std::vector< const edm::DetSetVector< SiStripDigi > * > digi_detset_handles
void tag(MonitorElement *, unsigned int)
Abs< T >::type abs(const T &t)
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
bool layerswitchnumdigison
bool globalswitchnstripsapvshotson
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
std::map< std::string, SubDetMEs > SubDetMEsMap
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
void Reset()
reset ME (ie. contents, errors, etc)
MonitorElement * ADCsHottestStrip
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
~SiStripMonitorDigi() override
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
std::map< std::string, std::vector< uint32_t > > LayerDetMap
MonitorElement * NumberOfDigis
T const * product() const
MonitorElement * book2D(Args &&...args)
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
MonitorElement * SubDetChargeMedianApvShotsTH1
void fill(DetId detid, float value)
bool moduleswitchadccooleston
LuminosityBlockNumber_t luminosityBlock() const
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
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_
double getBinContent(int binx) const
get content of bin (1-D)
bool layerswitchadchotteston
MonitorElement * LayerStripOccupancyTrend
bool moduleswitchnumdigispstripon
MonitorElement * LayerADCsCoolestStrip
int ignoreFirstNLumisections_
bool moduleswitchdigiadcson
bool layerswitchstripoccupancyon
MonitorElement * SubDetNApvShotsTH1
MonitorElement * bookMETrend(DQMStore::IBooker &ibooker, const char *ParameterSetLabel, const char *HistoName)
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)
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
const cms_uint16_t beamMode() const
T const * product() const
void FillApvShotsMap(TkHistoMap *, const std::vector< APVShot > &, uint32_t id, int)
MonitorElement * LayerDigiADCsTrend
MonitorElement * NumberOfFEDDigis
bool show_mechanical_structure_view
bool layerswitchadccooleston
Kind kind() const
Get the type of the monitor element.
void createModuleMEs(DQMStore::IBooker &ibooker, ModMEs &mod_single, uint32_t detid)
bool subdetswitchnapvshotson
void endRun(const edm::Run &, const edm::EventSetup &) override