11 : signalConeSizeFormula_(
12 std::regex_replace(
cfg.getParameter<
std::
string>(
"signalConeSize"),
std::regex(
"pt"),
"x")),
13 minSignalConeSize_(
cfg.getParameter<double>(
"minSignalConeSize")),
14 maxSignalConeSize_(
cfg.getParameter<double>(
"maxSignalConeSize")),
15 useStrips_(
cfg.getParameter<
bool>(
"useStrips")),
16 stripSizeEta_(
cfg.getParameter<double>(
"stripSizeEta")),
17 stripSizePhi_(
cfg.getParameter<double>(
"stripSizePhi")),
18 isolationConeSize_(
cfg.getParameter<double>(
"isolationConeSize")),
19 debug_(
cfg.getUntrackedParameter<
bool>(
"debug",
false)) {
25 std::cout <<
"setting Quality cuts for signal PFCands:" << std::endl;
31 std::cout <<
"setting Quality cuts for isolation PFCands:" << std::endl;
94 std::cout <<
"<L1HPSPFTauBuilder::setL1PFTauSeed>:" << std::endl;
95 std::cout <<
"seeding HPSPFTau with ChargedPFCand:";
102 if (l1PFCandSeed->charge() != 0 && l1PFCandSeed->pfTrack().
isNonnull()) {
148 const std::vector<l1t::PFCandidateRef>& l1PFCands) {
150 std::cout <<
"<L1HPSPFTauBuilder::setL1PFTauSeed>:" << std::endl;
151 std::cout <<
"seeding HPSPFTau with Jet:";
152 std::cout <<
" pT = " << l1JetSeed->pt() <<
", eta = " << l1JetSeed->eta() <<
", phi = " << l1JetSeed->phi()
158 float l1PFTauSeedZVtx = 0.;
159 bool l1PFTauSeed_hasVtx =
false;
160 float max_chargedPFCand_pt = -1.;
161 for (
const auto& l1PFCand : l1PFCands) {
162 double dR =
reco::deltaR(l1PFCand->eta(), l1PFCand->phi(), l1JetSeed->eta(), l1JetSeed->phi());
167 l1PFTauSeed_p4 += l1PFCand->p4();
168 if (l1PFCand->charge() != 0 && l1PFCand->pfTrack().isNonnull() && l1PFCand->pt() > max_chargedPFCand_pt) {
169 l1PFTauSeedZVtx = l1PFCand->pfTrack()->vertex().z();
170 l1PFTauSeed_hasVtx =
true;
171 max_chargedPFCand_pt = l1PFCand->pt();
175 if (l1PFTauSeed_p4.pt() > 1. && l1PFTauSeed_hasVtx) {
185 std::cout <<
"<L1HPSPFTauBuilder::addL1PFCandidates>:" << std::endl;
194 for (
const auto& l1PFCand : l1PFCands) {
214 std::vector<double> emptyV;
215 std::vector<double> sumAllL1PFCandidatesPt(1);
231 bool isSignalPFCand =
false;
232 bool isStripPFCand =
false;
233 bool isElectron_or_Photon =
237 isSignalPFCand =
true;
241 isSignalPFCand =
true;
243 isStripPFCand =
true;
246 if (isSignalPFCand && passesSignalQualityCuts) {
260 if (isStripPFCand && passesSignalQualityCuts) {
274 if (isIsolationPFCand && passesIsolationQualityCuts) {
291 <<
" isSignalPFCand = " << isSignalPFCand <<
", isStripPFCand = " << isStripPFCand
292 <<
" (passesSignalQualityCuts = " << passesSignalQualityCuts <<
")," 293 <<
" isIsolationPFCand = " << isIsolationPFCand
294 <<
" (passesIsolationQualityCuts = " << passesIsolationQualityCuts <<
")" << std::endl;
298 for (
const auto& l1PFCand : l1PFCands) {
344 l1PFTau_p4 += l1PFCand->p4();
345 if (l1PFCand->charge() != 0 &&
404 double sumChargedIso = 0.;
405 double sumNeutralIso = 0.;
407 if (l1PFCand->charge() != 0) {
408 sumChargedIso += l1PFCand->pt();
410 sumNeutralIso += l1PFCand->pt();
415 const double weightNeutralIso = 1.;
416 const double offsetNeutralIso = 0.;
433 if (l1PFTau_p4.pt() != 0) {
452 for (
const auto& l1PFCand : l1PFCands) {
455 return l1PFCandsRefVector;
void setPassMediumRelIso(bool passMediumRelIso)
std::vector< l1t::PFCandidateRef > signalAllL1PFCandidates_
std::vector< L1HPSPFTauQualityCut > isolationQualityCutsDzCutDisabled_
bool isWithinSignalCone(const l1t::PFCandidate &l1PFCand)
void setSumChargedHadrons(l1t::PFCandidateRefVector sumChargedHadrons)
edm::ProductID l1PFCandProductID_
void setIsoElectrons(l1t::PFCandidateRefVector isoElectrons)
std::vector< l1t::PFCandidateRef > isoMuons_
void setLeadChargedPFCand(l1t::PFCandidateRef leadChargedPFCand)
void setPassVLooseRelIso(bool passVLooseRelIso)
void setL1PFCandProductID(const edm::ProductID &l1PFCandProductID)
std::vector< L1HPSPFTauQualityCut > isolationQualityCutsDzCutEnabledPrimary_
reco::Particle::LorentzVector stripP4_
std::vector< l1t::PFCandidateRef > sumChargedHadrons_
std::vector< L1HPSPFTauQualityCut > signalQualityCutsDzCutEnabledPrimary_
void setSignalNeutralHadrons(l1t::PFCandidateRefVector signalNeutralHadrons)
void addL1PFCandidates(const std::vector< l1t::PFCandidateRef > &l1PFCands)
void setPrimaryVertex(l1t::VertexWordRef primaryVertex)
void setIsoPhotons(l1t::PFCandidateRefVector isoPhotons)
bool isNonnull() const
Checks for non-null.
std::vector< l1t::PFCandidateRef > stripAllL1PFCandidates_
std::vector< l1t::PFCandidateRef > signalChargedHadrons_
void setIsoNeutralHadrons(l1t::PFCandidateRefVector isoNeutralHadrons)
void setStripAllL1PFCandidates(l1t::PFCandidateRefVector stripAllL1PFCandidates)
std::vector< l1t::PFCandidateRef > signalNeutralHadrons_
reco::FormulaEvaluator signalConeSizeFormula_
void setSignalElectrons(l1t::PFCandidateRefVector signalElectrons)
std::vector< l1t::PFCandidateRef > isoNeutralHadrons_
L1HPSPFTauBuilder(const edm::ParameterSet &cfg)
static const double deltaEta
std::vector< l1t::PFCandidateRef > sumAllL1PFCandidates_
float sumChargedIso() const
void setSumChargedIso(float sumChargedIso)
void setStripElectrons(l1t::PFCandidateRefVector stripElectrons)
std::vector< l1t::PFCandidateRef > stripPhotons_
void setSumElectrons(l1t::PFCandidateRefVector sumElectrons)
std::vector< l1t::PFCandidateRef > isoAllL1PFCandidates_
void setSumNeutralHadrons(l1t::PFCandidateRefVector sumNeutralHadrons)
void setIsoMuons(l1t::PFCandidateRefVector isoMuons)
std::vector< L1HPSPFTauQualityCut > isolationQualityCutsDzCutEnabledPileup_
void setL1PFTauSeed(const l1t::PFCandidateRef &l1PFCandSeed)
edm::Ref< VertexWordCollection > VertexWordRef
void setIsoChargedHadrons(l1t::PFCandidateRefVector isoChargedHadrons)
bool isWithinIsolationCone(const l1t::PFCandidate &l1PFCand)
std::vector< l1t::PFCandidateRef > stripElectrons_
void setTauType(Kind tauType)
std::vector< L1HPSPFTauQualityCut > readL1PFTauQualityCuts(const edm::ParameterSet &cfg, const std::string &dzCut, bool debug=false)
bool isWithinStrip(const l1t::PFCandidate &l1PFCand)
std::vector< l1t::PFCandidateRef > signalElectrons_
void setPassTightIso(bool passTightIso)
bool isNull() const
Checks for null.
std::vector< l1t::PFCandidateRef > isoElectrons_
void setSumChargedIsoPileup(float sumChargedIsoPileup)
void setSumCombinedIso(float sumCombinedIso)
std::vector< l1t::PFCandidateRef > sumPhotons_
l1t::PFCandidateRefVector convertToRefVector(const std::vector< l1t::PFCandidateRef > &l1PFCands)
edm::Ref< CaloJetCollection > CaloJetRef
edm references
void setVertex(const l1t::VertexWordRef &primaryVertex)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
l1t::VertexWordRef primaryVertex_
void setSumMuons(l1t::PFCandidateRefVector sumMuons)
void setIsoAllL1PFCandidates(l1t::PFCandidateRefVector isoAllL1PFCandidates)
void setPassVLooseIso(bool passVLooseIso)
std::vector< l1t::PFCandidateRef > isoChargedHadrons_
void setSignalChargedHadrons(l1t::PFCandidateRefVector signalChargedHadrons)
void setStripP4(reco::Particle::LorentzVector &stripP4)
void setSumPhotons(l1t::PFCandidateRefVector sumPhotons)
size_type size() const
Size of the RefVector.
void setPassTightRelIso(bool passTightRelIso)
void setSeedChargedPFCand(l1t::PFCandidateRef seedChargedPFCand)
std::vector< L1HPSPFTauQualityCut > signalQualityCutsDzCutDisabled_
reco::CaloJetRef l1JetSeed_
std::vector< l1t::PFCandidateRef > isoPhotons_
std::vector< l1t::PFCandidateRef > sumElectrons_
void printPFCand(ostream &os, const l1t::PFCandidate &l1PFCand, const l1t::VertexWordRef &primaryVertex)
void setPassMediumIso(bool passMediumIso)
bool isSelected(const std::vector< L1HPSPFTauQualityCut > &qualityCuts, const l1t::PFCandidate &pfCand, float_t primaryVertexZ)
void setSignalPhotons(l1t::PFCandidateRefVector signalPhotons)
void setSignalAllL1PFCandidates(l1t::PFCandidateRefVector signalAllL1PFCandidates)
void setSumAllL1PFCandidatesPt(float sumAllL1PFCandidatesPt)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
const l1t::PFCandidateRefVector & signalChargedHadrons() const
void setPassLooseIso(bool passLooseIso)
void setStripPhotons(l1t::PFCandidateRefVector stripPhotons)
double minSignalConeSize_
void setSeedJet(reco::CaloJetRef seedJet)
double maxSignalConeSize_
void setSignalMuons(l1t::PFCandidateRefVector signalMuons)
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
std::vector< l1t::PFCandidateRef > signalPhotons_
const l1t::PFCandidateRef & leadChargedPFCand() const
std::vector< l1t::PFCandidateRef > sumMuons_
double sumAllL1PFCandidatesPt_
edm::Ref< l1t::PFCandidateCollection > PFCandidateRef
std::vector< l1t::PFCandidateRef > signalMuons_
double phi() const final
momentum azimuthal angle
void setSignalConeSize(float signalConeSize)
primaryVertex
hltOfflineBeamSpot for HLTMON
l1t::PFCandidateRef l1PFCandSeed_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
double isolationConeSize2_
void setP4(const LorentzVector &p4) final
set 4-momentum
void setSumNeutralIso(float sumNeutralIso)
void setPassLooseRelIso(bool passLooseRelIso)
double sumChargedIsoPileup_
std::vector< l1t::PFCandidateRef > sumNeutralHadrons_
void setSumAllL1PFCandidates(l1t::PFCandidateRefVector sumAllL1PFCandidates)
void setisolationConeSize(float isolationConeSize)
double isolationConeSize_
double eta() const final
momentum pseudorapidity