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

MTD Validation: Add printouts and protection for optional plots in BtlLocalRecoValidation #46408

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion Validation/MtdValidation/plugins/BtlLocalRecoValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ void BtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS
unsigned int n_reco_btl = 0;
unsigned int n_reco_btl_nosimhit = 0;
for (const auto& recHit : *btlRecHitsHandle) {
LogTrace("BtlLocalRecoValidation") << "@RH detid " << recHit.id().rawId() << " r/c/X/dX " << recHit.row() << " "
<< recHit.column() << " " << recHit.position() << " " << recHit.positionError()
<< " E,T,dT " << recHit.energy() << " " << recHit.time() << " "
<< recHit.timeError();

BTLDetId detId = recHit.id();
DetId geoId = detId.geographicalId(MTDTopologyMode::crysLayoutFromTopoMode(topology->getMTDTopologyMode()));
const MTDGeomDet* thedet = geom->idToDet(geoId);
Expand Down Expand Up @@ -843,6 +848,10 @@ void BtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS
for (const auto& uRecHit : *btlUncalibRecHitsHandle) {
BTLDetId detId = uRecHit.id();

LogTrace("BtlLocalRecoValidation") << "@URH detid " << detId.rawId() << " A " << uRecHit.amplitude().first << " "
<< uRecHit.amplitude().second << " T " << uRecHit.time().first << " "
<< uRecHit.time().second;

// --- Skip UncalibratedRecHits not matched to SimHits
if (m_btlSimHits.count(detId.rawId()) != 1)
continue;
Expand All @@ -869,11 +878,20 @@ void BtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS
hit_amplitude /= nHits;
hit_time /= nHits;

// --- Fill the histograms
LogDebug("BtlLocalRecoValidation") << "#unc " << nHits << " A/T " << hit_amplitude << " " << hit_time;
if (nHits == 0.) {
edm::LogWarning("BtlLocalRecoValidation") << "Empty uncalibrated hit in DetId " << detId;
continue;
}

hit_amplitude /= nHits;
hit_time /= nHits;

if (hit_amplitude < hitMinAmplitude_)
continue;

// --- Fill the histograms

meUncEneRVsX_->Fill(uRecHit.position(), uRecHit.amplitude().first - hit_amplitude);
meUncEneLVsX_->Fill(uRecHit.position(), uRecHit.amplitude().second - hit_amplitude);

Expand Down