26 siStripClusterInfo_(consumesCollector()),
32 tracksCollection_in_EventTree(
true),
35 conf.getParameter<edm::
ParameterSet>(
"genericTriggerEventPSet"), consumesCollector(), *this)) {
79 <<
" detectors instantiated in the geometry" << std::endl;
94 book(ibooker, trackerTopology, tkDetMap);
110 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::analyse] "
111 <<
"Run " << e.
id().
run() <<
" Event " << e.
id().
event() << std::endl;
120 iSubDet->second.totNClustersOnTrack = 0;
121 iSubDet->second.totNClustersOffTrack = 0;
134 std::map<std::string, MonitorElement*>::iterator iME;
135 std::map<std::string, LayerMEs>::iterator iLayerME;
137 if (!(
topFolderName_.find(
"IsolatedBunches") != std::string::npos)) {
171 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_StoNCorrOnTrack", 0.0,
true);
173 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberOfOnTrackCluster", 0.0,
true);
175 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberOfOfffTrackCluster", 0.0,
true);
177 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_ChargePerCMfromTrack", 0.0,
true);
179 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberMissingHits", 0.0,
true,
true);
181 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberInactiveHits", 0.0,
true,
true);
183 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberValidHits", 0.0,
true,
true);
187 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_ClusterWidthOnTrack", 0.0,
true);
189 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_ClusterWidthOffTrack", 0.0,
true);
193 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_ChargePerCMfromOrigin", 0.0,
true);
196 std::vector<uint32_t> vdetId_;
198 const char* tec =
"TEC";
199 const char* tid =
"TID";
204 for (std::vector<uint32_t>::const_iterator detid_iter = vdetId_.begin(), detid_end = vdetId_.end();
205 detid_iter != detid_end;
207 uint32_t detid = *detid_iter;
210 edm::LogError(
"SiStripMonitorTrack") <<
"[" << __PRETTY_FUNCTION__ <<
"] invalid detid " << detid << std::endl;
217 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
false);
226 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_id);
228 folder_organizer.
setLayerFolder(detid, tTopo, det_layer_pair.second,
false);
232 const char* subdet = det_layer_pair.first.c_str();
233 if (std::strstr(subdet, tec) !=
nullptr || std::strstr(subdet, tid) !=
nullptr) {
235 std::map<std::string, RingMEs>::iterator iRingME =
RingMEsMap.find(ring_id);
237 std::pair<std::string, int32_t> det_ring_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
true);
238 folder_organizer.
setLayerFolder(detid, tTopo, det_ring_pair.second,
true);
244 std::pair<std::string, std::string> sdet_pair = folder_organizer.
getSubDetFolderAndTag(detid, tTopo);
254 for (std::vector<uint32_t>::const_iterator detid_iter = vdetId_.begin(), detid_end = vdetId_.end();
255 detid_iter != detid_end;
257 uint32_t detid = *detid_iter;
260 edm::LogError(
"SiStripMonitorTrack") <<
"[" << __PRETTY_FUNCTION__ <<
"] invalid detid " << detid << std::endl;
267 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
false);
276 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_id);
278 folder_organizer.
setLayerFolder(detid, tTopo, det_layer_pair.second,
false);
282 const char* subdet = det_layer_pair.first.c_str();
283 if (std::strstr(subdet, tec) !=
nullptr || std::strstr(subdet, tid) !=
nullptr) {
285 std::map<std::string, RingMEs>::iterator iRingME =
RingMEsMap.find(ring_id);
287 std::pair<std::string, int32_t> det_ring_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
true);
288 folder_organizer.
setLayerFolder(detid, tTopo, det_ring_pair.second,
true);
294 std::pair<std::string, std::string> sdet_pair = folder_organizer.
getSubDetFolderAndTag(detid, tTopo);
303 if (!(topFolderName_.find(
"IsolatedBunches") != std::string::npos)) {
307 ibooker.
book1D(
"ClusterStoNCorr_OnTrack_TIBTID",
"TIB/TID [FECCrate=1] (OnTrack)", 100, 0., 100.);
311 ibooker.
book1D(
"ClusterStoNCorr_OnTrack_TOB",
"TOB [FECCrate=4] (OnTrack)", 100, 0., 100.);
315 ibooker.
book1D(
"ClusterStoNCorr_OnTrack_TECM",
"TECM [FECCrate=3] (OnTrack)", 100, 0., 100.);
319 ibooker.
book1D(
"ClusterStoNCorr_OnTrack_TECP",
"TECP [FECCrate=2] (OnTrack)", 100, 0., 100.);
323 ibooker.
book2D(
"ClusterStoNCorr_OnTrack_FECCratevsFECSlot",
" S/N (On track)", 22, 0.5, 22.5, 4, 0.5, 4.5);
332 "TIB/TID [FECCrate=1] (OnTrack)",
343 "ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TOB",
"TOB [FECCrate=4] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
348 "ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECM",
"TEC- [FECCrate=3] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
353 "ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECP",
"TEC- [FECCrate=2] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
362 ibooker.
book2D(
"ClusterCount_OnTrack_FECCratevsFECSlot",
" S/N (On track)", 22, 0.5, 22.5, 4, 0.5, 4.5);
371 "ClusterCount_OnTrack_FECSlotVsFECRing_TIBTID",
"TIB/TID [FECCrate=1] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
376 "ClusterCount_OnTrack_FECSlotVsFECRing_TOB",
"TOB [FECCrate=4] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
381 "ClusterCount_OnTrack_FECSlotVsFECRing_TECM",
"TEC- [FECCrate=3] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
386 "ClusterCount_OnTrack_FECSlotVsFECRing_TECP",
"TEC- [FECCrate=2] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
398 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(hid);
404 bookME1D(ibooker,
"TH1ClusterWidth", hidmanager.
createHistoId(
"ClusterWidth_OnTrack", name,
id).c_str());
410 bookME1D(ibooker,
"TH1ClusterCharge", hidmanager.
createHistoId(
"ClusterCharge_OnTrack", name,
id).c_str());
413 ibooker,
"TH1ClusterChargeRaw", hidmanager.
createHistoId(
"ClusterChargeRaw_OnTrack", name,
id).c_str());
416 ibooker,
"TH1ClusterChargeCorr", hidmanager.
createHistoId(
"ClusterChargeCorr_OnTrack", name,
id).c_str());
419 ibooker,
"TH1ClusterStoNCorrMod", hidmanager.
createHistoId(
"ClusterStoNCorr_OnTrack", name,
id).c_str());
423 hidmanager.
createHistoId(
"ClusterPosition_OnTrack", name,
id).c_str(),
426 total_nr_strips + 0.5);
432 ibooker,
"TH1ClusterChargePerCM", hidmanager.
createHistoId(
"ClusterChargePerCMfromTrack", name,
id).c_str());
435 ibooker,
"TH1ClusterChargePerCM", hidmanager.
createHistoId(
"ClusterChargePerCMfromOrigin", name,
id).c_str());
449 if (
id.
find(
"TEC") == std::string::npos &&
id.find(
"TID") == std::string::npos) {
450 me =
bookME1D(ibooker, histoParameters.c_str(), histoName.c_str());
454 me =
bookME1D(ibooker, histoParameters.c_str(), histoName.c_str());
474 hname = hidmanager.
createHistoLayer(
"Summary_ClusterStoNCorr", name, layer_id,
"OnTrack");
475 hpar =
"TH1ClusterStoNCorr";
479 hname = hidmanager.
createHistoLayer(
"Summary_ClusterGain", name, layer_id,
"");
480 hpar =
"TH1ClusterGain";
484 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeCorr", name, layer_id,
"OnTrack");
485 hpar =
"TH1ClusterChargeCorr";
489 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge", name, layer_id,
"OnTrack");
490 hpar =
"TH1ClusterCharge";
493 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge", name, layer_id,
"OffTrack");
494 hpar =
"TH1ClusterCharge";
498 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeRaw", name, layer_id,
"OnTrack");
499 hpar =
"TH1ClusterChargeRaw";
502 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeRaw", name, layer_id,
"OffTrack");
503 hpar =
"TH1ClusterChargeRaw";
507 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise", name, layer_id,
"OnTrack");
508 hpar =
"TH1ClusterNoise";
511 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise", name, layer_id,
"OffTrack");
512 hpar =
"TH1ClusterNoise";
516 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth", name, layer_id,
"OnTrack");
517 hpar =
"TH1ClusterWidth";
520 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth", name, layer_id,
"OffTrack");
521 hpar =
"TH1ClusterWidth";
526 if (layer_id.find(
"TEC") != std::string::npos)
527 total_nr_strips = 3 * 2 * 128;
529 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition", name, layer_id,
"OnTrack");
530 hpar =
"TH1ClusterPos";
531 if (layer_id.find(
"TIB") != std::string::npos || layer_id.find(
"TOB") != std::string::npos ||
537 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition2D", name, layer_id,
"OnTrack");
538 hpar =
"TH2ClusterPosTOB";
539 if (layer_id.find(
"TOB") != std::string::npos)
542 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition2D", name, layer_id,
"OnTrack");
543 hpar =
"TH2ClusterPosTIB";
544 if (layer_id.find(
"TIB") != std::string::npos)
547 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition2D", name, layer_id,
"OnTrack");
548 hpar =
"TH2ClusterPosTEC";
549 if (layer_id.find(
"TEC") != std::string::npos) {
550 static constexpr
int nbinR = 8;
551 static constexpr
float rval[9] = {0, 21.2, 30.8, 40.4, 50.0, 60.0, 75.0, 90.0, 110.0};
552 static constexpr
int nmodulesPhi = 40 * 6;
553 float phival[nmodulesPhi];
554 for (
int i = 0;
i < nmodulesPhi;
i++)
555 phival[
i] = -3.2 + 2 *
i * 3.2 / nmodulesPhi;
557 TH2F*
temp =
new TH2F(
"tmp",
"tmp", nbinR, rval, nmodulesPhi - 1, phival);
561 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition2D", name, layer_id,
"OnTrack");
562 hpar =
"TH2ClusterPosTID";
563 if (layer_id.find(
"TID") != std::string::npos) {
564 static constexpr
int nbinR = 4;
565 static constexpr
float rval[5] = {0, 21.2, 30.8, 40.4, 50.0};
566 static constexpr
int nmodulesPhi = 80 * 4;
567 float phival[nmodulesPhi];
568 for (
int i = 0;
i < nmodulesPhi;
i++)
569 phival[
i] = -3.2 +
i * 2 * 3.2 / nmodulesPhi;
571 TH2F*
temp =
new TH2F(
"tmp",
"tmp", nbinR, rval, nmodulesPhi - 1, phival);
575 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition", name, layer_id,
"OffTrack");
576 hpar =
"TH1ClusterPos";
577 if (layer_id.find(
"TIB") != std::string::npos || layer_id.find(
"TOB") != std::string::npos ||
582 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromTrack", name, layer_id,
"");
583 hpar =
"TH1ClusterChargePerCM";
586 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromOrigin", name, layer_id,
"OnTrack");
587 hpar =
"TH1ClusterChargePerCM";
590 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromOrigin", name, layer_id,
"OffTrack");
591 hpar =
"TH1ClusterChargePerCM";
607 hname = hidmanager.
createHistoLayer(
"Summary_ClusterStoNCorr", name, ring_id,
"OnTrack");
608 hpar =
"TH1ClusterStoNCorr";
612 hname = hidmanager.
createHistoLayer(
"Summary_ClusterGain", name, ring_id,
"");
613 hpar =
"TH1ClusterGain";
617 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeCorr", name, ring_id,
"OnTrack");
618 hpar =
"TH1ClusterChargeCorr";
622 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge", name, ring_id,
"OnTrack");
623 hpar =
"TH1ClusterCharge";
626 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge", name, ring_id,
"OffTrack");
627 hpar =
"TH1ClusterCharge";
631 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeRaw", name, ring_id,
"OnTrack");
632 hpar =
"TH1ClusterChargeRaw";
635 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeRaw", name, ring_id,
"OffTrack");
636 hpar =
"TH1ClusterChargeRaw";
640 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise", name, ring_id,
"OnTrack");
641 hpar =
"TH1ClusterNoise";
644 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise", name, ring_id,
"OffTrack");
645 hpar =
"TH1ClusterNoise";
649 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth", name, ring_id,
"OnTrack");
650 hpar =
"TH1ClusterWidth";
653 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth", name, ring_id,
"OffTrack");
654 hpar =
"TH1ClusterWidth";
659 if (ring_id.find(
"TEC") != std::string::npos)
660 total_nr_strips = 3 * 2 * 128;
662 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition", name, ring_id,
"OnTrack");
663 hpar =
"TH1ClusterPos";
667 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition", name, ring_id,
"OffTrack");
668 hpar =
"TH1ClusterPos";
673 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromTrack", name, ring_id,
"");
674 hpar =
"TH1ClusterChargePerCM";
677 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromOrigin", name, ring_id,
"OnTrack");
678 hpar =
"TH1ClusterChargePerCM";
681 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromOrigin", name, ring_id,
"OffTrack");
682 hpar =
"TH1ClusterChargePerCM";
694 subdet_tag =
"__" +
name;
701 completeName =
"Summary_TotalNumberOfClusters_OnTrack" +
subdet_tag;
702 axisName =
"Number of on-track clusters in " +
name;
708 completeName =
"Summary_TotalNumberOfClusters_OffTrack" +
subdet_tag;
709 axisName =
"Number of off-track clusters in " +
name;
714 if (name.find(
"TIB") != std::string::npos) {
718 if (name.find(
"TOB") != std::string::npos) {
722 if (name.find(
"TID") != std::string::npos) {
726 if (name.find(
"TEC") != std::string::npos) {
734 completeName =
"Summary_ClusterGain" +
subdet_tag;
738 completeName =
"Summary_ClusterStoNCorr_OnTrack" +
subdet_tag;
741 completeName =
"Summary_ClusterStoNCorrThin_OnTrack" +
subdet_tag;
742 if (subdet_tag.find(
"TEC") != std::string::npos)
745 completeName =
"Summary_ClusterStoNCorrThick_OnTrack" +
subdet_tag;
746 if (subdet_tag.find(
"TEC") != std::string::npos)
750 completeName =
"Summary_ClusterChargeCorr_OnTrack" +
subdet_tag;
753 completeName =
"Summary_ClusterChargeCorrThin_OnTrack" +
subdet_tag;
754 if (subdet_tag.find(
"TEC") != std::string::npos)
757 completeName =
"Summary_ClusterChargeCorrThick_OnTrack" +
subdet_tag;
758 if (subdet_tag.find(
"TEC") != std::string::npos)
762 completeName =
"Summary_ClusterCharge_OnTrack" +
subdet_tag;
766 completeName =
"Summary_ClusterChargeRaw_OnTrack" +
subdet_tag;
770 completeName =
"Summary_ClusterCharge_OffTrack" +
subdet_tag;
774 completeName =
"Summary_ClusterChargeRaw_OffTrack" +
subdet_tag;
778 completeName =
"Summary_ClusterStoN_OffTrack" +
subdet_tag;
782 completeName =
"Summary_ClusterChargePerCMfromTrack" +
subdet_tag;
786 completeName =
"Summary_ClusterChargePerCMfromOrigin_OnTrack" +
subdet_tag;
790 completeName =
"Summary_ClusterChargePerCMfromOrigin_OffTrack" +
subdet_tag;
795 completeName =
"Trend_TotalNumberOfClusters_OnTrack" +
subdet_tag;
797 completeName =
"Trend_TotalNumberOfClusters_OffTrack" +
subdet_tag;
807 const char* ParameterSetLabel,
810 return ibooker.
book1D(HistoName,
819 const char* ParameterSetLabel,
822 return ibooker.
book2D(HistoName,
834 const char* ParameterSetLabel,
837 return ibooker.
book3D(HistoName,
852 const char* ParameterSetLabel,
883 me->setAxisTitle(
"Lumisection", 1);
892 auto const& trajParams = track.
extra()->trajParams();
896 auto ttrh = *(hb +
h);
899 uint32_t thedetid = ttrh->rawId();
902 if ((ttrh->getType() == 1))
904 if ((ttrh->getType() == 2))
906 if ((ttrh->getType() == 0))
911 if (!ttrh->isValid())
915 auto statedirection = trajParams[
h].momentum();
925 LogTrace(
"SiStripMonitorTrack") <<
"\nMatched recHit found" << std::endl;
932 statedirection = monodet->
toLocal(gtrkdirup);
935 if (statedirection.mag())
936 RecHitInfo<SiStripRecHit2D>(&m, statedirection, digilist, ev, track_ok);
939 statedirection = stereodet->
toLocal(gtrkdirup);
942 if (statedirection.mag())
943 RecHitInfo<SiStripRecHit2D>(&s, statedirection, digilist, ev, track_ok);
944 }
else if (projhit) {
945 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found" << std::endl;
954 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found MONO" << std::endl;
956 statedirection = det->
toLocal(gtrkdirup);
957 if (statedirection.mag())
958 RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist,
ev, track_ok);
960 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found STEREO" << std::endl;
963 statedirection = det->
toLocal(gtrkdirup);
964 if (statedirection.mag())
965 RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist,
ev, track_ok);
968 if (statedirection.mag())
969 RecHitInfo<SiStripRecHit2D>(hit2D, statedirection, digilist, ev, track_ok);
971 if (statedirection.mag())
972 RecHitInfo<SiStripRecHit1D>(hit1D, statedirection, digilist, ev, track_ok);
974 LogDebug(
"SiStripMonitorTrack") <<
" LocalMomentum: " << statedirection
975 <<
"\nLocal x-z plane angle: " << atan2(statedirection.x(), statedirection.z());
987 const bool track_ok) {
990 LogTrace(
"SiStripMonitorTrack") <<
"\nMatched recHit found" << std::endl;
998 statedirection = monodet->
toLocal(gtrkdirup);
1000 if (statedirection.
mag())
1001 RecHitInfo<SiStripRecHit2D>(&m, statedirection, digilist, ev, track_ok);
1005 statedirection = stereodet->
toLocal(gtrkdirup);
1007 if (statedirection.
mag())
1008 RecHitInfo<SiStripRecHit2D>(&s, statedirection, digilist, ev, track_ok);
1009 }
else if (projhit) {
1010 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found" << std::endl;
1020 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found MONO" << std::endl;
1022 statedirection = det->
toLocal(gtrkdirup);
1023 if (statedirection.
mag())
1024 RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist,
ev, track_ok);
1026 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found STEREO" << std::endl;
1029 statedirection = det->
toLocal(gtrkdirup);
1030 if (statedirection.
mag())
1031 RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist,
ev, track_ok);
1034 statedirection = localMomentum;
1035 if (statedirection.
mag())
1036 RecHitInfo<SiStripRecHit2D>(hit2D, statedirection, digilist, ev, track_ok);
1038 statedirection = localMomentum;
1039 if (statedirection.
mag())
1040 RecHitInfo<SiStripRecHit1D>(hit1D, statedirection, digilist, ev, track_ok);
1042 LogDebug(
"SiStripMonitorTrack") <<
" LocalMomentum: " << statedirection
1043 <<
"\nLocal x-z plane angle: " << atan2(statedirection.
x(), statedirection.
z());
1048 using namespace std;
1049 using namespace edm;
1050 using namespace reco;
1063 auto& digilist = digihandle.isValid() ? *(digihandle.product()) : dummy;
1065 if (trackCollectionHandle.isValid()) {
1076 if (track.
pt() < 0.8)
1078 if (track.
p() < 2.0)
1092 for (reco::TrackCollection::const_iterator
track = trackCollection.begin(), etrack = trackCollection.end();
1100 uint32_t thedetid = (*hit)->rawId();
1103 if (((*hit)->getType() == 1))
1105 if (((*hit)->getType() == 2))
1107 if (((*hit)->getType() == 0))
1112 if (!(*hit)->isValid())
1114 DetId detID = (*hit)->geographicalId();
1127 hitStudy(ev, digilist, projhit, matchedhit, hit2D, hit1D, localMomentum, track_ok);
1171 for (reco::TrackCollection::const_iterator
track = trackCollection.begin(), etrack = trackCollection.end();
1174 LogDebug(
"SiStripMonitorTrack") <<
"Track number " << ++i << std::endl;
1196 if (!tkrecHit->isValid()) {
1197 LogTrace(
"SiStripMonitorTrack") <<
"\t\t Invalid Hit " << std::endl;
1201 const uint32_t& detid = tkrecHit->geographicalId().rawId();
1204 <<
"\n\t\tRecHit on det " << detid <<
"\n\t\tRecHit in LP " << tkrecHit->localPosition() <<
"\n\t\tRecHit in GP "
1206 <<
"\n\t\tRecHit trackLocal vector " << LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() << std::endl;
1209 if (tkrecHit !=
nullptr && tkrecHit->isValid()) {
1210 const DetId detid = tkrecHit->geographicalId();
1213 float clust_Pos1 = -1000;
1214 float clust_Pos2 = -1000;
1219 clust_Pos1 = theGlobalPos.
z();
1220 clust_Pos2 = theGlobalPos.
phi();
1222 clust_Pos1 =
pow(theGlobalPos.
x() * theGlobalPos.
x() + theGlobalPos.
y() * theGlobalPos.
y(), 0.5);
1223 clust_Pos2 = theGlobalPos.
phi();
1245 edm::LogError(
"SiStripMonitorTrack") <<
"NULL hit" << std::endl;
1257 auto& digilist = digihandle.
isValid() ? *(digihandle.
product()) : dummy;
1266 if (siStripClusterHandle.
isValid()) {
1269 DSVEnd = siStripClusterHandle->end();
1272 uint32_t detid = DSViter->id();
1275 LogDebug(
"SiStripMonitorTrack") <<
"on detid " << detid <<
" N Cluster= " << DSViter->size();
1306 edm::LogError(
"SiStripMonitorTrack") <<
"ClusterCollection is not valid!!" << std::endl;
1324 std::map<std::string, LayerMEs>::iterator iLayer =
LayerMEsMap.find(layer_id);
1326 me.
iLayer = &(iLayer->second);
1329 std::map<std::string, RingMEs>::iterator iRing =
RingMEsMap.find(ring_id);
1331 me.
iRing = &(iRing->second);
1334 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(sdet_tag);
1336 me.
iSubdet = &(iSubdet->second);
1353 for (
const auto&
track : *tracks) {
1356 uint32_t thedetid = (*hit)->rawId();
1357 if (!(
DetId(thedetid).subdetId() >= 3 &&
DetId(thedetid).subdetId() <= 6)) {
1361 if (!(*hit)->isValid())
1365 if (theHit ==
nullptr) {
1373 if (hit1D && !hit2D) {
1379 else if (!hit1D && hit2D) {
1385 std::vector<const FedChannelConnection*> getFedChanConnections;
1392 for (
const auto& getFedChanConnection : getFedChanConnections) {
1393 if (getFedChanConnection ==
nullptr) {
1397 int binfeccrate = getFedChanConnection->fecCrate();
1398 int binfecslot = getFedChanConnection->fecSlot();
1399 int binfecring = getFedChanConnection->fecRing();
1463 double theMeanSoN = (input1->
getBinContent(binx, biny) * nentries +
value) / (nentries + 1);
1473 const uint32_t detid,
1484 if (cluster ==
nullptr)
1494 LogDebug(
"SiStripMonitorTrack") <<
"\n\tLV " << LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() <<
" " << LV.
mag()
1497 cosRZ = fabs(LV.
z()) / LV.
mag();
1498 LogDebug(
"SiStripMonitorTrack") <<
"\n\t cosRZ " << cosRZ << std::endl;
1505 uint16_t width = cluster->
width();
1509 double chargeraw = 0;
1510 double clustergain = 0;
1511 auto digi_it = digilist.
find(detid);
1513 for (
size_t chidx = 0; chidx < cluster->
stripCharges().size(); ++chidx) {
1522 if (digi_it == digilist.
end()) {
1525 for (
const auto& digiobj : *digi_it) {
1526 if (digiobj.strip() == cluster->
firstStrip() + chidx) {
1527 chargeraw += digiobj.adc();
1544 uint32_t adet = cluster->
detId();
1549 uint32_t adet = cluster->
detId();
1558 if (MEs.
iLayer !=
nullptr) {
1562 LogDebug(
"SiStripMonitorTrack") <<
"Module " << detid <<
" in Event " <<
eventNb <<
" noise "
1581 if (MEs.
iRing !=
nullptr) {
1585 LogDebug(
"SiStripMonitorTrack") <<
"Module " << detid <<
" in Event " <<
eventNb <<
" noise "
1625 uint32_t adet = cluster->
detId();
1630 LogDebug(
"SiStripMonitorTrack") <<
"Module " << detid <<
" in Event " <<
eventNb <<
" noise " << noise
1634 uint32_t adet = cluster->
detId();
1645 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(name);
1648 fillME(iModME->second.ClusterStoNCorr, StoN * cosRZ);
1651 <<
"Module " << name <<
" in Event " <<
eventNb <<
" noise " << noise << std::endl;
1652 fillME(iModME->second.ClusterGain, clustergain);
1653 fillME(iModME->second.ClusterCharge, charge);
1654 fillME(iModME->second.ClusterChargeRaw, chargeraw);
1656 fillME(iModME->second.ClusterChargeCorr, charge * cosRZ);
1658 fillME(iModME->second.ClusterWidth, width);
1659 fillME(iModME->second.ClusterPos, position);
1662 fillME(iModME->second.ClusterChargePerCMfromTrack, dQdx_fromTrack);
1664 fillME(iModME->second.ClusterChargePerCMfromOrigin, dQdx_fromOrigin);
1668 int PGVposCounter = cluster->
maxIndex();
1672 fillME(iModME->second.ClusterPGV,
i, 0.);
1674 fillME(iModME->second.ClusterPGV, PGVposCounter++, (*it) / PGVmax);
1676 for (
int i = PGVposCounter;
1679 fillME(iModME->second.ClusterPGV,
i, 0.);
1689 uint32_t adet = cluster->
detId();
1692 LogDebug(
"SiStripMonitorTrack") <<
"Module firing " << detid <<
" in Event " <<
eventNb << std::endl;
1696 uint32_t adet = cluster->
detId();
1703 if (MEs.
iLayer !=
nullptr) {
1713 if (MEs.
iRing !=
nullptr) {
MonitorElement * ClusterStoNCorr
ClusterRef cluster() const
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TIBTID
uint8_t maxCharge() const
MonitorElement * ClusterNoiseOnTrack
double p() const
momentum vector magnitude
std::unique_ptr< TkHistoMap > tkhisto_NoiseOffTrack
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyRunToken_
EventNumber_t event() const
struct SubDetMEs * iSubdet
void return2DME(MonitorElement *input1, MonitorElement *input2, int binx, int biny, double value)
Det2MEs findMEs(const TrackerTopology *tTopo, const uint32_t detid)
MonitorElement * ClusterStoNCorr_OnTrack_TECP
MonitorElement * ClusterChargePerCMfromTrack
MonitorElement * bookMEProfile(DQMStore::IBooker &, const char *, const char *)
uint16_t firstStrip() const
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
SiStripMonitorTrack(const edm::ParameterSet &)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyEventToken_
~SiStripMonitorTrack() override
virtual DQM_DEPRECATED void setCanExtend(unsigned int value)
iterator find(det_id_type id)
std::unique_ptr< TkHistoMap > tkhisto_ClChPerCMfromOrigin
void setSiStripFolderName(std::string name)
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > siStripDetCablingToken_
void setCluster(const SiStripCluster &cluster, int detId)
edm::EDGetTokenT< reco::TrackCollection > trackToken_
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
MonitorElement * ClusterChargeRawOffTrack
const GeomDetUnit * monoDet() const
void fillME(MonitorElement *ME, float value1)
const TrackExtraRef & extra() const
reference to "extra" object
std::pair< const std::string, const char * > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
virtual void setCurrentFolder(std::string const &fullpath)
SiStripDCSStatus * dcsStatus_
MonitorElement * nClustersTrendOnTrack
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
MonitorElement * ClusterPosOffTrack
MonitorElement * ClusterPosOnTrack
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void trackStudyFromTrack(edm::Handle< reco::TrackCollection > trackCollectionHandle, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev)
float noiseRescaledByGain() const
static constexpr auto TID
MonitorElement * ClusterGain
MonitorElement * ClusterStoNCorrOnTrack
math::XYZTLorentzVectorD LV
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
MonitorElement * ClusterStoNOffTrack
MonitorElement * ClusterChargeOnTrack
bool IsStripBad(const uint32_t &detid, const short &strip) const
std::map< std::string, RingMEs > RingMEsMap
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
std::string topFolderName_
const TrackerGeometry * tkgeom_
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
constexpr uint32_t rawId() const
get the raw id
std::vector< Track > TrackCollection
collection of Tracks
bool clusterInfos(SiStripClusterInfo *cluster, const uint32_t detid, enum ClusterFlags flags, bool track_ok, LocalVector LV, const Det2MEs &MEs, const TrackerTopology *tTopo, const SiStripGain *stripGain, const SiStripQuality *stripQuality, const edm::DetSetVector< SiStripDigi > &digilist, float clustZ, float clustPhi)
MonitorElement * ClusterStoNCorrThinOnTrack
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
MonitorElement * bookMETrend(DQMStore::IBooker &, const char *)
MonitorElement * ClusterChargePerCMfromTrack
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=false)
auto const & tracks
cannot be loose
MonitorElement * ClusterChargeCorrOnTrack
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
MonitorElement * ClusterChargeRawOffTrack
data_type const * const_iterator
std::string TrackProducer_
MonitorElement * ClusterPosOnTrack2D
bool trackFilter(const reco::Track &track)
void bookLayerMEs(DQMStore::IBooker &, const uint32_t, std::string &)
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
void RecHitInfo(const T *tkrecHit, LocalVector LV, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev, bool track_ok)
MonitorElement * ClusterChargeCorr
Log< level::Error, false > LogError
MonitorElement * ClusterGain
uint16_t maxIndex() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
MonitorElement * ClusterChargeOffTrack
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECM
MonitorElement * ClusterStoNCorrOnTrack
void bookHistograms(DQMStore::IBooker &, edm::Run const &, const edm::EventSetup &) override
MonitorElement * ClusterChargePerCMfromOriginOffTrack
auto stripCharges() const -> decltype(cluster() ->amplitudes())
MonitorElement * ClusterPGV
MonitorElement * ClusterChargeCorrThinOnTrack
MonitorElement * nClustersTrendOffTrack
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
SiStripModuleGeometry moduleGeometry(const DetId &id) const
bool getData(T &iHolder) const
MonitorElement * ClusterCharge
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
bool getStatus(edm::Event const &e, edm::EventSetup const &eSetup)
edmNew::DetSet< SiStripCluster >::const_iterator ClusIter
float signalOverNoise() const
edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
MonitorElement * ClusterCount_OnTrack_FECCratevsFECSlot
MonitorElement * ClusterChargeRawOnTrack
MonitorElement * ClusterChargeRaw
vector< ParameterSet > Parameters
MonitorElement * ClusterStoNCorr_OnTrack_TOB
MonitorElement * ClusterGain
edm::EventNumber_t eventNb
std::unordered_set< const SiStripCluster * > vPSiStripCluster
std::map< std::string, SubDetMEs > SubDetMEsMap
virtual void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
MonitorElement * ClusterChargeOffTrack
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
MonitorElement * nClustersOnTrack
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
double pt() const
track transverse momentum
const std::string subdet_tag("SubDet")
MonitorElement * ClusterStoNCorrOnTrack
std::unique_ptr< TkHistoMap > tkhisto_ClChPerCMfromTrack
MonitorElement * ClusterNoiseOffTrack
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
MonitorElement * bookME2D(DQMStore::IBooker &, const char *, const char *)
MonitorElement * ClusterWidthOnTrack
void bookSubDetMEs(DQMStore::IBooker &, std::string &name)
ClusterRef cluster() const
void book(DQMStore::IBooker &, const TrackerTopology *tTopo, const TkDetMap *tkDetMap)
SiStripClusterInfo siStripClusterInfo_
std::unique_ptr< TkHistoMap > tkhisto_NumOffTrack
MonitorElement * ClusterChargePerCMfromOrigin
const SiStripQuality * siStripQuality() const
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
MonitorElement * ClusterChargePerCMfromOriginOffTrack
SiStripFolderOrganizer folderOrganizer_
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
MonitorElement * ClusterChargePerCMfromTrack
virtual 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)
virtual double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * ClusterChargeOnTrack
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TOB
static constexpr auto TOB
MonitorElement * ClusterNoiseOffTrack
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > digiToken_
const TrackerGeomDet * idToDet(DetId) const override
iterator end()
Return the off-the-end iterator.
MonitorElement * ClusterChargeCorrOnTrack
MonitorElement * ClusterChargeCorrThickOnTrack
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TECM
SiStripHistoId hidmanager
SiStripRecHit2D originalHit() const
Detector identifier class for the strip tracker.
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
void bookModMEs(DQMStore::IBooker &, const uint32_t)
MonitorElement * ClusterChargeRawOnTrack
MonitorElement * ClusterWidth
MonitorElement * ClusterChargeOnTrack
SiStripRecHit2D stereoHit() const
void trajectoryStudy(const reco::Track &track, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev, bool track_ok)
MonitorElement * ClusterStoNCorr_OnTrack_FECCratevsFECSlot
T const * product() const
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECP
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
MonitorElement * ClusterWidthOffTrack
std::unique_ptr< TkHistoMap > tkhisto_ClusterWidthOffTrack
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
MonitorElement * ClusterPosOnTrack
void AllClusters(const edm::Event &ev)
MonitorElement * ClusterChargePerCMfromTrack
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
T getParameter(std::string const &) const
MonitorElement * ClusterPosOffTrack
bool fillControlViewHistos(const edm::Event &ev)
SiStripFolderOrganizer folder_organizer
MonitorElement * ClusterChargeOffTrack
std::map< std::string, ModMEs > ModMEsMap
virtual DQM_DEPRECATED void setStatOverflows(bool value)
MonitorElement * ClusterPos
MonitorElement * ClusterChargeCorrOnTrack
std::unique_ptr< TkHistoMap > tkhisto_StoNCorrOnTrack
static constexpr auto TIB
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=false)
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TOB
int numberOfValidTrackerHits() const
void trackStudyFromTrajectory(edm::Handle< reco::TrackCollection > trackCollectionHandle, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev)
MonitorElement * bookME3D(DQMStore::IBooker &, const char *, const char *)
MonitorElement * ClusterStoNCorr_OnTrack_TIBTID
SiStripRecHit2D monoHit() const
GenericTriggerEventFlag * genTriggerEventFlag_
const uint16_t nApvPairs(uint32_t det_id) const
MonitorElement * ClusterChargeRawOnTrack
std::unique_ptr< TkHistoMap > tkhisto_ClusterWidthOnTrack
MonitorElement * ClusterChargePerCMfromOriginOnTrack
const Range getRange(const uint32_t detID) const
std::unique_ptr< TkHistoMap > tkhisto_NumMissingHits
static int position[264][3]
const SiStripDetCabling * siStripDetCabling_
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &) override
std::unique_ptr< TkHistoMap > tkhisto_NoiseOnTrack
std::unique_ptr< TkHistoMap > tkhisto_NumberValidHits
std::unique_ptr< TkHistoMap > tkhisto_NumOnTrack
MonitorElement * ClusterWidthOnTrack
MonitorElement * bookME1D(DQMStore::IBooker &, const char *, const char *)
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TIBTID
trackerGeometryToken_(iC.esConsumes())
MonitorElement * ClusterGain
std::unique_ptr< TkHistoMap > tkhisto_NumberInactiveHits
DetId geographicalId() const
bool clchCMoriginTkHmap_On_
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
MonitorElement * ClusterChargePerCMfromOriginOnTrack
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
void initEvent(const edm::EventSetup &iSetup)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
void hitStudy(const edm::Event &ev, const edm::DetSetVector< SiStripDigi > &digilist, const ProjectedSiStripRecHit2D *projhit, const SiStripMatchedRecHit2D *matchedhit, const SiStripRecHit2D *hit2D, const SiStripRecHit1D *hit1D, LocalVector localMomentum, const bool track_ok)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
MonitorElement * ClusterWidthOffTrack
MonitorElement * book3D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, FUNC onbooking=NOOP())
MonitorElement * nClustersOffTrack
void trackStudy(const edm::Event &ev)
void bookRingMEs(DQMStore::IBooker &, const uint32_t, std::string &)
MonitorElement * ClusterStoNCorrThickOnTrack
MonitorElement * ClusterChargePerCMfromOriginOnTrack
bool applyClusterQuality_
Power< A, B >::type pow(const A &a, const B &b)
edm::InputTag Cluster_src_
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * handleBookMEs(DQMStore::IBooker &, std::string &, std::string &, std::string &, std::string &)
static constexpr auto TEC
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
const GeomDetUnit * stereoDet() const
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TECP
const SiStripGain * siStripGain() const
unsigned int tecSide(const DetId &id) const
MonitorElement * ClusterStoNCorr_OnTrack_TECM
const TrackerTopology * trackerTopology_
MonitorElement * ClusterChargeRawOffTrack
const SiStripApvGain::Range getRange(uint32_t detID) const
constexpr Detector det() const
get the detector field from this detid
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
std::map< std::string, LayerMEs > LayerMEsMap
MonitorElement * ClusterChargePerCMfromOriginOffTrack
MonitorElement * ClusterNoiseOnTrack