21 typedef std::pair<std::string, edm::InputTag>
NameTag;
38 std::map<std::string, IDContainerData> idContainerMap;
46 std::map<std::string, IDContainerData>::iterator it;
47 it = idContainerMap.insert({
tag.label() +
tag.instance(), {
tag, std::vector<NameWPIdx>()}}).
first;
52 if (
tauIDSrcs_.empty() && idContainerMap.empty())
53 throw cms::Exception(
"Configuration") <<
"PATTauProducer: id addTauID is true, you must specify:\n"
54 <<
"\tPSet tauIDSources = { \n"
55 <<
"\t\tInputTag <someName> = <someTag> // as many as you want \n "
57 for (
auto const& mapEntry : idContainerMap) {
69 produces<std::vector<pat::Tau> >();
76 auto outputTaus = std::make_unique<std::vector<pat::Tau> >();
77 outputTaus->reserve(inputTaus->size());
80 for (pat::TauCollection::const_iterator inputTau = inputTaus->begin(); inputTau != inputTaus->end();
81 ++inputTau, ++tau_idx) {
84 size_t nTauIds = inputTau->tauIDs().size();
85 std::vector<pat::Tau::IdPair> tauIds(nTauIds +
nNewTauIds_);
88 for (
size_t i = 0;
i < nTauIds; ++
i) {
89 tauIds[
i] = inputTau->tauIDs().at(
i);
97 tauIds[nTauIds +
i].second = (*tauDiscr)[inputTauRef];
108 if (tauDiscrCont[inputTauRef].
rawValues.size() == 1)
110 tauIds[nEmbeddedIDs +
j].
second = tauDiscrCont[inputTauRef].
rawValues.at(0);
113 tauIds[nEmbeddedIDs +
j].second = tauDiscrCont[inputTauRef].rawValues.at(-1 - wpIdx);
117 tauIds[nEmbeddedIDs +
j].
second = 0.0;
119 tauIds[nEmbeddedIDs +
j].second = tauDiscrCont[inputTauRef].workingPoints.at(wpIdx);
126 outputTaus->push_back(outputTau);