Skip to content

Commit

Permalink
Revert "TICLCandidate validation (cms-sw#21)"
Browse files Browse the repository at this point in the history
This reverts commit e058f66.
  • Loading branch information
waredjeb committed Jan 2, 2024
1 parent bf67fa0 commit 078b8b5
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 872 deletions.
13 changes: 4 additions & 9 deletions RecoHGCal/TICL/plugins/SimTrackstersProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,9 @@ void SimTrackstersProducer::produce(edm::Event& evt, const edm::EventSetup& es)

auto pdgId = cp.pdgId();
auto charge = cp.charge();
if (cand.trackPtr().isNonnull()) {
if (cand.trackPtr().isNonnull() and charge == 0) {
}
if (cand.trackPtr().isNonnull() and charge != 0) {
auto const& track = cand.trackPtr().get();
if (std::abs(pdgId) == 13) {
cand.setPdgId(pdgId);
Expand All @@ -473,14 +475,7 @@ void SimTrackstersProducer::produce(edm::Event& evt, const edm::EventSetup& es)
regressedEnergy);
cand.setP4(p4);
} else { // neutral candidates
// a neutral candidate with a charged CaloParticle is charged without a reco track associated with it
// set the charge = 0, but keep the real pdgId to keep track of that
if (charge != 0)
cand.setPdgId(isHad(pdgId) ? 211 : 11);
else if (pdgId == 111)
cand.setPdgId(pdgId);
else
cand.setPdgId(isHad(pdgId) ? 130 : 22);
cand.setPdgId(isHad(pdgId) ? 130 : 22);
cand.setCharge(0);

auto particleType = tracksterParticleTypeFromPdgId(cand.pdgId(), 1);
Expand Down
4 changes: 0 additions & 4 deletions Validation/HGCalValidation/interface/HGCalValidator.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#include "DQMServices/Core/interface/DQMGlobalEDAnalyzer.h"

#include "Validation/HGCalValidation/interface/TICLCandidateValidator.h"
#include "Validation/HGCalValidation/interface/HGVHistoProducerAlgo.h"
#include "Validation/HGCalValidation/interface/CaloParticleSelector.h"
#include "RecoLocalCalo/HGCalRecProducers/interface/HGCalClusteringAlgoBase.h"
Expand Down Expand Up @@ -76,8 +75,6 @@ class HGCalValidator : public DQMGlobalEDAnalyzer<HGCalValidatorHistograms> {
const bool doTrackstersPlots_;
std::string label_TS_, label_TSToCPLinking_, label_TSToSTSPR_;
std::vector<edm::InputTag> label_clustersmask;
const bool doCandidatesPlots_;
edm::InputTag label_candidates_;
const edm::FileInPath cummatbudinxo_;

std::vector<edm::EDGetTokenT<reco::CaloClusterCollection>> labelToken;
Expand All @@ -99,7 +96,6 @@ class HGCalValidator : public DQMGlobalEDAnalyzer<HGCalValidatorHistograms> {
std::unique_ptr<HGVHistoProducerAlgo> histoProducerAlgo_;

private:
mutable TICLCandidateValidator candidateVal;
CaloParticleSelector cpSelector;
std::shared_ptr<hgcal::RecHitTools> tools_;
std::map<double, double> cummatbudg;
Expand Down
118 changes: 0 additions & 118 deletions Validation/HGCalValidation/interface/TICLCandidateValidator.h

This file was deleted.

37 changes: 0 additions & 37 deletions Validation/HGCalValidation/plugins/HGCalValidator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ HGCalValidator::HGCalValidator(const edm::ParameterSet& pset)
label_TSToCPLinking_(pset.getParameter<std::string>("label_TSToCPLinking")),
label_TSToSTSPR_(pset.getParameter<std::string>("label_TSToSTSPR")),
label_clustersmask(pset.getParameter<std::vector<edm::InputTag>>("LayerClustersInputMask")),
doCandidatesPlots_(pset.getUntrackedParameter<bool>("doCandidatesPlots")),
label_candidates_(pset.getParameter<edm::InputTag>("ticlCandidates")),
cummatbudinxo_(pset.getParameter<edm::FileInPath>("cummatbudinxo")) {
//In this way we can easily generalize to associations between other objects also.
const edm::InputTag& label_cp_effic_tag = pset.getParameter<edm::InputTag>("label_cp_effic");
Expand All @@ -57,29 +55,6 @@ HGCalValidator::HGCalValidator(const edm::ParameterSet& pset)

layerclusters_ = consumes<reco::CaloClusterCollection>(label_lcl);

if (doCandidatesPlots_) {
edm::EDGetTokenT<std::vector<TICLCandidate>> TICLCandidatesToken =
consumes<std::vector<TICLCandidate>>(pset.getParameter<edm::InputTag>("ticlTrackstersMerge"));
edm::EDGetTokenT<std::vector<TICLCandidate>> simTICLCandidatesToken =
consumes<std::vector<TICLCandidate>>(pset.getParameter<edm::InputTag>("simTiclCandidates"));
edm::EDGetTokenT<std::vector<reco::Track>> recoTracksToken =
consumes<std::vector<reco::Track>>(pset.getParameter<edm::InputTag>("recoTracks"));
edm::EDGetTokenT<std::vector<ticl::Trackster>> trackstersToken =
consumes<std::vector<ticl::Trackster>>(pset.getParameter<edm::InputTag>("ticlTrackstersMerge"));
//consumes<std::vector<ticl::Trackster>>(pset.getParameter<edm::InputTag>("trackstersclue3d"));
edm::EDGetTokenT<hgcal::RecoToSimCollectionSimTracksters> associatorMapRtSToken =
consumes<hgcal::SimToRecoCollectionSimTracksters>(pset.getParameter<edm::InputTag>("mergeRecoToSimAssociator"));
edm::EDGetTokenT<hgcal::SimToRecoCollectionSimTracksters> associatorMapStRToken =
consumes<hgcal::SimToRecoCollectionSimTracksters>(pset.getParameter<edm::InputTag>("mergeSimToRecoAssociator"));

candidateVal = TICLCandidateValidator(TICLCandidatesToken,
simTICLCandidatesToken,
recoTracksToken,
trackstersToken,
associatorMapRtSToken,
associatorMapStRToken);
}

for (auto& itag : label_tst) {
label_tstTokens.push_back(consumes<ticl::TracksterCollection>(itag));
}
Expand Down Expand Up @@ -244,13 +219,6 @@ void HGCalValidator::bookHistograms(DQMStore::IBooker& ibook,
ibook, histograms.histoProducerAlgo, HGVHistoProducerAlgo::validationType::PatternRecognition);
}
} //end of booking Tracksters loop

// Booking histograms concerning TICL candidates
if (doCandidatesPlots_) {
ibook.cd();
ibook.setCurrentFolder(dirName_ + label_candidates_.label());
candidateVal.bookCandidatesHistos(ibook, dirName_ + label_candidates_.label());
}
}

void HGCalValidator::cpParametersAndSelection(const Histograms& histograms,
Expand Down Expand Up @@ -464,9 +432,4 @@ void HGCalValidator::dqmAnalyze(const edm::Event& event,
totallayers_to_monitor_);
}
} //end of loop over Trackster input labels

// tracksters histograms
if (doCandidatesPlots_) {
candidateVal.fillCandidateHistos(event, simTracksterFromCPHandle);
}
}
5 changes: 2 additions & 3 deletions Validation/HGCalValidation/python/HGCalPostProcessor_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from Validation.HGCalValidation.HGCalSimHitsClient_cff import *
from Validation.HGCalValidation.HGCalDigiClient_cff import *
from Validation.HGCalValidation.HGCalRecHitsClient_cff import *
from Validation.HGCalValidation.PostProcessorHGCAL_cfi import postProcessorHGCALlayerclusters,postProcessorHGCALsimclusters,postProcessorHGCALTracksters,postProcessorHGCALCandidates
from Validation.HGCalValidation.PostProcessorHGCAL_cfi import postProcessorHGCALlayerclusters,postProcessorHGCALsimclusters,postProcessorHGCALTracksters

