43 show_mechanical_structure_view(
true),
44 show_readout_view(
false),
45 show_control_view(
false),
46 select_all_detectors(
false),
47 reset_each_run(
false),
50 trackerTopologyRunToken_{esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()},
51 tkDetMapToken_{esConsumes<TkDetMap, TrackerTopologyRcd, edm::Transition::BeginRun>()},
52 siStripDetCablingRunToken_{esConsumes<SiStripDetCabling, SiStripDetCablingRcd, edm::Transition::BeginRun>()},
53 trackerTopologyEventToken_{esConsumes<TrackerTopology, TrackerTopologyRcd>()},
54 siStripNoisesToken_{esConsumes<SiStripNoises, SiStripNoisesRcd>()},
55 siStripGainToken_{esConsumes<SiStripGain, SiStripGainRcd>()},
56 siStripQualityToken_{esConsumes<SiStripQuality, SiStripQualityRcd>(
edm::ESInputTag(
"", qualityLabel_))},
57 siStripDetCablingEventToken_{esConsumes<SiStripDetCabling, SiStripDetCablingRcd>()} {
59 passBPTXfilter_ =
true;
63 genTriggerEventFlagBPTXfilter_ =
66 iConfig.getParameter<
edm::ParameterSet>(
"PixelDCSfilter"), consumesCollector(), *
this);
68 iConfig.getParameter<
edm::ParameterSet>(
"StripDCSfilter"), consumesCollector(), *
this);
74 SubDetPhasePartMap[
"TIB"] =
"TI";
75 SubDetPhasePartMap[
"TID__MINUS"] =
"TI";
76 SubDetPhasePartMap[
"TID__PLUS"] =
"TI";
77 SubDetPhasePartMap[
"TOB"] =
"TO";
78 SubDetPhasePartMap[
"TEC__MINUS"] =
"TM";
79 SubDetPhasePartMap[
"TEC__PLUS"] =
"TP";
83 layerswitchncluson = ParametersnClusters.
getParameter<
bool>(
"layerswitchon");
84 moduleswitchncluson = ParametersnClusters.
getParameter<
bool>(
"moduleswitchon");
87 layerswitchcluschargeon = ParametersClusterCharge.
getParameter<
bool>(
"layerswitchon");
88 moduleswitchcluschargeon = ParametersClusterCharge.getParameter<
bool>(
"moduleswitchon");
89 subdetswitchcluschargeon = ParametersClusterCharge.getParameter<
bool>(
"subdetswitchon");
92 layerswitchclusstonon = ParametersClusterStoN.
getParameter<
bool>(
"layerswitchon");
93 moduleswitchclusstonon = ParametersClusterStoN.getParameter<
bool>(
"moduleswitchon");
96 layerswitchclusstonVsposon = ParametersClusterStoNVsPos.
getParameter<
bool>(
"layerswitchon");
97 moduleswitchclusstonVsposon = ParametersClusterStoNVsPos.getParameter<
bool>(
"moduleswitchon");
100 layerswitchclusposon = ParametersClusterPos.
getParameter<
bool>(
"layerswitchon");
101 moduleswitchclusposon = ParametersClusterPos.getParameter<
bool>(
"moduleswitchon");
104 layerswitchclusdigiposon = ParametersClusterDigiPos.
getParameter<
bool>(
"layerswitchon");
105 moduleswitchclusdigiposon = ParametersClusterDigiPos.getParameter<
bool>(
"moduleswitchon");
108 layerswitchclusnoiseon = ParametersClusterNoise.
getParameter<
bool>(
"layerswitchon");
109 moduleswitchclusnoiseon = ParametersClusterNoise.getParameter<
bool>(
"moduleswitchon");
112 layerswitchcluswidthon = ParametersClusterWidth.
getParameter<
bool>(
"layerswitchon");
113 moduleswitchcluswidthon = ParametersClusterWidth.getParameter<
bool>(
"moduleswitchon");
114 subdetswitchcluswidthon = ParametersClusterWidth.getParameter<
bool>(
"subdetswitchon");
117 layerswitchlocaloccupancy = ParametersModuleLocalOccupancy.
getParameter<
bool>(
"layerswitchon");
118 moduleswitchlocaloccupancy = ParametersModuleLocalOccupancy.getParameter<
bool>(
"moduleswitchon");
121 layerswitchnrclusterizedstrip = ParametersNrOfClusterizedStrips.
getParameter<
bool>(
"layerswitchon");
122 moduleswitchnrclusterizedstrip = ParametersNrOfClusterizedStrips.getParameter<
bool>(
"moduleswitchon");
125 layerswitchnumclusterprofon = ParametersClusterProf.
getParameter<
bool>(
"layerswitchon");
128 layerswitchclusterwidthprofon = ParametersClusterWidthProf.
getParameter<
bool>(
"layerswitchon");
131 subdetswitchtotclusprofon = ParametersTotClusterProf.
getParameter<
bool>(
"subdetswitchon");
134 subdetswitchtotclusth1on = ParametersTotClusterTH1.
getParameter<
bool>(
"subdetswitchon");
137 subdetswitchapvcycleprofon = ParametersClusterApvProf.
getParameter<
bool>(
"subdetswitchon");
140 subdetswitchapvcycleth2on = ParametersClustersApvTH2.
getParameter<
bool>(
"subdetswitchon");
143 subdetswitchapvcycledbxprof2on = ParametersApvCycleDBxProf2.
getParameter<
bool>(
"subdetswitchon");
146 subdetswitchdbxcycleprofon = ParametersDBxCycleProf.
getParameter<
bool>(
"subdetswitchon");
149 globalswitchcstripvscpix = ParametersCStripVsCPix.
getParameter<
bool>(
"globalswitchon");
152 globalswitchMultiRegions = ParametersMultiplicityRegionsTH1.
getParameter<
bool>(
"globalswitchon");
155 globalswitchapvcycledbxth2on = ParametersApvCycleVsDBxGlobalTH2.
getParameter<
bool>(
"globalswitchon");
158 globalswitchstripnoise2apvcycle = ParametersNoiseStrip2ApvCycle.
getParameter<
bool>(
"globalswitchon");
161 globalswitchstripnoise3apvcycle = ParametersNoiseStrip3ApvCycle.
getParameter<
bool>(
"globalswitchon");
164 globalswitchmaindiagonalposition = ParametersMainDiagonalPosition.
getParameter<
bool>(
"globalswitchon");
167 k0 = ClusterMultiplicityRegions.getParameter<
double>(
"k0");
168 q0 = ClusterMultiplicityRegions.getParameter<
double>(
"q0");
169 dk0 = ClusterMultiplicityRegions.getParameter<
double>(
"dk0");
170 maxClus = ClusterMultiplicityRegions.getParameter<
double>(
"MaxClus");
171 minPix = ClusterMultiplicityRegions.getParameter<
double>(
"MinPix");
174 globalswitchnclusvscycletimeprof2don = ParametersNclusVsCycleTimeProf2D.
getParameter<
bool>(
"globalswitchon");
177 globalswitchFEDCluster = ParametersFEDCluster.
getParameter<
bool>(
"globalswitchon");
180 clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.
getParameter<
bool>(
"globalswitchon");
181 layer_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<
bool>(
"layerswitchon");
182 subdet_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<
bool>(
"subdetswitchon");
183 module_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<
bool>(
"moduleswitchon");
185 clustertkhistomapon = conf_.getParameter<
bool>(
"TkHistoMap_On");
186 clusterchtkhistomapon = conf_.getParameter<
bool>(
"ClusterChTkHistoMap_On");
187 createTrendMEs = conf_.getParameter<
bool>(
"CreateTrendMEs");
188 trendVs10Ls_ = conf_.getParameter<
bool>(
"TrendVs10LS");
189 Mod_On_ = conf_.getParameter<
bool>(
"Mod_On");
190 ClusterHisto_ = conf_.getParameter<
bool>(
"ClusterHisto");
192 topFolderName_ = conf_.getParameter<
std::string>(
"TopFolderName");
195 clusterProducerStripToken_ =
196 consumes<edmNew::DetSetVector<SiStripCluster> >(conf_.getParameter<
edm::InputTag>(
"ClusterProducerStrip"));
197 clusterProducerPixToken_ =
198 consumes<edmNew::DetSetVector<SiPixelCluster> >(conf_.getParameter<
edm::InputTag>(
"ClusterProducerPix"));
206 applyClusterQuality_ = cluster_condition.
getParameter<
bool>(
"On");
207 sToNLowerLimit_ = cluster_condition.
getParameter<
double>(
"minStoN");
208 sToNUpperLimit_ = cluster_condition.
getParameter<
double>(
"maxStoN");
209 widthLowerLimit_ = cluster_condition.
getParameter<
double>(
"minWidth");
210 widthUpperLimit_ = cluster_condition.
getParameter<
double>(
"maxWidth");
214 historyProducerToken_ = consumes<EventWithHistory>(conf_.getParameter<
edm::InputTag>(
"HistoryProducer"));
217 apvPhaseProducerToken_ = consumes<APVCyclePhaseCollection>(conf_.getParameter<
edm::InputTag>(
"ApvPhaseProducer"));
219 bool checkDCS = conf_.getParameter<
bool>(
"UseDCSFiltering");
223 dcsStatus_ =
nullptr;
256 std::vector<uint32_t> activeDets;
269 std::make_unique<TkHistoMap>(tkDetMap, ibooker,
topFolderName_,
"TkHMap_NumberOfCluster", 0.,
true);
272 tkDetMap, ibooker,
topFolderName_ +
"/TkHistoMap",
"TkHMap_NumberOfCluster", 0.,
false);
277 std::make_unique<TkHistoMap>(tkDetMap, ibooker,
topFolderName_,
"TkHMap_ClusterCharge", 0.,
true);
280 tkDetMap, ibooker,
topFolderName_ +
"/TkHistoMap",
"TkHMap_ClusterCharge", 0.,
false);
284 edm::LogInfo(
"SiStripTkDQM|SiStripMonitorCluster") <<
"nr. of activeDets: " << activeDets.size();
285 for (std::vector<uint32_t>::iterator detid_iterator = activeDets.begin(); detid_iterator != activeDets.end();
287 uint32_t detid = (*detid_iterator);
291 activeDets.erase(detid_iterator);
307 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo);
311 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(
label);
314 int32_t lnumber = det_layer_pair.second;
315 std::vector<uint32_t> layerDetIds;
316 if (det_layer_pair.first ==
"TIB") {
318 }
else if (det_layer_pair.first ==
"TOB") {
320 }
else if (det_layer_pair.first ==
"TID" && lnumber > 0) {
322 }
else if (det_layer_pair.first ==
"TID" && lnumber < 0) {
324 }
else if (det_layer_pair.first ==
"TEC" && lnumber > 0) {
326 }
else if (det_layer_pair.first ==
"TEC" && lnumber < 0) {
332 folder_organizer.
setLayerFolder(detid, tTopo, det_layer_pair.second);
437 HistoName =
"MainDiagonalPosition_vs_BX";
451 HistoName =
"TH2MainDiagonalPosition_vs_BX";
502 const char*
HistoName =
"StripClusVsBXandOrbit";
503 const char* HistoTitle =
504 "Strip cluster multiplicity vs BX mod(70) and Orbit;Event 1 BX "
505 "mod(70);time [Orb#]";
510 ParametersNclusVsCycleTimeProf2D.
getParameter<int32_t>(
"Nbins"),
511 ParametersNclusVsCycleTimeProf2D.
getParameter<
double>(
"xmin"),
512 ParametersNclusVsCycleTimeProf2D.
getParameter<
double>(
"xmax"),
513 ParametersNclusVsCycleTimeProf2D.
getParameter<int32_t>(
"Nbinsy"),
514 ParametersNclusVsCycleTimeProf2D.
getParameter<
double>(
"ymin"),
515 ParametersNclusVsCycleTimeProf2D.
getParameter<
double>(
"ymax"),
524 const char*
HistoName =
"ClusterWidths_vs_Amplitudes";
525 const char* HistoTitle =
526 "Cluster widths vs amplitudes;Amplitudes (integrated ADC "
527 "counts);Cluster widths";
530 ParametersClusWidthVsAmpTH2.
getParameter<int32_t>(
"Nbinsx"),
531 ParametersClusWidthVsAmpTH2.
getParameter<
double>(
"xmin"),
532 ParametersClusWidthVsAmpTH2.
getParameter<
double>(
"xmax"),
533 ParametersClusWidthVsAmpTH2.
getParameter<int32_t>(
"Nbinsy"),
534 ParametersClusWidthVsAmpTH2.
getParameter<
double>(
"ymin"),
535 ParametersClusWidthVsAmpTH2.
getParameter<
double>(
"ymax"));
562 HistoName =
"NumberOfClustersInStrip_vs_BX";
577 HistoName =
"NumberOfClustersInPixel_vs_BX";
593 HistoName =
"NumberOfClustersinFED_v_FEDID";
618 edm::LogInfo(
"SiStripMonitorCluster") <<
"SiStripMonitorCluster::bookHistograms: "
619 <<
" Creating MEs for new Cabling ";
624 edm::LogInfo(
"SiStripMonitorCluster") <<
"SiStripMonitorCluster::bookHistograms: "
625 <<
" Resetting MEs ";
655 if (!
iEvent.isRealData()) {
657 :
iEvent.eventAuxiliary().luminosityBlock();
661 :
iEvent.orbitNumber() / (1 * 262144.0);
664 int NPixClusters = 0, NStripClusters = 0, MultiplicityRegion = 0;
665 bool isPixValid =
false;
680 if (!cluster_detsetvektor.
isValid())
684 NStripClusters = StrC->
data().
size();
686 if (cluster_detsetvektor_pix.
isValid()) {
690 MultiplicityRegion =
FindRegion(NStripClusters, NPixClusters);
712 iSubdet->second.totNClusters = 0;
716 bool found_layer_me =
false;
718 std::map<int, int> FEDID_v_clustersum;
725 int ncluster_layer = 0;
726 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_label);
731 layer_single = iLayerME->second;
732 found_layer_me =
true;
735 int ncluster_ring[20] = {0};
737 bool found_module_me =
false;
741 for (std::vector<uint32_t>::const_iterator iterDets = iterLayer->second.begin();
742 iterDets != iterLayer->second.end();
746 uint32_t detid = (*iterDets);
749 if (subdet_label.empty())
755 std::map<uint32_t, ModMEs>::iterator imodME =
ModuleMEsMap.find(detid);
757 mod_single = imodME->second;
758 found_module_me =
true;
761 found_module_me =
false;
764 cluster_detsetvektor->find(detid);
766 if (isearch == cluster_detsetvektor->end() and passDCSFilter_) {
780 if (isearch == cluster_detsetvektor->end()) {
796 std::vector<const FedChannelConnection*> fedConnections = siStripDetCabling.
getConnections(detid);
800 int good_fcc_index = -999;
801 for (
unsigned int x = 0;
x < fedConnections.size();
x++) {
802 if (fedConnections[
x] !=
nullptr) {
807 if (good_fcc_index != -999 && fedConnections[good_fcc_index] !=
nullptr) {
808 int temp_fedid = fedConnections[good_fcc_index]->fedId();
809 if (FEDID_v_clustersum.find(temp_fedid) != FEDID_v_clustersum.end()) {
810 if (cluster_detset.
size() < 1000 && !cluster_detset.
empty()) {
811 FEDID_v_clustersum[temp_fedid] = FEDID_v_clustersum.find(temp_fedid)->second + cluster_detset.
size();
814 if (cluster_detset.
size() < 1000 && !cluster_detset.
empty()) {
815 FEDID_v_clustersum[temp_fedid] = cluster_detset.
size();
819 edm::LogInfo(
"SiStripMonitorCluster") <<
"SiStripMonitorCluster::analyze WARNING! no good connections "
837 ncluster_layer += cluster_detset.
size();
839 short total_clusterized_strips = 0;
846 clusterIter != cluster_detset.
end();
848 const auto& ampls = clusterIter->amplitudes();
850 float cluster_position = clusterIter->barycenter();
852 short cluster_start = clusterIter->firstStrip();
854 short cluster_width = ampls.size();
856 total_clusterized_strips = total_clusterized_strips + cluster_width;
859 tkmapclusterch->fill(detid, static_cast<float>(clusterIter->charge()));
862 float cluster_signal = 0.0;
863 float cluster_noise = 0.0;
864 int nrnonzeroamplitudes = 0;
867 for (
uint iamp = 0; iamp < ampls.size(); iamp++) {
868 if (ampls[iamp] > 0) {
869 cluster_signal += ampls[iamp];
870 if (!siStripQuality.
IsStripBad(qualityRange, clusterIter->firstStrip() + iamp)) {
871 noise = siStripNoises.
getNoise(clusterIter->firstStrip() + iamp, detNoiseRange) /
872 siStripGain.
getStripGain(clusterIter->firstStrip() + iamp, detGainRange);
875 nrnonzeroamplitudes++;
879 if (nrnonzeroamplitudes > 0)
880 cluster_noise =
sqrt(noise2 / nrnonzeroamplitudes);
883 (cluster_signal / cluster_noise < sToNLowerLimit_ || cluster_signal / cluster_noise >
sToNUpperLimit_ ||
888 cluster_properties.
charge = cluster_signal;
889 cluster_properties.
position = cluster_position;
890 cluster_properties.
start = cluster_start;
891 cluster_properties.
width = cluster_width;
892 cluster_properties.
noise = cluster_noise;
895 if (found_module_me and passDCSFilter_)
899 if (found_layer_me and passDCSFilter_) {
906 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
909 iSubdet->second.SubDetClusterChargeTH1->Fill(cluster_signal);
911 iSubdet->second.SubDetClusterWidthTH1->Fill(cluster_width);
916 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
918 iSubdet->second.SubDetClusWidthVsAmpTH2->Fill(cluster_signal, cluster_width);
926 (subdet_label.find(
"TID") != std::string::npos || subdet_label.find(
"TEC") != std::string::npos)) {
927 std::pair<std::string, int32_t> det_ring_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
true);
928 ncluster_ring[
std::abs(det_ring_pair.second)]++;
934 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
935 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo);
936 iSubdet->second.SubDetNumberOfClusterPerLayerTrend->Fill(
941 (subdet_label.find(
"TID") != std::string::npos || subdet_label.find(
"TEC") != std::string::npos)) {
942 std::pair<std::string, int32_t> det_ring_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
true);
947 short total_nr_strips = siStripDetCabling.
nApvPairs(detid) * 2 * 128;
948 float local_occupancy = static_cast<float>(total_clusterized_strips) / static_cast<float>(total_nr_strips);
949 if (found_module_me and passDCSFilter_) {
968 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
970 iSubdet->second.totNClusters += ncluster_layer;
983 long long dbx = event_history->
deltaBX();
986 bool global_histo_filled =
false;
987 bool MultiplicityRegion_Vs_APVcycle_filled =
false;
1002 long long tbx_corr = tbx;
1012 tbx_corr -= the_phase;
1020 global_histo_filled =
true;
1024 if (cluster_detsetvektor_pix.
isValid()) {
1039 map<int, int>::iterator it;
1042 for (
auto const& fedidEntry : FEDID_v_clustersum) {
1050 FEDID_v_clustersum.clear();
1054 if (isPixValid && !MultiplicityRegion_Vs_APVcycle_filled && passDCSFilter_) {
1061 MultiplicityRegion_Vs_APVcycle_filled =
true;
1080 long long tbx_corr = tbx;
1081 int the_phase = apv_phase_collection->
getPhase(
"All");
1087 tbx_corr -= the_phase;
1136 hid = hidmanager.
createHistoId(
"NumberOfClusters",
"det", detid);
1144 short total_nr_strips = siStripDetCabling.
nApvPairs(detid) * 2 * 128;
1145 hid = hidmanager.
createHistoId(
"ClusterPosition",
"det", detid);
1152 short total_nr_strips = siStripDetCabling.
nApvPairs(detid) * 2 * 128;
1153 hid = hidmanager.
createHistoId(
"ClusterDigiPosition",
"det", detid);
1160 hid = hidmanager.
createHistoId(
"ClusterWidth",
"det", detid);
1167 hid = hidmanager.
createHistoId(
"ClusterCharge",
"det", detid);
1174 hid = hidmanager.
createHistoId(
"ClusterNoise",
"det", detid);
1181 hid = hidmanager.
createHistoId(
"ClusterSignalOverNoise",
"det", detid);
1188 hid = hidmanager.
createHistoId(
"ClusterSignalOverNoiseVsPos",
"det", detid);
1203 hid = hidmanager.
createHistoId(
"ClusterLocalOccupancy",
"det", detid);
1210 hid = hidmanager.
createHistoId(
"NrOfClusterizedStrips",
"det", detid);
1216 hid = hidmanager.
createHistoId(
"ClusterWidths_vs_Amplitudes",
"det", detid);
1261 "TH1ClusterWidth", hidmanager.
createHistoLayer(
"Summary_ClusterWidth",
"layer",
label,
"").c_str(), ibooker);
1270 "TH1ClusterNoise", hidmanager.
createHistoLayer(
"Summary_ClusterNoise",
"layer",
label,
"").c_str(), ibooker);
1279 "TH1ClusterCharge", hidmanager.
createHistoLayer(
"Summary_ClusterCharge",
"layer",
label,
"").c_str(), ibooker);
1299 bookME1D(
"TH1ModuleLocalOccupancy",
1318 if (
label.find(
"TID") != std::string::npos ||
label.find(
"TEC") != std::string::npos) {
1322 "NumberOfClusterPerRingVsTrendVar",
1451 double h2ymax = 9999.0;
1452 double yfact =
Parameters.getParameter<
double>(
"yfactor");
1453 if (
label.find(
"TIB") != std::string::npos)
1454 h2ymax = (6984. * 256.) * yfact;
1455 else if (
label.find(
"TID") != std::string::npos)
1456 h2ymax = (2208. * 256.) * yfact;
1457 else if (
label.find(
"TOB") != std::string::npos)
1458 h2ymax = (12906. * 256.) * yfact;
1459 else if (
label.find(
"TEC") != std::string::npos)
1460 h2ymax = (7552. * 2. * 256.) * yfact;
1535 for (
int ipos = cluster.
start + 1; ipos <= cluster.
start + cluster.
width; ipos++) {
1544 if (cluster.
noise > 0)
1549 if (cluster.
noise > 0)
1619 me->setCanExtend(TH1::kAllAxes);
1651 double kplus =
k0 * (1 +
dk0 / 100);
1652 double kminus =
k0 * (1 -
dk0 / 100);
1655 if (nstrip != 0 && npix >= (nstrip * kminus -
q0) && npix <= (nstrip * kplus +
q0))
1657 else if (nstrip != 0 && npix < (nstrip * kminus -
q0) && nstrip <=
maxClus)
1659 else if (nstrip != 0 && npix < (nstrip * kminus -
q0) && nstrip >
maxClus)
1661 else if (nstrip != 0 && npix > (nstrip * kplus +
q0))
1663 else if (npix >
minPix && nstrip == 0)