44 show_mechanical_structure_view(
true),
45 show_readout_view(
false),
46 show_control_view(
false),
47 select_all_detectors(
false),
48 reset_each_run(
false),
51 trackerTopologyRunToken_{esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()},
52 tkDetMapToken_{esConsumes<TkDetMap, TrackerTopologyRcd, edm::Transition::BeginRun>()},
53 siStripDetCablingRunToken_{esConsumes<SiStripDetCabling, SiStripDetCablingRcd, edm::Transition::BeginRun>()},
54 trackerTopologyEventToken_{esConsumes<TrackerTopology, TrackerTopologyRcd>()},
55 siStripNoisesToken_{esConsumes<SiStripNoises, SiStripNoisesRcd>()},
56 siStripGainToken_{esConsumes<SiStripGain, SiStripGainRcd>()},
57 siStripQualityToken_{esConsumes<SiStripQuality, SiStripQualityRcd>(
edm::ESInputTag(
"", qualityLabel_))},
58 siStripDetCablingEventToken_{esConsumes<SiStripDetCabling, SiStripDetCablingRcd>()} {
60 passBPTXfilter_ =
true;
64 genTriggerEventFlagBPTXfilter_ =
67 iConfig.getParameter<
edm::ParameterSet>(
"PixelDCSfilter"), consumesCollector(), *
this);
69 iConfig.getParameter<
edm::ParameterSet>(
"StripDCSfilter"), consumesCollector(), *
this);
75 SubDetPhasePartMap[
"TIB"] =
"TI";
76 SubDetPhasePartMap[
"TID__MINUS"] =
"TI";
77 SubDetPhasePartMap[
"TID__PLUS"] =
"TI";
78 SubDetPhasePartMap[
"TOB"] =
"TO";
79 SubDetPhasePartMap[
"TEC__MINUS"] =
"TM";
80 SubDetPhasePartMap[
"TEC__PLUS"] =
"TP";
84 layerswitchncluson = ParametersnClusters.
getParameter<
bool>(
"layerswitchon");
85 moduleswitchncluson = ParametersnClusters.
getParameter<
bool>(
"moduleswitchon");
88 layerswitchcluschargeon = ParametersClusterCharge.
getParameter<
bool>(
"layerswitchon");
89 moduleswitchcluschargeon = ParametersClusterCharge.getParameter<
bool>(
"moduleswitchon");
90 subdetswitchcluschargeon = ParametersClusterCharge.getParameter<
bool>(
"subdetswitchon");
93 layerswitchclusstonon = ParametersClusterStoN.
getParameter<
bool>(
"layerswitchon");
94 moduleswitchclusstonon = ParametersClusterStoN.getParameter<
bool>(
"moduleswitchon");
97 layerswitchclusstonVsposon = ParametersClusterStoNVsPos.
getParameter<
bool>(
"layerswitchon");
98 moduleswitchclusstonVsposon = ParametersClusterStoNVsPos.getParameter<
bool>(
"moduleswitchon");
101 layerswitchclusposon = ParametersClusterPos.
getParameter<
bool>(
"layerswitchon");
102 moduleswitchclusposon = ParametersClusterPos.getParameter<
bool>(
"moduleswitchon");
105 layerswitchclusdigiposon = ParametersClusterDigiPos.
getParameter<
bool>(
"layerswitchon");
106 moduleswitchclusdigiposon = ParametersClusterDigiPos.getParameter<
bool>(
"moduleswitchon");
109 layerswitchclusnoiseon = ParametersClusterNoise.
getParameter<
bool>(
"layerswitchon");
110 moduleswitchclusnoiseon = ParametersClusterNoise.getParameter<
bool>(
"moduleswitchon");
113 layerswitchcluswidthon = ParametersClusterWidth.
getParameter<
bool>(
"layerswitchon");
114 moduleswitchcluswidthon = ParametersClusterWidth.getParameter<
bool>(
"moduleswitchon");
115 subdetswitchcluswidthon = ParametersClusterWidth.getParameter<
bool>(
"subdetswitchon");
118 layerswitchlocaloccupancy = ParametersModuleLocalOccupancy.
getParameter<
bool>(
"layerswitchon");
119 moduleswitchlocaloccupancy = ParametersModuleLocalOccupancy.getParameter<
bool>(
"moduleswitchon");
122 layerswitchnrclusterizedstrip = ParametersNrOfClusterizedStrips.
getParameter<
bool>(
"layerswitchon");
123 moduleswitchnrclusterizedstrip = ParametersNrOfClusterizedStrips.getParameter<
bool>(
"moduleswitchon");
126 layerswitchnumclusterprofon = ParametersClusterProf.
getParameter<
bool>(
"layerswitchon");
129 layerswitchclusterwidthprofon = ParametersClusterWidthProf.
getParameter<
bool>(
"layerswitchon");
132 subdetswitchtotclusprofon = ParametersTotClusterProf.
getParameter<
bool>(
"subdetswitchon");
135 subdetswitchtotclusth1on = ParametersTotClusterTH1.
getParameter<
bool>(
"subdetswitchon");
138 subdetswitchapvcycleprofon = ParametersClusterApvProf.
getParameter<
bool>(
"subdetswitchon");
141 subdetswitchapvcycleth2on = ParametersClustersApvTH2.
getParameter<
bool>(
"subdetswitchon");
144 subdetswitchapvcycledbxprof2on = ParametersApvCycleDBxProf2.
getParameter<
bool>(
"subdetswitchon");
147 subdetswitchdbxcycleprofon = ParametersDBxCycleProf.
getParameter<
bool>(
"subdetswitchon");
150 globalswitchcstripvscpix = ParametersCStripVsCPix.
getParameter<
bool>(
"globalswitchon");
153 globalswitchMultiRegions = ParametersMultiplicityRegionsTH1.
getParameter<
bool>(
"globalswitchon");
156 globalswitchapvcycledbxth2on = ParametersApvCycleVsDBxGlobalTH2.
getParameter<
bool>(
"globalswitchon");
159 globalswitchstripnoise2apvcycle = ParametersNoiseStrip2ApvCycle.
getParameter<
bool>(
"globalswitchon");
162 globalswitchstripnoise3apvcycle = ParametersNoiseStrip3ApvCycle.
getParameter<
bool>(
"globalswitchon");
165 globalswitchmaindiagonalposition = ParametersMainDiagonalPosition.
getParameter<
bool>(
"globalswitchon");
168 k0 = ClusterMultiplicityRegions.getParameter<
double>(
"k0");
169 q0 = ClusterMultiplicityRegions.getParameter<
double>(
"q0");
170 dk0 = ClusterMultiplicityRegions.getParameter<
double>(
"dk0");
171 maxClus = ClusterMultiplicityRegions.getParameter<
double>(
"MaxClus");
172 minPix = ClusterMultiplicityRegions.getParameter<
double>(
"MinPix");
175 globalswitchnclusvscycletimeprof2don = ParametersNclusVsCycleTimeProf2D.
getParameter<
bool>(
"globalswitchon");
178 globalswitchFEDCluster = ParametersFEDCluster.
getParameter<
bool>(
"globalswitchon");
181 clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.
getParameter<
bool>(
"globalswitchon");
182 layer_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<
bool>(
"layerswitchon");
183 subdet_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<
bool>(
"subdetswitchon");
184 module_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<
bool>(
"moduleswitchon");
186 clustertkhistomapon = conf_.getParameter<
bool>(
"TkHistoMap_On");
187 clusterchtkhistomapon = conf_.getParameter<
bool>(
"ClusterChTkHistoMap_On");
188 createTrendMEs = conf_.getParameter<
bool>(
"CreateTrendMEs");
189 trendVs10Ls_ = conf_.getParameter<
bool>(
"TrendVs10LS");
190 Mod_On_ = conf_.getParameter<
bool>(
"Mod_On");
191 ClusterHisto_ = conf_.getParameter<
bool>(
"ClusterHisto");
193 topFolderName_ = conf_.getParameter<
std::string>(
"TopFolderName");
196 clusterProducerStripToken_ =
197 consumes<edmNew::DetSetVector<SiStripCluster> >(conf_.getParameter<
edm::InputTag>(
"ClusterProducerStrip"));
198 clusterProducerPixToken_ =
199 consumes<edmNew::DetSetVector<SiPixelCluster> >(conf_.getParameter<
edm::InputTag>(
"ClusterProducerPix"));
207 applyClusterQuality_ = cluster_condition.
getParameter<
bool>(
"On");
208 sToNLowerLimit_ = cluster_condition.
getParameter<
double>(
"minStoN");
209 sToNUpperLimit_ = cluster_condition.
getParameter<
double>(
"maxStoN");
210 widthLowerLimit_ = cluster_condition.
getParameter<
double>(
"minWidth");
211 widthUpperLimit_ = cluster_condition.
getParameter<
double>(
"maxWidth");
215 historyProducerToken_ = consumes<EventWithHistory>(conf_.getParameter<
edm::InputTag>(
"HistoryProducer"));
218 apvPhaseProducerToken_ = consumes<APVCyclePhaseCollection>(conf_.getParameter<
edm::InputTag>(
"ApvPhaseProducer"));
220 bool checkDCS = conf_.getParameter<
bool>(
"UseDCSFiltering");
224 dcsStatus_ =
nullptr;
257 std::vector<uint32_t> activeDets;
270 std::make_unique<TkHistoMap>(tkDetMap, ibooker,
topFolderName_,
"TkHMap_NumberOfCluster", 0.,
true);
273 tkDetMap, ibooker,
topFolderName_ +
"/TkHistoMap",
"TkHMap_NumberOfCluster", 0.,
false);
278 std::make_unique<TkHistoMap>(tkDetMap, ibooker,
topFolderName_,
"TkHMap_ClusterCharge", 0.,
true);
281 tkDetMap, ibooker,
topFolderName_ +
"/TkHistoMap",
"TkHMap_ClusterCharge", 0.,
false);
285 edm::LogInfo(
"SiStripTkDQM|SiStripMonitorCluster") <<
"nr. of activeDets: " << activeDets.size();
286 for (std::vector<uint32_t>::iterator detid_iterator = activeDets.begin(); detid_iterator != activeDets.end();
288 uint32_t detid = (*detid_iterator);
292 activeDets.erase(detid_iterator);
308 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo);
312 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(
label);
315 int32_t lnumber = det_layer_pair.second;
316 std::vector<uint32_t> layerDetIds;
317 if (det_layer_pair.first ==
"TIB") {
319 }
else if (det_layer_pair.first ==
"TOB") {
321 }
else if (det_layer_pair.first ==
"TID" && lnumber > 0) {
323 }
else if (det_layer_pair.first ==
"TID" && lnumber < 0) {
325 }
else if (det_layer_pair.first ==
"TEC" && lnumber > 0) {
327 }
else if (det_layer_pair.first ==
"TEC" && lnumber < 0) {
333 folder_organizer.
setLayerFolder(detid, tTopo, det_layer_pair.second);
438 HistoName =
"MainDiagonalPosition_vs_BX";
452 HistoName =
"TH2MainDiagonalPosition_vs_BX";
503 const char*
HistoName =
"StripClusVsBXandOrbit";
504 const char* HistoTitle =
505 "Strip cluster multiplicity vs BX mod(70) and Orbit;Event 1 BX "
506 "mod(70);time [Orb#]";
511 ParametersNclusVsCycleTimeProf2D.
getParameter<int32_t>(
"Nbins"),
512 ParametersNclusVsCycleTimeProf2D.
getParameter<
double>(
"xmin"),
513 ParametersNclusVsCycleTimeProf2D.
getParameter<
double>(
"xmax"),
514 ParametersNclusVsCycleTimeProf2D.
getParameter<int32_t>(
"Nbinsy"),
515 ParametersNclusVsCycleTimeProf2D.
getParameter<
double>(
"ymin"),
516 ParametersNclusVsCycleTimeProf2D.
getParameter<
double>(
"ymax"),
525 const char*
HistoName =
"ClusterWidths_vs_Amplitudes";
526 const char* HistoTitle =
527 "Cluster widths vs amplitudes;Amplitudes (integrated ADC "
528 "counts);Cluster widths";
531 ParametersClusWidthVsAmpTH2.
getParameter<int32_t>(
"Nbinsx"),
532 ParametersClusWidthVsAmpTH2.
getParameter<
double>(
"xmin"),
533 ParametersClusWidthVsAmpTH2.
getParameter<
double>(
"xmax"),
534 ParametersClusWidthVsAmpTH2.
getParameter<int32_t>(
"Nbinsy"),
535 ParametersClusWidthVsAmpTH2.
getParameter<
double>(
"ymin"),
536 ParametersClusWidthVsAmpTH2.
getParameter<
double>(
"ymax"));
563 HistoName =
"NumberOfClustersInStrip_vs_BX";
578 HistoName =
"NumberOfClustersInPixel_vs_BX";
594 HistoName =
"NumberOfClustersinFED_v_FEDID";
619 edm::LogInfo(
"SiStripMonitorCluster") <<
"SiStripMonitorCluster::bookHistograms: "
620 <<
" Creating MEs for new Cabling ";
625 edm::LogInfo(
"SiStripMonitorCluster") <<
"SiStripMonitorCluster::bookHistograms: "
626 <<
" Resetting MEs ";
656 :
iEvent.orbitNumber() / (1 * 262144.0);
658 int NPixClusters = 0, NStripClusters = 0, MultiplicityRegion = 0;
659 bool isPixValid =
false;
674 if (!cluster_detsetvektor.
isValid())
678 NStripClusters = StrC->
data().
size();
680 if (cluster_detsetvektor_pix.
isValid()) {
684 MultiplicityRegion =
FindRegion(NStripClusters, NPixClusters);
706 iSubdet->second.totNClusters = 0;
710 bool found_layer_me =
false;
712 std::map<int, int> FEDID_v_clustersum;
719 int ncluster_layer = 0;
720 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_label);
725 layer_single = iLayerME->second;
726 found_layer_me =
true;
729 int ncluster_ring[20] = {0};
731 bool found_module_me =
false;
735 for (std::vector<uint32_t>::const_iterator iterDets = iterLayer->second.begin();
736 iterDets != iterLayer->second.end();
740 uint32_t detid = (*iterDets);
743 if (subdet_label.empty())
749 std::map<uint32_t, ModMEs>::iterator imodME =
ModuleMEsMap.find(detid);
751 mod_single = imodME->second;
752 found_module_me =
true;
755 found_module_me =
false;
758 cluster_detsetvektor->find(detid);
760 if (isearch == cluster_detsetvektor->end() and passDCSFilter_) {
774 if (isearch == cluster_detsetvektor->end()) {
790 std::vector<const FedChannelConnection*> fedConnections = siStripDetCabling.
getConnections(detid);
794 int good_fcc_index = -999;
795 for (
unsigned int x = 0;
x < fedConnections.size();
x++) {
796 if (fedConnections[
x] !=
nullptr) {
801 if (good_fcc_index != -999 && fedConnections[good_fcc_index] !=
nullptr) {
802 int temp_fedid = fedConnections[good_fcc_index]->fedId();
803 if (FEDID_v_clustersum.find(temp_fedid) != FEDID_v_clustersum.end()) {
804 if (cluster_detset.
size() < 1000 && !cluster_detset.
empty()) {
805 FEDID_v_clustersum[temp_fedid] = FEDID_v_clustersum.find(temp_fedid)->second + cluster_detset.
size();
808 if (cluster_detset.
size() < 1000 && !cluster_detset.
empty()) {
809 FEDID_v_clustersum[temp_fedid] = cluster_detset.
size();
813 edm::LogInfo(
"SiStripMonitorCluster") <<
"SiStripMonitorCluster::analyze WARNING! no good connections "
831 ncluster_layer += cluster_detset.
size();
833 short total_clusterized_strips = 0;
840 clusterIter != cluster_detset.
end();
842 const auto& ampls = clusterIter->amplitudes();
844 float cluster_position = clusterIter->barycenter();
846 short cluster_start = clusterIter->firstStrip();
848 short cluster_width = ampls.size();
850 total_clusterized_strips = total_clusterized_strips + cluster_width;
853 tkmapclusterch->fill(detid, static_cast<float>(clusterIter->charge()));
856 float cluster_signal = 0.0;
857 float cluster_noise = 0.0;
858 int nrnonzeroamplitudes = 0;
861 for (
uint iamp = 0; iamp < ampls.size(); iamp++) {
862 if (ampls[iamp] > 0) {
863 cluster_signal += ampls[iamp];
864 if (!siStripQuality.
IsStripBad(qualityRange, clusterIter->firstStrip() + iamp)) {
865 noise = siStripNoises.
getNoise(clusterIter->firstStrip() + iamp, detNoiseRange) /
866 siStripGain.
getStripGain(clusterIter->firstStrip() + iamp, detGainRange);
869 nrnonzeroamplitudes++;
873 if (nrnonzeroamplitudes > 0)
874 cluster_noise =
sqrt(noise2 / nrnonzeroamplitudes);
877 (cluster_signal / cluster_noise < sToNLowerLimit_ || cluster_signal / cluster_noise >
sToNUpperLimit_ ||
882 cluster_properties.
charge = cluster_signal;
883 cluster_properties.
position = cluster_position;
884 cluster_properties.
start = cluster_start;
885 cluster_properties.
width = cluster_width;
886 cluster_properties.
noise = cluster_noise;
889 if (found_module_me and passDCSFilter_)
893 if (found_layer_me and passDCSFilter_) {
900 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
903 iSubdet->second.SubDetClusterChargeTH1->Fill(cluster_signal);
905 iSubdet->second.SubDetClusterWidthTH1->Fill(cluster_width);
910 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
912 iSubdet->second.SubDetClusWidthVsAmpTH2->Fill(cluster_signal, cluster_width);
920 (subdet_label.find(
"TID") != std::string::npos || subdet_label.find(
"TEC") != std::string::npos)) {
921 std::pair<std::string, int32_t> det_ring_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
true);
922 ncluster_ring[
std::abs(det_ring_pair.second)]++;
928 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
929 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo);
930 iSubdet->second.SubDetNumberOfClusterPerLayerTrend->Fill(
935 (subdet_label.find(
"TID") != std::string::npos || subdet_label.find(
"TEC") != std::string::npos)) {
936 std::pair<std::string, int32_t> det_ring_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
true);
941 short total_nr_strips = siStripDetCabling.
nApvPairs(detid) * 2 * 128;
942 float local_occupancy = static_cast<float>(total_clusterized_strips) / static_cast<float>(total_nr_strips);
943 if (found_module_me and passDCSFilter_) {
962 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
964 iSubdet->second.totNClusters += ncluster_layer;
977 long long dbx = event_history->
deltaBX();
980 bool global_histo_filled =
false;
981 bool MultiplicityRegion_Vs_APVcycle_filled =
false;
996 long long tbx_corr = tbx;
1006 tbx_corr -= the_phase;
1014 global_histo_filled =
true;
1018 if (cluster_detsetvektor_pix.
isValid()) {
1033 map<int, int>::iterator it;
1036 for (
auto const& fedidEntry : FEDID_v_clustersum) {
1044 FEDID_v_clustersum.clear();
1048 if (isPixValid && !MultiplicityRegion_Vs_APVcycle_filled && passDCSFilter_) {
1055 MultiplicityRegion_Vs_APVcycle_filled =
true;
1074 long long tbx_corr = tbx;
1075 int the_phase = apv_phase_collection->
getPhase(
"All");
1081 tbx_corr -= the_phase;
1130 hid = hidmanager.
createHistoId(
"NumberOfClusters",
"det", detid);
1138 short total_nr_strips = siStripDetCabling.
nApvPairs(detid) * 2 * 128;
1139 hid = hidmanager.
createHistoId(
"ClusterPosition",
"det", detid);
1146 short total_nr_strips = siStripDetCabling.
nApvPairs(detid) * 2 * 128;
1147 hid = hidmanager.
createHistoId(
"ClusterDigiPosition",
"det", detid);
1154 hid = hidmanager.
createHistoId(
"ClusterWidth",
"det", detid);
1161 hid = hidmanager.
createHistoId(
"ClusterCharge",
"det", detid);
1168 hid = hidmanager.
createHistoId(
"ClusterNoise",
"det", detid);
1175 hid = hidmanager.
createHistoId(
"ClusterSignalOverNoise",
"det", detid);
1182 hid = hidmanager.
createHistoId(
"ClusterSignalOverNoiseVsPos",
"det", detid);
1197 hid = hidmanager.
createHistoId(
"ClusterLocalOccupancy",
"det", detid);
1204 hid = hidmanager.
createHistoId(
"NrOfClusterizedStrips",
"det", detid);
1210 hid = hidmanager.
createHistoId(
"ClusterWidths_vs_Amplitudes",
"det", detid);
1255 "TH1ClusterWidth", hidmanager.
createHistoLayer(
"Summary_ClusterWidth",
"layer",
label,
"").c_str(), ibooker);
1264 "TH1ClusterNoise", hidmanager.
createHistoLayer(
"Summary_ClusterNoise",
"layer",
label,
"").c_str(), ibooker);
1273 "TH1ClusterCharge", hidmanager.
createHistoLayer(
"Summary_ClusterCharge",
"layer",
label,
"").c_str(), ibooker);
1293 bookME1D(
"TH1ModuleLocalOccupancy",
1312 if (
label.find(
"TID") != std::string::npos ||
label.find(
"TEC") != std::string::npos) {
1316 "NumberOfClusterPerRingVsTrendVar",
1445 double h2ymax = 9999.0;
1446 double yfact =
Parameters.getParameter<
double>(
"yfactor");
1447 if (
label.find(
"TIB") != std::string::npos)
1448 h2ymax = (6984. * 256.) * yfact;
1449 else if (
label.find(
"TID") != std::string::npos)
1450 h2ymax = (2208. * 256.) * yfact;
1451 else if (
label.find(
"TOB") != std::string::npos)
1452 h2ymax = (12906. * 256.) * yfact;
1453 else if (
label.find(
"TEC") != std::string::npos)
1454 h2ymax = (7552. * 2. * 256.) * yfact;
1529 for (
int ipos = cluster.
start + 1; ipos <= cluster.
start + cluster.
width; ipos++) {
1538 if (cluster.
noise > 0)
1543 if (cluster.
noise > 0)
1613 me->getTH1()->SetCanExtend(TH1::kAllAxes);
1645 double kplus =
k0 * (1 +
dk0 / 100);
1646 double kminus =
k0 * (1 -
dk0 / 100);
1649 if (nstrip != 0 && npix >= (nstrip * kminus -
q0) && npix <= (nstrip * kplus +
q0))
1651 else if (nstrip != 0 && npix < (nstrip * kminus -
q0) && nstrip <=
maxClus)
1653 else if (nstrip != 0 && npix < (nstrip * kminus -
q0) && nstrip >
maxClus)
1655 else if (nstrip != 0 && npix > (nstrip * kplus +
q0))
1657 else if (npix >
minPix && nstrip == 0)