hgcalPostProcessor = cms.Sequence(hgcalSimHitClientEE
+ hgcalSimHitClientHEF
Expand All @@ -18,5 +18,4 @@
hgcalValidatorPostProcessor = cms.Sequence(
postProcessorHGCALlayerclusters+
postProcessorHGCALsimclusters+
postProcessorHGCALTracksters+
postProcessorHGCALCandidates)
postProcessorHGCALTracksters)
10 changes: 0 additions & 10 deletions Validation/HGCalValidation/python/HGCalValidator_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,6 @@
label_TS = cms.string("Morphology"),
label_TSToCPLinking = cms.string("TSToCP_linking"),
label_TSToSTSPR = cms.string("TSToSTS_patternRecognition"),
#candidates plots
doCandidatesPlots = cms.untracked.bool(True),
ticlCandidates = cms.string("ticlCandidates"),

ticlTrackstersMerge = cms.InputTag("ticlTrackstersMerge"),
simTiclCandidates = cms.InputTag("ticlSimTracksters"),
recoTracks = cms.InputTag("generalTracks"),
trackstersclue3d = cms.InputTag("ticlTrackstersCLUE3DHigh"),
mergeRecoToSimAssociator = cms.InputTag("tracksterSimTracksterAssociationLinking", "recoToSim"),
mergeSimToRecoAssociator = cms.InputTag("tracksterSimTracksterAssociationLinking", "simToReco"),

