51 std::vector<TFile*>& inputFilesToDelete) {
53 throw cms::Exception(
"PATTauDiscriminationByIsolationMVARun2::loadMVA")
60 throw cms::Exception(
"PATTauDiscriminationByIsolationMVARun2::loadMVA")
61 <<
" Failed to load MVA = " <<
mvaName.data() <<
" from file = " <<
inputFileName.fullPath().data()
83 moduleLabel_(
cfg.getParameter<
std::
string>(
"@module_label")),
87 loadMVAfromDB_ =
cfg.getParameter<
bool>(
"loadMVAfromDB");
88 if (!loadMVAfromDB_) {
92 if (mvaOpt_string ==
"oldDMwoLT")
94 else if (mvaOpt_string ==
"oldDMwLT")
96 else if (mvaOpt_string ==
"newDMwoLT")
98 else if (mvaOpt_string ==
"newDMwLT")
100 else if (mvaOpt_string ==
"DBoldDMwLT")
102 else if (mvaOpt_string ==
"DBnewDMwLT")
104 else if (mvaOpt_string ==
"PWoldDMwLT")
106 else if (mvaOpt_string ==
"PWnewDMwLT")
108 else if (mvaOpt_string ==
"DBoldDMwLTwGJ")
110 else if (mvaOpt_string ==
"DBnewDMwLTwGJ")
114 <<
" Invalid Configuration Parameter 'mvaOpt' = " << mvaOpt_string <<
" !!\n";
117 mvaInput_ =
new float[6];
119 mvaInput_ =
new float[12];
122 mvaInput_ =
new float[23];
126 chargedIsoPtSums_ =
cfg.getParameter<
std::string>(
"srcChargedIsoPtSum");
127 neutralIsoPtSums_ =
cfg.getParameter<
std::string>(
"srcNeutralIsoPtSum");
129 photonPtSumOutsideSignalCone_ =
cfg.getParameter<
std::string>(
"srcPhotonPtSumOutsideSignalCone");
130 footprintCorrection_ =
cfg.getParameter<
std::string>(
"srcFootprintCorrection");
132 verbosity_ =
cfg.getParameter<
int>(
"verbosity");
143 for (std::vector<TFile*>::iterator it = inputFilesToDelete_.begin(); it != inputFilesToDelete_.end(); ++it) {
174 if (loadMVAfromDB_) {
177 mvaReader_ = loadMVAfromFile(inputFileName_, mvaName_, inputFilesToDelete_);
190 if (
tau->leadChargedHadrCand().isNull()) {
191 result.rawValues.at(0) = 0.;
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;
217 result.rawValues.at(0) = mvaValue;
227 desc.
add<
bool>(
"loadMVAfromDB");
236 desc.
add<
int>(
"verbosity", 0);
238 fillProducerDescriptions(desc);
240 descriptions.
add(
"patTauDiscriminationByMVAIsolationRun2", desc);