Skip to content

Commit

Permalink
Update with Fabio's comments and additional MEs
Browse files Browse the repository at this point in the history
  • Loading branch information
gsorrentino18 committed Mar 26, 2021
1 parent 1f16063 commit 65147b9
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 34 deletions.
11 changes: 7 additions & 4 deletions Validation/MtdValidation/plugins/BtlLocalRecoValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class BtlLocalRecoValidation : public DQMEDAnalyzer {
MonitorElement* meTPullvsEta_;

MonitorElement* meCluTime_;
MonitorElement* meCluTimeError_;
MonitorElement* meCluEnergy_;
MonitorElement* meCluPhi_;
MonitorElement* meCluEta_;
Expand Down Expand Up @@ -236,8 +237,8 @@ void BtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS
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 / m_btlSimHits[detId.rawId()].time);
meEnergyRes_->Fill(energy_res / m_btlSimHits[detId.rawId()].energy);
meTimeRes_->Fill(time_res);
meEnergyRes_->Fill(energy_res);

meLongPosPull_->Fill(longpos_res / recHit.positionError());
meLongPosPullvsEta_->Fill(std::abs(global_point_sim.eta()), longpos_res / recHit.positionError());
Expand Down Expand Up @@ -276,6 +277,7 @@ void BtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS

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 Down Expand Up @@ -328,8 +330,8 @@ 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}/T_{SIM}", 100, -0.5, 0.5);
meEnergyRes_ = ibook.book1D("BtlEnergyRes", "BTL energy resolution;E_{RECO}-E_{SIM}/E_{SIM}", 100, -0.5, 0.5);
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,
Expand Down Expand Up @@ -364,6 +366,7 @@ void BtlLocalRecoValidation::bookHistograms(DQMStore::IBooker& ibook,
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.55, 1.55);
Expand Down
24 changes: 20 additions & 4 deletions Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class EtlLocalRecoValidation : public DQMEDAnalyzer {
MonitorElement* meHitTvsEta_[4];

MonitorElement* meCluTime_[4];
MonitorElement* meCluTimeError_[4];
MonitorElement* meCluEnergy_[4];
MonitorElement* meCluPhi_[4];
MonitorElement* meCluEta_[4];
Expand Down Expand Up @@ -268,8 +269,8 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS
float time_res = recHit.time() - m_etlSimHits[idet][detId.rawId()].time;
float energy_res = recHit.energy() - m_etlSimHits[idet][detId.rawId()].energy;

meTimeRes_->Fill(time_res / m_etlSimHits[idet][detId.rawId()].time);
meEnergyRes_->Fill(energy_res / m_etlSimHits[idet][detId.rawId()].energy);
meTimeRes_->Fill(time_res);
meEnergyRes_->Fill(energy_res);

meTPullvsEta_->Fill(std::abs(global_point.eta()), time_res / recHit.timeError());
meTPullvsE_->Fill(m_etlSimHits[idet][detId.rawId()].energy, time_res / recHit.timeError());
Expand Down Expand Up @@ -346,6 +347,7 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS

meCluEnergy_[idet]->Fill(cluster.energy());
meCluTime_[idet]->Fill(cluster.time());
meCluTimeError_[idet]->Fill(cluster.timeError());
meCluPhi_[idet]->Fill(global_point.phi());
meCluEta_[idet]->Fill(global_point.eta());
meCluOccupancy_[idet]->Fill(global_point.x(), global_point.y(), weight);
Expand Down Expand Up @@ -487,8 +489,8 @@ void EtlLocalRecoValidation::bookHistograms(DQMStore::IBooker& ibook,
meHitEta_[2] = ibook.book1D(
"EtlHitEtaZposD1", "ETL RECO hits #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, 1.56, 3.2);
meHitEta_[3] = ibook.book1D("EtlHitEtaZposD2", "ETL RECO hits #eta (+Z, Second Disk);#eta_{RECO}", 100, 1.56, 3.2);
meTimeRes_ = ibook.book1D("EtlTimeRes", "ETL time resolution;T_{RECO}-T_{SIM}/T_{SIM}", 100, -0.5, 0.5);
meEnergyRes_ = ibook.book1D("EtlEnergyRes", "ETL energy resolution;E_{RECO}-E_{SIM}/E_{SIM}", 100, -0.5, 0.5);
meTimeRes_ = ibook.book1D("EtlTimeRes", "ETL time resolution;T_{RECO}-T_{SIM}", 100, -0.5, 0.5);
meEnergyRes_ = ibook.book1D("EtlEnergyRes", "ETL energy resolution;E_{RECO}-E_{SIM}", 100, -0.5, 0.5);
meHitTvsE_[0] = ibook.bookProfile(
"EtlHitTvsEZnegD1",
"ETL RECO time vs energy (-Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV];ToA_{RECO} [ns]",
Expand Down Expand Up @@ -655,6 +657,20 @@ void EtlLocalRecoValidation::bookHistograms(DQMStore::IBooker& ibook,
meCluTime_[2] =
ibook.book1D("EtlCluTimeZposD1", "ETL cluster ToA (+Z, Single(topo1D)/First(topo2D) Disk);ToA [ns]", 250, 0, 25);
meCluTime_[3] = ibook.book1D("EtlCluTimeZposD2", "ETL cluster ToA (+Z, Second Disk);ToA [ns]", 250, 0, 25);
meCluTimeError_[0] = ibook.book1D("EtlCluTimeErrosZnegD1",
"ETL cluster time error (-Z, Single(topo1D)/First(topo2D) Disk);#sigma_{t} [ns]",
100,
0,
0.1);
meCluTimeError_[1] =
ibook.book1D("EtlCluTimeErrorZnegD2", "ETL cluster time error (-Z, Second Disk);#sigma_{t} [ns]", 100, 0, 0.1);
meCluTimeError_[2] = ibook.book1D("EtlCluTimeErrorZposD1",
"ETL cluster time error (+Z, Single(topo1D)/First(topo2D) Disk);#sigma_{t} [ns]",
100,
0,
0.1);
meCluTimeError_[3] =
ibook.book1D("EtlCluTimeErrorZposD2", "ETL cluster time error (+Z, Second Disk);#sigma_{t} [ns]", 100, 0, 0.1);
meCluEnergy_[0] = ibook.book1D(
"EtlCluEnergyZnegD1", "ETL cluster energy (-Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV]", 100, 0, 10);
meCluEnergy_[1] =
Expand Down
70 changes: 44 additions & 26 deletions Validation/MtdValidation/plugins/MtdTracksValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class MtdTracksValidation : public DQMEDAnalyzer {
// ------------ member data ------------

const std::string folder_;
const float trackMinEnergy_;
const float trackMinPt_;
const float trackMinEta_;
const float trackMaxEta_;

Expand All @@ -60,6 +60,8 @@ class MtdTracksValidation : public DQMEDAnalyzer {

edm::EDGetTokenT<edm::ValueMap<float>> tmtdToken_;
edm::EDGetTokenT<edm::ValueMap<float>> SigmatmtdToken_;
edm::EDGetTokenT<edm::ValueMap<float>> t0SrcToken_;
edm::EDGetTokenT<edm::ValueMap<float>> Sigmat0SrcToken_;
edm::EDGetTokenT<edm::ValueMap<float>> t0PidToken_;
edm::EDGetTokenT<edm::ValueMap<float>> Sigmat0PidToken_;
edm::EDGetTokenT<edm::ValueMap<float>> t0SafePidToken_;
Expand All @@ -85,7 +87,8 @@ class MtdTracksValidation : public DQMEDAnalyzer {
MonitorElement* meETLTrackPtRes_;

MonitorElement* meTracktmtd_;
MonitorElement* meTrackSigmatmtd_;
MonitorElement* meTrackt0Src_;
MonitorElement* meTrackSigmat0Src_;
MonitorElement* meTrackt0Pid_;
MonitorElement* meTrackSigmat0Pid_;
MonitorElement* meTrackt0SafePid_;
Expand All @@ -102,16 +105,18 @@ class MtdTracksValidation : public DQMEDAnalyzer {
// ------------ constructor and destructor --------------
MtdTracksValidation::MtdTracksValidation(const edm::ParameterSet& iConfig)
: folder_(iConfig.getParameter<std::string>("folder")),
trackMinEnergy_(iConfig.getParameter<double>("trackMinimumPt")),
trackMinPt_(iConfig.getParameter<double>("trackMinimumPt")),
trackMinEta_(iConfig.getParameter<double>("trackMinimumEta")),
trackMaxEta_(iConfig.getParameter<double>("trackMaximumEta")) {
GenRecTrackToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("inputTagG"));
RecTrackToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("inputTagT"));
RecVertexToken_ = consumes<std::vector<reco::Vertex>>(iConfig.getParameter<edm::InputTag>("inputTagV"));
trackAssocToken_ = consumes<edm::ValueMap<int>>(iConfig.getParameter<edm::InputTag>("trackAssocSrc"));
pathLengthToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("pathLengthSrc"));
tmtdToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("t0Src"));
SigmatmtdToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("sigmat0Src"));
tmtdToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("tmtd"));
SigmatmtdToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("sigmatmtd"));
t0SrcToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("t0Src"));
Sigmat0SrcToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("sigmat0Src"));
t0PidToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("t0PID"));
Sigmat0PidToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("sigmat0PID"));
t0SafePidToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("t0SafePID"));
Expand Down Expand Up @@ -145,6 +150,8 @@ void MtdTracksValidation::analyze(const edm::Event& iEvent, const edm::EventSetu

const auto& tMtd = iEvent.get(tmtdToken_);
const auto& SigmatMtd = iEvent.get(SigmatmtdToken_);
const auto& t0Src = iEvent.get(t0SrcToken_);
const auto& Sigmat0Src = iEvent.get(Sigmat0SrcToken_);
const auto& t0Pid = iEvent.get(t0PidToken_);
const auto& Sigmat0Pid = iEvent.get(Sigmat0PidToken_);
const auto& t0Safe = iEvent.get(t0SafePidToken_);
Expand All @@ -167,11 +174,18 @@ void MtdTracksValidation::analyze(const edm::Event& iEvent, const edm::EventSetu
const reco::TrackRef mtdTrackref = reco::TrackRef(iEvent.getHandle(RecTrackToken_), trackAssoc[trackref]);
const reco::Track track = *mtdTrackref;

if (track.pt() < trackMinEnergy_)
if (track.pt() < trackMinPt_)
continue;

meTracktmtd_->Fill(tMtd[trackref]);
meTrackSigmatmtd_->Fill(SigmatMtd[trackref]);
meTracktmtd_->Fill(tMtd[mtdTrackref]);
if (std::round(SigmatMtd[mtdTrackref] - Sigmat0Pid[trackref]) != 0) {
LogWarning("mtdTracks") << "TimeError associated to refitted track is different from TimeError stored in tofPID "
"sigmat0 ValueMap: this should not happen";
}

meTrackt0Src_->Fill(t0Src[trackref]);
meTrackSigmat0Src_->Fill(Sigmat0Src[trackref]);

meTrackt0Pid_->Fill(t0Pid[trackref]);
meTrackSigmat0Pid_->Fill(Sigmat0Pid[trackref]);
meTrackt0SafePid_->Fill(t0Safe[trackref]);
Expand Down Expand Up @@ -352,15 +366,17 @@ void MtdTracksValidation::bookHistograms(DQMStore::IBooker& ibook, edm::Run cons
ibook.book1D("TrackETLEffPtMtdZpos", "Track efficiency vs pt (Mtd) (+Z);pt_{RECO} [GeV]", 50, 0, 10);
meETLTrackPtRes_ =
ibook.book1D("TrackETLPtRes", "Track pT resolution;pT_{Gentrack}-pT_{MTDtrack}/pT_{Gentrack} ", 100, -0.1, 0.1);
meTracktmtd_ = ibook.book1D("Tracktmtd", "Track time from TrackExtenderWithMTD;tmtd [ns]", 100, -1.5, 1.5);
meTrackSigmatmtd_ =
ibook.book1D("TrackSigmatmtd", "Time Error from TrackExtenderWithMTD; #sigma_{tmtd} [ns]", 100, 0, 0.1);

meTracktmtd_ = ibook.book1D("Tracktmtd", "Track time from TrackExtenderWithMTD;tmtd [ns]", 150, 1, 16);
meTrackt0Src_ = ibook.book1D("Trackt0Src", "Track time from TrackExtenderWithMTD;t0Src [ns]", 100, -1.5, 1.5);
meTrackSigmat0Src_ =
ibook.book1D("TrackSigmat0Src", "Time Error from TrackExtenderWithMTD; #sigma_{t0Src} [ns]", 100, 0, 0.1);

meTrackt0Pid_ = ibook.book1D("Trackt0Pid", "Track t0 as stored in TofPid;t0 [ns]", 100, -1, 1);
meTrackSigmat0Pid_ =
ibook.book1D("TrackSigmat0Pid", "Sigmat0 as stored in TofPid; #sigma_{t0} [ns]", 100, -0.02, 0.06);
meTrackSigmat0Pid_ = ibook.book1D("TrackSigmat0Pid", "Sigmat0 as stored in TofPid; #sigma_{t0} [ns]", 100, 0, 0.1);
meTrackt0SafePid_ = ibook.book1D("Trackt0SafePID", "Track t0 Safe as stored in TofPid;t0 [ns]", 100, -1, 1);
meTrackSigmat0SafePid_ =
ibook.book1D("TrackSigmat0SafePID", "Sigmat0 Safe as stored in TofPid; #sigma_{t0} [ns]", 100, -0.02, 0.06);
ibook.book1D("TrackSigmat0SafePID", "Sigmat0 Safe as stored in TofPid; #sigma_{t0} [ns]", 100, 0, 0.1);
meTrackNumHits_ = ibook.book1D("TrackNumHits", "Number of valid MTD hits per track ; Number of hits", 10, -5, 5);
meTrackMVAQual_ = ibook.book1D("TrackMVAQual", "Track MVA Quality as stored in Value Map ; MVAQual", 100, 0, 1);
meTrackPathLenghtvsEta_ = ibook.bookProfile(
Expand All @@ -376,19 +392,21 @@ void MtdTracksValidation::fillDescriptions(edm::ConfigurationDescriptions& descr
edm::ParameterSetDescription desc;

desc.add<std::string>("folder", "MTD/Tracks");
desc.add<edm::InputTag>("inputTagG", edm::InputTag("generalTracks", ""));
desc.add<edm::InputTag>("inputTagT", edm::InputTag("trackExtenderWithMTD", ""));
desc.add<edm::InputTag>("inputTagV", edm::InputTag("offlinePrimaryVertices4D", ""));
desc.add<edm::InputTag>("t0Src", edm::InputTag("trackExtenderWithMTD:generalTrackt0", ""));
desc.add<edm::InputTag>("sigmat0Src", edm::InputTag("trackExtenderWithMTD:generalTracksigmat0", ""));
desc.add<edm::InputTag>("trackAssocSrc", edm::InputTag("trackExtenderWithMTD", "generalTrackassoc"))
desc.add<edm::InputTag>("inputTagG", edm::InputTag("generalTracks"));
desc.add<edm::InputTag>("inputTagT", edm::InputTag("trackExtenderWithMTD"));
desc.add<edm::InputTag>("inputTagV", edm::InputTag("offlinePrimaryVertices4D"));
desc.add<edm::InputTag>("tmtd", edm::InputTag("trackExtenderWithMTD:tmtd"));
desc.add<edm::InputTag>("sigmatmtd", edm::InputTag("trackExtenderWithMTD:sigmatmtd"));
desc.add<edm::InputTag>("t0Src", edm::InputTag("trackExtenderWithMTD:generalTrackt0"));
desc.add<edm::InputTag>("sigmat0Src", edm::InputTag("trackExtenderWithMTD:generalTracksigmat0"));
desc.add<edm::InputTag>("trackAssocSrc", edm::InputTag("trackExtenderWithMTD:generalTrackassoc"))
->setComment("Association between General and MTD Extended tracks");
desc.add<edm::InputTag>("pathLengthSrc", edm::InputTag("trackExtenderWithMTD", "pathLength"));
desc.add<edm::InputTag>("t0SafePID", edm::InputTag("tofPID:t0safe", ""));
desc.add<edm::InputTag>("sigmat0SafePID", edm::InputTag("tofPID:sigmat0safe", ""));
desc.add<edm::InputTag>("sigmat0PID", edm::InputTag("tofPID:sigmat0", ""));
desc.add<edm::InputTag>("t0PID", edm::InputTag("tofPID:t0", ""));
desc.add<edm::InputTag>("trackMVAQual", edm::InputTag("mtdTrackQualityMVA:mtdQualMVA", ""));
desc.add<edm::InputTag>("pathLengthSrc", edm::InputTag("trackExtenderWithMTD:pathLength"));
desc.add<edm::InputTag>("t0SafePID", edm::InputTag("tofPID:t0safe"));
desc.add<edm::InputTag>("sigmat0SafePID", edm::InputTag("tofPID:sigmat0safe"));
desc.add<edm::InputTag>("sigmat0PID", edm::InputTag("tofPID:sigmat0"));
desc.add<edm::InputTag>("t0PID", edm::InputTag("tofPID:t0"));
desc.add<edm::InputTag>("trackMVAQual", edm::InputTag("mtdTrackQualityMVA:mtdQualMVA"));
desc.add<double>("trackMinimumPt", 1.0); // [GeV]
desc.add<double>("trackMinimumEta", 1.5);
desc.add<double>("trackMaximumEta", 3.2);
Expand Down

0 comments on commit 65147b9

Please sign in to comment.