50 std::vector<TFile*>& inputFilesToDelete) {
52 throw cms::Exception(
"PATTauDiscriminationByIsolationMVARun2::loadMVA")
53 <<
" Failed to find File = " << inputFileName <<
" !!\n";
59 throw cms::Exception(
"PATTauDiscriminationByIsolationMVARun2::loadMVA")
60 <<
" Failed to load MVA = " << mvaName.data() <<
" from file = " << inputFileName.
fullPath().data()
63 inputFilesToDelete.push_back(inputFile);
80 loadMVAfromDB_ = cfg.
getParameter<
bool>(
"loadMVAfromDB");
81 if (!loadMVAfromDB_) {
87 if (mvaOpt_string ==
"oldDMwoLT")
89 else if (mvaOpt_string ==
"oldDMwLT")
91 else if (mvaOpt_string ==
"newDMwoLT")
93 else if (mvaOpt_string ==
"newDMwLT")
95 else if (mvaOpt_string ==
"DBoldDMwLT")
97 else if (mvaOpt_string ==
"DBnewDMwLT")
99 else if (mvaOpt_string ==
"PWoldDMwLT")
101 else if (mvaOpt_string ==
"PWnewDMwLT")
103 else if (mvaOpt_string ==
"DBoldDMwLTwGJ")
105 else if (mvaOpt_string ==
"DBnewDMwLTwGJ")
107 else if (mvaOpt_string ==
"DBnewDMwLTwGJPhase2")
111 <<
" Invalid Configuration Parameter 'mvaOpt' = " << mvaOpt_string <<
" !!\n";
114 mvaInput_ =
new float[6];
116 mvaInput_ =
new float[12];
119 mvaInput_ =
new float[23];
121 mvaInput_ =
new float[30];
142 for (std::vector<TFile*>::iterator it = inputFilesToDelete_.begin(); it != inputFilesToDelete_.end(); ++it) {
174 if (loadMVAfromDB_) {
175 mvaReader_ = &es.
getData(mvaToken_);
177 mvaReader_ = loadMVAfromFile(inputFileName_, mvaName_, inputFilesToDelete_);
190 if (tau->leadChargedHadrCand().
isNull()) {
201 photonPtSumOutsideSignalCone_,
202 footprintCorrection_)) {
203 double mvaValue = mvaReader_->GetClassifier(mvaInput_);
205 edm::LogPrint(
"PATTauDiscByMVAIsolRun2") <<
"<PATTauDiscriminationByMVAIsolationRun2::discriminate>:";
206 edm::LogPrint(
"PATTauDiscByMVAIsolRun2") <<
" tau: Pt = " << tau->pt() <<
", eta = " << tau->eta();
208 <<
" isolation: charged = " << tau->tauID(chargedIsoPtSums_)
209 <<
", neutral = " << tau->tauID(neutralIsoPtSums_) <<
", PUcorr = " << tau->tauID(puCorrPtSums_);
210 edm::LogPrint(
"PATTauDiscByMVAIsolRun2") <<
" decay mode = " << tau->decayMode();
212 <<
" impact parameter: distance = " << tau->dxy() <<
", significance = " << tau->dxy_Sig();
213 edm::LogPrint(
"PATTauDiscByMVAIsolRun2") <<
" has decay vertex = " << tau->hasSecondaryVertex() <<
":"
214 <<
", significance = " << tau->flightLengthSig();
215 edm::LogPrint(
"PATTauDiscByMVAIsolRun2") <<
"--> mvaValue = " << mvaValue;
227 desc.
add<
bool>(
"loadMVAfromDB");
236 desc.
add<
int>(
"verbosity", 0);
238 fillProducerDescriptions(desc);
240 descriptions.
add(
"patTauDiscriminationByMVAIsolationRun2", desc);
std::string footprintCorrection_
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::Handle< TauCollection > taus_
const GBRForest * mvaReader_
bool fillIsoMVARun2Inputs(float *mvaInput, const pat::Tau &tau, int mvaOpt, const std::string &nameCharged, const std::string &nameNeutral, const std::string &namePu, const std::string &nameOutside, const std::string &nameFootprint)
std::string photonPtSumOutsideSignalCone_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaToken_
bool getData(T &iHolder) const
std::string chargedIsoPtSums_
PATTauDiscriminationByMVAIsolationRun2(const edm::ParameterSet &cfg)
~PATTauDiscriminationByMVAIsolationRun2() override
LocationCode location() const
Where was the file found?
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Log< level::Warning, true > LogPrint
bool isNull() const
Checks for null.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::string neutralIsoPtSums_
std::vector< TFile * > inputFilesToDelete_
std::string puCorrPtSums_
std::string fullPath() const
edm::FileInPath inputFileName_
std::vector< float > rawValues