CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PFElecTkProducer Class Referencefinal

Abstract. More...

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 hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () 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 &, bool)
 
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

Abstract.

Author
Michele Pioppi, Daniele Benedetti
Date
January 2007

PFElecTkProducer reads the merged GsfTracks collection built with the TrackerDriven and EcalDriven seeds and transform them in PFGsfRecTracks.

Definition at line 53 of file PFElecTkProducer.cc.

Constructor & Destructor Documentation

◆ PFElecTkProducer()

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

Constructor.

Definition at line 163 of file PFElecTkProducer.cc.

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

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 534 of file PFElecTkProducer.cc.

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

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 439 of file PFElecTkProducer.cc.

442  {
443  unsigned int cgsf = 0;
444  unsigned int csecgsf = 0;
445  for (std::map<unsigned int, std::vector<reco::GsfPFRecTrack> >::const_iterator igsf = MapPrimSec.begin();
446  igsf != MapPrimSec.end();
447  igsf++, cgsf++) {
448  vector<reco::GsfPFRecTrack> SecGsfPF = igsf->second;
449  for (unsigned int iSecGsf = 0; iSecGsf < SecGsfPF.size(); iSecGsf++) {
450  edm::Ref<reco::GsfPFRecTrackCollection> refgprt(gsfPfHandle, csecgsf);
451  gsfPFRecTrackPrimary[cgsf].addConvBremGsfPFRecTrackRef(refgprt);
452  ++csecgsf;
453  }
454  }
455 
456  return;
457 }

References genParticles_cff::map.

Referenced by produce().

◆ endRun()

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

Definition at line 1123 of file PFElecTkProducer.cc.

1123  {
1124  pfTransformer_.reset();
1125  convBremFinder_.reset();
1126 }

References convBremFinder_, and pfTransformer_.

◆ FindPfRef()

int PFElecTkProducer::FindPfRef ( const reco::PFRecTrackCollection PfRTkColl,
const reco::GsfTrack gsftk,
bool  otherColl 
)
private

Definition at line 459 of file PFElecTkProducer.cc.

461  {
462  if (gsftk.seedRef().get() == nullptr)
463  return -1;
464  auto const& ElSeedFromRef = static_cast<ElectronSeed const&>(*(gsftk.extra()->seedRef()));
465  //CASE 1 ELECTRONSEED DOES NOT HAVE A REF TO THE CKFTRACK
466  if (ElSeedFromRef.ctfTrack().isNull()) {
467  reco::PFRecTrackCollection::const_iterator pft = PfRTkColl.begin();
468  reco::PFRecTrackCollection::const_iterator pftend = PfRTkColl.end();
469  unsigned int i_pf = 0;
470  int ibest = -1;
471  unsigned int ish_max = 0;
472  float dr_min = 1000;
473  //SEARCH THE PFRECTRACK THAT SHARES HITS WITH THE ELECTRON SEED
474  // Here the cpu time can be improved.
475  for (; pft != pftend; ++pft) {
476  unsigned int ish = 0;
477 
478  float dph = fabs(pft->trackRef()->phi() - gsftk.phi());
479  if (dph > TMath::Pi())
480  dph -= TMath::TwoPi();
481  float det = fabs(pft->trackRef()->eta() - gsftk.eta());
482  float dr = sqrt(dph * dph + det * det);
483 
484  for (auto const& hhit : pft->trackRef()->recHits()) {
485  if (!hhit->isValid())
486  continue;
488  TrajectorySeed::const_iterator hit_end = gsftk.seedRef()->recHits().second;
489  for (; hit != hit_end; ++hit) {
490  if (!(hit->isValid()))
491  continue;
492  if (hhit->sharesInput(&*(hit), TrackingRecHit::all))
493  ish++;
494  // if((hit->geographicalId()==hhit->geographicalId())&&
495  // ((hhit->localPosition()-hit->localPosition()).mag()<0.01)) ish++;
496  }
497  }
498 
499  if ((ish > ish_max) || ((ish == ish_max) && (dr < dr_min))) {
500  ish_max = ish;
501  dr_min = dr;
502  ibest = i_pf;
503  }
504 
505  i_pf++;
506  }
507  if (ibest < 0)
508  return -1;
509 
510  if ((ish_max == 0) || (dr_min > 0.05))
511  return -1;
512  if (otherColl && (ish_max == 0))
513  return -1;
514  return ibest;
515  } else {
516  //ELECTRON SEED HAS A REFERENCE
517 
518  reco::PFRecTrackCollection::const_iterator pft = PfRTkColl.begin();
519  reco::PFRecTrackCollection::const_iterator pftend = PfRTkColl.end();
520  unsigned int i_pf = 0;
521 
522  for (; pft != pftend; ++pft) {
523  //REF COMPARISON
524  if (pft->trackRef() == ElSeedFromRef.ctfTrack()) {
525  return i_pf;
526  }
527  i_pf++;
528  }
529  }
530  return -1;
531 }

