68 #include "CLHEP/Units/PhysicalConstants.h" 254 trackMaxPt_(iConfig.getParameter<double>(
"trackMaximumPt")),
255 trackMaxBtlEta_(iConfig.getParameter<double>(
"trackMaximumBtlEta")),
256 trackMinEtlEta_(iConfig.getParameter<double>(
"trackMinimumEtlEta")),
257 trackMaxEtlEta_(iConfig.getParameter<double>(
"trackMaximumEtlEta")) {
286 mtdgeoToken_ = esConsumes<MTDGeometry, MTDDigiGeometryRecord>();
288 mtdlayerToken_ = esConsumes<MTDDetLayerGeometry, MTDRecoGeometryRecord>();
289 magfieldToken_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
303 std::unordered_map<uint32_t, MTDHit> m_btlHits;
304 std::unordered_map<uint32_t, MTDHit> m_etlHits;
305 std::unordered_map<uint32_t, std::set<unsigned long int>> m_btlTrkPerCell;
306 std::unordered_map<uint32_t, std::set<unsigned long int>> m_etlTrkPerCell;
326 s2r_ = simToRecoH.product();
329 r2s_ = recoToSimH.product();
331 unsigned int index = 0;
334 for (
const auto& trackGen : *GenRecTrackHandle) {
338 if (trackAssoc[trackref] == -1) {
339 LogWarning(
"mtdTracks") <<
"Extended track not associated";
348 bool twoETLdiscs =
false;
353 if (std::round(SigmatMtd[trackref] - Sigmat0Pid[trackref]) != 0) {
355 <<
"TimeError associated to refitted track is different from TimeError stored in tofPID " 356 "sigmat0 ValueMap: this should not happen";
384 int numMTDBtlvalidhits = 0;
385 for (
const auto hit :
track.recHits()) {
386 if (
hit->isValid() ==
false)
389 if ((
Hit.det() == 6) && (
Hit.subdetId() == 1) && (
Hit.mtdSubDetector() == 1)) {
391 numMTDBtlvalidhits++;
397 if (MTDBtl ==
true) {
405 if (isBTL && Sigmat0Safe[trackref] < 0.) {
424 bool MTDEtlZnegD1 =
false;
425 bool MTDEtlZnegD2 =
false;
426 bool MTDEtlZposD1 =
false;
427 bool MTDEtlZposD2 =
false;
428 int numMTDEtlvalidhits = 0;
429 for (
const auto hit :
track.recHits()) {
430 if (
hit->isValid() ==
false)
433 if ((
Hit.det() == 6) && (
Hit.subdetId() == 1) && (
Hit.mtdSubDetector() == 2)) {
437 if ((ETLHit.
zside() == -1) && (ETLHit.
nDisc() == 1)) {
441 numMTDEtlvalidhits++;
443 if ((ETLHit.
zside() == -1) && (ETLHit.
nDisc() == 2)) {
447 numMTDEtlvalidhits++;
449 if ((ETLHit.
zside() == 1) && (ETLHit.
nDisc() == 1)) {
453 numMTDEtlvalidhits++;
455 if ((ETLHit.
zside() == 1) && (ETLHit.
nDisc() == 2)) {
459 numMTDEtlvalidhits++;
464 if (
isETL && Sigmat0Safe[trackref] < 0.) {
470 twoETLdiscs = (MTDEtlZnegD1 ==
true) && (MTDEtlZnegD2 ==
true);
471 if ((MTDEtlZnegD1 ==
true) || (MTDEtlZnegD2 ==
true)) {
483 twoETLdiscs = (MTDEtlZposD1 ==
true) && (MTDEtlZposD2 ==
true);
484 if ((MTDEtlZposD1 ==
true) || (MTDEtlZposD2 ==
true)) {
502 LogDebug(
"MtdTracksValidation") <<
"Track p/pt = " << trackGen.p() <<
" " << trackGen.pt() <<
" eta " 503 << trackGen.eta() <<
" BTL " << isBTL <<
" ETL " <<
isETL <<
" 2disks " 513 if (tp_info !=
nullptr &&
trkTPSelAll(**tp_info)) {
517 std::abs(trackGen.pt() - (*tp_info)->pt()));
521 (*tp_info)->pt(),
std::abs(
track.pt() - (*tp_info)->pt()) /
std::abs(trackGen.pt() - (*tp_info)->pt()));
523 (trackGen.pt() - (*tp_info)->pt()) / (*tp_info)->pt());
529 std::abs(trackGen.pt() - (*tp_info)->pt()));
533 (*tp_info)->pt(),
std::abs(
track.pt() - (*tp_info)->pt()) /
std::abs(trackGen.pt() - (*tp_info)->pt()));
535 (trackGen.pt() - (*tp_info)->pt()) / ((*tp_info)->pt()));
537 (
track.pt() - (*tp_info)->pt()) / ((*tp_info)->pt()));
539 if (
isETL && twoETLdiscs) {
541 std::abs(trackGen.pt() - (*tp_info)->pt()));
545 (*tp_info)->pt(),
std::abs(
track.pt() - (*tp_info)->pt()) /
std::abs(trackGen.pt() - (*tp_info)->pt()));
547 (trackGen.pt() - (*tp_info)->pt()) / ((*tp_info)->pt()));
549 (
track.pt() - (*tp_info)->pt()) / ((*tp_info)->pt()));
552 auto simClustersRefs = tp2SimAssociationMap.find(*tp_info);
553 const bool withMTD = (simClustersRefs != tp2SimAssociationMap.end());
570 if (isBTL ||
isETL) {
573 if (isBTL || twoETLdiscs) {
581 if (isBTL || twoETLdiscs) {
619 <<
"MtdTracksValidation: extender fail in " <<
iEvent.id().run() <<
" " <<
iEvent.id().event()
620 <<
" pt= " << trackGen.pt() <<
" eta= " << trackGen.eta();
629 double tsim = (*tp_info)->parentVertex()->position().t() *
simUnit_;
631 double pullT(-9999.);
632 if (Sigmat0Safe[trackref] != -1.) {
633 dT = t0Safe[trackref] - tsim;
634 pullT = dT / Sigmat0Safe[trackref];
635 if (isBTL ||
isETL) {
649 if (trackGen.pt() < 0.45) {
655 bool MTDEtlZnegD1 =
false;
656 bool MTDEtlZnegD2 =
false;
657 bool MTDEtlZposD1 =
false;
658 bool MTDEtlZposD2 =
false;
659 for (
const auto hit :
track.recHits()) {
660 if (
hit->isValid() ==
false)
663 if ((
Hit.det() == 6) && (
Hit.subdetId() == 1) && (
Hit.mtdSubDetector() == 2)) {
666 if ((ETLHit.
zside() == -1) && (ETLHit.
nDisc() == 1)) {
669 if ((ETLHit.
zside() == -1) && (ETLHit.
nDisc() == 2)) {
672 if ((ETLHit.
zside() == 1) && (ETLHit.
nDisc() == 1)) {
675 if ((ETLHit.
zside() == 1) && (ETLHit.
nDisc() == 2)) {
681 twoETLdiscs = (MTDEtlZnegD1 ==
true) && (MTDEtlZnegD2 ==
true);
684 twoETLdiscs = (MTDEtlZposD1 ==
true) && (MTDEtlZposD2 ==
true);
687 if (trackGen.pt() < 0.45) {
693 if (
isETL && twoETLdiscs) {
694 if (trackGen.pt() < 0.45) {
733 auto tTrack = ttrackBuilder->build(
track);
737 std::unique_ptr<MeasurementEstimator> theEstimator =
745 <<
"MtdTracksValidation: extrapolating track, pt= " <<
track.pt() <<
" eta= " <<
track.eta();
750 const std::vector<const DetLayer*>& layersBTL = layerGeo->
allBTLLayers();
751 for (
const DetLayer* ilay : layersBTL) {
752 std::pair<bool, TrajectoryStateOnSurface>
comp = ilay->compatible(tsos, prop, *theEstimator);
757 extrho =
comp.second.globalPosition().perp();
758 exteta =
comp.second.globalPosition().eta();
759 extphi =
comp.second.globalPosition().phi();
760 edm::LogVerbatim(
"MtdTracksValidation") <<
"MtdTracksValidation: extrapolation at BTL surface, rho= " << extrho
761 <<
" eta= " << exteta <<
" phi= " << extphi;
763 std::vector<DetLayer::DetWithState> compDets = ilay->compatibleDets(tsos, prop, *theEstimator);
764 for (
const auto& detWithState : compDets) {
765 const auto& det = detWithState.first;
770 <<
"MtdTracksValidation: DetId= " << det->geographicalId().rawId()
771 <<
" gp= " << detWithState.second.globalPosition().x() <<
" " << detWithState.second.globalPosition().y()
772 <<
" " << detWithState.second.globalPosition().z() <<
" rho= " << detWithState.second.globalPosition().perp()
773 <<
" eta= " << detWithState.second.globalPosition().eta()
774 <<
" phi= " << detWithState.second.globalPosition().phi();
776 for (
const auto&
recHit : *btlRecHitsHandle) {
780 if (thedet ==
nullptr)
781 throw cms::Exception(
"MtdTracksValidation") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" (" 782 <<
detId.rawId() <<
") is invalid!" <<
std::dec << std::endl;
783 if (geoId == det->geographicalId()) {
789 const auto& global_point = thedet->
toGlobal(local_point);
791 <<
"MtdTracksValidation: Hit id= " <<
detId.rawId() <<
" ene= " <<
recHit.energy()
792 <<
" dr= " <<
reco::deltaR(global_point, detWithState.second.globalPosition());
794 eneSum +=
recHit.energy();
807 <<
"MtdTracksValidation: BTL matched, energy= " << eneSum <<
" #layers= " << nlayers;
816 const std::vector<const DetLayer*>& layersETL = layerGeo->
allETLLayers();
817 for (
const DetLayer* ilay : layersETL) {
820 const double diskZ = disk.position().z();
823 std::pair<bool, TrajectoryStateOnSurface>
comp = ilay->compatible(tsos, prop, *theEstimator);
828 extrho =
comp.second.globalPosition().perp();
829 exteta =
comp.second.globalPosition().eta();
830 extphi =
comp.second.globalPosition().phi();
832 edm::LogVerbatim(
"MtdTracksValidation") <<
"MtdTracksValidation: extrapolation at ETL surface, rho= " << extrho
833 <<
" eta= " << exteta <<
" phi= " << extphi;
834 std::vector<DetLayer::DetWithState> compDets = ilay->compatibleDets(tsos, prop, *theEstimator);
835 for (
const auto& detWithState : compDets) {
836 const auto& det = detWithState.first;
841 <<
"MtdTracksValidation: DetId= " << det->geographicalId().rawId()
842 <<
" gp= " << detWithState.second.globalPosition().x() <<
" " << detWithState.second.globalPosition().y()
843 <<
" " << detWithState.second.globalPosition().z() <<
" rho= " << detWithState.second.globalPosition().perp()
844 <<
" eta= " << detWithState.second.globalPosition().eta()
845 <<
" phi= " << detWithState.second.globalPosition().phi();
847 for (
const auto&
recHit : *etlRecHitsHandle) {
851 if (thedet ==
nullptr)
852 throw cms::Exception(
"MtdTracksValidation") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" (" 853 <<
detId.rawId() <<
") is invalid!" <<
std::dec << std::endl;
854 if (geoId == det->geographicalId()) {
859 const auto& global_point = thedet->
toGlobal(local_point);
861 <<
"MtdTracksValidation: Hit id= " <<
detId.rawId() <<
" time= " <<
recHit.time()
862 <<
" dr= " <<
reco::deltaR(global_point, detWithState.second.globalPosition());
876 selvar = (
float)hcount;
879 <<
"MtdTracksValidation: ETL matched, counts= " << hcount <<
" #layers= " << nlayers;
883 if (!inBTL && !inETL) {
885 <<
"MtdTracksValidation: track not extrapolating to MTD: pt= " <<
track.pt() <<
" eta= " <<
track.eta()
886 <<
" phi= " <<
track.phi() <<
" vz= " <<
track.vz()
905 ibook.
book1D(
"TrackBTLPtRes",
"Track pT resolution ;pT_{Gentrack}-pT_{MTDtrack}/pT_{Gentrack} ", 100, -0.1, 0.1);
908 ibook.
book1D(
"TrackETLEffEtaTotZneg",
"Eta of tracks (Tot) (-Z);#eta_{RECO}", 100, -3.2, -1.4);
910 ibook.
book1D(
"TrackETLEffEtaTotZpos",
"Eta of tracks (Tot) (+Z);#eta_{RECO}", 100, 1.4, 3.2);
912 ibook.
book1D(
"TrackETLEffEtaTotLowPt0",
"Eta of tracks, 0.2 < pt < 0.45 (Tot);#eta_{RECO}", 100, 1.4, 3.2);
914 ibook.
book1D(
"TrackETLEffEtaTotLowPt1",
"Eta of tracks, 0.45 < pt < 0.7 (Tot);#eta_{RECO}", 100, 1.4, 3.2);
916 ibook.
book1D(
"TrackETLEffPhiTotZneg",
"Phi of tracks (Tot) (-Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
918 ibook.
book1D(
"TrackETLEffPhiTotZpos",
"Phi of tracks (Tot) (+Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
922 ibook.
book1D(
"TrackETLEffEtaMtdZneg",
"Eta of tracks (Mtd) (-Z);#eta_{RECO}", 100, -3.2, -1.4);
924 ibook.
book1D(
"TrackETLEffEtaMtdZpos",
"Eta of tracks (Mtd) (+Z);#eta_{RECO}", 100, 1.4, 3.2);
926 ibook.
book1D(
"TrackETLEffEtaMtdLowPt0",
"Eta of tracks, 0.2 < pt < 0.45 (Mtd);#eta_{RECO}", 100, 1.4, 3.2);
928 ibook.
book1D(
"TrackETLEffEtaMtdLowPt1",
"Eta of tracks, 0.45 < pt < 0.7 (Mtd);#eta_{RECO}", 100, 1.4, 3.2);
930 ibook.
book1D(
"TrackETLEffEta2MtdLowPt0",
"Eta of tracks, 0.2 < pt < 0.45 (Mtd 2 hit);#eta_{RECO}", 100, 1.4, 3.2);
932 ibook.
book1D(
"TrackETLEffEta2MtdLowPt1",
"Eta of tracks, 0.45 < pt < 0.7 (Mtd 2 hit);#eta_{RECO}", 100, 1.4, 3.2);
934 ibook.
book1D(
"TrackETLEffPhiMtdZneg",
"Phi of tracks (Mtd) (-Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
936 ibook.
book1D(
"TrackETLEffPhiMtdZpos",
"Phi of tracks (Mtd) (+Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
940 ibook.
book1D(
"TrackETLEffEta2MtdZneg",
"Eta of tracks (Mtd 2 hit) (-Z);#eta_{RECO}", 100, -3.2, -1.4);
942 ibook.
book1D(
"TrackETLEffEta2MtdZpos",
"Eta of tracks (Mtd 2 hit) (+Z);#eta_{RECO}", 100, 1.4, 3.2);
944 ibook.
book1D(
"TrackETLEffPhi2MtdZneg",
"Phi of tracks (Mtd 2 hit) (-Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
946 ibook.
book1D(
"TrackETLEffPhi2MtdZpos",
"Phi of tracks (Mtd 2 hit) (+Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
948 ibook.
book1D(
"TrackETLEffPt2MtdZneg",
"Pt of tracks (Mtd 2 hit) (-Z);pt_{RECO} [GeV]", 50, 0, 10);
950 ibook.
book1D(
"TrackETLEffPt2MtdZpos",
"Pt of tracks (Mtd 2 hit) (+Z);pt_{RECO} [GeV]", 50, 0, 10);
952 ibook.
book1D(
"TrackETLPtRes",
"Track pT resolution;pT_{Gentrack}-pT_{MTDtrack}/pT_{Gentrack} ", 100, -0.1, 0.1);
954 meTracktmtd_ = ibook.
book1D(
"Tracktmtd",
"Track time from TrackExtenderWithMTD;tmtd [ns]", 150, 1, 16);
955 meTrackt0Src_ = ibook.
book1D(
"Trackt0Src",
"Track time from TrackExtenderWithMTD;t0Src [ns]", 100, -1.5, 1.5);
957 ibook.
book1D(
"TrackSigmat0Src",
"Time Error from TrackExtenderWithMTD; #sigma_{t0Src} [ns]", 100, 0, 0.1);
959 meTrackt0Pid_ = ibook.
book1D(
"Trackt0Pid",
"Track t0 as stored in TofPid;t0 [ns]", 100, -1, 1);
963 "TrackSigmat0SafePID",
"Log10(Sigmat0 Safe) as stored in TofPid; Log10(#sigma_{t0} [ns])", 80, -3, 1);
964 meTrackNumHits_ = ibook.
book1D(
"TrackNumHits",
"Number of valid MTD hits per track ; Number of hits", 10, -5, 5);
966 "TrackNumHitsNT",
"Number of valid MTD hits per track no time associated; Number of hits", 10, -5, 5);
967 meTrackMVAQual_ = ibook.
book1D(
"TrackMVAQual",
"Track MVA Quality as stored in Value Map ; MVAQual", 100, -1, 1);
969 "TrackPathLenghtvsEta",
"MTD Track pathlength vs MTD track Eta;|#eta|;Pathlength", 100, 0, 3.2, 100.0, 400.0,
"S");
975 ibook.
book1D(
"TrackSigmaTof_Pion",
"Sigma(TOF) for pion hypothesis; #sigma_{t0} [ps]", 10, 0, 5);
977 ibook.
book1D(
"TrackSigmaTof_Kaon",
"Sigma(TOF) for kaon hypothesis; #sigma_{t0} [ps]", 25, 0, 25);
979 ibook.
book1D(
"TrackSigmaTof_Proton",
"Sigma(TOF) for proton hypothesis; #sigma_{t0} [ps]", 50, 0, 50);
982 "Sigma(TOF) for pion hypothesis vs p; p [GeV]; #sigma_{t0} [ps]",
990 "Sigma(TOF) for kaon hypothesis vs p; p [GeV]; #sigma_{t0} [ps]",
998 "Sigma(TOF) for proton hypothesis vs p; p [GeV]; #sigma_{t0} [ps]",
1007 ibook.
book1D(
"ExtraPtMtd",
"Pt of tracks associated to LV extrapolated to hits; track pt [GeV] ", 110, 0., 11.);
1009 "Pt of tracks associated to LV extrapolated to hits, 2 ETL layers; track pt [GeV] ",
1014 meTrackPtTot_ = ibook.
book1D(
"TrackPtTot",
"Pt of tracks ; track pt [GeV] ", 110, 0., 11.);
1016 ibook.
book1D(
"MatchedTPEffPtTot",
"Pt of tracks matched to TP; track pt [GeV] ", 110, 0., 11.);
1018 ibook.
book1D(
"MatchedTPEffPtTotLV",
"Pt of tracks associated to LV matched to TP; track pt [GeV] ", 110, 0., 11.);
1020 ibook.
book1D(
"MatchedTPEffPtMtd",
"Pt of tracks matched to TP with time; track pt [GeV] ", 110, 0., 11.);
1022 "MatchedTPEffPtEtl2Mtd",
"Pt of tracks matched to TP with time, 2 ETL hits; track pt [GeV] ", 110, 0., 11.);
1025 "TrackMatchedTPBTLPtResMtd",
1026 "Pt resolution of tracks matched to TP-BTL hit ;|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1031 "TrackMatchedTPETLPtResMtd",
1032 "Pt resolution of tracks matched to TP-ETL hit ;|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1037 "TrackMatchedTPETL2PtResMtd",
1038 "Pt resolution of tracks matched to TP-ETL 2hits ;|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1043 "TrackMatchedTPBTLPtRatioGen",
"Pt ratio of Gentracks (BTL) ;pT_{Gentrack}/pT_{truth} ", 100, 0.9, 1.1);
1045 "TrackMatchedTPETLPtRatioGen",
"Pt ratio of Gentracks (ETL 1hit) ;pT_{Gentrack}/pT_{truth} ", 100, 0.9, 1.1);
1047 "TrackMatchedTPETL2PtRatioGen",
"Pt ratio of Gentracks (ETL 2hits) ;pT_{Gentrack}/pT_{truth} ", 100, 0.9, 1.1);
1049 "Pt ratio of tracks matched to TP-BTL hit ;pT_{MTDtrack}/pT_{truth} ",
1054 "Pt ratio of tracks matched to TP-ETL hit ;pT_{MTDtrack}/pT_{truth} ",
1059 ibook.
book1D(
"TrackMatchedTPETL2PtRatioMtd",
1060 "Pt ratio of tracks matched to TP-ETL 2hits ;pT_{MTDtrack}/pT_{truth} ",
1065 "Pt resolution of tracks matched to TP-BTL hit vs Pt;pT_{truth} " 1066 "[GeV];|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1074 "Pt resolution of tracks matched to TP-ETL hit vs Pt;pT_{truth} " 1075 "[GeV];|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1083 ibook.
bookProfile(
"TrackMatchedTPETL2PtResvsPtMtd",
1084 "Pt resolution of tracks matched to TP-ETL 2hits Pt pT;pT_{truth} " 1085 "[GeV];|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1093 "TrackMatchedTPBTLDPtvsPtGen",
1094 "Pt relative difference of Gentracks (BTL) vs Pt;pT_{truth} [GeV];pT_{Gentrack}-pT_{truth}/pT_{truth} ",
1102 "TrackMatchedTPETLDPtvsPtGen",
1103 "Pt relative difference of Gentracks (ETL 1hit) vs Pt;pT_{truth} [GeV];pT_{Gentrack}-pT_{truth}/pT_{truth} ",
1111 "TrackMatchedTPETL2DPtvsPtGen",
1112 "Pt relative difference of Gentracks (ETL 2hits) vs Pt;pT_{truth} [GeV];pT_{Gentrack}-pT_{truth}/pT_{truth} ",
1120 "Pt relative difference of tracks matched to TP-BTL hits vs " 1121 "Pt;pT_{truth} [GeV];pT_{MTDtrack}-pT_{truth}/pT_{truth} ",
1129 "Pt relative difference of tracks matched to TP-ETL hits vs " 1130 "Pt;pT_{truth} [GeV];pT_{MTDtrack}-pT_{truth}/pT_{truth} ",
1138 "Pt relative difference of tracks matched to TP-ETL 2hits vs " 1139 "Pt;pT_{truth} [GeV];pT_{MTDtrack}-pT_{truth}/pT_{truth} ",
1148 ibook.
book1D(
"MatchedTPmtdEffPtTot",
"Pt of tracks matched to TP-mtd hit; track pt [GeV] ", 110, 0., 11.);
1150 "MatchedTPmtdEffPtMtd",
"Pt of tracks matched to TP-mtd hit with time; track pt [GeV] ", 110, 0., 11.);
1153 ibook.
book1D(
"ExtraEtaMtd",
"Eta of tracks associated to LV extrapolated to hits; track eta ", 66, 0., 3.3);
1155 "ExtraEtaEtl2Mtd",
"Eta of tracks associated to LV extrapolated to hits, 2 ETL layers; track eta ", 66, 0., 3.3);
1159 ibook.
book1D(
"MatchedTPEffEtaTot",
"Eta of tracks matched to TP; track eta ", 66, 0., 3.3);
1161 ibook.
book1D(
"MatchedTPEffEtaTotLV",
"Eta of tracks associated to LV matched to TP; track eta ", 66, 0., 3.3);
1163 ibook.
book1D(
"MatchedTPEffEtaMtd",
"Eta of tracks matched to TP with time; track eta ", 66, 0., 3.3);
1165 "MatchedTPEffEtaEtl2Mtd",
"Eta of tracks matched to TP with time, 2 ETL hits; track eta ", 66, 0., 3.3);
1168 ibook.
book1D(
"MatchedTPmtdEffEtaTot",
"Eta of tracks matched to TP-mtd hit; track eta ", 66, 0., 3.3);
1170 ibook.
book1D(
"MatchedTPmtdEffEtaMtd",
"Eta of tracks matched to TP-mtd hit with time; track eta ", 66, 0., 3.3);
1173 "TrackRes",
"t_{rec} - t_{sim} for LV associated tracks matched to TP; t_{rec} - t_{sim} [ns] ", 120, -0.15, 0.15);
1175 "TrackPull",
"Pull for LV associated tracks matched to TP; (t_{rec}-t_{sim})/#sigma_{t}", 50, -5., 5.);
1178 "t_{rec} - t_{sim} for LV associated tracks matched to TP vs MVA Quality; MVAQual; t_{rec} - t_{sim} [ns] ",
1187 "Pull for LV associated tracks matched to TP vs MVA Quality; MVAQual; (t_{rec}-t_{sim})/#sigma_{t}",
1196 "ExtraPhiAtBTL",
"Phi at BTL surface of extrapolated tracks associated to LV; phi [deg]", 720, -180., 180.);
1198 ibook.
book1D(
"ExtraPhiAtBTLmatched",
1199 "Phi at BTL surface of extrapolated tracks associated to LV matched with BTL hits; phi [deg]",
1204 ibook.
book1D(
"ExtraBTLeneInCone",
1205 "BTL reconstructed energy in cone arounnd extrapolated track associated to LV; E [MeV]",
1210 ibook.
book1D(
"ExtraMTDfailExtenderEta",
1211 "Eta of tracks associated to LV extrapolated to MTD with no track extender match to hits; track eta",
1217 "ExtraMTDfailExtenderPt",
1218 "Pt of tracks associated to LV extrapolated to MTD with no track extender match to hits; track pt [GeV] ",
1244 ->setComment(
"Association between General and MTD Extended tracks");
1255 edm::InputTag(
"trackExtenderWithMTD:generalTrackOutermostHitPosition"));
1256 desc.add<
double>(
"trackMinimumPt", 0.7);
1257 desc.add<
double>(
"trackMaximumPt", 12.);
1258 desc.add<
double>(
"trackMaximumBtlEta", 1.5);
1259 desc.add<
double>(
"trackMinimumEtlEta", 1.6);
1260 desc.add<
double>(
"trackMaximumEtlEta", 3.);
1261 desc.addUntracked<
bool>(
"optionalPlots",
true);
1263 descriptions.
add(
"mtdTracksValid",
desc);
1267 bool match = (
tp.status() != 1) ?
false :
true;
1274 auto x_pv =
tp.parentVertex()->position().x();
1275 auto y_pv =
tp.parentVertex()->position().y();
1276 auto z_pv =
tp.parentVertex()->position().z();
1278 auto r_pv =
std::sqrt(x_pv * x_pv + y_pv * y_pv);
1305 for (
const auto&
tp :
found->val) {
1306 if (
tp.first->eventId().bunchCrossing() == 0)
MonitorElement * meETLTrackEffEtaTot_[2]
edm::EDGetTokenT< edm::ValueMap< int > > trackAssocToken_
static constexpr double etacutGEN_
Log< level::Info, true > LogVerbatim
MonitorElement * meBTLTrackMatchedTPPtResMtd_
MonitorElement * meTrackMatchedTPEffEtaMtd_
MonitorElement * meBTLTrackEffPhiMtd_
edm::EDGetTokenT< edm::ValueMap< float > > trackMVAQualToken_
edm::EDGetTokenT< edm::ValueMap< float > > pathLengthToken_
T getParameter(std::string const &) const
MonitorElement * meETLTrackMatchedTPPtResvsPtMtd_
MonitorElement * meTrackNumHits_
MonitorElement * meTrackt0Pid_
MonitorElement * meExtraMTDfailExtenderEta_
const std::pair< bool, bool > checkAcceptance(const reco::Track &, const edm::Event &, const edm::EventSetup &, size_t &, float &, float &, float &, float &)
MonitorElement * meETLTrackMatchedTP2DPtvsPtGen_
MonitorElement * meETLTrackRPTime_
MonitorElement * meTrackPullTotvsMVAQual_
MonitorElement * meETLTrackMatchedTP2PtResMtd_
edm::EDGetTokenT< edm::ValueMap< float > > t0SafePidToken_
edm::EDGetTokenT< edm::ValueMap< float > > t0SrcToken_
static constexpr double rBTL_
MonitorElement * meETLTrackMatchedTP2PtRatioMtd_
edm::ESGetToken< MTDTopology, MTDTopologyRcd > mtdtopoToken_
virtual void setCurrentFolder(std::string const &fullpath)
const std::string folder_
const bool trkRecSel(const reco::TrackBase &)
static constexpr double pTcutETL_
virtual const Topology & topology() const
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > builderToken_
constexpr NumType convertRadToDeg(NumType radians)
virtual const PixelTopology & specificTopology() const
MonitorElement * meETLTrackMatchedTP2PtResvsPtMtd_
MonitorElement * meTrackResTotvsMVAQual_
static constexpr double etacutREC_
MonitorElement * meBTLTrackPtRes_
MonitorElement * meETLTrackEffEta2MtdLowPt_[2]
MonitorElement * meETLTrackEffPtTot_[2]
MonitorElement * meBTLTrackEffEtaMtd_
MonitorElement * meETLTrackEffPhi2Mtd_[2]
edm::EDGetTokenT< edm::ValueMap< float > > tmtdToken_
MonitorElement * meExtraBTLeneInCone_
edm::EDGetTokenT< edm::ValueMap< float > > outermostHitPositionToken_
MonitorElement * meExtraMTDfailExtenderPt_
MonitorElement * meExtraEtaMtd_
const float trackMaxEtlEta_
const reco::SimToRecoCollection * s2r_
const float trackMaxBtlEta_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
const unsigned long int uniqueId(const uint32_t x, const EncodedEventId &y)
MonitorElement * meBTLTrackMatchedTPPtRatioMtd_
LocalPoint pixelToModuleLocalPoint(const LocalPoint &plp, int row, int col) const
MonitorElement * meTrackMatchedTPmtdEffEtaTot_
static constexpr double cluDRradius_
const reco::RecoToSimCollection * r2s_
const edm::Ref< std::vector< TrackingParticle > > * getMatchedTP(const reco::TrackBaseRef &)
const_iterator find(const key_type &k) const
find element with specified reference key
Detector identifier base class for the MIP Timing Layer.
MonitorElement * meETLTrackMatchedTP2PtRatioGen_
edm::EDGetTokenT< reco::TrackCollection > GenRecTrackToken_
MonitorElement * meETLTrackEffPhiMtd_[2]
edm::EDGetTokenT< reco::TPToSimCollectionMtd > tp2SimAssociationMapToken_
MonitorElement * meTrackResTot_
const_iterator end() const
last iterator over the map (read only)
MonitorElement * meTrackMatchedTPEffEtaTotLV_
double pt() const
track transverse momentum
edm::EDGetTokenT< edm::ValueMap< float > > SigmaTofPToken_
edm::EDGetTokenT< reco::TrackCollection > RecTrackToken_
MonitorElement * meExtraEtaEtl2Mtd_
MonitorElement * meBTLTrackEffPhiTot_
edm::ESGetToken< MTDDetLayerGeometry, MTDRecoGeometryRecord > mtdlayerToken_
const bool trkTPSelAll(const TrackingParticle &)
GlobalPoint globalPosition() const
MonitorElement * meTrackMatchedTPmtdEffEtaMtd_
MonitorElement * meTrackMatchedTPEffEtaTot_
float localX(const float mpX) const override
edm::EDGetTokenT< FTLRecHitCollection > etlRecHitsToken_
MonitorElement * meTrackMatchedTPEffPtTotLV_
MonitorElement * meBTLTrackRPTime_
MonitorElement * meETLTrackEffEta2Mtd_[2]
MonitorElement * meBTLTrackMatchedTPDPtvsPtMtd_
static constexpr double depositBTLthreshold_
MonitorElement * meETLTrackPtRes_
MonitorElement * meETLTrackEffPt2Mtd_[2]
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())
const bool trkTPSelLV(const TrackingParticle &)
MonitorElement * meETLTrackMatchedTPDPtvsPtGen_
MonitorElement * meTrackt0SafePid_
MonitorElement * meBTLTrackEffEtaTot_
MonitorElement * meETLTrackMatchedTPDPtvsPtMtd_
Abs< T >::type abs(const T &t)
bool isETL(const double eta) const
bool isMatched(TrackingRecHit const &hit)
MonitorElement * meBTLTrackMatchedTPPtResvsPtMtd_
MonitorElement * meTrackSigmaTof_[3]
#define DEFINE_FWK_MODULE(type)
int nrows() const override
static constexpr double simUnit_
MonitorElement * meTrackOutermostHitZ_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< edm::ValueMap< float > > t0PidToken_
MonitorElement * meTrackMatchedTPEffPtEtl2Mtd_
MonitorElement * meTrackMatchedTPmtdEffPtMtd_
edm::EDGetTokenT< FTLRecHitCollection > btlRecHitsToken_
MonitorElement * meETLTrackMatchedTPPtRatioMtd_
MonitorElement * meTrackMVAQual_
MonitorElement * meETLTrackEffPhiTot_[2]
float localY(const float mpY) const override
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
const std::vector< const DetLayer * > & allBTLLayers() const
return the BTL DetLayers (barrel), inside-out
edm::EDGetTokenT< edm::ValueMap< float > > SigmatmtdToken_
const bool trkRecSelLowPt(const reco::TrackBase &)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleCollectionToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * meTrackNumHitsNT_
edm::EDGetTokenT< edm::ValueMap< float > > SigmaTofPiToken_
Log< level::Info, false > LogInfo
double eta() const
pseudorapidity of momentum vector
const float trackMinEtlEta_
edm::EDGetTokenT< reco::SimToRecoCollection > simToRecoAssociationToken_
MonitorElement * meTrackOutermostHitR_
MonitorElement * meTrackEtaTot_
static constexpr double etaMatchCut_
static constexpr double zETL_
static constexpr double depositETLthreshold_
MonitorElement * meTrackMatchedTPEffEtaEtl2Mtd_
unsigned long long uint64_t
MonitorElement * meTrackMatchedTPEffPtMtd_
constexpr uint32_t rawId() const
get the raw id
MonitorElement * meBTLTrackMatchedTPDPtvsPtGen_
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
void add(std::string const &label, ParameterSetDescription const &psetDescription)
MonitorElement * meTrackSigmat0SafePid_
edm::EDGetTokenT< edm::ValueMap< float > > SigmaTofKToken_
MonitorElement * meETLTrackEffEtaMtd_[2]
MonitorElement * meTrackSigmat0Pid_
MonitorElement * meTrackMatchedTPmtdEffPtTot_
MonitorElement * meBTLTrackEffPtMtd_
MonitorElement * meTrackt0Src_
edm::EDGetTokenT< edm::ValueMap< float > > Sigmat0PidToken_
MonitorElement * meTracktmtd_
MonitorElement * meBTLTrackEffPtTot_
MonitorElement * meTrackPathLenghtvsEta_
MonitorElement * meTrackMatchedTPEffPtTot_
Detector identifier class for the Endcap Timing Layer.
MonitorElement * meETLTrackMatchedTPPtResMtd_
MonitorElement * meTrackPullTot_
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
MonitorElement * meETLTrackMatchedTPPtRatioGen_
MonitorElement * meExtraPtMtd_
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
MonitorElement * meExtraPhiAtBTLmatched_
edm::EDGetTokenT< reco::RecoToSimCollection > recoToSimAssociationToken_
Monte Carlo truth information used for tracking validation.
MonitorElement * meBTLTrackMatchedTPPtRatioGen_
edm::EDGetTokenT< edm::ValueMap< float > > Sigmat0SrcToken_
MonitorElement * meETLTrackEffPtMtd_[2]
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
~MtdTracksValidation() override
MonitorElement * meExtraPtEtl2Mtd_
BTLDetId::CrysLayout crysLayoutFromTopoMode(const int &topoMode)
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > mtdgeoToken_
MonitorElement * meTrackPtTot_
Log< level::Warning, false > LogWarning
auto makeValid(const U &iOtherHandleType) noexcept(false)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * meETLTrackMatchedTP2DPtvsPtMtd_
MonitorElement * meETLTrackEffEtaMtdLowPt_[2]
MonitorElement * meTrackSigmat0Src_
const std::vector< const DetLayer * > & allETLLayers() const
return the ETL DetLayers (endcap), -Z to +Z
static constexpr double pTcutBTL_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
MonitorElement * meTrackSigmaTofvsP_[3]
edm::EDGetTokenT< edm::ValueMap< float > > Sigmat0SafePidToken_
MtdTracksValidation(const edm::ParameterSet &)
MonitorElement * meETLTrackEffEtaTotLowPt_[2]
MonitorElement * meExtraPhiAtBTL_