42 linkToPackedPF_(iConfig.getParameter<
bool>(
"linkToPackedPFCandidates")),
44 iConfig.getParameter<
edm::
InputTag>(
"packedPFCandidates"))),
45 dropPiZeroRefs_(iConfig.exists(
"dropPiZeroRefs") ? iConfig.getParameter<
bool>(
"dropPiZeroRefs") :
true),
46 dropTauChargedHadronRefs_(
47 iConfig.exists(
"dropTauChargedHadronRefs") ? iConfig.getParameter<
bool>(
"dropTauChargedHadronRefs") :
true),
48 dropPFSpecific_(iConfig.exists(
"dropPFSpecific") ? iConfig.getParameter<
bool>(
"dropPFSpecific") :
true),
49 modifyTau_(iConfig.getParameter<
bool>(
"modifyTaus")) {
52 tauModifier_ = std::make_unique<pat::ObjectModifier<pat::Tau>>(mod_config, consumesCollector());
54 produces<std::vector<pat::Tau>>();
59 tauModifier_->setEventContent(iSetup);
71 iEvent.getByToken(pf2pc_, pf2pc);
73 auto out = std::make_unique<std::vector<pat::Tau>>();
77 tauModifier_->setEvent(
iEvent);
85 tauModifier_->modify(
tau);
89 tau.isolations_.clear();
90 tau.isoDeposits_.clear();
92 if (linkToPackedPF_) {
99 tau.setSignalChargedHadrCands(signalChHPtrs);
104 tau.setSignalNeutralHadrCands(signalNHPtrs);
109 tau.setSignalGammaCands(signalGammaPtrs);
114 tau.setIsolationChargedHadrCands(isolationChHPtrs);
119 tau.setIsolationNeutralHadrCands(isolationNHPtrs);
124 tau.setIsolationGammaCands(isolationGammaPtrs);
126 if (dropPiZeroRefs_) {
127 tau.pfSpecific_[0].signalPiZeroCandidates_.clear();
128 tau.pfSpecific_[0].isolationPiZeroCandidates_.clear();
130 if (dropTauChargedHadronRefs_) {
131 tau.pfSpecific_[0].signalTauChargedHadronCandidates_.clear();
132 tau.pfSpecific_[0].isolationTauChargedHadronCandidates_.clear();
134 if (dropPFSpecific_) {
135 tau.pfSpecific_.clear();