CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
PileupJetIdAlgo Class Reference

#include <PileupJetIdAlgo.h>

Classes

class  AlgoGBRForestsAndConstants
 

Public Types

typedef std::map< std::string, std::pair< float *, float > > variables_list_t
 
enum  version_t { USER = -1, PHILv0 = 0 }
 

Public Member Functions

int computeCutIDflag (float betaStarClassic, float dR2Mean, float nvtx, float jetPt, float jetEta)
 
int computeIDflag (float mva, float jetPt, float jetEta)
 
int computeIDflag (float mva, int ptId, int etaId)
 
PileupJetIdentifier computeIdVariables (const reco::Jet *jet, float jec, const reco::Vertex *, const reco::VertexCollection &, double rho, edm::ValueMap< float > &constituentWeights, bool applyConstituentWeight)
 
PileupJetIdentifier computeMva ()
 
std::string dumpVariables () const
 
std::pair< int, int > getJetIdKey (float jetPt, float jetEta)
 
float getMVAval (const std::vector< std::string > &, const std::unique_ptr< const GBRForest > &)
 
const variables_list_tgetVariables () const
 const PileupJetIdentifier::variables_list_t & getVariables() const { return variables_; }; More...
 
const std::string method () const
 
 PileupJetIdAlgo (AlgoGBRForestsAndConstants const *cache)
 
void set (const PileupJetIdentifier &)
 
 ~PileupJetIdAlgo ()
 

Protected Member Functions

void initVariables ()
 
void resetVariables ()
 
void runMva ()
 

Protected Attributes

AlgoGBRForestsAndConstants const * cache_
 
PileupJetIdentifier internalId_
 
variables_list_t variables_
 

Detailed Description

Definition at line 22 of file PileupJetIdAlgo.h.

Member Typedef Documentation

◆ variables_list_t

typedef std::map<std::string, std::pair<float*, float> > PileupJetIdAlgo::variables_list_t

Definition at line 46 of file PileupJetIdAlgo.h.

Member Enumeration Documentation

◆ version_t

Enumerator
USER 
PHILv0 

Definition at line 24 of file PileupJetIdAlgo.h.

Constructor & Destructor Documentation

◆ PileupJetIdAlgo()

PileupJetIdAlgo::PileupJetIdAlgo ( AlgoGBRForestsAndConstants const *  cache)

Definition at line 133 of file PileupJetIdAlgo.cc.

References initVariables().

133 : cache_(cache) { initVariables(); }
AlgoGBRForestsAndConstants const * cache_
def cache(function)
Definition: utilities.py:3

◆ ~PileupJetIdAlgo()

PileupJetIdAlgo::~PileupJetIdAlgo ( )

Definition at line 136 of file PileupJetIdAlgo.cc.

136 {}

Member Function Documentation

◆ computeCutIDflag()

int PileupJetIdAlgo::computeCutIDflag ( float  betaStarClassic,
float  dR2Mean,
float  nvtx,
float  jetPt,
float  jetEta 
)

Definition at line 219 of file PileupJetIdAlgo.cc.

References getJetIdKey(), reco::btau::jetEta, reco::btau::jetPt, PileupJetIdentifier::kLoose, PileupJetIdentifier::kMedium, PileupJetIdentifier::kTight, and CrabHelper::log.

Referenced by runMva().

219  {
220  std::pair<int, int> jetIdKey = getJetIdKey(jetPt, jetEta);
221  float betaStarModified = betaStarClassic / log(nvtx - 0.64);
222  int idFlag(0);
223  if (betaStarModified < cache_->betaStarCut()[PileupJetIdentifier::kTight][jetIdKey.first][jetIdKey.second] &&
224  dR2Mean < cache_->rmsCut()[PileupJetIdentifier::kTight][jetIdKey.first][jetIdKey.second])
225  idFlag += 1 << PileupJetIdentifier::kTight;
226 
227  if (betaStarModified < cache_->betaStarCut()[PileupJetIdentifier::kMedium][jetIdKey.first][jetIdKey.second] &&
228  dR2Mean < cache_->rmsCut()[PileupJetIdentifier::kMedium][jetIdKey.first][jetIdKey.second])
229  idFlag += 1 << PileupJetIdentifier::kMedium;
230 
231  if (betaStarModified < cache_->betaStarCut()[PileupJetIdentifier::kLoose][jetIdKey.first][jetIdKey.second] &&
232  dR2Mean < cache_->rmsCut()[PileupJetIdentifier::kLoose][jetIdKey.first][jetIdKey.second])
233  idFlag += 1 << PileupJetIdentifier::kLoose;
234  return idFlag;
235 }
std::pair< int, int > getJetIdKey(float jetPt, float jetEta)

◆ computeIDflag() [1/2]

int PileupJetIdAlgo::computeIDflag ( float  mva,
float  jetPt,
float  jetEta 
)

Definition at line 237 of file PileupJetIdAlgo.cc.

References getJetIdKey(), reco::btau::jetEta, reco::btau::jetPt, and beam_dqm_sourceclient-live_cfg::mva.

Referenced by runMva().

237  {
238  std::pair<int, int> jetIdKey = getJetIdKey(jetPt, jetEta);
239  return computeIDflag(mva, jetIdKey.first, jetIdKey.second);
240 }
std::pair< int, int > getJetIdKey(float jetPt, float jetEta)
int computeIDflag(float mva, float jetPt, float jetEta)

◆ computeIDflag() [2/2]

int PileupJetIdAlgo::computeIDflag ( float  mva,
int  ptId,
int  etaId 
)

◆ computeIdVariables()

PileupJetIdentifier PileupJetIdAlgo::computeIdVariables ( const reco::Jet jet,
float  jec,
const reco::Vertex vtx,
const reco::VertexCollection allvtx,
double  rho,
edm::ValueMap< float > &  constituentWeights,
bool  applyConstituentWeight 
)

Definition at line 261 of file PileupJetIdAlgo.cc.

