34 : ecalSeedToken_{consumes<ElectronSeedCollection>(iConfig.
getParameter<
InputTag>(
"EcalBasedSeeds"))} {
36 if (!tkSeedLabel_.
label().empty())
37 tkSeedToken_ = consumes<ElectronSeedCollection>(tkSeedLabel_);
39 produces<ElectronSeedCollection>();
51 auto output = std::make_unique<ElectronSeedCollection>();
52 output->reserve(eSeeds.size() + tSeeds.size());
55 vector<bool> tSeedsMatched(tSeeds.size(),
false);
58 for (
auto newSeed : eSeeds) {
62 for (
auto const& tSeed : tSeeds) {
66 unsigned int hitShared = 0;
67 unsigned int hitSeed = 0;
68 for (
auto const& eh : newSeed.recHits()) {
73 for (
auto const& th : tSeed.recHits()) {
83 if (hitShared == hitSeed) {
84 tSeedsMatched[it] =
true;
85 newSeed.setCtfTrack(tSeed.ctfTrack());
88 if (hitShared == (hitSeed - 1)) {
89 newSeed.setCtfTrack(tSeed.ctfTrack());
90 }
else if ((hitShared > 0 || tSeed.nHits() == 0) && !newSeed.isTrackerDriven()) {
92 unsigned int hitSharedOnTrack = 0;
93 for (
auto const& eh : newSeed.recHits()) {
96 for (
auto const* th : tSeed.ctfTrack()->recHits()) {
106 if (hitSharedOnTrack == hitSeed) {
107 tSeedsMatched[it] =
true;
108 newSeed.setCtfTrack(tSeed.ctfTrack());
111 if (hitSharedOnTrack == (hitSeed - 1)) {
112 newSeed.setCtfTrack(tSeed.ctfTrack());
117 output->push_back(newSeed);
121 for (
unsigned int it = 0; it < tSeeds.size(); it++) {
122 if (!tSeedsMatched[it])
123 output->push_back(tSeeds[it]);
T getParameter(std::string const &) const
ElectronSeedMerger(const edm::ParameterSet &)
constexpr bool isUninitialized() const noexcept
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
#define DEFINE_FWK_MODULE(type)
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
edm::EDGetTokenT< reco::ElectronSeedCollection > tkSeedToken_
const edm::EDGetTokenT< reco::ElectronSeedCollection > ecalSeedToken_