49 show_mechanical_structure_view(
true),
50 show_readout_view (
false),
51 show_control_view (
false),
52 select_all_detectors (
true),
53 reset_each_run (
false),
72 for (
auto const&
tag : digiProducerList) {
202 edm::LogInfo(
"SiStripMonitorDigi") <<
"SiStripMonitorDigi::beginRun: "
203 <<
" Creating MEs for new Cabling ";
207 edm::LogInfo(
"SiStripMonitorDigi") <<
"SiStripMonitorDigi::beginRun: "
208 <<
" Resetting MEs ";
209 for (std::map<uint32_t, ModMEs >::const_iterator idet =
DigiMEs.begin() ; idet!=
DigiMEs.end() ; idet++) {
235 if( es.
find( recordKey ) != 0) {
241 std::vector<int> FedsInIds= sumFED->m_fed_in;
242 for(
unsigned int it = 0; it < FedsInIds.size(); ++it) {
243 int fedID = FedsInIds[it];
246 if ( fedID >= 50 && fedID <= 133 ) ++
nFedTIB;
247 if ( fedID >= 134 && fedID <= 148 ) ++
nFedTIDm;
248 if ( fedID >= 149 && fedID <= 163 ) ++
nFedTIDp;
249 if ( fedID >= 164 && fedID <= 259 ) ++
nFedTECm;
250 if ( fedID >= 260 && fedID <= 355 ) ++
nFedTECp;
251 if ( fedID >= 356 && fedID <= 489 ) ++
nFedTOB;
287 int nFeds [6] = { 96 , 96 , 84 , 15 , 15 , 134 };
293 for (
int ibin = 1; ibin<7;ibin++){
301 && (
float)nFedsConnected[ibin-1] / nFeds[ibin-1] > 0.5
334 std::vector<uint32_t> activeDets;
341 for(std::vector<uint32_t>::iterator idets = activeDets.begin(); idets != activeDets.end(); idets++){
342 if(*idets == 0) activeDets.erase(idets);
355 std::vector<uint32_t> tibDetIds;
358 edm::LogInfo(
"SiStripTkDQM|SiStripMonitorDigi")<<
"nr. of activeDets: "<<activeDets.size();
359 for(std::vector<uint32_t>::const_iterator detid_iterator = activeDets.begin(); detid_iterator!=activeDets.end(); detid_iterator++){
361 uint32_t
detid = (*detid_iterator);
380 DigiMEs.insert( std::make_pair(detid, local_modmes));
384 std::pair<std::string,int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo);
389 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
392 int32_t lnumber = det_layer_pair.second;
393 std::vector<uint32_t> layerDetIds;
394 if (det_layer_pair.first ==
"TIB") {
396 }
else if (det_layer_pair.first ==
"TOB") {
398 }
else if (det_layer_pair.first ==
"TID" && lnumber > 0) {
400 }
else if (det_layer_pair.first ==
"TID" && lnumber < 0) {
402 }
else if (det_layer_pair.first ==
"TEC" && lnumber > 0) {
404 }
else if (det_layer_pair.first ==
"TEC" && lnumber < 0) {
411 folder_organizer.
setLayerFolder(detid,tTopo,det_layer_pair.second);
429 const char*
HistoName =
"Summary Mean Apv shots for SubDets";
445 const char*
HistoName =
"NApv_Shots_vs_Time";
462 const char*
HistoName =
"Number_of_Strips_in_Apv_Shots";
473 const char*
HistoName =
"Number_of_Apv_Shots";
485 const char*
HistoName =
"Apv_Shots_Charge_Median";
497 const char*
HistoName =
"Apv_Shots_Apv_Number";
512 std::stringstream ss;
519 const char*
HistoName =
"NumberOfDigisInLastLS";
582 std::vector<edm::EDGetTokenT<edm::DetSetVector<SiStripDigi> > >::const_iterator iToken =
digiProducerTokenList.begin();
584 iter != iEnd; ++iter, ++iToken) {
591 for (std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.begin();
593 iSubdet->second.totNDigis = 0;
594 iSubdet->second.SubDetApvShots.clear();
602 std::vector< uint32_t > layer_dets = iterLayer->second;
603 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_label);
609 else local_layermes = iLayerME->second;
611 int largest_adc_layer= 0;
612 int smallest_adc_layer= 99999;
621 for (std::vector< uint32_t >::const_iterator iterDets = layer_dets.begin() ;
622 iterDets != layer_dets.end() ; iterDets++) {
626 uint32_t
detid = (*iterDets);
633 std::map<uint32_t, ModMEs >::iterator pos =
DigiMEs.find(detid);
634 ModMEs local_modmes = pos->second;
644 const std::vector<APVShot>& shots = theShotFinder.
getShots();
659 if (ndigi_det == 0)
continue;
663 ndigi_layer += ndigi_det;
666 int largest_adc=(digi_detset.
data.begin())->
adc();
667 int smallest_adc=(digi_detset.
data.begin())->
adc();
671 float det_occupancy = 0.0;
674 digiIter!= digi_detset.
data.end(); digiIter++ ){
676 int this_adc = digiIter->adc();
678 if (this_adc > 0.0) det_occupancy++;
680 if(this_adc>largest_adc) largest_adc = this_adc;
681 if(this_adc<smallest_adc) smallest_adc = this_adc;
687 (local_modmes.
DigiADCs)->Fill(static_cast<float>(this_adc));
702 if (nstrips > 0 && det_occupancy > 0 ) {
703 det_occupancy = det_occupancy/nstrips;
712 if (largest_adc > largest_adc_layer) largest_adc_layer = largest_adc;
713 if (smallest_adc < smallest_adc_layer) smallest_adc_layer = smallest_adc;
738 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
740 iSubdet->second.totNDigis += ndigi_layer;
759 edm::LogInfo(
"DQMProvInfo") <<
" gtfeEvmWord inaccessible" ;
762 if ( gtfeEvmExtWord.
beamMode() == 11 )
766 for (std::map<std::string, SubDetMEs>::iterator it =
SubDetMEsMap.begin();
771 if (strcmp(it->first.c_str(),
"TEC__MINUS")==0){
773 }
else if (strcmp(it->first.c_str(),
"TEC__PLUS")==0){
775 }
else if (strcmp(it->first.c_str(),
"TIB")==0){
777 }
else if (strcmp(it->first.c_str(),
"TID__MINUS")==0){
779 }
else if (strcmp(it->first.c_str(),
"TID__PLUS")==0){
781 }
else if (strcmp(it->first.c_str(),
"TOB")==0){
787 if (strcmp(it->first.c_str(),
"TEC__MINUS")==0){
789 }
else if (strcmp(it->first.c_str(),
"TEC__PLUS")==0){
791 }
else if (strcmp(it->first.c_str(),
"TIB")==0){
793 }
else if (strcmp(it->first.c_str(),
"TID__MINUS")==0){
795 }
else if (strcmp(it->first.c_str(),
"TID__PLUS")==0){
797 }
else if (strcmp(it->first.c_str(),
"TOB")==0){
813 for (uint
i=0;
i< ShotsSize; ++
i){
845 && apv_phase_collection.
isValid()
849 long long tbx = event_history->absoluteBX();
852 for (std::map<std::string, SubDetMEs>::iterator it =
SubDetMEsMap.begin();
857 subdetmes = it->second;
860 long long tbx_corr = tbx;
866 tbx_corr -= the_phase;
885 std::map<uint32_t, ModMEs >::iterator pos =
DigiMEs.find(idet);
886 ModMEs mod_me = pos->second;
932 me->
Fill(timeinorbit,value);
955 hid = hidmanager.
createHistoId(
"NumberOfDigisPerStrip",
"det",detid);
964 hid = hidmanager.
createHistoId(
"ADCsHottestStrip",
"det",detid);
972 hid = hidmanager.
createHistoId(
"ADCsCoolestStrip",
"det",detid);
988 hid = hidmanager.
createHistoId(
"StripOccupancy",
"det",detid);
1002 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
1087 HistoName =
"TotalNumberOfDigiProfile__" +
label;
1103 HistoName =
"Digi_vs_ApvCycle__" +
label;
1119 HistoName =
"Digi_vs_ApvCycle_2D__" +
label;
1121 double h2ymax = 9999.0;
1122 double yfact = Parameters.
getParameter<
double>(
"yfactor");
1123 if(label.find(
"TIB") != std::string::npos) h2ymax = (6984.*256.)*yfact;
1124 else if (label.find(
"TID") != std::string::npos) h2ymax = (2208.*256.)*yfact;
1125 else if (label.find(
"TOB") != std::string::npos) h2ymax = (12906.*256.)*yfact;
1126 else if (label.find(
"TEC") != std::string::npos) h2ymax = (7552.*2.*256.)*yfact;
1141 HistoName =
"Number_of_Apv_Shots_" +
label;
1153 HistoName =
"Number_of_Strips_in_Apv_Shots_" +
label;
1165 HistoName =
"Apv_Shots_Charge_Median_" +
label;
1177 HistoName =
"Apv_Shots_Apv_Number_" +
label;
1192 HistoName =
"NApv_Shots_vs_Time_" +
label;
1231 for (uint
i=0;
i<moduleShots.size();
i++){
1232 subdetShots.push_back(moduleShots[
i]);
1238 for (uint
i=0;
i<shots.size();
i++){
1239 if (mode==1) the_map->
fill(
id,shots[
i].nStrips());
1240 if (mode==2) the_map->
fill(
id,shots[
i].median());
int adc(sample_type sample)
get the ADC sample (12 bits)
LuminosityBlockID id() const
void ResetModuleMEs(uint32_t idet)
void createSubDetMEs(std::string label)
T getParameter(std::string const &) const
bool subdetswitchapvcycleth2on
std::map< std::string, LayerMEs > LayerMEsMap
bool moduleswitchnumdigison
int integrateNLumisections_
MonitorElement * LayerNumberOfDigisTrend
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
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 subdetswitchtotdigiproflson
bool subdetswitchapvshotsApvon
MonitorElement * SubDetDigiFailures2D
edm::InputTag historyProducer_
void createModuleMEs(ModMEs &mod_single, uint32_t detid)
const L1GtfeExtWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
void getLayerFolderName(std::stringstream &ss, uint32_t rawdetid, const TrackerTopology *tTopo, bool ring_flag=0)
MonitorElement * LayerADCsHottestStripTrend
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)
MonitorElement * NApvShotsGlobalProf
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=0)
std::map< uint32_t, ModMEs > DigiMEs
std::map< std::string, std::string > SubDetPhasePartMap
MonitorElement * MedianChargeApvShotsGlobal
MonitorElement * StripMultiplicityApvShotsGlobal
TkHistoMap * tkmapNstripApvshot
bool globalsummaryapvshotson
bool layerswitchdigiadcprofon
MonitorElement * SubDetDigiApvTH2
MonitorElement * StripOccupancy
bool subdetswitchtotdigiprofon
MonitorElement * SubDetDigiApvProf
MonitorElement * LayerNumberOfDigisProfile
bool globalswitchnapvshotson
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
bool subdetswitchchargemedianapvshotson
std::vector< APVShot > SubDetApvShots
virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
void tag(MonitorElement *me, unsigned int myTag)
unsigned long long m_cacheID_
MonitorElement * SubDetNApvShotsNApvTH1
bool getStatus(edm::Event const &e, edm::EventSetup const &eSetup)
MonitorElement * NumberOfDigisPerStrip
const std::vector< APVShot > & getShots() const
bool subdetswitchapvcycleprofon
MonitorElement * ADCsCoolestStrip
vector< ParameterSet > Parameters
bool moduleswitchadchotteston
bool globalswitchapvshotsApvon
SiStripDCSStatus * dcsStatus_
const double NORBITS_PER_SECOND
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
void getTOBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tobDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t rod=0) const
MonitorElement * bookMETrend(const char *ParameterSetLabel, const char *HistoName)
MonitorElement * LayerADCsCoolestStripTrend
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * SubDetNStripsApvShotsTH1
bool shotsstripshistomapon
DigiFailureMEs digiFailureMEs
void fill(uint32_t &detid, float value)
edm::EDGetTokenT< EventWithHistory > historyProducerToken_
MonitorElement * SubDetTotDigiProfLS
void fillME(MonitorElement *ME, float value1)
MonitorElement * LayerDigiADCs
MonitorElement * LayerNumberOfDigis
MonitorElement * NApvApvShotsGlobal
std::vector< const edm::DetSetVector< SiStripDigi > * > digi_detset_handles
void createLayerMEs(std::string label, int ndet)
Abs< T >::type abs(const T &t)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
bool layerswitchnumdigison
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
bool globalswitchnstripsapvshotson
Kind kind(void) const
Get the type of the monitor element.
std::map< std::string, SubDetMEs > SubDetMEsMap
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
MonitorElement * ADCsHottestStrip
bool shotschargehistomapon
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
int getDigiSourceIndex(uint32_t id)
SiStripMonitorDigi(const edm::ParameterSet &)
edm::InputTag apvPhaseProducer_
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=0)
std::map< std::string, std::vector< uint32_t > > LayerDetMap
MonitorElement * NumberOfDigis
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
MonitorElement * SubDetChargeMedianApvShotsTH1
bool moduleswitchadccooleston
T const * product() const
LuminosityBlockNumber_t luminosityBlock() const
T const * product() const
bool globalswitchchargemedianapvshotson
std::string topFolderName_
std::pair< std::string, std::string > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
bool subdetswitchnstripsapvshotson
void getTECDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tecDetRawIds, 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) const
std::vector< edm::InputTag > digiProducerList
TkHistoMap * tkmapMedianChargeApvshots
edm::EDGetTokenT< APVCyclePhaseCollection > apvPhaseProducerToken_
double getBinContent(int binx) const
get content of bin (1-D)
bool layerswitchadchotteston
TkHistoMap * tkmapNApvshots
MonitorElement * LayerStripOccupancyTrend
bool moduleswitchnumdigispstripon
void getTIBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tibDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t int_ext=0, uint32_t string=0) const
virtual void endRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * LayerADCsCoolestStrip
int ignoreFirstNLumisections_
bool moduleswitchdigiadcson
bool layerswitchstripoccupancyon
MonitorElement * SubDetNApvShotsTH1
void AddApvShotsToSubDet(const std::vector< APVShot > &, std::vector< APVShot > &)
virtual void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
SiStripFolderOrganizer folder_organizer
void getTIDDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tidDetRawIds, uint32_t side=0, uint32_t wheel=0, uint32_t ring=0, uint32_t ster=0) const
bool subdetswitchapvshotsonprof
MonitorElement * ShotsVsTimeApvShotsGlobal
MonitorElement * DigiADCs
void createMEs(const edm::EventSetup &es)
volatile std::atomic< bool > shutdown_flag false
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
collection_type::const_iterator const_iterator
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
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)
void Reset(void)
reset ME (ie. contents, errors, etc)
const cms_uint16_t beamMode() const
void FillApvShotsMap(TkHistoMap *, const std::vector< APVShot > &, uint32_t id, int)
MonitorElement * LayerDigiADCsTrend
bool show_mechanical_structure_view
bool layerswitchadccooleston
void setCurrentFolder(const std::string &fullpath)
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
bool subdetswitchnapvshotson
MonitorElement * bookME1D(const char *ParameterSetLabel, const char *HistoName)