References funct::abs(), cms::cuda::assert(), assign(), reco::Muon::bestTrack(), reco::Candidate::bestTrack(), cache_, reco::Candidate::charge(), reco::PFJet::chargedEmEnergy(), pat::Jet::chargedEmEnergy(), reco::PFJet::chargedHadronEnergy(), pat::Jet::chargedHadronEnergy(), reco::PFJet::chargedMultiplicity(), pat::Jet::chargedMultiplicity(), PileupJetIdentifier::chFrac01_, PileupJetIdentifier::chFrac02_, PileupJetIdentifier::chFrac03_, PileupJetIdentifier::chFrac04_, PileupJetIdentifier::chFrac05_, PileupJetIdentifier::chFrac06_, PileupJetIdentifier::chFrac07_, PileupJetIdentifier::chgEMfrac_, PileupJetIdentifier::chgHadrfrac_, pat::Jet::correctedJet(), PileupJetIdentifier::d0_, reco::deltaPhi(), reco::deltaR(), PileupJetIdentifier::dRLead2nd_, PileupJetIdentifier::dRLeadCent_, PileupJetIdentifier::dRMeanCh_, PileupJetIdentifier::dRMeanEm_, PileupJetIdentifier::dRMeanNeut_, HLT_2024v14_cff::dRmin, reco::TrackBase::dxy(), pat::PackedCandidate::dxy(), l1ctLayer1_cff::dZ, reco::TrackBase::dz(), pat::PackedCandidate::dz(), PileupJetIdentifier::emFrac01_, PileupJetIdentifier::emFrac02_, PileupJetIdentifier::emFrac03_, PileupJetIdentifier::emFrac04_, PileupJetIdentifier::emFrac05_, PileupJetIdentifier::emFrac06_, PileupJetIdentifier::emFrac07_, reco::Candidate::eta(), PileupJetIdentifier::etaW_, PileupJetIdentifier::fourthChFrac_, PileupJetIdentifier::fourthEmFrac_, PileupJetIdentifier::fourthFrac_, PileupJetIdentifier::fourthNeutFrac_, DivergingColor::frac, pat::PackedCandidate::fromPV(), edm::Ptr< T >::get(), edm::Ref< C, T, F >::get(), reco::PFCandidate::gsfTrackRef(), mps_fire::i, internalId_, edm::Ref< C, T, F >::isNonnull(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::iv, jetMETDQMOfflineSource_cff::jec, metsig::jet, PileupJetIdentifier::jetM_, PileupJetIdentifier::jetPhi_, reco::btau::jetPt, PileupJetIdentifier::jetW_, isotrackApplyRegressor::k, large_val, PileupJetIdentifier::leadChEta_, PileupJetIdentifier::leadChFrac_, PileupJetIdentifier::leadChPhi_, PileupJetIdentifier::leadChPt_, PileupJetIdentifier::leadEmEta_, PileupJetIdentifier::leadEmFrac_, PileupJetIdentifier::leadEmPhi_, PileupJetIdentifier::leadEmPt_, PileupJetIdentifier::leadEta_, PileupJetIdentifier::leadFrac_, PileupJetIdentifier::leadNeutEta_, PileupJetIdentifier::leadNeutFrac_, PileupJetIdentifier::leadNeutPhi_, PileupJetIdentifier::leadNeutPt_, PileupJetIdentifier::leadPhi_, PileupJetIdentifier::leadPt_, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, SiStripPI::min, reco::PFCandidate::muonRef(), PileupJetIdentifier::neuEMfrac_, PileupJetIdentifier::neuHadrfrac_, PileupJetIdentifier::neutFrac01_, PileupJetIdentifier::neutFrac02_, PileupJetIdentifier::neutFrac03_, PileupJetIdentifier::neutFrac04_, PileupJetIdentifier::neutFrac05_, PileupJetIdentifier::neutFrac06_, PileupJetIdentifier::neutFrac07_, reco::PFJet::neutralEmEnergy(), pat::Jet::neutralEmEnergy(), reco::PFJet::neutralHadronEnergy(), pat::Jet::neutralHadronEnergy(), reco::PFJet::neutralMultiplicity(), pat::Jet::neutralMultiplicity(), reco::Candidate::pdgId(), reco::Candidate::phi(), PileupJetIdentifier::phiW_, reco::Candidate::pt(), reco::LeafCandidate::pt(), PileupJetIdentifier::pt2A_, PileupJetIdentifier::ptDCh_, PileupJetIdentifier::ptDNe_, PileupJetIdentifier::ptMean_, PileupJetIdentifier::ptRMS_, pat::PackedCandidate::PVUsedInFit, alignCSCRings::r, resetVariables(), rho, runMva(), PileupJetIdAlgo::AlgoGBRForestsAndConstants::runMvas(), PileupJetIdentifier::secondChFrac_, PileupJetIdentifier::secondEmFrac_, PileupJetIdentifier::secondEta_, PileupJetIdentifier::secondFrac_, PileupJetIdentifier::secondNeutFrac_, PileupJetIdentifier::secondPhi_, PileupJetIdentifier::secondPt_, setPtEtaPhi(), jetUpdater_cfi::sort, mathSSE::sqrt(), PileupJetIdentifier::sumChPt_, PileupJetIdentifier::sumNePt_, TtFullHadEvtBuilder_cfi::sumPt, PileupJetIdentifier::sumPt_, edm::swap(), PileupJetIdentifier::thirdChFrac_, PileupJetIdentifier::thirdEmFrac_, PileupJetIdentifier::thirdFrac_, PileupJetIdentifier::thirdNeutFrac_, reco::PFCandidate::trackRef(), L1BJetProducer_cff::vtx, and mps_merge::weight.

Referenced by PileupJetIdProducer::produce().

267  {
268  // initialize all variables to 0
269  resetVariables();
270 
271  // loop over constituents, accumulate sums and find leading candidates
272  const pat::Jet* patjet = dynamic_cast<const pat::Jet*>(jet);
273  const reco::PFJet* pfjet = dynamic_cast<const reco::PFJet*>(jet);
274  assert(patjet != nullptr || pfjet != nullptr);
275  if (patjet != nullptr && jec == 0.) { // if this is a pat jet and no jec has been passed take the jec from the object
276  jec = patjet->pt() / patjet->correctedJet(0).pt();
277  }
278  if (jec <= 0.) {
279  jec = 1.;
280  }
281 
282  const reco::Candidate *lLead = nullptr, *lSecond = nullptr, *lLeadNeut = nullptr, *lLeadEm = nullptr,
283  *lLeadCh = nullptr, *lTrail = nullptr;
284 
285  std::vector<float> frac, fracCh, fracEm, fracNeut;
286  float cones[] = {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7};
287  size_t ncones = sizeof(cones) / sizeof(float);
288  float* coneFracs[] = {&internalId_.frac01_,
289  &internalId_.frac02_,
290  &internalId_.frac03_,
291  &internalId_.frac04_,
292  &internalId_.frac05_,
293  &internalId_.frac06_,
294  &internalId_.frac07_};
295  float* coneEmFracs[] = {&internalId_.emFrac01_,
302  float* coneNeutFracs[] = {&internalId_.neutFrac01_,
309  float* coneChFracs[] = {&internalId_.chFrac01_,
316  TMatrixDSym covMatrix(2);
317  covMatrix = 0.;
318  float jetPt = jet->pt() / jec; // use uncorrected pt for shape variables
319  float sumPt = 0., sumPt2 = 0., sumTkPt = 0., sumPtCh = 0, sumPtNe = 0;
320  float multNeut = 0.0;
321  float sumW2(0.0);
322  float sum_deta(0.0), sum_dphi(0.0);
323  float ave_deta(0.0), ave_dphi(0.0);
324  setPtEtaPhi(
325  *jet, internalId_.jetPt_, internalId_.jetEta_, internalId_.jetPhi_); // use corrected pt for jet kinematics
326  internalId_.jetM_ = jet->mass();
327  internalId_.nvtx_ = allvtx.size();
328  internalId_.rho_ = rho;
329 
330  float dRmin(1000);
331  float LeadcandWeight = 1.0;
332  float SecondcandWeight = 1.0;
333  float LeadNeutcandWeight = 1.0;
334  float LeadEmcandWeight = 1.0;
335  float LeadChcandWeight = 1.0;
336  float TrailcandWeight = 1.0;
337 
338  for (unsigned i = 0; i < jet->numberOfSourceCandidatePtrs(); ++i) {
339  reco::CandidatePtr pfJetConstituent = jet->sourceCandidatePtr(i);
340  const reco::Candidate* icand = pfJetConstituent.get();
341  assert(icand);
342  const pat::PackedCandidate* lPack = dynamic_cast<const pat::PackedCandidate*>(icand);
343  const reco::PFCandidate* lPF = dynamic_cast<const reco::PFCandidate*>(icand);
344  bool isPacked = true;
345  if (lPack == nullptr) {
346  isPacked = false;
347  }
348 
349  float candWeight = 1.0;
350  if (applyConstituentWeight) { // PUPPI Jet weight should be pulled up from valuemap, not packed candidate
351  candWeight = constituentWeights[jet->sourceCandidatePtr(i)];
352  }
353  float candPt = (icand->pt()) * candWeight;
354  float candPtFrac = candPt / jetPt;
355  float candDr = reco::deltaR(*icand, *jet);
356  float candDeta = icand->eta() - jet->eta();
357  float candDphi = reco::deltaPhi(*icand, *jet);
358  float candPtDr = candPt * candDr;
359  size_t icone = std::lower_bound(&cones[0], &cones[ncones], candDr) - &cones[0];
360 
361  if (candDr < dRmin)
362  dRmin = candDr;
363 
364  // // all particles; PUPPI weights multiplied to leading and subleading constituent if it is for PUPPI
365  if (lLead == nullptr || candPt > (lLead->pt()) * LeadcandWeight) {
366  lSecond = lLead;
367  SecondcandWeight = LeadcandWeight;
368  lLead = icand;
369  if (applyConstituentWeight) {
370  LeadcandWeight = constituentWeights[jet->sourceCandidatePtr(i)];
371  }
372  } else if ((lSecond == nullptr || candPt > (lSecond->pt()) * SecondcandWeight) &&
373  (candPt < (lLead->pt()) * LeadcandWeight)) {
374  lSecond = icand;
375  if (applyConstituentWeight) {
376  SecondcandWeight = constituentWeights[jet->sourceCandidatePtr(i)];
377  }
378  }
379 
380  // // average shapes
381  internalId_.dRMean_ += candPtDr;
382  internalId_.dR2Mean_ += candPtDr * candPtDr;
383  covMatrix(0, 0) += candPt * candPt * candDeta * candDeta;
384  covMatrix(0, 1) += candPt * candPt * candDeta * candDphi;
385  covMatrix(1, 1) += candPt * candPt * candDphi * candDphi;
386  internalId_.ptD_ += candPt * candPt;
387  sumPt += candPt;
388  sumPt2 += candPt * candPt;
389 
390  // single most energetic candiates and jet shape profiles
391  frac.push_back(candPtFrac);
392 
393  if (icone < ncones) {
394  *coneFracs[icone] += candPt;
395  }
396 
397  // neutrals Neutral hadrons
398  if (abs(icand->pdgId()) == 130) {
399  if (lLeadNeut == nullptr || candPt > (lLeadNeut->pt()) * LeadNeutcandWeight) {
400  lLeadNeut = icand;
401  if (applyConstituentWeight) {
402  LeadNeutcandWeight = constituentWeights[jet->sourceCandidatePtr(i)];
403  }
404  }
405 
406  internalId_.dRMeanNeut_ += candPtDr;
407  fracNeut.push_back(candPtFrac);
408  if (icone < ncones) {
409  *coneNeutFracs[icone] += candPt;
410  }
411  internalId_.ptDNe_ += candPt * candPt;
412  sumPtNe += candPt;
413  multNeut += candWeight;
414  }
415 
416  // EM candidated photon
417  if (icand->pdgId() == 22) {
418  if (lLeadEm == nullptr || candPt > (lLeadEm->pt()) * LeadEmcandWeight) {
419  lLeadEm = icand;
420  if (applyConstituentWeight) {
421  LeadEmcandWeight = constituentWeights[jet->sourceCandidatePtr(i)];
422  }
423  }
424  internalId_.dRMeanEm_ += candPtDr;
425  fracEm.push_back(candPtFrac);
426  if (icone < ncones) {
427  *coneEmFracs[icone] += candPt;
428  }
429  internalId_.ptDNe_ += candPt * candPt;
430  sumPtNe += candPt;
431  multNeut += candWeight;
432  }
433  // hadrons and EM in HF
434  if ((abs(icand->pdgId()) == 1) || (abs(icand->pdgId()) == 2))
435  multNeut += candWeight;
436 
437  // Charged particles
438  if (icand->charge() != 0) {
439  if (lLeadCh == nullptr || candPt > (lLeadCh->pt()) * LeadChcandWeight) {
440  lLeadCh = icand;
441  if (applyConstituentWeight) {
442  LeadChcandWeight = constituentWeights[jet->sourceCandidatePtr(i)];
443  }
444  const reco::Track* pfTrk = icand->bestTrack();
445  if (lPF && std::abs(icand->pdgId()) == 13 && pfTrk == nullptr) {
446  reco::MuonRef lmuRef = lPF->muonRef();
447  if (lmuRef.isNonnull()) {
448  const reco::Muon& lmu = *lmuRef.get();
449  pfTrk = lmu.bestTrack();
450  edm::LogWarning("BadMuon")
451  << "Found a PFCandidate muon without a trackRef: falling back to Muon::bestTrack ";
452  }
453  }
454  if (pfTrk == nullptr) { //protection against empty pointers for the miniAOD case
455  //To handle the electron case
456  if (isPacked) {
457  internalId_.d0_ = std::abs(lPack->dxy(vtx->position()));
458  internalId_.dZ_ = std::abs(lPack->dz(vtx->position()));
459  } else if (lPF != nullptr) {
460  pfTrk = (lPF->trackRef().get() == nullptr) ? lPF->gsfTrackRef().get() : lPF->trackRef().get();
461  internalId_.d0_ = std::abs(pfTrk->dxy(vtx->position()));
462  internalId_.dZ_ = std::abs(pfTrk->dz(vtx->position()));
463  }
464  } else {
465  internalId_.d0_ = std::abs(pfTrk->dxy(vtx->position()));
466  internalId_.dZ_ = std::abs(pfTrk->dz(vtx->position()));
467  }
468  }
469  internalId_.dRMeanCh_ += candPtDr;
470  internalId_.ptDCh_ += candPt * candPt;
471  fracCh.push_back(candPtFrac);
472  if (icone < ncones) {
473  *coneChFracs[icone] += candPt;
474  }
475  sumPtCh += candPt;
476  }
477  // // beta and betastar
478  if (icand->charge() != 0) {
479  if (!isPacked) {
480  if (lPF->trackRef().isNonnull()) {
481  float tkpt = candPt;
482  sumTkPt += tkpt;
483  // 'classic' beta definition based on track-vertex association
484  bool inVtx0 = vtx->trackWeight(lPF->trackRef()) > 0;
485 
486  bool inAnyOther = false;
487  // alternative beta definition based on track-vertex distance of closest approach
488  double dZ0 = std::abs(lPF->trackRef()->dz(vtx->position()));
489  double dZ = dZ0;
490  for (reco::VertexCollection::const_iterator vi = allvtx.begin(); vi != allvtx.end(); ++vi) {
491  const reco::Vertex& iv = *vi;
492  if (iv.isFake() || iv.ndof() < 4) {
493  continue;
494  }
495  // the primary vertex may have been copied by the user: check identity by position
496  bool isVtx0 = (iv.position() - vtx->position()).r() < 0.02;
497  // 'classic' beta definition: check if the track is associated with
498  // any vertex other than the primary one
499  if (!isVtx0 && !inAnyOther) {
500  inAnyOther = vtx->trackWeight(lPF->trackRef()) <= 0;
501  }
502  // alternative beta: find closest vertex to the track
503  dZ = std::min(dZ, std::abs(lPF->trackRef()->dz(iv.position())));
504  }
505  // classic beta/betaStar
506  if (inVtx0 && !inAnyOther) {
507  internalId_.betaClassic_ += tkpt;
508  } else if (!inVtx0 && inAnyOther) {
509  internalId_.betaStarClassic_ += tkpt;
510  }
511  // alternative beta/betaStar
512  if (dZ0 < 0.2) {
513  internalId_.beta_ += tkpt;
514  } else if (dZ < 0.2) {
515  internalId_.betaStar_ += tkpt;
516  }
517  }
518  } else {
519  float tkpt = candPt;
520  sumTkPt += tkpt;
521  bool inVtx0 = false;
522  bool inVtxOther = false;
523  double dZ0 = 9999.;
524  double dZ_tmp = 9999.;
525  for (unsigned vtx_i = 0; vtx_i < allvtx.size(); vtx_i++) {
526  const auto& iv = allvtx[vtx_i];
527 
528  if (iv.isFake())
529  continue;
530 
531  // Match to vertex in case of copy as above
532  bool isVtx0 = (iv.position() - vtx->position()).r() < 0.02;
533 
534  if (isVtx0) {
535  if (lPack->fromPV(vtx_i) == pat::PackedCandidate::PVUsedInFit)
536  inVtx0 = true;
537  if (lPack->fromPV(vtx_i) == 0)
538  inVtxOther = true;
539  dZ0 = lPack->dz(iv.position());
540  }
541 
542  if (fabs(lPack->dz(iv.position())) < fabs(dZ_tmp)) {
543  dZ_tmp = lPack->dz(iv.position());
544  }
545  }
546  if (inVtx0) {
547  internalId_.betaClassic_ += tkpt;
548  } else if (inVtxOther) {
549  internalId_.betaStarClassic_ += tkpt;
550  }
551  if (fabs(dZ0) < 0.2) {
552  internalId_.beta_ += tkpt;
553  } else if (fabs(dZ_tmp) < 0.2) {
554  internalId_.betaStar_ += tkpt;
555  }
556  }
557  }
558 
559  // trailing candidate
560  if (lTrail == nullptr || candPt < (lTrail->pt()) * TrailcandWeight) {
561  lTrail = icand;
562  if (applyConstituentWeight) {
563  TrailcandWeight = constituentWeights[jet->sourceCandidatePtr(i)];
564  }
565  }
566 
567  // average for pull variable
568 
569  float weight2 = candPt * candPt;
570  sumW2 += weight2;
571  float deta = icand->eta() - jet->eta();
572  float dphi = reco::deltaPhi(*icand, *jet);
573  sum_deta += deta * weight2;
574  sum_dphi += dphi * weight2;
575  }
576  if (sumW2 > 0) {
577  ave_deta = sum_deta / sumW2;
578  ave_dphi = sum_dphi / sumW2;
579  }
580 
581  // // Finalize all variables
582  // Most of Below values are not used for puID variable generation at the moment, except lLeadCh Pt for JetRchg, so I assign that zero if there is no charged constituent.
583 
584  assert(!(lLead == nullptr));
585  internalId_.leadPt_ = lLead->pt() * LeadcandWeight;
586  internalId_.leadEta_ = lLead->eta();
587  internalId_.leadPhi_ = lLead->phi();
588 
589  if (lSecond != nullptr) {
590  internalId_.secondPt_ = lSecond->pt() * SecondcandWeight;
591  internalId_.secondEta_ = lSecond->eta();
592  internalId_.secondPhi_ = lSecond->phi();
593  } else {
594  internalId_.secondPt_ = 0.0;
597  }
598 
599  if (lLeadNeut != nullptr) {
600  internalId_.leadNeutPt_ = lLeadNeut->pt() * LeadNeutcandWeight;
601  internalId_.leadNeutEta_ = lLeadNeut->eta();
602  internalId_.leadNeutPhi_ = lLeadNeut->phi();
603  } else {
604  internalId_.leadNeutPt_ = 0.0;
607  }
608 
609  if (lLeadEm != nullptr) {
610  internalId_.leadEmPt_ = lLeadEm->pt() * LeadEmcandWeight;
611  internalId_.leadEmEta_ = lLeadEm->eta();
612  internalId_.leadEmPhi_ = lLeadEm->phi();
613  } else {
614  internalId_.leadEmPt_ = 0.0;
617  }
618 
619  if (lLeadCh != nullptr) {
620  internalId_.leadChPt_ = lLeadCh->pt() * LeadChcandWeight;
621  internalId_.leadChEta_ = lLeadCh->eta();
622  internalId_.leadChPhi_ = lLeadCh->phi();
623  } else {
624  internalId_.leadChPt_ = 0.0;
627  }
628 
629  if (patjet != nullptr) { // to enable running on MiniAOD slimmedJets
630  internalId_.nCharged_ = patjet->chargedMultiplicity();
631  internalId_.nNeutrals_ = patjet->neutralMultiplicity();
632  internalId_.chgEMfrac_ = patjet->chargedEmEnergy() / jet->energy();
633  internalId_.neuEMfrac_ = patjet->neutralEmEnergy() / jet->energy();
634  internalId_.chgHadrfrac_ = patjet->chargedHadronEnergy() / jet->energy();
635  internalId_.neuHadrfrac_ = patjet->neutralHadronEnergy() / jet->energy();
636  if (applyConstituentWeight)
637  internalId_.nNeutrals_ = multNeut;
638  } else {
639  internalId_.nCharged_ = pfjet->chargedMultiplicity();
640  internalId_.nNeutrals_ = pfjet->neutralMultiplicity();
641  internalId_.chgEMfrac_ = pfjet->chargedEmEnergy() / jet->energy();
642  internalId_.neuEMfrac_ = pfjet->neutralEmEnergy() / jet->energy();
643  internalId_.chgHadrfrac_ = pfjet->chargedHadronEnergy() / jet->energy();
644  internalId_.neuHadrfrac_ = pfjet->neutralHadronEnergy() / jet->energy();
645  if (applyConstituentWeight)
646  internalId_.nNeutrals_ = multNeut;
647  }
648  internalId_.nParticles_ = jet->nConstituents();
649 
651  float ddetaR_sum(0.0), ddphiR_sum(0.0), pull_tmp(0.0);
652  for (unsigned k = 0; k < jet->numberOfSourceCandidatePtrs(); k++) {
653  reco::CandidatePtr temp_pfJetConstituent = jet->sourceCandidatePtr(k);
654  // reco::CandidatePtr temp_weightpfJetConstituent = jet->sourceCandidatePtr(k);
655  const reco::Candidate* part = temp_pfJetConstituent.get();
656 
657  float candWeight = 1.0;
658 
659  if (applyConstituentWeight)
660  candWeight = constituentWeights[jet->sourceCandidatePtr(k)];
661 
662  float weight = candWeight * (part->pt()) * candWeight * (part->pt());
663  float deta = part->eta() - jet->eta();
664  float dphi = reco::deltaPhi(*part, *jet);
665  float ddeta, ddphi, ddR;
666  ddeta = deta - ave_deta;
667  ddphi = dphi - ave_dphi;
668  ddR = sqrt(ddeta * ddeta + ddphi * ddphi);
669  ddetaR_sum += ddR * ddeta * weight;
670  ddphiR_sum += ddR * ddphi * weight;
671  }
672  if (sumW2 > 0) {
673  float ddetaR_ave = ddetaR_sum / sumW2;
674  float ddphiR_ave = ddphiR_sum / sumW2;
675  pull_tmp = sqrt(ddetaR_ave * ddetaR_ave + ddphiR_ave * ddphiR_ave);
676  }
677  internalId_.pull_ = pull_tmp;
679 
680  std::sort(frac.begin(), frac.end(), std::greater<float>());
681  std::sort(fracCh.begin(), fracCh.end(), std::greater<float>());
682  std::sort(fracEm.begin(), fracEm.end(), std::greater<float>());
683  std::sort(fracNeut.begin(), fracNeut.end(), std::greater<float>());
685  assign(
687  assign(
689  assign(fracNeut,
694 
695  covMatrix(0, 0) /= sumPt2;
696  covMatrix(0, 1) /= sumPt2;
697  covMatrix(1, 1) /= sumPt2;
698  covMatrix(1, 0) = covMatrix(0, 1);
699  internalId_.etaW_ = sqrt(covMatrix(0, 0));
700  internalId_.phiW_ = sqrt(covMatrix(1, 1));
702  TVectorD eigVals(2);
703  eigVals = TMatrixDSymEigen(covMatrix).GetEigenValues();
704  internalId_.majW_ = sqrt(std::abs(eigVals(0)));
705  internalId_.minW_ = sqrt(std::abs(eigVals(1)));
706  if (internalId_.majW_ < internalId_.minW_) {
707  std::swap(internalId_.majW_, internalId_.minW_);
708  }
709 
711  if (lSecond != nullptr) {
712  internalId_.dRLead2nd_ = reco::deltaR(*jet, *lSecond);
713  }
714  internalId_.dRMean_ /= jetPt;
718  internalId_.dR2Mean_ /= sumPt2;
719 
720  for (size_t ic = 0; ic < ncones; ++ic) {
721  *coneFracs[ic] /= jetPt;
722  *coneEmFracs[ic] /= jetPt;
723  *coneNeutFracs[ic] /= jetPt;
724  *coneChFracs[ic] /= jetPt;
725  }
726  //http://jets.physics.harvard.edu/qvg/
727  double ptMean = sumPt / internalId_.nParticles_;
728  double ptRMS = 0;
729  for (unsigned int i0 = 0; i0 < frac.size(); i0++) {
730  ptRMS += (frac[i0] - ptMean) * (frac[i0] - ptMean);
731  }
732  ptRMS /= internalId_.nParticles_;
733  ptRMS = sqrt(ptRMS);
734 
735  internalId_.ptMean_ = ptMean;
736  internalId_.ptRMS_ = ptRMS / jetPt;
737  internalId_.pt2A_ = sqrt(internalId_.ptD_ / internalId_.nParticles_) / jetPt;
738  internalId_.ptD_ = sqrt(internalId_.ptD_) / sumPt;
742  internalId_.sumChPt_ = sumPtCh;
743  internalId_.sumNePt_ = sumPtNe;
744 
745  internalId_.jetR_ = (lLead->pt()) * LeadcandWeight / sumPt;
746  if (lLeadCh != nullptr) {
747  internalId_.jetRchg_ = (lLeadCh->pt()) * LeadChcandWeight / sumPt;
748  } else {
749  internalId_.jetRchg_ = 0;
750  }
751 
752  internalId_.dRMatch_ = dRmin;
753 
754  if (sumTkPt != 0.) {
755  internalId_.beta_ /= sumTkPt;
756  internalId_.betaStar_ /= sumTkPt;
757  internalId_.betaClassic_ /= sumTkPt;
758  internalId_.betaStarClassic_ /= sumTkPt;
759  } else {
760  assert(internalId_.beta_ == 0. && internalId_.betaStar_ == 0. && internalId_.betaClassic_ == 0. &&
761  internalId_.betaStarClassic_ == 0.);
762  }
763 
764  if (cache_->runMvas()) {
765  runMva();
766  }
767 
769 }
const float large_val
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:469
AlgoGBRForestsAndConstants const * cache_
float neutralHadronEnergy() const
neutralHadronEnergy
Definition: PFJet.h:99
double pt() const final
transverse momentum
int chargedMultiplicity() const
chargedMultiplicity
Definition: PFJet.h:152
int chargedMultiplicity() const
chargedMultiplicity
Definition: Jet.h:740
float chargedEmEnergy() const
chargedEmEnergy
Definition: PFJet.h:139
float neutralEmEnergy() const
neutralEmEnergy
Definition: PFJet.h:147
virtual double pt() const =0
transverse momentum
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:232
Definition: weight.py:1
const PVAssoc fromPV(size_t ipv=0) const
int neutralMultiplicity() const
neutralMultiplicity
Definition: Jet.h:464
const Track * bestTrack() const override
Definition: Muon.h:58
int neutralMultiplicity() const
neutralMultiplicity
Definition: PFJet.h:154
assert(be >=bs)
Jets made from PFObjects.
Definition: PFJet.h:20
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:112
float chargedHadronEnergy() const
chargedHadronEnergy
Definition: Jet.h:694
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:622
PileupJetIdentifier internalId_
T sqrt(T t)
Definition: SSEVec.h:23
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void assign(const std::vector< float > &vec, float &a, float &b, float &c, float &d)
virtual int charge() const =0
electric charge
Jet correctedJet(const std::string &level, const std::string &flavor="none", const std::string &set="") const
float chargedEmEnergy() const
chargedEmEnergy
Definition: Jet.h:712
reco::MuonRef muonRef() const
Definition: PFCandidate.cc:450
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:141
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
virtual int pdgId() const =0
PDG identifier.
float neutralHadronEnergy() const
neutralHadronEnergy
Definition: Jet.h:704
void setPtEtaPhi(const reco::Candidate &p, float &pt, float &eta, float &phi)
part
Definition: HCALResponse.h:20
Analysis-level calorimeter jet class.
Definition: Jet.h:77
float neutralEmEnergy() const
neutralEmEnergy
Definition: Jet.h:722
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
float chargedHadronEnergy() const
chargedHadronEnergy
Definition: PFJet.h:95
virtual const Track * bestTrack() const
Definition: Candidate.h:268
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:226
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:437
virtual float dxy() const
dxy with respect to the PV ref
virtual float dz(size_t ipv=0) const
dz with respect to the PV[ipv]
Log< level::Warning, false > LogWarning
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608

◆ computeMva()

PileupJetIdentifier PileupJetIdAlgo::computeMva ( )

Definition at line 255 of file PileupJetIdAlgo.cc.

References internalId_, and runMva().

Referenced by PileupJetIdProducer::produce().

255  {
256  runMva();
258 }
PileupJetIdentifier internalId_

◆ dumpVariables()

std::string PileupJetIdAlgo::dumpVariables ( ) const

Definition at line 772 of file PileupJetIdAlgo.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, MillePedeFileConverter_cfg::out, and variables_.

772  {
773  std::stringstream out;
774  for (variables_list_t::const_iterator it = variables_.begin(); it != variables_.end(); ++it) {
775  out << std::setw(15) << it->first << std::setw(3) << "=" << std::setw(5) << *it->second.first << " ("
776  << std::setw(5) << it->second.second << ")" << std::endl;
777  }
778  return out.str();
779 }
variables_list_t variables_

◆ getJetIdKey()

std::pair< int, int > PileupJetIdAlgo::getJetIdKey ( float  jetPt,
float  jetEta 
)

Definition at line 197 of file PileupJetIdAlgo.cc.

References funct::abs(), reco::btau::jetEta, and reco::btau::jetPt.

Referenced by computeCutIDflag(), and computeIDflag().

197  {
198  int ptId = 0;
199  if (jetPt >= 10 && jetPt < 20)
200  ptId = 1;
201  if (jetPt >= 20 && jetPt < 30)
202  ptId = 2;
203  if (jetPt >= 30 && jetPt < 40)
204  ptId = 3;
205  if (jetPt >= 40)
206  ptId = 4;
207 
208  int etaId = 0;
209  if (std::abs(jetEta) >= 2.5 && std::abs(jetEta) < 2.75)
210  etaId = 1;
211  if (std::abs(jetEta) >= 2.75 && std::abs(jetEta) < 3.0)
212  etaId = 2;
213  if (std::abs(jetEta) >= 3.0 && std::abs(jetEta) < 5.0)
214  etaId = 3;
215 
216  return std::pair<int, int>(ptId, etaId);
217 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ getMVAval()

float PileupJetIdAlgo::getMVAval ( const std::vector< std::string > &  varList,
const std::unique_ptr< const GBRForest > &  reader 
)

Definition at line 158 of file PileupJetIdAlgo.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, SQLiteCheck_cfg::reader, ALCARECOEcalPhiSym_cff::var, and variables_.

Referenced by runMva().

159  {
160  std::vector<float> vars;
161  for (std::vector<std::string>::const_iterator it = varList.begin(); it != varList.end(); ++it) {
162  std::pair<float*, float> var = variables_.at(*it);
163  vars.push_back(*var.first);
164  }
165  return reader->GetClassifier(vars.data());
166 }
vars
Definition: DeepTauIdBase.h:60
variables_list_t variables_

◆ getVariables()

const variables_list_t& PileupJetIdAlgo::getVariables ( ) const
inline

const PileupJetIdentifier::variables_list_t & getVariables() const { return variables_; };

Definition at line 54 of file PileupJetIdAlgo.h.

References variables_.

54 { return variables_; };
variables_list_t variables_

◆ initVariables()

void PileupJetIdAlgo::initVariables ( )
protected

Definition at line 795 of file PileupJetIdAlgo.cc.

References HLT_2024v14_cff::beta, simBeamSpotPI::betaStar, d0, METSignificanceParams_cfi::dRMatch, l1ctLayer1_cff::dZ, PileupJetIdentifier::idFlag_, INIT_VARIABLE, internalId_, reco::btau::jetEta, reco::btau::jetPhi, reco::btau::jetPt, LHEJetFilter_cfi::jetR, large_val, beam_dqm_sourceclient-live_cfg::mva, HLT_2024v14_cff::nCharged, jetsAK4_CHS_cff::ptD, rho, and TtFullHadEvtBuilder_cfi::sumPt.

Referenced by PileupJetIdAlgo().

795  {
796  internalId_.idFlag_ = 0;
797  INIT_VARIABLE(mva, "", -100.);
798  //INIT_VARIABLE(jetPt , "jspt_1", 0.);
799  //INIT_VARIABLE(jetEta , "jseta_1", large_val);
800  INIT_VARIABLE(jetPt, "", 0.);
802  INIT_VARIABLE(jetPhi, "jsphi_1", large_val);
803  INIT_VARIABLE(jetM, "jm_1", 0.);
804 
805  INIT_VARIABLE(nCharged, "", 0.);
806  INIT_VARIABLE(nNeutrals, "", 0.);
807 
808  INIT_VARIABLE(chgEMfrac, "", 0.);
809  INIT_VARIABLE(neuEMfrac, "", 0.);
810  INIT_VARIABLE(chgHadrfrac, "", 0.);
811  INIT_VARIABLE(neuHadrfrac, "", 0.);
812 
813  INIT_VARIABLE(d0, "jd0_1", -1000.);
814  INIT_VARIABLE(dZ, "jdZ_1", -1000.);
815  //INIT_VARIABLE(nParticles , "npart_1" , 0.);
816  INIT_VARIABLE(nParticles, "", 0.);
817 
818  INIT_VARIABLE(leadPt, "lpt_1", 0.);
819  INIT_VARIABLE(leadEta, "leta_1", large_val);
820  INIT_VARIABLE(leadPhi, "lphi_1", large_val);
821  INIT_VARIABLE(secondPt, "spt_1", 0.);
822  INIT_VARIABLE(secondEta, "seta_1", large_val);
823  INIT_VARIABLE(secondPhi, "sphi_1", large_val);
824  INIT_VARIABLE(leadNeutPt, "lnept_1", 0.);
825  INIT_VARIABLE(leadNeutEta, "lneeta_1", large_val);
826  INIT_VARIABLE(leadNeutPhi, "lnephi_1", large_val);
827  INIT_VARIABLE(leadEmPt, "lempt_1", 0.);
828  INIT_VARIABLE(leadEmEta, "lemeta_1", large_val);
829  INIT_VARIABLE(leadEmPhi, "lemphi_1", large_val);
830  INIT_VARIABLE(leadChPt, "lchpt_1", 0.);
831  INIT_VARIABLE(leadChEta, "lcheta_1", large_val);
832  INIT_VARIABLE(leadChPhi, "lchphi_1", large_val);
833  INIT_VARIABLE(leadFrac, "lLfr_1", 0.);
834 
835  INIT_VARIABLE(dRLeadCent, "drlc_1", 0.);
836  INIT_VARIABLE(dRLead2nd, "drls_1", 0.);
837  INIT_VARIABLE(dRMean, "drm_1", 0.);
838  INIT_VARIABLE(dRMean, "", 0.);
839  INIT_VARIABLE(pull, "", 0.);
840  INIT_VARIABLE(dRMeanNeut, "drmne_1", 0.);
841  INIT_VARIABLE(dRMeanEm, "drem_1", 0.);
842  INIT_VARIABLE(dRMeanCh, "drch_1", 0.);
843  INIT_VARIABLE(dR2Mean, "", 0.);
844 
845  INIT_VARIABLE(ptD, "", 0.);
846  INIT_VARIABLE(ptMean, "", 0.);
847  INIT_VARIABLE(ptRMS, "", 0.);
848  INIT_VARIABLE(pt2A, "", 0.);
849  INIT_VARIABLE(ptDCh, "", 0.);
850  INIT_VARIABLE(ptDNe, "", 0.);
851  INIT_VARIABLE(sumPt, "", 0.);
852  INIT_VARIABLE(sumChPt, "", 0.);
853  INIT_VARIABLE(sumNePt, "", 0.);
854 
855  INIT_VARIABLE(secondFrac, "", 0.);
856  INIT_VARIABLE(thirdFrac, "", 0.);
857  INIT_VARIABLE(fourthFrac, "", 0.);
858 
859  INIT_VARIABLE(leadChFrac, "", 0.);
860  INIT_VARIABLE(secondChFrac, "", 0.);
861  INIT_VARIABLE(thirdChFrac, "", 0.);
862  INIT_VARIABLE(fourthChFrac, "", 0.);
863 
864  INIT_VARIABLE(leadNeutFrac, "", 0.);
865  INIT_VARIABLE(secondNeutFrac, "", 0.);
866  INIT_VARIABLE(thirdNeutFrac, "", 0.);
867  INIT_VARIABLE(fourthNeutFrac, "", 0.);
868 
869  INIT_VARIABLE(leadEmFrac, "", 0.);
870  INIT_VARIABLE(secondEmFrac, "", 0.);
871  INIT_VARIABLE(thirdEmFrac, "", 0.);
872  INIT_VARIABLE(fourthEmFrac, "", 0.);
873 
874  INIT_VARIABLE(jetW, "", 1.);
875  INIT_VARIABLE(etaW, "", 1.);
876  INIT_VARIABLE(phiW, "", 1.);
877 
878  INIT_VARIABLE(majW, "", 1.);
879  INIT_VARIABLE(minW, "", 1.);
880 
881  INIT_VARIABLE(frac01, "", 0.);
882  INIT_VARIABLE(frac02, "", 0.);
883  INIT_VARIABLE(frac03, "", 0.);
884  INIT_VARIABLE(frac04, "", 0.);
885  INIT_VARIABLE(frac05, "", 0.);
886  INIT_VARIABLE(frac06, "", 0.);
887  INIT_VARIABLE(frac07, "", 0.);
888 
889  INIT_VARIABLE(chFrac01, "", 0.);
890  INIT_VARIABLE(chFrac02, "", 0.);
891  INIT_VARIABLE(chFrac03, "", 0.);
892  INIT_VARIABLE(chFrac04, "", 0.);
893  INIT_VARIABLE(chFrac05, "", 0.);
894  INIT_VARIABLE(chFrac06, "", 0.);
895  INIT_VARIABLE(chFrac07, "", 0.);
896 
897  INIT_VARIABLE(neutFrac01, "", 0.);
898  INIT_VARIABLE(neutFrac02, "", 0.);
899  INIT_VARIABLE(neutFrac03, "", 0.);
900  INIT_VARIABLE(neutFrac04, "", 0.);
901  INIT_VARIABLE(neutFrac05, "", 0.);
902  INIT_VARIABLE(neutFrac06, "", 0.);
903  INIT_VARIABLE(neutFrac07, "", 0.);
904 
905  INIT_VARIABLE(emFrac01, "", 0.);
906  INIT_VARIABLE(emFrac02, "", 0.);
907  INIT_VARIABLE(emFrac03, "", 0.);
908  INIT_VARIABLE(emFrac04, "", 0.);
909  INIT_VARIABLE(emFrac05, "", 0.);
910  INIT_VARIABLE(emFrac06, "", 0.);
911  INIT_VARIABLE(emFrac07, "", 0.);
912 
913  INIT_VARIABLE(beta, "", 0.);
914  INIT_VARIABLE(betaStar, "", 0.);
915  INIT_VARIABLE(betaClassic, "", 0.);
916  INIT_VARIABLE(betaStarClassic, "", 0.);
917 
918  INIT_VARIABLE(nvtx, "", 0.);
919  INIT_VARIABLE(rho, "", 0.);
920  INIT_VARIABLE(nTrueInt, "", 0.);
921 
922  INIT_VARIABLE(jetR, "", 0.);
923  INIT_VARIABLE(jetRchg, "", 0.);
924  INIT_VARIABLE(dRMatch, "", 0.);
925 }
const float large_val
#define INIT_VARIABLE(NAME, TMVANAME, VAL)
PileupJetIdentifier internalId_
static constexpr float d0

◆ method()

const std::string PileupJetIdAlgo::method ( ) const
inline

Definition at line 42 of file PileupJetIdAlgo.h.

References cache_, and PileupJetIdAlgo::AlgoGBRForestsAndConstants::tmvaMethod().

42 { return cache_->tmvaMethod(); }
AlgoGBRForestsAndConstants const * cache_
std::string const & tmvaMethod() const

◆ resetVariables()

void PileupJetIdAlgo::resetVariables ( )
protected

Definition at line 782 of file PileupJetIdAlgo.cc.

References PileupJetIdentifier::idFlag_, internalId_, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and variables_.

Referenced by computeIdVariables().

782  {
783  internalId_.idFlag_ = 0;
784  for (variables_list_t::iterator it = variables_.begin(); it != variables_.end(); ++it) {
785  *it->second.first = it->second.second;
786  }
787 }
PileupJetIdentifier internalId_
variables_list_t variables_

◆ runMva()

void PileupJetIdAlgo::runMva ( )
protected

Definition at line 168 of file PileupJetIdAlgo.cc.

References funct::abs(), cache_, computeCutIDflag(), computeIDflag(), PileupJetIdAlgo::AlgoGBRForestsAndConstants::cutBased(), PileupJetIdAlgo::AlgoGBRForestsAndConstants::etaBinnedWeights(), PileupJetIdAlgo::AlgoGBRForestsAndConstants::etaReader(), getMVAval(), PileupJetIdentifier::idFlag_, internalId_, PileupJetIdAlgo::AlgoGBRForestsAndConstants::jEtaMax(), PileupJetIdAlgo::AlgoGBRForestsAndConstants::jEtaMin(), PileupJetIdentifier::mva_, PileupJetIdAlgo::AlgoGBRForestsAndConstants::nEtaBins(), PileupJetIdAlgo::AlgoGBRForestsAndConstants::reader(), PileupJetIdAlgo::AlgoGBRForestsAndConstants::tmvaEtaVariables(), PileupJetIdAlgo::AlgoGBRForestsAndConstants::tmvaVariables(), and findQualityFiles::v.

Referenced by computeIdVariables(), and computeMva().

168  {
169  if (cache_->cutBased()) {
171  internalId_.betaStarClassic_, internalId_.dR2Mean_, internalId_.nvtx_, internalId_.jetPt_, internalId_.jetEta_);
172  } else {
173  if (std::abs(internalId_.jetEta_) >= 5.0) {
174  internalId_.mva_ = -2.;
175  } else {
176  if (cache_->etaBinnedWeights()) {
177  if (std::abs(internalId_.jetEta_) > cache_->jEtaMax().at(cache_->nEtaBins() - 1)) {
178  internalId_.mva_ = -2.;
179  } else {
180  for (int v = 0; v < cache_->nEtaBins(); v++) {
181  if (std::abs(internalId_.jetEta_) >= cache_->jEtaMin().at(v) &&
182  std::abs(internalId_.jetEta_) < cache_->jEtaMax().at(v)) {
184  break;
185  }
186  }
187  }
188  } else {
190  }
191  }
193  }
194 }
std::vector< double > const & jEtaMin() const
AlgoGBRForestsAndConstants const * cache_
int computeCutIDflag(float betaStarClassic, float dR2Mean, float nvtx, float jetPt, float jetEta)
std::vector< std::vector< std::string > > const & tmvaEtaVariables() const
PileupJetIdentifier internalId_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< std::string > const & tmvaVariables() const
int computeIDflag(float mva, float jetPt, float jetEta)
std::vector< std::unique_ptr< const GBRForest > > const & etaReader() const
std::unique_ptr< const GBRForest > const & reader() const
std::vector< double > const & jEtaMax() const
float getMVAval(const std::vector< std::string > &, const std::unique_ptr< const GBRForest > &)

◆ set()

void PileupJetIdAlgo::set ( const PileupJetIdentifier id)

Member Data Documentation

◆ cache_

AlgoGBRForestsAndConstants const* PileupJetIdAlgo::cache_
protected

Definition at line 111 of file PileupJetIdAlgo.h.

Referenced by computeIDflag(), computeIdVariables(), method(), and runMva().

◆ internalId_

PileupJetIdentifier PileupJetIdAlgo::internalId_
protected

◆ variables_

variables_list_t PileupJetIdAlgo::variables_
protected

Definition at line 110 of file PileupJetIdAlgo.h.

Referenced by dumpVariables(), getMVAval(), getVariables(), and resetVariables().