References TrackingRecHit::all, flavorHistoryFilter_cfi::dr, reco::TrackBase::eta(), reco::Track::extra(), edm::RefToBase< T >::get(), reco::TrackBase::phi(), Pi, TrajectorySeed::recHits(), reco::Track::seedRef(), mathSSE::sqrt(), and TwoPi.

Referenced by produce().

◆ globalEndJob()

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

Definition at line 62 of file PFElecTkProducer.cc.

62 {}

◆ initializeGlobalCache()

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

Definition at line 58 of file PFElecTkProducer.cc.

58  {
59  return std::unique_ptr<convbremhelpers::HeavyObjectCache>(new convbremhelpers::HeavyObjectCache(conf));
60  }

◆ isInnerMost()

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

Definition at line 1048 of file PFElecTkProducer.cc.

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

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 1084 of file PFElecTkProducer.cc.

1086  {
1087  // define closest using the lost hits on the expectedhitsineer
1088  unsigned int nLostHits = nGsfTrack->hitPattern().numberOfLostHits(HitPattern::MISSING_INNER_HITS);
1089  unsigned int iLostHits = iGsfTrack->hitPattern().numberOfLostHits(HitPattern::MISSING_INNER_HITS);
1090 
1091  if (nLostHits != iLostHits) {
1092  return (nLostHits > iLostHits);
1093  } else {
1094  sameLayer = true;
1095  return false;
1096  }
1097 }

Referenced by resolveGsfTracks().

◆ isSameEgSC()

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

Definition at line 843 of file PFElecTkProducer.cc.

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

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 864 of file PFElecTkProducer.cc.

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

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 800 of file PFElecTkProducer.cc.

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

References reco::PFTrajectoryPoint::ECALEntrance, reco::PFTrajectoryPoint::isValid(), HLT_2018_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 215 of file PFElecTkProducer.cc.

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

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 560 of file PFElecTkProducer.cc.

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

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 120 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and resolveGsfTracks().

◆ applyGsfClean_

bool PFElecTkProducer::applyGsfClean_
private

Definition at line 133 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ applySel_

bool PFElecTkProducer::applySel_
private

Definition at line 132 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ conf_

edm::ParameterSet PFElecTkProducer::conf_
private

Definition at line 109 of file PFElecTkProducer.cc.

◆ convBremFinder_

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

Definition at line 127 of file PFElecTkProducer.cc.

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

◆ debugGsfCleaning_

bool PFElecTkProducer::debugGsfCleaning_
private

Definition at line 137 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and resolveGsfTracks().

◆ detaCutGsfClean_

double PFElecTkProducer::detaCutGsfClean_
private

Definition at line 121 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and resolveGsfTracks().

◆ detaGsfSC_

double PFElecTkProducer::detaGsfSC_
private

Definition at line 139 of file PFElecTkProducer.cc.

Referenced by applySelection(), and PFElecTkProducer().

◆ dphiCutGsfClean_

double PFElecTkProducer::dphiCutGsfClean_
private

Definition at line 122 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and resolveGsfTracks().

◆ dphiGsfSC_

double PFElecTkProducer::dphiGsfSC_
private

Definition at line 140 of file PFElecTkProducer.cc.

Referenced by applySelection(), and PFElecTkProducer().

◆ gsfInnerMomentumCache_

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

Definition at line 156 of file PFElecTkProducer.cc.

Referenced by produce(), and resolveGsfTracks().

◆ gsfTrackLabel_

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

Definition at line 110 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ maxPtConvReco_

double PFElecTkProducer::maxPtConvReco_
private

Definition at line 141 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer().

◆ modemomentum_

bool PFElecTkProducer::modemomentum_
private

Definition at line 131 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ mtsTransform_

