CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PFElecTkProducer Class Referencefinal
Inheritance diagram for PFElecTkProducer:
edm::stream::EDProducer< edm::GlobalCache< convbremhelpers::HeavyObjectCache > >

Public Member Functions

 PFElecTkProducer (const edm::ParameterSet &, const convbremhelpers::HeavyObjectCache *)
 Constructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< convbremhelpers::HeavyObjectCache > >
 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 globalEndJob (convbremhelpers::HeavyObjectCache const *)
 
static std::unique_ptr< convbremhelpers::HeavyObjectCacheinitializeGlobalCache (const edm::ParameterSet &conf)
 

Private Member Functions

bool applySelection (const reco::GsfTrack &)
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void createGsfPFRecTrackRef (const edm::OrphanHandle< reco::GsfPFRecTrackCollection > &gsfPfHandle, std::vector< reco::GsfPFRecTrack > &gsfPFRecTrackPrimary, const std::map< unsigned int, std::vector< reco::GsfPFRecTrack > > &MapPrimSec)
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
int findPfRef (const reco::PFRecTrackCollection &pfRTkColl, const reco::GsfTrack &, edm::soa::EtaPhiTableView trackEtaPhiTable)
 
bool isInnerMost (const reco::GsfTrackRef &nGsfTrack, const reco::GsfTrackRef &iGsfTrack, bool &sameLayer)
 
bool isInnerMostWithLostHits (const reco::GsfTrackRef &nGsfTrack, const reco::GsfTrackRef &iGsfTrack, bool &sameLayer)
 
bool isSameEgSC (const reco::ElectronSeed &nSeed, const reco::ElectronSeed &iSeed, bool &bothGsfEcalDriven, float &SCEnergy)
 
bool isSharingEcalEnergyWithEgSC (const reco::GsfPFRecTrack &nGsfPFRecTrack, const reco::GsfPFRecTrack &iGsfPFRecTrack, const reco::ElectronSeed &nSeed, const reco::ElectronSeed &iSeed, const reco::PFClusterCollection &theEClus, bool &bothGsfTrackerDriven, bool &nEcalDriven, bool &iEcalDriven, float &nEnergy, float &iEnergy)
 
float minTangDist (const reco::GsfPFRecTrack &primGsf, const reco::GsfPFRecTrack &secGsf)
 
void produce (edm::Event &, const edm::EventSetup &) override
 Produce the PFRecTrack collection. More...
 
bool resolveGsfTracks (const std::vector< reco::GsfPFRecTrack > &GsfPFVec, unsigned int ngsf, std::vector< unsigned int > &secondaries, const reco::PFClusterCollection &theEClus)
 

Private Attributes

bool applyAngularGsfClean_
 
bool applyGsfClean_
 
bool applySel_
 
edm::ParameterSet conf_
 
std::unique_ptr< ConvBremPFTrackFinderconvBremFinder_
 
bool debugGsfCleaning_
 
double detaCutGsfClean_
 
double detaGsfSC_
 
double dphiCutGsfClean_
 
double dphiGsfSC_
 
std::vector< double > gsfInnerMomentumCache_
 
edm::EDGetTokenT< reco::GsfTrackCollectiongsfTrackLabel_
 
double maxPtConvReco_
 
bool modemomentum_
 
MultiTrajectoryStateTransform mtsTransform_
 
double mvaConvBremFinderIDBarrelHighPt_
 
double mvaConvBremFinderIDBarrelLowPt_
 
double mvaConvBremFinderIDEndcapsHighPt_
 
double mvaConvBremFinderIDEndcapsLowPt_
 
std::string path_mvaWeightFileConvBremBarrelHighPt_
 
std::string path_mvaWeightFileConvBremBarrelLowPt_
 
std::string path_mvaWeightFileConvBremEndcapsHighPt_
 
std::string path_mvaWeightFileConvBremEndcapsLowPt_
 
edm::EDGetTokenT< reco::PFConversionCollectionpfConv_
 
edm::EDGetTokenT< reco::PFClusterCollectionpfEcalClusters_
 
edm::EDGetTokenT< reco::PFDisplacedTrackerVertexCollectionpfNuclear_
 
reco::GsfPFRecTrack pftrack_
 
edm::EDGetTokenT< reco::PFRecTrackCollectionpfTrackLabel_
 
std::unique_ptr< PFTrackTransformerpfTransformer_
 PFTrackTransformer. More...
 
edm::EDGetTokenT< reco::PFV0CollectionpfV0_
 
edm::EDGetTokenT< reco::VertexCollectionprimVtxLabel_
 
double SCEne_
 
reco::GsfPFRecTrack secpftrack_
 
bool trajinev_
 Trajectory of GSfTracks in the event? More...
 
bool useConvBremFinder_
 Conv Brem Finder. More...
 
bool useConversions_
 
bool useFifthStepForEcalDriven_
 
bool useFifthStepForTrackDriven_
 
bool useNuclear_
 
bool useV0_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< convbremhelpers::HeavyObjectCache > >
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
 

Detailed Description

Definition at line 62 of file PFElecTkProducer.cc.

Constructor & Destructor Documentation

◆ PFElecTkProducer()

PFElecTkProducer::PFElecTkProducer ( const edm::ParameterSet iConfig,
const convbremhelpers::HeavyObjectCache  
)
explicit

Constructor.

Definition at line 174 of file PFElecTkProducer.cc.

175  : conf_(iConfig) {
176  gsfTrackLabel_ = consumes<reco::GsfTrackCollection>(iConfig.getParameter<InputTag>("GsfTrackModuleLabel"));
177 
178  pfTrackLabel_ = consumes<reco::PFRecTrackCollection>(iConfig.getParameter<InputTag>("PFRecTrackLabel"));
179 
180  primVtxLabel_ = consumes<reco::VertexCollection>(iConfig.getParameter<InputTag>("PrimaryVertexLabel"));
181 
182  pfEcalClusters_ = consumes<reco::PFClusterCollection>(iConfig.getParameter<InputTag>("PFEcalClusters"));
183 
184  pfNuclear_ = consumes<reco::PFDisplacedTrackerVertexCollection>(iConfig.getParameter<InputTag>("PFNuclear"));
185 
186  pfConv_ = consumes<reco::PFConversionCollection>(iConfig.getParameter<InputTag>("PFConversions"));
187 
188  pfV0_ = consumes<reco::PFV0Collection>(iConfig.getParameter<InputTag>("PFV0"));
189 
190  useNuclear_ = iConfig.getParameter<bool>("useNuclear");
191  useConversions_ = iConfig.getParameter<bool>("useConversions");
192  useV0_ = iConfig.getParameter<bool>("useV0");
193  debugGsfCleaning_ = iConfig.getParameter<bool>("debugGsfCleaning");
194 
195  produces<GsfPFRecTrackCollection>();
196  produces<GsfPFRecTrackCollection>("Secondary").setBranchAlias("secondary");
197 
198  trajinev_ = iConfig.getParameter<bool>("TrajInEvents");
199  modemomentum_ = iConfig.getParameter<bool>("ModeMomentum");
200  applySel_ = iConfig.getParameter<bool>("applyEGSelection");
201  applyGsfClean_ = iConfig.getParameter<bool>("applyGsfTrackCleaning");
202  applyAngularGsfClean_ = iConfig.getParameter<bool>("applyAlsoGsfAngularCleaning");
203  detaCutGsfClean_ = iConfig.getParameter<double>("maxDEtaGsfAngularCleaning");
204  dphiCutGsfClean_ = iConfig.getParameter<double>("maxDPhiBremTangGsfAngularCleaning");
205  useFifthStepForTrackDriven_ = iConfig.getParameter<bool>("useFifthStepForTrackerDrivenGsf");
206  useFifthStepForEcalDriven_ = iConfig.getParameter<bool>("useFifthStepForEcalDrivenGsf");
207  maxPtConvReco_ = iConfig.getParameter<double>("MaxConvBremRecoPT");
208  detaGsfSC_ = iConfig.getParameter<double>("MinDEtaGsfSC");
209  dphiGsfSC_ = iConfig.getParameter<double>("MinDPhiGsfSC");
210  SCEne_ = iConfig.getParameter<double>("MinSCEnergy");
211 
212  // set parameter for convBremFinder
213  useConvBremFinder_ = iConfig.getParameter<bool>("useConvBremFinder");
214 
215  mvaConvBremFinderIDBarrelLowPt_ = iConfig.getParameter<double>("pf_convBremFinderID_mvaCutBarrelLowPt");
216  mvaConvBremFinderIDBarrelHighPt_ = iConfig.getParameter<double>("pf_convBremFinderID_mvaCutBarrelHighPt");
217  mvaConvBremFinderIDEndcapsLowPt_ = iConfig.getParameter<double>("pf_convBremFinderID_mvaCutEndcapsLowPt");
218  mvaConvBremFinderIDEndcapsHighPt_ = iConfig.getParameter<double>("pf_convBremFinderID_mvaCutEndcapsHighPt");
219 }

References applyAngularGsfClean_, applyGsfClean_, applySel_, debugGsfCleaning_, detaCutGsfClean_, detaGsfSC_, dphiCutGsfClean_, dphiGsfSC_, edm::ParameterSet::getParameter(), gsfTrackLabel_, maxPtConvReco_, modemomentum_, mvaConvBremFinderIDBarrelHighPt_, mvaConvBremFinderIDBarrelLowPt_, mvaConvBremFinderIDEndcapsHighPt_, mvaConvBremFinderIDEndcapsLowPt_, pfConv_, pfEcalClusters_, pfNuclear_, pfTrackLabel_, pfV0_, primVtxLabel_, SCEne_, trajinev_, useConvBremFinder_, useConversions_, useFifthStepForEcalDriven_, useFifthStepForTrackDriven_, useNuclear_, and useV0_.

