Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:52

0001 #include <algorithm>
0002 #include <functional>
0003 using namespace std;
0004 
0005 #include "FWCore/Utilities/interface/EDMException.h"
0006 #include "DataFormats/BTauReco/interface/TaggingVariable.h"
0007 
0008 namespace reco {
0009 
0010   const char* const TaggingVariableDescription[] = {
0011       /* [jetEnergy]                                = */ "jet energy",
0012       /* [jetPt]                                    = */ "jet transverse momentum",
0013       /* [trackJetPt]                               = */ "track-based jet transverse momentum",
0014       /* [jetEta]                                   = */ "jet pseudorapidity",
0015       /* [jetAbsEta]                                = */ "jet absolute pseudorapidity",
0016       /* [jetPhi]                                   = */ "jet polar angle",
0017       /* [jetNTracks]                               = */ "tracks associated to jet",
0018       /* [jetNSelectedTracks]                       = */ "selected tracks in the jet",
0019       /* [jetNTracksEtaRel]                         = */ "number of tracks for which etaRel is computed",
0020 
0021       /* [trackMomentum]                            = */ "track momentum",
0022       /* [trackEta]                                 = */ "track pseudorapidity",
0023       /* [trackPhi]                                 = */ "track polar angle",
0024 
0025       /* [trackCharge]                              = */ "track charge",
0026 
0027       /* [trackPtRel]                               = */ "track transverse momentum, relative to the jet axis",
0028       /* [trackPPar]                                = */ "track parallel momentum, along the jet axis",
0029       /* [trackEtaRel]                              = */ "track pseudorapidity, relative to the jet axis",
0030       /* [trackDeltaR]                              = */ "track pseudoangular distance from the jet axis",
0031       /* [trackPtRatio]                             = */
0032       "track transverse momentum, relative to the jet axis, normalized to its energy",
0033       /* [trackPParRatio]                           = */
0034       "track parallel momentum, along the jet axis, normalized to its energy",
0035 
0036       /* [trackSip2dVal]                            = */ "track 2D signed impact parameter",
0037       /* [trackSip2dSig]                            = */ "track 2D signed impact parameter significance",
0038       /* [trackSip3dVal]                            = */ "track 3D signed impact parameter",
0039       /* [trackSip3dSig]                            = */ "track 3D signed impact parameter significance",
0040       /* [trackDecayLenVal]                         = */ "track decay length",
0041       /* [trackDecayLenSig]                         = */ "track decay length significance",
0042       /* [trackJetDistVal]                          = */ "minimum track approach distance to jet axis",
0043       /* [trackJetDistSig]                          = */ "minimum track approach distance to jet axis signifiance",
0044       /* [trackGhostTrackDistVal]                   = */ "minimum approach distance to ghost track",
0045       /* [trackGhostTrackDistSig]                   = */ "minimum approach distance to ghost track significance",
0046       /* [trackGhostTrackWeight]                    = */ "weight of track participation in ghost track fit",
0047 
0048       /* [trackSumJetEtRatio]                       = */ "ratio of track sum transverse energy over jet energy",
0049       /* [trackSumJetDeltaR]                        = */
0050       "pseudoangular distance between jet axis and track fourvector sum",
0051 
0052       /* [vertexCategory]                           = */ "category of secondary vertex (Reco, Pseudo, No)",
0053       /* [vertexLeptonCategory]                     = */
0054       "category of secondary vertex & soft lepton (RecoNo, PseudoNo, NoNo, RecoMu, PseudoMu, NoMu, RecoEl, PseudoEl, "
0055       "NoEl)",
0056 
0057       /* [jetNSecondaryVertices]                    = */ "number of reconstructed possible secondary vertices in jet",
0058       /* [jetNSingleTrackVertices]                  = */ "number of single-track ghost-track vertices",
0059 
0060       /* [vertexMass]                               = */ "mass of track sum at secondary vertex",
0061       /* [vertexNTracks]                            = */ "number of tracks at secondary vertex",
0062       /* [vertexFitProb]                            = */ "vertex fit probability",
0063 
0064       /* [vertexEnergyRatio]                        = */ "ratio of energy at secondary vertex over total energy",
0065       /* [vertexJetDeltaR]                          = */
0066       "pseudoangular distance between jet axis and secondary vertex direction",
0067 
0068       /* [flightDistance1dVal]                      = */
0069       "Longitudinal distance along the z-axis between primary and secondary vertex",
0070       /* [flightDistance1dSig]                      = */
0071       "Longitudinal distance significance along the z-axis between primary and secondary vertex",
0072       /* [flightDistance2dVal]                      = */ "transverse distance between primary and secondary vertex",
0073       /* [flightDistance2dSig]                      = */
0074       "transverse distance significance between primary and secondary vertex",
0075       /* [flightDistance3dVal]                      = */ "distance between primary and secondary vertex",
0076       /* [flightDistance3dSig]                      = */ "distance significance between primary and secondary vertex",
0077 
0078       /* [trackSip2dValAboveCharm]                  = */
0079       "track 2D signed impact parameter of first track lifting mass above charm",
0080       /* [trackSip2dSigAboveCharm]                  = */
0081       "track 2D signed impact parameter significance of first track lifting mass above charm",
0082       /* [trackSip3dValAboveCharm]                  = */
0083       "track 3D signed impact parameter of first track lifting mass above charm",
0084       /* [trackSip3dSigAboveCharm]                  = */
0085       "track 3D signed impact parameter significance of first track lifting mass above charm",
0086 
0087       /* [trackP0Par]                               = */ "track momentum along the jet axis, in the jet rest frame",
0088       /* [trackP0ParRatio]                          = */
0089       "track momentum along the jet axis, in the jet rest frame, normalized to its energy"
0090       /* [trackChi2]                                = */ "chi2 of the track fit",
0091       /* [trackNTotalHits]                          = */ "number of valid total hits",
0092       /* [trackNPixelHits]                          = */ "number of valid pixel hits",
0093 
0094       /* [leptonQuality]                            = */ "lepton identification quality",
0095       /* [leptonQuality2]                           = */ "lepton identification quality 2",
0096 
0097       /* [chargedHadronEnergyFraction]              = */ "fraction of the jet energy coming from charged hadrons",
0098       /* [neutralHadronEnergyFraction]              = */ "fraction of the jet energy coming from neutral hadrons",
0099       /* [photonEnergyFraction]                     = */ "fraction of the jet energy coming from photons",
0100       /* [electronEnergyFraction]                   = */ "fraction of the jet energy coming from electrons",
0101       /* [muonEnergyFraction]                       = */ "fraction of the jet energy coming from muons",
0102       /* [chargedHadronMultiplicity]                = */ "number of charged hadrons in the jet",
0103       /* [neutralHadronMultiplicity]                = */ "number of neutral hadrons in the jet",
0104       /* [photonMultiplicity]                       = */ "number of photons in the jet",
0105       /* [electronMultiplicity]                     = */ "number of electrons in the jet",
0106       /* [muonMultiplicity]                         = */ "number of muons in the jet",
0107       /* [hadronMultiplicity]                       = */ "total number of charged and neutral hadrons in the jet",
0108       /* [hadronPhotonMultiplicity]                 = */
0109       "total number of photons, charged and neutral hadrons in the jet",
0110       /* [totalMultiplicity]                        = */
0111       "total number of photons, electrons, muons, charged and neutral hadrons in the jet",
0112 
0113       /* [massVertexEnergyFraction]                 = */
0114       "vertexmass times fraction of the vertex energy w.r.t. the jet energy",
0115       /* [vertexBoostOverSqrtJetPt]                 = */
0116       "variable related to the boost of the vertex system in flight direction",
0117 
0118       /* [leptonSip2d]                              = */ "2D signed impact parameter of the soft lepton",
0119       /* [leptonSip3d]                              = */ "3D signed impact parameter of the soft lepton",
0120       /* [leptonPtRel]                              = */ "transverse momentum of the soft lepton wrt. the jet axis",
0121       /* [leptonP0Par]                              = */
0122       "momentum of the soft lepton along the jet direction, in the jet rest frame",
0123       /* [leptonEtaRel]                             = */ "pseudo)rapidity of the soft lepton along jet axis",
0124       /* [leptonDeltaR]                             = */ "pseudo)angular distance of the soft lepton to jet axis",
0125       /* [leptonRatio]                              = */ "momentum of the soft lepton over jet energy",
0126       /* [leptonRatioRel]                           = */
0127       "momentum of the soft lepton parallel to jet axis over jet energy",
0128       /* [electronMVA]                              = */ "mva output of the electron ID",
0129 
0130       /* [trackSip3dSig_0]                          = */ "1st largest track 3D signed impact parameter significance",
0131       /* [trackSip3dSig_1]                          = */ "2nd largest track 3D signed impact parameter significance",
0132       /* [trackSip3dSig_2]                          = */ "3rd largest track 3D signed impact parameter significance",
0133       /* [trackSip3dSig_3]                          = */ "4th largest track 3D signed impact parameter significance",
0134       /* [tau1_trackSip3dSig_0]                     = */
0135       "1st largest track 3D signed impact parameter significance associated to the 1st N-subjettiness axis",
0136       /* [tau1_trackSip3dSig_1]                     = */
0137       "2nd largest track 3D signed impact parameter significance associated to the 1st N-subjettiness axis",
0138       /* [tau2_trackSip3dSig_0]                     = */
0139       "1st largest track 3D signed impact parameter significance associated to the 2nd N-subjettiness axis",
0140       /* [tau2_trackSip3dSig_1]                     = */
0141       "2nd largest track 3D signed impact parameter significance associated to the 2nd N-subjettiness axis",
0142       /* [trackSip2dSigAboveBottom_0]               = */
0143       "track 2D signed impact parameter significance of 1st track lifting mass above bottom",
0144       /* [trackSip2dSigAboveBottom_1]               = */
0145       "track 2D signed impact parameter significance of 2nd track lifting mass above bottom",
0146       /* [tau1_trackEtaRel_0]                       = */
0147       "1st smallest track pseudorapidity, relative to the jet axis, associated to the 1st N-subjettiness axis",
0148       /* [tau1_trackEtaRel_1]                       = */
0149       "2nd smallest track pseudorapidity, relative to the jet axis, associated to the 1st N-subjettiness axis",
0150       /* [tau1_trackEtaRel_2]                       = */
0151       "3rd smallest track pseudorapidity, relative to the jet axis, associated to the 1st N-subjettiness axis",
0152       /* [tau2_trackEtaRel_0]                       = */
0153       "1st smallest track pseudorapidity, relative to the jet axis, associated to the 2nd N-subjettiness axis",
0154       /* [tau2_trackEtaRel_1]                       = */
0155       "2nd smallest track pseudorapidity, relative to the jet axis, associated to the 2nd N-subjettiness axis",
0156       /* [tau2_trackEtaRel_2]                       = */
0157       "3rd smallest track pseudorapidity, relative to the jet axis, associated to the 2nd N-subjettiness axis",
0158       /* [tau1_vertexMass]                          = */
0159       "mass of track sum at secondary vertex associated to the 1st N-subjettiness axis",
0160       /* [tau1_vertexEnergyRatio]                   = */
0161       "ratio of energy at secondary vertex over total energy associated to the 1st N-subjettiness axis",
0162       /* [tau1_flightDistance2dSig]                 = */
0163       "transverse distance significance between primary and secondary vertex associated to the 1st N-subjettiness axis",
0164       /* [tau1_vertexDeltaR]                        = */
0165       "pseudoangular distance between the 1st N-subjettiness axis and secondary vertex direction",
0166       /* [tau2_vertexMass]                          = */
0167       "mass of track sum at secondary vertex associated to the 2nd N-subjettiness axis",
0168       /* [tau2_vertexEnergyRatio]                   = */
0169       "ratio of energy at secondary vertex over total energy associated to the 2nd N-subjettiness axis",
0170       /* [tau2_flightDistance2dSig]                 = */
0171       "transverse distance significance between primary and secondary vertex associated to the 2nd N-subjettiness axis",
0172       /* [tau2_vertexDeltaR]                        = */
0173       "pseudoangular distance between the 2nd N-subjettiness axis and secondary vertex direction",
0174       /* [z_ratio]                                  = */ "z ratio",
0175       /* [Jet_SoftMu]                               = */ "SoftMu Tagger discriminator",
0176       /* [Jet_SoftEl]                               = */ "SoftEl Tagger discriminator",
0177       /* [Jet_JBP]                                  = */ "JBP Tagger discriminator",
0178       /* [Jet_JP]                                   = */ "JP Tagger discriminator",
0179 
0180       /* [algoDiscriminator]                        = */ "discriminator output of an algorithm",
0181 
0182       /* [lastTaggingVariable]                      = */ ""};
0183 
0184   const char* const TaggingVariableTokens[] = {
0185       /* [jetEnergy]                                = */ "jetEnergy",
0186       /* [jetPt]                                    = */ "jetPt",
0187       /* [trackJetPt]                               = */ "trackJetPt",
0188       /* [jetEta]                                   = */ "jetEta",
0189       /* [jetAbsEta]                                = */ "jetAbsEta",
0190       /* [jetPhi]                                   = */ "jetPhi",
0191       /* [jetNTracks]                               = */ "jetNTracks",
0192       /* [jetNSelectedTracks]                       = */ "jetNSelectedTracks",
0193       /* [jetNTracksEtaRel]                         = */ "jetNTracksEtaRel",
0194 
0195       /* [trackMomentum]                            = */ "trackMomentum",
0196       /* [trackEta]                                 = */ "trackEta",
0197       /* [trackPhi]                                 = */ "trackPhi",
0198 
0199       /* [trackCharge]                              = */ "trackCharge",
0200 
0201       /* [trackPtRel]                               = */ "trackPtRel",
0202       /* [trackPPar]                                = */ "trackPPar",
0203       /* [trackEtaRel]                              = */ "trackEtaRel",
0204       /* [trackDeltaR]                              = */ "trackDeltaR",
0205       /* [trackPtRatio]                             = */ "trackPtRatio",
0206       /* [trackPParRatio]                           = */ "trackPParRatio",
0207 
0208       /* [trackSip2dVal]                            = */ "trackSip2dVal",
0209       /* [trackSip2dSig]                            = */ "trackSip2dSig",
0210       /* [trackSip3dVal]                            = */ "trackSip3dVal",
0211       /* [trackSip3dSig]                            = */ "trackSip3dSig",
0212       /* [trackDecayLenVal]                         = */ "trackDecayLenVal",
0213       /* [trackDecayLenSig]                         = */ "trackDecayLenSig",
0214       /* [trackJetDistVal]                          = */ "trackJetDist",  //FIXME
0215       /* [trackJetDistSig]                          = */ "trackJetDistSig",
0216       /* [trackGhostTrackDistVal]                   = */ "trackGhostTrackDistVal",
0217       /* [trackGhostTrackDistSig]                   = */ "trackGhostTrackDistSig",
0218       /* [trackGhostTrackWeight]                    = */ "trackGhostTrackWeight",
0219 
0220       /* [trackSumJetEtRatio]                       = */ "trackSumJetEtRatio",
0221       /* [trackSumJetDeltaR]                        = */ "trackSumJetDeltaR",
0222 
0223       /* [vertexCategory]                           = */ "vertexCategory",
0224       /* [vertexLeptonCategory]                     = */ "vertexLeptonCategory",
0225 
0226       /* [jetNSecondaryVertices]                    = */ "jetNSecondaryVertices",
0227       /* [jetNSingleTrackVertices]                  = */ "jetNSingleTrackVertices",
0228 
0229       /* [vertexMass]                               = */ "vertexMass",
0230       /* [vertexNTracks]                            = */ "vertexNTracks",
0231       /* [vertexFitProb]                            = */ "vertexFitProb",
0232 
0233       /* [vertexEnergyRatio]                        = */ "vertexEnergyRatio",
0234       /* [vertexJetDeltaR]                          = */ "vertexJetDeltaR",
0235 
0236       /* [flightDistance1dVal]                      = */ "flightDistance1dVal",
0237       /* [flightDistance1dSig]                      = */ "flightDistance1dSig",
0238       /* [flightDistance2dVal]                      = */ "flightDistance2dVal",
0239       /* [flightDistance2dSig]                      = */ "flightDistance2dSig",
0240       /* [flightDistance3dVal]                      = */ "flightDistance3dVal",
0241       /* [flightDistance3dSig]                      = */ "flightDistance3dSig",
0242 
0243       /* [trackSip2dValAboveCharm]                  = */ "trackSip2dValAboveCharm",
0244       /* [trackSip2dSigAboveCharm]                  = */ "trackSip2dSigAboveCharm",
0245       /* [trackSip3dValAboveCharm]                  = */ "trackSip3dValAboveCharm",
0246       /* [trackSip3dSigAboveCharm]                  = */ "trackSip3dSigAboveCharm",
0247 
0248       /* [leptonQuality]                            = */ "leptonQuality",
0249       /* [leptonQuality2]                           = */ "leptonQuality2",
0250 
0251       /* [trackP0Par]                               = */ "trackP0Par",
0252       /* [trackP0ParRatio]                          = */ "trackP0ParRatio",
0253       /* [trackChi2]                                = */ "trackChi2",
0254       /* [trackNTotalHits]                          = */ "trackNTotalHits",
0255       /* [trackNPixelHits]                          = */ "trackNPixelHits",
0256 
0257       /* [chargedHadronEnergyFraction]              = */ "chargedHadronEnergyFraction",
0258       /* [neutralHadronEnergyFraction]              = */ "neutralHadronEnergyFraction",
0259       /* [photonEnergyFraction]                     = */ "photonEnergyFraction",
0260       /* [electronEnergyFraction]                   = */ "electronEnergyFraction",
0261       /* [muonEnergyFraction]                       = */ "muonEnergyFraction",
0262       /* [chargedHadronMultiplicity]                = */ "chargedHadronMultiplicity",
0263       /* [neutralHadronMultiplicity]                = */ "neutralHadronMultiplicity",
0264       /* [photonMultiplicity]                       = */ "photonMultiplicity",
0265       /* [electronMultiplicity]                     = */ "electronMultiplicity",
0266       /* [muonMultiplicity]                         = */ "muonMultiplicity",
0267       /* [hadronMultiplicity]                       = */ "hadronMultiplicity",
0268       /* [hadronPhotonMultiplicity]                 = */ "hadronPhotonMultiplicity",
0269       /* [totalMultiplicity]                        = */ "totalMultiplicity",
0270 
0271       /* [massVertexEnergyFraction]                 = */ "massVertexEnergyFraction",
0272       /* [vertexBoostOverSqrtJetPt]                 = */ "vertexBoostOverSqrtJetPt",
0273 
0274       /* [leptonSip2d]                              = */ "leptonSip2d",
0275       /* [leptonSip3d]                              = */ "leptonSip3d",
0276       /* [leptonPtRel]                              = */ "leptonPtRel",
0277       /* [leptonP0Par]                              = */ "leptonP0Par",
0278       /* [leptonEtaRel]                             = */ "leptonEtaRel",
0279       /* [leptonDeltaR]                             = */ "leptonDeltaR",
0280       /* [leptonRatio]                              = */ "leptonRatio",
0281       /* [leptonRatioRel]                           = */ "leptonRatioRel",
0282       /* [electronMVA]                              = */ "electronMVA",
0283 
0284       /* [trackSip3dSig_0]                          = */ "trackSip3dSig_0",
0285       /* [trackSip3dSig_1]                          = */ "trackSip3dSig_1",
0286       /* [trackSip3dSig_2]                          = */ "trackSip3dSig_2",
0287       /* [trackSip3dSig_3]                          = */ "trackSip3dSig_3",
0288       /* [tau1_trackSip3dSig_0]                     = */ "tau1_trackSip3dSig_0",
0289       /* [tau1_trackSip3dSig_1]                     = */ "tau1_trackSip3dSig_1",
0290       /* [tau2_trackSip3dSig_0]                     = */ "tau2_trackSip3dSig_0",
0291       /* [tau2_trackSip3dSig_1]                     = */ "tau2_trackSip3dSig_1",
0292       /* [trackSip2dSigAboveBottom_0]               = */ "trackSip2dSigAboveBottom_0",
0293       /* [trackSip2dSigAboveBottom_1]               = */ "trackSip2dSigAboveBottom_1",
0294       /* [tau1_trackEtaRel_0]                       = */ "tau1_trackEtaRel_0",
0295       /* [tau1_trackEtaRel_1]                       = */ "tau1_trackEtaRel_1",
0296       /* [tau1_trackEtaRel_2]                       = */ "tau1_trackEtaRel_2",
0297       /* [tau2_trackEtaRel_0]                       = */ "tau2_trackEtaRel_0",
0298       /* [tau2_trackEtaRel_1]                       = */ "tau2_trackEtaRel_1",
0299       /* [tau2_trackEtaRel_2]                       = */ "tau2_trackEtaRel_2",
0300       /* [tau1_vertexMass]                          = */ "tau1_vertexMass",
0301       /* [tau1_vertexEnergyRatio]                   = */ "tau1_vertexEnergyRatio",
0302       /* [tau1_flightDistance2dSig]                 = */ "tau1_flightDistance2dSig",
0303       /* [tau1_vertexDeltaR]                        = */ "tau1_vertexDeltaR",
0304       /* [tau2_vertexMass]                          = */ "tau2_vertexMass",
0305       /* [tau2_vertexEnergyRatio]                   = */ "tau2_vertexEnergyRatio",
0306       /* [tau2_flightDistance2dSig]                 = */ "tau2_flightDistance2dSig",
0307       /* [tau2_vertexDeltaR]                        = */ "tau2_vertexDeltaR",
0308       /* [z_ratio]                                  = */ "z_ratio",
0309       /* [Jet_SoftMu]                               = */ "Jet_SoftMu",
0310       /* [Jet_SoftEl]                               = */ "Jet_SoftEl",
0311       /* [Jet_JBP]                                  = */ "Jet_JBP",
0312       /* [Jet_JP]                                   = */ "Jet_JP",
0313 
0314       /* [algoDiscriminator]                        = */ "algoDiscriminator",
0315 
0316       /* [lastTaggingVariable]                      = */ "lastTaggingVariable"};
0317 
0318   btau::TaggingVariableName getTaggingVariableName(const std::string& name) {
0319     for (int i = 0; i <= reco::btau::lastTaggingVariable; i++)
0320       if (name == TaggingVariableTokens[i])
0321         return (reco::btau::TaggingVariableName)(i);
0322     return btau::lastTaggingVariable;
0323   }
0324 
0325   // check if a tag is present in the TaggingVariableList
0326   bool TaggingVariableList::checkTag(TaggingVariableName tag) const {
0327     return binary_search(m_list.begin(), m_list.end(), tag, TaggingVariableCompare());
0328   }
0329 
0330   void TaggingVariableList::insert(const TaggingVariable& variable, bool delayed /* = false */) {
0331     m_list.push_back(variable);
0332     if (not delayed)
0333       finalize();
0334   }
0335 
0336   void TaggingVariableList::insert(TaggingVariableName tag, TaggingValue value, bool delayed /* = false */) {
0337     m_list.push_back(TaggingVariable(tag, value));
0338     if (not delayed)
0339       finalize();
0340   }
0341 
0342   void TaggingVariableList::insert(TaggingVariableName tag,
0343                                    const std::vector<TaggingValue>& values,
0344                                    bool delayed /* = false */) {
0345     for (std::vector<TaggingValue>::const_iterator i = values.begin(); i != values.end(); i++) {
0346       m_list.push_back(TaggingVariable(tag, *i));
0347     }
0348     if (not delayed)
0349       finalize();
0350   }
0351 
0352   void TaggingVariableList::insert(const TaggingVariableList& list) {
0353     std::vector<TaggingVariable>::size_type size = m_list.size();
0354     m_list.insert(m_list.end(), list.m_list.begin(), list.m_list.end());
0355     inplace_merge(m_list.begin(), m_list.begin() + size, m_list.end(), TaggingVariableCompare());
0356   }
0357 
0358   void TaggingVariableList::finalize(void) { stable_sort(m_list.begin(), m_list.end(), TaggingVariableCompare()); }
0359 
0360   TaggingValue TaggingVariableList::get(TaggingVariableName tag) const {
0361     range r = getRange(tag);
0362     if (r.first == r.second)
0363       throw edm::Exception(edm::errors::InvalidReference)
0364           << "TaggingVariable " << tag << " is not present in the collection";
0365     return r.first->second;
0366   }
0367 
0368   TaggingValue TaggingVariableList::get(TaggingVariableName tag, TaggingValue defaultValue) const {
0369     range r = getRange(tag);
0370     if (r.first == r.second)
0371       return defaultValue;
0372     return r.first->second;
0373   }
0374 
0375   std::vector<TaggingValue> TaggingVariableList::getList(TaggingVariableName tag, bool throwOnEmptyList) const {
0376     range r = getRange(tag);
0377     if (throwOnEmptyList && r.first == r.second)
0378       throw edm::Exception(edm::errors::InvalidReference)
0379           << "TaggingVariable " << tag << " is not present in the collection";
0380     std::vector<TaggingValue> list(r.second - r.first);
0381     transform(r.first, r.second, list.begin(), [](TaggingVariable const& x) { return x.second; });
0382     return list;
0383   }
0384 
0385   TaggingVariableList::range TaggingVariableList::getRange(TaggingVariableName tag) const {
0386     return equal_range(m_list.begin(), m_list.end(), tag, TaggingVariableCompare());
0387   }
0388 
0389 }  // namespace reco