49 std::unique_ptr<ElectronSeedGenerator>
matcher_;
68 [
this](
edm::InputTag const&
tag) { return consumes<TrajectorySeedCollection>(tag); })}
71 SCEtCut_ = conf.getParameter<
double>(
"SCEtCut");
72 auto theconsumes = consumesCollector();
75 beamSpotTag_ = consumes(conf.getParameter<
edm::InputTag>(
"beamSpot"));
78 applyHOverECut_ = conf.getParameter<
bool>(
"applyHOverECut");
79 if (applyHOverECut_) {
81 hcalCfg.
hOverEConeSize = conf.getParameter<
double>(
"hOverEConeSize");
82 if (hcalCfg.hOverEConeSize > 0) {
83 hcalCfg.onlyBehindCluster =
false;
84 hcalCfg.checkHcalStatus =
false;
86 hcalCfg.hbheRecHits = consumes<HBHERecHitCollection>(conf.getParameter<
edm::InputTag>(
"hbheRecHits"));
89 hcalCfg.maxSeverityHB = conf.getParameter<
int>(
"maxHcalRecHitSeverity");
91 hcalCfg.maxSeverityHE = hcalCfg.maxSeverityHB;
93 hcalHelper_ = std::make_unique<ElectronHcalHelper>(hcalCfg, consumesCollector());
95 allowHGCal_ = conf.getParameter<
bool>(
"allowHGCal");
98 hgcClusterTools_ = std::make_unique<hgcal::ClusterTools>(hgcCfg, theconsumes);
101 maxHOverEBarrel_ = conf.
getParameter<
double>(
"maxHOverEBarrel");
102 maxHOverEEndcaps_ = conf.getParameter<
double>(
"maxHOverEEndcaps");
109 matcher_ = std::make_unique<ElectronSeedGenerator>(conf, esg_tokens, consumesCollector());
111 superClusters_[0] = consumes(conf.getParameter<
edm::InputTag>(
"barrelSuperClusters"));
112 superClusters_[1] = consumes(conf.getParameter<
edm::InputTag>(
"endcapSuperClusters"));
115 produces<ElectronSeedCollection>();
119 LogDebug(
"ElectronSeedProducer") <<
"[ElectronSeedProducer::produce] entering ";
121 std::vector<TrajectorySeedCollection const*> initialSeedCollections;
122 std::unique_ptr<TrajectorySeedCollection> initialSeedCollectionPtr =
nullptr;
135 initialSeedCollections.clear();
137 initialSeedCollections.push_back(&
e.get(
seeds));
140 auto seeds = std::make_unique<ElectronSeedCollection>();
141 auto const& beamSportPosition =
e.get(
beamSpotTag_).position();
144 for (
unsigned int i = 0;
i < 2;
i++) {
153 LogDebug(
"ElectronSeedProducer") <<
"new seed with " <<
seed.nHits() <<
" hits" 154 <<
", charge " <<
seed.getCharge() <<
" and cluster energy " 155 << superCluster->energy() <<
" PID " << superCluster.
id();
172 auto const& scl = (*superClusters)[
i];
173 double sclEta =
EleRelPoint(scl.position(), beamSpotPosition).
eta();
174 if (scl.energy() / cosh(sclEta) >
SCEtCut_) {
176 bool hoeVeto =
false;
178 double scle = scl.energy();
179 int det_group = scl.seed()->hitsAndFractions()[0].first.det();
180 int detector = scl.seed()->hitsAndFractions()[0].first.subdetId();
186 float had_fraction =
hgcClusterTools_->getClusterHadronFraction(*(scl.seed()));
197 LogDebug(
"ElectronSeedProducer") <<
"Filtered out " << sclRefs.
size() <<
" superclusters from " 207 desc.add<std::vector<edm::InputTag>>(
"initialSeedsVector", {});
208 desc.add<
bool>(
"useRecoVertex",
false);
211 desc.add<
bool>(
"dynamicPhiRoad",
true);
214 desc.add<
double>(
"SCEtCut", 0.0);
217 desc.add<
bool>(
"applyHOverECut",
true);
218 desc.add<
double>(
"hOverEConeSize", 0.15);
219 desc.add<
double>(
"maxHOverEBarrel", 0.15);
220 desc.add<
double>(
"maxHOverEEndcaps", 0.15);
222 desc.add<std::vector<double>>(
"recHitEThresholdHB", {0., 0., 0., 0.});
223 desc.add<std::vector<double>>(
"recHitEThresholdHE", {0., 0., 0., 0., 0., 0., 0.});
224 desc.add<
int>(
"maxHcalRecHitSeverity", 999999);
227 desc.add<
bool>(
"allowHGCal",
false);
230 psd4.add<
edm::InputTag>(
"HGCFHInput", {
"HGCalRecHit",
"HGCHEFRecHits"});
231 psd4.add<
edm::InputTag>(
"HGCBHInput", {
"HGCalRecHit",
"HGCHEBRecHits"});
235 desc.add<
double>(
"nSigmasDeltaZ1", 5.0);
236 desc.add<
double>(
"deltaZ1WithVertex", 25.0);
237 desc.add<
double>(
"z2MaxB", 0.09);
238 desc.add<
double>(
"r2MaxF", 0.15);
239 desc.add<
double>(
"rMaxI", 0.2);
242 desc.add<
double>(
"LowPtThreshold", 5.0);
243 desc.add<
double>(
"HighPtThreshold", 35.0);
244 desc.add<
double>(
"SizeWindowENeg", 0.675);
245 desc.add<
double>(
"DeltaPhi1Low", 0.23);
246 desc.add<
double>(
"DeltaPhi1High", 0.08);
247 desc.add<
double>(
"DeltaPhi2B", 0.008);
248 desc.add<
double>(
"DeltaPhi2F", 0.012);
251 desc.add<
double>(
"ePhiMin1", -0.125);
252 desc.add<
double>(
"ePhiMax1", 0.075);
253 desc.add<
double>(
"PhiMax2B", 0.002);
254 desc.add<
double>(
"PhiMax2F", 0.003);
257 {
"particleFlowSuperClusterECAL",
"particleFlowSuperClusterECALBarrel"});
259 {
"particleFlowSuperClusterECAL",
"particleFlowSuperClusterECALEndcapWithPreshower"});
261 descriptions.
add(
"ecalDrivenElectronSeedsDefault",
desc);
T getParameter(std::string const &) const
ProductID id() const
Accessor for product ID.
edm::EDGetTokenT< reco::BeamSpot > token_bs
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
reco::SuperClusterRefVector filterClusters(math::XYZPoint const &beamSpotPosition, const edm::Handle< reco::SuperClusterCollection > &superClusters) const
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
std::unique_ptr< hgcal::ClusterTools > hgcClusterTools_
std::vector< edm::EDGetTokenT< TrajectorySeedCollection > > initialSeeds_
std::array< double, 7 > arrayHE