Member Function Documentation

◆ applySelection()

bool PFElecTkProducer::applySelection ( const reco::GsfTrack gsftk)
private

Definition at line 542 of file PFElecTkProducer.cc.

542  {
543  if (gsftk.seedRef().get() == nullptr)
544  return false;
545  auto const& ElSeedFromRef = static_cast<ElectronSeed const&>(*(gsftk.extra()->seedRef()));
546 
547  bool passCut = false;
548  if (ElSeedFromRef.ctfTrack().isNull()) {
549  if (ElSeedFromRef.caloCluster().isNull())
550  return passCut;
551  auto const* scRef = static_cast<SuperCluster const*>(ElSeedFromRef.caloCluster().get());
552  //do this just to know if exist a SC?
553  if (scRef) {
554  float caloEne = scRef->energy();
555  float feta = fabs(scRef->eta() - gsftk.etaMode());
556  float fphi = fabs(scRef->phi() - gsftk.phiMode());
557  if (fphi > TMath::Pi())
558  fphi -= TMath::TwoPi();
559  if (caloEne > SCEne_ && feta < detaGsfSC_ && fabs(fphi) < dphiGsfSC_)
560  passCut = true;
561  }
562  } else {
563  // get all the gsf found by tracker driven
564  passCut = true;
565  }
566  return passCut;
567 }

References detaGsfSC_, dphiGsfSC_, reco::GsfTrack::etaMode(), reco::Track::extra(), JetMETHLTOfflineSource_cfi::feta, edm::RefToBase< T >::get(), reco::GsfTrack::phiMode(), Pi, SCEne_, reco::Track::seedRef(), and TwoPi.

Referenced by produce().

◆ beginRun()

void PFElecTkProducer::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprivate

◆ createGsfPFRecTrackRef()

void PFElecTkProducer::createGsfPFRecTrackRef ( const edm::OrphanHandle< reco::GsfPFRecTrackCollection > &  gsfPfHandle,
std::vector< reco::GsfPFRecTrack > &  gsfPFRecTrackPrimary,
const std::map< unsigned int, std::vector< reco::GsfPFRecTrack > > &  MapPrimSec 
)
private

Definition at line 453 of file PFElecTkProducer.cc.

456  {
457  unsigned int cgsf = 0;
458  unsigned int csecgsf = 0;
459  for (std::map<unsigned int, std::vector<reco::GsfPFRecTrack> >::const_iterator igsf = MapPrimSec.begin();
460  igsf != MapPrimSec.end();
461  igsf++, cgsf++) {
462  vector<reco::GsfPFRecTrack> SecGsfPF = igsf->second;
463  for (unsigned int iSecGsf = 0; iSecGsf < SecGsfPF.size(); iSecGsf++) {
464  edm::Ref<reco::GsfPFRecTrackCollection> refgprt(gsfPfHandle, csecgsf);
465  gsfPFRecTrackPrimary[cgsf].addConvBremGsfPFRecTrackRef(refgprt);
466  ++csecgsf;
467  }
468  }
469 
470  return;
471 }

References genParticles_cff::map.

Referenced by produce().

◆ endRun()

void PFElecTkProducer::endRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 1129 of file PFElecTkProducer.cc.

1129  {
1130  pfTransformer_.reset();
1131  convBremFinder_.reset();
1132 }

References convBremFinder_, and pfTransformer_.

◆ findPfRef()

int PFElecTkProducer::findPfRef ( const reco::PFRecTrackCollection pfRTkColl,
const reco::GsfTrack gsftk,
edm::soa::EtaPhiTableView  trackEtaPhiTable 
)
private

Definition at line 473 of file PFElecTkProducer.cc.

475  {
476  if (gsftk.seedRef().get() == nullptr) {
477  return -1;
478  }
479 
480  // maximum delta_r2 for matching
481  constexpr float maxDR2 = square(0.05f);
482 
483  // precompute expensive trigonometry
484  float gsftkEta = gsftk.eta();
485  float gsftkPhi = gsftk.phi();
486  auto const& gsftkHits = gsftk.seedRef()->recHits();
487 
488  auto const& electronSeedFromRef = static_cast<ElectronSeed const&>(*(gsftk.extra()->seedRef()));
489  //CASE 1 ELECTRONSEED DOES NOT HAVE A REF TO THE CKFTRACK
490  if (electronSeedFromRef.ctfTrack().isNull()) {
491  unsigned int i_pf = 0;
492  int ibest = -1;
493  unsigned int ish_max = 0;
494  float dr2_min = square(1000.f);
495 
496  //SEARCH THE PFRECTRACK THAT SHARES HITS WITH THE ELECTRON SEED
497  // Here the cpu time has been be improved.
498  for (auto const& pft : trackEtaPhiTable) {
499  unsigned int ish = 0;
500 
501  using namespace edm::soa::col;
502  const float dr2 = reco::deltaR2(pft.get<Eta>(), pft.get<Phi>(), gsftkEta, gsftkPhi);
503 
504  if (dr2 <= maxDR2) {
505  for (auto const& hhit : pfRTkColl[i_pf].trackRef()->recHits()) {
506  if (!hhit->isValid())
507  continue;
508  for (auto const& hit : gsftkHits) {
509  if (hit.isValid() && hhit->sharesInput(&hit, TrackingRecHit::all))
510  ish++;
511  }
512  }
513 
514  if ((ish > ish_max) || ((ish == ish_max) && (dr2 < dr2_min))) {
515  ish_max = ish;
516  dr2_min = dr2;
517  ibest = i_pf;
518  }
519  }
520 
521  i_pf++;
522  }
523 
524  return ((ish_max == 0) || (dr2_min > maxDR2)) ? -1 : ibest;
525  } else {
526  //ELECTRON SEED HAS A REFERENCE
527 
528  unsigned int i_pf = 0;
529 
530  for (auto const& pft : pfRTkColl) {
531  //REF COMPARISON
532  if (pft.trackRef() == electronSeedFromRef.ctfTrack()) {
533  return i_pf;
534  }
535  i_pf++;
536  }
537  }
538  return -1;
539 }

References TrackingRecHit::all, reco::deltaR2(), reco::TrackBase::eta(), reco::Track::extra(), f, edm::RefToBase< T >::get(), reco::TrackBase::phi(), FastTrackerRecHitMaskProducer_cfi::recHits, TrajectorySeed::recHits(), reco::Track::seedRef(), and square().

Referenced by produce().

◆ globalEndJob()

static void PFElecTkProducer::globalEndJob ( convbremhelpers::HeavyObjectCache const *  )
inlinestatic

Definition at line 71 of file PFElecTkProducer.cc.

71 {}

◆ initializeGlobalCache()

static std::unique_ptr<convbremhelpers::HeavyObjectCache> PFElecTkProducer::initializeGlobalCache ( const edm::ParameterSet conf)
inlinestatic

Definition at line 67 of file PFElecTkProducer.cc.

67  {
68  return std::make_unique<convbremhelpers::HeavyObjectCache>(conf);
69  }

◆ isInnerMost()

bool PFElecTkProducer::isInnerMost ( const reco::GsfTrackRef nGsfTrack,
const reco::GsfTrackRef iGsfTrack,
bool &  sameLayer 
)
private

Definition at line 1054 of file PFElecTkProducer.cc.

1056  {
1057  // copied by the class RecoEgamma/EgammaElectronAlgos/src/EgAmbiguityTools.cc
1058  // obsolete but the code is kept: now using lost hits method
1059 
1060  const reco::HitPattern& gsfHitPattern1 = nGsfTrack->hitPattern();
1061  const reco::HitPattern& gsfHitPattern2 = iGsfTrack->hitPattern();
1062 
1063  // retrieve first valid hit
1064  int gsfHitCounter1 = 0;
1065  for (auto const& hit : nGsfTrack->recHits()) {
1066  if (hit->isValid())
1067  break;
1068  gsfHitCounter1++;
1069  }
1070 
1071  int gsfHitCounter2 = 0;
1072  for (auto const& hit : iGsfTrack->recHits()) {
1073  if (hit->isValid())
1074  break;
1075  gsfHitCounter2++;
1076  }
1077 
1078  uint32_t gsfHit1 = gsfHitPattern1.getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter1);
1079  uint32_t gsfHit2 = gsfHitPattern2.getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter2);
1080 
1081  if (gsfHitPattern1.getSubStructure(gsfHit1) != gsfHitPattern2.getSubStructure(gsfHit2)) {
1082  return (gsfHitPattern2.getSubStructure(gsfHit2) < gsfHitPattern1.getSubStructure(gsfHit1));
1083  } else if (gsfHitPattern1.getLayer(gsfHit1) != gsfHitPattern2.getLayer(gsfHit2)) {
1084  return (gsfHitPattern2.getLayer(gsfHit2) < gsfHitPattern1.getLayer(gsfHit1));
1085  } else {
1086  sameLayer = true;
1087  return false;
1088  }
1089 }

References reco::HitPattern::getHitPattern(), reco::HitPattern::getLayer(), and reco::HitPattern::getSubStructure().

◆ isInnerMostWithLostHits()

bool PFElecTkProducer::isInnerMostWithLostHits ( const reco::GsfTrackRef nGsfTrack,
const reco::GsfTrackRef iGsfTrack,
bool &  sameLayer 
)
private

