Skip to content

Commit

Permalink
Merge pull request #32476 from gsorrentino18/gs-validationupdate
Browse files Browse the repository at this point in the history
ETL Validation code update and fixes
  • Loading branch information
cmsbuild committed Dec 17, 2020
2 parents f039e3b + 3654de0 commit 284a188
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 264 deletions.
2 changes: 1 addition & 1 deletion RecoLocalFastTime/FTLRecProducers/python/mtdRecHits_cfi.py
Expand Up @@ -14,7 +14,7 @@
)

from Configuration.Eras.Modifier_phase2_etlV4_cff import phase2_etlV4
phase2_etlV4.toModify(_endcapAlgo, thresholdToKeep = 0.005, calibrationConstant = 0.001 )
phase2_etlV4.toModify(_endcapAlgo, thresholdToKeep = 0.005, calibrationConstant = 0.015 )

mtdRecHits = cms.EDProducer(
"MTDRecHitProducer",
Expand Down
2 changes: 1 addition & 1 deletion SimFastTiming/FastTimingCommon/python/mtdDigitizer_cfi.py
Expand Up @@ -85,7 +85,7 @@
)

from Configuration.Eras.Modifier_phase2_etlV4_cff import phase2_etlV4
phase2_etlV4.toModify(_endcap_MTDDigitizer.DeviceSimulation, meVPerMIP = 0.001 )
phase2_etlV4.toModify(_endcap_MTDDigitizer.DeviceSimulation, meVPerMIP = 0.015 )

from Configuration.ProcessModifiers.premix_stage1_cff import premix_stage1
for _m in [_barrel_MTDDigitizer, _endcap_MTDDigitizer]:
Expand Down
15 changes: 9 additions & 6 deletions Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc
Expand Up @@ -109,7 +109,7 @@ void EtlDigiHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSe
for (const auto& dataFrame : *etlDigiHitsHandle) {
// --- Get the on-time sample
int isample = 2;

double weight = 1.0;
const auto& sample = dataFrame.sample(isample);
ETLDetId detId = dataFrame.id();
DetId geoId = detId.geographicalId();
Expand Down Expand Up @@ -138,6 +138,9 @@ void EtlDigiHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSe
}

if (topo2Dis) {
if (detId.discSide() == 1) {
weight = -weight;
}
if ((detId.zside() == -1) && (detId.nDisc() == 1)) {
idet = 0;
} else if ((detId.zside() == -1) && (detId.nDisc() == 2)) {
Expand All @@ -153,7 +156,7 @@ void EtlDigiHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSe

meHitCharge_[idet]->Fill(sample.data());
meHitTime_[idet]->Fill(sample.toa());
meOccupancy_[idet]->Fill(global_point.x(), global_point.y());
meOccupancy_[idet]->Fill(global_point.x(), global_point.y(), weight);

meHitX_[idet]->Fill(global_point.x());
meHitY_[idet]->Fill(global_point.y());
Expand Down Expand Up @@ -283,11 +286,11 @@ void EtlDigiHitsValidation::bookHistograms(DQMStore::IBooker& ibook,
"EtlHitYZposD1", "ETL DIGI hits Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{DIGI} [cm]", 100, -130., 130.);
meHitY_[3] = ibook.book1D("EtlHitYZposD2", "ETL DIGI hits Y (+Z, Second disk);Y_{DIGI} [cm]", 100, -130., 130.);
meHitZ_[0] = ibook.book1D(
"EtlHitZZnegD1", "ETL DIGI hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{DIGI} [cm]", 100, -304.2, -303.4);
meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL DIGI hits Z (-Z, Second disk);Z_{DIGI} [cm]", 100, -304.2, -303.4);
"EtlHitZZnegD1", "ETL DIGI hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{DIGI} [cm]", 100, -302., -298.);
meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL DIGI hits Z (-Z, Second disk);Z_{DIGI} [cm]", 100, -304., -300.);
meHitZ_[2] = ibook.book1D(
"EtlHitZZposD1", "ETL DIGI hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{DIGI} [cm]", 100, 303.4, 304.2);
meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL DIGI hits Z (+Z, Second disk);Z_{DIGI} [cm]", 100, 303.4, 304.2);
"EtlHitZZposD1", "ETL DIGI hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{DIGI} [cm]", 100, 298., 302.);
meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL DIGI hits Z (+Z, Second disk);Z_{DIGI} [cm]", 100, 300., 304.);

