83 <<
"an invalid PFTau handle with ProductID" << hc.id() <<
" passed to PFTauSelector.";
88 e.getByToken(
disc.inputToken,
disc.handle);
91 e.getByToken(
disc.inputToken,
disc.handle);
94 if (
phID_ !=
e.processHistoryID()) {
95 phID_ =
e.processHistoryID();
97 auto const& psetsFromProvenance =
edm::parameterSet(
disc.handle.provenance()->stable(),
e.processHistory());
99 if (psetsFromProvenance.exists(
"rawValues")) {
100 auto const idlist = psetsFromProvenance.
getParameter<std::vector<std::string>>(
"rawValues");
101 for (
size_t i = 0;
i <
disc.rawLabels.size(); ++
i) {
103 for (
size_t j = 0;
j < idlist.size(); ++
j) {
104 if (
disc.rawLabels[
i] == idlist[
j]) {
106 disc.rawCuts[
i].first =
j;
111 <<
"PFTauSelector: Requested working point '" <<
disc.rawLabels[
i] <<
"' not found!\n";
113 }
else if (psetsFromProvenance.exists(
"IDdefinitions")) {
114 auto const idlist = psetsFromProvenance.getParameter<std::vector<edm::ParameterSet>>(
"IDdefinitions");
115 for (
size_t i = 0;
i <
disc.rawLabels.size(); ++
i) {
117 for (
size_t j = 0;
j < idlist.size(); ++
j) {
120 disc.rawCuts[
i].first =
j;
125 <<
"PFTauSelector: Requested working point '" <<
disc.rawLabels[
i] <<
"' not found!\n";
127 }
else if (psetsFromProvenance.exists(
"VSjetWP")) {
132 throw cms::Exception(
"Configuration") <<
"PFTauSelector: No suitable ID list found in provenace config!\n";
134 if (psetsFromProvenance.exists(
"workingPoints")) {
135 auto const idlist = psetsFromProvenance.getParameter<std::vector<std::string>>(
"workingPoints");
136 for (
size_t i = 0;
i <
disc.wpLabels.size(); ++
i) {
138 for (
size_t j = 0;
j < idlist.size(); ++
j) {
139 if (
disc.wpLabels[
i] == idlist[
j]) {
146 <<
"PFTauSelector: Requested working point '" <<
disc.wpLabels[
i] <<
"' not found!\n";
148 }
else if (psetsFromProvenance.exists(
"IDWPdefinitions")) {
149 auto const idlist = psetsFromProvenance.getParameter<std::vector<edm::ParameterSet>>(
"IDWPdefinitions");
150 for (
size_t i = 0;
i <
disc.wpLabels.size(); ++
i) {
152 for (
size_t j = 0;
j < idlist.size(); ++
j) {
160 <<
"PFTauSelector: Requested working point '" <<
disc.wpLabels[
i] <<
"' not found!\n";
162 }
else if (psetsFromProvenance.exists(
"VSjetWP")) {
163 auto const idlist = psetsFromProvenance.getParameter<std::vector<std::string>>(
"VSjetWP");
164 for (
size_t i = 0;
i <
disc.wpLabels.size(); ++
i) {
166 for (
size_t j = 0;
j < idlist.size(); ++
j) {
167 if (
disc.wpLabels[
i] == idlist[
j]) {
174 <<
"PFTauSelector: Requested working point '" <<
disc.wpLabels[
i] <<
"' not found!\n";
177 throw cms::Exception(
"Configuration") <<
"PFTauSelector: No suitable ID WP list found in provenace config!\n";
181 const size_t nTaus = hc->size();
182 for (
size_t iTau = 0; iTau < nTaus; ++iTau) {
195 for (
auto const& rawCut :
disc.rawCuts) {
196 if (!((*
disc.handle)[
tau].rawValues.at(rawCut.first) > rawCut.second)) {
203 for (
auto const& wpCut :
disc.wpCuts) {
204 if (!((*
disc.handle)[
tau].workingPoints.at(wpCut))) {
T getParameter(std::string const &) const
DiscCutPairVec discriminators_
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
std::unique_ptr< StringCutObjectSelector< reco::PFTau > > cut_
DiscContainerCutPairVec discriminatorContainers_
edm::ProcessHistoryID phID_