Definition at line 1090 of file PFElecTkProducer.cc.

1092  {
1093  // define closest using the lost hits on the expectedhitsineer
1094  unsigned int nLostHits = nGsfTrack->missingInnerHits();
1095  unsigned int iLostHits = iGsfTrack->missingInnerHits();
1096 
1097  if (nLostHits != iLostHits) {
1098  return (nLostHits > iLostHits);
1099  } else {
1100  sameLayer = true;
1101  return false;
1102  }
1103 }

Referenced by resolveGsfTracks().

◆ isSameEgSC()

bool PFElecTkProducer::isSameEgSC ( const reco::ElectronSeed nSeed,
const reco::ElectronSeed iSeed,
bool &  bothGsfEcalDriven,
float &  SCEnergy 
)
private

Definition at line 849 of file PFElecTkProducer.cc.

852  {
853  bool isSameSC = false;
854 
855  if (nSeed.caloCluster().isNonnull() && iSeed.caloCluster().isNonnull()) {
856  auto const* nscRef = static_cast<SuperCluster const*>(nSeed.caloCluster().get());
857  auto const* iscRef = static_cast<SuperCluster const*>(iSeed.caloCluster().get());
858 
859  if (nscRef && iscRef) {
860  bothGsfEcalDriven = true;
861  if (nscRef == iscRef) {
862  isSameSC = true;
863  // retrieve the supercluster energy
864  SCEnergy = nscRef->energy();
865  }
866  }
867  }
868  return isSameSC;
869 }

References reco::ElectronSeed::caloCluster(), edm::RefToBase< T >::get(), edm::RefToBase< T >::isNonnull(), and TrendClient_cfi::SCEnergy.

Referenced by resolveGsfTracks().

◆ isSharingEcalEnergyWithEgSC()

bool PFElecTkProducer::isSharingEcalEnergyWithEgSC ( const reco::GsfPFRecTrack nGsfPFRecTrack,
const reco::GsfPFRecTrack iGsfPFRecTrack,
const reco::ElectronSeed nSeed,
const reco::ElectronSeed iSeed,
const reco::PFClusterCollection theEClus,
bool &  bothGsfTrackerDriven,
bool &  nEcalDriven,
bool &  iEcalDriven,
float &  nEnergy,
float &  iEnergy 
)
private

Definition at line 870 of file PFElecTkProducer.cc.

879  {
880  bool isSharingEnergy = false;
881 
882  //which is EcalDriven?
883  bool oneEcalDriven = true;
884  SuperCluster const* scRef = nullptr;
885  GsfPFRecTrack gsfPfTrack;
886 
887  if (nSeed.caloCluster().isNonnull()) {
888  scRef = static_cast<SuperCluster const*>(nSeed.caloCluster().get());
889  assert(scRef);
890  nEnergy = scRef->energy();
891  nEcalDriven = true;
892  gsfPfTrack = iGsfPFRecTrack;
893  } else if (iSeed.caloCluster().isNonnull()) {
894  scRef = static_cast<SuperCluster const*>(iSeed.caloCluster().get());
895  assert(scRef);
896  iEnergy = scRef->energy();
897  iEcalDriven = true;
898  gsfPfTrack = nGsfPFRecTrack;
899  } else {
900  oneEcalDriven = false;
901  }
902 
903  if (oneEcalDriven) {
904  //run a basic reconstruction for the particle flow
905 
906  vector<PFCluster> vecPFClusters;
907  vecPFClusters.clear();
908 
909  for (PFClusterCollection::const_iterator clus = theEClus.begin(); clus != theEClus.end(); clus++) {
910  PFCluster clust = *clus;
911  clust.calculatePositionREP();
912 
913  float deta = fabs(scRef->position().eta() - clust.position().eta());
914  float dphi = fabs(scRef->position().phi() - clust.position().phi());
915  if (dphi > TMath::Pi())
916  dphi -= TMath::TwoPi();
917 
918  // Angle preselection between the supercluster and pfclusters
919  // this is needed just to save some cpu-time for this is hard-coded
920  if (deta < 0.5 && fabs(dphi) < 1.0) {
922  ? LinkByRecHit::testTrackAndClusterByRecHit(gsfPfTrack, clust)
923  : -1.;
924  // check if it touch the GsfTrack
925  if (distGsf > 0.) {
926  if (nEcalDriven)
927  iEnergy += clust.energy();
928  else
929  nEnergy += clust.energy();
930  vecPFClusters.push_back(clust);
931  }
932  // check if it touch the Brem-tangents
933  else {
934  vector<PFBrem> primPFBrem = gsfPfTrack.PFRecBrem();
935  for (unsigned ipbrem = 0; ipbrem < primPFBrem.size(); ipbrem++) {
936  if (primPFBrem[ipbrem].indTrajPoint() == 99)
937  continue;
938  const reco::PFRecTrack& pfBremTrack = primPFBrem[ipbrem];
940  ? LinkByRecHit::testTrackAndClusterByRecHit(pfBremTrack, clust, true)
941  : -1.;
942  if (dist > 0.) {
943  if (nEcalDriven)
944  iEnergy += clust.energy();
945  else
946  nEnergy += clust.energy();
947  vecPFClusters.push_back(clust);
948  }
949  }
950  }
951  } // END if angle preselection
952  } // PFClusters Loop
953  if (!vecPFClusters.empty()) {
954  for (unsigned int pf = 0; pf < vecPFClusters.size(); pf++) {
955  bool isCommon = ClusterClusterMapping::overlap(vecPFClusters[pf], *scRef);
956  if (isCommon) {
957  isSharingEnergy = true;
958  }
959  break;
960  }
961  }
962  } else {
963  // both tracks are trackerDriven, try ECAL energy matching also in this case.
964 
965  bothGsfTrackerDriven = true;
966  vector<PFCluster> nPFCluster;
967  vector<PFCluster> iPFCluster;
968 
969  nPFCluster.clear();
970  iPFCluster.clear();
971 
972  for (PFClusterCollection::const_iterator clus = theEClus.begin(); clus != theEClus.end(); clus++) {
973  PFCluster clust = *clus;
974  clust.calculatePositionREP();
975 
976  float ndeta = fabs(nGsfPFRecTrack.gsfTrackRef()->eta() - clust.position().eta());
977  float ndphi = fabs(nGsfPFRecTrack.gsfTrackRef()->phi() - clust.position().phi());
978  if (ndphi > TMath::Pi())
979  ndphi -= TMath::TwoPi();
980  // Apply loose preselection with the track
981  // just to save cpu time, for this hard-coded
982  if (ndeta < 0.5 && fabs(ndphi) < 1.0) {
983  double distGsf = nGsfPFRecTrack.extrapolatedPoint(reco::PFTrajectoryPoint::ECALShowerMax).isValid()
984  ? LinkByRecHit::testTrackAndClusterByRecHit(nGsfPFRecTrack, clust)
985  : -1.;
986  if (distGsf > 0.) {
987  nPFCluster.push_back(clust);
988  nEnergy += clust.energy();
989  } else {
990  const vector<PFBrem>& primPFBrem = nGsfPFRecTrack.PFRecBrem();
991  for (unsigned ipbrem = 0; ipbrem < primPFBrem.size(); ipbrem++) {
992  if (primPFBrem[ipbrem].indTrajPoint() == 99)
993  continue;
994  const reco::PFRecTrack& pfBremTrack = primPFBrem[ipbrem];
996  ? LinkByRecHit::testTrackAndClusterByRecHit(pfBremTrack, clust, true)
997  : -1.;
998  if (dist > 0.) {
999  nPFCluster.push_back(clust);
1000  nEnergy += clust.energy();
1001  break;
1002  }
1003  }
1004  }
1005  }
1006 
1007  float ideta = fabs(iGsfPFRecTrack.gsfTrackRef()->eta() - clust.position().eta());
1008  float idphi = fabs(iGsfPFRecTrack.gsfTrackRef()->phi() - clust.position().phi());
1009  if (idphi > TMath::Pi())
1010  idphi -= TMath::TwoPi();
1011  // Apply loose preselection with the track
1012  // just to save cpu time, for this hard-coded
1013  if (ideta < 0.5 && fabs(idphi) < 1.0) {
1014  double dist = iGsfPFRecTrack.extrapolatedPoint(reco::PFTrajectoryPoint::ECALShowerMax).isValid()
1015  ? LinkByRecHit::testTrackAndClusterByRecHit(iGsfPFRecTrack, clust)
1016  : -1.;
1017  if (dist > 0.) {
1018  iPFCluster.push_back(clust);
1019  iEnergy += clust.energy();
1020  } else {
1021  vector<PFBrem> primPFBrem = iGsfPFRecTrack.PFRecBrem();
1022  for (unsigned ipbrem = 0; ipbrem < primPFBrem.size(); ipbrem++) {
1023  if (primPFBrem[ipbrem].indTrajPoint() == 99)
1024  continue;
1025  const reco::PFRecTrack& pfBremTrack = primPFBrem[ipbrem];
1026  double dist = LinkByRecHit::testTrackAndClusterByRecHit(pfBremTrack, clust, true);
1027  if (dist > 0.) {
1028  iPFCluster.push_back(clust);
1029  iEnergy += clust.energy();
1030  break;
1031  }
1032  }
1033  }
1034  }
1035  }
1036 
1037  if (!nPFCluster.empty() && !iPFCluster.empty()) {
1038  for (unsigned int npf = 0; npf < nPFCluster.size(); npf++) {
1039  for (unsigned int ipf = 0; ipf < iPFCluster.size(); ipf++) {
1040  bool isCommon = ClusterClusterMapping::overlap(nPFCluster[npf], iPFCluster[ipf]);
1041  if (isCommon) {
1042  isSharingEnergy = true;
1043  break;
1044  }
1045  }
1046  if (isSharingEnergy)
1047  break;
1048  }
1049  }
1050  }
1051 
1052  return isSharingEnergy;
1053 }

