31 tracksCollection_in_EventTree(
true),
34 conf.getParameter<
edm::
ParameterSet>(
"genericTriggerEventPSet"), consumesCollector(), *this)) {
79 <<
" detectors instantiated in the geometry" << std::endl;
118 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::analyse] " 119 <<
"Run " << e.
id().
run() <<
" Event " << e.
id().
event() << std::endl;
128 iSubDet->second.totNClustersOnTrack = 0;
129 iSubDet->second.totNClustersOffTrack = 0;
156 std::map<std::string, MonitorElement*>::iterator iME;
157 std::map<std::string, LayerMEs>::iterator iLayerME;
159 if (!(
topFolderName_.find(
"IsolatedBunches") != std::string::npos)) {
193 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_StoNCorrOnTrack", 0.0,
true);
195 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberOfOnTrackCluster", 0.0,
true);
197 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberOfOfffTrackCluster", 0.0,
true);
199 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_ChargePerCMfromTrack", 0.0,
true);
201 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberMissingHits", 0.0,
true,
true);
203 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberInactiveHits", 0.0,
true,
true);
205 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberValidHits", 0.0,
true,
true);
209 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_ClusterWidthOnTrack", 0.0,
true);
211 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_ClusterWidthOffTrack", 0.0,
true);
215 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_ChargePerCMfromOrigin", 0.0,
true);
218 std::vector<uint32_t> vdetId_;
220 const char* tec =
"TEC";
221 const char* tid =
"TID";
226 for (std::vector<uint32_t>::const_iterator detid_iter = vdetId_.begin(), detid_end = vdetId_.end();
227 detid_iter != detid_end;
229 uint32_t detid = *detid_iter;
232 edm::LogError(
"SiStripMonitorTrack") <<
"[" << __PRETTY_FUNCTION__ <<
"] invalid detid " << detid << std::endl;
239 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
false);
248 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_id);
250 folder_organizer.
setLayerFolder(detid, tTopo, det_layer_pair.second,
false);
254 const char* subdet = det_layer_pair.first.c_str();
255 if (std::strstr(subdet, tec) !=
nullptr || std::strstr(subdet, tid) !=
nullptr) {
257 std::map<std::string, RingMEs>::iterator iRingME =
RingMEsMap.find(ring_id);
259 std::pair<std::string, int32_t> det_ring_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
true);
260 folder_organizer.
setLayerFolder(detid, tTopo, det_ring_pair.second,
true);
266 std::pair<std::string, std::string> sdet_pair = folder_organizer.
getSubDetFolderAndTag(detid, tTopo);
276 for (std::vector<uint32_t>::const_iterator detid_iter = vdetId_.begin(), detid_end = vdetId_.end();
277 detid_iter != detid_end;
279 uint32_t detid = *detid_iter;
282 edm::LogError(
"SiStripMonitorTrack") <<
"[" << __PRETTY_FUNCTION__ <<
"] invalid detid " << detid << std::endl;
289 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
false);
298 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_id);
300 folder_organizer.
setLayerFolder(detid, tTopo, det_layer_pair.second,
false);
304 const char* subdet = det_layer_pair.first.c_str();
305 if (std::strstr(subdet, tec) !=
nullptr || std::strstr(subdet, tid) !=
nullptr) {
307 std::map<std::string, RingMEs>::iterator iRingME =
RingMEsMap.find(ring_id);
309 std::pair<std::string, int32_t> det_ring_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
true);
310 folder_organizer.
setLayerFolder(detid, tTopo, det_ring_pair.second,
true);
316 std::pair<std::string, std::string> sdet_pair = folder_organizer.
getSubDetFolderAndTag(detid, tTopo);
325 if (!(topFolderName_.find(
"IsolatedBunches") != std::string::npos)) {
329 ibooker.
book1D(
"ClusterStoNCorr_OnTrack_TIBTID",
"TIB/TID [FECCrate=1] (OnTrack)", 100, 0., 100.);
333 ibooker.
book1D(
"ClusterStoNCorr_OnTrack_TOB",
"TOB [FECCrate=4] (OnTrack)", 100, 0., 100.);
337 ibooker.
book1D(
"ClusterStoNCorr_OnTrack_TECM",
"TECM [FECCrate=3] (OnTrack)", 100, 0., 100.);
341 ibooker.
book1D(
"ClusterStoNCorr_OnTrack_TECP",
"TECP [FECCrate=2] (OnTrack)", 100, 0., 100.);
345 ibooker.
book2D(
"ClusterStoNCorr_OnTrack_FECCratevsFECSlot",
" S/N (On track)", 22, 0.5, 22.5, 4, 0.5, 4.5);
354 "TIB/TID [FECCrate=1] (OnTrack)",
365 "ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TOB",
"TOB [FECCrate=4] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
370 "ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECM",
"TEC- [FECCrate=3] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
375 "ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECP",
"TEC- [FECCrate=2] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
384 ibooker.
book2D(
"ClusterCount_OnTrack_FECCratevsFECSlot",
" S/N (On track)", 22, 0.5, 22.5, 4, 0.5, 4.5);
393 "ClusterCount_OnTrack_FECSlotVsFECRing_TIBTID",
"TIB/TID [FECCrate=1] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
398 "ClusterCount_OnTrack_FECSlotVsFECRing_TOB",
"TOB [FECCrate=4] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
403 "ClusterCount_OnTrack_FECSlotVsFECRing_TECM",
"TEC- [FECCrate=3] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
408 "ClusterCount_OnTrack_FECSlotVsFECRing_TECP",
"TEC- [FECCrate=2] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
420 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(hid);
426 bookME1D(ibooker,
"TH1ClusterWidth", hidmanager.
createHistoId(
"ClusterWidth_OnTrack", name,
id).c_str());
432 bookME1D(ibooker,
"TH1ClusterCharge", hidmanager.
createHistoId(
"ClusterCharge_OnTrack", name,
id).c_str());
435 ibooker,
"TH1ClusterChargeRaw", hidmanager.
createHistoId(
"ClusterChargeRaw_OnTrack", name,
id).c_str());
438 ibooker,
"TH1ClusterChargeCorr", hidmanager.
createHistoId(
"ClusterChargeCorr_OnTrack", name,
id).c_str());
441 ibooker,
"TH1ClusterStoNCorrMod", hidmanager.
createHistoId(
"ClusterStoNCorr_OnTrack", name,
id).c_str());
445 hidmanager.
createHistoId(
"ClusterPosition_OnTrack", name,
id).c_str(),
448 total_nr_strips + 0.5);
454 ibooker,
"TH1ClusterChargePerCM", hidmanager.
createHistoId(
"ClusterChargePerCMfromTrack", name,
id).c_str());
457 ibooker,
"TH1ClusterChargePerCM", hidmanager.
createHistoId(
"ClusterChargePerCMfromOrigin", name,
id).c_str());
471 if (
id.
find(
"TEC") == std::string::npos &&
id.find(
"TID") == std::string::npos) {
472 me =
bookME1D(ibooker, histoParameters.c_str(), histoName.c_str());
476 me =
bookME1D(ibooker, histoParameters.c_str(), histoName.c_str());
496 hname = hidmanager.
createHistoLayer(
"Summary_ClusterStoNCorr", name, layer_id,
"OnTrack");
497 hpar =
"TH1ClusterStoNCorr";
501 hname = hidmanager.
createHistoLayer(
"Summary_ClusterGain", name, layer_id,
"");
502 hpar =
"TH1ClusterGain";
506 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeCorr", name, layer_id,
"OnTrack");
507 hpar =
"TH1ClusterChargeCorr";
511 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge", name, layer_id,
"OnTrack");
512 hpar =
"TH1ClusterCharge";
515 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge", name, layer_id,
"OffTrack");
516 hpar =
"TH1ClusterCharge";
520 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeRaw", name, layer_id,
"OnTrack");
521 hpar =
"TH1ClusterChargeRaw";
524 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeRaw", name, layer_id,
"OffTrack");
525 hpar =
"TH1ClusterChargeRaw";
529 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise", name, layer_id,
"OnTrack");
530 hpar =
"TH1ClusterNoise";
533 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise", name, layer_id,
"OffTrack");
534 hpar =
"TH1ClusterNoise";
538 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth", name, layer_id,
"OnTrack");
539 hpar =
"TH1ClusterWidth";
542 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth", name, layer_id,
"OffTrack");
543 hpar =
"TH1ClusterWidth";
548 if (layer_id.find(
"TEC") != std::string::npos)
549 total_nr_strips = 3 * 2 * 128;
551 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition", name, layer_id,
"OnTrack");
552 hpar =
"TH1ClusterPos";
553 if (layer_id.find(
"TIB") != std::string::npos || layer_id.find(
"TOB") != std::string::npos ||
559 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition2D", name, layer_id,
"OnTrack");
560 hpar =
"TH2ClusterPosTOB";
561 if (layer_id.find(
"TOB") != std::string::npos)
564 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition2D", name, layer_id,
"OnTrack");
565 hpar =
"TH2ClusterPosTIB";
566 if (layer_id.find(
"TIB") != std::string::npos)
569 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition2D", name, layer_id,
"OnTrack");
570 hpar =
"TH2ClusterPosTEC";
571 if (layer_id.find(
"TEC") != std::string::npos) {
573 static constexpr float rval[9] = {0, 21.2, 30.8, 40.4, 50.0, 60.0, 75.0, 90.0, 110.0};
574 static constexpr int nmodulesPhi = 40 * 6;
575 float phival[nmodulesPhi];
576 for (
int i = 0;
i < nmodulesPhi;
i++)
577 phival[
i] = -3.2 + 2 *
i * 3.2 / nmodulesPhi;
579 TH2F*
temp =
new TH2F(
"tmp",
"tmp", nbinR, rval, nmodulesPhi - 1, phival);
583 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition2D", name, layer_id,
"OnTrack");
584 hpar =
"TH2ClusterPosTID";
585 if (layer_id.find(
"TID") != std::string::npos) {
587 static constexpr float rval[5] = {0, 21.2, 30.8, 40.4, 50.0};
588 static constexpr int nmodulesPhi = 80 * 4;
589 float phival[nmodulesPhi];
590 for (
int i = 0;
i < nmodulesPhi;
i++)
591 phival[
i] = -3.2 +
i * 2 * 3.2 / nmodulesPhi;
593 TH2F*
temp =
new TH2F(
"tmp",
"tmp", nbinR, rval, nmodulesPhi - 1, phival);
597 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition", name, layer_id,
"OffTrack");
598 hpar =
"TH1ClusterPos";
599 if (layer_id.find(
"TIB") != std::string::npos || layer_id.find(
"TOB") != std::string::npos ||
604 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromTrack", name, layer_id,
"");
605 hpar =
"TH1ClusterChargePerCM";
608 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromOrigin", name, layer_id,
"OnTrack");
609 hpar =
"TH1ClusterChargePerCM";
612 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromOrigin", name, layer_id,
"OffTrack");
613 hpar =
"TH1ClusterChargePerCM";
629 hname = hidmanager.
createHistoLayer(
"Summary_ClusterStoNCorr", name, ring_id,
"OnTrack");
630 hpar =
"TH1ClusterStoNCorr";
634 hname = hidmanager.
createHistoLayer(
"Summary_ClusterGain", name, ring_id,
"");
635 hpar =
"TH1ClusterGain";
639 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeCorr", name, ring_id,
"OnTrack");
640 hpar =
"TH1ClusterChargeCorr";
644 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge", name, ring_id,
"OnTrack");
645 hpar =
"TH1ClusterCharge";
648 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge", name, ring_id,
"OffTrack");
649 hpar =
"TH1ClusterCharge";
653 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeRaw", name, ring_id,
"OnTrack");
654 hpar =
"TH1ClusterChargeRaw";
657 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeRaw", name, ring_id,
"OffTrack");
658 hpar =
"TH1ClusterChargeRaw";
662 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise", name, ring_id,
"OnTrack");
663 hpar =
"TH1ClusterNoise";
666 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise", name, ring_id,
"OffTrack");
667 hpar =
"TH1ClusterNoise";
671 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth", name, ring_id,
"OnTrack");
672 hpar =
"TH1ClusterWidth";
675 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth", name, ring_id,
"OffTrack");
676 hpar =
"TH1ClusterWidth";
681 if (ring_id.find(
"TEC") != std::string::npos)
682 total_nr_strips = 3 * 2 * 128;
684 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition", name, ring_id,
"OnTrack");
685 hpar =
"TH1ClusterPos";
689 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition", name, ring_id,
"OffTrack");
690 hpar =
"TH1ClusterPos";
695 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromTrack", name, ring_id,
"");
696 hpar =
"TH1ClusterChargePerCM";
699 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromOrigin", name, ring_id,
"OnTrack");
700 hpar =
"TH1ClusterChargePerCM";
703 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromOrigin", name, ring_id,
"OffTrack");
704 hpar =
"TH1ClusterChargePerCM";
716 subdet_tag =
"__" +
name;
723 completeName =
"Summary_TotalNumberOfClusters_OnTrack" +
subdet_tag;
724 axisName =
"Number of on-track clusters in " +
name;
730 completeName =
"Summary_TotalNumberOfClusters_OffTrack" +
subdet_tag;
731 axisName =
"Number of off-track clusters in " +
name;
736 if (name.find(
"TIB") != std::string::npos) {
740 if (name.find(
"TOB") != std::string::npos) {
744 if (name.find(
"TID") != std::string::npos) {
748 if (name.find(
"TEC") != std::string::npos) {
756 completeName =
"Summary_ClusterGain" +
subdet_tag;
760 completeName =
"Summary_ClusterStoNCorr_OnTrack" +
subdet_tag;
763 completeName =
"Summary_ClusterStoNCorrThin_OnTrack" +
subdet_tag;
764 if (subdet_tag.find(
"TEC") != std::string::npos)
767 completeName =
"Summary_ClusterStoNCorrThick_OnTrack" +
subdet_tag;
768 if (subdet_tag.find(
"TEC") != std::string::npos)
772 completeName =
"Summary_ClusterChargeCorr_OnTrack" +
subdet_tag;
775 completeName =
"Summary_ClusterChargeCorrThin_OnTrack" +
subdet_tag;
776 if (subdet_tag.find(
"TEC") != std::string::npos)
779 completeName =
"Summary_ClusterChargeCorrThick_OnTrack" +
subdet_tag;
780 if (subdet_tag.find(
"TEC") != std::string::npos)
784 completeName =
"Summary_ClusterCharge_OnTrack" +
subdet_tag;
788 completeName =
"Summary_ClusterChargeRaw_OnTrack" +
subdet_tag;
792 completeName =
"Summary_ClusterCharge_OffTrack" +
subdet_tag;
796 completeName =
"Summary_ClusterChargeRaw_OffTrack" +
subdet_tag;
800 completeName =
"Summary_ClusterStoN_OffTrack" +
subdet_tag;
804 completeName =
"Summary_ClusterChargePerCMfromTrack" +
subdet_tag;
808 completeName =
"Summary_ClusterChargePerCMfromOrigin_OnTrack" +
subdet_tag;
812 completeName =
"Summary_ClusterChargePerCMfromOrigin_OffTrack" +
subdet_tag;
817 completeName =
"Trend_TotalNumberOfClusters_OnTrack" +
subdet_tag;
819 completeName =
"Trend_TotalNumberOfClusters_OffTrack" +
subdet_tag;
829 const char* ParameterSetLabel,
832 return ibooker.
book1D(HistoName,
841 const char* ParameterSetLabel,
844 return ibooker.
book2D(HistoName,
856 const char* ParameterSetLabel,
859 return ibooker.
book3D(HistoName,
874 const char* ParameterSetLabel,
901 me->
getTH1()->SetCanExtend(TH1::kAllAxes);
905 me->setAxisTitle(
"Lumisection", 1);
915 auto const& trajParams = track.
extra()->trajParams();
919 auto ttrh = *(hb +
h);
922 uint32_t thedetid = ttrh->rawId();
925 if ((ttrh->getType() == 1))
927 if ((ttrh->getType() == 2))
929 if ((ttrh->getType() == 0))
934 if (!ttrh->isValid())
938 auto statedirection = trajParams[
h].momentum();
948 LogTrace(
"SiStripMonitorTrack") <<
"\nMatched recHit found" << std::endl;
955 statedirection = monodet->
toLocal(gtrkdirup);
958 if (statedirection.mag())
959 RecHitInfo<SiStripRecHit2D>(&m, statedirection, digilist, ev, es, track_ok);
962 statedirection = stereodet->
toLocal(gtrkdirup);
965 if (statedirection.mag())
966 RecHitInfo<SiStripRecHit2D>(&s, statedirection, digilist, ev, es, track_ok);
967 }
else if (projhit) {
968 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found" << std::endl;
977 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found MONO" << std::endl;
979 statedirection = det->
toLocal(gtrkdirup);
980 if (statedirection.mag())
981 RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist,
ev, es, track_ok);
983 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found STEREO" << std::endl;
986 statedirection = det->
toLocal(gtrkdirup);
987 if (statedirection.mag())
988 RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist,
ev, es, track_ok);
991 if (statedirection.mag())
992 RecHitInfo<SiStripRecHit2D>(hit2D, statedirection, digilist, ev, es, track_ok);
994 if (statedirection.mag())
995 RecHitInfo<SiStripRecHit1D>(hit1D, statedirection, digilist, ev, es, track_ok);
997 LogDebug(
"SiStripMonitorTrack") <<
" LocalMomentum: " << statedirection
998 <<
"\nLocal x-z plane angle: " << atan2(statedirection.x(), statedirection.z());
1011 const bool track_ok) {
1014 LogTrace(
"SiStripMonitorTrack") <<
"\nMatched recHit found" << std::endl;
1022 statedirection = monodet->
toLocal(gtrkdirup);
1024 if (statedirection.
mag())
1025 RecHitInfo<SiStripRecHit2D>(&m, statedirection, digilist, ev, es, track_ok);
1029 statedirection = stereodet->
toLocal(gtrkdirup);
1031 if (statedirection.
mag())
1032 RecHitInfo<SiStripRecHit2D>(&s, statedirection, digilist, ev, es, track_ok);
1033 }
else if (projhit) {
1034 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found" << std::endl;
1044 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found MONO" << std::endl;
1046 statedirection = det->
toLocal(gtrkdirup);
1047 if (statedirection.
mag())
1048 RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist,
ev, es, track_ok);
1050 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found STEREO" << std::endl;
1053 statedirection = det->
toLocal(gtrkdirup);
1054 if (statedirection.
mag())
1055 RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist,
ev, es, track_ok);
1058 statedirection = localMomentum;
1059 if (statedirection.
mag())
1060 RecHitInfo<SiStripRecHit2D>(hit2D, statedirection, digilist, ev, es, track_ok);
1062 statedirection = localMomentum;
1063 if (statedirection.
mag())
1064 RecHitInfo<SiStripRecHit1D>(hit1D, statedirection, digilist, ev, es, track_ok);
1066 LogDebug(
"SiStripMonitorTrack") <<
" LocalMomentum: " << statedirection
1067 <<
"\nLocal x-z plane angle: " << atan2(statedirection.
x(), statedirection.
z());
1072 using namespace std;
1073 using namespace edm;
1074 using namespace reco;
1087 auto& digilist = digihandle.
isValid() ? *(digihandle.
product()) : dummy;
1089 if (trackCollectionHandle.
isValid()) {
1100 if (track.
pt() < 0.8)
1102 if (track.
p() < 2.0)
1121 for (reco::TrackCollection::const_iterator
track = trackCollection.begin(), etrack = trackCollection.end();
1129 uint32_t thedetid = (*hit)->rawId();
1132 if (((*hit)->getType() == 1))
1134 if (((*hit)->getType() == 2))
1136 if (((*hit)->getType() == 0))
1141 if (!(*hit)->isValid())
1143 DetId detID = (*hit)->geographicalId();
1156 hitStudy(ev, es, digilist, projhit, matchedhit, hit2D, hit1D, localMomentum, track_ok);
1201 for (reco::TrackCollection::const_iterator
track = trackCollection.begin(), etrack = trackCollection.end();
1204 LogDebug(
"SiStripMonitorTrack") <<
"Track number " << ++i << std::endl;
1227 if (!tkrecHit->isValid()) {
1228 LogTrace(
"SiStripMonitorTrack") <<
"\t\t Invalid Hit " << std::endl;
1232 const uint32_t& detid = tkrecHit->geographicalId().rawId();
1235 <<
"\n\t\tRecHit on det " << detid <<
"\n\t\tRecHit in LP " << tkrecHit->localPosition() <<
"\n\t\tRecHit in GP " 1237 <<
"\n\t\tRecHit trackLocal vector " << LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() << std::endl;
1240 if (tkrecHit !=
nullptr && tkrecHit->isValid()) {
1241 const DetId detid = tkrecHit->geographicalId();
1244 float clust_Pos1 = -1000;
1245 float clust_Pos2 = -1000;
1250 clust_Pos1 = theGlobalPos.
z();
1251 clust_Pos2 = theGlobalPos.
phi();
1253 clust_Pos1 =
pow(theGlobalPos.
x() * theGlobalPos.
x() + theGlobalPos.
y() * theGlobalPos.
y(), 0.5);
1254 clust_Pos2 = theGlobalPos.
phi();
1276 edm::LogError(
"SiStripMonitorTrack") <<
"NULL hit" << std::endl;
1303 auto& digilist = digihandle.
isValid() ? *(digihandle.
product()) : dummy;
1312 if (siStripClusterHandle.
isValid()) {
1315 DSVEnd = siStripClusterHandle->end();
1318 uint32_t detid = DSViter->id();
1321 LogDebug(
"SiStripMonitorTrack") <<
"on detid " << detid <<
" N Cluster= " << DSViter->size();
1352 edm::LogError(
"SiStripMonitorTrack") <<
"ClusterCollection is not valid!!" << std::endl;
1370 std::map<std::string, LayerMEs>::iterator iLayer =
LayerMEsMap.find(layer_id);
1372 me.
iLayer = &(iLayer->second);
1375 std::map<std::string, RingMEs>::iterator iRing =
RingMEsMap.find(ring_id);
1377 me.
iRing = &(iRing->second);
1380 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(sdet_tag);
1382 me.
iSubdet = &(iSubdet->second);
1397 for (
const auto&
track : *tracks) {
1400 uint32_t thedetid = (*hit)->rawId();
1401 if (!(
DetId(thedetid).subdetId() >= 3 &&
DetId(thedetid).subdetId() <= 6)) {
1405 if (!(*hit)->isValid())
1409 if (theHit ==
nullptr) {
1421 if (hit1D && !hit2D) {
1427 else if (!hit1D && hit2D) {
1433 std::vector<const FedChannelConnection*> getFedChanConnections;
1440 for (
const auto& getFedChanConnection : getFedChanConnections) {
1441 if (getFedChanConnection ==
nullptr) {
1445 int binfeccrate = getFedChanConnection->fecCrate();
1446 int binfecslot = getFedChanConnection->fecSlot();
1447 int binfecring = getFedChanConnection->fecRing();
1511 double theMeanSoN = (input1->
getBinContent(binx, biny) * nentries +
value) / (nentries + 1);
1521 const uint32_t detid,
1532 if (cluster ==
nullptr)
1542 LogDebug(
"SiStripMonitorTrack") <<
"\n\tLV " << LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() <<
" " << LV.
mag()
1545 cosRZ = fabs(LV.
z()) / LV.
mag();
1546 LogDebug(
"SiStripMonitorTrack") <<
"\n\t cosRZ " << cosRZ << std::endl;
1557 double chargeraw = 0;
1558 double clustergain = 0;
1559 auto digi_it = digilist.
find(detid);
1561 for (
size_t chidx = 0; chidx < cluster->
stripCharges().size(); ++chidx) {
1570 if (digi_it == digilist.
end()) {
1573 for (
const auto& digiobj : *digi_it) {
1574 if (digiobj.strip() == cluster->
firstStrip() + chidx) {
1575 chargeraw += digiobj.adc();
1592 uint32_t adet = cluster->
detId();
1597 uint32_t adet = cluster->
detId();
1606 if (MEs.
iLayer !=
nullptr) {
1610 LogDebug(
"SiStripMonitorTrack") <<
"Module " << detid <<
" in Event " <<
eventNb <<
" noise " 1629 if (MEs.
iRing !=
nullptr) {
1633 LogDebug(
"SiStripMonitorTrack") <<
"Module " << detid <<
" in Event " <<
eventNb <<
" noise " 1673 uint32_t adet = cluster->
detId();
1678 LogDebug(
"SiStripMonitorTrack") <<
"Module " << detid <<
" in Event " <<
eventNb <<
" noise " << noise
1682 uint32_t adet = cluster->
detId();
1693 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(name);
1696 fillME(iModME->second.ClusterStoNCorr, StoN * cosRZ);
1699 <<
"Module " << name <<
" in Event " <<
eventNb <<
" noise " << noise << std::endl;
1700 fillME(iModME->second.ClusterGain, clustergain);
1701 fillME(iModME->second.ClusterCharge, charge);
1702 fillME(iModME->second.ClusterChargeRaw, chargeraw);
1704 fillME(iModME->second.ClusterChargeCorr, charge * cosRZ);
1706 fillME(iModME->second.ClusterWidth, width);
1707 fillME(iModME->second.ClusterPos, position);
1710 fillME(iModME->second.ClusterChargePerCMfromTrack, dQdx_fromTrack);
1712 fillME(iModME->second.ClusterChargePerCMfromOrigin, dQdx_fromOrigin);
1716 int PGVposCounter = cluster->
maxIndex();
1720 fillME(iModME->second.ClusterPGV,
i, 0.);
1722 fillME(iModME->second.ClusterPGV, PGVposCounter++, (*it) / PGVmax);
1724 for (
int i = PGVposCounter;
1727 fillME(iModME->second.ClusterPGV,
i, 0.);
1737 uint32_t adet = cluster->
detId();
1740 LogDebug(
"SiStripMonitorTrack") <<
"Module firing " << detid <<
" in Event " <<
eventNb << std::endl;
1744 uint32_t adet = cluster->
detId();
1751 if (MEs.
iLayer !=
nullptr) {
1761 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
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
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)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * ClusterStoNCorr_OnTrack_TECP
MonitorElement * ClusterChargePerCMfromTrack
MonitorElement * bookMEProfile(DQMStore::IBooker &, const char *, const char *)
void RecHitInfo(const T *tkrecHit, LocalVector LV, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev, const edm::EventSetup &es, bool track_ok)
uint16_t firstStrip() const
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
SiStripMonitorTrack(const edm::ParameterSet &)
~SiStripMonitorTrack() override
iterator find(det_id_type id)
std::unique_ptr< TkHistoMap > tkhisto_ClChPerCMfromOrigin
void setSiStripFolderName(std::string name)
void trackStudy(const edm::Event &ev, const edm::EventSetup &es)
edm::EDGetTokenT< reco::TrackCollection > trackToken_
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)
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)
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
MonitorElement * ClusterPosOffTrack
MonitorElement * ClusterPosOnTrack
bool getByToken(EDGetToken token, Handle< PROD > &result) const
float noiseRescaledByGain() const
static constexpr auto TID
MonitorElement * ClusterGain
MonitorElement * ClusterStoNCorrOnTrack
void AllClusters(const edm::Event &ev, const edm::EventSetup &es)
math::XYZTLorentzVectorD LV
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
void setCurrentFolder(std::string const &fullpath)
MonitorElement * ClusterStoNOffTrack
MonitorElement * ClusterChargeOnTrack
edm::ESWatcher< TrackerTopologyRcd > watchertTopo_
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_
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)
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)
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
void bookLayerMEs(DQMStore::IBooker &, const uint32_t, std::string &)
MonitorElement * ClusterChargeCorr
MonitorElement * ClusterGain
uint16_t maxIndex() const
auto stripCharges() const -> decltype(cluster() ->amplitudes())
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
MonitorElement * ClusterChargePerCMfromOriginOffTrack
MonitorElement * ClusterPGV
MonitorElement * ClusterChargeCorrThinOnTrack
MonitorElement * nClustersTrendOffTrack
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
edm::ESHandle< TrackerGeometry > tkgeom_
SiStripModuleGeometry moduleGeometry(const DetId &id) const
MonitorElement * ClusterCharge
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
bool getStatus(edm::Event const &e, edm::EventSetup const &eSetup)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
edmNew::DetSet< SiStripCluster >::const_iterator ClusIter
float signalOverNoise() const
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 * ClusterChargeOffTrack
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
MonitorElement * nClustersOnTrack
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
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 * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
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 * 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)
const SiStripQuality * stripQuality_
edm::ESWatcher< SiStripGainRcd > watcherStripGain_
MonitorElement * ClusterWidthOnTrack
void bookSubDetMEs(DQMStore::IBooker &, std::string &name)
ClusterRef cluster() const
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &es) override
void book(DQMStore::IBooker &, const TrackerTopology *tTopo, const TkDetMap *tkDetMap)
std::unique_ptr< TkHistoMap > tkhisto_NumOffTrack
MonitorElement * ClusterChargePerCMfromOrigin
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_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
iterator end()
Return the off-the-end iterator.
MonitorElement * ClusterChargeCorrOnTrack
MonitorElement * ClusterChargeCorrThickOnTrack
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TECM
SiStripRecHit2D originalHit() const
Detector identifier class for the strip tracker.
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
void trackStudyFromTrajectory(edm::Handle< reco::TrackCollection > trackCollectionHandle, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev, const edm::EventSetup &es)
unsigned long long int rval
void bookModMEs(DQMStore::IBooker &, const uint32_t)
MonitorElement * ClusterChargeRawOnTrack
MonitorElement * ClusterWidth
MonitorElement * ClusterChargeOnTrack
SiStripRecHit2D stereoHit() const
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
virtual DQM_DEPRECATED void setStatOverflows(unsigned int value)
MonitorElement * ClusterChargePerCMfromTrack
void hitStudy(const edm::Event &ev, const edm::EventSetup &es, const edm::DetSetVector< SiStripDigi > &digilist, const ProjectedSiStripRecHit2D *projhit, const SiStripMatchedRecHit2D *matchedhit, const SiStripRecHit2D *hit2D, const SiStripRecHit1D *hit1D, LocalVector localMomentum, const bool track_ok)
MonitorElement * ClusterPosOffTrack
MonitorElement * ClusterChargeOffTrack
const SiStripGain * stripGain_
std::map< std::string, ModMEs > ModMEsMap
MonitorElement * ClusterPos
void trackStudyFromTrack(edm::Handle< reco::TrackCollection > trackCollectionHandle, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev, const edm::EventSetup &es)
MonitorElement * ClusterChargeCorrOnTrack
std::unique_ptr< TkHistoMap > tkhisto_StoNCorrOnTrack
bool check(const edm::EventSetup &iSetup)
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
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
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
static int position[264][3]
std::unique_ptr< TkHistoMap > tkhisto_NoiseOnTrack
const TrackerGeomDet * idToDet(DetId) const override
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
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)
MonitorElement * ClusterWidthOffTrack
const TrackerTopology * tTopo_
MonitorElement * nClustersOffTrack
void bookRingMEs(DQMStore::IBooker &, const uint32_t, std::string &)
T const * product() const
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
void trajectoryStudy(const reco::Track &track, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev, const edm::EventSetup &es, bool track_ok)
MonitorElement * handleBookMEs(DQMStore::IBooker &, std::string &, std::string &, std::string &, std::string &)
static constexpr auto TEC
const GeomDetUnit * stereoDet() const
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TECP
bool fillControlViewHistos(const edm::Event &ev, const edm::EventSetup &es)
unsigned int tecSide(const DetId &id) const
MonitorElement * ClusterStoNCorr_OnTrack_TECM
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