26 std::vector<edm::EDGetTokenT<pat::PackedCandidateCollection>>
setTokens(
const std::vector<edm::InputTag>&
tags);
31 const std::vector<T>&
values,
34 std::vector<SuperclusTkIsolFromCands::PIDVeto>
candVetos_;
37 const std::vector<edm::EDGetTokenT<pat::PackedCandidateCollection>>
candTokens_;
49 candTokens_(setTokens(candTags_)),
53 trkIsoCalcCfg_(iConfig.getParameter<
edm::
ParameterSet>(
"trkIsoConfig")) {
54 auto fillVetos = [](
const auto&
in,
auto&
out) {
61 throw cms::Exception(
"ConfigError") <<
"Error candVetos should be the same size as cands" << std::endl;
78 if (pvHandle.
isValid() && !pvHandle->empty())
79 pos = pvHandle->front().position();
81 pos = (*bsHandle).position();
83 std::vector<edm::Handle<pat::PackedCandidateCollection>> candHandles(
candTokens_.size());
84 std::vector<std::unique_ptr<SuperclusTkIsolFromCands>> tkIsoCalc;
92 std::vector<float> vecTkIso;
93 vecTkIso.reserve(scHandle->size());
95 for (
const auto& sc : *scHandle) {
98 for (
auto& calc : tkIsoCalc)
99 tkIso += (*calc)(sc,
pos).ptSum;
101 vecTkIso.push_back(tkIso);
108 const std::vector<edm::InputTag>&
tags) {
109 std::vector<edm::EDGetTokenT<pat::PackedCandidateCollection>>
out;
112 out.push_back(consumes<pat::PackedCandidateCollection>(
tag));
117 template <
typename T>
120 const std::vector<T>&
values,
T getParameter(std::string const &) const
std::vector< SuperclusTkIsolFromCands::PIDVeto > candVetos_
const std::string superclusTkIsoLabel_
std::vector< edm::EDGetTokenT< pat::PackedCandidateCollection > > setTokens(const std::vector< edm::InputTag > &tags)
SuperclusValueMapProducer(const edm::ParameterSet &)
const std::vector< edm::InputTag > candTags_
const edm::EDGetTokenT< edm::View< reco::SuperCluster > > scToken_
const std::vector< edm::EDGetTokenT< pat::PackedCandidateCollection > > candTokens_
static void writeValueMap(edm::Event &iEvent, const edm::Handle< edm::View< reco::SuperCluster >> &handle, const std::vector< T > &values, const std::string &label)
#define DEFINE_FWK_MODULE(type)
const SuperclusTkIsolFromCands::Configuration trkIsoCalcCfg_
~SuperclusValueMapProducer()=default
static PIDVeto pidVetoFromStr(const std::string &vetoStr)
XYZPointD XYZPoint
point in space with cartesian internal representation
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
const edm::EDGetTokenT< edm::View< reco::Vertex > > pvToken_
void produce(edm::Event &, const edm::EventSetup &) override