References cms::cuda::assert(), reco::PFCluster::calculatePositionREP(), reco::ElectronSeed::caloCluster(), reco::PFTrajectoryPoint::ECALShowerMax, reco::PFCluster::energy(), reco::CaloCluster::energy(), reco::PFTrack::extrapolatedPoint(), edm::RefToBase< T >::get(), reco::GsfPFRecTrack::gsfTrackRef(), edm::RefToBase< T >::isNonnull(), reco::PFTrajectoryPoint::isValid(), ClusterClusterMapping::overlap(), packedPFCandidateRefMixer_cfi::pf, reco::GsfPFRecTrack::PFRecBrem(), Pi, reco::CaloCluster::position(), LinkByRecHit::testTrackAndClusterByRecHit(), and TwoPi.

Referenced by resolveGsfTracks().

◆ minTangDist()

float PFElecTkProducer::minTangDist ( const reco::GsfPFRecTrack primGsf,
const reco::GsfPFRecTrack secGsf 
)
private

Definition at line 806 of file PFElecTkProducer.cc.

806  {
807  float minDphi = 1000.;
808 
809  std::vector<reco::PFBrem> primPFBrem = primGsf.PFRecBrem();
810  std::vector<reco::PFBrem> secPFBrem = secGsf.PFRecBrem();
811 
812  unsigned int cbrem = 0;
813  for (unsigned isbrem = 0; isbrem < secPFBrem.size(); isbrem++) {
814  if (secPFBrem[isbrem].indTrajPoint() == 99)
815  continue;
816  const reco::PFTrajectoryPoint& atSecECAL =
817  secPFBrem[isbrem].extrapolatedPoint(reco::PFTrajectoryPoint::ECALEntrance);
818  if (!atSecECAL.isValid())
819  continue;
820  float secPhi = atSecECAL.positionREP().Phi();
821 
822  unsigned int sbrem = 0;
823  for (unsigned ipbrem = 0; ipbrem < primPFBrem.size(); ipbrem++) {
824  if (primPFBrem[ipbrem].indTrajPoint() == 99)
825  continue;
826  const reco::PFTrajectoryPoint& atPrimECAL =
827  primPFBrem[ipbrem].extrapolatedPoint(reco::PFTrajectoryPoint::ECALEntrance);
828  if (!atPrimECAL.isValid())
829  continue;
830  sbrem++;
831  if (sbrem <= 3) {
832  float primPhi = atPrimECAL.positionREP().Phi();
833 
834  float dphi = fabs(primPhi - secPhi);
835  if (dphi > TMath::Pi())
836  dphi -= TMath::TwoPi();
837  if (fabs(dphi) < minDphi) {
838  minDphi = fabs(dphi);
839  }
840  }
841  }
842 
843  cbrem++;
844  if (cbrem == 3)
845  break;
846  }
847  return minDphi;
848 }

References reco::PFTrajectoryPoint::ECALEntrance, reco::PFTrajectoryPoint::isValid(), HLT_FULL_cff::minDphi, reco::GsfPFRecTrack::PFRecBrem(), Pi, reco::PFTrajectoryPoint::positionREP(), and TwoPi.

Referenced by resolveGsfTracks().

◆ produce()

void PFElecTkProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Produce the PFRecTrack collection.

Definition at line 226 of file PFElecTkProducer.cc.

226  {
227  //create the empty collections
228  auto gsfPFRecTrackCollection = std::make_unique<GsfPFRecTrackCollection>();
229 
230  auto gsfPFRecTrackCollectionSecondary = std::make_unique<GsfPFRecTrackCollection>();
231 
232  //read collections of tracks
233  Handle<GsfTrackCollection> gsftrackscoll;
234  iEvent.getByToken(gsfTrackLabel_, gsftrackscoll);
235 
236  //read collections of trajectories
238 
239  //read pfrectrack collection
240  Handle<PFRecTrackCollection> thePfRecTrackCollection;
241  iEvent.getByToken(pfTrackLabel_, thePfRecTrackCollection);
242 
243  // SoA structure for frequently used track information.
244  // LazyConstructed so it is only filled when needed, i.e., when there is an electron in the event.
245  auto trackEtaPhiTable = makeLazy<edm::soa::EtaPhiTable>(*thePfRecTrackCollection);
246 
247  // PFClusters
248  Handle<PFClusterCollection> theECPfClustCollection;
249  iEvent.getByToken(pfEcalClusters_, theECPfClustCollection);
250  const PFClusterCollection& theEcalClusters = *(theECPfClustCollection.product());
251 
252  //Primary Vertexes
253  Handle<reco::VertexCollection> thePrimaryVertexColl;
254  iEvent.getByToken(primVtxLabel_, thePrimaryVertexColl);
255 
256  // Displaced Vertex
258  if (useNuclear_)
259  iEvent.getByToken(pfNuclear_, pfNuclears);
260 
261  // Conversions
263  if (useConversions_)
264  iEvent.getByToken(pfConv_, pfConversions);
265 
266  // V0
268  if (useV0_)
269  iEvent.getByToken(pfV0_, pfV0);
270 
271  GsfTrackCollection gsftracks = *(gsftrackscoll.product());
272  vector<Trajectory> tjvec(0);
273  if (trajinev_) {
275 
276  tjvec = *(TrajectoryCollection.product());
277  }
278 
279  vector<reco::GsfPFRecTrack> selGsfPFRecTracks;
280  vector<reco::GsfPFRecTrack> primaryGsfPFRecTracks;
281  std::map<unsigned int, std::vector<reco::GsfPFRecTrack> > GsfPFMap;
282 
283  for (unsigned igsf = 0; igsf < gsftracks.size(); igsf++) {
284  GsfTrackRef trackRef(gsftrackscoll, igsf);
285  gsfInnerMomentumCache_.push_back(trackRef->pMode());
287  GlobalVector i_innMom;
288  if (i_inTSOS.isValid()) {
290  gsfInnerMomentumCache_.back() = i_innMom.mag();
291  }
292  }
293 
294  for (unsigned int igsf = 0; igsf < gsftracks.size(); igsf++) {
295  GsfTrackRef trackRef(gsftrackscoll, igsf);
296 
297  int kf_ind = findPfRef(*thePfRecTrackCollection, gsftracks[igsf], trackEtaPhiTable.value());
298 
299  if (kf_ind >= 0) {
300  PFRecTrackRef kf_ref(thePfRecTrackCollection, kf_ind);
301 
302  // remove fifth step tracks
303  if (useFifthStepForEcalDriven_ == false || useFifthStepForTrackDriven_ == false) {
304  bool isFifthStepTrack = PFTrackAlgoTools::isFifthStep(kf_ref->trackRef()->algo());
305  bool isEcalDriven = true;
306  bool isTrackerDriven = true;
307 
308  if (trackRef->seedRef().get() == nullptr) {
309  isEcalDriven = false;
310  isTrackerDriven = false;
311  } else {
312  auto const& SeedFromRef = static_cast<ElectronSeed const&>(*(trackRef->extra()->seedRef()));
313  if (SeedFromRef.caloCluster().isNull())
314  isEcalDriven = false;
315  if (SeedFromRef.ctfTrack().isNull())
316  isTrackerDriven = false;
317  }
318  //note: the same track could be both ecalDriven and trackerDriven
319  if (isFifthStepTrack && isEcalDriven && isTrackerDriven == false && useFifthStepForEcalDriven_ == false) {
320  continue;
321  }
322 
323  if (isFifthStepTrack && isTrackerDriven && isEcalDriven == false && useFifthStepForTrackDriven_ == false) {
324  continue;
325  }
326 
327  if (isFifthStepTrack && isTrackerDriven && isEcalDriven && useFifthStepForTrackDriven_ == false &&
328  useFifthStepForEcalDriven_ == false) {
329  continue;
330  }
331  }
332 
333  pftrack_ = GsfPFRecTrack(gsftracks[igsf].charge(), reco::PFRecTrack::GSF, igsf, trackRef, kf_ref);
334  } else {
335  PFRecTrackRef dummyRef;
336  pftrack_ = GsfPFRecTrack(gsftracks[igsf].charge(), reco::PFRecTrack::GSF, igsf, trackRef, dummyRef);
337  }
338 
339  bool validgsfbrem = false;
340  if (trajinev_) {
341  validgsfbrem = pfTransformer_->addPointsAndBrems(pftrack_, gsftracks[igsf], tjvec[igsf], modemomentum_);
342  } else {
343  validgsfbrem = pfTransformer_->addPointsAndBrems(pftrack_, gsftracks[igsf], mtsTransform_);
344  }
345 
346  bool passSel = true;
347  if (applySel_)
348  passSel = applySelection(gsftracks[igsf]);
349 
350  if (validgsfbrem && passSel)
351  selGsfPFRecTracks.push_back(pftrack_);
352  }
353 
354  unsigned int count_primary = 0;
355  if (!selGsfPFRecTracks.empty()) {
356  for (unsigned int ipfgsf = 0; ipfgsf < selGsfPFRecTracks.size(); ipfgsf++) {
357  vector<unsigned int> secondaries(0);
358  secondaries.clear();
359  bool keepGsf = true;
360 
361  if (applyGsfClean_) {
362  keepGsf = resolveGsfTracks(selGsfPFRecTracks, ipfgsf, secondaries, theEcalClusters);
363  }
364 
365  //is primary?
366  if (keepGsf == true) {
367  // Find kf tracks from converted brem photons
368  if (convBremFinder_->foundConvBremPFRecTrack(thePfRecTrackCollection,
369  thePrimaryVertexColl,
370  pfNuclears,
372  pfV0,
373  globalCache(),
374  useNuclear_,
376  useV0_,
377  theEcalClusters,
378  selGsfPFRecTracks[ipfgsf])) {
379  const vector<PFRecTrackRef>& convBremPFRecTracks(convBremFinder_->getConvBremPFRecTracks());
380  for (unsigned int ii = 0; ii < convBremPFRecTracks.size(); ii++) {
381  selGsfPFRecTracks[ipfgsf].addConvBremPFRecTrackRef(convBremPFRecTracks[ii]);
382  }
383  }
384 
385  // save primaries gsf tracks
386  // gsfPFRecTrackCollection->push_back(selGsfPFRecTracks[ipfgsf]);
387  primaryGsfPFRecTracks.push_back(selGsfPFRecTracks[ipfgsf]);
388 
389  // NOTE:: THE TRACKID IS USED TO LINK THE PRIMARY GSF TRACK. THIS NEEDS
390  // TO BE CHANGED AS SOON AS IT IS POSSIBLE TO CHANGE DATAFORMATS
391  // A MODIFICATION HERE IMPLIES A MODIFICATION IN PFBLOCKALGO.CC/H
392  unsigned int primGsfIndex = selGsfPFRecTracks[ipfgsf].trackId();
393  vector<reco::GsfPFRecTrack> trueGsfPFRecTracks;
394  if (!secondaries.empty()) {
395  // loop on secondaries gsf tracks (from converted brems)
396  for (unsigned int isecpfgsf = 0; isecpfgsf < secondaries.size(); isecpfgsf++) {
397  PFRecTrackRef refsecKF = selGsfPFRecTracks[(secondaries[isecpfgsf])].kfPFRecTrackRef();
398 
399  unsigned int secGsfIndex = selGsfPFRecTracks[(secondaries[isecpfgsf])].trackId();
400  GsfTrackRef secGsfRef = selGsfPFRecTracks[(secondaries[isecpfgsf])].gsfTrackRef();
401 
402  if (refsecKF.isNonnull()) {
403  // NOTE::IT SAVED THE TRACKID OF THE PRIMARY!!! THIS IS USED IN PFBLOCKALGO.CC/H
405  gsftracks[secGsfIndex].charge(), reco::PFRecTrack::GSF, primGsfIndex, secGsfRef, refsecKF);
406  } else {
407  PFRecTrackRef dummyRef;
408  // NOTE::IT SAVED THE TRACKID OF THE PRIMARY!!! THIS IS USED IN PFBLOCKALGO.CC/H
410  gsftracks[secGsfIndex].charge(), reco::PFRecTrack::GSF, primGsfIndex, secGsfRef, dummyRef);
411  }
412 
413  bool validgsfbrem = false;
414  if (trajinev_) {
415  validgsfbrem = pfTransformer_->addPointsAndBrems(
416  secpftrack_, gsftracks[secGsfIndex], tjvec[secGsfIndex], modemomentum_);
417  } else {
418  validgsfbrem = pfTransformer_->addPointsAndBrems(secpftrack_, gsftracks[secGsfIndex], mtsTransform_);
419  }
420 
421  if (validgsfbrem) {
422  gsfPFRecTrackCollectionSecondary->push_back(secpftrack_);
423  trueGsfPFRecTracks.push_back(secpftrack_);
424  }
425  }
426  }
427  GsfPFMap.insert(pair<unsigned int, std::vector<reco::GsfPFRecTrack> >(count_primary, trueGsfPFRecTracks));
428  trueGsfPFRecTracks.clear();
429  count_primary++;
430  }
431  }
432  }
433 
434  const edm::OrphanHandle<GsfPFRecTrackCollection> gsfPfRefProd =
435  iEvent.put(std::move(gsfPFRecTrackCollectionSecondary), "Secondary");
436 
437  //now the secondary GsfPFRecTracks are in the event, the Ref can be created
438  createGsfPFRecTrackRef(gsfPfRefProd, primaryGsfPFRecTracks, GsfPFMap);
439 
440  for (unsigned int iGSF = 0; iGSF < primaryGsfPFRecTracks.size(); iGSF++) {
441  gsfPFRecTrackCollection->push_back(primaryGsfPFRecTracks[iGSF]);
442  }
443  iEvent.put(std::move(gsfPFRecTrackCollection));
444 
445  selGsfPFRecTracks.clear();
446  GsfPFMap.clear();
447  primaryGsfPFRecTracks.clear();
448 
449  std::vector<double>().swap(gsfInnerMomentumCache_);
450 }

