6 : moduleLabel_(
cfg.getParameter<
std::
string>(
"@module_label")),
8 useChargedPFCandSeeds_(
cfg.getParameter<
bool>(
"useChargedPFCandSeeds")),
9 minSeedChargedPFCandPt_(
cfg.getParameter<double>(
"minSeedChargedPFCandPt")),
10 maxSeedChargedPFCandEta_(
cfg.getParameter<double>(
"maxSeedChargedPFCandEta")),
11 maxSeedChargedPFCandDz_(
cfg.getParameter<double>(
"maxSeedChargedPFCandDz")),
12 useJetSeeds_(
cfg.getParameter<
bool>(
"useJetSeeds")),
13 minSeedJetPt_(
cfg.getParameter<double>(
"minSeedJetPt")),
14 maxSeedJetEta_(
cfg.getParameter<double>(
"maxSeedJetEta")),
15 minPFTauPt_(
cfg.getParameter<double>(
"minPFTauPt")),
16 maxPFTauEta_(
cfg.getParameter<double>(
"maxPFTauEta")),
17 minLeadChargedPFCandPt_(
cfg.getParameter<double>(
"minLeadChargedPFCandPt")),
18 maxLeadChargedPFCandEta_(
cfg.getParameter<double>(
"maxLeadChargedPFCandEta")),
19 maxLeadChargedPFCandDz_(
cfg.getParameter<double>(
"maxLeadChargedPFCandDz")),
20 maxChargedIso_(
cfg.getParameter<double>(
"maxChargedIso")),
21 maxChargedRelIso_(
cfg.getParameter<double>(
"maxChargedRelIso")),
22 deltaRCleaning_(
cfg.getParameter<double>(
"deltaRCleaning")),
23 applyPreselection_(
cfg.getParameter<
bool>(
"applyPreselection")),
24 debug_(
cfg.getUntrackedParameter<
bool>(
"debug",
false)) {
42 produces<l1t::HPSPFTauCollection>();
47 return l1PFCand1->pt() > l1PFCand2->pt();
51 return l1PFTau1.
pt() > l1PFTau2.
pt();
62 float primaryVertex_z = 0.;
73 std::vector<l1t::PFCandidateRef> selectedL1PFCandsSignalQualityCuts;
74 std::vector<l1t::PFCandidateRef> selectedL1PFCandsSignalOrIsolationQualityCuts;
75 size_t numL1PFCands = l1PFCands->size();
76 for (
size_t idxL1PFCand = 0; idxL1PFCand < numL1PFCands; ++idxL1PFCand) {
80 if (passesSignalQualityCuts) {
81 selectedL1PFCandsSignalQualityCuts.push_back(l1PFCand);
83 if (passesSignalQualityCuts || passesIsolationQualityCuts) {
84 selectedL1PFCandsSignalOrIsolationQualityCuts.push_back(l1PFCand);
89 std::sort(selectedL1PFCandsSignalQualityCuts.begin(), selectedL1PFCandsSignalQualityCuts.end(), isHigherPt_pfCandRef);
90 std::sort(selectedL1PFCandsSignalOrIsolationQualityCuts.begin(),
91 selectedL1PFCandsSignalOrIsolationQualityCuts.end(),
92 isHigherPt_pfCandRef);
97 for (
const auto& l1PFCand : selectedL1PFCandsSignalQualityCuts) {
100 bool isFromPrimaryVertex =
false;
103 double dz = std::fabs(l1PFTrack->vertex().z() - primaryVertex_z);
105 isFromPrimaryVertex =
true;
108 isFromPrimaryVertex =
true;
110 if (isFromPrimaryVertex) {
119 l1PFTauCollectionUncleaned.push_back(l1PFTau);
129 size_t numL1Jets = l1Jets->size();
130 for (
size_t idxL1Jet = 0; idxL1Jet < numL1Jets; ++idxL1Jet) {
142 l1PFTauCollectionUncleaned.push_back(l1PFTau);
148 std::sort(l1PFTauCollectionUncleaned.begin(), l1PFTauCollectionUncleaned.end(), isHigherPt_pfTau);
150 for (
const auto& l1PFTau : l1PFTauCollectionUncleaned) {
156 (
primaryVertex.isNonnull() && l1PFTau.leadChargedPFCand()->pfTrack().isNonnull() &&
157 std::fabs(l1PFTau.leadChargedPFCand()->pfTrack()->vertex().z() -
primaryVertex->z0()) <
162 bool isOverlap =
false;
163 for (
const auto& l1PFTau2 : *l1PFTauCollectionCleaned) {
171 l1PFTauCollectionCleaned->push_back(l1PFTau);
184 desc.add<
bool>(
"useJetSeeds",
true);
185 desc.add<
double>(
"minPFTauPt", 20.0);
186 desc.add<
double>(
"minSignalConeSize", 0.05);
191 psd1.
add<
double>(
"minPt", 0.0);
196 psd1.
add<
double>(
"maxDz", 0.4);
197 psd1.
add<
double>(
"minPt", 0.0);
202 psd1.
add<
double>(
"maxDz", 0.4);
203 psd1.
add<
double>(
"minPt", 0.0);
208 psd1.
add<
double>(
"minPt", 0.0);
213 psd1.
add<
double>(
"maxDz", 0.4);
214 psd1.
add<
double>(
"minPt", 0.0);
219 desc.add<
double>(
"stripSizePhi", 0.2);
220 desc.add<
double>(
"minSeedJetPt", 30.0);
221 desc.add<
double>(
"maxChargedRelIso", 1.0);
222 desc.add<
double>(
"minSeedChargedPFCandPt", 5.0);
224 desc.add<
double>(
"stripSizeEta", 0.05);
225 desc.add<
double>(
"maxLeadChargedPFCandEta", 2.4);
226 desc.add<
double>(
"deltaRCleaning", 0.4);
227 desc.add<
bool>(
"useStrips",
true);
228 desc.add<
double>(
"maxSeedChargedPFCandDz", 1000.0);
229 desc.add<
double>(
"minLeadChargedPFCandPt", 1.0);
230 desc.add<
double>(
"maxSeedChargedPFCandEta", 2.4);
231 desc.add<
bool>(
"applyPreselection",
false);
232 desc.add<
double>(
"isolationConeSize", 0.4);
234 desc.add<
double>(
"maxChargedIso", 1000.0);
239 psd1.
add<
double>(
"minPt", 0.0);
244 psd1.
add<
double>(
"maxDz", 0.4);
245 psd1.
add<
double>(
"minPt", 0.0);
250 psd1.
add<
double>(
"maxDz", 0.4);
251 psd1.
add<
double>(
"minPt", 0.0);
256 psd1.
add<
double>(
"minPt", 0.0);
261 psd1.
add<
double>(
"maxDz", 0.4);
262 psd1.
add<
double>(
"minPt", 0.0);
267 desc.add<
bool>(
"useChargedPFCandSeeds",
true);
268 desc.add<
double>(
"maxLeadChargedPFCandDz", 1000.0);
269 desc.add<
double>(
"maxSeedJetEta", 2.4);
272 edm::InputTag(
"l1tPhase1JetCalibrator9x9trimmed",
"Phase1L1TJetFromPfCandidates"));
273 desc.addUntracked<
bool>(
"debug",
false);
274 desc.add<
double>(
"maxPFTauEta", 2.4);
275 desc.add<
double>(
"maxSignalConeSize", 0.1);
edm::InputTag srcL1Vertices_
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
double pt() const final
transverse momentum
double maxLeadChargedPFCandEta_
void setL1PFCandProductID(const edm::ProductID &l1PFCandProductID)
void addL1PFCandidates(const std::vector< l1t::PFCandidateRef > &l1PFCands)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< HPSPFTau > HPSPFTauCollection
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static const double deltaEta
L1HPSPFTauBuilder tauBuilder_
double maxSeedChargedPFCandEta_
bool useChargedPFCandSeeds_
double minLeadChargedPFCandPt_
void produce(edm::Event &evt, const edm::EventSetup &es) override
void setL1PFTauSeed(const l1t::PFCandidateRef &l1PFCandSeed)
edm::Ref< VertexWordCollection > VertexWordRef
#define DEFINE_FWK_MODULE(type)
double minSeedChargedPFCandPt_
std::vector< L1HPSPFTauQualityCut > readL1PFTauQualityCuts(const edm::ParameterSet &cfg, const std::string &dzCut, bool debug=false)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void setVertex(const l1t::VertexWordRef &primaryVertex)
double maxSeedChargedPFCandDz_
bool isSelected(const std::vector< L1HPSPFTauQualityCut > &qualityCuts, const l1t::PFCandidate &pfCand, float_t primaryVertexZ)
std::vector< L1HPSPFTauQualityCut > isolationQualityCutsDzCutDisabled_
edm::EDGetTokenT< std::vector< reco::CaloJet > > tokenL1Jets_
l1t::HPSPFTau getL1PFTau() const
HPSPFTauProducer(const edm::ParameterSet &cfg)
edm::InputTag srcL1PFCands_
double maxLeadChargedPFCandDz_
std::vector< L1HPSPFTauQualityCut > signalQualityCutsDzCutDisabled_
edm::EDGetTokenT< l1t::PFCandidateCollection > tokenL1PFCands_
double phi() const final
momentum azimuthal angle
primaryVertex
hltOfflineBeamSpot for HLTMON
edm::EDGetTokenT< l1t::VertexWordCollection > tokenL1Vertices_
double eta() const final
momentum pseudorapidity