178 edm::LogInfo(
"SiStripMonitorDigi") <<
"SiStripMonitorDigi::beginRun: "
179 <<
" Creating MEs for new Cabling ";
183 edm::LogInfo(
"SiStripMonitorDigi") <<
"SiStripMonitorDigi::beginRun: "
184 <<
" Resetting MEs ";
185 for (std::map<uint32_t, ModMEs >::const_iterator idet =
DigiMEs.begin() ; idet!=
DigiMEs.end() ; idet++) {
204 if( es.
find( recordKey ) != 0) {
210 std::vector<int> FedsInIds= sumFED->m_fed_in;
211 for(
unsigned int it = 0; it < FedsInIds.size(); ++it) {
212 int fedID = FedsInIds[it];
213 if(fedID>=siStripFedIdMin && fedID<=siStripFedIdMax) ++
nFEDConnected;
241 for (
int ibin = 1; ibin<7;ibin++){
273 std::vector<uint32_t> activeDets;
280 for(std::vector<uint32_t>::iterator idets = activeDets.begin(); idets != activeDets.end(); idets++){
281 if(*idets == 0) activeDets.erase(idets);
294 std::vector<uint32_t> tibDetIds;
297 edm::LogInfo(
"SiStripTkDQM|SiStripMonitorDigi")<<
"nr. of activeDets: "<<activeDets.size();
298 for(std::vector<uint32_t>::const_iterator detid_iterator = activeDets.begin(); detid_iterator!=activeDets.end(); detid_iterator++){
300 uint32_t
detid = (*detid_iterator);
319 DigiMEs.insert( std::make_pair(detid, local_modmes));
323 std::pair<std::string,int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo);
328 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
331 int32_t lnumber = det_layer_pair.second;
332 std::vector<uint32_t> layerDetIds;
333 if (det_layer_pair.first ==
"TIB") {
335 }
else if (det_layer_pair.first ==
"TOB") {
337 }
else if (det_layer_pair.first ==
"TID" && lnumber > 0) {
339 }
else if (det_layer_pair.first ==
"TID" && lnumber < 0) {
341 }
else if (det_layer_pair.first ==
"TEC" && lnumber > 0) {
343 }
else if (det_layer_pair.first ==
"TEC" && lnumber < 0) {
350 folder_organizer.
setLayerFolder(detid,tTopo,det_layer_pair.second);
368 const char*
HistoName =
"Summary Mean Apv shots for SubDets";
384 const char*
HistoName =
"NApv_Shots_vs_Time";
401 const char*
HistoName =
"Number_of_Strips_in_Apv_Shots";
412 const char*
HistoName =
"Number_of_Apv_Shots";
424 const char*
HistoName =
"Apv_Shots_Charge_Median";
436 const char*
HistoName =
"Apv_Shots_Apv_Number";
451 std::stringstream ss;
457 const char*
HistoName =
"NumberOfDigisInLastLS";
460 100, 0., 10000.,
"" );
512 for(std::vector<edm::InputTag>::iterator itDigiProducerList =
digiProducerList.begin();
517 iEvent.
getByLabel((*itDigiProducerList),digi_handle);
523 for (std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.begin();
525 iSubdet->second.totNDigis = 0;
526 iSubdet->second.SubDetApvShots.clear();
534 std::vector< uint32_t > layer_dets = iterLayer->second;
535 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_label);
541 else local_layermes = iLayerME->second;
543 int largest_adc_layer= 0;
544 int smallest_adc_layer= 99999;
553 for (std::vector< uint32_t >::const_iterator iterDets = layer_dets.begin() ;
554 iterDets != layer_dets.end() ; iterDets++) {
558 uint32_t
detid = (*iterDets);
565 std::map<uint32_t, ModMEs >::iterator
pos =
DigiMEs.find(detid);
566 ModMEs local_modmes = pos->second;
576 const std::vector<APVShot>& shots = theShotFinder.
getShots();
591 if (ndigi_det == 0)
continue;
595 ndigi_layer += ndigi_det;
598 int largest_adc=(digi_detset.
data.begin())->
adc();
599 int smallest_adc=(digi_detset.
data.begin())->
adc();
603 float det_occupancy = 0.0;
606 digiIter!= digi_detset.
data.end(); digiIter++ ){
608 int this_adc = digiIter->adc();
610 if (this_adc > 0.0) det_occupancy++;
612 if(this_adc>largest_adc) largest_adc = this_adc;
613 if(this_adc<smallest_adc) smallest_adc = this_adc;
619 (local_modmes.
DigiADCs)->Fill(static_cast<float>(this_adc));
634 if (nstrips > 0 && det_occupancy > 0 ) {
635 det_occupancy = det_occupancy/nstrips;
644 if (largest_adc > largest_adc_layer) largest_adc_layer = largest_adc;
645 if (smallest_adc < smallest_adc_layer) smallest_adc_layer = smallest_adc;
670 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
672 iSubdet->second.totNDigis += ndigi_layer;
681 iEvent.
getByLabel(
"gtEvmDigis", gtEvm_handle);
690 edm::LogInfo(
"DQMProvInfo") <<
" gtfeEvmWord inaccessible" ;
692 if ( gtfeEvmExtWord.
beamMode() == 11 )
696 for (std::map<std::string, SubDetMEs>::iterator it =
SubDetMEsMap.begin();
700 if (strcmp(it->first.c_str(),
"TEC__side__1")==0){
702 }
else if (strcmp(it->first.c_str(),
"TEC__side__2")==0){
704 }
else if (strcmp(it->first.c_str(),
"TIB")==0){
706 }
else if (strcmp(it->first.c_str(),
"TID__side__1")==0){
708 }
else if (strcmp(it->first.c_str(),
"TID__side__2")==0){
710 }
else if (strcmp(it->first.c_str(),
"TOB")==0){
716 if (strcmp(it->first.c_str(),
"TEC__side__1")==0){
718 }
else if (strcmp(it->first.c_str(),
"TEC__side__2")==0){
720 }
else if (strcmp(it->first.c_str(),
"TIB")==0){
722 }
else if (strcmp(it->first.c_str(),
"TID__side__1")==0){
724 }
else if (strcmp(it->first.c_str(),
"TID__side__2")==0){
726 }
else if (strcmp(it->first.c_str(),
"TOB")==0){
742 for (uint
i=0;
i< ShotsSize; ++
i){
772 && apv_phase_collection.
isValid()
776 long long tbx = event_history->absoluteBX();
779 for (std::map<std::string, SubDetMEs>::iterator it =
SubDetMEsMap.begin();
784 subdetmes = it->second;
787 long long tbx_corr = tbx;
793 tbx_corr -= the_phase;
812 std::map<uint32_t, ModMEs >::iterator
pos =
DigiMEs.find(idet);
813 ModMEs mod_me = pos->second;
859 me->
Fill(timeinorbit,value);
882 hid = hidmanager.
createHistoId(
"NumberOfDigisPerStrip",
"det",detid);
891 hid = hidmanager.
createHistoId(
"ADCsHottestStrip",
"det",detid);
899 hid = hidmanager.
createHistoId(
"ADCsCoolestStrip",
"det",detid);
915 hid = hidmanager.
createHistoId(
"StripOccupancy",
"det",detid);
929 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
1014 HistoName =
"TotalNumberOfDigiProfile__" +
label;
1030 HistoName =
"Digi_vs_ApvCycle__" +
label;
1046 HistoName =
"Digi_vs_ApvCycle_2D__" +
label;
1048 double h2ymax = 9999.0;
1049 double yfact = Parameters.
getParameter<
double>(
"yfactor");
1050 if(label.find(
"TIB") != std::string::npos) h2ymax = (6984.*256.)*yfact;
1051 else if (label.find(
"TID") != std::string::npos) h2ymax = (2208.*256.)*yfact;
1052 else if (label.find(
"TOB") != std::string::npos) h2ymax = (12906.*256.)*yfact;
1053 else if (label.find(
"TEC") != std::string::npos) h2ymax = (7552.*2.*256.)*yfact;
1068 HistoName =
"Number_of_Apv_Shots_" +
label;
1080 HistoName =
"Number_of_Strips_in_Apv_Shots_" +
label;
1092 HistoName =
"Apv_Shots_Charge_Median_" +
label;
1104 HistoName =
"Apv_Shots_Apv_Number_" +
label;
1119 HistoName =
"NApv_Shots_vs_Time_" +
label;
1158 for (uint
i=0;
i<moduleShots.size();
i++){
1159 subdetShots.push_back(moduleShots[
i]);
1165 for (uint
i=0;
i<shots.size();
i++){
1166 if (mode==1) the_map->
fill(
id,shots[
i].nStrips());
1167 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
MonitorElement * LayerNumberOfDigisTrend
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * SubDetTotDigiProf
#define DEFINE_FWK_MODULE(type)
MonitorElement * LayerStripOccupancy
bool globalswitchapvshotsonprof
bool layerswitchdigiadcson
MonitorElement * LayerADCsHottestStrip
bool layerswitchnumdigisprofon
bool subdetswitchtotdigiproflson
bool subdetswitchapvshotsApvon
MonitorElement * SubDetDigiFailures2D
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
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
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_
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)
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)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void fillTrend(MonitorElement *me, float value, float timeinorbit)
MonitorElement * SubDetNApvShotsProf
MonitorElement * NApvShotsGlobal
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::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
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
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)
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)