References applyGsfClean_, applySel_, applySelection(), ALCARECOTkAlJpsiMuMu_cff::charge, convBremFinder_, createGsfPFRecTrackRef(), findPfRef(), edm::Ref< C, T, F >::get(), reco::PFRecTrack::GSF, gsfInnerMomentumCache_, gsfTrackLabel_, iEvent, cuy::ii, MultiTrajectoryStateTransform::innerStateOnSurface(), PFTrackAlgoTools::isFifthStep(), edm::Ref< C, T, F >::isNonnull(), TrajectoryStateOnSurface::isValid(), PV3DBase< T, PVType, FrameType >::mag(), modemomentum_, multiTrajectoryStateMode::momentumFromModeCartesian(), eostools::move(), mtsTransform_, pfConv_, pfConversions_cfi::pfConversions, pfEcalClusters_, pfNuclear_, pftrack_, pfTrackLabel_, pfTransformer_, pfV0_cfi::pfV0, pfV0_, primVtxLabel_, edm::Handle< T >::product(), resolveGsfTracks(), secpftrack_, trajinev_, useConversions_, useFifthStepForEcalDriven_, useFifthStepForTrackDriven_, useNuclear_, and useV0_.

◆ resolveGsfTracks()

bool PFElecTkProducer::resolveGsfTracks ( const std::vector< reco::GsfPFRecTrack > &  GsfPFVec,
unsigned int  ngsf,
std::vector< unsigned int > &  secondaries,
const reco::PFClusterCollection theEClus 
)
private

Definition at line 568 of file PFElecTkProducer.cc.

