72 #include "HepMC/GenRanges.h" 73 #include "CLHEP/Units/PhysicalConstants.h" 102 return (
b << 32) |
a;
104 return (
a << 32) |
b;
255 trackMinPt_(iConfig.getParameter<double>(
"trackMinimumPt")),
256 trackMaxBtlEta_(iConfig.getParameter<double>(
"trackMaximumBtlEta")),
257 trackMinEtlEta_(iConfig.getParameter<double>(
"trackMinimumEtlEta")),
258 trackMaxEtlEta_(iConfig.getParameter<double>(
"trackMaximumEtlEta")) {
284 mtdgeoToken_ = esConsumes<MTDGeometry, MTDDigiGeometryRecord>();
286 mtdlayerToken_ = esConsumes<MTDDetLayerGeometry, MTDRecoGeometryRecord>();
287 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;
307 std::map<TrackingParticleRef, std::vector<uint32_t>> m_tp2detid;
321 const auto& primRecoVtx = *(RecVertexHandle.product()->begin());
326 double zsim =
convertMmToCm((*(
mc->vertices_begin()))->position().z());
327 double tsim = (*(
mc->vertices_begin()))->position().t() * CLHEP::mm / CLHEP::c_light;
333 s2r_ = simToRecoH.product();
336 r2s_ = recoToSimH.product();
342 for (
auto const&
simHit : btlSimHits) {
347 m_btlTrkPerCell[
id.rawId()].insert(thisHId);
348 auto simHitIt = m_btlHits.emplace(
id.
rawId(),
MTDHit()).first;
355 for (
auto const&
simHit : etlSimHits) {
361 m_etlTrkPerCell[
id.rawId()].insert(thisHId);
362 auto simHitIt = m_etlHits.emplace(
id.
rawId(),
MTDHit()).first;
372 for (
auto tp = tpColl.begin();
tp != tpColl.end();
tp++, ++tpindex) {
374 if (
tp->eventId().bunchCrossing() == 0 &&
tp->eventId().event() == 0) {
377 for (
const auto& simTrk :
tp->g4Tracks()) {
378 auto const thisTId =
uniqueId(simTrk.trackId(), simTrk.eventId());
379 for (
auto const& cell : m_btlTrkPerCell) {
383 for (
auto const& simtrack : cell.second) {
384 if (thisTId == simtrack) {
385 m_tp2detid[tpref].emplace_back(cell.first);
390 for (
auto const& cell : m_etlTrkPerCell) {
394 for (
auto const& simtrack : cell.second) {
395 if (thisTId == simtrack) {
396 m_tp2detid[tpref].emplace_back(cell.first);
405 unsigned int index = 0;
408 const bool isGoodVtx =
std::abs(primRecoVtx.z() - zsim) <
deltaZcut_ || primRecoVtx.isFake();
411 for (
const auto& trackGen : *GenRecTrackHandle) {
415 if (trackAssoc[trackref] == -1) {
416 LogInfo(
"mtdTracks") <<
"Extended track not associated";
425 bool twoETLdiscs =
false;
430 if (std::round(SigmatMtd[trackref] - Sigmat0Pid[trackref]) != 0) {
432 <<
"TimeError associated to refitted track is different from TimeError stored in tofPID " 433 "sigmat0 ValueMap: this should not happen";
454 int numMTDBtlvalidhits = 0;
455 for (
const auto hit :
track.recHits()) {
456 if (
hit->isValid() ==
false)
459 if ((
Hit.det() == 6) && (
Hit.subdetId() == 1) && (
Hit.mtdSubDetector() == 1)) {
461 numMTDBtlvalidhits++;
467 if (MTDBtl ==
true) {
475 if (isBTL && Sigmat0Safe[trackref] < 0.) {
494 bool MTDEtlZnegD1 =
false;
495 bool MTDEtlZnegD2 =
false;
496 bool MTDEtlZposD1 =
false;
497 bool MTDEtlZposD2 =
false;
498 int numMTDEtlvalidhits = 0;
499 for (
const auto hit :
track.recHits()) {
500 if (
hit->isValid() ==
false)
503 if ((
Hit.det() == 6) && (
Hit.subdetId() == 1) && (
Hit.mtdSubDetector() == 2)) {
507 if ((ETLHit.
zside() == -1) && (ETLHit.
nDisc() == 1)) {
511 numMTDEtlvalidhits++;
513 if ((ETLHit.
zside() == -1) && (ETLHit.
nDisc() == 2)) {
517 numMTDEtlvalidhits++;
519 if ((ETLHit.
zside() == 1) && (ETLHit.
nDisc() == 1)) {
523 numMTDEtlvalidhits++;
525 if ((ETLHit.
zside() == 1) && (ETLHit.
nDisc() == 2)) {
529 numMTDEtlvalidhits++;
534 if (
isETL && Sigmat0Safe[trackref] < 0.) {
540 twoETLdiscs = (MTDEtlZnegD1 ==
true) && (MTDEtlZnegD2 ==
true);
541 if ((MTDEtlZnegD1 ==
true) || (MTDEtlZnegD2 ==
true)) {
553 twoETLdiscs = (MTDEtlZposD1 ==
true) && (MTDEtlZposD2 ==
true);
554 if ((MTDEtlZposD1 ==
true) || (MTDEtlZposD2 ==
true)) {
568 <<
" BTL " << isBTL <<
" ETL " <<
isETL <<
" 2disks " << twoETLdiscs;
577 if (tp_info !=
nullptr &&
mvaTPSel(**tp_info)) {
578 if (
track.pt() < 12.) {
581 std::abs(trackGen.pt() - (*tp_info)->pt()));
585 (*tp_info)->pt(),
std::abs(
track.pt() - (*tp_info)->pt()) /
std::abs(trackGen.pt() - (*tp_info)->pt()));
587 (trackGen.pt() - (*tp_info)->pt()) / (*tp_info)->pt());
590 if (
isETL && !twoETLdiscs) {
592 std::abs(trackGen.pt() - (*tp_info)->pt()));
596 (*tp_info)->pt(),
std::abs(
track.pt() - (*tp_info)->pt()) /
std::abs(trackGen.pt() - (*tp_info)->pt()));
598 (trackGen.pt() - (*tp_info)->pt()) / ((*tp_info)->pt()));
600 (
track.pt() - (*tp_info)->pt()) / ((*tp_info)->pt()));
602 if (
isETL && twoETLdiscs) {
604 std::abs(trackGen.pt() - (*tp_info)->pt()));
608 (*tp_info)->pt(),
std::abs(
track.pt() - (*tp_info)->pt()) /
std::abs(trackGen.pt() - (*tp_info)->pt()));
610 (trackGen.pt() - (*tp_info)->pt()) / ((*tp_info)->pt()));
612 (
track.pt() - (*tp_info)->pt()) / ((*tp_info)->pt()));
615 const bool withMTD = (m_tp2detid.find(*tp_info) != m_tp2detid.end());
616 LogDebug(
"MtdTracksValidation") <<
"Matched with selected TP, MTD sim hits association: " << withMTD;
627 if (isBTL ||
isETL) {
630 if (isBTL || twoETLdiscs) {
638 if (isBTL || twoETLdiscs) {
672 <<
"MtdTracksValidation: extender fail in " <<
iEvent.id().run() <<
" " <<
iEvent.id().event()
673 <<
" pt= " << trackGen.pt() <<
" eta= " << trackGen.eta();
685 const bool vtxFake = primRecoVtx.isFake();
687 if (
mvaRecSel(trackGen, primRecoVtx, t0Safe[trackref], Sigmat0Safe[trackref])) {
695 double dZ = trackGen.vz() - zsim;
697 double pullT(-9999.);
698 if (Sigmat0Safe[trackref] != -1.) {
699 dT = t0Safe[trackref] - tsim;
700 pullT = dT / Sigmat0Safe[trackref];
702 for (
const auto& genP :
mc->particle_range()) {
715 if (isBTL ||
isETL) {
760 auto tTrack = ttrackBuilder->build(
track);
764 std::unique_ptr<MeasurementEstimator> theEstimator =
772 <<
"MtdTracksValidation: extrapolating track, pt= " <<
track.pt() <<
" eta= " <<
track.eta();
777 const std::vector<const DetLayer*>& layersBTL = layerGeo->
allBTLLayers();
778 for (
const DetLayer* ilay : layersBTL) {
779 std::pair<bool, TrajectoryStateOnSurface>
comp = ilay->compatible(tsos, prop, *theEstimator);
784 extrho =
comp.second.globalPosition().perp();
785 exteta =
comp.second.globalPosition().eta();
786 extphi =
comp.second.globalPosition().phi();
787 edm::LogVerbatim(
"MtdTracksValidation") <<
"MtdTracksValidation: extrapolation at BTL surface, rho= " << extrho
788 <<
" eta= " << exteta <<
" phi= " << extphi;
790 std::vector<DetLayer::DetWithState> compDets = ilay->compatibleDets(tsos, prop, *theEstimator);
791 for (
const auto& detWithState : compDets) {
792 const auto& det = detWithState.first;
797 <<
"MtdTracksValidation: DetId= " << det->geographicalId().rawId()
798 <<
" gp= " << detWithState.second.globalPosition().x() <<
" " << detWithState.second.globalPosition().y()
799 <<
" " << detWithState.second.globalPosition().z() <<
" rho= " << detWithState.second.globalPosition().perp()
800 <<
" eta= " << detWithState.second.globalPosition().eta()
801 <<
" phi= " << detWithState.second.globalPosition().phi();
803 for (
const auto&
recHit : *btlRecHitsHandle) {
807 if (thedet ==
nullptr)
808 throw cms::Exception(
"MtdTracksValidation") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" (" 809 <<
detId.rawId() <<
") is invalid!" <<
std::dec << std::endl;
810 if (geoId == det->geographicalId()) {
816 const auto& global_point = thedet->
toGlobal(local_point);
818 <<
"MtdTracksValidation: Hit id= " <<
detId.rawId() <<
" ene= " <<
recHit.energy()
819 <<
" dr= " <<
reco::deltaR(global_point, detWithState.second.globalPosition());
821 eneSum +=
recHit.energy();
834 <<
"MtdTracksValidation: BTL matched, energy= " << eneSum <<
" #layers= " <<
nlayers;
843 const std::vector<const DetLayer*>& layersETL = layerGeo->
allETLLayers();
844 for (
const DetLayer* ilay : layersETL) {
847 const double diskZ = disk.position().z();
850 std::pair<bool, TrajectoryStateOnSurface>
comp = ilay->compatible(tsos, prop, *theEstimator);
855 extrho =
comp.second.globalPosition().perp();
856 exteta =
comp.second.globalPosition().eta();
857 extphi =
comp.second.globalPosition().phi();
859 edm::LogVerbatim(
"MtdTracksValidation") <<
"MtdTracksValidation: extrapolation at ETL surface, rho= " << extrho
860 <<
" eta= " << exteta <<
" phi= " << extphi;
861 std::vector<DetLayer::DetWithState> compDets = ilay->compatibleDets(tsos, prop, *theEstimator);
862 for (
const auto& detWithState : compDets) {
863 const auto& det = detWithState.first;
868 <<
"MtdTracksValidation: DetId= " << det->geographicalId().rawId()
869 <<
" gp= " << detWithState.second.globalPosition().x() <<
" " << detWithState.second.globalPosition().y()
870 <<
" " << detWithState.second.globalPosition().z() <<
" rho= " << detWithState.second.globalPosition().perp()
871 <<
" eta= " << detWithState.second.globalPosition().eta()
872 <<
" phi= " << detWithState.second.globalPosition().phi();
874 for (
const auto&
recHit : *etlRecHitsHandle) {
878 if (thedet ==
nullptr)
879 throw cms::Exception(
"MtdTracksValidation") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" (" 880 <<
detId.rawId() <<
") is invalid!" <<
std::dec << std::endl;
881 if (geoId == det->geographicalId()) {
886 const auto& global_point = thedet->
toGlobal(local_point);
888 <<
"MtdTracksValidation: Hit id= " <<
detId.rawId() <<
" time= " <<
recHit.time()
889 <<
" dr= " <<
reco::deltaR(global_point, detWithState.second.globalPosition());
903 selvar = (
float)hcount;
906 <<
"MtdTracksValidation: ETL matched, counts= " << hcount <<
" #layers= " <<
nlayers;
910 if (!inBTL && !inETL) {
912 <<
"MtdTracksValidation: track not extrapolating to MTD: pt= " <<
track.pt() <<
" eta= " <<
track.eta()
913 <<
" phi= " <<
track.phi() <<
" vz= " <<
track.vz()
927 ibook.
book1D(
"TrackBTLEffPhiTot",
"Track efficiency vs phi (Tot);#phi_{RECO} [rad]", 100, -3.2, 3.2);
931 ibook.
book1D(
"TrackBTLEffPhiMtd",
"Track efficiency vs phi (Mtd);#phi_{RECO} [rad]", 100, -3.2, 3.2);
934 ibook.
book1D(
"TrackBTLPtRes",
"Track pT resolution ;pT_{Gentrack}-pT_{MTDtrack}/pT_{Gentrack} ", 100, -0.1, 0.1);
937 ibook.
book1D(
"TrackETLEffEtaTotZneg",
"Track efficiency vs eta (Tot) (-Z);#eta_{RECO}", 100, -3.2, -1.4);
939 ibook.
book1D(
"TrackETLEffEtaTotZpos",
"Track efficiency vs eta (Tot) (+Z);#eta_{RECO}", 100, 1.4, 3.2);
941 ibook.
book1D(
"TrackETLEffPhiTotZneg",
"Track efficiency vs phi (Tot) (-Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
943 ibook.
book1D(
"TrackETLEffPhiTotZpos",
"Track efficiency vs phi (Tot) (+Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
945 ibook.
book1D(
"TrackETLEffPtTotZneg",
"Track efficiency vs pt (Tot) (-Z);pt_{RECO} [GeV]", 50, 0, 10);
947 ibook.
book1D(
"TrackETLEffPtTotZpos",
"Track efficiency vs pt (Tot) (+Z);pt_{RECO} [GeV]", 50, 0, 10);
949 ibook.
book1D(
"TrackETLEffEtaMtdZneg",
"Track efficiency vs eta (Mtd) (-Z);#eta_{RECO}", 100, -3.2, -1.4);
951 ibook.
book1D(
"TrackETLEffEtaMtdZpos",
"Track efficiency vs eta (Mtd) (+Z);#eta_{RECO}", 100, 1.4, 3.2);
953 ibook.
book1D(
"TrackETLEffPhiMtdZneg",
"Track efficiency vs phi (Mtd) (-Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
955 ibook.
book1D(
"TrackETLEffPhiMtdZpos",
"Track efficiency vs phi (Mtd) (+Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
957 ibook.
book1D(
"TrackETLEffPtMtdZneg",
"Track efficiency vs pt (Mtd) (-Z);pt_{RECO} [GeV]", 50, 0, 10);
959 ibook.
book1D(
"TrackETLEffPtMtdZpos",
"Track efficiency vs pt (Mtd) (+Z);pt_{RECO} [GeV]", 50, 0, 10);
961 ibook.
book1D(
"TrackETLEffEta2MtdZneg",
"Track efficiency vs eta (Mtd 2 hit) (-Z);#eta_{RECO}", 100, -3.2, -1.4);
963 ibook.
book1D(
"TrackETLEffEta2MtdZpos",
"Track efficiency vs eta (Mtd 2 hit) (+Z);#eta_{RECO}", 100, 1.4, 3.2);
965 "TrackETLEffPhi2MtdZneg",
"Track efficiency vs phi (Mtd 2 hit) (-Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
967 "TrackETLEffPhi2MtdZpos",
"Track efficiency vs phi (Mtd 2 hit) (+Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
969 ibook.
book1D(
"TrackETLEffPt2MtdZneg",
"Track efficiency vs pt (Mtd 2 hit) (-Z);pt_{RECO} [GeV]", 50, 0, 10);
971 ibook.
book1D(
"TrackETLEffPt2MtdZpos",
"Track efficiency vs pt (Mtd 2 hit) (+Z);pt_{RECO} [GeV]", 50, 0, 10);
973 ibook.
book1D(
"TrackETLPtRes",
"Track pT resolution;pT_{Gentrack}-pT_{MTDtrack}/pT_{Gentrack} ", 100, -0.1, 0.1);
975 meTracktmtd_ = ibook.
book1D(
"Tracktmtd",
"Track time from TrackExtenderWithMTD;tmtd [ns]", 150, 1, 16);
976 meTrackt0Src_ = ibook.
book1D(
"Trackt0Src",
"Track time from TrackExtenderWithMTD;t0Src [ns]", 100, -1.5, 1.5);
978 ibook.
book1D(
"TrackSigmat0Src",
"Time Error from TrackExtenderWithMTD; #sigma_{t0Src} [ns]", 100, 0, 0.1);
980 meTrackt0Pid_ = ibook.
book1D(
"Trackt0Pid",
"Track t0 as stored in TofPid;t0 [ns]", 100, -1, 1);
984 ibook.
book1D(
"TrackSigmat0SafePID",
"Sigmat0 Safe as stored in TofPid; #sigma_{t0} [ns]", 100, 0, 0.1);
985 meTrackNumHits_ = ibook.
book1D(
"TrackNumHits",
"Number of valid MTD hits per track ; Number of hits", 10, -5, 5);
987 "TrackNumHitsNT",
"Number of valid MTD hits per track no time associated; Number of hits", 10, -5, 5);
988 meTrackMVAQual_ = ibook.
book1D(
"TrackMVAQual",
"Track MVA Quality as stored in Value Map ; MVAQual", 100, 0, 1);
990 "TrackPathLenghtvsEta",
"MTD Track pathlength vs MTD track Eta;|#eta|;Pathlength", 100, 0, 3.2, 100.0, 400.0,
"S");
994 ibook.
book1D(
"MVAMatchedEffPtTot",
"Pt of tracks associated to LV matched to GEN; track pt [GeV] ", 110, 0., 11.);
996 "MVAMatchedEffPtMtd",
"Pt of tracks associated to LV matched to GEN with time; track pt [GeV] ", 110, 0., 11.);
998 meExtraPtMtd_ = ibook.
book1D(
"ExtraPtMtd",
"Pt of tracks extrapolated to hits; track pt [GeV] ", 110, 0., 11.);
1000 ibook.
book1D(
"ExtraPtEtl2Mtd",
"Pt of tracks extrapolated to hits, 2 ETL layers; track pt [GeV] ", 110, 0., 11.);
1002 meTrackPtTot_ = ibook.
book1D(
"TrackPtTot",
"Pt of tracks ; track pt [GeV] ", 110, 0., 11.);
1004 ibook.
book1D(
"MatchedTPEffPtTot",
"Pt of tracks matched to TP; track pt [GeV] ", 110, 0., 11.);
1006 ibook.
book1D(
"MatchedTPEffPtMtd",
"Pt of tracks matched to TP with time; track pt [GeV] ", 110, 0., 11.);
1008 "MatchedTPEffPtEtl2Mtd",
"Pt of tracks matched to TP with time, 2 ETL hits; track pt [GeV] ", 110, 0., 11.);
1011 "TrackMatchedTPBTLPtResMtd",
1012 "Pt resolution of tracks matched to TP-BTL hit ;|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1017 "TrackMatchedTPETLPtResMtd",
1018 "Pt resolution of tracks matched to TP-ETL hit ;|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1023 "TrackMatchedTPETL2PtResMtd",
1024 "Pt resolution of tracks matched to TP-ETL 2hits ;|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1029 "TrackMatchedTPBTLPtRatioGen",
"Pt ratio of Gentracks (BTL) ;pT_{Gentrack}/pT_{truth} ", 100, 0.9, 1.1);
1031 "TrackMatchedTPETLPtRatioGen",
"Pt ratio of Gentracks (ETL 1hit) ;pT_{Gentrack}/pT_{truth} ", 100, 0.9, 1.1);
1033 "TrackMatchedTPETL2PtRatioGen",
"Pt ratio of Gentracks (ETL 2hits) ;pT_{Gentrack}/pT_{truth} ", 100, 0.9, 1.1);
1035 "Pt ratio of tracks matched to TP-BTL hits ;pT_{MTDtrack}/pT_{truth} ",
1040 "Pt ratio of tracks matched to TP-ETL hits ;pT_{MTDtrack}/pT_{truth} ",
1045 ibook.
book1D(
"TrackMatchedTPETL2PtRatioMtd",
1046 "Pt ratio of tracks matched to TP-ETL 2hits ;pT_{MTDtrack}/pT_{truth} ",
1051 "Pt resolution of tracks matched to TP-BTL hit vs Pt;pT_{truth} " 1052 "[GeV];|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1060 "Pt resolution of tracks matched to TP-ETL hit vs Pt;pT_{truth} " 1061 "[GeV];|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1069 ibook.
bookProfile(
"TrackMatchedTPETL2PtResvsPtMtd",
1070 "Pt resolution of tracks matched to TP-ETL 2hits Pt pT;pT_{truth} " 1071 "[GeV];|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1079 "TrackMatchedTPBTLDPtvsPtGen",
1080 "Pt relative difference of Gentracks (BTL) vs Pt;pT_{truth} [GeV];pT_{Gentrack}-pT_{truth}/pT_{truth} ",
1088 "TrackMatchedTPETLDPtvsPtGen",
1089 "Pt relative difference of Gentracks (ETL 1hit) vs Pt;pT_{truth} [GeV];pT_{Gentrack}-pT_{truth}/pT_{truth} ",
1097 "TrackMatchedTPETL2DPtvsPtGen",
1098 "Pt relative difference of Gentracks (ETL 2hits) vs Pt;pT_{truth} [GeV];pT_{Gentrack}-pT_{truth}/pT_{truth} ",
1106 "Pt relative difference of tracks matched to TP-BTL hits vs " 1107 "Pt;pT_{truth} [GeV];pT_{MTDtrack}-pT_{truth}/pT_{truth} ",
1115 "Pt relative difference of tracks matched to TP-ETL hits vs " 1116 "Pt;pT_{truth} [GeV];pT_{MTDtrack}-pT_{truth}/pT_{truth} ",
1124 "Pt relative difference of tracks matched to TP-ETL 2hits vs " 1125 "Pt;pT_{truth} [GeV];pT_{MTDtrack}-pT_{truth}/pT_{truth} ",
1134 ibook.
book1D(
"MatchedTPmtdEffPtTot",
"Pt of tracks matched to TP-mtd hit; track pt [GeV] ", 110, 0., 11.);
1136 "MatchedTPmtdEffPtMtd",
"Pt of tracks matched to TP-mtd hit with time; track pt [GeV] ", 110, 0., 11.);
1140 ibook.
book1D(
"MVAMatchedEffEtaTot",
"Eta of tracks associated to LV matched to GEN; track eta ", 66, 0., 3.3);
1142 "MVAMatchedEffEtaMtd",
"Eta of tracks associated to LV matched to GEN with time; track eta ", 66, 0., 3.3);
1144 meExtraEtaMtd_ = ibook.
book1D(
"ExtraEtaMtd",
"Eta of tracks extrapolated to hits; track eta ", 66, 0., 3.3);
1146 ibook.
book1D(
"ExtraEtaEtl2Mtd",
"Eta of tracks extrapolated to hits, 2 ETL layers; track eta ", 66, 0., 3.3);
1150 ibook.
book1D(
"MatchedTPEffEtaTot",
"Eta of tracks matched to TP; track eta ", 66, 0., 3.3);
1153 ibook.
book1D(
"MatchedTPEffEtaMtd",
"Eta of tracks matched to TP with time; track eta ", 66, 0., 3.3);
1155 "MatchedTPEffEtaEtl2Mtd",
"Eta of tracks matched to TP with time, 2 ETL hits; track eta ", 66, 0., 3.3);
1158 ibook.
book1D(
"MatchedTPmtdEffEtaTot",
"Eta of tracks matched to TP-mtd hit; track eta ", 66, 0., 3.3);
1160 ibook.
book1D(
"MatchedTPmtdEffEtaMtd",
"Eta of tracks matched to TP-mtd hit with time; track eta ", 66, 0., 3.3);
1163 "MVATrackRes",
"t_{rec} - t_{sim} for LV associated tracks; t_{rec} - t_{sim} [ns] ", 120, -0.15, 0.15);
1165 ibook.
book1D(
"MVATrackPull",
"Pull for associated tracks; (t_{rec}-t_{sim})/#sigma_{t}", 50, -5., 5.);
1167 "MVATrackZposResTot",
"Z_{PCA} - Z_{sim} for associated tracks;Z_{PCA} - Z_{sim} [cm] ", 100, -0.1, 0.1);
1170 ibook.
book1D(
"ExtraPhiAtBTL",
"Phi at BTL surface of extrapolated tracks; phi [deg]", 720, -180., 180.);
1172 "Phi at BTL surface of extrapolated tracksi matched with BTL hits; phi [deg]",
1177 "ExtraBTLeneInCone",
"BTL reconstructed energy in cone arounnd extrapolated track; E [MeV]", 100, 0., 50.);
1179 ibook.
book1D(
"ExtraMTDfailExtenderEta",
1180 "Eta of tracks extrapolated to MTD with no track extender match to hits; track eta",
1186 ibook.
book1D(
"ExtraMTDfailExtenderPt",
1187 "Pt of tracks extrapolated to MTD with no track extender match to hits; track pt [GeV] ",
1214 ->setComment(
"Association between General and MTD Extended tracks");
1221 desc.add<
double>(
"trackMinimumPt", 0.7);
1222 desc.add<
double>(
"trackMaximumBtlEta", 1.5);
1223 desc.add<
double>(
"trackMinimumEtlEta", 1.6);
1224 desc.add<
double>(
"trackMaximumEtlEta", 3.);
1225 desc.addUntracked<
bool>(
"optionalPlots",
true);
1227 descriptions.
add(
"mtdTracksValid",
desc);
1232 if (
gp.status() != 1) {
1241 if (
tp.status() != 1) {
1244 auto x_pv =
tp.parentVertex()->position().x();
1245 auto y_pv =
tp.parentVertex()->position().y();
1246 auto z_pv =
tp.parentVertex()->position().z();
1248 auto r_pv =
std::sqrt(x_pv * x_pv + y_pv * y_pv);
1257 const double& st0) {
1270 const bool& vtxFake) {
1273 double genPT = genP.momentum().perp();
1287 for (
const auto&
tp :
found->val) {
1288 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 * meMVATrackResTot_
MonitorElement * meETLTrackMatchedTPPtResvsPtMtd_
MonitorElement * meTrackNumHits_
MonitorElement * meTrackt0Pid_
MonitorElement * meExtraMTDfailExtenderEta_
static constexpr double pTcut_
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 * 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_
edm::EDGetTokenT< edm::HepMCProduct > HepMCProductToken_
HepPDT::ParticleDataTable ParticleDataTable
MonitorElement * meMVATrackMatchedEffEtaMtd_
const bool mvaRecSel(const reco::TrackBase &, const reco::Vertex &, const double &, const double &)
virtual const Topology & topology() const
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > builderToken_
constexpr NumType convertRadToDeg(NumType radians)
virtual const PixelTopology & specificTopology() const
MonitorElement * meETLTrackMatchedTP2PtResvsPtMtd_
static constexpr double etacutREC_
static constexpr double deltaPTcut_
MonitorElement * meBTLTrackPtRes_
edm::EDGetTokenT< std::vector< reco::Vertex > > RecVertexToken_
MonitorElement * meETLTrackEffPtTot_[2]
MonitorElement * meBTLTrackEffEtaMtd_
MonitorElement * meETLTrackEffPhi2Mtd_[2]
edm::EDGetTokenT< edm::ValueMap< float > > tmtdToken_
MonitorElement * meExtraBTLeneInCone_
MonitorElement * meExtraMTDfailExtenderPt_
MonitorElement * meMVATrackMatchedEffPtTot_
MonitorElement * meMVATrackEffPtTot_
MonitorElement * meExtraEtaMtd_
MonitorElement * meMVATrackEffEtaTot_
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
const bool mvaGenSel(const HepMC::GenParticle &, const float &)
Detector identifier base class for the MIP Timing Layer.
const bool mvaTPSel(const TrackingParticle &)
MonitorElement * meETLTrackMatchedTP2PtRatioGen_
constexpr NumType convertUnitsTo(double desiredUnits, NumType val)
edm::EDGetTokenT< reco::TrackCollection > GenRecTrackToken_
MonitorElement * meETLTrackEffPhiMtd_[2]
const_iterator end() const
last iterator over the map (read only)
double pt() const
track transverse momentum
edm::EDGetTokenT< reco::TrackCollection > RecTrackToken_
MonitorElement * meExtraEtaEtl2Mtd_
MonitorElement * meBTLTrackEffPhiTot_
edm::ESGetToken< MTDDetLayerGeometry, MTDRecoGeometryRecord > mtdlayerToken_
GlobalPoint globalPosition() const
MonitorElement * meTrackMatchedTPmtdEffEtaMtd_
MonitorElement * meTrackMatchedTPEffEtaTot_
float localX(const float mpX) const override
edm::EDGetTokenT< FTLRecHitCollection > etlRecHitsToken_
MonitorElement * meBTLTrackRPTime_
double vz() const
z coordinate of the reference point on track
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())
MonitorElement * meETLTrackMatchedTPDPtvsPtGen_
MonitorElement * meTrackt0SafePid_
MonitorElement * meBTLTrackEffEtaTot_
MonitorElement * meETLTrackMatchedTPDPtvsPtMtd_
static constexpr double deltaZcut_
Abs< T >::type abs(const T &t)
bool isETL(const double eta) const
bool isMatched(TrackingRecHit const &hit)
MonitorElement * meBTLTrackMatchedTPPtResvsPtMtd_
#define DEFINE_FWK_MODULE(type)
int nrows() const override
MonitorElement * meMVATrackMatchedEffEtaTot_
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_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
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_
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleCollectionToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * meTrackNumHitsNT_
Log< level::Info, false > LogInfo
double eta() const
pseudorapidity of momentum vector
const float trackMinEtlEta_
constexpr NumType convertMmToCm(NumType millimeters)
edm::EDGetTokenT< reco::SimToRecoCollection > simToRecoAssociationToken_
MonitorElement * meTrackEtaTot_
static constexpr double etaMatchCut_
static constexpr double zETL_
static constexpr double depositETLthreshold_
MonitorElement * meTrackMatchedTPEffEtaEtl2Mtd_
unsigned long long uint64_t
MonitorElement * meMVATrackPullTot_
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
edm::EDGetTokenT< CrossingFrame< PSimHit > > etlSimHitsToken_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
MonitorElement * meTrackSigmat0SafePid_
MonitorElement * meETLTrackEffEtaMtd_[2]
const Vector & momentum() const
track momentum vector
MonitorElement * meTrackSigmat0Pid_
edm::EDGetTokenT< CrossingFrame< PSimHit > > btlSimHitsToken_
MonitorElement * meTrackMatchedTPmtdEffPtTot_
MonitorElement * meBTLTrackEffPtMtd_
MonitorElement * meTrackt0Src_
edm::EDGetTokenT< edm::ValueMap< float > > Sigmat0PidToken_
static constexpr double deltaDRcut_
MonitorElement * meTracktmtd_
MonitorElement * meBTLTrackEffPtTot_
MonitorElement * meTrackPathLenghtvsEta_
MonitorElement * meTrackMatchedTPEffPtTot_
Detector identifier class for the Endcap Timing Layer.
MonitorElement * meETLTrackMatchedTPPtResMtd_
const bool mvaGenRecMatch(const HepMC::GenParticle &, const double &, const reco::TrackBase &, const bool &)
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_
std::vector< TrackingParticle > TrackingParticleCollection
MonitorElement * meTrackPtTot_
MonitorElement * meMVATrackZposResTot_
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 * meMVATrackMatchedEffPtMtd_
MonitorElement * meTrackSigmat0Src_
const std::vector< const DetLayer * > & allETLLayers() const
return the ETL DetLayers (endcap), -Z to +Z
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
edm::EDGetTokenT< edm::ValueMap< float > > Sigmat0SafePidToken_
MtdTracksValidation(const edm::ParameterSet &)
edm::ESGetToken< HepPDT::ParticleDataTable, edm::DefaultRecord > particleTableToken_
MonitorElement * meExtraPhiAtBTL_