CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2 Class Reference
Inheritance diagram for reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2:
TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType > edm::stream::EDProducer<>

Public Member Functions

void beginEvent (const edm::Event &, const edm::EventSetup &) override
 
reco::SingleTauDiscriminatorContainer discriminate (const PFTauRef &) const override
 
 PFRecoTauDiscriminationByMVAIsolationRun2 (const edm::ParameterSet &cfg)
 
 ~PFRecoTauDiscriminationByMVAIsolationRun2 () override
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >
virtual TauDiscriminatorDataType discriminate (const TauRef &tau) const =0
 
virtual void endEvent (edm::Event &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 TauDiscriminationProducerBase ()
 
 TauDiscriminationProducerBase (const edm::ParameterSet &iConfig)
 
 ~TauDiscriminationProducerBase () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >
static void fillProducerDescriptions (edm::ParameterSetDescription &desc)
 
static std::string getTauTypeString ()
 helper method to retrieve tau type name, e.g. to build correct cfi getter More...
 

Private Types

typedef edm::AssociationVector< reco::PFTauRefProd, std::vector< reco::PFTauTransverseImpactParameterRef > > PFTauTIPAssociationByRef
 

Private Attributes

edm::Handle< reco::TauDiscriminatorContainerbasicTauDiscriminators_
 
edm::EDGetTokenT< reco::TauDiscriminatorContainerbasicTauDiscriminators_token
 
int chargedIsoPtSum_index_ = 0
 
int footprintCorrection_index_ = 0
 
std::string input_id_name_suffix_
 
edm::FileInPath inputFileName_
 
std::vector< TFile * > inputFilesToDelete_
 
bool loadMVAfromDB_
 
std::string moduleLabel_
 
float * mvaInput_
 
std::string mvaName_
 
int mvaOpt_
 
const GBRForestmvaReader_
 
int neutralIsoPtSum_index_ = 0
 
edm::ProcessHistoryID phID_
 
int photonPtSumOutsideSignalCone_index_ = 0
 
int pucorrPtSum_index_ = 0
 
edm::Handle< PFTauTIPAssociationByReftauLifetimeInfos
 
edm::Handle< TauCollectiontaus_
 
edm::EDGetTokenT< PFTauTIPAssociationByRefTauTransverseImpactParameters_token
 
int verbosity_
 

Additional Inherited Members

- Public Types inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >
typedef std::vector< TauType > TauCollection
 
typedef edm::Ref< TauCollectionTauRef
 
typedef edm::RefProd< TauCollectionTauRefProd
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Protected Attributes inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >
std::string moduleLabel_
 
double prediscriminantFailValue_
 
edm::EDGetTokenT< TauCollectionTau_token
 
size_t tauIndex_
 
edm::InputTag TauProducer_
 

Detailed Description

Definition at line 74 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

Member Typedef Documentation

◆ PFTauTIPAssociationByRef

Constructor & Destructor Documentation

◆ PFRecoTauDiscriminationByMVAIsolationRun2()

reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::PFRecoTauDiscriminationByMVAIsolationRun2 ( const edm::ParameterSet cfg)
inlineexplicit

Definition at line 76 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

78  moduleLabel_(cfg.getParameter<std::string>("@module_label")),
79  mvaReader_(nullptr),
80  mvaInput_(nullptr) {
81  mvaName_ = cfg.getParameter<std::string>("mvaName");
82  loadMVAfromDB_ = cfg.getParameter<bool>("loadMVAfromDB");
83  if (!loadMVAfromDB_) {
84  inputFileName_ = cfg.getParameter<edm::FileInPath>("inputFileName");
85  }
86  std::string mvaOpt_string = cfg.getParameter<std::string>("mvaOpt");
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
108  throw cms::Exception("PFRecoTauDiscriminationByMVAIsolationRun2")
109  << " Invalid Configuration Parameter 'mvaOpt' = " << mvaOpt_string << " !!\n";
110 
111  if (mvaOpt_ == kOldDMwoLT || mvaOpt_ == kNewDMwoLT)
112  mvaInput_ = new float[6];
113  else if (mvaOpt_ == kOldDMwLT || mvaOpt_ == kNewDMwLT)
114  mvaInput_ = new float[12];
117  mvaInput_ = new float[23];
118  else
119  assert(0);
120 
122  consumes<PFTauTIPAssociationByRef>(cfg.getParameter<edm::InputTag>("srcTauTransverseImpactParameters"));
123 
125  consumes<reco::TauDiscriminatorContainer>(cfg.getParameter<edm::InputTag>("srcBasicTauDiscriminators"));
126  input_id_name_suffix_ = cfg.getParameter<std::string>("inputIDNameSuffix");
127 
128  verbosity_ = cfg.getParameter<int>("verbosity");
129  }

References cms::cuda::assert(), basicTauDiscriminators_token, looper::cfg, Exception, input_id_name_suffix_, inputFileName_, reco::tau::kDBnewDMwLT, reco::tau::kDBnewDMwLTwGJ, reco::tau::kDBoldDMwLT, reco::tau::kDBoldDMwLTwGJ, reco::tau::kNewDMwLT, reco::tau::kNewDMwoLT, reco::tau::kOldDMwLT, reco::tau::kOldDMwoLT, reco::tau::kPWnewDMwLT, reco::tau::kPWoldDMwLT, loadMVAfromDB_, mvaInput_, mvaName_, mvaOpt_, AlCaHLTBitMon_QueryRunRegistry::string, TauTransverseImpactParameters_token, and verbosity_.

◆ ~PFRecoTauDiscriminationByMVAIsolationRun2()

reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::~PFRecoTauDiscriminationByMVAIsolationRun2 ( )
inlineoverride

Definition at line 135 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

135  {
136  if (!loadMVAfromDB_)
137  delete mvaReader_;
138  delete[] mvaInput_;
139  for (std::vector<TFile*>::iterator it = inputFilesToDelete_.begin(); it != inputFilesToDelete_.end(); ++it) {
140  delete (*it);
141  }
142  }

References inputFilesToDelete_, loadMVAfromDB_, mvaInput_, and mvaReader_.

Member Function Documentation

◆ beginEvent()

void reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::beginEvent ( const edm::Event evt,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >.

Definition at line 178 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

178  {
179  if (!mvaReader_) {
180  if (loadMVAfromDB_) {
182  } else {
184  }
185  }
186 
188 
190 
191  evt.getByToken(Tau_token, taus_);
192 
193  // load indices from input provenance config if process history changed, in particular for the first event
194  // skip missing IDs and leave treatment to produce/discriminate function
195  if (evt.processHistoryID() != phID_ && basicTauDiscriminators_.isValid()) {
196  phID_ = evt.processHistoryID();
197  const edm::Provenance* prov = basicTauDiscriminators_.provenance();
198  const std::vector<edm::ParameterSet> psetsFromProvenance =
199  edm::parameterSet(prov->stable(), evt.processHistory())
200  .getParameter<std::vector<edm::ParameterSet>>("IDdefinitions");
201  for (uint i = 0; i < psetsFromProvenance.size(); i++) {
202  if (psetsFromProvenance[i].getParameter<std::string>("IDname") == "ChargedIsoPtSum" + input_id_name_suffix_)
204  else if (psetsFromProvenance[i].getParameter<std::string>("IDname") ==
205  "NeutralIsoPtSum" + input_id_name_suffix_)
207  else if (psetsFromProvenance[i].getParameter<std::string>("IDname") == "PUcorrPtSum" + input_id_name_suffix_)
209  else if (psetsFromProvenance[i].getParameter<std::string>("IDname") ==
210  "PhotonPtSumOutsideSignalCone" + input_id_name_suffix_)
212  else if (psetsFromProvenance[i].getParameter<std::string>("IDname") ==
213  "TauFootprintCorrection" + input_id_name_suffix_)
215  }
216  }
217  }

References basicTauDiscriminators_, basicTauDiscriminators_token, chargedIsoPtSum_index_, footprintCorrection_index_, edm::Event::getByToken(), mps_fire::i, input_id_name_suffix_, inputFileName_, inputFilesToDelete_, taus_updatedMVAIds_cff::loadMVAfromDB, loadMVAfromDB_, mvaName_, mvaReader_, neutralIsoPtSum_index_, edm::parameterSet(), phID_, photonPtSumOutsideSignalCone_index_, edm::Event::processHistory(), edm::Event::processHistoryID(), pucorrPtSum_index_, edm::Provenance::stable(), TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >::Tau_token, tauLifetimeInfos, taus_, TauTransverseImpactParameters_token, and parallelization::uint.

◆ discriminate()

reco::SingleTauDiscriminatorContainer reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::discriminate ( const PFTauRef tau) const
override

Definition at line 219 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

220  {
222  result.rawValues = {-1.};
223 
224  // CV: computation of MVA value requires presence of leading charged hadron
225  if (tau->leadChargedHadrCand().isNull())
226  return 0.;
227 
228  int tauDecayMode = tau->decayMode();
229 
231  mvaOpt_ == kDBoldDMwLTwGJ) &&
232  (tauDecayMode == 0 || tauDecayMode == 1 || tauDecayMode == 2 || tauDecayMode == 10)) ||
234  mvaOpt_ == kDBnewDMwLTwGJ) &&
235  (tauDecayMode == 0 || tauDecayMode == 1 || tauDecayMode == 2 || tauDecayMode == 5 || tauDecayMode == 6 ||
236  tauDecayMode == 10 || tauDecayMode == 11))) {
237  auto const rawValues = (*basicTauDiscriminators_)[tau].rawValues;
238  float chargedIsoPtSum = rawValues.at(chargedIsoPtSum_index_);
239  float neutralIsoPtSum = rawValues.at(neutralIsoPtSum_index_);
240  float puCorrPtSum = rawValues.at(pucorrPtSum_index_);
241  float photonPtSumOutsideSignalCone = rawValues.at(photonPtSumOutsideSignalCone_index_);
242  float footprintCorrection = rawValues.at(footprintCorrection_index_);
243 
244  const reco::PFTauTransverseImpactParameter& tauLifetimeInfo = *(*tauLifetimeInfos)[tau];
245 
246  float decayDistX = tauLifetimeInfo.flightLength().x();
247  float decayDistY = tauLifetimeInfo.flightLength().y();
248  float decayDistZ = tauLifetimeInfo.flightLength().z();
249  float decayDistMag = std::sqrt(decayDistX * decayDistX + decayDistY * decayDistY + decayDistZ * decayDistZ);
250 
251  float nPhoton = (float)reco::tau::n_photons_total(*tau);
252  float ptWeightedDetaStrip = reco::tau::pt_weighted_deta_strip(*tau, tauDecayMode);
253  float ptWeightedDphiStrip = reco::tau::pt_weighted_dphi_strip(*tau, tauDecayMode);
254  float ptWeightedDrSignal = reco::tau::pt_weighted_dr_signal(*tau, tauDecayMode);
255  float ptWeightedDrIsolation = reco::tau::pt_weighted_dr_iso(*tau, tauDecayMode);
256  float leadingTrackChi2 = reco::tau::lead_track_chi2(*tau);
257  float eRatio = reco::tau::eratio(*tau);
258 
259  // Difference between measured and maximally allowed Gottfried-Jackson angle
260  float gjAngleDiff = -999;
261  if (tauDecayMode == 10) {
262  double mTau = 1.77682;
263  double mAOne = tau->p4().M();
264  double pAOneMag = tau->p();
265  double argumentThetaGJmax = (std::pow(mTau, 2) - std::pow(mAOne, 2)) / (2 * mTau * pAOneMag);
266  double argumentThetaGJmeasured =
267  (tau->p4().px() * decayDistX + tau->p4().py() * decayDistY + tau->p4().pz() * decayDistZ) /
268  (pAOneMag * decayDistMag);
269  if (std::abs(argumentThetaGJmax) <= 1. && std::abs(argumentThetaGJmeasured) <= 1.) {
270  double thetaGJmax = std::asin(argumentThetaGJmax);
271  double thetaGJmeasured = std::acos(argumentThetaGJmeasured);
272  gjAngleDiff = thetaGJmeasured - thetaGJmax;
273  }
274  }
275 
276  if (mvaOpt_ == kOldDMwoLT || mvaOpt_ == kNewDMwoLT) {
277  mvaInput_[0] = std::log(std::max(1.f, (float)tau->pt()));
278  mvaInput_[1] = std::abs((float)tau->eta());
279  mvaInput_[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
280  mvaInput_[3] = std::log(std::max(1.e-2f, neutralIsoPtSum - 0.125f * puCorrPtSum));
281  mvaInput_[4] = std::log(std::max(1.e-2f, puCorrPtSum));
282  mvaInput_[5] = tauDecayMode;
283  } else if (mvaOpt_ == kOldDMwLT || mvaOpt_ == kNewDMwLT) {
284  mvaInput_[0] = std::log(std::max(1.f, (float)tau->pt()));
285  mvaInput_[1] = std::abs((float)tau->eta());
286  mvaInput_[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
287  mvaInput_[3] = std::log(std::max(1.e-2f, neutralIsoPtSum - 0.125f * puCorrPtSum));
288  mvaInput_[4] = std::log(std::max(1.e-2f, puCorrPtSum));
289  mvaInput_[5] = tauDecayMode;
290  mvaInput_[6] = std::copysign(+1.f, (float)tauLifetimeInfo.dxy());
291  mvaInput_[7] = std::sqrt(std::abs(std::min(1.f, (float)tauLifetimeInfo.dxy())));
292  mvaInput_[8] = std::min(10.f, std::abs((float)tauLifetimeInfo.dxy_Sig()));
293  mvaInput_[9] = (tauLifetimeInfo.hasSecondaryVertex()) ? 1. : 0.;
294  mvaInput_[10] = std::sqrt(decayDistMag);
295  mvaInput_[11] = std::min(10.f, (float)tauLifetimeInfo.flightLengthSig());
296  } else if (mvaOpt_ == kDBoldDMwLT || mvaOpt_ == kDBnewDMwLT) {
297  mvaInput_[0] = std::log(std::max(1.f, (float)tau->pt()));
298  mvaInput_[1] = std::abs((float)tau->eta());
299  mvaInput_[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
300  mvaInput_[3] = std::log(std::max(1.e-2f, neutralIsoPtSum));
301  mvaInput_[4] = std::log(std::max(1.e-2f, puCorrPtSum));
302  mvaInput_[5] = std::log(std::max(1.e-2f, photonPtSumOutsideSignalCone));
303  mvaInput_[6] = tauDecayMode;
304  mvaInput_[7] = std::min(30.f, nPhoton);
305  mvaInput_[8] = std::min(0.5f, ptWeightedDetaStrip);
306  mvaInput_[9] = std::min(0.5f, ptWeightedDphiStrip);
307  mvaInput_[10] = std::min(0.5f, ptWeightedDrSignal);
308  mvaInput_[11] = std::min(0.5f, ptWeightedDrIsolation);
309  mvaInput_[12] = std::min(100.f, leadingTrackChi2);
310  mvaInput_[13] = std::min(1.f, eRatio);
311  mvaInput_[14] = std::copysign(+1.f, (float)tauLifetimeInfo.dxy());
312  mvaInput_[15] = std::sqrt(std::min(1.f, std::abs((float)tauLifetimeInfo.dxy())));
313  mvaInput_[16] = std::min(10.f, std::abs((float)tauLifetimeInfo.dxy_Sig()));
314  mvaInput_[17] = std::copysign(+1.f, (float)tauLifetimeInfo.ip3d());
315  mvaInput_[18] = std::sqrt(std::min(1.f, std::abs((float)tauLifetimeInfo.ip3d())));
316  mvaInput_[19] = std::min(10.f, std::abs((float)tauLifetimeInfo.ip3d_Sig()));
317  mvaInput_[20] = (tauLifetimeInfo.hasSecondaryVertex()) ? 1. : 0.;
318  mvaInput_[21] = std::sqrt(decayDistMag);
319  mvaInput_[22] = std::min(10.f, (float)tauLifetimeInfo.flightLengthSig());
320  } else if (mvaOpt_ == kPWoldDMwLT || mvaOpt_ == kPWnewDMwLT) {
321  mvaInput_[0] = std::log(std::max(1.f, (float)tau->pt()));
322  mvaInput_[1] = std::abs((float)tau->eta());
323  mvaInput_[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
324  mvaInput_[3] = std::log(std::max(1.e-2f, neutralIsoPtSum));
325  mvaInput_[4] = std::log(std::max(1.e-2f, footprintCorrection));
326  mvaInput_[5] = std::log(std::max(1.e-2f, photonPtSumOutsideSignalCone));
327  mvaInput_[6] = tauDecayMode;
328  mvaInput_[7] = std::min(30.f, nPhoton);
329  mvaInput_[8] = std::min(0.5f, ptWeightedDetaStrip);
330  mvaInput_[9] = std::min(0.5f, ptWeightedDphiStrip);
331  mvaInput_[10] = std::min(0.5f, ptWeightedDrSignal);
332  mvaInput_[11] = std::min(0.5f, ptWeightedDrIsolation);
333  mvaInput_[12] = std::min(100.f, leadingTrackChi2);
334  mvaInput_[13] = std::min(1.f, eRatio);
335  mvaInput_[14] = std::copysign(+1.f, (float)tauLifetimeInfo.dxy());
336  mvaInput_[15] = std::sqrt(std::min(1.f, std::abs((float)tauLifetimeInfo.dxy())));
337  mvaInput_[16] = std::min(10.f, std::abs((float)tauLifetimeInfo.dxy_Sig()));
338  mvaInput_[17] = std::copysign(+1.f, (float)tauLifetimeInfo.ip3d());
339  mvaInput_[18] = std::sqrt(std::min(1.f, std::abs((float)tauLifetimeInfo.ip3d())));
340  mvaInput_[19] = std::min(10.f, std::abs((float)tauLifetimeInfo.ip3d_Sig()));
341  mvaInput_[20] = (tauLifetimeInfo.hasSecondaryVertex()) ? 1. : 0.;
342  mvaInput_[21] = std::sqrt(decayDistMag);
343  mvaInput_[22] = std::min(10.f, (float)tauLifetimeInfo.flightLengthSig());
344  } else if (mvaOpt_ == kDBoldDMwLTwGJ || mvaOpt_ == kDBnewDMwLTwGJ) {
345  mvaInput_[0] = std::log(std::max(1.f, (float)tau->pt()));
346  mvaInput_[1] = std::abs((float)tau->eta());
347  mvaInput_[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
348  mvaInput_[3] = std::log(std::max(1.e-2f, neutralIsoPtSum));
349  mvaInput_[4] = std::log(std::max(1.e-2f, puCorrPtSum));
350  mvaInput_[5] = std::log(std::max(1.e-2f, photonPtSumOutsideSignalCone));
351  mvaInput_[6] = tauDecayMode;
352  mvaInput_[7] = std::min(30.f, nPhoton);
353  mvaInput_[8] = std::min(0.5f, ptWeightedDetaStrip);
354  mvaInput_[9] = std::min(0.5f, ptWeightedDphiStrip);
355  mvaInput_[10] = std::min(0.5f, ptWeightedDrSignal);
356  mvaInput_[11] = std::min(0.5f, ptWeightedDrIsolation);
357  mvaInput_[12] = std::min(1.f, eRatio);
358  mvaInput_[13] = std::copysign(+1.f, (float)tauLifetimeInfo.dxy());
359  mvaInput_[14] = std::sqrt(std::min(1.f, std::abs((float)tauLifetimeInfo.dxy())));
360  mvaInput_[15] = std::min(10.f, std::abs((float)tauLifetimeInfo.dxy_Sig()));
361  mvaInput_[16] = std::copysign(+1.f, (float)tauLifetimeInfo.ip3d());
362  mvaInput_[17] = std::sqrt(std::min(1.f, std::abs((float)tauLifetimeInfo.ip3d())));
363  mvaInput_[18] = std::min(10.f, std::abs((float)tauLifetimeInfo.ip3d_Sig()));
364  mvaInput_[19] = (tauLifetimeInfo.hasSecondaryVertex()) ? 1. : 0.;
365  mvaInput_[20] = std::sqrt(decayDistMag);
366  mvaInput_[21] = std::min(10.f, (float)tauLifetimeInfo.flightLengthSig());
367  mvaInput_[22] = std::max(-1.f, gjAngleDiff);
368  }
369 
370  double mvaValue = mvaReader_->GetClassifier(mvaInput_);
371  if (verbosity_) {
372  edm::LogPrint("PFTauDiscByMVAIsol2") << "<PFRecoTauDiscriminationByMVAIsolationRun2::discriminate>:";
373  edm::LogPrint("PFTauDiscByMVAIsol2") << " tau: Pt = " << tau->pt() << ", eta = " << tau->eta();
374  edm::LogPrint("PFTauDiscByMVAIsol2") << " isolation: charged = " << chargedIsoPtSum
375  << ", neutral = " << neutralIsoPtSum << ", PUcorr = " << puCorrPtSum;
376  edm::LogPrint("PFTauDiscByMVAIsol2") << " decay mode = " << tauDecayMode;
377  edm::LogPrint("PFTauDiscByMVAIsol2") << " impact parameter: distance = " << tauLifetimeInfo.dxy()
378  << ", significance = " << tauLifetimeInfo.dxy_Sig();
379  edm::LogPrint("PFTauDiscByMVAIsol2")
380  << " has decay vertex = " << tauLifetimeInfo.hasSecondaryVertex() << ":"
381  << " distance = " << decayDistMag << ", significance = " << tauLifetimeInfo.flightLengthSig();
382  edm::LogPrint("PFTauDiscByMVAIsol2") << "--> mvaValue = " << mvaValue;
383  }
384  result.rawValues.at(0) = mvaValue;
385  }
386  return result;
387  }

References funct::abs(), chargedIsoPtSum_index_, reco::PFTauTransverseImpactParameter::dxy(), reco::PFTauTransverseImpactParameter::dxy_Sig(), MillePedeFileConverter_cfg::e, reco::tau::eratio(), f, reco::PFTauTransverseImpactParameter::flightLength(), reco::PFTauTransverseImpactParameter::flightLengthSig(), dqmMemoryStats::float, footprintCorrection_index_, GBRForest::GetClassifier(), reco::PFTauTransverseImpactParameter::hasSecondaryVertex(), reco::PFTauTransverseImpactParameter::ip3d(), reco::PFTauTransverseImpactParameter::ip3d_Sig(), reco::tau::kDBnewDMwLT, reco::tau::kDBnewDMwLTwGJ, reco::tau::kDBoldDMwLT, reco::tau::kDBoldDMwLTwGJ, reco::tau::kNewDMwLT, reco::tau::kNewDMwoLT, reco::tau::kOldDMwLT, reco::tau::kOldDMwoLT, reco::tau::kPWnewDMwLT, reco::tau::kPWoldDMwLT, reco::tau::lead_track_chi2(), dqm-mbProfile::log, SiStripPI::max, min(), mvaInput_, mvaOpt_, mvaReader_, reco::tau::n_photons_total(), neutralIsoPtSum_index_, photonPtSumOutsideSignalCone_index_, funct::pow(), reco::tau::pt_weighted_deta_strip(), reco::tau::pt_weighted_dphi_strip(), reco::tau::pt_weighted_dr_iso(), reco::tau::pt_weighted_dr_signal(), pucorrPtSum_index_, PDWG_TauSkim_cff::rawValues, mps_fire::result, mathSSE::sqrt(), metsig::tau, and verbosity_.

◆ fillDescriptions()

void reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 389 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

389  {
390  // pfRecoTauDiscriminationByMVAIsolationRun2
392 
393  desc.add<std::string>("mvaName", "tauIdMVAnewDMwLT");
394  desc.add<bool>("loadMVAfromDB", true);
395  desc.addOptional<edm::FileInPath>("inputFileName");
396  desc.add<std::string>("mvaOpt", "newDMwLT");
397 
398  desc.add<edm::InputTag>("srcTauTransverseImpactParameters", edm::InputTag(""));
399  desc.add<edm::InputTag>("srcBasicTauDiscriminators", edm::InputTag("hpsPFTauBasicDiscriminators"));
400  desc.add<std::string>("inputIDNameSuffix", "");
401 
402  desc.add<int>("verbosity", 0);
403 
404  fillProducerDescriptions(desc); // inherited from the base
405 
406  descriptions.add("pfRecoTauDiscriminationByMVAIsolationRun2", desc);
407  }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >::fillProducerDescriptions(), HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

Member Data Documentation

◆ basicTauDiscriminators_

edm::Handle<reco::TauDiscriminatorContainer> reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::basicTauDiscriminators_
private

Definition at line 162 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

Referenced by beginEvent().

◆ basicTauDiscriminators_token

edm::EDGetTokenT<reco::TauDiscriminatorContainer> reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::basicTauDiscriminators_token
private

◆ chargedIsoPtSum_index_

int reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::chargedIsoPtSum_index_ = 0
private

Definition at line 163 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

Referenced by beginEvent(), and discriminate().

◆ footprintCorrection_index_

int reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::footprintCorrection_index_ = 0
private

Definition at line 167 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

Referenced by beginEvent(), and discriminate().

◆ input_id_name_suffix_

std::string reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::input_id_name_suffix_
private

◆ inputFileName_

edm::FileInPath reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::inputFileName_
private

◆ inputFilesToDelete_

std::vector<TFile*> reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::inputFilesToDelete_
private

◆ loadMVAfromDB_

bool reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::loadMVAfromDB_
private

◆ moduleLabel_

std::string reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::moduleLabel_
private

◆ mvaInput_

float* reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::mvaInput_
private

◆ mvaName_

std::string reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::mvaName_
private

◆ mvaOpt_

int reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::mvaOpt_
private

◆ mvaReader_

const GBRForest* reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::mvaReader_
private

◆ neutralIsoPtSum_index_

int reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::neutralIsoPtSum_index_ = 0
private

Definition at line 164 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

Referenced by beginEvent(), and discriminate().

◆ phID_

edm::ProcessHistoryID reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::phID_
private

Definition at line 169 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

Referenced by beginEvent().

◆ photonPtSumOutsideSignalCone_index_

int reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::photonPtSumOutsideSignalCone_index_ = 0
private

Definition at line 166 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

Referenced by beginEvent(), and discriminate().

◆ pucorrPtSum_index_

int reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::pucorrPtSum_index_ = 0
private

Definition at line 165 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

Referenced by beginEvent(), and discriminate().

◆ tauLifetimeInfos

edm::Handle<PFTauTIPAssociationByRef> reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::tauLifetimeInfos
private

Definition at line 159 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

Referenced by beginEvent().

◆ taus_

edm::Handle<TauCollection> reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::taus_
private

Definition at line 171 of file PFRecoTauDiscriminationByMVAIsolationRun2.cc.

Referenced by beginEvent().

◆ TauTransverseImpactParameters_token

edm::EDGetTokenT<PFTauTIPAssociationByRef> reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::TauTransverseImpactParameters_token
private

◆ verbosity_

int reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::verbosity_
private
reco::tau::pt_weighted_deta_strip
float pt_weighted_deta_strip(const reco::PFTau &tau, int dm)
Definition: PFRecoTauClusterVariables.h:36
PFTauDiscriminationContainerProducerBase
TauDiscriminationProducerBase< reco::PFTau, reco::TauDiscriminatorContainer, reco::SingleTauDiscriminatorContainer, reco::PFTauDiscriminator > PFTauDiscriminationContainerProducerBase
Definition: TauDiscriminationProducerBase.h:123
taus_updatedMVAIds_cff.loadMVAfromDB
loadMVAfromDB
Definition: taus_updatedMVAIds_cff.py:17
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::mvaReader_
const GBRForest * mvaReader_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:152
PDWG_TauSkim_cff.rawValues
rawValues
Definition: PDWG_TauSkim_cff.py:13
mps_fire.i
i
Definition: mps_fire.py:428
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::basicTauDiscriminators_token
edm::EDGetTokenT< reco::TauDiscriminatorContainer > basicTauDiscriminators_token
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:161
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
GBRForest::GetClassifier
double GetClassifier(const float *vector) const
Definition: GBRForest.h:34
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
metsig::tau
Definition: SignAlgoResolutions.h:49
min
T min(T a, T b)
Definition: MathUtil.h:58
reco::tau::eratio
float eratio(const reco::PFTau &tau)
return ratio of energy in ECAL over sum of energy in ECAL and HCAL
Definition: PFRecoTauClusterVariables.cc:78
reco::tau::kDBoldDMwLTwGJ
Definition: PFRecoTauClusterVariables.h:67
edm::LogPrint
Log< level::Warning, true > LogPrint
Definition: MessageLogger.h:130
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::mvaName_
std::string mvaName_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:149
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::input_id_name_suffix_
std::string input_id_name_suffix_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:168
cms::cuda::assert
assert(be >=bs)
reco::tau::kOldDMwoLT
Definition: PFRecoTauClusterVariables.h:59
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::TauTransverseImpactParameters_token
edm::EDGetTokenT< PFTauTIPAssociationByRef > TauTransverseImpactParameters_token
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:158
parallelization.uint
uint
Definition: parallelization.py:124
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::photonPtSumOutsideSignalCone_index_
int photonPtSumOutsideSignalCone_index_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:166
reco::PFTauTransverseImpactParameter::dxy
double dxy() const
Definition: PFTauTransverseImpactParameter.h:51
edm::parameterSet
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
edm::FileInPath
Definition: FileInPath.h:64
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::neutralIsoPtSum_index_
int neutralIsoPtSum_index_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:164
reco::tau::pt_weighted_dphi_strip
float pt_weighted_dphi_strip(const reco::PFTau &tau, int dm)
Definition: PFRecoTauClusterVariables.h:44
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
reco::PFTauTransverseImpactParameter::flightLengthSig
double flightLengthSig() const
Definition: PFTauTransverseImpactParameter.cc:71
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::phID_
edm::ProcessHistoryID phID_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:169
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::mvaInput_
float * mvaInput_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:154
edm::Event::processHistoryID
ProcessHistoryID const & processHistoryID() const
Definition: Event.cc:116
reco::tau::kNewDMwoLT
Definition: PFRecoTauClusterVariables.h:61
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:535
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::basicTauDiscriminators_
edm::Handle< reco::TauDiscriminatorContainer > basicTauDiscriminators_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:162
reco::PFTauTransverseImpactParameter::ip3d_Sig
double ip3d_Sig() const
Definition: PFTauTransverseImpactParameter.h:57
reco::PFTauTransverseImpactParameter
Definition: PFTauTransverseImpactParameter.h:24
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
reco::PFTauTransverseImpactParameter::hasSecondaryVertex
bool hasSecondaryVertex() const
Definition: PFTauTransverseImpactParameter.h:61
edm::Event::processHistory
ProcessHistory const & processHistory() const override
Definition: Event.cc:250
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::footprintCorrection_index_
int footprintCorrection_index_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:167
TauDiscriminationProducerBase::fillProducerDescriptions
static void fillProducerDescriptions(edm::ParameterSetDescription &desc)
Definition: TauDiscriminationProducerBase.cc:173
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::tauLifetimeInfos
edm::Handle< PFTauTIPAssociationByRef > tauLifetimeInfos
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:159
reco::tau::lead_track_chi2
float lead_track_chi2(const reco::PFTau &tau)
return chi2 of the leading track ==> deprecated? <==
Definition: PFRecoTauClusterVariables.cc:58
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
TauDiscriminationProducerBase::Tau_token
edm::EDGetTokenT< TauCollection > Tau_token
Definition: TauDiscriminationProducerBase.h:107
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::inputFilesToDelete_
std::vector< TFile * > inputFilesToDelete_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:173
reco::tau::kNewDMwLT
Definition: PFRecoTauClusterVariables.h:62
reco::tau::n_photons_total
unsigned int n_photons_total(const reco::PFTau &tau)
return total number of pf photon candidates with pT>500 MeV, which are associated to signal
Definition: PFRecoTauClusterVariables.cc:163
reco::PFTauTransverseImpactParameter::ip3d
double ip3d() const
Definition: PFTauTransverseImpactParameter.h:55
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::verbosity_
int verbosity_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:175
reco::PFTauTransverseImpactParameter::dxy_Sig
double dxy_Sig() const
Definition: PFTauTransverseImpactParameter.h:53
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::moduleLabel_
std::string moduleLabel_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:147
looper.cfg
cfg
Definition: looper.py:297
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::pucorrPtSum_index_
int pucorrPtSum_index_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:165
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::taus_
edm::Handle< TauCollection > taus_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:171
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::Provenance::stable
StableProvenance const & stable() const
Definition: Provenance.h:42
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::inputFileName_
edm::FileInPath inputFileName_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:151
Exception
Definition: hltDiff.cc:245
reco::tau::kOldDMwLT
Definition: PFRecoTauClusterVariables.h:60
reco::tau::pt_weighted_dr_signal
float pt_weighted_dr_signal(const reco::PFTau &tau, int dm)
Definition: PFRecoTauClusterVariables.h:32
reco::tau::kDBoldDMwLT
Definition: PFRecoTauClusterVariables.h:63
reco::tau::pt_weighted_dr_iso
float pt_weighted_dr_iso(const reco::PFTau &tau, int dm)
Definition: PFRecoTauClusterVariables.h:52
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::loadMVAfromDB_
bool loadMVAfromDB_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:150
reco::tau::kDBnewDMwLTwGJ
Definition: PFRecoTauClusterVariables.h:68
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
reco::tau::kPWnewDMwLT
Definition: PFRecoTauClusterVariables.h:66
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::Provenance
Definition: Provenance.h:34
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::mvaOpt_
int mvaOpt_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:153
edm::InputTag
Definition: InputTag.h:15
reco::tau::kDBnewDMwLT
Definition: PFRecoTauClusterVariables.h:64
reco::tau::kPWoldDMwLT
Definition: PFRecoTauClusterVariables.h:65
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
reco::PFTauTransverseImpactParameter::flightLength
const Vector & flightLength() const
Definition: PFTauTransverseImpactParameter.cc:67
reco::SingleTauDiscriminatorContainer
Definition: TauDiscriminatorContainer.h:9
reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::chargedIsoPtSum_index_
int chargedIsoPtSum_index_
Definition: PFRecoTauDiscriminationByMVAIsolationRun2.cc:163