571  {
572  bool debugCleaning = debugGsfCleaning_;
573  bool n_keepGsf = true;
574 
575  const reco::GsfTrackRef& nGsfTrack = GsfPFVec[ngsf].gsfTrackRef();
576 
577  if (nGsfTrack->seedRef().get() == nullptr)
578  return false;
579  auto const& nElSeedFromRef = static_cast<ElectronSeed const&>(*(nGsfTrack->extra()->seedRef()));
580 
581  /* // now gotten from cache below
582  TrajectoryStateOnSurface inTSOS = mtsTransform_.innerStateOnSurface((*nGsfTrack));
583  GlobalVector ninnMom;
584  float nPin = nGsfTrack->pMode();
585  if(inTSOS.isValid()){
586  multiTrajectoryStateMode::momentumFromModeCartesian(inTSOS,ninnMom);
587  nPin = ninnMom.mag();
588  }
589  */
590  float nPin = gsfInnerMomentumCache_[nGsfTrack.key()];
591 
592  float neta = nGsfTrack->innerMomentum().eta();
593  float nphi = nGsfTrack->innerMomentum().phi();
594 
595  if (debugCleaning)
596  cout << " PFElecTkProducer:: considering track " << nGsfTrack->pt() << " eta,phi " << nGsfTrack->eta() << ", "
597  << nGsfTrack->phi() << endl;
598 
599  for (unsigned int igsf = 0; igsf < GsfPFVec.size(); igsf++) {
600  if (igsf != ngsf) {
601  reco::GsfTrackRef iGsfTrack = GsfPFVec[igsf].gsfTrackRef();
602 
603  if (debugCleaning)
604  cout << " PFElecTkProducer:: and comparing with track " << iGsfTrack->pt() << " eta,phi " << iGsfTrack->eta()
605  << ", " << iGsfTrack->phi() << endl;
606 
607  float ieta = iGsfTrack->innerMomentum().eta();
608  float iphi = iGsfTrack->innerMomentum().phi();
609  float feta = fabs(neta - ieta);
610  float fphi = fabs(nphi - iphi);
611  if (fphi > TMath::Pi())
612  fphi -= TMath::TwoPi();
613 
614  // apply a superloose preselection only to avoid un-useful cpu time: hard-coded for this reason
615  if (feta < 0.5 && fabs(fphi) < 1.0) {
616  if (debugCleaning)
617  cout << " Entering angular superloose preselection " << endl;
618 
619  /* //now taken from cache below
620  TrajectoryStateOnSurface i_inTSOS = mtsTransform_.innerStateOnSurface((*iGsfTrack));
621  GlobalVector i_innMom;
622  float iPin = iGsfTrack->pMode();
623  if(i_inTSOS.isValid()){
624  multiTrajectoryStateMode::momentumFromModeCartesian(i_inTSOS,i_innMom);
625  iPin = i_innMom.mag();
626  }
627  */
628  float iPin = gsfInnerMomentumCache_[iGsfTrack.key()];
629 
630  if (iGsfTrack->seedRef().get() == nullptr)
631  continue;
632  auto const& iElSeedFromRef = static_cast<ElectronSeed const&>(*(iGsfTrack->extra()->seedRef()));
633 
634  float SCEnergy = -1.;
635  // Check if two tracks match the same SC
636  bool areBothGsfEcalDriven = false;
637  ;
638  bool isSameSC = isSameEgSC(nElSeedFromRef, iElSeedFromRef, areBothGsfEcalDriven, SCEnergy);
639 
640  // CASE1 both GsfTracks ecalDriven and match the same SC
641  if (areBothGsfEcalDriven) {
642  if (isSameSC) {
643  float nEP = SCEnergy / nPin;
644  float iEP = SCEnergy / iPin;
645  if (debugCleaning)
646  cout << " Entering SAME supercluster case "
647  << " nEP " << nEP << " iEP " << iEP << endl;
648 
649  // if same SC take the closest or if same
650  // distance the best E/p
651 
652  // Innermost using LostHits technology
653  bool isSameLayer = false;
654  bool iGsfInnermostWithLostHits = isInnerMostWithLostHits(nGsfTrack, iGsfTrack, isSameLayer);
655 
656  if (debugCleaning)
657  cout << " iGsf is InnerMostWithLostHits " << iGsfInnermostWithLostHits << " isSameLayer " << isSameLayer
658  << endl;
659 
660  if (iGsfInnermostWithLostHits) {
661  n_keepGsf = false;
662  return n_keepGsf;
663  } else if (isSameLayer) {
664  if (fabs(iEP - 1) < fabs(nEP - 1)) {
665  n_keepGsf = false;
666  return n_keepGsf;
667  } else {
668  secondaries.push_back(igsf);
669  }
670  } else {
671  // save secondaries gsf track (put selection)
672  secondaries.push_back(igsf);
673  }
674  } // end same SC case
675  } else {
676  // enter in the condition where at least one track is trackerDriven
677  float minBremDphi = minTangDist(GsfPFVec[ngsf], GsfPFVec[igsf]);
678  float nETot = 0.;
679  float iETot = 0.;
680  bool isBothGsfTrackerDriven = false;
681  bool nEcalDriven = false;
682  bool iEcalDriven = false;
683  bool isSameScEgPf = isSharingEcalEnergyWithEgSC(GsfPFVec[ngsf],
684  GsfPFVec[igsf],
685  nElSeedFromRef,
686  iElSeedFromRef,
687  theEClus,
688  isBothGsfTrackerDriven,
689  nEcalDriven,
690  iEcalDriven,
691  nETot,
692  iETot);
693 
694  // check if the first hit of iGsfTrack < nGsfTrack
695  bool isSameLayer = false;
696  bool iGsfInnermostWithLostHits = isInnerMostWithLostHits(nGsfTrack, iGsfTrack, isSameLayer);
697 
698  if (isSameScEgPf) {
699  // CASE 2 : One Gsf has reference to a SC and the other one not or both not
700 
701  if (debugCleaning) {
702  cout << " Sharing ECAL energy passed "
703  << " nEtot " << nETot << " iEtot " << iETot << endl;
704  if (isBothGsfTrackerDriven)
705  cout << " Both Track are trackerDriven " << endl;
706  }
707 
708  // Innermost using LostHits technology
709  if (iGsfInnermostWithLostHits) {
710  n_keepGsf = false;
711  return n_keepGsf;
712  } else if (isSameLayer) {
713  // Thirt Case: One Gsf has reference to a SC and the other one not or both not
714  // gsf tracks starts from the same layer
715  // check number of sharing modules (at least 50%)
716  // check number of sharing hits (at least 2)
717  // check charge flip inner/outer
718 
719  // they share energy
720  if (isBothGsfTrackerDriven == false) {
721  // if at least one Gsf track is EcalDriven choose that one.
722  if (iEcalDriven) {
723  n_keepGsf = false;
724  return n_keepGsf;
725  } else {
726  secondaries.push_back(igsf);
727  }
728  } else {
729  // if both tracks are tracker driven choose that one with the best E/p
730  // with ETot = max(En,Ei)
731 
732  float ETot = -1;
733  if (nETot != iETot) {
734  if (nETot > iETot)
735  ETot = nETot;
736  else
737  ETot = iETot;
738  } else {
739  ETot = nETot;
740  }
741  float nEP = ETot / nPin;
742  float iEP = ETot / iPin;
743 
744  if (debugCleaning)
745  cout << " nETot " << nETot << " iETot " << iETot << " ETot " << ETot << endl
746  << " nPin " << nPin << " iPin " << iPin << " nEP " << nEP << " iEP " << iEP << endl;
747 
748  if (fabs(iEP - 1) < fabs(nEP - 1)) {
749  n_keepGsf = false;
750  return n_keepGsf;
751  } else {
752  secondaries.push_back(igsf);
753  }
754  }
755  } else {
756  secondaries.push_back(igsf);
757  }
758  } else if (feta < detaCutGsfClean_ && minBremDphi < dphiCutGsfClean_) {
759  // very close tracks
760  bool secPushedBack = false;
761  if (nEcalDriven == false && nETot == 0.) {
762  n_keepGsf = false;
763  return n_keepGsf;
764  } else if (iEcalDriven == false && iETot == 0.) {
765  secondaries.push_back(igsf);
766  secPushedBack = true;
767  }
768  if (debugCleaning)
769  cout << " Close Tracks "
770  << " feta " << feta << " fabs(fphi) " << fabs(fphi) << " minBremDphi " << minBremDphi << " nETot "
771  << nETot << " iETot " << iETot << " nLostHits " << nGsfTrack->missingInnerHits() << " iLostHits "
772  << iGsfTrack->missingInnerHits() << endl;
773 
774  // apply selection only if one track has lost hits
775  if (applyAngularGsfClean_) {
776  if (iGsfInnermostWithLostHits) {
777  n_keepGsf = false;
778  return n_keepGsf;
779  } else if (isSameLayer == false) {
780  if (secPushedBack == false)
781  secondaries.push_back(igsf);
782  }
783  }
784  } else if (feta < 0.1 && minBremDphi < 0.2) {
785  // failed all the conditions, discard only tracker driven tracks
786  // with no PFClusters linked.
787  if (debugCleaning)
788  cout << " Close Tracks and failed all the conditions "
789  << " feta " << feta << " fabs(fphi) " << fabs(fphi) << " minBremDphi " << minBremDphi << " nETot "
790  << nETot << " iETot " << iETot << " nLostHits " << nGsfTrack->missingInnerHits() << " iLostHits "
791  << iGsfTrack->missingInnerHits() << endl;
792 
793  if (nEcalDriven == false && nETot == 0.) {
794  n_keepGsf = false;
795  return n_keepGsf;
796  }
797  // Here I do not push back the secondary because considered fakes...
798  }
799  }
800  }
801  }
802  }
803 
804  return n_keepGsf;
805 }

References applyAngularGsfClean_, gather_cfg::cout, debugGsfCleaning_, detaCutGsfClean_, dphiCutGsfClean_, JetMETHLTOfflineSource_cfi::feta, edm::Ref< C, T, F >::get(), gsfInnerMomentumCache_, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, isInnerMostWithLostHits(), isSameEgSC(), isSharingEcalEnergyWithEgSC(), edm::Ref< C, T, F >::key(), minTangDist(), neta, nphi, Pi, TrendClient_cfi::SCEnergy, and TwoPi.

Referenced by produce().

Member Data Documentation

◆ applyAngularGsfClean_

bool PFElecTkProducer::applyAngularGsfClean_
private

Definition at line 131 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and resolveGsfTracks().

◆ applyGsfClean_

bool PFElecTkProducer::applyGsfClean_
private

Definition at line 144 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ applySel_

bool PFElecTkProducer::applySel_
private

Definition at line 143 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ conf_

edm::ParameterSet PFElecTkProducer::conf_
private

Definition at line 120 of file PFElecTkProducer.cc.

◆ convBremFinder_

std::unique_ptr<ConvBremPFTrackFinder> PFElecTkProducer::convBremFinder_
private

Definition at line 138 of file PFElecTkProducer.cc.

Referenced by beginRun(), endRun(), and produce().

◆ debugGsfCleaning_

bool PFElecTkProducer::debugGsfCleaning_
private

Definition at line 148 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and resolveGsfTracks().

◆ detaCutGsfClean_

double PFElecTkProducer::detaCutGsfClean_
private

Definition at line 132 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and resolveGsfTracks().

◆ detaGsfSC_

double PFElecTkProducer::detaGsfSC_
private

Definition at line 150 of file PFElecTkProducer.cc.

Referenced by applySelection(), and PFElecTkProducer().

◆ dphiCutGsfClean_

double PFElecTkProducer::dphiCutGsfClean_
private

Definition at line 133 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and resolveGsfTracks().

◆ dphiGsfSC_

double PFElecTkProducer::dphiGsfSC_
private

Definition at line 151 of file PFElecTkProducer.cc.

Referenced by applySelection(), and PFElecTkProducer().

◆ gsfInnerMomentumCache_

std::vector<double> PFElecTkProducer::gsfInnerMomentumCache_
private

Definition at line 167 of file PFElecTkProducer.cc.

Referenced by produce(), and resolveGsfTracks().

◆ gsfTrackLabel_

edm::EDGetTokenT<reco::GsfTrackCollection> PFElecTkProducer::gsfTrackLabel_
private

Definition at line 121 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ maxPtConvReco_

double PFElecTkProducer::maxPtConvReco_
private

