Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation code update for MTD tracks and hits #33252

Merged
merged 8 commits into from
Mar 29, 2021
4 changes: 2 additions & 2 deletions Validation/Configuration/python/mtdSimValid_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from Validation.MtdValidation.etlLocalReco_cfi import etlLocalReco
from Validation.MtdValidation.etlSimHits_cfi import etlSimHits
from Validation.MtdValidation.etlDigiHits_cfi import etlDigiHits
from Validation.MtdValidation.globalReco_cfi import globalReco
from Validation.MtdValidation.mtdTracks_cfi import mtdTracks

mtdSimValid = cms.Sequence(btlSimHits + etlSimHits )
mtdDigiValid = cms.Sequence(btlDigiHits + etlDigiHits)
mtdRecoValid = cms.Sequence(btlLocalReco + etlLocalReco + globalReco)
mtdRecoValid = cms.Sequence(btlLocalReco + etlLocalReco + mtdTracks)
38 changes: 35 additions & 3 deletions Validation/MtdValidation/plugins/BtlDigiHitsValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class BtlDigiHitsValidation : public DQMEDAnalyzer {
// ------------ member data ------------

const std::string folder_;
const bool LocalPosDebug_;

edm::EDGetTokenT<BTLDigiCollection> btlDigiHitsToken_;

Expand All @@ -62,6 +63,12 @@ class BtlDigiHitsValidation : public DQMEDAnalyzer {

MonitorElement* meOccupancy_[2];

//local position monitoring
MonitorElement* meLocalOccupancy_[2];
MonitorElement* meHitXlocal_[2];
MonitorElement* meHitYlocal_[2];
MonitorElement* meHitZlocal_[2];

MonitorElement* meHitX_[2];
MonitorElement* meHitY_[2];
MonitorElement* meHitZ_[2];
Expand All @@ -79,7 +86,8 @@ class BtlDigiHitsValidation : public DQMEDAnalyzer {

// ------------ constructor and destructor --------------
BtlDigiHitsValidation::BtlDigiHitsValidation(const edm::ParameterSet& iConfig)
: folder_(iConfig.getParameter<std::string>("folder")) {
: folder_(iConfig.getParameter<std::string>("folder")),
LocalPosDebug_(iConfig.getParameter<bool>("LocalPositionDebug")) {
btlDigiHitsToken_ = consumes<BTLDigiCollection>(iConfig.getParameter<edm::InputTag>("inputTag"));
}

Expand Down Expand Up @@ -132,6 +140,13 @@ void BtlDigiHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSe

meOccupancy_[iside]->Fill(global_point.z(), global_point.phi());

if (LocalPosDebug_) {
meLocalOccupancy_[iside]->Fill(local_point.x(), local_point.y());
meHitXlocal_[iside]->Fill(local_point.x());
meHitYlocal_[iside]->Fill(local_point.y());
meHitZlocal_[iside]->Fill(local_point.z());
}

meHitX_[iside]->Fill(global_point.x());
meHitY_[iside]->Fill(global_point.y());
meHitZ_[iside]->Fill(global_point.z());
Expand Down Expand Up @@ -163,7 +178,6 @@ void BtlDigiHitsValidation::bookHistograms(DQMStore::IBooker& ibook,
edm::Run const& run,
edm::EventSetup const& iSetup) {
ibook.setCurrentFolder(folder_);

// --- histograms booking

meNhits_[0] = ibook.book1D("BtlNhitsL", "Number of BTL DIGI hits (L);log_{10}(N_{DIGI})", 100, 0., 5.25);
Expand All @@ -173,7 +187,6 @@ void BtlDigiHitsValidation::bookHistograms(DQMStore::IBooker& ibook,
meHitCharge_[1] = ibook.book1D("BtlHitChargeR", "BTL DIGI hits charge (R);Q_{DIGI} [ADC counts]", 100, 0., 1024.);
meHitTime_[0] = ibook.book1D("BtlHitTimeL", "BTL DIGI hits ToA (L);ToA_{DIGI} [TDC counts]", 100, 0., 1024.);
meHitTime_[1] = ibook.book1D("BtlHitTimeR", "BTL DIGI hits ToA (R);ToA_{DIGI} [TDC counts]", 100, 0., 1024.);

meOccupancy_[0] = ibook.book2D("BtlOccupancyL",
"BTL DIGI hits occupancy (L);Z_{DIGI} [cm]; #phi_{DIGI} [rad]",
65,
Expand All @@ -190,6 +203,24 @@ void BtlDigiHitsValidation::bookHistograms(DQMStore::IBooker& ibook,
126,
-3.15,
3.15);
if (LocalPosDebug_) {
meLocalOccupancy_[0] = ibook.book2D("BtlLocalOccupancyL",
"BTL DIGI hits local occupancy (L);X_{DIGI} [cm]; Y_{DIGI} [cm]",
100,
-10.,
10,
60,
-3.,
3.);
meLocalOccupancy_[1] = ibook.book2D(
"BtlLocalOccupancyR", "BTL DIGI hits occupancy (R);X_{DIGI} [cm]; Y_{DIGI} [cm]", 100, -10., 10., 60, -3., 3.);
meHitXlocal_[0] = ibook.book1D("BtlHitXlocalL", "BTL DIGI local X (L);X_{DIGI}^{LOC} [cm]", 100, -10., 10.);
meHitXlocal_[1] = ibook.book1D("BtlHitXlocalR", "BTL DIGI local X (R);X_{DIGI}^{LOC} [cm]", 100, -10., 10.);
meHitYlocal_[0] = ibook.book1D("BtlHitYlocalL", "BTL DIGI local Y (L);Y_{DIGI}^{LOC} [cm]", 60, -3., 3.);
meHitYlocal_[1] = ibook.book1D("BtlHitYlocalR", "BTL DIGI local Y (R);Y_{DIGI}^{LOC} [cm]", 60, -3., 3.);
meHitZlocal_[0] = ibook.book1D("BtlHitZlocalL", "BTL DIGI local z (L);z_{DIGI}^{LOC} [cm]", 10, -1, 1);
meHitZlocal_[1] = ibook.book1D("BtlHitZlocalR", "BTL DIGI local z (R);z_{DIGI}^{LOC} [cm]", 10, -1, 1);
}

meHitX_[0] = ibook.book1D("BtlHitXL", "BTL DIGI hits X (L);X_{DIGI} [cm]", 60, -120., 120.);
meHitX_[1] = ibook.book1D("BtlHitXR", "BTL DIGI hits X (R);X_{DIGI} [cm]", 60, -120., 120.);
Expand Down Expand Up @@ -258,6 +289,7 @@ void BtlDigiHitsValidation::fillDescriptions(edm::ConfigurationDescriptions& des

desc.add<std::string>("folder", "MTD/BTL/DigiHits");
desc.add<edm::InputTag>("inputTag", edm::InputTag("mix", "FTLBarrel"));
desc.add<bool>("LocalPositionDebug", false);

descriptions.add("btlDigiHitsDefault", desc);
}
Expand Down
107 changes: 88 additions & 19 deletions Validation/MtdValidation/plugins/BtlLocalRecoValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class BtlLocalRecoValidation : public DQMEDAnalyzer {
// ------------ member data ------------

const std::string folder_;
const float hitMinEnergy_;
const double hitMinEnergy_;
const bool LocalPosDebug_;

edm::EDGetTokenT<FTLRecHitCollection> btlRecHitsToken_;
edm::EDGetTokenT<CrossingFrame<PSimHit> > btlSimHitsToken_;
Expand All @@ -76,9 +77,16 @@ class BtlLocalRecoValidation : public DQMEDAnalyzer {

MonitorElement* meHitEnergy_;
MonitorElement* meHitTime_;
MonitorElement* meHitTimeError_;

MonitorElement* meOccupancy_;

//local position monitoring
MonitorElement* meLocalOccupancy_;
MonitorElement* meHitXlocal_;
MonitorElement* meHitYlocal_;
MonitorElement* meHitZlocal_;

MonitorElement* meHitX_;
MonitorElement* meHitY_;
MonitorElement* meHitZ_;
Expand All @@ -97,10 +105,16 @@ class BtlLocalRecoValidation : public DQMEDAnalyzer {

MonitorElement* meTimeRes_;
MonitorElement* meEnergyRes_;
MonitorElement* meTresvsE_;
MonitorElement* meEresvsE_;

MonitorElement* meLongPosPull_;
MonitorElement* meLongPosPullvsE_;
MonitorElement* meLongPosPullvsEta_;

MonitorElement* meTPullvsE_;
MonitorElement* meTPullvsEta_;

MonitorElement* meCluTime_;
MonitorElement* meCluTimeError_;
MonitorElement* meCluEnergy_;
MonitorElement* meCluPhi_;
MonitorElement* meCluEta_;
Expand All @@ -111,7 +125,8 @@ class BtlLocalRecoValidation : public DQMEDAnalyzer {
// ------------ constructor and destructor --------------
BtlLocalRecoValidation::BtlLocalRecoValidation(const edm::ParameterSet& iConfig)
: folder_(iConfig.getParameter<std::string>("folder")),
hitMinEnergy_(iConfig.getParameter<double>("hitMinimumEnergy")) {
hitMinEnergy_(iConfig.getParameter<double>("hitMinimumEnergy")),
LocalPosDebug_(iConfig.getParameter<bool>("LocalPositionDebug")) {
btlRecHitsToken_ = consumes<FTLRecHitCollection>(iConfig.getParameter<edm::InputTag>("recHitsTag"));
btlSimHitsToken_ = consumes<CrossingFrame<PSimHit> >(iConfig.getParameter<edm::InputTag>("simHitsTag"));
btlRecCluToken_ = consumes<FTLClusterCollection>(iConfig.getParameter<edm::InputTag>("recCluTag"));
Expand Down Expand Up @@ -183,11 +198,18 @@ void BtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS

meHitEnergy_->Fill(recHit.energy());
meHitTime_->Fill(recHit.time());
meHitTimeError_->Fill(recHit.timeError());
meHitLongPos_->Fill(recHit.position());
meHitLongPosErr_->Fill(recHit.positionError());

meOccupancy_->Fill(global_point.z(), global_point.phi());

if (LocalPosDebug_) {
meLocalOccupancy_->Fill(local_point.x() + recHit.position(), local_point.y());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsorrentino18 is the addition of the reconstructed longitudinal position giving the expected behaviour?

Copy link
Contributor Author

@gsorrentino18 gsorrentino18 Mar 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following occupancy plot (10k MinBias) shows that the BTL crystals are correctly arranged in the module, but there's still something that needs to be understood in the reconstruction of the longitudinal position inside the crystal.

Schermata 2021-03-24 alle 09 38 51

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is observed likely accounts for uncertainty in the reconstructed position that is used on top of the nominal center of the crystal according to the geometry, this is seen also in the one-dimensional plot of the longitudinal position in local coordinates

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in any case the 16x3 layout is confirmed to be in the correct orientation, unlike the ETL pixels layout (@parbol FYI)

meHitXlocal_->Fill(local_point.x());
meHitYlocal_->Fill(local_point.y());
meHitZlocal_->Fill(local_point.z());
}
meHitX_->Fill(global_point.x());
meHitY_->Fill(global_point.y());
meHitZ_->Fill(global_point.z());
Expand All @@ -204,14 +226,26 @@ void BtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS

// Resolution histograms
if (m_btlSimHits.count(detId.rawId()) == 1 && m_btlSimHits[detId.rawId()].energy > hitMinEnergy_) {
float longpos_res = recHit.position() - convertMmToCm(m_btlSimHits[detId.rawId()].x_local);
float time_res = recHit.time() - m_btlSimHits[detId.rawId()].time;
float energy_res = recHit.energy() - m_btlSimHits[detId.rawId()].energy;

Local3DPoint local_point_sim(m_btlSimHits[detId.rawId()].x_local,
m_btlSimHits[detId.rawId()].y_local,
m_btlSimHits[detId.rawId()].z_local);
local_point_sim =
topo.pixelToModuleLocalPoint(local_point_sim, detId.row(topo.nrows()), detId.column(topo.nrows()));
const auto& global_point_sim = thedet->toGlobal(local_point_sim);

meTimeRes_->Fill(time_res);
meEnergyRes_->Fill(energy_res);

meTresvsE_->Fill(m_btlSimHits[detId.rawId()].energy, time_res);
meEresvsE_->Fill(m_btlSimHits[detId.rawId()].energy, energy_res);
meLongPosPull_->Fill(longpos_res / recHit.positionError());
meLongPosPullvsEta_->Fill(std::abs(global_point_sim.eta()), longpos_res / recHit.positionError());
meLongPosPullvsE_->Fill(m_btlSimHits[detId.rawId()].energy, longpos_res / recHit.positionError());

meTPullvsEta_->Fill(std::abs(global_point_sim.eta()), time_res / recHit.timeError());
meTPullvsE_->Fill(m_btlSimHits[detId.rawId()].energy, time_res / recHit.timeError());
}

n_reco_btl++;
Expand All @@ -237,12 +271,13 @@ void BtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS
const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(genericDet->topology());
const RectangularMTDTopology& topo = static_cast<const RectangularMTDTopology&>(topoproxy.specificTopology());

Local3DPoint local_point(cluster.x() * 5.7, cluster.y() * 0.3, 0.);
Local3DPoint local_point(cluster.x() * topo.pitch().first, cluster.y() * topo.pitch().second, 0.);
local_point = topo.pixelToModuleLocalPoint(local_point, cluId.row(topo.nrows()), cluId.column(topo.ncolumns()));
const auto& global_point = genericDet->toGlobal(local_point);

meCluEnergy_->Fill(cluster.energy());
meCluTime_->Fill(cluster.time());
meCluTimeError_->Fill(cluster.timeError());
meCluPhi_->Fill(global_point.phi());
meCluEta_->Fill(global_point.eta());
meCluZvsPhi_->Fill(global_point.z(), global_point.phi());
Expand All @@ -263,16 +298,21 @@ void BtlLocalRecoValidation::bookHistograms(DQMStore::IBooker& ibook,

meHitEnergy_ = ibook.book1D("BtlHitEnergy", "BTL RECO hits energy;E_{RECO} [MeV]", 100, 0., 20.);
meHitTime_ = ibook.book1D("BtlHitTime", "BTL RECO hits ToA;ToA_{RECO} [ns]", 100, 0., 25.);

meHitTimeError_ = ibook.book1D("BtlHitTimeError", "BTL RECO hits ToA error;#sigma^{ToA}_{RECO} [ns]", 50, 0., 0.1);
meOccupancy_ = ibook.book2D(
"BtlOccupancy", "BTL RECO hits occupancy;Z_{RECO} [cm]; #phi_{RECO} [rad]", 65, -260., 260., 126, -3.2, 3.2);

if (LocalPosDebug_) {
meLocalOccupancy_ = ibook.book2D(
"BtlLocalOccupancy", "BTL RECO hits local occupancy;X_{RECO} [cm]; Y_{RECO} [cm]", 100, 10., 10., 60, -3., 3.);
meHitXlocal_ = ibook.book1D("BtlHitXlocal", "BTL RECO local X;X_{RECO}^{LOC} [cm]", 100, -10., 10.);
meHitYlocal_ = ibook.book1D("BtlHitYlocal", "BTL RECO local Y;Y_{RECO}^{LOC} [cm]", 60, -3, 3);
meHitZlocal_ = ibook.book1D("BtlHitZlocal", "BTL RECO local z;z_{RECO}^{LOC} [cm]", 10, -1, 1);
}
meHitX_ = ibook.book1D("BtlHitX", "BTL RECO hits X;X_{RECO} [cm]", 60, -120., 120.);
meHitY_ = ibook.book1D("BtlHitY", "BTL RECO hits Y;Y_{RECO} [cm]", 60, -120., 120.);
meHitZ_ = ibook.book1D("BtlHitZ", "BTL RECO hits Z;Z_{RECO} [cm]", 100, -260., 260.);
meHitPhi_ = ibook.book1D("BtlHitPhi", "BTL RECO hits #phi;#phi_{RECO} [rad]", 126, -3.2, 3.2);
meHitEta_ = ibook.book1D("BtlHitEta", "BTL RECO hits #eta;#eta_{RECO}", 100, -1.55, 1.55);

meHitTvsE_ =
ibook.bookProfile("BtlHitTvsE", "BTL RECO ToA vs energy;E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 20., 0., 100.);
meHitEvsPhi_ = ibook.bookProfile(
Expand All @@ -290,18 +330,46 @@ void BtlLocalRecoValidation::bookHistograms(DQMStore::IBooker& ibook,
meHitLongPos_ = ibook.book1D("BtlLongPos", "BTL RECO hits longitudinal position;long. pos._{RECO}", 100, -10, 10);
meHitLongPosErr_ =
ibook.book1D("BtlLongPosErr", "BTL RECO hits longitudinal position error; long. pos. error_{RECO}", 100, -1, 1);

meTimeRes_ = ibook.book1D("BtlTimeRes", "BTL time resolution;T_{RECO} - T_{SIM} [ns]", 100, -0.5, 0.5);
meEnergyRes_ = ibook.book1D("BtlEnergyRes", "BTL energy resolution;E_{RECO} - E_{SIM} [MeV]", 100, -0.5, 0.5);

meTresvsE_ = ibook.bookProfile(
"BtlTresvsE", "BTL time resolution vs E;E_{SIM} [MeV];T_{RECO}-T_{SIM} [ns]", 50, 0., 20., 0., 100.);
meEresvsE_ = ibook.bookProfile(
"BtlEresvsE", "BTL energy resolution vs E;E_{SIM} [MeV];E_{RECO}-E_{SIM} [MeV]", 50, 0., 20., 0., 100.);
meTimeRes_ = ibook.book1D("BtlTimeRes", "BTL time resolution;T_{RECO}-T_{SIM}", 100, -0.5, 0.5);
meEnergyRes_ = ibook.book1D("BtlEnergyRes", "BTL energy resolution;E_{RECO}-E_{SIM}", 100, -0.5, 0.5);
meLongPosPull_ = ibook.book1D("BtlLongPosPull",
"BTL longitudinal position pull;X^{loc}_{RECO}-X^{loc}_{SIM}/#sigma_{xloc_{RECO}}",
100,
-5.5,
5.5);
meLongPosPullvsE_ = ibook.bookProfile(
"BtlLongposPullvsE",
"BTL longitudinal position pull vs E;E_{SIM} [MeV];X^{loc}_{RECO}-X^{loc}_{SIM}/#sigma_{xloc_{RECO}}",
20,
0.,
20.,
-1.5,
1.5,
"S");
meLongPosPullvsEta_ = ibook.bookProfile(
"BtlLongposPullvsEta",
"BTL longitudinal position pull vs #eta;|#eta_{RECO}|;X^{loc}_{RECO}-X^{loc}_{SIM}/#sigma_{xloc_{RECO}}",
32,
0,
1.55,
-1.5,
1.5,
"S");
meTPullvsE_ = ibook.bookProfile(
"BtlTPullvsE", "BTL time pull vs E;E_{SIM} [MeV];T_{RECO}-T_{SIM}/#sigma_{T_{RECO}}", 20, 0., 20., -0.8, 0.8, "S");
meTPullvsEta_ = ibook.bookProfile("BtlTPullvsEta",
"BTL time pull vs #eta;|#eta_{RECO}|;T_{RECO}-T_{SIM}/#sigma_{T_{RECO}}",
32,
0,
1.55,
-0.8,
0.8,
"S");
meCluTime_ = ibook.book1D("BtlCluTime", "BTL cluster time ToA;ToA [ns]", 250, 0, 25);
meCluTimeError_ = ibook.book1D("BtlCluTimeError", "BTL cluster time error;#sigma_{t} [ns]", 100, 0, 0.1);
meCluEnergy_ = ibook.book1D("BtlCluEnergy", "BTL cluster energy;E_{RECO} [MeV]", 100, 0, 20);
meCluPhi_ = ibook.book1D("BtlCluPhi", "BTL cluster #phi;#phi_{RECO} [rad]", 144, -3.2, 3.2);
meCluEta_ = ibook.book1D("BtlCluEta", "BTL cluster #eta;#eta_{RECO}", 100, -1.6, 1.6);
meCluEta_ = ibook.book1D("BtlCluEta", "BTL cluster #eta;#eta_{RECO}", 100, -1.55, 1.55);
meCluHits_ = ibook.book1D("BtlCluHitNumber", "BTL hits per cluster; Cluster size", 10, 0, 10);
meCluZvsPhi_ = ibook.book2D(
"BtlOccupancy", "BTL cluster Z vs #phi;Z_{RECO} [cm]; #phi_{RECO} [rad]", 144, -260., 260., 50, -3.2, 3.2);
Expand All @@ -316,6 +384,7 @@ void BtlLocalRecoValidation::fillDescriptions(edm::ConfigurationDescriptions& de
desc.add<edm::InputTag>("simHitsTag", edm::InputTag("mix", "g4SimHitsFastTimerHitsBarrel"));
desc.add<edm::InputTag>("recCluTag", edm::InputTag("mtdClusters", "FTLBarrel"));
desc.add<double>("hitMinimumEnergy", 1.); // [MeV]
desc.add<bool>("LocalPositionDebug", false);

descriptions.add("btlLocalReco", desc);
}
Expand Down
Loading