meHitPhi_[0] = ibook.book1D("EtlHitPhiZnegD1",
"ETL DIGI hits #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad]",
Expand Down
28 changes: 18 additions & 10 deletions Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc
Expand Up @@ -120,6 +120,7 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS

unsigned int n_reco_etl[4] = {0, 0, 0, 0};
for (const auto& recHit : *etlRecHitsHandle) {
double weight = 1.0;
ETLDetId detId = recHit.id();
DetId geoId = detId.geographicalId();
const MTDGeomDet* thedet = geom->idToDet(geoId);
Expand All @@ -144,6 +145,9 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS
}

if (topo2Dis) {
if (detId.discSide() == 1) {
weight = -weight;
}
if ((detId.zside() == -1) && (detId.nDisc() == 1)) {
idet = 0;
} else if ((detId.zside() == -1) && (detId.nDisc() == 2)) {
Expand All @@ -162,7 +166,7 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS
meHitEnergy_[idet]->Fill(recHit.energy());
meHitTime_[idet]->Fill(recHit.time());

meOccupancy_[idet]->Fill(global_point.x(), global_point.y());
meOccupancy_[idet]->Fill(global_point.x(), global_point.y(), weight);
meHitX_[idet]->Fill(global_point.x());
meHitY_[idet]->Fill(global_point.y());
meHitZ_[idet]->Fill(global_point.z());
Expand Down Expand Up @@ -191,6 +195,7 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS
// --- Loop over the ETL RECO clusters ---
for (const auto& DetSetClu : *etlRecCluHandle) {
for (const auto& cluster : DetSetClu) {
double weight = 1.0;
if (topo1Dis) {
if (cluster.energy() < hitMinEnergy1Dis_)
continue;
Expand Down Expand Up @@ -225,6 +230,9 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS
}

if (topo2Dis) {
if (cluId.discSide() == 1) {
weight = -weight;
}
if ((cluId.zside() == -1) && (cluId.nDisc() == 1)) {
idet = 0;
} else if ((cluId.zside() == -1) && (cluId.nDisc() == 2)) {
Expand All @@ -242,7 +250,7 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS
meCluTime_[idet]->Fill(cluster.time());
meCluPhi_[idet]->Fill(global_point.phi());
meCluEta_[idet]->Fill(global_point.eta());
meCluOccupancy_[idet]->Fill(global_point.x(), global_point.y());
meCluOccupancy_[idet]->Fill(global_point.x(), global_point.y(), weight);
meCluHits_[idet]->Fill(cluster.size());
}
}
Expand Down Expand Up @@ -325,11 +333,11 @@ void EtlLocalRecoValidation::bookHistograms(DQMStore::IBooker& ibook,
"EtlHitYZposD1", "ETL RECO hits Y (+Z, Single(topo1D)/First(topo2D) Disk);Y_{RECO} [cm]", 100, -130., 130.);
meHitY_[3] = ibook.book1D("EtlHitYZposD2", "ETL RECO hits Y (+Z, Second Disk);Y_{RECO} [cm]", 100, -130., 130.);
meHitZ_[0] = ibook.book1D(
"EtlHitZZnegD1", "ETL RECO hits Z (-Z, Single(topo1D)/First(topo2D) Disk);Z_{RECO} [cm]", 100, -304.2, -303.4);
meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL RECO hits Z (-Z, Second Disk);Z_{RECO} [cm]", 100, -304.2, -303.4);
"EtlHitZZnegD1", "ETL RECO hits Z (-Z, Single(topo1D)/First(topo2D) Disk);Z_{RECO} [cm]", 100, -302., -298.);
meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL RECO hits Z (-Z, Second Disk);Z_{RECO} [cm]", 100, -304., -300.);
meHitZ_[2] = ibook.book1D(
"EtlHitZZposD1", "ETL RECO hits Z (+Z, Single(topo1D)/First(topo2D) Disk);Z_{RECO} [cm]", 100, 303.4, 304.2);
meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL RECO hits Z (+Z, Second Disk);Z_{RECO} [cm]", 100, 303.4, 304.2);
"EtlHitZZposD1", "ETL RECO hits Z (+Z, Single(topo1D)/First(topo2D) Disk);Z_{RECO} [cm]", 100, 298., 302.);
meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL RECO hits Z (+Z, Second Disk);Z_{RECO} [cm]", 100, 300., 304.);
meHitPhi_[0] = ibook.book1D(
"EtlHitPhiZnegD1", "ETL RECO hits #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2);
meHitPhi_[1] =
Expand Down Expand Up @@ -532,15 +540,15 @@ void EtlLocalRecoValidation::bookHistograms(DQMStore::IBooker& ibook,
meCluHits_[3] =
ibook.book1D("EtlCluHitNumberZposD2", "ETL hits per cluster (+Z, Second Disk);Cluster size", 10, 0, 10);
meCluOccupancy_[0] =
ibook.book2D("EtlOccupancyZnegD1",
ibook.book2D("EtlCluOccupancyZnegD1",
"ETL cluster X vs Y (-Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]; Y_{RECO} [cm]",
100,
-150.,
150.,
100,
-150,
150);
meCluOccupancy_[1] = ibook.book2D("EtlOccupancyZnegD2",
meCluOccupancy_[1] = ibook.book2D("EtlCluOccupancyZnegD2",
"ETL cluster X vs Y (-Z, Second Disk);X_{RECO} [cm]; Y_{RECO} [cm]",
100,
-150.,
Expand All @@ -549,15 +557,15 @@ void EtlLocalRecoValidation::bookHistograms(DQMStore::IBooker& ibook,
-150,
150);
meCluOccupancy_[2] =
ibook.book2D("EtlOccupancyZposD1",
ibook.book2D("EtlCluOccupancyZposD1",
"ETL cluster X vs Y (+Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]; Y_{RECO} [cm]",
100,
-150.,
150.,
100,
-150,
150);
meCluOccupancy_[3] = ibook.book2D("EtlOccupancyZposD2",
meCluOccupancy_[3] = ibook.book2D("EtlCluOccupancyZposD2",
"ETL cluster X vs Y (+Z, Second Disk);X_{RECO} [cm]; Y_{RECO} [cm]",
100,
-150.,
Expand Down
17 changes: 11 additions & 6 deletions Validation/MtdValidation/plugins/EtlSimHitsValidation.cc
Expand Up @@ -194,6 +194,7 @@ void EtlSimHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSet
}

for (auto const& hit : m_etlHits[idet]) {
double weight = 1.0;
if (topo1Dis) {
if ((hit.second).energy < hitMinEnergy1Dis_)
continue;
Expand All @@ -214,13 +215,18 @@ void EtlSimHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSet
convertMmToCm((hit.second).x), convertMmToCm((hit.second).y), convertMmToCm((hit.second).z));
const auto& global_point = thedet->toGlobal(local_point);

if (topo2Dis && (detId.discSide() == 1)) {
weight = -weight;
}

// --- Fill the histograms

meHitEnergy_[idet]->Fill((hit.second).energy);
meHitTime_[idet]->Fill((hit.second).time);
meHitXlocal_[idet]->Fill((hit.second).x);
meHitYlocal_[idet]->Fill((hit.second).y);
meHitZlocal_[idet]->Fill((hit.second).z);
meOccupancy_[idet]->Fill(global_point.x(), global_point.y());
meOccupancy_[idet]->Fill(global_point.x(), global_point.y(), weight);
meHitX_[idet]->Fill(global_point.x());
meHitY_[idet]->Fill(global_point.y());
meHitZ_[idet]->Fill(global_point.z());
Expand Down Expand Up @@ -273,7 +279,6 @@ void EtlSimHitsValidation::bookHistograms(DQMStore::IBooker& ibook,
10.);
meNtrkPerCell_[3] =
ibook.book1D("EtlNtrkPerCellZposD2", "Number of tracks per ETL sensor (+Z, Second disk);N_{trk}", 10, 0., 10.);

meHitEnergy_[0] = ibook.book1D(
"EtlHitEnergyZnegD1", "ETL SIM hits energy (-Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV]", 100, 0., 3.);
meHitEnergy_[1] =
Expand Down Expand Up @@ -381,11 +386,11 @@ void EtlSimHitsValidation::bookHistograms(DQMStore::IBooker& ibook,
"EtlHitYZposD1", "ETL SIM hits Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{SIM} [cm]", 100, -130., 130.);
meHitY_[3] = ibook.book1D("EtlHitYZposD2", "ETL SIM hits Y (+Z, Second disk);Y_{SIM} [cm]", 100, -130., 130.);
meHitZ_[0] = ibook.book1D(
"EtlHitZZnegD1", "ETL SIM hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, -304.2, -303.4);
meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL SIM hits Z (-Z, Second disk);Z_{SIM} [cm]", 100, -304.2, -303.4);
"EtlHitZZnegD1", "ETL SIM hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, -302., -298.);
meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL SIM hits Z (-Z, Second disk);Z_{SIM} [cm]", 100, -304., -300.);
meHitZ_[2] = ibook.book1D(
"EtlHitZZposD1", "ETL SIM hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, 303.4, 304.2);
meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL SIM hits Z (+Z, Second disk);Z_{SIM} [cm]", 100, 303.4, 304.2);
"EtlHitZZposD1", "ETL SIM hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, 298., 302.);
meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL SIM hits Z (+Z, Second disk);Z_{SIM} [cm]", 100, 300., 304.);

meHitPhi_[0] = ibook.book1D(
"EtlHitPhiZnegD1", "ETL SIM hits #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad]", 100, -3.15, 3.15);
Expand Down

0 comments on commit 284a188

Please sign in to comment.