Definition at line 152 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer().

◆ modemomentum_

bool PFElecTkProducer::modemomentum_
private

Definition at line 142 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ mtsTransform_

MultiTrajectoryStateTransform PFElecTkProducer::mtsTransform_
private

Definition at line 137 of file PFElecTkProducer.cc.

Referenced by beginRun(), and produce().

◆ mvaConvBremFinderIDBarrelHighPt_

double PFElecTkProducer::mvaConvBremFinderIDBarrelHighPt_
private

Definition at line 158 of file PFElecTkProducer.cc.

Referenced by beginRun(), and PFElecTkProducer().

◆ mvaConvBremFinderIDBarrelLowPt_

double PFElecTkProducer::mvaConvBremFinderIDBarrelLowPt_
private

Definition at line 157 of file PFElecTkProducer.cc.

Referenced by beginRun(), and PFElecTkProducer().

◆ mvaConvBremFinderIDEndcapsHighPt_

double PFElecTkProducer::mvaConvBremFinderIDEndcapsHighPt_
private

Definition at line 160 of file PFElecTkProducer.cc.

Referenced by beginRun(), and PFElecTkProducer().

◆ mvaConvBremFinderIDEndcapsLowPt_

double PFElecTkProducer::mvaConvBremFinderIDEndcapsLowPt_
private

Definition at line 159 of file PFElecTkProducer.cc.

Referenced by beginRun(), and PFElecTkProducer().

◆ path_mvaWeightFileConvBremBarrelHighPt_

std::string PFElecTkProducer::path_mvaWeightFileConvBremBarrelHighPt_
private

Definition at line 162 of file PFElecTkProducer.cc.

◆ path_mvaWeightFileConvBremBarrelLowPt_

std::string PFElecTkProducer::path_mvaWeightFileConvBremBarrelLowPt_
private

Definition at line 161 of file PFElecTkProducer.cc.

◆ path_mvaWeightFileConvBremEndcapsHighPt_

std::string PFElecTkProducer::path_mvaWeightFileConvBremEndcapsHighPt_
private

Definition at line 164 of file PFElecTkProducer.cc.

◆ path_mvaWeightFileConvBremEndcapsLowPt_

std::string PFElecTkProducer::path_mvaWeightFileConvBremEndcapsLowPt_
private

Definition at line 163 of file PFElecTkProducer.cc.

◆ pfConv_

edm::EDGetTokenT<reco::PFConversionCollection> PFElecTkProducer::pfConv_
private

Definition at line 126 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ pfEcalClusters_

edm::EDGetTokenT<reco::PFClusterCollection> PFElecTkProducer::pfEcalClusters_
private

Definition at line 124 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ pfNuclear_

edm::EDGetTokenT<reco::PFDisplacedTrackerVertexCollection> PFElecTkProducer::pfNuclear_
private

Definition at line 125 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ pftrack_

reco::GsfPFRecTrack PFElecTkProducer::pftrack_
private

Definition at line 118 of file PFElecTkProducer.cc.

Referenced by produce().

◆ pfTrackLabel_

edm::EDGetTokenT<reco::PFRecTrackCollection> PFElecTkProducer::pfTrackLabel_
private

Definition at line 122 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ pfTransformer_

std::unique_ptr<PFTrackTransformer> PFElecTkProducer::pfTransformer_
private

PFTrackTransformer.

Definition at line 136 of file PFElecTkProducer.cc.

Referenced by beginRun(), endRun(), and produce().

◆ pfV0_

edm::EDGetTokenT<reco::PFV0Collection> PFElecTkProducer::pfV0_
private

Definition at line 127 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ primVtxLabel_

edm::EDGetTokenT<reco::VertexCollection> PFElecTkProducer::primVtxLabel_
private

Definition at line 123 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ SCEne_

double PFElecTkProducer::SCEne_
private

Definition at line 149 of file PFElecTkProducer.cc.

Referenced by applySelection(), and PFElecTkProducer().

◆ secpftrack_

reco::GsfPFRecTrack PFElecTkProducer::secpftrack_
private

Definition at line 119 of file PFElecTkProducer.cc.

Referenced by produce().

◆ trajinev_

bool PFElecTkProducer::trajinev_
private

Trajectory of GSfTracks in the event?

Definition at line 141 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ useConvBremFinder_

bool PFElecTkProducer::useConvBremFinder_
private

Conv Brem Finder.

Definition at line 155 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer().

◆ useConversions_

bool PFElecTkProducer::useConversions_
private

Definition at line 129 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ useFifthStepForEcalDriven_

bool PFElecTkProducer::useFifthStepForEcalDriven_
private

Definition at line 145 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ useFifthStepForTrackDriven_

bool PFElecTkProducer::useFifthStepForTrackDriven_
private

Definition at line 146 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ useNuclear_

bool PFElecTkProducer::useNuclear_
private

Definition at line 128 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ useV0_

bool PFElecTkProducer::useV0_
private

Definition at line 130 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

