53 std::unique_ptr<ElectronSeedGenerator>
matcher_;
75 [
this](
edm::InputTag const&
tag) { return consumes<TrajectorySeedCollection>(tag); })}
78 SCEtCut_ = conf.getParameter<
double>(
"SCEtCut");
79 auto theconsumes = consumesCollector();
82 beamSpotTag_ = consumes(conf.getParameter<
edm::InputTag>(
"beamSpot"));
85 applyHOverECut_ = conf.getParameter<
bool>(
"applyHOverECut");
86 if (applyHOverECut_) {
88 hcalCfg.
hOverEConeSize = conf.getParameter<
double>(
"hOverEConeSize");
89 if (hcalCfg.hOverEConeSize > 0) {
90 hcalCfg.onlyBehindCluster =
false;
91 hcalCfg.checkHcalStatus =
false;
93 hcalCfg.hbheRecHits = consumes<HBHERecHitCollection>(conf.getParameter<
edm::InputTag>(
"hbheRecHits"));
96 hcalCfg.maxSeverityHB = conf.getParameter<
int>(
"maxHcalRecHitSeverity");
98 hcalCfg.maxSeverityHE = hcalCfg.maxSeverityHB;
100 hcalHelper_ = std::make_unique<ElectronHcalHelper>(hcalCfg, consumesCollector());
102 allowHGCal_ = conf.getParameter<
bool>(
"allowHGCal");
105 hgcClusterTools_ = std::make_unique<hgcal::ClusterTools>(hgcCfg, theconsumes);
108 maxHOverEBarrel_ = conf.
getParameter<
double>(
"maxHOverEBarrel");
109 maxHOverEEndcaps_ = conf.getParameter<
double>(
"maxHOverEEndcaps");
113 cutsFromDB_ = conf.getParameter<
bool>(
"usePFThresholdsFromDB");
115 hcalCutsToken_ = esConsumes<HcalPFCuts, HcalPFCutsRcd>(
edm::ESInputTag(
"",
"withTopo"));
122 matcher_ = std::make_unique<ElectronSeedGenerator>(conf, esg_tokens, consumesCollector());
124 superClusters_[0] = consumes(conf.getParameter<
edm::InputTag>(
"barrelSuperClusters"));
125 superClusters_[1] = consumes(conf.getParameter<
edm::InputTag>(
"endcapSuperClusters"));
128 produces<ElectronSeedCollection>();
132 LogDebug(
"ElectronSeedProducer") <<
"[ElectronSeedProducer::produce] entering ";
139 std::vector<TrajectorySeedCollection const*> initialSeedCollections;
140 std::unique_ptr<TrajectorySeedCollection> initialSeedCollectionPtr =
nullptr;
153 initialSeedCollections.clear();
155 initialSeedCollections.push_back(&
e.get(
seeds));
158 auto seeds = std::make_unique<ElectronSeedCollection>();
159 auto const& beamSpotPosition =
e.get(
beamSpotTag_).position();
162 for (
unsigned int i = 0;
i < 2;
i++) {
171 LogDebug(
"ElectronSeedProducer") <<
"new seed with " <<
seed.nHits() <<
" hits" 172 <<
", charge " <<
seed.getCharge() <<
" and cluster energy " 173 << superCluster->energy() <<
" PID " << superCluster.
id();
192 auto const& scl = (*superClusters)[
i];
193 double sclEta =
EleRelPoint(scl.position(), beamSpotPosition).
eta();
194 if (scl.energy() / cosh(sclEta) >
SCEtCut_) {
196 bool hoeVeto =
false;
197 double had =
hcalHelper_->hcalESum(scl, 0, hcalCuts);
198 double scle = scl.energy();
199 int det_group = scl.seed()->hitsAndFractions()[0].first.det();
200 int detector = scl.seed()->hitsAndFractions()[0].first.subdetId();
206 float had_fraction =
hgcClusterTools_->getClusterHadronFraction(*(scl.seed()));
217 LogDebug(
"ElectronSeedProducer") <<
"Filtered out " << sclRefs.
size() <<
" superclusters from " 227 desc.add<std::vector<edm::InputTag>>(
"initialSeedsVector", {});
228 desc.add<
bool>(
"useRecoVertex",
false);
231 desc.add<
bool>(
"dynamicPhiRoad",
true);
234 desc.add<
double>(
"SCEtCut", 0.0);
237 desc.add<
bool>(
"applyHOverECut",
true);
238 desc.add<
double>(
"hOverEConeSize", 0.15);
239 desc.add<
double>(
"maxHOverEBarrel", 0.15);
240 desc.add<
double>(
"maxHOverEEndcaps", 0.15);
242 desc.add<std::vector<double>>(
"recHitEThresholdHB", {0., 0., 0., 0.});
243 desc.add<std::vector<double>>(
"recHitEThresholdHE", {0., 0., 0., 0., 0., 0., 0.});
244 desc.add<
int>(
"maxHcalRecHitSeverity", 999999);
245 desc.add<
bool>(
"usePFThresholdsFromDB",
false);
248 desc.add<
bool>(
"allowHGCal",
false);
251 psd4.add<
edm::InputTag>(
"HGCFHInput", {
"HGCalRecHit",
"HGCHEFRecHits"});
252 psd4.add<
edm::InputTag>(
"HGCBHInput", {
"HGCalRecHit",
"HGCHEBRecHits"});
256 desc.add<
double>(
"nSigmasDeltaZ1", 5.0);
257 desc.add<
double>(
"deltaZ1WithVertex", 25.0);
258 desc.add<
double>(
"z2MaxB", 0.09);
259 desc.add<
double>(
"r2MaxF", 0.15);
260 desc.add<
double>(
"rMaxI", 0.2);
263 desc.add<
double>(
"LowPtThreshold", 5.0);
264 desc.add<
double>(
"HighPtThreshold", 35.0);
265 desc.add<
double>(
"SizeWindowENeg", 0.675);
266 desc.add<
double>(
"DeltaPhi1Low", 0.23);
267 desc.add<
double>(
"DeltaPhi1High", 0.08);
268 desc.add<
double>(
"DeltaPhi2B", 0.008);
269 desc.add<
double>(
"DeltaPhi2F", 0.012);
272 desc.add<
double>(
"ePhiMin1", -0.125);
273 desc.add<
double>(
"ePhiMax1", 0.075);
274 desc.add<
double>(
"PhiMax2B", 0.002);
275 desc.add<
double>(
"PhiMax2F", 0.003);
278 {
"particleFlowSuperClusterECAL",
"particleFlowSuperClusterECALBarrel"});
280 {
"particleFlowSuperClusterECAL",
"particleFlowSuperClusterECALEndcapWithPreshower"});
282 descriptions.
add(
"ecalDrivenElectronSeedsDefault",
desc);
T getParameter(std::string const &) const
ProductID id() const
Accessor for product ID.
edm::EDGetTokenT< reco::BeamSpot > token_bs
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_
ParameterSet const & getParameterSet(std::string const &) const
std::unique_ptr< ElectronHcalHelper > hcalHelper_
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
ElectronSeedProducer(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
std::unique_ptr< ElectronSeedGenerator > matcher_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
size_type size() const
Size of the RefVector.
XYZPointD XYZPoint
point in space with cartesian internal representation
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< reco::SuperClusterCollection > superClusters_[2]
void produce(edm::Event &, const edm::EventSetup &) final
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
std::array< double, 4 > arrayHB
edm::EDGetTokenT< std::vector< reco::Vertex > > token_vtx
reco::SuperClusterRefVector filterClusters(math::XYZPoint const &beamSpotPosition, const edm::Handle< reco::SuperClusterCollection > &superClusters, HcalPFCuts const *hcalCuts) const
std::unique_ptr< hgcal::ClusterTools > hgcClusterTools_
std::vector< edm::EDGetTokenT< TrajectorySeedCollection > > initialSeeds_
std::array< double, 7 > arrayHE