32 tracksCollection_in_EventTree(
true),
35 conf.getParameter<
edm::
ParameterSet>(
"genericTriggerEventPSet"), consumesCollector(), *this)) {
80 <<
" detectors instantiated in the geometry" << std::endl;
111 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::analyse] " 112 <<
"Run " << e.
id().
run() <<
" Event " << e.
id().
event() << std::endl;
121 iSubDet->second.totNClustersOnTrack = 0;
122 iSubDet->second.totNClustersOffTrack = 0;
133 std::map<std::string, MonitorElement*>::iterator iME;
134 std::map<std::string, LayerMEs>::iterator iLayerME;
136 if (!(
topFolderName_.find(
"IsolatedBunches") != std::string::npos)) {
170 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_StoNCorrOnTrack", 0.0,
true);
172 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberOfOnTrackCluster", 0.0,
true);
174 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberOfOfffTrackCluster", 0.0,
true);
176 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_ChargePerCMfromTrack", 0.0,
true);
178 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberMissingHits", 0.0,
true,
true);
180 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberInactiveHits", 0.0,
true,
true);
182 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_NumberValidHits", 0.0,
true,
true);
186 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_ClusterWidthOnTrack", 0.0,
true);
188 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_ClusterWidthOffTrack", 0.0,
true);
192 std::make_unique<TkHistoMap>(tkDetMap,
topFolderName_,
"TkHMap_ChargePerCMfromOrigin", 0.0,
true);
195 std::vector<uint32_t> vdetId_;
197 const char* tec =
"TEC";
198 const char* tid =
"TID";
203 for (std::vector<uint32_t>::const_iterator detid_iter = vdetId_.begin(), detid_end = vdetId_.end();
204 detid_iter != detid_end;
206 uint32_t detid = *detid_iter;
209 edm::LogError(
"SiStripMonitorTrack") <<
"[" << __PRETTY_FUNCTION__ <<
"] invalid detid " << detid << std::endl;
216 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
false);
225 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_id);
227 folder_organizer.
setLayerFolder(detid, tTopo, det_layer_pair.second,
false);
231 const char* subdet = det_layer_pair.first.c_str();
232 if (std::strstr(subdet, tec) !=
nullptr || std::strstr(subdet, tid) !=
nullptr) {
234 std::map<std::string, RingMEs>::iterator iRingME =
RingMEsMap.find(ring_id);
236 std::pair<std::string, int32_t> det_ring_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
true);
237 folder_organizer.
setLayerFolder(detid, tTopo, det_ring_pair.second,
true);
243 std::pair<std::string, std::string> sdet_pair = folder_organizer.
getSubDetFolderAndTag(detid, tTopo);
253 for (std::vector<uint32_t>::const_iterator detid_iter = vdetId_.begin(), detid_end = vdetId_.end();
254 detid_iter != detid_end;
256 uint32_t detid = *detid_iter;
259 edm::LogError(
"SiStripMonitorTrack") <<
"[" << __PRETTY_FUNCTION__ <<
"] invalid detid " << detid << std::endl;
266 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
false);
275 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_id);
277 folder_organizer.
setLayerFolder(detid, tTopo, det_layer_pair.second,
false);
281 const char* subdet = det_layer_pair.first.c_str();
282 if (std::strstr(subdet, tec) !=
nullptr || std::strstr(subdet, tid) !=
nullptr) {
284 std::map<std::string, RingMEs>::iterator iRingME =
RingMEsMap.find(ring_id);
286 std::pair<std::string, int32_t> det_ring_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo,
true);
287 folder_organizer.
setLayerFolder(detid, tTopo, det_ring_pair.second,
true);
293 std::pair<std::string, std::string> sdet_pair = folder_organizer.
getSubDetFolderAndTag(detid, tTopo);
302 if (!(topFolderName_.find(
"IsolatedBunches") != std::string::npos)) {
306 ibooker.
book1D(
"ClusterStoNCorr_OnTrack_TIBTID",
"TIB/TID [FECCrate=1] (OnTrack)", 100, 0., 100.);
310 ibooker.
book1D(
"ClusterStoNCorr_OnTrack_TOB",
"TOB [FECCrate=4] (OnTrack)", 100, 0., 100.);
314 ibooker.
book1D(
"ClusterStoNCorr_OnTrack_TECM",
"TECM [FECCrate=3] (OnTrack)", 100, 0., 100.);
318 ibooker.
book1D(
"ClusterStoNCorr_OnTrack_TECP",
"TECP [FECCrate=2] (OnTrack)", 100, 0., 100.);
322 ibooker.
book2D(
"ClusterStoNCorr_OnTrack_FECCratevsFECSlot",
" S/N (On track)", 22, 0.5, 22.5, 4, 0.5, 4.5);
331 "TIB/TID [FECCrate=1] (OnTrack)",
342 "ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TOB",
"TOB [FECCrate=4] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
347 "ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECM",
"TEC- [FECCrate=3] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
352 "ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECP",
"TEC- [FECCrate=2] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
361 ibooker.
book2D(
"ClusterCount_OnTrack_FECCratevsFECSlot",
" S/N (On track)", 22, 0.5, 22.5, 4, 0.5, 4.5);
370 "ClusterCount_OnTrack_FECSlotVsFECRing_TIBTID",
"TIB/TID [FECCrate=1] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
375 "ClusterCount_OnTrack_FECSlotVsFECRing_TOB",
"TOB [FECCrate=4] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
380 "ClusterCount_OnTrack_FECSlotVsFECRing_TECM",
"TEC- [FECCrate=3] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
385 "ClusterCount_OnTrack_FECSlotVsFECRing_TECP",
"TEC- [FECCrate=2] (OnTrack)", 10, -0.5, 9.5, 22, 0.5, 22.5);
397 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(hid);
403 bookME1D(ibooker,
"TH1ClusterWidth", hidmanager.
createHistoId(
"ClusterWidth_OnTrack", name,
id).c_str());
411 bookME1D(ibooker,
"TH1ClusterCharge", hidmanager.
createHistoId(
"ClusterCharge_OnTrack", name,
id).c_str());
415 ibooker,
"TH1ClusterChargeRaw", hidmanager.
createHistoId(
"ClusterChargeRaw_OnTrack", name,
id).c_str());
419 ibooker,
"TH1ClusterChargeCorr", hidmanager.
createHistoId(
"ClusterChargeCorr_OnTrack", name,
id).c_str());
423 ibooker,
"TH1ClusterStoNCorrMod", hidmanager.
createHistoId(
"ClusterStoNCorr_OnTrack", name,
id).c_str());
428 hidmanager.
createHistoId(
"ClusterPosition_OnTrack", name,
id).c_str(),
431 total_nr_strips + 0.5);
439 ibooker,
"TH1ClusterChargePerCM", hidmanager.
createHistoId(
"ClusterChargePerCMfromTrack", name,
id).c_str());
443 ibooker,
"TH1ClusterChargePerCM", hidmanager.
createHistoId(
"ClusterChargePerCMfromOrigin", name,
id).c_str());
458 if (
id.
find(
"TEC") == std::string::npos &&
id.find(
"TID") == std::string::npos) {
459 me =
bookME1D(ibooker, histoParameters.c_str(), histoName.c_str());
463 me =
bookME1D(ibooker, histoParameters.c_str(), histoName.c_str());
483 hname = hidmanager.
createHistoLayer(
"Summary_ClusterStoNCorr", name, layer_id,
"OnTrack");
484 hpar =
"TH1ClusterStoNCorr";
488 hname = hidmanager.
createHistoLayer(
"Summary_ClusterGain", name, layer_id,
"");
489 hpar =
"TH1ClusterGain";
493 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeCorr", name, layer_id,
"OnTrack");
494 hpar =
"TH1ClusterChargeCorr";
498 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge", name, layer_id,
"OnTrack");
499 hpar =
"TH1ClusterCharge";
502 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge", name, layer_id,
"OffTrack");
503 hpar =
"TH1ClusterCharge";
507 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeRaw", name, layer_id,
"OnTrack");
508 hpar =
"TH1ClusterChargeRaw";
511 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeRaw", name, layer_id,
"OffTrack");
512 hpar =
"TH1ClusterChargeRaw";
516 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise", name, layer_id,
"OnTrack");
517 hpar =
"TH1ClusterNoise";
520 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise", name, layer_id,
"OffTrack");
521 hpar =
"TH1ClusterNoise";
525 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth", name, layer_id,
"OnTrack");
526 hpar =
"TH1ClusterWidth";
529 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth", name, layer_id,
"OffTrack");
530 hpar =
"TH1ClusterWidth";
535 if (layer_id.find(
"TEC") != std::string::npos)
536 total_nr_strips = 3 * 2 * 128;
538 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition", name, layer_id,
"OnTrack");
539 hpar =
"TH1ClusterPos";
540 if (layer_id.find(
"TIB") != std::string::npos || layer_id.find(
"TOB") != std::string::npos ||
547 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition2D", name, layer_id,
"OnTrack");
548 hpar =
"TH2ClusterPosTOB";
549 if ( layer_id.find(
"TOB") != std::string::npos ) theLayerMEs.
ClusterPosOnTrack2D = ibooker.
book2D(hname, hname, 12, -110, 110, 300, -3.2, 3.2);
551 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition2D", name, layer_id,
"OnTrack");
552 hpar =
"TH2ClusterPosTIB";
553 if ( layer_id.find(
"TIB") != std::string::npos ) theLayerMEs.
ClusterPosOnTrack2D = ibooker.
book2D(hname, hname, 12, -65, 65, 450, -3.2, 3.2);
555 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition2D", name, layer_id,
"OnTrack");
556 hpar =
"TH2ClusterPosTEC";
557 if ( layer_id.find(
"TEC") != std::string::npos ){
560 static constexpr float rval[9]= {0, 21.2, 30.8, 40.4, 50.0, 60.0, 75.0, 90.0, 110.0};
562 float phival[nmodulesPhi];
563 for(
int i=0;
i<nmodulesPhi;
i++) phival[
i] = -3.2+2*
i*3.2/nmodulesPhi;
565 TH2F *
temp =
new TH2F(
"tmp",
"tmp", nbinR, rval, nmodulesPhi-1, phival);
569 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition2D", name, layer_id,
"OnTrack");
570 hpar =
"TH2ClusterPosTID";
571 if ( layer_id.find(
"TID") != std::string::npos ){
575 float phival[nmodulesPhi];
576 for(
int i=0;
i<nmodulesPhi;
i++) phival[
i] = -3.2+
i*2*3.2/nmodulesPhi;
578 TH2F *
temp =
new TH2F(
"tmp",
"tmp", nbinR, rval, nmodulesPhi-1, phival);
585 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition", name, layer_id,
"OffTrack");
586 hpar =
"TH1ClusterPos";
587 if (layer_id.find(
"TIB") != std::string::npos || layer_id.find(
"TOB") != std::string::npos ||
592 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromTrack", name, layer_id,
"");
593 hpar =
"TH1ClusterChargePerCM";
596 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromOrigin", name, layer_id,
"OnTrack");
597 hpar =
"TH1ClusterChargePerCM";
600 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromOrigin", name, layer_id,
"OffTrack");
601 hpar =
"TH1ClusterChargePerCM";
617 hname = hidmanager.
createHistoLayer(
"Summary_ClusterStoNCorr", name, ring_id,
"OnTrack");
618 hpar =
"TH1ClusterStoNCorr";
622 hname = hidmanager.
createHistoLayer(
"Summary_ClusterGain", name, ring_id,
"");
623 hpar =
"TH1ClusterGain";
627 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeCorr", name, ring_id,
"OnTrack");
628 hpar =
"TH1ClusterChargeCorr";
632 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge", name, ring_id,
"OnTrack");
633 hpar =
"TH1ClusterCharge";
636 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge", name, ring_id,
"OffTrack");
637 hpar =
"TH1ClusterCharge";
641 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeRaw", name, ring_id,
"OnTrack");
642 hpar =
"TH1ClusterChargeRaw";
645 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeRaw", name, ring_id,
"OffTrack");
646 hpar =
"TH1ClusterChargeRaw";
650 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise", name, ring_id,
"OnTrack");
651 hpar =
"TH1ClusterNoise";
654 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise", name, ring_id,
"OffTrack");
655 hpar =
"TH1ClusterNoise";
659 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth", name, ring_id,
"OnTrack");
660 hpar =
"TH1ClusterWidth";
663 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth", name, ring_id,
"OffTrack");
664 hpar =
"TH1ClusterWidth";
669 if (ring_id.find(
"TEC") != std::string::npos)
670 total_nr_strips = 3 * 2 * 128;
672 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition", name, ring_id,
"OnTrack");
673 hpar =
"TH1ClusterPos";
677 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition", name, ring_id,
"OffTrack");
678 hpar =
"TH1ClusterPos";
683 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromTrack", name, ring_id,
"");
684 hpar =
"TH1ClusterChargePerCM";
687 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromOrigin", name, ring_id,
"OnTrack");
688 hpar =
"TH1ClusterChargePerCM";
691 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargePerCMfromOrigin", name, ring_id,
"OffTrack");
692 hpar =
"TH1ClusterChargePerCM";
704 subdet_tag =
"__" +
name;
711 completeName =
"Summary_TotalNumberOfClusters_OnTrack" +
subdet_tag;
712 axisName =
"Number of on-track clusters in " +
name;
718 completeName =
"Summary_TotalNumberOfClusters_OffTrack" +
subdet_tag;
719 axisName =
"Number of off-track clusters in " +
name;
724 if (name.find(
"TIB") != std::string::npos) {
728 if (name.find(
"TOB") != std::string::npos) {
732 if (name.find(
"TID") != std::string::npos) {
736 if (name.find(
"TEC") != std::string::npos) {
744 completeName =
"Summary_ClusterGain" +
subdet_tag;
748 completeName =
"Summary_ClusterStoNCorr_OnTrack" +
subdet_tag;
751 completeName =
"Summary_ClusterStoNCorrThin_OnTrack" +
subdet_tag;
752 if (subdet_tag.find(
"TEC") != std::string::npos)
755 completeName =
"Summary_ClusterStoNCorrThick_OnTrack" +
subdet_tag;
756 if (subdet_tag.find(
"TEC") != std::string::npos)
760 completeName =
"Summary_ClusterChargeCorr_OnTrack" +
subdet_tag;
763 completeName =
"Summary_ClusterChargeCorrThin_OnTrack" +
subdet_tag;
764 if (subdet_tag.find(
"TEC") != std::string::npos)
767 completeName =
"Summary_ClusterChargeCorrThick_OnTrack" +
subdet_tag;
768 if (subdet_tag.find(
"TEC") != std::string::npos)
772 completeName =
"Summary_ClusterCharge_OnTrack" +
subdet_tag;
776 completeName =
"Summary_ClusterChargeRaw_OnTrack" +
subdet_tag;
780 completeName =
"Summary_ClusterCharge_OffTrack" +
subdet_tag;
784 completeName =
"Summary_ClusterChargeRaw_OffTrack" +
subdet_tag;
788 completeName =
"Summary_ClusterStoN_OffTrack" +
subdet_tag;
792 completeName =
"Summary_ClusterChargePerCMfromTrack" +
subdet_tag;
796 completeName =
"Summary_ClusterChargePerCMfromOrigin_OnTrack" +
subdet_tag;
800 completeName =
"Summary_ClusterChargePerCMfromOrigin_OffTrack" +
subdet_tag;
805 completeName =
"Trend_TotalNumberOfClusters_OnTrack" +
subdet_tag;
807 completeName =
"Trend_TotalNumberOfClusters_OffTrack" +
subdet_tag;
817 const char* ParameterSetLabel,
820 return ibooker.
book1D(HistoName,
829 const char* ParameterSetLabel,
832 return ibooker.
book2D(HistoName,
844 const char* ParameterSetLabel,
847 return ibooker.
book3D(HistoName,
862 const char* ParameterSetLabel,
888 me->
getTH1()->SetCanExtend(TH1::kAllAxes);
892 me->setAxisTitle(
"Lumisection", 1);
902 auto const& trajParams = track.
extra()->trajParams();
906 auto ttrh = *(hb +
h);
909 uint32_t thedetid = ttrh->rawId();
912 if ((ttrh->getType() == 1))
914 if ((ttrh->getType() == 2))
916 if ((ttrh->getType() == 0))
921 if (!ttrh->isValid())
925 auto statedirection = trajParams[
h].momentum();
935 LogTrace(
"SiStripMonitorTrack") <<
"\nMatched recHit found" << std::endl;
942 statedirection = monodet->
toLocal(gtrkdirup);
945 if (statedirection.mag())
946 RecHitInfo<SiStripRecHit2D>(&m, statedirection, digilist, ev, es, track_ok);
949 statedirection = stereodet->
toLocal(gtrkdirup);
952 if (statedirection.mag())
953 RecHitInfo<SiStripRecHit2D>(&s, statedirection, digilist, ev, es, track_ok);
954 }
else if (projhit) {
955 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found" << std::endl;
964 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found MONO" << std::endl;
966 statedirection = det->
toLocal(gtrkdirup);
967 if (statedirection.mag())
968 RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist,
ev, es, track_ok);
970 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found STEREO" << std::endl;
973 statedirection = det->
toLocal(gtrkdirup);
974 if (statedirection.mag())
975 RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist,
ev, es, track_ok);
978 if (statedirection.mag())
979 RecHitInfo<SiStripRecHit2D>(hit2D, statedirection, digilist, ev, es, track_ok);
981 if (statedirection.mag())
982 RecHitInfo<SiStripRecHit1D>(hit1D, statedirection, digilist, ev, es, track_ok);
984 LogDebug(
"SiStripMonitorTrack") <<
" LocalMomentum: " << statedirection
985 <<
"\nLocal x-z plane angle: " << atan2(statedirection.x(), statedirection.z());
998 const bool track_ok) {
1001 LogTrace(
"SiStripMonitorTrack") <<
"\nMatched recHit found" << std::endl;
1009 statedirection = monodet->
toLocal(gtrkdirup);
1011 if (statedirection.
mag())
1012 RecHitInfo<SiStripRecHit2D>(&m, statedirection, digilist, ev, es, track_ok);
1016 statedirection = stereodet->
toLocal(gtrkdirup);
1018 if (statedirection.
mag())
1019 RecHitInfo<SiStripRecHit2D>(&s, statedirection, digilist, ev, es, track_ok);
1020 }
else if (projhit) {
1021 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found" << std::endl;
1031 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found MONO" << std::endl;
1033 statedirection = det->
toLocal(gtrkdirup);
1034 if (statedirection.
mag())
1035 RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist,
ev, es, track_ok);
1037 LogTrace(
"SiStripMonitorTrack") <<
"\nProjected recHit found STEREO" << std::endl;
1040 statedirection = det->
toLocal(gtrkdirup);
1041 if (statedirection.
mag())
1042 RecHitInfo<SiStripRecHit2D>(&(originalhit), statedirection, digilist,
ev, es, track_ok);
1045 statedirection = localMomentum;
1046 if (statedirection.
mag())
1047 RecHitInfo<SiStripRecHit2D>(hit2D, statedirection, digilist, ev, es, track_ok);
1049 statedirection = localMomentum;
1050 if (statedirection.
mag())
1051 RecHitInfo<SiStripRecHit1D>(hit1D, statedirection, digilist, ev, es, track_ok);
1053 LogDebug(
"SiStripMonitorTrack") <<
" LocalMomentum: " << statedirection
1054 <<
"\nLocal x-z plane angle: " << atan2(statedirection.
x(), statedirection.
z());
1059 using namespace std;
1060 using namespace edm;
1061 using namespace reco;
1074 auto& digilist = digihandle.
isValid() ? *(digihandle.
product()) : dummy;
1076 if (trackCollectionHandle.
isValid()) {
1087 if (track.
pt() < 0.8)
1089 if (track.
p() < 2.0)
1108 for (reco::TrackCollection::const_iterator
track = trackCollection.begin(), etrack = trackCollection.end();
1116 uint32_t thedetid = (*hit)->rawId();
1119 if (((*hit)->getType() == 1))
1121 if (((*hit)->getType() == 2))
1123 if (((*hit)->getType() == 0))
1128 if (!(*hit)->isValid())
1130 DetId detID = (*hit)->geographicalId();
1143 hitStudy(ev, es, digilist, projhit, matchedhit, hit2D, hit1D, localMomentum, track_ok);
1188 for (reco::TrackCollection::const_iterator
track = trackCollection.begin(), etrack = trackCollection.end();
1191 LogDebug(
"SiStripMonitorTrack") <<
"Track number " << ++i << std::endl;
1214 if (!tkrecHit->isValid()) {
1215 LogTrace(
"SiStripMonitorTrack") <<
"\t\t Invalid Hit " << std::endl;
1219 const uint32_t& detid = tkrecHit->geographicalId().rawId();
1222 <<
"\n\t\tRecHit on det " << detid <<
"\n\t\tRecHit in LP " << tkrecHit->localPosition() <<
"\n\t\tRecHit in GP " 1224 <<
"\n\t\tRecHit trackLocal vector " << LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() << std::endl;
1243 if (tkrecHit !=
nullptr && tkrecHit->isValid()) {
1244 const DetId detid = tkrecHit->geographicalId();
1247 float clust_Pos1 = -1000;
1248 float clust_Pos2 = -1000;
1253 clust_Pos1 = theGlobalPos.
z();
1254 clust_Pos2 = theGlobalPos.
phi();
1256 clust_Pos1 =
pow(theGlobalPos.
x()*theGlobalPos.
x() + theGlobalPos.
y()*theGlobalPos.
y(), 0.5);
1257 clust_Pos2 = theGlobalPos.
phi();
1266 &SiStripClusterInfo_, detid,
OnTrack, track_ok, LV, MEs, tTopo, stripGain, stripQuality, digilist, clust_Pos1, clust_Pos2)) {
1270 edm::LogError(
"SiStripMonitorTrack") <<
"NULL hit" << std::endl;
1298 auto& digilist = digihandle.
isValid() ? *(digihandle.
product()) : dummy;
1308 if (siStripClusterHandle.
isValid()) {
1311 DSVEnd = siStripClusterHandle->end();
1314 uint32_t detid = DSViter->id();
1317 LogDebug(
"SiStripMonitorTrack") <<
"on detid " << detid <<
" N Cluster= " << DSViter->size();
1348 edm::LogError(
"SiStripMonitorTrack") <<
"ClusterCollection is not valid!!" << std::endl;
1366 std::map<std::string, LayerMEs>::iterator iLayer =
LayerMEsMap.find(layer_id);
1368 me.
iLayer = &(iLayer->second);
1371 std::map<std::string, RingMEs>::iterator iRing =
RingMEsMap.find(ring_id);
1373 me.
iRing = &(iRing->second);
1376 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(sdet_tag);
1378 me.
iSubdet = &(iSubdet->second);
1393 for (
const auto&
track : *tracks) {
1396 uint32_t thedetid = (*hit)->rawId();
1397 if (!(
DetId(thedetid).subdetId() >= 3 &&
DetId(thedetid).subdetId() <= 6)) {
1401 if (!(*hit)->isValid())
1405 if (theHit ==
nullptr) {
1417 if (hit1D && !hit2D) {
1423 else if (!hit1D && hit2D) {
1429 std::vector<const FedChannelConnection*> getFedChanConnections;
1436 for (
const auto& getFedChanConnection : getFedChanConnections) {
1437 if (getFedChanConnection ==
nullptr) {
1441 int binfeccrate = getFedChanConnection->fecCrate();
1442 int binfecslot = getFedChanConnection->fecSlot();
1443 int binfecring = getFedChanConnection->fecRing();
1507 double theMeanSoN = (input1->
getBinContent(binx, biny) * nentries +
value) / (nentries + 1);
1517 const uint32_t detid,
1528 if (cluster ==
nullptr)
1538 LogDebug(
"SiStripMonitorTrack") <<
"\n\tLV " << LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() <<
" " << LV.
mag()
1541 cosRZ = fabs(LV.
z()) / LV.
mag();
1542 LogDebug(
"SiStripMonitorTrack") <<
"\n\t cosRZ " << cosRZ << std::endl;
1555 double chargeraw = 0;
1556 double clustergain = 0;
1557 auto digi_it = digilist.
find(detid);
1559 for (
size_t chidx = 0; chidx < cluster->
stripCharges().size(); ++chidx) {
1568 if (digi_it == digilist.
end()) {
1571 for (
const auto& digiobj : *digi_it) {
1572 if (digiobj.strip() == cluster->
firstStrip() + chidx) {
1573 chargeraw += digiobj.adc();
1590 uint32_t adet = cluster->
detId();
1595 uint32_t adet = cluster->
detId();
1604 if (MEs.
iLayer !=
nullptr) {
1608 LogDebug(
"SiStripMonitorTrack") <<
"Module " << detid <<
" in Event " <<
eventNb <<
" noise " 1628 if (MEs.
iRing !=
nullptr) {
1632 LogDebug(
"SiStripMonitorTrack") <<
"Module " << detid <<
" in Event " <<
eventNb <<
" noise " 1658 if (tTopo->
moduleGeometry(detid) == SiStripDetId::ModuleGeometry::W5 ||
1659 tTopo->
moduleGeometry(detid) == SiStripDetId::ModuleGeometry::W6 ||
1660 tTopo->
moduleGeometry(detid) == SiStripDetId::ModuleGeometry::W7) {
1672 uint32_t adet = cluster->
detId();
1677 LogDebug(
"SiStripMonitorTrack") <<
"Module " << detid <<
" in Event " <<
eventNb <<
" noise " << noise
1681 uint32_t adet = cluster->
detId();
1692 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(name);
1695 fillME(iModME->second.ClusterStoNCorr, StoN * cosRZ);
1698 <<
"Module " << name <<
" in Event " <<
eventNb <<
" noise " << noise << std::endl;
1699 fillME(iModME->second.ClusterGain, clustergain);
1700 fillME(iModME->second.ClusterCharge, charge);
1701 fillME(iModME->second.ClusterChargeRaw, chargeraw);
1703 fillME(iModME->second.ClusterChargeCorr, charge * cosRZ);
1705 fillME(iModME->second.ClusterWidth, width);
1706 fillME(iModME->second.ClusterPos, position);
1709 fillME(iModME->second.ClusterChargePerCMfromTrack, dQdx_fromTrack);
1711 fillME(iModME->second.ClusterChargePerCMfromOrigin, dQdx_fromOrigin);
1715 int PGVposCounter = cluster->
maxIndex();
1719 fillME(iModME->second.ClusterPGV,
i, 0.);
1721 fillME(iModME->second.ClusterPGV, PGVposCounter++, (*it) / PGVmax);
1723 for (
int i = PGVposCounter;
1726 fillME(iModME->second.ClusterPGV,
i, 0.);
1736 uint32_t adet = cluster->
detId();
1739 LogDebug(
"SiStripMonitorTrack") <<
"Module firing " << detid <<
" in Event " <<
eventNb << std::endl;
1743 uint32_t adet = cluster->
detId();
1750 if (MEs.
iLayer !=
nullptr) {
1760 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
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)
MonitorElement * ClusterStoNCorr_OnTrack_TECP
MonitorElement * ClusterChargePerCMfromTrack
void RecHitInfo(const T *tkrecHit, LocalVector LV, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev, const edm::EventSetup &es, bool track_ok)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
void setBinContent(int binx, double content)
set content of bin (1-D)
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
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
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)
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
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 * bookProfile(Args &&...args)
MonitorElement * ClusterPosOffTrack
MonitorElement * ClusterPosOnTrack
bool getByToken(EDGetToken token, Handle< PROD > &result) const
float noiseRescaledByGain() const
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)...
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_
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)
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * ClusterStoNCorrThinOnTrack
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
MonitorElement * bookME1D(DQMStore::IBooker &, const char *, const char *)
MonitorElement * ClusterChargePerCMfromTrack
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=false)
SiStripDetId::ModuleGeometry moduleGeometry(const DetId &id) const
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_
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
void setCurrentFolder(std::string const &fullpath)
std::unordered_set< const SiStripCluster * > vPSiStripCluster
std::map< std::string, SubDetMEs > SubDetMEsMap
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
MonitorElement * bookME2D(DQMStore::IBooker &, const char *, const char *)
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 * book1D(Args &&...args)
void tag(MonitorElement *, unsigned int)
MonitorElement * ClusterWidthOnTrack
void bookSubDetMEs(DQMStore::IBooker &, std::string &name)
MonitorElement * bookME3D(DQMStore::IBooker &, const char *, const char *)
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
MonitorElement * ClusterChargeOnTrack
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_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.
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
MonitorElement * book2D(Args &&...args)
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
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
std::map< std::string, ModMEs > ModMEsMap
MonitorElement * bookMETrend(DQMStore::IBooker &, const char *)
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
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 * 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
double getBinContent(int binx) const
get content of bin (1-D)
const Range getRange(const uint32_t detID) const
std::unique_ptr< TkHistoMap > tkhisto_NumMissingHits
MonitorElement * handleBookMEs(DQMStore::IBooker &, std::string &, std::string &, std::string &, std::string &)
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 * ClusterCount_OnTrack_FECSlotVsFECRing_TIBTID
MonitorElement * bookMEProfile(DQMStore::IBooker &, const char *, const char *)
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 * book3D(Args &&...args)
MonitorElement * ClusterWidthOffTrack
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
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)
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_
std::map< std::string, LayerMEs > LayerMEsMap
MonitorElement * ClusterChargePerCMfromOriginOffTrack
MonitorElement * ClusterNoiseOnTrack