Vector3DBase
Definition: Vector3DBase.h:8
reco::PFClusterCollection
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
reco::HitPattern::getHitPattern
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:530
reco::HitPattern::getSubStructure
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:695
PFElecTkProducer::convBremFinder_
std::unique_ptr< ConvBremPFTrackFinder > convBremFinder_
Definition: PFElecTkProducer.cc:138
reco::PFTrack::extrapolatedPoint
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
Definition: PFTrack.cc:46
neta
const int neta
Definition: CMTRawAnalyzer.h:423
PFElecTkProducer::debugGsfCleaning_
bool debugGsfCleaning_
Definition: PFElecTkProducer.cc:148
PFElecTkProducer::maxPtConvReco_
double maxPtConvReco_
Definition: PFElecTkProducer.cc:152
TwoPi
const double TwoPi
Definition: CosmicMuonParameters.h:19
TrendClient_cfi.SCEnergy
SCEnergy
Definition: TrendClient_cfi.py:17
edm::Handle::product
T const * product() const
Definition: Handle.h:70
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
reco::SuperCluster
Definition: SuperCluster.h:18
PFElecTkProducer::useNuclear_
bool useNuclear_
Definition: PFElecTkProducer.cc:128
PFElecTkProducer::gsfInnerMomentumCache_
std::vector< double > gsfInnerMomentumCache_
Definition: PFElecTkProducer.cc:167
PFElecTkProducer::detaGsfSC_
double detaGsfSC_
Definition: PFElecTkProducer.cc:150
reco::GsfPFRecTrack::PFRecBrem
const std::vector< reco::PFBrem > & PFRecBrem() const
Definition: GsfPFRecTrack.h:45
gather_cfg.cout
cout
Definition: gather_cfg.py:144
PFElecTkProducer::useConversions_
bool useConversions_
Definition: PFElecTkProducer.cc:129
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
LinkByRecHit::testTrackAndClusterByRecHit
static double testTrackAndClusterByRecHit(const reco::PFRecTrack &track, const reco::PFCluster &cluster, bool isBrem=false, bool debug=false)
Definition: LinkByRecHit.cc:18
cms::cuda::assert
assert(be >=bs)
PFElecTkProducer::minTangDist
float minTangDist(const reco::GsfPFRecTrack &primGsf, const reco::GsfPFRecTrack &secGsf)
Definition: PFElecTkProducer.cc:806
PFElecTkProducer::useConvBremFinder_
bool useConvBremFinder_
Conv Brem Finder.
Definition: PFElecTkProducer.cc:155
PFElecTkProducer::isSameEgSC
bool isSameEgSC(const reco::ElectronSeed &nSeed, const reco::ElectronSeed &iSeed, bool &bothGsfEcalDriven, float &SCEnergy)
Definition: PFElecTkProducer.cc:849
PFElecTkProducer::applyAngularGsfClean_
bool applyAngularGsfClean_
Definition: PFElecTkProducer.cc:131
multiTrajectoryStateMode::momentumFromModeCartesian
bool momentumFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
Definition: MultiTrajectoryStateMode.cc:16
PFElecTkProducer::applyGsfClean_
bool applyGsfClean_
Definition: PFElecTkProducer.cc:144
reco::GsfTrack::phiMode
double phiMode() const
azimuthal angle of momentum vector from mode
Definition: GsfTrack.h:55
HLT_FULL_cff.magneticField
magneticField
Definition: HLT_FULL_cff.py:348
PFElecTkProducer::isInnerMostWithLostHits
bool isInnerMostWithLostHits(const reco::GsfTrackRef &nGsfTrack, const reco::GsfTrackRef &iGsfTrack, bool &sameLayer)
Definition: PFElecTkProducer.cc:1090
edm::Handle
Definition: AssociativeIterator.h:50
PFElecTkProducer::trajinev_
bool trajinev_
Trajectory of GSfTracks in the event?
Definition: PFElecTkProducer.cc:141
PFElecTkProducer::pfTrackLabel_
edm::EDGetTokenT< reco::PFRecTrackCollection > pfTrackLabel_
Definition: PFElecTkProducer.cc:122
reco::Track::extra
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139
reco::GsfPFRecTrack
Definition: GsfPFRecTrack.h:24
edm::Ref
Definition: AssociativeIterator.h:58
PFElecTkProducer::isSharingEcalEnergyWithEgSC
bool isSharingEcalEnergyWithEgSC(const reco::GsfPFRecTrack &nGsfPFRecTrack, const reco::GsfPFRecTrack &iGsfPFRecTrack, const reco::ElectronSeed &nSeed, const reco::ElectronSeed &iSeed, const reco::PFClusterCollection &theEClus, bool &bothGsfTrackerDriven, bool &nEcalDriven, bool &iEcalDriven, float &nEnergy, float &iEnergy)
Definition: PFElecTkProducer.cc:870
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
PFElecTkProducer::resolveGsfTracks
bool resolveGsfTracks(const std::vector< reco::GsfPFRecTrack > &GsfPFVec, unsigned int ngsf, std::vector< unsigned int > &secondaries, const reco::PFClusterCollection &theEClus)
Definition: PFElecTkProducer.cc:568
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
nphi
const int nphi
Definition: CMTRawAnalyzer.h:424
reco::PFTrajectoryPoint::positionREP
const REPPoint & positionREP() const
trajectory position in (rho, eta, phi) base
Definition: PFTrajectoryPoint.h:103
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
reco::HitPattern
Definition: HitPattern.h:147
reco::PFCluster::energy
double energy() const
cluster energy
Definition: PFCluster.h:74
reco::GsfPFRecTrack::gsfTrackRef
const reco::GsfTrackRef & gsfTrackRef() const
Definition: GsfPFRecTrack.h:34
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
edm::soa::col
Definition: KinematicColumns.h:8
PFTrackAlgoTools::isFifthStep
bool isFifthStep(const reco::TrackBase::TrackAlgorithm &)
Definition: PFTrackAlgoTools.cc:163
PFElecTkProducer::mvaConvBremFinderIDEndcapsHighPt_
double mvaConvBremFinderIDEndcapsHighPt_
Definition: PFElecTkProducer.cc:160
reco::GsfTrack::etaMode
double etaMode() const
pseudorapidity of momentum vector from mode
Definition: GsfTrack.h:57
reco::PFTrajectoryPoint::ECALShowerMax
Definition: PFTrajectoryPoint.h:46
PFElecTkProducer::useV0_
bool useV0_
Definition: PFElecTkProducer.cc:130
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
TransientTrackRecord
Definition: TransientTrackRecord.h:11
edm::ESHandle< MagneticField >
PFElecTkProducer::createGsfPFRecTrackRef
void createGsfPFRecTrackRef(const edm::OrphanHandle< reco::GsfPFRecTrackCollection > &gsfPfHandle, std::vector< reco::GsfPFRecTrack > &gsfPFRecTrackPrimary, const std::map< unsigned int, std::vector< reco::GsfPFRecTrack > > &MapPrimSec)
Definition: PFElecTkProducer.cc:453
PFElecTkProducer::dphiGsfSC_
double dphiGsfSC_
Definition: PFElecTkProducer.cc:151
PFElecTkProducer::pftrack_
reco::GsfPFRecTrack pftrack_
Definition: PFElecTkProducer.cc:118
Point3DBase< float, GlobalTag >
edm::RefToBase::get
value_type const * get() const
Definition: RefToBase.h:209
reco::TrackBase::phi
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
PFElecTkProducer::dphiCutGsfClean_
double dphiCutGsfClean_
Definition: PFElecTkProducer.cc:133
ClusterClusterMapping::overlap
static bool overlap(const reco::CaloCluster &sc1, const reco::CaloCluster &sc, float minfrac=0.01, bool debug=false)
Definition: ClusterClusterMapping.cc:4
PFElecTkProducer::pfConv_
edm::EDGetTokenT< reco::PFConversionCollection > pfConv_
Definition: PFElecTkProducer.cc:126
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
PFElecTkProducer::applySel_
bool applySel_
Definition: PFElecTkProducer.cc:143
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
reco::HitPattern::getLayer
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:702
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
JetMETHLTOfflineSource_cfi.feta
feta
Definition: JetMETHLTOfflineSource_cfi.py:30
TrackingRecHit::all
Definition: TrackingRecHit.h:59
pfV0_cfi.pfV0
pfV0
Definition: pfV0_cfi.py:3
PFElecTkProducer::useFifthStepForEcalDriven_
bool useFifthStepForEcalDriven_
Definition: PFElecTkProducer.cc:145
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
square
static double square(double x)
Definition: DDCutTubsFromPoints.cc:100
reco::TrackBase::eta
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
reco::PFCluster::calculatePositionREP
void calculatePositionREP()
computes posrep_ once and for all
Definition: PFCluster.h:95
edm::soa::col::Eta
Definition: KinematicColumns.h:10
iEvent
int iEvent
Definition: GenABIO.cc:224
PFElecTkProducer::mtsTransform_
MultiTrajectoryStateTransform mtsTransform_
Definition: PFElecTkProducer.cc:137
PFElecTkProducer::pfTransformer_
std::unique_ptr< PFTrackTransformer > pfTransformer_
PFTrackTransformer.
Definition: PFElecTkProducer.cc:136
TransientTrackBuilder
Definition: TransientTrackBuilder.h:16
pfConversions_cfi.pfConversions
pfConversions
Definition: pfConversions_cfi.py:6
PFElecTkProducer::conf_
edm::ParameterSet conf_
Definition: PFElecTkProducer.cc:120
get
#define get
TrajectorySeed::recHits
RecHitRange recHits() const
Definition: TrajectorySeed.h:52
PFElecTkProducer::pfEcalClusters_
edm::EDGetTokenT< reco::PFClusterCollection > pfEcalClusters_
Definition: PFElecTkProducer.cc:124
reco::PFTrajectoryPoint::isValid
bool isValid() const
is this point valid ?
Definition: PFTrajectoryPoint.h:84
PFElecTkProducer::primVtxLabel_
edm::EDGetTokenT< reco::VertexCollection > primVtxLabel_
Definition: PFElecTkProducer.cc:123
reco::CaloCluster::position
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
MultiTrajectoryStateTransform
Definition: MultiTrajectoryStateTransform.h:18
HLT_FULL_cff.minDphi
minDphi
Definition: HLT_FULL_cff.py:47698
reco::PFRecTrack::GSF
Definition: PFRecTrack.h:26
PFElecTkProducer::mvaConvBremFinderIDBarrelLowPt_
double mvaConvBremFinderIDBarrelLowPt_
Definition: PFElecTkProducer.cc:157
PFElecTkProducer::pfV0_
edm::EDGetTokenT< reco::PFV0Collection > pfV0_
Definition: PFElecTkProducer.cc:127
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
reco::PFTrajectoryPoint::ECALEntrance
ECAL front face.
Definition: PFTrajectoryPoint.h:43
reco::GsfTrackCollection
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
reco::PFRecTrack
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:20
reco::Track::seedRef
const edm::RefToBase< TrajectorySeed > & seedRef() const
Definition: Track.h:155
packedPFCandidateRefMixer_cfi.pf
pf
Definition: packedPFCandidateRefMixer_cfi.py:4
PFElecTkProducer::detaCutGsfClean_
double detaCutGsfClean_
Definition: PFElecTkProducer.cc:132
reco::PFTrajectoryPoint
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
Definition: PFTrajectoryPoint.h:26
edm::RefToBase::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: RefToBase.h:301
reco::PFCluster
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
PFElecTkProducer::gsfTrackLabel_
edm::EDGetTokenT< reco::GsfTrackCollection > gsfTrackLabel_
Definition: PFElecTkProducer.cc:121
PFElecTkProducer::findPfRef
int findPfRef(const reco::PFRecTrackCollection &pfRTkColl, const reco::GsfTrack &, edm::soa::EtaPhiTableView trackEtaPhiTable)
Definition: PFElecTkProducer.cc:473
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MultiTrajectoryStateTransform::innerStateOnSurface
TrajectoryStateOnSurface innerStateOnSurface(const reco::GsfTrack &tk) const
Definition: MultiTrajectoryStateTransform.cc:23
Pi
const double Pi
Definition: CosmicMuonParameters.h:18
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
PFElecTkProducer::mvaConvBremFinderIDEndcapsLowPt_
double mvaConvBremFinderIDEndcapsLowPt_
Definition: PFElecTkProducer.cc:159
genParticles_cff.map
map
Definition: genParticles_cff.py:11
PFElecTkProducer::useFifthStepForTrackDriven_
bool useFifthStepForTrackDriven_
Definition: PFElecTkProducer.cc:146
PFElecTkProducer::SCEne_
double SCEne_
Definition: PFElecTkProducer.cc:149
PFElecTkProducer::pfNuclear_
edm::EDGetTokenT< reco::PFDisplacedTrackerVertexCollection > pfNuclear_
Definition: PFElecTkProducer.cc:125
TrajectoryCollection
std::vector< Trajectory > TrajectoryCollection
Definition: TrajectoryToSeedMap.h:17
PFElecTkProducer::secpftrack_
reco::GsfPFRecTrack secpftrack_
Definition: PFElecTkProducer.cc:119
reco::CaloCluster::energy
double energy() const
cluster energy
Definition: CaloCluster.h:149
cuy.ii
ii
Definition: cuy.py:590
edm::InputTag
Definition: InputTag.h:15
PFElecTkProducer::modemomentum_
bool modemomentum_
Definition: PFElecTkProducer.cc:142
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
hit
Definition: SiStripHitEffFromCalibTree.cc:88
edm::soa::col::Phi
Definition: KinematicColumns.h:11
PFElecTkProducer::applySelection
bool applySelection(const reco::GsfTrack &)
Definition: PFElecTkProducer.cc:542
PFElecTkProducer::mvaConvBremFinderIDBarrelHighPt_
double mvaConvBremFinderIDBarrelHighPt_
Definition: PFElecTkProducer.cc:158
reco::ElectronSeed::caloCluster
const CaloClusterRef & caloCluster() const
Definition: ElectronSeed.h:93