◆ CandView
◆ IsoTypes
◆ TypeMap
◆ PFIsolationSumProducer()
Definition at line 67 of file CITKPFIsolationSumProducer.cc.
68 :
_typeMap({{
"h+", 1}, {
"h0", 5}, {
"gamma", 4}, {
"electron", 2}, {
"muon", 3}, {
"HFh", 6}, {
"HFgamma", 7}}) {
71 const std::vector<edm::ParameterSet>& isoDefs =
c.getParameterSetVector(
"isolationConeDefinitions");
72 for (
const auto& isodef : isoDefs) {
74 const float coneSize = isodef.getParameter<
double>(
"coneSize");
78 auto decimal = coneName.find(
'.');
79 if (decimal != std::string::npos)
80 coneName.erase(decimal, 1);
83 theisolator->setConsumes(consumesCollector());
84 const auto thetype =
_typeMap.find(isotype);
86 throw cms::Exception(
"InvalidIsolationType") <<
"Isolation type: " << isotype <<
" is not available in the "
87 <<
"list of allowed isolations!.";
90 std::string pname = isotype + dash + coneName + dash + theisolator->additionalCode();
92 produces<edm::ValueMap<float>>(
pname);
◆ ~PFIsolationSumProducer()
citk::PFIsolationSumProducer::~PFIsolationSumProducer |
( |
| ) |
|
|
inlineoverride |
◆ beginLuminosityBlock()
◆ fillDescriptions()
Definition at line 164 of file CITKPFIsolationSumProducer.cc.
169 ->setComment(
"calculate isolation for this collection");
171 ->setComment(
"collection for the isolation calculation: like particleFlow ");
174 descIsoConeDefinitions.
add<
std::string>(
"isolationAlgo",
"no default");
175 descIsoConeDefinitions.
add<
double>(
"coneSize", 0.3);
176 descIsoConeDefinitions.add<
std::string>(
"isolateAgainst",
"no default");
177 descIsoConeDefinitions.add<std::vector<unsigned>>(
"miniAODVertexCodes", {2, 3});
178 descIsoConeDefinitions.addOptional<
double>(
"VetoConeSizeBarrel", 0.0);
179 descIsoConeDefinitions.addOptional<
double>(
"VetoConeSizeEndcaps", 0.0);
180 descIsoConeDefinitions.addOptional<
int>(
"vertexIndex", 0);
182 ->setComment(
"map for footprint removal that is used for photons");
191 descriptions.
add(
"CITKPFIsolationSumProducer", iDesc);
References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addOptional(), edm::ParameterSetDescription::addVPSet(), HLT_2018_cff::InputTag, egmElectronIsolationPUPPI_cff::isolationConeDefinitions, BPHMonitor_cfi::photons, edm::ParameterSetDescription::setComment(), and AlCaHLTBitMon_QueryRunRegistry::string.
◆ produce()
Definition at line 105 of file CITKPFIsolationSumProducer.cc.
106 typedef std::unique_ptr<edm::ValueMap<float>> product_type;
107 typedef std::vector<float> product_values;
113 std::array<std::vector<product_values>,
kNPFTypes> the_values;
117 the_values[
i++].resize(isolators_for_type.size());
118 for (
const auto& isolator : isolators_for_type) {
119 isolator->getEventInfo(
ev);
124 for (
size_t c = 0;
c < to_isolate->
size(); ++
c) {
125 auto cand_to_isolate = to_isolate->
ptrAt(
c);
126 std::array<std::vector<float>,
kNPFTypes> cand_values;
129 cand_values[
k].resize(isolators_for_type.size());
130 for (
auto&
value : cand_values[
k])
134 for (
size_t ic = 0; ic < isolate_with->
size(); ++ic) {
135 auto isocand = isolate_with->
ptrAt(ic);
136 auto isotype =
helper.translatePdgIdToType(isocand->pdgId());
138 for (
unsigned i = 0;
i < isolations.size(); ++
i) {
139 if (isolations[
i]->isInIsolationCone(cand_to_isolate, isocand)) {
140 cand_values[isotype][
i] += isocand->pt();
146 for (
unsigned j = 0;
j < cand_values[
i].size(); ++
j) {
147 the_values[
i][
j].push_back(cand_values[
i][
j]);
153 for (
unsigned j = 0;
j < the_values[
i].size(); ++
j) {
156 fillerprod.insert(to_isolate, the_values[
i][
j].
begin(), the_values[
i][
j].
end());
References _isolate_with, _isolation_types, _product_names, _to_isolate, begin, HltBtagPostValidation_cff::c, end, ev, edm::helper::Filler< Map >::fill(), mps_fire::i, edm::helper::Filler< Map >::insert(), dqmiolumiharvest::j, dqmdumpme::k, kNPFTypes, eostools::move(), edm::View< T >::ptrAt(), and edm::View< T >::size().
◆ _isolate_with
◆ _isolation_types
◆ _product_names
std::array<std::vector<std::string>, kNPFTypes> citk::PFIsolationSumProducer::_product_names |
|
private |
◆ _to_isolate
◆ _typeMap
const TypeMap citk::PFIsolationSumProducer::_typeMap |
|
private |
◆ kNPFTypes
constexpr unsigned citk::PFIsolationSumProducer::kNPFTypes = 8 |
|
staticconstexprprivate |