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")
112 else if (mvaOpt_string ==
"DBnewDMwLTwGJPhase2")
116 <<
" Invalid Configuration Parameter 'mvaOpt' = " << mvaOpt_string <<
" !!\n";
119 mvaInput_ =
new float[6];
121 mvaInput_ =
new float[12];
124 mvaInput_ =
new float[23];
126 mvaInput_ =
new float[30];
130 chargedIsoPtSums_ =
cfg.getParameter<
std::string>(
"srcChargedIsoPtSum");
131 neutralIsoPtSums_ =
cfg.getParameter<
std::string>(
"srcNeutralIsoPtSum");
133 photonPtSumOutsideSignalCone_ =
cfg.getParameter<
std::string>(
"srcPhotonPtSumOutsideSignalCone");
134 footprintCorrection_ =
cfg.getParameter<
std::string>(
"srcFootprintCorrection");
136 verbosity_ =
cfg.getParameter<
int>(
"verbosity");
147 for (std::vector<TFile*>::iterator it = inputFilesToDelete_.begin(); it != inputFilesToDelete_.end(); ++it) {
178 if (loadMVAfromDB_) {
181 mvaReader_ = loadMVAfromFile(inputFileName_, mvaName_, inputFilesToDelete_);
194 if (
tau->leadChargedHadrCand().isNull()) {
195 result.rawValues.at(0) = 0.;
205 photonPtSumOutsideSignalCone_,
206 footprintCorrection_)) {
207 double mvaValue = mvaReader_->GetClassifier(mvaInput_);
209 edm::LogPrint(
"PATTauDiscByMVAIsolRun2") <<
"<PATTauDiscriminationByMVAIsolationRun2::discriminate>:";
210 edm::LogPrint(
"PATTauDiscByMVAIsolRun2") <<
" tau: Pt = " <<
tau->pt() <<
", eta = " <<
tau->eta();
212 <<
" isolation: charged = " <<
tau->tauID(chargedIsoPtSums_)
213 <<
", neutral = " <<
tau->tauID(neutralIsoPtSums_) <<
", PUcorr = " <<
tau->tauID(puCorrPtSums_);
214 edm::LogPrint(
"PATTauDiscByMVAIsolRun2") <<
" decay mode = " <<
tau->decayMode();
216 <<
" impact parameter: distance = " <<
tau->dxy() <<
", significance = " <<
tau->dxy_Sig();
217 edm::LogPrint(
"PATTauDiscByMVAIsolRun2") <<
" has decay vertex = " <<
tau->hasSecondaryVertex() <<
":"
218 <<
", significance = " <<
tau->flightLengthSig();
219 edm::LogPrint(
"PATTauDiscByMVAIsolRun2") <<
"--> mvaValue = " << mvaValue;
221 result.rawValues.at(0) = mvaValue;
231 desc.add<
bool>(
"loadMVAfromDB");
240 desc.add<
int>(
"verbosity", 0);
242 fillProducerDescriptions(
desc);
244 descriptions.
add(
"patTauDiscriminationByMVAIsolationRun2",
desc);