Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:49

0001 
0002 /** \class PFRecoTauDiscriminationByMVAIsolation2
0003  *
0004  * MVA based discriminator against jet -> tau fakes
0005  * 
0006  * \author Christian Veelken, LLR
0007  *
0008  */
0009 
0010 #include "RecoTauTag/RecoTau/interface/TauDiscriminationProducerBase.h"
0011 
0012 #include "FWCore/Common/interface/Provenance.h"
0013 #include "FWCore/Framework/interface/Event.h"
0014 #include "FWCore/Framework/interface/EventSetup.h"
0015 #include "FWCore/Utilities/interface/InputTag.h"
0016 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0017 #include "FWCore/ParameterSet/interface/FileInPath.h"
0018 
0019 #include "FWCore/Utilities/interface/Exception.h"
0020 
0021 #include <FWCore/ParameterSet/interface/ConfigurationDescriptions.h>
0022 #include <FWCore/ParameterSet/interface/ParameterSetDescription.h>
0023 
0024 #include "DataFormats/Candidate/interface/Candidate.h"
0025 #include "DataFormats/Provenance/interface/ProcessHistoryID.h"
0026 #include "DataFormats/Provenance/interface/ProductProvenance.h"
0027 #include "DataFormats/TauReco/interface/PFTau.h"
0028 #include "DataFormats/TauReco/interface/PFTauFwd.h"
0029 #include "DataFormats/TauReco/interface/PFTauTransverseImpactParameterAssociation.h"
0030 #include "DataFormats/Math/interface/deltaR.h"
0031 #include "RecoTauTag/RecoTau/interface/PFRecoTauClusterVariables.h"
0032 
0033 #include "CondFormats/GBRForest/interface/GBRForest.h"
0034 #include "CondFormats/DataRecord/interface/GBRWrapperRcd.h"
0035 
0036 #include <TFile.h>
0037 
0038 #include <iostream>
0039 
0040 using namespace reco;
0041 
0042 namespace {
0043   const GBRForest* loadMVAfromFile(const edm::FileInPath& inputFileName,
0044                                    const std::string& mvaName,
0045                                    std::vector<TFile*>& inputFilesToDelete) {
0046     if (inputFileName.location() == edm::FileInPath::Unknown)
0047       throw cms::Exception("PFRecoTauDiscriminationByIsolationMVA2::loadMVA")
0048           << " Failed to find File = " << inputFileName << " !!\n";
0049     TFile* inputFile = new TFile(inputFileName.fullPath().data());
0050 
0051     //const GBRForest* mva = dynamic_cast<GBRForest*>(inputFile->Get(mvaName.data())); // CV: dynamic_cast<GBRForest*> fails for some reason ?!
0052     const GBRForest* mva = (GBRForest*)inputFile->Get(mvaName.data());
0053     if (!mva)
0054       throw cms::Exception("PFRecoTauDiscriminationByIsolationMVA2::loadMVA")
0055           << " Failed to load MVA = " << mvaName.data() << " from file = " << inputFileName.fullPath().data()
0056           << " !!\n";
0057 
0058     inputFilesToDelete.push_back(inputFile);
0059 
0060     return mva;
0061   }
0062 }  // namespace
0063 
0064 namespace reco {
0065   namespace tau {
0066 
0067     class PFRecoTauDiscriminationByMVAIsolationRun2 : public PFTauDiscriminationContainerProducerBase {
0068     public:
0069       explicit PFRecoTauDiscriminationByMVAIsolationRun2(const edm::ParameterSet& cfg)
0070           : PFTauDiscriminationContainerProducerBase(cfg),
0071             moduleLabel_(cfg.getParameter<std::string>("@module_label")),
0072             mvaReader_(nullptr),
0073             mvaInput_(nullptr) {
0074         mvaName_ = cfg.getParameter<std::string>("mvaName");
0075         loadMVAfromDB_ = cfg.getParameter<bool>("loadMVAfromDB");
0076         if (!loadMVAfromDB_) {
0077           inputFileName_ = cfg.getParameter<edm::FileInPath>("inputFileName");
0078         } else {
0079           mvaToken_ = esConsumes(edm::ESInputTag{"", mvaName_});
0080         }
0081         std::string mvaOpt_string = cfg.getParameter<std::string>("mvaOpt");
0082         if (mvaOpt_string == "oldDMwoLT")
0083           mvaOpt_ = kOldDMwoLT;
0084         else if (mvaOpt_string == "oldDMwLT")
0085           mvaOpt_ = kOldDMwLT;
0086         else if (mvaOpt_string == "newDMwoLT")
0087           mvaOpt_ = kNewDMwoLT;
0088         else if (mvaOpt_string == "newDMwLT")
0089           mvaOpt_ = kNewDMwLT;
0090         else if (mvaOpt_string == "DBoldDMwLT")
0091           mvaOpt_ = kDBoldDMwLT;
0092         else if (mvaOpt_string == "DBnewDMwLT")
0093           mvaOpt_ = kDBnewDMwLT;
0094         else if (mvaOpt_string == "PWoldDMwLT")
0095           mvaOpt_ = kPWoldDMwLT;
0096         else if (mvaOpt_string == "PWnewDMwLT")
0097           mvaOpt_ = kPWnewDMwLT;
0098         else if (mvaOpt_string == "DBoldDMwLTwGJ")
0099           mvaOpt_ = kDBoldDMwLTwGJ;
0100         else if (mvaOpt_string == "DBnewDMwLTwGJ")
0101           mvaOpt_ = kDBnewDMwLTwGJ;
0102         else
0103           throw cms::Exception("PFRecoTauDiscriminationByMVAIsolationRun2")
0104               << " Invalid Configuration Parameter 'mvaOpt' = " << mvaOpt_string << " !!\n";
0105 
0106         if (mvaOpt_ == kOldDMwoLT || mvaOpt_ == kNewDMwoLT)
0107           mvaInput_ = new float[6];
0108         else if (mvaOpt_ == kOldDMwLT || mvaOpt_ == kNewDMwLT)
0109           mvaInput_ = new float[12];
0110         else if (mvaOpt_ == kDBoldDMwLT || mvaOpt_ == kDBnewDMwLT || mvaOpt_ == kPWoldDMwLT || mvaOpt_ == kPWnewDMwLT ||
0111                  mvaOpt_ == kDBoldDMwLTwGJ || mvaOpt_ == kDBnewDMwLTwGJ)
0112           mvaInput_ = new float[23];
0113         else
0114           assert(0);
0115 
0116         TauTransverseImpactParameters_token =
0117             consumes<PFTauTIPAssociationByRef>(cfg.getParameter<edm::InputTag>("srcTauTransverseImpactParameters"));
0118 
0119         basicTauDiscriminators_token =
0120             consumes<reco::TauDiscriminatorContainer>(cfg.getParameter<edm::InputTag>("srcBasicTauDiscriminators"));
0121         input_id_name_suffix_ = cfg.getParameter<std::string>("inputIDNameSuffix");
0122 
0123         verbosity_ = cfg.getParameter<int>("verbosity");
0124       }
0125 
0126       void beginEvent(const edm::Event&, const edm::EventSetup&) override;
0127 
0128       reco::SingleTauDiscriminatorContainer discriminate(const PFTauRef&) const override;
0129 
0130       ~PFRecoTauDiscriminationByMVAIsolationRun2() override {
0131         if (!loadMVAfromDB_)
0132           delete mvaReader_;
0133         delete[] mvaInput_;
0134         for (std::vector<TFile*>::iterator it = inputFilesToDelete_.begin(); it != inputFilesToDelete_.end(); ++it) {
0135           delete (*it);
0136         }
0137       }
0138 
0139       static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0140 
0141     private:
0142       std::string moduleLabel_;
0143 
0144       std::string mvaName_;
0145       edm::ESGetToken<GBRForest, GBRWrapperRcd> mvaToken_;
0146       bool loadMVAfromDB_;
0147       edm::FileInPath inputFileName_;
0148       const GBRForest* mvaReader_;
0149       int mvaOpt_;
0150       float* mvaInput_;
0151 
0152       typedef edm::AssociationVector<reco::PFTauRefProd, std::vector<reco::PFTauTransverseImpactParameterRef>>
0153           PFTauTIPAssociationByRef;
0154       edm::EDGetTokenT<PFTauTIPAssociationByRef> TauTransverseImpactParameters_token;
0155       edm::Handle<PFTauTIPAssociationByRef> tauLifetimeInfos;
0156 
0157       edm::EDGetTokenT<reco::TauDiscriminatorContainer> basicTauDiscriminators_token;
0158       edm::Handle<reco::TauDiscriminatorContainer> basicTauDiscriminators_;
0159       int chargedIsoPtSum_index_ = 0;
0160       int neutralIsoPtSum_index_ = 0;
0161       int pucorrPtSum_index_ = 0;
0162       int photonPtSumOutsideSignalCone_index_ = 0;
0163       int footprintCorrection_index_ = 0;
0164       std::string input_id_name_suffix_;
0165       edm::ProcessHistoryID phID_;
0166 
0167       edm::Handle<TauCollection> taus_;
0168 
0169       std::vector<TFile*> inputFilesToDelete_;
0170 
0171       int verbosity_;
0172     };
0173 
0174     void PFRecoTauDiscriminationByMVAIsolationRun2::beginEvent(const edm::Event& evt, const edm::EventSetup& es) {
0175       if (!mvaReader_) {
0176         if (loadMVAfromDB_) {
0177           mvaReader_ = &es.getData(mvaToken_);
0178         } else {
0179           mvaReader_ = loadMVAfromFile(inputFileName_, mvaName_, inputFilesToDelete_);
0180         }
0181       }
0182 
0183       evt.getByToken(TauTransverseImpactParameters_token, tauLifetimeInfos);
0184 
0185       evt.getByToken(basicTauDiscriminators_token, basicTauDiscriminators_);
0186 
0187       evt.getByToken(Tau_token, taus_);
0188 
0189       // load indices from input provenance config if process history changed, in particular for the first event
0190       // skip missing IDs and leave treatment to produce/discriminate function
0191       if (evt.processHistoryID() != phID_ && basicTauDiscriminators_.isValid()) {
0192         phID_ = evt.processHistoryID();
0193         const edm::Provenance* prov = basicTauDiscriminators_.provenance();
0194         const std::vector<edm::ParameterSet> psetsFromProvenance =
0195             edm::parameterSet(prov->stable(), evt.processHistory())
0196                 .getParameter<std::vector<edm::ParameterSet>>("IDdefinitions");
0197         for (uint i = 0; i < psetsFromProvenance.size(); i++) {
0198           if (psetsFromProvenance[i].getParameter<std::string>("IDname") == "ChargedIsoPtSum" + input_id_name_suffix_)
0199             chargedIsoPtSum_index_ = i;
0200           else if (psetsFromProvenance[i].getParameter<std::string>("IDname") ==
0201                    "NeutralIsoPtSum" + input_id_name_suffix_)
0202             neutralIsoPtSum_index_ = i;
0203           else if (psetsFromProvenance[i].getParameter<std::string>("IDname") == "PUcorrPtSum" + input_id_name_suffix_)
0204             pucorrPtSum_index_ = i;
0205           else if (psetsFromProvenance[i].getParameter<std::string>("IDname") ==
0206                    "PhotonPtSumOutsideSignalCone" + input_id_name_suffix_)
0207             photonPtSumOutsideSignalCone_index_ = i;
0208           else if (psetsFromProvenance[i].getParameter<std::string>("IDname") ==
0209                    "TauFootprintCorrection" + input_id_name_suffix_)
0210             footprintCorrection_index_ = i;
0211         }
0212       }
0213     }
0214 
0215     reco::SingleTauDiscriminatorContainer PFRecoTauDiscriminationByMVAIsolationRun2::discriminate(
0216         const PFTauRef& tau) const {
0217       reco::SingleTauDiscriminatorContainer result;
0218       result.rawValues = {-1.};
0219 
0220       // CV: computation of MVA value requires presence of leading charged hadron
0221       if (tau->leadChargedHadrCand().isNull())
0222         return 0.;
0223 
0224       int tauDecayMode = tau->decayMode();
0225 
0226       if (((mvaOpt_ == kOldDMwoLT || mvaOpt_ == kOldDMwLT || mvaOpt_ == kDBoldDMwLT || mvaOpt_ == kPWoldDMwLT ||
0227             mvaOpt_ == kDBoldDMwLTwGJ) &&
0228            (tauDecayMode == 0 || tauDecayMode == 1 || tauDecayMode == 2 || tauDecayMode == 10)) ||
0229           ((mvaOpt_ == kNewDMwoLT || mvaOpt_ == kNewDMwLT || mvaOpt_ == kDBnewDMwLT || mvaOpt_ == kPWnewDMwLT ||
0230             mvaOpt_ == kDBnewDMwLTwGJ) &&
0231            (tauDecayMode == 0 || tauDecayMode == 1 || tauDecayMode == 2 || tauDecayMode == 5 || tauDecayMode == 6 ||
0232             tauDecayMode == 10 || tauDecayMode == 11))) {
0233         auto const rawValues = (*basicTauDiscriminators_)[tau].rawValues;
0234         float chargedIsoPtSum = rawValues.at(chargedIsoPtSum_index_);
0235         float neutralIsoPtSum = rawValues.at(neutralIsoPtSum_index_);
0236         float puCorrPtSum = rawValues.at(pucorrPtSum_index_);
0237         float photonPtSumOutsideSignalCone = rawValues.at(photonPtSumOutsideSignalCone_index_);
0238         float footprintCorrection = rawValues.at(footprintCorrection_index_);
0239 
0240         const reco::PFTauTransverseImpactParameter& tauLifetimeInfo = *(*tauLifetimeInfos)[tau];
0241 
0242         float decayDistX = tauLifetimeInfo.flightLength().x();
0243         float decayDistY = tauLifetimeInfo.flightLength().y();
0244         float decayDistZ = tauLifetimeInfo.flightLength().z();
0245         float decayDistMag = std::sqrt(decayDistX * decayDistX + decayDistY * decayDistY + decayDistZ * decayDistZ);
0246 
0247         float nPhoton = (float)reco::tau::n_photons_total(*tau);
0248         float ptWeightedDetaStrip = reco::tau::pt_weighted_deta_strip(*tau, tauDecayMode);
0249         float ptWeightedDphiStrip = reco::tau::pt_weighted_dphi_strip(*tau, tauDecayMode);
0250         float ptWeightedDrSignal = reco::tau::pt_weighted_dr_signal(*tau, tauDecayMode);
0251         float ptWeightedDrIsolation = reco::tau::pt_weighted_dr_iso(*tau, tauDecayMode);
0252         float leadingTrackChi2 = reco::tau::lead_track_chi2(*tau);
0253         float eRatio = reco::tau::eratio(*tau);
0254 
0255         // Difference between measured and maximally allowed Gottfried-Jackson angle
0256         float gjAngleDiff = -999;
0257         if (tauDecayMode == 10) {
0258           double mTau = 1.77682;
0259           double mAOne = tau->p4().M();
0260           double pAOneMag = tau->p();
0261           double argumentThetaGJmax = (std::pow(mTau, 2) - std::pow(mAOne, 2)) / (2 * mTau * pAOneMag);
0262           double argumentThetaGJmeasured =
0263               (tau->p4().px() * decayDistX + tau->p4().py() * decayDistY + tau->p4().pz() * decayDistZ) /
0264               (pAOneMag * decayDistMag);
0265           if (std::abs(argumentThetaGJmax) <= 1. && std::abs(argumentThetaGJmeasured) <= 1.) {
0266             double thetaGJmax = std::asin(argumentThetaGJmax);
0267             double thetaGJmeasured = std::acos(argumentThetaGJmeasured);
0268             gjAngleDiff = thetaGJmeasured - thetaGJmax;
0269           }
0270         }
0271 
0272         if (mvaOpt_ == kOldDMwoLT || mvaOpt_ == kNewDMwoLT) {
0273           mvaInput_[0] = std::log(std::max(1.f, (float)tau->pt()));
0274           mvaInput_[1] = std::abs((float)tau->eta());
0275           mvaInput_[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
0276           mvaInput_[3] = std::log(std::max(1.e-2f, neutralIsoPtSum - 0.125f * puCorrPtSum));
0277           mvaInput_[4] = std::log(std::max(1.e-2f, puCorrPtSum));
0278           mvaInput_[5] = tauDecayMode;
0279         } else if (mvaOpt_ == kOldDMwLT || mvaOpt_ == kNewDMwLT) {
0280           mvaInput_[0] = std::log(std::max(1.f, (float)tau->pt()));
0281           mvaInput_[1] = std::abs((float)tau->eta());
0282           mvaInput_[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
0283           mvaInput_[3] = std::log(std::max(1.e-2f, neutralIsoPtSum - 0.125f * puCorrPtSum));
0284           mvaInput_[4] = std::log(std::max(1.e-2f, puCorrPtSum));
0285           mvaInput_[5] = tauDecayMode;
0286           mvaInput_[6] = std::copysign(+1.f, (float)tauLifetimeInfo.dxy());
0287           mvaInput_[7] = std::sqrt(std::abs(std::min(1.f, (float)tauLifetimeInfo.dxy())));
0288           mvaInput_[8] = std::min(10.f, std::abs((float)tauLifetimeInfo.dxy_Sig()));
0289           mvaInput_[9] = (tauLifetimeInfo.hasSecondaryVertex()) ? 1. : 0.;
0290           mvaInput_[10] = std::sqrt(decayDistMag);
0291           mvaInput_[11] = std::min(10.f, (float)tauLifetimeInfo.flightLengthSig());
0292         } else if (mvaOpt_ == kDBoldDMwLT || mvaOpt_ == kDBnewDMwLT) {
0293           mvaInput_[0] = std::log(std::max(1.f, (float)tau->pt()));
0294           mvaInput_[1] = std::abs((float)tau->eta());
0295           mvaInput_[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
0296           mvaInput_[3] = std::log(std::max(1.e-2f, neutralIsoPtSum));
0297           mvaInput_[4] = std::log(std::max(1.e-2f, puCorrPtSum));
0298           mvaInput_[5] = std::log(std::max(1.e-2f, photonPtSumOutsideSignalCone));
0299           mvaInput_[6] = tauDecayMode;
0300           mvaInput_[7] = std::min(30.f, nPhoton);
0301           mvaInput_[8] = std::min(0.5f, ptWeightedDetaStrip);
0302           mvaInput_[9] = std::min(0.5f, ptWeightedDphiStrip);
0303           mvaInput_[10] = std::min(0.5f, ptWeightedDrSignal);
0304           mvaInput_[11] = std::min(0.5f, ptWeightedDrIsolation);
0305           mvaInput_[12] = std::min(100.f, leadingTrackChi2);
0306           mvaInput_[13] = std::min(1.f, eRatio);
0307           mvaInput_[14] = std::copysign(+1.f, (float)tauLifetimeInfo.dxy());
0308           mvaInput_[15] = std::sqrt(std::min(1.f, std::abs((float)tauLifetimeInfo.dxy())));
0309           mvaInput_[16] = std::min(10.f, std::abs((float)tauLifetimeInfo.dxy_Sig()));
0310           mvaInput_[17] = std::copysign(+1.f, (float)tauLifetimeInfo.ip3d());
0311           mvaInput_[18] = std::sqrt(std::min(1.f, std::abs((float)tauLifetimeInfo.ip3d())));
0312           mvaInput_[19] = std::min(10.f, std::abs((float)tauLifetimeInfo.ip3d_Sig()));
0313           mvaInput_[20] = (tauLifetimeInfo.hasSecondaryVertex()) ? 1. : 0.;
0314           mvaInput_[21] = std::sqrt(decayDistMag);
0315           mvaInput_[22] = std::min(10.f, (float)tauLifetimeInfo.flightLengthSig());
0316         } else if (mvaOpt_ == kPWoldDMwLT || mvaOpt_ == kPWnewDMwLT) {
0317           mvaInput_[0] = std::log(std::max(1.f, (float)tau->pt()));
0318           mvaInput_[1] = std::abs((float)tau->eta());
0319           mvaInput_[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
0320           mvaInput_[3] = std::log(std::max(1.e-2f, neutralIsoPtSum));
0321           mvaInput_[4] = std::log(std::max(1.e-2f, footprintCorrection));
0322           mvaInput_[5] = std::log(std::max(1.e-2f, photonPtSumOutsideSignalCone));
0323           mvaInput_[6] = tauDecayMode;
0324           mvaInput_[7] = std::min(30.f, nPhoton);
0325           mvaInput_[8] = std::min(0.5f, ptWeightedDetaStrip);
0326           mvaInput_[9] = std::min(0.5f, ptWeightedDphiStrip);
0327           mvaInput_[10] = std::min(0.5f, ptWeightedDrSignal);
0328           mvaInput_[11] = std::min(0.5f, ptWeightedDrIsolation);
0329           mvaInput_[12] = std::min(100.f, leadingTrackChi2);
0330           mvaInput_[13] = std::min(1.f, eRatio);
0331           mvaInput_[14] = std::copysign(+1.f, (float)tauLifetimeInfo.dxy());
0332           mvaInput_[15] = std::sqrt(std::min(1.f, std::abs((float)tauLifetimeInfo.dxy())));
0333           mvaInput_[16] = std::min(10.f, std::abs((float)tauLifetimeInfo.dxy_Sig()));
0334           mvaInput_[17] = std::copysign(+1.f, (float)tauLifetimeInfo.ip3d());
0335           mvaInput_[18] = std::sqrt(std::min(1.f, std::abs((float)tauLifetimeInfo.ip3d())));
0336           mvaInput_[19] = std::min(10.f, std::abs((float)tauLifetimeInfo.ip3d_Sig()));
0337           mvaInput_[20] = (tauLifetimeInfo.hasSecondaryVertex()) ? 1. : 0.;
0338           mvaInput_[21] = std::sqrt(decayDistMag);
0339           mvaInput_[22] = std::min(10.f, (float)tauLifetimeInfo.flightLengthSig());
0340         } else if (mvaOpt_ == kDBoldDMwLTwGJ || mvaOpt_ == kDBnewDMwLTwGJ) {
0341           mvaInput_[0] = std::log(std::max(1.f, (float)tau->pt()));
0342           mvaInput_[1] = std::abs((float)tau->eta());
0343           mvaInput_[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
0344           mvaInput_[3] = std::log(std::max(1.e-2f, neutralIsoPtSum));
0345           mvaInput_[4] = std::log(std::max(1.e-2f, puCorrPtSum));
0346           mvaInput_[5] = std::log(std::max(1.e-2f, photonPtSumOutsideSignalCone));
0347           mvaInput_[6] = tauDecayMode;
0348           mvaInput_[7] = std::min(30.f, nPhoton);
0349           mvaInput_[8] = std::min(0.5f, ptWeightedDetaStrip);
0350           mvaInput_[9] = std::min(0.5f, ptWeightedDphiStrip);
0351           mvaInput_[10] = std::min(0.5f, ptWeightedDrSignal);
0352           mvaInput_[11] = std::min(0.5f, ptWeightedDrIsolation);
0353           mvaInput_[12] = std::min(1.f, eRatio);
0354           mvaInput_[13] = std::copysign(+1.f, (float)tauLifetimeInfo.dxy());
0355           mvaInput_[14] = std::sqrt(std::min(1.f, std::abs((float)tauLifetimeInfo.dxy())));
0356           mvaInput_[15] = std::min(10.f, std::abs((float)tauLifetimeInfo.dxy_Sig()));
0357           mvaInput_[16] = std::copysign(+1.f, (float)tauLifetimeInfo.ip3d());
0358           mvaInput_[17] = std::sqrt(std::min(1.f, std::abs((float)tauLifetimeInfo.ip3d())));
0359           mvaInput_[18] = std::min(10.f, std::abs((float)tauLifetimeInfo.ip3d_Sig()));
0360           mvaInput_[19] = (tauLifetimeInfo.hasSecondaryVertex()) ? 1. : 0.;
0361           mvaInput_[20] = std::sqrt(decayDistMag);
0362           mvaInput_[21] = std::min(10.f, (float)tauLifetimeInfo.flightLengthSig());
0363           mvaInput_[22] = std::max(-1.f, gjAngleDiff);
0364         }
0365 
0366         double mvaValue = mvaReader_->GetClassifier(mvaInput_);
0367         if (verbosity_) {
0368           edm::LogPrint("PFTauDiscByMVAIsol2") << "<PFRecoTauDiscriminationByMVAIsolationRun2::discriminate>:";
0369           edm::LogPrint("PFTauDiscByMVAIsol2") << " tau: Pt = " << tau->pt() << ", eta = " << tau->eta();
0370           edm::LogPrint("PFTauDiscByMVAIsol2") << " isolation: charged = " << chargedIsoPtSum
0371                                                << ", neutral = " << neutralIsoPtSum << ", PUcorr = " << puCorrPtSum;
0372           edm::LogPrint("PFTauDiscByMVAIsol2") << " decay mode = " << tauDecayMode;
0373           edm::LogPrint("PFTauDiscByMVAIsol2") << " impact parameter: distance = " << tauLifetimeInfo.dxy()
0374                                                << ", significance = " << tauLifetimeInfo.dxy_Sig();
0375           edm::LogPrint("PFTauDiscByMVAIsol2")
0376               << " has decay vertex = " << tauLifetimeInfo.hasSecondaryVertex() << ":"
0377               << " distance = " << decayDistMag << ", significance = " << tauLifetimeInfo.flightLengthSig();
0378           edm::LogPrint("PFTauDiscByMVAIsol2") << "--> mvaValue = " << mvaValue;
0379         }
0380         result.rawValues.at(0) = mvaValue;
0381       }
0382       return result;
0383     }
0384 
0385     void PFRecoTauDiscriminationByMVAIsolationRun2::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0386       // pfRecoTauDiscriminationByMVAIsolationRun2
0387       edm::ParameterSetDescription desc;
0388 
0389       desc.add<std::string>("mvaName", "tauIdMVAnewDMwLT");
0390       desc.add<bool>("loadMVAfromDB", true);
0391       desc.addOptional<edm::FileInPath>("inputFileName");
0392       desc.add<std::string>("mvaOpt", "newDMwLT");
0393 
0394       desc.add<edm::InputTag>("srcTauTransverseImpactParameters", edm::InputTag(""));
0395       desc.add<edm::InputTag>("srcBasicTauDiscriminators", edm::InputTag("hpsPFTauBasicDiscriminators"));
0396       desc.add<std::string>("inputIDNameSuffix", "");
0397 
0398       desc.add<int>("verbosity", 0);
0399 
0400       fillProducerDescriptions(desc);  // inherited from the base
0401 
0402       descriptions.add("pfRecoTauDiscriminationByMVAIsolationRun2", desc);
0403     }
0404 
0405     DEFINE_FWK_MODULE(PFRecoTauDiscriminationByMVAIsolationRun2);
0406 
0407   }  // namespace tau
0408 }  // namespace reco