MultiTrajectoryStateTransform PFElecTkProducer::mtsTransform_
private

Definition at line 126 of file PFElecTkProducer.cc.

Referenced by beginRun(), and produce().

◆ mvaConvBremFinderIDBarrelHighPt_

double PFElecTkProducer::mvaConvBremFinderIDBarrelHighPt_
private

Definition at line 147 of file PFElecTkProducer.cc.

Referenced by beginRun(), and PFElecTkProducer().

◆ mvaConvBremFinderIDBarrelLowPt_

double PFElecTkProducer::mvaConvBremFinderIDBarrelLowPt_
private

Definition at line 146 of file PFElecTkProducer.cc.

Referenced by beginRun(), and PFElecTkProducer().

◆ mvaConvBremFinderIDEndcapsHighPt_

double PFElecTkProducer::mvaConvBremFinderIDEndcapsHighPt_
private

Definition at line 149 of file PFElecTkProducer.cc.

Referenced by beginRun(), and PFElecTkProducer().

◆ mvaConvBremFinderIDEndcapsLowPt_

double PFElecTkProducer::mvaConvBremFinderIDEndcapsLowPt_
private

Definition at line 148 of file PFElecTkProducer.cc.

Referenced by beginRun(), and PFElecTkProducer().

◆ path_mvaWeightFileConvBremBarrelHighPt_

std::string PFElecTkProducer::path_mvaWeightFileConvBremBarrelHighPt_
private

Definition at line 151 of file PFElecTkProducer.cc.

◆ path_mvaWeightFileConvBremBarrelLowPt_

std::string PFElecTkProducer::path_mvaWeightFileConvBremBarrelLowPt_
private

Definition at line 150 of file PFElecTkProducer.cc.

◆ path_mvaWeightFileConvBremEndcapsHighPt_

std::string PFElecTkProducer::path_mvaWeightFileConvBremEndcapsHighPt_
private

Definition at line 153 of file PFElecTkProducer.cc.

◆ path_mvaWeightFileConvBremEndcapsLowPt_

std::string PFElecTkProducer::path_mvaWeightFileConvBremEndcapsLowPt_
private

Definition at line 152 of file PFElecTkProducer.cc.

◆ pfConv_

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

Definition at line 115 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ pfEcalClusters_

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

Definition at line 113 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ pfNuclear_

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

Definition at line 114 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ pftrack_

reco::GsfPFRecTrack PFElecTkProducer::pftrack_
private

Definition at line 107 of file PFElecTkProducer.cc.

Referenced by produce().

◆ pfTrackLabel_

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

Definition at line 111 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ pfTransformer_

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

PFTrackTransformer.

Definition at line 125 of file PFElecTkProducer.cc.

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

◆ pfV0_

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

Definition at line 116 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ primVtxLabel_

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

Definition at line 112 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ SCEne_

double PFElecTkProducer::SCEne_
private

Definition at line 138 of file PFElecTkProducer.cc.

Referenced by applySelection(), and PFElecTkProducer().

◆ secpftrack_

reco::GsfPFRecTrack PFElecTkProducer::secpftrack_
private

Definition at line 108 of file PFElecTkProducer.cc.

Referenced by produce().

◆ trajinev_

bool PFElecTkProducer::trajinev_
private

Trajectory of GSfTracks in the event?

Definition at line 130 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ useConvBremFinder_

bool PFElecTkProducer::useConvBremFinder_
private

Conv Brem Finder.

Definition at line 144 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer().

◆ useConversions_

bool PFElecTkProducer::useConversions_
private

Definition at line 118 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ useFifthStepForEcalDriven_

bool PFElecTkProducer::useFifthStepForEcalDriven_
private

Definition at line 134 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ useFifthStepForTrackDriven_

bool PFElecTkProducer::useFifthStepForTrackDriven_
private

Definition at line 135 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ useNuclear_

bool PFElecTkProducer::useNuclear_
private

Definition at line 117 of file PFElecTkProducer.cc.

Referenced by PFElecTkProducer(), and produce().

◆ useV0_

bool PFElecTkProducer::useV0_
private

