57 std::vector<edm::EDGetTokenT<l1t::PFClusterCollection>>
emCands_;
58 std::vector<edm::EDGetTokenT<l1t::PFClusterCollection>>
hadCands_;
87 debug_(iConfig.getUntrackedParameter<
int>(
"debug", 0)),
88 useStandaloneMuons_(iConfig.getParameter<
bool>(
"useStandaloneMuons")),
89 useTrackerMuons_(iConfig.getParameter<
bool>(
"useTrackerMuons")),
93 trkPt_(iConfig.getParameter<double>(
"trkPtCut")),
94 trkMaxChi2_(iConfig.getParameter<double>(
"trkMaxChi2")),
95 trkMinStubs_(iConfig.getParameter<unsigned>(
"trkMinStubs")),
98 emPtCut_(iConfig.getParameter<double>(
"emPtCut")),
99 hadPtCut_(iConfig.getParameter<double>(
"hadPtCut")),
103 regionDumpName_(iConfig.getUntrackedParameter<
std::
string>(
"dumpFileName",
"")),
104 regionCOEName_(iConfig.getUntrackedParameter<
std::
string>(
"coeFileName",
"")),
105 fRegionDump_(nullptr),
106 fRegionCOE_(nullptr),
107 neventscoemax_(iConfig.getUntrackedParameter<unsigned
int>(
"neventscoemax_", 0)),
109 debugEta_(iConfig.getUntrackedParameter<double>(
"debugEta", 0)),
110 debugPhi_(iConfig.getUntrackedParameter<double>(
"debugPhi", 0)),
111 debugR_(iConfig.getUntrackedParameter<double>(
"debugR", -1)) {
112 produces<l1t::PFCandidateCollection>(
"PF");
113 produces<l1t::PFCandidateCollection>(
"Puppi");
115 produces<l1t::PFCandidateCollection>(
"EmCalo");
116 produces<l1t::PFCandidateCollection>(
"Calo");
117 produces<l1t::PFCandidateCollection>(
"TK");
118 produces<l1t::PFCandidateCollection>(
"TKVtx");
120 produces<float>(
"z0");
122 for (
const auto&
tag : iConfig.
getParameter<std::vector<edm::InputTag>>(
"emClusters")) {
123 emCands_.push_back(consumes<l1t::PFClusterCollection>(
tag));
125 for (
const auto&
tag : iConfig.
getParameter<std::vector<edm::InputTag>>(
"hadClusters")) {
126 hadCands_.push_back(consumes<l1t::PFClusterCollection>(
tag));
130 if (
algo ==
"PFAlgo3") {
131 l1pfalgo_ = std::make_unique<l1tpf_impl::PFAlgo3>(iConfig);
132 }
else if (
algo ==
"PFAlgo2HGC") {
133 l1pfalgo_ = std::make_unique<l1tpf_impl::PFAlgo2HGC>(iConfig);
134 }
else if (
algo ==
"BitwisePFAlgo") {
135 l1pfalgo_ = std::make_unique<l1tpf_impl::BitwisePFAlgo>(iConfig);
140 if (pualgo ==
"Puppi") {
141 l1pualgo_ = std::make_unique<l1tpf_impl::PuppiAlgo>(iConfig);
142 }
else if (pualgo ==
"LinearizedPuppi") {
143 l1pualgo_ = std::make_unique<l1tpf_impl::LinearizedPuppiAlgo>(iConfig);
152 else if (
vtxAlgo ==
"external") {
163 produces<float>(
label);
169 for (
int tot = 0; tot <= 1; ++tot) {
202 <<
"Job running with multiple streams, but dump file will have only events on stream zero.";
210 <<
"Job running with multiple streams, but COE file will dump only events on stream zero.";
224 const auto&
tracks = *htracks;
225 for (
unsigned int itk = 0, ntk =
tracks.size(); itk < ntk; ++itk) {
226 const auto& tk =
tracks[itk];
241 "setting useStandaloneMuons=True && useTrackerMuons=True is not to be done, as it would duplicate all muons\n");
247 for (
auto it =
muons->begin(0), ed =
muons->end(0); it != ed; ++it) {
258 for (
auto it =
muons->begin(), ed =
muons->end(); it != ed; ++it) {
270 const auto& calos = *caloHandle;
271 for (
unsigned int ic = 0, nc = calos.size(); ic < nc; ++ic) {
272 const auto&
calo = calos[ic];
281 const auto& calos = *caloHandle;
282 for (
unsigned int ic = 0, nc = calos.size(); ic < nc; ++ic) {
283 const auto&
calo = calos[ic];
321 if (ptsum == 0 ||
vtx.sum() > ptsum) {
327 throw cms::Exception(
"LogicError",
"Inconsistent vertex configuration");
330 iEvent.put(std::make_unique<float>(
z0),
"z0");
336 float genZ = genOrigin.Z();
352 std::vector<float> puGlobals;
354 const std::vector<std::string>& puGlobalNames =
l1pualgo_->puGlobalNames();
355 if (puGlobals.size() != puGlobalNames.size())
356 throw cms::Exception(
"LogicError",
"Mismatch in the number of global pileup inputs");
357 for (
unsigned int i = 0,
n = puGlobalNames.size();
i <
n; ++
i) {
358 iEvent.put(std::make_unique<float>(puGlobals[
i]), puGlobalNames[
i]);
366 l1pualgo_->runNeutralsPU(l1region, -1., puGlobals);
395 iEvent.put(std::make_unique<unsigned>(
value), iLabel);