#The cumulative material budget in front of each layer. To be more specific, it
#is the material budget just in front of the active material (not including it).
Expand Down
36 changes: 0 additions & 36 deletions Validation/HGCalValidation/python/PostProcessorHGCAL_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,39 +82,3 @@
outputFileName = cms.untracked.string(""),
verbose = cms.untracked.uint32(4)
)

neutrals = ["photons", "neutral_pions", "neutral_hadrons"]
charged = ["electrons", "muons", "charged_hadrons"]
variables = ["energy", "pt", "eta", "phi"]
subDirsCandidates = [prefix + hgcalValidator.ticlCandidates.value() + "/" + c for cands in (neutrals, charged) for c in cands]
eff_candidates = []

for c in charged:
for var in variables:
eff_candidates.append("eff_"+c+"_track_"+var+" '"+c.replace("_", " ")+" candidates track efficiency vs "+var+"' num_track_cand_vs_"+var+"_"+c+" den_cand_vs_"+var+"_"+c)
eff_candidates.append("eff_"+c+"_pid_"+var+" '"+c.replace("_", " ")+" candidates track + pid efficiency vs "+var+"' num_pid_cand_vs_"+var+"_"+c+" den_cand_vs_"+var+"_"+c)
eff_candidates.append("eff_"+c+"_energy_"+var+" '"+c.replace("_", " ")+" candidates track + pid + energy efficiency vs "+var+"' num_energy_cand_vs_"+var+"_"+c+" den_cand_vs_"+var+"_"+c)
for n in neutrals:
for var in variables:
eff_candidates.append("eff_"+n+"_pid_"+var+" '"+n.replace("_", " ")+" candidates pid efficiency vs "+var+"' num_pid_cand_vs_"+var+"_"+n+" den_cand_vs_"+var+"_"+n)
eff_candidates.append("eff_"+n+"_energy_"+var+" '"+n.replace("_", " ")+" candidates pid + energy efficiency vs "+var+"' num_energy_cand_vs_"+var+"_"+n+" den_cand_vs_"+var+"_"+n)

for c in charged:
for var in variables:
eff_candidates.append("fake_"+c+"_track_"+var+" '"+c.replace("_", " ")+" candidates track fake vs "+var+"' num_fake_track_cand_vs_"+var+"_"+c+" den_fake_cand_vs_"+var+"_"+c)
eff_candidates.append("fake_"+c+"_pid_"+var+" '"+c.replace("_", " ")+" candidates track + pid fake vs "+var+"' num_fake_pid_cand_vs_"+var+"_"+c+" den_fake_cand_vs_"+var+"_"+c)
eff_candidates.append("fake_"+c+"_energy_"+var+" '"+c.replace("_", " ")+" candidates track + pid + energy fake vs "+var+"' num_fake_energy_cand_vs_"+var+"_"+c+" den_fake_cand_vs_"+var+"_"+c)
for n in neutrals:
for var in variables:
eff_candidates.append("fake_"+n+"_pid_"+var+" '"+n.replace("_", " ")+" candidates pid fake vs "+var+"' num_fake_pid_cand_vs_"+var+"_"+n+" den_fake_cand_vs_"+var+"_"+n)
eff_candidates.append("fake_"+n+"_energy_"+var+" '"+n.replace("_", " ")+" candidates pid + energy fake vs "+var+"' num_fake_energy_cand_vs_"+var+"_"+n+" den_fake_cand_vs_"+var+"_"+n)

postProcessorHGCALCandidates = DQMEDHarvester('DQMGenericClient',
subDirs = cms.untracked.vstring(subDirsCandidates),
efficiency = cms.vstring(eff_candidates),
resolution = cms.vstring(),
cumulativeDists = cms.untracked.vstring(),
noFlowDists = cms.untracked.vstring(),
outputFileName = cms.untracked.string(""),
verbose = cms.untracked.uint32(4)
)
Loading

0 comments on commit 078b8b5

Please sign in to comment.