Definition at line 119 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:127
reco::PFTrack::extrapolatedPoint
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
Definition: PFTrack.cc:58
neta
const int neta
Definition: CMTRawAnalyzer.h:423
PFElecTkProducer::debugGsfCleaning_
bool debugGsfCleaning_
Definition: PFElecTkProducer.cc:137
PFElecTkProducer::maxPtConvReco_
double maxPtConvReco_
Definition: PFElecTkProducer.cc:141
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
HLT_2018_cff.magneticField
magneticField
Definition: HLT_2018_cff.py:348
reco::SuperCluster
Definition: SuperCluster.h:18
PFElecTkProducer::useNuclear_
bool useNuclear_
Definition: PFElecTkProducer.cc:117
PFElecTkProducer::gsfInnerMomentumCache_
std::vector< double > gsfInnerMomentumCache_
Definition: PFElecTkProducer.cc:156
PFElecTkProducer::detaGsfSC_
double detaGsfSC_
Definition: PFElecTkProducer.cc:139
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:118
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:16
cms::cuda::assert
assert(be >=bs)
PFElecTkProducer::minTangDist
float minTangDist(const reco::GsfPFRecTrack &primGsf, const reco::GsfPFRecTrack &secGsf)
Definition: PFElecTkProducer.cc:800
TrajectorySeed::const_iterator
recHitContainer::const_iterator const_iterator
Definition: TrajectorySeed.h:20
PFElecTkProducer::useConvBremFinder_
bool useConvBremFinder_
Conv Brem Finder.
Definition: PFElecTkProducer.cc:144
PFElecTkProducer::isSameEgSC
bool isSameEgSC(const reco::ElectronSeed &nSeed, const reco::ElectronSeed &iSeed, bool &bothGsfEcalDriven, float &SCEnergy)
Definition: PFElecTkProducer.cc:843
PFElecTkProducer::applyAngularGsfClean_
bool applyAngularGsfClean_
Definition: PFElecTkProducer.cc:120
multiTrajectoryStateMode::momentumFromModeCartesian
bool momentumFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
Definition: MultiTrajectoryStateMode.cc:16
HLT_2018_cff.minDphi
minDphi
Definition: HLT_2018_cff.py:45977
PFElecTkProducer::applyGsfClean_
bool applyGsfClean_
Definition: PFElecTkProducer.cc:133
reco::GsfTrack::phiMode
double phiMode() const
azimuthal angle of momentum vector from mode
Definition: GsfTrack.h:55
PFElecTkProducer::isInnerMostWithLostHits
bool isInnerMostWithLostHits(const reco::GsfTrackRef &nGsfTrack, const reco::GsfTrackRef &iGsfTrack, bool &sameLayer)
Definition: PFElecTkProducer.cc:1084
edm::Handle
Definition: AssociativeIterator.h:50
PFElecTkProducer::trajinev_
bool trajinev_
Trajectory of GSfTracks in the event?
Definition: PFElecTkProducer.cc:130
PFElecTkProducer::pfTrackLabel_
edm::EDGetTokenT< reco::PFRecTrackCollection > pfTrackLabel_
Definition: PFElecTkProducer.cc:111
reco::Track::extra
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139
PFElecTkProducer::FindPfRef
int FindPfRef(const reco::PFRecTrackCollection &PfRTkColl, const reco::GsfTrack &, bool)
Definition: PFElecTkProducer.cc:459
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:864
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:560
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:78
reco::GsfPFRecTrack::gsfTrackRef
const reco::GsfTrackRef & gsfTrackRef() const
Definition: GsfPFRecTrack.h:34
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
PFTrackAlgoTools::isFifthStep
bool isFifthStep(const reco::TrackBase::TrackAlgorithm &)
Definition: PFTrackAlgoTools.cc:163
PFElecTkProducer::mvaConvBremFinderIDEndcapsHighPt_
double mvaConvBremFinderIDEndcapsHighPt_
Definition: PFElecTkProducer.cc:149
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:119
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
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:439
ConvBremPFTrackFinder
Definition: ConvBremPFTrackFinder.h:35
PFElecTkProducer::dphiGsfSC_
double dphiGsfSC_
Definition: PFElecTkProducer.cc:140
PFElecTkProducer::pftrack_
reco::GsfPFRecTrack pftrack_
Definition: PFElecTkProducer.cc:107
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:620
PFElecTkProducer::dphiCutGsfClean_
double dphiCutGsfClean_
Definition: PFElecTkProducer.cc:122
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:115
PFElecTkProducer::applySel_
bool applySel_
Definition: PFElecTkProducer.cc:132
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:134
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
reco::TrackBase::eta
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:623
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:99
iEvent
int iEvent
Definition: GenABIO.cc:224
PFElecTkProducer::mtsTransform_
MultiTrajectoryStateTransform mtsTransform_
Definition: PFElecTkProducer.cc:126
PFElecTkProducer::pfTransformer_
std::unique_ptr< PFTrackTransformer > pfTransformer_
PFTrackTransformer.
Definition: PFElecTkProducer.cc:125
TransientTrackBuilder
Definition: TransientTrackBuilder.h:16
convbremhelpers::HeavyObjectCache
Definition: ConvBremHeavyObjectCache.h:10
pfConversions_cfi.pfConversions
pfConversions
Definition: pfConversions_cfi.py:6
PFElecTkProducer::conf_
edm::ParameterSet conf_
Definition: PFElecTkProducer.cc:109
get
#define get
PFElecTkProducer::pfEcalClusters_
edm::EDGetTokenT< reco::PFClusterCollection > pfEcalClusters_
Definition: PFElecTkProducer.cc:113
reco::PFTrajectoryPoint::isValid
bool isValid() const
is this point valid ?
Definition: PFTrajectoryPoint.h:84
PFElecTkProducer::primVtxLabel_
edm::EDGetTokenT< reco::VertexCollection > primVtxLabel_
Definition: PFElecTkProducer.cc:112
reco::CaloCluster::position
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
MultiTrajectoryStateTransform
Definition: MultiTrajectoryStateTransform.h:18
reco::PFRecTrack::GSF
Definition: PFRecTrack.h:28
PFElecTkProducer::mvaConvBremFinderIDBarrelLowPt_
double mvaConvBremFinderIDBarrelLowPt_
Definition: PFElecTkProducer.cc:146
PFElecTkProducer::pfV0_
edm::EDGetTokenT< reco::PFV0Collection > pfV0_
Definition: PFElecTkProducer.cc:116
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
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:22
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:121
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
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
reco::PFCluster
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:46
TrajectorySeed::recHits
range recHits() const
Definition: TrajectorySeed.h:52
PFElecTkProducer::gsfTrackLabel_
edm::EDGetTokenT< reco::GsfTrackCollection > gsfTrackLabel_
Definition: PFElecTkProducer.cc:110
MultiTrajectoryStateTransform::innerStateOnSurface
TrajectoryStateOnSurface innerStateOnSurface(const reco::GsfTrack &tk) const
Definition: MultiTrajectoryStateTransform.cc:23
Pi
const double Pi
Definition: CosmicMuonParameters.h:18
reco::PFRecTrackCollection
std::vector< PFRecTrack > PFRecTrackCollection
collection of PFRecTrack objects
Definition: PFRecTrackFwd.h:9
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
PFElecTkProducer::mvaConvBremFinderIDEndcapsLowPt_
double mvaConvBremFinderIDEndcapsLowPt_
Definition: PFElecTkProducer.cc:148
genParticles_cff.map
map
Definition: genParticles_cff.py:11
PFElecTkProducer::useFifthStepForTrackDriven_
bool useFifthStepForTrackDriven_
Definition: PFElecTkProducer.cc:135
PFElecTkProducer::SCEne_
double SCEne_
Definition: PFElecTkProducer.cc:138
PFElecTkProducer::pfNuclear_
edm::EDGetTokenT< reco::PFDisplacedTrackerVertexCollection > pfNuclear_
Definition: PFElecTkProducer.cc:114
PFTrackTransformer
Definition: PFTrackTransformer.h:34
TrajectoryCollection
std::vector< Trajectory > TrajectoryCollection
Definition: TrajectoryToSeedMap.h:17
PFElecTkProducer::secpftrack_
reco::GsfPFRecTrack secpftrack_
Definition: PFElecTkProducer.cc:108
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:131
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
hit
Definition: SiStripHitEffFromCalibTree.cc:88
PFElecTkProducer::applySelection
bool applySelection(const reco::GsfTrack &)
Definition: PFElecTkProducer.cc:534
PFElecTkProducer::mvaConvBremFinderIDBarrelHighPt_
double mvaConvBremFinderIDBarrelHighPt_
Definition: PFElecTkProducer.cc:147
reco::ElectronSeed::caloCluster
const CaloClusterRef & caloCluster() const
Definition: ElectronSeed.h:94