48 : gsfPfRecTracks_{consumes<reco::GsfPFRecTrackCollection>(
cfg.getParameter<
edm::InputTag>(
"gsfPfRecTracks"))},
49 ecalClusters_{consumes<reco::PFClusterCollection>(
cfg.getParameter<
edm::InputTag>(
"ecalClusters"))},
50 dr2_{
cfg.getParameter<
double>(
"MaxDeltaR2")} {
51 produces<reco::CaloClusterCollection>();
52 produces<reco::SuperClusterCollection>();
53 produces<edm::ValueMap<reco::SuperClusterRef> >();
71 std::vector<reco::SuperClusterRef> superClustersValueMap;
78 std::vector<std::vector<int> > cluster_idx;
82 std::vector<std::vector<int> > pfcluster_idx;
86 std::vector<std::vector<float> > cluster_dr2min;
90 std::vector<std::vector<const reco::PFTrajectoryPoint*> >
points;
94 std::vector<const reco::PFTrajectoryPoint*> traj;
95 traj.reserve(trk.PFRecBrem().size() + 1);
96 traj.push_back(&trk.extrapolatedPoint(reco::PFTrajectoryPoint::LayerType::ECALShowerMax));
98 for (
auto const& brem : trk.PFRecBrem()) {
99 traj.push_back(&brem.extrapolatedPoint(reco::PFTrajectoryPoint::LayerType::ECALShowerMax));
101 auto size = traj.size();
104 cluster_idx.emplace_back(
size, -1);
105 pfcluster_idx.emplace_back(
size, -1);
106 cluster_dr2min.emplace_back(
size, 1.e6);
110 for (
size_t iclu = 0; iclu <
ecalClusters.size(); ++iclu) {
111 std::pair<int, int>
point = std::make_pair(-1, -1);
114 for (
size_t jpoint = 0; jpoint <
points[
ipoint].size(); ++jpoint) {
126 dr2min < cluster_dr2min[
point.first][
point.second]) {
130 cluster_idx[
point.first][
point.second] = caloClusters->size() - 1;
131 pfcluster_idx[
point.first][
point.second] = iclu;
132 cluster_dr2min[
point.first][
point.second] = dr2min;
143 float X = 0.,
Y = 0.,
Z = 0.;
146 std::vector<const reco::PFCluster*> barePtrs;
152 if (cluster_idx[itrk][
ipoint] < 0) {
155 if (cluster_dr2min[itrk][
ipoint] < dr2) {
156 dr2 = cluster_dr2min[itrk][
ipoint];
163 if (cluster_idx[itrk][
ipoint] < 0) {
178 energy += clu->correctedEnergy();
179 X += clu->position().X() * clu->correctedEnergy();
180 Y += clu->position().Y() * clu->correctedEnergy();
181 Z += clu->position().Z() * clu->correctedEnergy();
192 if (
seed.isNonnull()) {
227 if (
point.isValid()) {
238 if (dr2min < (
dr2_ - 1.
e-6)) {
252 desc.add<
double>(
"MaxDeltaR2", 0.5);
253 descriptions.
add(
"lowPtGsfElectronSuperClusters",
desc);
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
const edm::EDGetTokenT< reco::PFClusterCollection > ecalClusters_
double pflowPhiWidth() const
int closest(std::vector< int > const &vec, int value)
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
double pflowEtaWidth() const
const edm::EDGetTokenT< reco::GsfPFRecTrackCollection > gsfPfRecTracks_
void setSeed(const CaloClusterPtr &r)
list of used xtals by DetId // now inherited by CaloCluster
static void fillDescriptions(edm::ConfigurationDescriptions &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void setPhiWidth(double pw)
void setClusters(const CaloClusterPtrVector &clusters)
void setEtaWidth(double ew)
bool isNull() const
Checks for null.
void produce(edm::Event &, const edm::EventSetup &) override
LowPtGsfElectronSCProducer(const edm::ParameterSet &)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
void setCorrectedEnergy(double cenergy)
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
std::vector< CaloCluster > CaloClusterCollection
collection of CaloCluster objects
#define DEFINE_FWK_MODULE(type)
reco::PFClusterRef closestCluster(const reco::PFTrajectoryPoint &point, const edm::Handle< reco::PFClusterCollection > &clusters, std::vector< int > &matched)
ProductID id() const
Accessor for product ID.
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
XYZPointD XYZPoint
point in space with cartesian internal representation
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
auto makeValid(const U &iOtherHandleType) noexcept(false)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point