50 std::unique_ptr<ElectronSeedGenerator>
matcher_;
73 if (legacyConfSeeds.label().
empty()) {
76 [
this](
edm::InputTag const&
tag) { return consumes<TrajectorySeedCollection>(tag); });
81 SCEtCut_ = conf.getParameter<
double>(
"SCEtCut");
84 auto theconsumes = consumesCollector();
93 hcalCfg.
hOverEConeSize = conf.getParameter<
double>(
"hOverEConeSize");
97 hcalCfg.
hOverEPtMin = conf.getParameter<
double>(
"hOverEPtMin");
99 hcalHelper_ = std::make_unique<ElectronHcalHelper>(hcalCfg);
101 allowHGCal_ = conf.getParameter<
bool>(
"allowHGCal");
104 hgcClusterTools_ = std::make_unique<hgcal::ClusterTools>(hgcCfg, theconsumes);
109 maxHBarrel_ = conf.getParameter<
double>(
"maxHBarrel");
110 maxHEndcaps_ = conf.getParameter<
double>(
"maxHEndcaps");
117 esg_tokens.token_vtx = mayConsume<reco::VertexCollection>(conf.getParameter<
edm::InputTag>(
"vertices"));
119 matcher_ = std::make_unique<ElectronSeedGenerator>(conf, esg_tokens);
132 if (prefilteredSeeds_) {
135 sf_tokens.
token_vtx = consumes<std::vector<reco::Vertex>>(rpset.getParameter<
edm::InputTag>(
"VertexProducer"));
138 seedFilter_ = std::make_unique<SeedFilter>(conf, sf_tokens, iC);
142 produces<ElectronSeedCollection>();
146 LogDebug(
"ElectronSeedProducer") <<
"[ElectronSeedProducer::produce] entering ";
148 std::vector<TrajectorySeedCollection const*> initialSeedCollections;
149 std::unique_ptr<TrajectorySeedCollection> initialSeedCollectionPtr =
nullptr;
164 initialSeedCollections.clear();
166 initialSeedCollections.push_back(&e.
get(seeds));
169 initialSeedCollections.clear();
170 initialSeedCollectionPtr = std::make_unique<TrajectorySeedCollection>();
173 auto seeds = std::make_unique<ElectronSeedCollection>();
177 for (
unsigned int i = 0;
i < 2;
i++) {
180 for (
auto const& sclRef : clusterRefs) {
181 seedFilter_->seeds(e, iSetup, sclRef, initialSeedCollectionPtr.
get());
182 initialSeedCollections.push_back(initialSeedCollectionPtr.get());
183 LogDebug(
"ElectronSeedProducer") <<
"Number of Seeds: " << initialSeedCollections.back()->size();
186 matcher_->run(e, iSetup, clusterRefs, initialSeedCollections, *seeds);
191 for (
auto const&
seed : *seeds) {
193 LogDebug(
"ElectronSeedProducer") <<
"new seed with " <<
seed.nHits() <<
" hits" 194 <<
", charge " <<
seed.getCharge() <<
" and cluster energy " 195 << superCluster->energy() <<
" PID " << superCluster.
id();
211 for (
unsigned int i = 0;
i < superClusters->size(); ++
i) {
212 auto const& scl = (*superClusters)[
i];
213 double sclEta =
EleRelPoint(scl.position(), beamSpotPosition).
eta();
214 if (scl.energy() / cosh(sclEta) >
SCEtCut_) {
216 bool hoeVeto =
false;
218 double scle = scl.energy();
219 int det_group = scl.seed()->hitsAndFractions()[0].first.det();
220 int detector = scl.seed()->hitsAndFractions()[0].first.subdetId();
226 float had_fraction =
hgcClusterTools_->getClusterHadronFraction(*(scl.seed()));
237 LogDebug(
"ElectronSeedProducer") <<
"Filtered out " << sclRefs.
size() <<
" superclusters from " 238 << superClusters->size();
246 {
"particleFlowSuperClusterECAL",
"particleFlowSuperClusterECALEndcapWithPreshower"});
249 psd1.
add<
std::string>(
"ComponentName",
"StandardHitPairGenerator");
253 psd2.
add<
double>(
"deltaPhiRegion", 0.4);
254 psd2.
add<
double>(
"originHalfLength", 15.0);
255 psd2.
add<
bool>(
"useZInVertex",
true);
256 psd2.
add<
double>(
"deltaEtaRegion", 0.1);
257 psd2.
add<
double>(
"ptMin", 1.5);
258 psd2.
add<
double>(
"originRadius", 0.2);
264 psd0.
add<std::vector<edm::InputTag>>(
"initialSeedsVector", {});
265 psd0.
add<
bool>(
"preFilteredSeeds",
false);
266 psd0.
add<
bool>(
"useRecoVertex",
false);
269 psd0.
add<
bool>(
"dynamicPhiRoad",
true);
272 psd0.
add<
edm::InputTag>(
"measurementTrackerEvent", {
"MeasurementTrackerEvent"});
275 psd0.
add<
double>(
"SCEtCut", 0.0);
278 psd0.
add<
bool>(
"applyHOverECut",
true);
279 psd0.
add<
double>(
"hOverEConeSize", 0.15);
280 psd0.
add<
double>(
"maxHOverEBarrel", 0.15);
281 psd0.
add<
double>(
"maxHOverEEndcaps", 0.15);
282 psd0.
add<
double>(
"maxHBarrel", 0.0);
283 psd0.
add<
double>(
"maxHEndcaps", 0.0);
287 psd0.
add<
double>(
"hOverEPtMin", 0.0);
290 psd0.
add<
bool>(
"allowHGCal",
false);
293 psd4.add<
edm::InputTag>(
"HGCFHInput", {
"HGCalRecHit",
"HGCHEFRecHits"});
294 psd4.add<
edm::InputTag>(
"HGCBHInput", {
"HGCalRecHit",
"HGCHEBRecHits"});
298 psd0.
add<
double>(
"nSigmasDeltaZ1", 5.0);
299 psd0.
add<
double>(
"deltaZ1WithVertex", 25.0);
300 psd0.
add<
double>(
"z2MinB", -0.09);
301 psd0.
add<
double>(
"z2MaxB", 0.09);
302 psd0.
add<
double>(
"r2MinF", -0.15);
303 psd0.
add<
double>(
"r2MaxF", 0.15);
304 psd0.
add<
double>(
"rMinI", -0.2);
305 psd0.
add<
double>(
"rMaxI", 0.2);
308 psd0.
add<
double>(
"LowPtThreshold", 5.0);
309 psd0.
add<
double>(
"HighPtThreshold", 35.0);
310 psd0.
add<
double>(
"SizeWindowENeg", 0.675);
311 psd0.
add<
double>(
"DeltaPhi1Low", 0.23);
312 psd0.
add<
double>(
"DeltaPhi1High", 0.08);
313 psd0.
add<
double>(
"DeltaPhi2B", 0.008);
314 psd0.
add<
double>(
"DeltaPhi2F", 0.012);
317 psd0.
add<
double>(
"ePhiMin1", -0.125);
318 psd0.
add<
double>(
"ePhiMax1", 0.075);
319 psd0.
add<
double>(
"pPhiMin1", -0.075);
320 psd0.
add<
double>(
"pPhiMax1", 0.125);
321 psd0.
add<
double>(
"PhiMin2B", -0.002);
322 psd0.
add<
double>(
"PhiMax2B", 0.002);
323 psd0.
add<
double>(
"PhiMin2F", -0.003);
324 psd0.
add<
double>(
"PhiMax2F", 0.003);
326 psd3.
add<
std::string>(
"ComponentName",
"SeedFromConsecutiveHitsCreator");
328 psd3.
add<
double>(
"SeedMomentumForBOFF", 5.0);
329 psd3.
add<
double>(
"OriginTransverseErrorMultiplier", 1.0);
330 psd3.
add<
double>(
"MinOneOverPtError", 1.0);
333 psd3.
add<
bool>(
"forceKinematicWithRegionDirection",
false);
340 {
"particleFlowSuperClusterECAL",
"particleFlowSuperClusterECALBarrel"});
341 descriptions.
add(
"ecalDrivenElectronSeeds", desc);
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< reco::BeamSpot > token_bs
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::unique_ptr< ElectronHcalHelper > hcalHelper_
ProductID id() const
Accessor for product ID.
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
#define DEFINE_FWK_MODULE(type)
ElectronSeedProducer(const edm::ParameterSet &)
bool get(ProductID const &oid, Handle< PROD > &result) const
reco::SuperClusterRefVector filterClusters(math::XYZPoint const &beamSpotPosition, const edm::Handle< reco::SuperClusterCollection > &superClusters) const
std::unique_ptr< ElectronSeedGenerator > matcher_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::unique_ptr< SeedFilter > seedFilter_
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 >
ParameterSet const & getParameterSet(std::string const &) const
XYZPointD XYZPoint
point in space with cartesian internal representation
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< reco::SuperClusterCollection > superClusters_[2]
edm::EDGetTokenT< reco::BeamSpot > token_bs
void produce(edm::Event &, const edm::EventSetup &) final
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
size_type size() const
Size of the RefVector.
edm::EDGetTokenT< CaloTowerCollection > hcalTowers
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
edm::EDGetTokenT< std::vector< reco::Vertex > > token_vtx
std::unique_ptr< hgcal::ClusterTools > hgcClusterTools_
std::vector< edm::EDGetTokenT< TrajectorySeedCollection > > initialSeeds_