CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
PFElecTkProducer Class Referencefinal

Abstract. More...

#include <PFElecTkProducer.h>

Inheritance diagram for PFElecTkProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PFElecTkProducer (const edm::ParameterSet &)
 Constructor. More...
 
 ~PFElecTkProducer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

bool applySelection (const reco::GsfTrack &)
 
virtual 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)
 
virtual void endRun (const edm::Run &, const edm::EventSetup &) override
 
int FindPfRef (const reco::PFRecTrackCollection &PfRTkColl, const reco::GsfTrack &, bool)
 
bool isFifthStep (reco::PFRecTrackRef pfKfTrack)
 
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)
 
virtual 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_
 
ConvBremPFTrackFinderconvBremFinder_
 
bool debugGsfCleaning_
 
double detaCutGsfClean_
 
double detaGsfSC_
 
double dphiCutGsfClean_
 
double dphiGsfSC_
 
edm::EDGetTokenT
< reco::GsfTrackCollection
gsfTrackLabel_
 
double maxPtConvReco_
 
bool modemomentum_
 
const MultiTrajectoryStateModemtsMode_
 
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::PFConversionCollection
pfConv_
 
edm::EDGetTokenT
< reco::PFClusterCollection
pfEcalClusters_
 
edm::EDGetTokenT
< reco::PFDisplacedTrackerVertexCollection
pfNuclear_
 
reco::GsfPFRecTrack pftrack_
 
edm::EDGetTokenT
< reco::PFRecTrackCollection
pfTrackLabel_
 
PFTrackTransformerpfTransformer_
 PFTrackTransformer. More...
 
edm::EDGetTokenT
< reco::PFV0Collection
pfV0_
 
edm::EDGetTokenT
< reco::VertexCollection
primVtxLabel_
 
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<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 44 of file PFElecTkProducer.h.

Constructor & Destructor Documentation

PFElecTkProducer::PFElecTkProducer ( const edm::ParameterSet iConfig)
explicit

Constructor.

Definition at line 40 of file PFElecTkProducer.cc.

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

40  :
41  conf_(iConfig),
42  pfTransformer_(0),
44 {
45 
46 
47  gsfTrackLabel_ = consumes<reco::GsfTrackCollection>(iConfig.getParameter<InputTag>
48  ("GsfTrackModuleLabel"));
49 
50  pfTrackLabel_ = consumes<reco::PFRecTrackCollection>(iConfig.getParameter<InputTag>
51  ("PFRecTrackLabel"));
52 
53  primVtxLabel_ = consumes<reco::VertexCollection>(iConfig.getParameter<InputTag>
54  ("PrimaryVertexLabel"));
55 
56  pfEcalClusters_ = consumes<reco::PFClusterCollection>(iConfig.getParameter<InputTag>
57  ("PFEcalClusters"));
58 
59  pfNuclear_ = consumes<reco::PFDisplacedTrackerVertexCollection>(iConfig.getParameter<InputTag>
60  ("PFNuclear"));
61 
62  pfConv_ = consumes<reco::PFConversionCollection>(iConfig.getParameter<InputTag>
63  ("PFConversions"));
64 
65  pfV0_ = consumes<reco::PFV0Collection>(iConfig.getParameter<InputTag>
66  ("PFV0"));
67 
68  useNuclear_ = iConfig.getParameter<bool>("useNuclear");
69  useConversions_ = iConfig.getParameter<bool>("useConversions");
70  useV0_ = iConfig.getParameter<bool>("useV0");
71  debugGsfCleaning_ = iConfig.getParameter<bool>("debugGsfCleaning");
72 
73  produces<GsfPFRecTrackCollection>();
74  produces<GsfPFRecTrackCollection>( "Secondary" ).setBranchAlias( "secondary" );
75 
76 
77  trajinev_ = iConfig.getParameter<bool>("TrajInEvents");
78  modemomentum_ = iConfig.getParameter<bool>("ModeMomentum");
79  applySel_ = iConfig.getParameter<bool>("applyEGSelection");
80  applyGsfClean_ = iConfig.getParameter<bool>("applyGsfTrackCleaning");
81  applyAngularGsfClean_ = iConfig.getParameter<bool>("applyAlsoGsfAngularCleaning");
82  detaCutGsfClean_ = iConfig.getParameter<double>("maxDEtaGsfAngularCleaning");
83  dphiCutGsfClean_ = iConfig.getParameter<double>("maxDPhiBremTangGsfAngularCleaning");
84  useFifthStepForTrackDriven_ = iConfig.getParameter<bool>("useFifthStepForTrackerDrivenGsf");
85  useFifthStepForEcalDriven_ = iConfig.getParameter<bool>("useFifthStepForEcalDrivenGsf");
86  maxPtConvReco_ = iConfig.getParameter<double>("MaxConvBremRecoPT");
87  detaGsfSC_ = iConfig.getParameter<double>("MinDEtaGsfSC");
88  dphiGsfSC_ = iConfig.getParameter<double>("MinDPhiGsfSC");
89  SCEne_ = iConfig.getParameter<double>("MinSCEnergy");
90 
91  // set parameter for convBremFinder
92  useConvBremFinder_ = iConfig.getParameter<bool>("useConvBremFinder");
93 
94  mvaConvBremFinderIDBarrelLowPt_ = iConfig.getParameter<double>("pf_convBremFinderID_mvaCutBarrelLowPt");
95  mvaConvBremFinderIDBarrelHighPt_ = iConfig.getParameter<double>("pf_convBremFinderID_mvaCutBarrelHighPt");
96  mvaConvBremFinderIDEndcapsLowPt_ = iConfig.getParameter<double>("pf_convBremFinderID_mvaCutEndcapsLowPt");
97  mvaConvBremFinderIDEndcapsHighPt_ = iConfig.getParameter<double>("pf_convBremFinderID_mvaCutEndcapsHighPt");
98 
99  string mvaWeightFileConvBremBarrelLowPt = iConfig.getParameter<string>("pf_convBremFinderID_mvaWeightFileBarrelLowPt");
100  string mvaWeightFileConvBremBarrelHighPt = iConfig.getParameter<string>("pf_convBremFinderID_mvaWeightFileBarrelHighPt");
101  string mvaWeightFileConvBremEndcapsLowPt = iConfig.getParameter<string>("pf_convBremFinderID_mvaWeightFileEndcapsLowPt");
102  string mvaWeightFileConvBremEndcapsHighPt = iConfig.getParameter<string>("pf_convBremFinderID_mvaWeightFileEndcapsHighPt");
103 
104  if(useConvBremFinder_) {
105  path_mvaWeightFileConvBremBarrelLowPt_ = edm::FileInPath ( mvaWeightFileConvBremBarrelLowPt.c_str() ).fullPath();
106  path_mvaWeightFileConvBremBarrelHighPt_ = edm::FileInPath ( mvaWeightFileConvBremBarrelHighPt.c_str() ).fullPath();
107  path_mvaWeightFileConvBremEndcapsLowPt_ = edm::FileInPath ( mvaWeightFileConvBremEndcapsLowPt.c_str() ).fullPath();
108  path_mvaWeightFileConvBremEndcapsHighPt_ = edm::FileInPath ( mvaWeightFileConvBremEndcapsHighPt.c_str() ).fullPath();
109  }
110 }
bool trajinev_
Trajectory of GSfTracks in the event?
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::PFRecTrackCollection > pfTrackLabel_
edm::EDGetTokenT< reco::GsfTrackCollection > gsfTrackLabel_
double mvaConvBremFinderIDEndcapsLowPt_
std::string path_mvaWeightFileConvBremEndcapsLowPt_
ConvBremPFTrackFinder * convBremFinder_
edm::EDGetTokenT< reco::VertexCollection > primVtxLabel_
std::string path_mvaWeightFileConvBremBarrelHighPt_
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
double mvaConvBremFinderIDBarrelLowPt_
edm::EDGetTokenT< reco::PFV0Collection > pfV0_
std::string path_mvaWeightFileConvBremEndcapsHighPt_
edm::EDGetTokenT< reco::PFDisplacedTrackerVertexCollection > pfNuclear_
std::string path_mvaWeightFileConvBremBarrelLowPt_
double mvaConvBremFinderIDBarrelHighPt_
double mvaConvBremFinderIDEndcapsHighPt_
edm::EDGetTokenT< reco::PFConversionCollection > pfConv_
bool useConvBremFinder_
Conv Brem Finder.
edm::ParameterSet conf_
edm::EDGetTokenT< reco::PFClusterCollection > pfEcalClusters_
PFElecTkProducer::~PFElecTkProducer ( )

Destructor.

Definition at line 113 of file PFElecTkProducer.cc.

References convBremFinder_, and pfTransformer_.

114 {
115 
116  delete pfTransformer_;
117  delete convBremFinder_;
118 }
ConvBremPFTrackFinder * convBremFinder_
PFTrackTransformer * pfTransformer_
PFTrackTransformer.

Member Function Documentation

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

Definition at line 532 of file PFElecTkProducer.cc.

References compareJSON::const, detaGsfSC_, dphiGsfSC_, reco::GsfTrack::etaMode(), reco::Track::extra(), reco::GsfTrack::phiMode(), Pi, SCEne_, reco::Track::seedRef(), and TwoPi.

Referenced by produce().

532  {
533  if (&(*gsftk.seedRef())==0) return false;
534  auto const& ElSeedFromRef=dynamic_cast<ElectronSeed const&>( *(gsftk.extra()->seedRef()) );
535 
536  bool passCut = false;
537  if (ElSeedFromRef.ctfTrack().isNull()){
538  if(ElSeedFromRef.caloCluster().isNull()) return passCut;
539  auto const* scRef = dynamic_cast<SuperCluster const*>(ElSeedFromRef.caloCluster().get());
540  //do this just to know if exist a SC?
541  if(scRef) {
542  float caloEne = scRef->energy();
543  float feta = fabs(scRef->eta()-gsftk.etaMode());
544  float fphi = fabs(scRef->phi()-gsftk.phiMode());
545  if (fphi>TMath::Pi()) fphi-= TMath::TwoPi();
546  if(caloEne > SCEne_ && feta < detaGsfSC_ && fabs(fphi) < dphiGsfSC_)
547  passCut = true;
548  }
549  }
550  else {
551  // get all the gsf found by tracker driven
552  passCut = true;
553  }
554  return passCut;
555 }
const double TwoPi
const double Pi
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:189
edm::RefToBase< TrajectorySeed > seedRef() const
Definition: Track.h:213
string const
Definition: compareJSON.py:14
double etaMode() const
pseudorapidity of momentum vector from mode
Definition: GsfTrack.h:59
double phiMode() const
azimuthal angle of momentum vector from mode
Definition: GsfTrack.h:57
void PFElecTkProducer::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 1156 of file PFElecTkProducer.cc.

References convBremFinder_, edm::EventSetup::get(), getDQMSummary::iter, HLT_25ns14e33_v1_cff::magneticField, mtsTransform_, mvaConvBremFinderIDBarrelHighPt_, mvaConvBremFinderIDBarrelLowPt_, mvaConvBremFinderIDEndcapsHighPt_, mvaConvBremFinderIDEndcapsLowPt_, path_mvaWeightFileConvBremBarrelHighPt_, path_mvaWeightFileConvBremBarrelLowPt_, path_mvaWeightFileConvBremEndcapsHighPt_, path_mvaWeightFileConvBremEndcapsLowPt_, pfTransformer_, edm::ESHandle< class >::product(), patCandidatesForDimuonsSequences_cff::tracker, and useConvBremFinder_.

1158 {
1160  iSetup.get<IdealMagneticFieldRecord>().get(magneticField);
1161 
1163  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
1164 
1165 
1166  mtsTransform_ = MultiTrajectoryStateTransform(tracker.product(),magneticField.product());
1167 
1168 
1169  pfTransformer_= new PFTrackTransformer(math::XYZVector(magneticField->inTesla(GlobalPoint(0,0,0))));
1170 
1171 
1173  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", builder);
1174  TransientTrackBuilder thebuilder = *(builder.product());
1175 
1176 
1177  if(useConvBremFinder_) {
1178  vector <TString> weightfiles;
1179  weightfiles.push_back(path_mvaWeightFileConvBremBarrelLowPt_.c_str());
1180  weightfiles.push_back(path_mvaWeightFileConvBremBarrelHighPt_.c_str());
1181  weightfiles.push_back(path_mvaWeightFileConvBremEndcapsLowPt_.c_str());
1182  weightfiles.push_back(path_mvaWeightFileConvBremEndcapsHighPt_.c_str());
1183  for(uint iter = 0;iter<weightfiles.size();iter++){
1184  FILE * fileConvBremID = fopen(weightfiles[iter],"r");
1185  if (fileConvBremID) {
1186  fclose(fileConvBremID);
1187  }
1188  else {
1189  string err = "PFElecTkProducer: cannot open weight file '";
1190  err += weightfiles[iter];
1191  err += "'";
1192  throw invalid_argument( err );
1193  }
1194  }
1195 
1196  }
1197  convBremFinder_ = new ConvBremPFTrackFinder(thebuilder,
1206 
1207 }
double mvaConvBremFinderIDEndcapsLowPt_
std::string path_mvaWeightFileConvBremEndcapsLowPt_
ConvBremPFTrackFinder * convBremFinder_
std::string path_mvaWeightFileConvBremBarrelHighPt_
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
double mvaConvBremFinderIDBarrelLowPt_
std::string path_mvaWeightFileConvBremEndcapsHighPt_
std::string path_mvaWeightFileConvBremBarrelLowPt_
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
double mvaConvBremFinderIDBarrelHighPt_
double mvaConvBremFinderIDEndcapsHighPt_
bool useConvBremFinder_
Conv Brem Finder.
MultiTrajectoryStateTransform mtsTransform_
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 389 of file PFElecTkProducer.cc.

References python.multivaluedict::map().

Referenced by produce().

391  {
392  unsigned int cgsf=0;
393  unsigned int csecgsf=0;
394  for (std::map<unsigned int, std::vector<reco::GsfPFRecTrack> >::const_iterator igsf = MapPrimSec.begin();
395  igsf != MapPrimSec.end(); igsf++,cgsf++) {
396  vector<reco::GsfPFRecTrack> SecGsfPF = igsf->second;
397  for (unsigned int iSecGsf=0; iSecGsf < SecGsfPF.size(); iSecGsf++) {
398  edm::Ref<reco::GsfPFRecTrackCollection> refgprt(gsfPfHandle,csecgsf);
399  gsfPFRecTrackPrimary[cgsf].addConvBremGsfPFRecTrackRef(refgprt);
400  ++csecgsf;
401  }
402  }
403 
404  return;
405 }
void PFElecTkProducer::endRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 1211 of file PFElecTkProducer.cc.

References convBremFinder_, and pfTransformer_.

1212  {
1213  delete pfTransformer_;
1214  pfTransformer_=nullptr;
1215  delete convBremFinder_;
1216  convBremFinder_=nullptr;
1217 }
ConvBremPFTrackFinder * convBremFinder_
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
int PFElecTkProducer::FindPfRef ( const reco::PFRecTrackCollection PfRTkColl,
const reco::GsfTrack gsftk,
bool  otherColl 
)
private

Definition at line 408 of file PFElecTkProducer.cc.

References TrackingRecHit::all, compareJSON::const, reco::TrackBase::eta(), reco::Track::extra(), reco::TrackBase::phi(), Pi, TrajectorySeed::recHits(), reco::Track::seedRef(), mathSSE::sqrt(), and TwoPi.

Referenced by produce().

410  {
411 
412 
413  if (&(*gsftk.seedRef())==0) return -1;
414  auto const & ElSeedFromRef=dynamic_cast<ElectronSeed const&>( *(gsftk.extra()->seedRef()) );
415  //CASE 1 ELECTRONSEED DOES NOT HAVE A REF TO THE CKFTRACK
416  if (ElSeedFromRef.ctfTrack().isNull()){
417  reco::PFRecTrackCollection::const_iterator pft=PfRTkColl.begin();
418  reco::PFRecTrackCollection::const_iterator pftend=PfRTkColl.end();
419  unsigned int i_pf=0;
420  int ibest=-1;
421  unsigned int ish_max=0;
422  float dr_min=1000;
423  //SEARCH THE PFRECTRACK THAT SHARES HITS WITH THE ELECTRON SEED
424  // Here the cpu time can be improved.
425  for(;pft!=pftend;++pft){
426  unsigned int ish=0;
427 
428  float dph= fabs(pft->trackRef()->phi()-gsftk.phi());
429  if (dph>TMath::Pi()) dph-= TMath::TwoPi();
430  float det=fabs(pft->trackRef()->eta()-gsftk.eta());
431  float dr =sqrt(dph*dph+det*det);
432 
434  pft->trackRef()->recHitsBegin();
435  trackingRecHit_iterator hhit_end=
436  pft->trackRef()->recHitsEnd();
437 
438 
439 
440  for(;hhit!=hhit_end;++hhit){
441  if (!(*hhit)->isValid()) continue;
443  gsftk.seedRef()->recHits().first;
445  gsftk.seedRef()->recHits().second;
446  for(;hit!=hit_end;++hit){
447  if (!(hit->isValid())) continue;
448  if((*hhit)->sharesInput(&*(hit),TrackingRecHit::all)) ish++;
449  // if((hit->geographicalId()==(*hhit)->geographicalId())&&
450  // (((*hhit)->localPosition()-hit->localPosition()).mag()<0.01)) ish++;
451  }
452 
453  }
454 
455 
456  if ((ish>ish_max)||
457  ((ish==ish_max)&&(dr<dr_min))){
458  ish_max=ish;
459  dr_min=dr;
460  ibest=i_pf;
461  }
462 
463 
464 
465  i_pf++;
466  }
467  if (ibest<0) return -1;
468 
469  if((ish_max==0) || (dr_min>0.05))return -1;
470  if(otherColl && (ish_max==0)) return -1;
471  return ibest;
472  }
473  else{
474  //ELECTRON SEED HAS A REFERENCE
475 
476  reco::PFRecTrackCollection::const_iterator pft=PfRTkColl.begin();
477  reco::PFRecTrackCollection::const_iterator pftend=PfRTkColl.end();
478  unsigned int i_pf=0;
479 
480  for(;pft!=pftend;++pft){
481  //REF COMPARISON
482  if (pft->trackRef()==ElSeedFromRef.ctfTrack()){
483  return i_pf;
484  }
485  i_pf++;
486  }
487  }
488  return -1;
489 }
const double TwoPi
const double Pi
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:189
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:693
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:699
recHitContainer::const_iterator const_iterator
T sqrt(T t)
Definition: SSEVec.h:48
edm::RefToBase< TrajectorySeed > seedRef() const
Definition: Track.h:213
range recHits() const
string const
Definition: compareJSON.py:14
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
bool PFElecTkProducer::isFifthStep ( reco::PFRecTrackRef  pfKfTrack)
private

Definition at line 490 of file PFElecTkProducer.cc.

References DetachedTripletStep_cff::detachedTripletStep, InitialStep_cff::initialStep, LowPU_MixedTripletStep_cff::mixedTripletStep, and PixelLessStep_cff::pixelLessStep.

Referenced by produce().

490  {
491 
492  bool isFithStep = false;
493 
494 
495  TrackRef kfref = pfKfTrack->trackRef();
496  unsigned int Algo = 0;
497  switch (kfref->algo()) {
498  case TrackBase::undefAlgorithm:
499  case TrackBase::ctf:
501  case TrackBase::lowPtTripletStep:
502  case TrackBase::pixelPairStep:
503  case TrackBase::jetCoreRegionalStep:
504  case TrackBase::muonSeededStepInOut:
505  case TrackBase::muonSeededStepOutIn:
506  Algo = 0;
507  break;
509  Algo = 1;
510  break;
512  Algo = 2;
513  break;
515  Algo = 3;
516  break;
517  case TrackBase::tobTecStep:
518  Algo = 4;
519  break;
520  default:
521  Algo = 5;
522  break;
523  }
524  if ( Algo >= 4 ) {
525  isFithStep = true;
526  }
527 
528  return isFithStep;
529 }
Definition: fakeMenu.h:6
bool PFElecTkProducer::isInnerMost ( const reco::GsfTrackRef nGsfTrack,
const reco::GsfTrackRef iGsfTrack,
bool &  sameLayer 
)
private

Definition at line 1090 of file PFElecTkProducer.cc.

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

1092  {
1093 
1094  // copied by the class RecoEgamma/EgammaElectronAlgos/src/EgAmbiguityTools.cc
1095  // obsolete but the code is kept: now using lost hits method
1096 
1097  const reco::HitPattern &gsfHitPattern1 = nGsfTrack->hitPattern();
1098  const reco::HitPattern &gsfHitPattern2 = iGsfTrack->hitPattern();
1099 
1100  // retrieve first valid hit
1101  int gsfHitCounter1 = 0 ;
1102  trackingRecHit_iterator elHitsIt1 ;
1103  for
1104  ( elHitsIt1 = nGsfTrack->recHitsBegin() ;
1105  elHitsIt1 != nGsfTrack->recHitsEnd() ;
1106  elHitsIt1++, gsfHitCounter1++ )
1107  { if (((**elHitsIt1).isValid())) break ; }
1108 
1109  int gsfHitCounter2 = 0 ;
1110  trackingRecHit_iterator elHitsIt2 ;
1111  for
1112  ( elHitsIt2 = iGsfTrack->recHitsBegin() ;
1113  elHitsIt2 != iGsfTrack->recHitsEnd() ;
1114  elHitsIt2++, gsfHitCounter2++ )
1115  { if (((**elHitsIt2).isValid())) break ; }
1116 
1117  uint32_t gsfHit1 = gsfHitPattern1.getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter1) ;
1118  uint32_t gsfHit2 = gsfHitPattern2.getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter2) ;
1119 
1120 
1121  if (gsfHitPattern1.getSubStructure(gsfHit1)!=gsfHitPattern2.getSubStructure(gsfHit2))
1122  {
1123  return (gsfHitPattern2.getSubStructure(gsfHit2)<gsfHitPattern1.getSubStructure(gsfHit1));
1124  }
1125  else if (gsfHitPattern1.getLayer(gsfHit1)!=gsfHitPattern2.getLayer(gsfHit2))
1126  {
1127  return (gsfHitPattern2.getLayer(gsfHit2)<gsfHitPattern1.getLayer(gsfHit1));
1128  }
1129  else
1130  {
1131  sameLayer = true;
1132  return false;
1133  }
1134 }
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:624
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:615
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:456
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
bool PFElecTkProducer::isInnerMostWithLostHits ( const reco::GsfTrackRef nGsfTrack,
const reco::GsfTrackRef iGsfTrack,
bool &  sameLayer 
)
private

Definition at line 1135 of file PFElecTkProducer.cc.

Referenced by resolveGsfTracks().

1137  {
1138 
1139  // define closest using the lost hits on the expectedhitsineer
1140  unsigned int nLostHits = nGsfTrack->hitPattern().numberOfLostHits(HitPattern::MISSING_INNER_HITS);
1141  unsigned int iLostHits = iGsfTrack->hitPattern().numberOfLostHits(HitPattern::MISSING_INNER_HITS);
1142 
1143  if (nLostHits!=iLostHits) {
1144  return (nLostHits > iLostHits);
1145  }
1146  else {
1147  sameLayer = true;
1148  return false;
1149  }
1150 }
bool PFElecTkProducer::isSameEgSC ( const reco::ElectronSeed nSeed,
const reco::ElectronSeed iSeed,
bool &  bothGsfEcalDriven,
float &  SCEnergy 
)
private

Definition at line 871 of file PFElecTkProducer.cc.

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

Referenced by resolveGsfTracks().

874  {
875 
876  bool isSameSC = false;
877 
878  if(nSeed.caloCluster().isNonnull() && iSeed.caloCluster().isNonnull()) {
879  auto const* nscRef = dynamic_cast<SuperCluster const*>(nSeed.caloCluster().get());
880  auto const* iscRef = dynamic_cast<SuperCluster const*>(iSeed.caloCluster().get());
881 
882  if(nscRef && iscRef) {
883  bothGsfEcalDriven = true;
884  if(nscRef == iscRef) {
885  isSameSC = true;
886  // retrieve the supercluster energy
887  SCEnergy = nscRef->energy();
888  }
889  }
890  }
891  return isSameSC;
892 }
value_type const * get() const
Definition: RefToBase.h:212
bool isNonnull() const
Checks for non-null.
Definition: RefToBase.h:279
CaloClusterRef caloCluster() const
Definition: ElectronSeed.h:70
string const
Definition: compareJSON.py:14
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 894 of file PFElecTkProducer.cc.

References assert(), reco::PFCluster::calculatePositionREP(), reco::ElectronSeed::caloCluster(), compareJSON::const, 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(), reco::GsfPFRecTrack::PFRecBrem(), Pi, reco::CaloCluster::position(), LinkByRecHit::testTrackAndClusterByRecHit(), and TwoPi.

Referenced by resolveGsfTracks().

903  {
904 
905  bool isSharingEnergy = false;
906 
907  //which is EcalDriven?
908  bool oneEcalDriven = true;
909  SuperCluster const* scRef = nullptr;
910  GsfPFRecTrack gsfPfTrack;
911 
912  if(nSeed.caloCluster().isNonnull()) {
913  scRef = dynamic_cast<SuperCluster const*>(nSeed.caloCluster().get());
914  assert(scRef);
915  nEnergy = scRef->energy();
916  nEcalDriven = true;
917  gsfPfTrack = iGsfPFRecTrack;
918  }
919  else if(iSeed.caloCluster().isNonnull()){
920  scRef = dynamic_cast<SuperCluster const*>(iSeed.caloCluster().get());
921  assert(scRef);
922  iEnergy = scRef->energy();
923  iEcalDriven = true;
924  gsfPfTrack = nGsfPFRecTrack;
925  }
926  else{
927  oneEcalDriven = false;
928  }
929 
930  if(oneEcalDriven) {
931  //run a basic reconstruction for the particle flow
932 
933  vector<PFCluster> vecPFClusters;
934  vecPFClusters.clear();
935 
936  for (PFClusterCollection::const_iterator clus = theEClus.begin();
937  clus != theEClus.end();
938  clus++ ) {
939  PFCluster clust = *clus;
940  clust.calculatePositionREP();
941 
942  float deta = fabs(scRef->position().eta() - clust.position().eta());
943  float dphi = fabs(scRef->position().phi() - clust.position().phi());
944  if (dphi>TMath::Pi()) dphi-= TMath::TwoPi();
945 
946  // Angle preselection between the supercluster and pfclusters
947  // this is needed just to save some cpu-time for this is hard-coded
948  if(deta < 0.5 && fabs(dphi) < 1.0) {
949  bool foundLink = false;
950  double distGsf = gsfPfTrack.extrapolatedPoint( reco::PFTrajectoryPoint::ECALShowerMax ).isValid() ?
951  LinkByRecHit::testTrackAndClusterByRecHit(gsfPfTrack , clust ) : -1.;
952  // check if it touch the GsfTrack
953  if(distGsf > 0.) {
954  if(nEcalDriven)
955  iEnergy += clust.energy();
956  else
957  nEnergy += clust.energy();
958  vecPFClusters.push_back(clust);
959  foundLink = true;
960  }
961  // check if it touch the Brem-tangents
962  if(foundLink == false) {
963  vector<PFBrem> primPFBrem = gsfPfTrack.PFRecBrem();
964  for(unsigned ipbrem = 0; ipbrem < primPFBrem.size(); ipbrem++) {
965  if(primPFBrem[ipbrem].indTrajPoint() == 99) continue;
966  const reco::PFRecTrack& pfBremTrack = primPFBrem[ipbrem];
967  double dist = pfBremTrack.extrapolatedPoint( reco::PFTrajectoryPoint::ECALShowerMax ).isValid() ?
968  LinkByRecHit::testTrackAndClusterByRecHit(pfBremTrack , clust, true ) : -1.;
969  if(dist > 0.) {
970  if(nEcalDriven)
971  iEnergy += clust.energy();
972  else
973  nEnergy += clust.energy();
974  vecPFClusters.push_back(clust);
975  foundLink = true;
976  }
977  }
978  }
979  } // END if anble preselection
980  } // PFClusters Loop
981  if(vecPFClusters.size() > 0 ) {
982  for(unsigned int pf = 0; pf < vecPFClusters.size(); pf++) {
983  bool isCommon = ClusterClusterMapping::overlap(vecPFClusters[pf],*scRef);
984  if(isCommon) {
985  isSharingEnergy = true;
986  }
987  break;
988  }
989  }
990  }
991  else {
992  // both tracks are trackerDriven, try ECAL energy matching also in this case.
993 
994  bothGsfTrackerDriven = true;
995  vector<PFCluster> nPFCluster;
996  vector<PFCluster> iPFCluster;
997 
998  nPFCluster.clear();
999  iPFCluster.clear();
1000 
1001  for (PFClusterCollection::const_iterator clus = theEClus.begin();
1002  clus != theEClus.end();
1003  clus++ ) {
1004  PFCluster clust = *clus;
1005  clust.calculatePositionREP();
1006 
1007  float ndeta = fabs(nGsfPFRecTrack.gsfTrackRef()->eta() - clust.position().eta());
1008  float ndphi = fabs(nGsfPFRecTrack.gsfTrackRef()->phi() - clust.position().phi());
1009  if (ndphi>TMath::Pi()) ndphi-= TMath::TwoPi();
1010  // Apply loose preselection with the track
1011  // just to save cpu time, for this hard-coded
1012  if(ndeta < 0.5 && fabs(ndphi) < 1.0) {
1013  bool foundNLink = false;
1014 
1015  double distGsf = nGsfPFRecTrack.extrapolatedPoint( reco::PFTrajectoryPoint::ECALShowerMax ).isValid() ?
1016  LinkByRecHit::testTrackAndClusterByRecHit(nGsfPFRecTrack , clust ) : -1.;
1017  if(distGsf > 0.) {
1018  nPFCluster.push_back(clust);
1019  nEnergy += clust.energy();
1020  foundNLink = true;
1021  }
1022  if(foundNLink == false) {
1023  const vector<PFBrem>& primPFBrem = nGsfPFRecTrack.PFRecBrem();
1024  for(unsigned ipbrem = 0; ipbrem < primPFBrem.size(); ipbrem++) {
1025  if(primPFBrem[ipbrem].indTrajPoint() == 99) continue;
1026  const reco::PFRecTrack& pfBremTrack = primPFBrem[ipbrem];
1027  if(foundNLink == false) {
1028  double dist = pfBremTrack.extrapolatedPoint( reco::PFTrajectoryPoint::ECALShowerMax ).isValid() ?
1029  LinkByRecHit::testTrackAndClusterByRecHit(pfBremTrack , clust, true ) : -1.;
1030  if(dist > 0.) {
1031  nPFCluster.push_back(clust);
1032  nEnergy += clust.energy();
1033  foundNLink = true;
1034  }
1035  }
1036  }
1037  }
1038  }
1039 
1040  float ideta = fabs(iGsfPFRecTrack.gsfTrackRef()->eta() - clust.position().eta());
1041  float idphi = fabs(iGsfPFRecTrack.gsfTrackRef()->phi() - clust.position().phi());
1042  if (idphi>TMath::Pi()) idphi-= TMath::TwoPi();
1043  // Apply loose preselection with the track
1044  // just to save cpu time, for this hard-coded
1045  if(ideta < 0.5 && fabs(idphi) < 1.0) {
1046  bool foundILink = false;
1047  double dist = iGsfPFRecTrack.extrapolatedPoint( reco::PFTrajectoryPoint::ECALShowerMax ).isValid() ?
1048  LinkByRecHit::testTrackAndClusterByRecHit(iGsfPFRecTrack , clust ) : -1.;
1049  if(dist > 0.) {
1050  iPFCluster.push_back(clust);
1051  iEnergy += clust.energy();
1052  foundILink = true;
1053  }
1054  if(foundILink == false) {
1055  vector<PFBrem> primPFBrem = iGsfPFRecTrack.PFRecBrem();
1056  for(unsigned ipbrem = 0; ipbrem < primPFBrem.size(); ipbrem++) {
1057  if(primPFBrem[ipbrem].indTrajPoint() == 99) continue;
1058  const reco::PFRecTrack& pfBremTrack = primPFBrem[ipbrem];
1059  if(foundILink == false) {
1060  double dist = LinkByRecHit::testTrackAndClusterByRecHit(pfBremTrack , clust, true );
1061  if(dist > 0.) {
1062  iPFCluster.push_back(clust);
1063  iEnergy += clust.energy();
1064  foundILink = true;
1065  }
1066  }
1067  }
1068  }
1069  }
1070  }
1071 
1072 
1073  if(nPFCluster.size() > 0 && iPFCluster.size() > 0) {
1074  for(unsigned int npf = 0; npf < nPFCluster.size(); npf++) {
1075  for(unsigned int ipf = 0; ipf < iPFCluster.size(); ipf++) {
1076  bool isCommon = ClusterClusterMapping::overlap(nPFCluster[npf],iPFCluster[ipf]);
1077  if(isCommon) {
1078  isSharingEnergy = true;
1079  break;
1080  }
1081  }
1082  if(isSharingEnergy)
1083  break;
1084  }
1085  }
1086  }
1087 
1088  return isSharingEnergy;
1089 }
const double TwoPi
const double Pi
value_type const * get() const
Definition: RefToBase.h:212
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:126
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:22
static bool overlap(const reco::CaloCluster &sc1, const reco::CaloCluster &sc, float minfrac=0.01, bool debug=false)
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:47
assert(m_qm.get())
const std::vector< reco::PFBrem > & PFRecBrem() const
Definition: GsfPFRecTrack.h:51
bool isNonnull() const
Checks for non-null.
Definition: RefToBase.h:279
CaloClusterRef caloCluster() const
Definition: ElectronSeed.h:70
void calculatePositionREP()
computes posrep_ once and for all
Definition: PFCluster.h:96
const reco::GsfTrackRef & gsfTrackRef() const
Definition: GsfPFRecTrack.h:39
double energy() const
cluster energy
Definition: CaloCluster.h:121
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
Definition: PFTrack.cc:76
double energy() const
cluster energy
Definition: PFCluster.h:82
bool isValid() const
is this point valid ?
string const
Definition: compareJSON.py:14
static double testTrackAndClusterByRecHit(const reco::PFRecTrack &track, const reco::PFCluster &cluster, bool isBrem=false, bool debug=false)
Definition: LinkByRecHit.cc:10
float PFElecTkProducer::minTangDist ( const reco::GsfPFRecTrack primGsf,
const reco::GsfPFRecTrack secGsf 
)
private

Definition at line 827 of file PFElecTkProducer.cc.

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

Referenced by resolveGsfTracks().

828  {
829 
830  float minDphi = 1000.;
831 
832 
833  std::vector<reco::PFBrem> primPFBrem = primGsf.PFRecBrem();
834  std::vector<reco::PFBrem> secPFBrem = secGsf.PFRecBrem();
835 
836 
837  unsigned int cbrem = 0;
838  for (unsigned isbrem = 0; isbrem < secPFBrem.size(); isbrem++) {
839  if(secPFBrem[isbrem].indTrajPoint() == 99) continue;
840  const reco::PFTrajectoryPoint& atSecECAL
841  = secPFBrem[isbrem].extrapolatedPoint( reco::PFTrajectoryPoint::ECALEntrance );
842  if( ! atSecECAL.isValid() ) continue;
843  float secPhi = atSecECAL.positionREP().Phi();
844 
845  unsigned int sbrem = 0;
846  for(unsigned ipbrem = 0; ipbrem < primPFBrem.size(); ipbrem++) {
847  if(primPFBrem[ipbrem].indTrajPoint() == 99) continue;
848  const reco::PFTrajectoryPoint& atPrimECAL
849  = primPFBrem[ipbrem].extrapolatedPoint( reco::PFTrajectoryPoint::ECALEntrance );
850  if( ! atPrimECAL.isValid() ) continue;
851  sbrem++;
852  if(sbrem <= 3) {
853  float primPhi = atPrimECAL.positionREP().Phi();
854 
855  float dphi = fabs(primPhi - secPhi);
856  if (dphi>TMath::Pi()) dphi-= TMath::TwoPi();
857  if(fabs(dphi) < minDphi) {
858  minDphi = fabs(dphi);
859  }
860  }
861  }
862 
863 
864  cbrem++;
865  if(cbrem == 3)
866  break;
867  }
868  return minDphi;
869 }
const REPPoint & positionREP() const
trajectory position in (rho, eta, phi) base
const double TwoPi
const double Pi
const std::vector< reco::PFBrem > & PFRecBrem() const
Definition: GsfPFRecTrack.h:51
bool isValid() const
is this point valid ?
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
void PFElecTkProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Produce the PFRecTrack collection.

Implements edm::stream::EDProducerBase.

Definition at line 127 of file PFElecTkProducer.cc.

References PFTrackTransformer::addPointsAndBrems(), applyGsfClean_, applySel_, applySelection(), compareJSON::const, convBremFinder_, createGsfPFRecTrackRef(), FindPfRef(), ConvBremPFTrackFinder::foundConvBremPFRecTrack(), edm::Event::getByToken(), ConvBremPFTrackFinder::getConvBremPFRecTracks(), reco::PFRecTrack::GSF, gsfTrackLabel_, cuy::ii, isFifthStep(), edm::Ref< C, T, F >::isNonnull(), modemomentum_, mtsTransform_, pfConv_, pfConversions_cfi::pfConversions, pfEcalClusters_, pfNuclear_, pftrack_, pfTrackLabel_, pfTransformer_, pfV0_cfi::pfV0, pfV0_, primVtxLabel_, edm::Handle< T >::product(), edm::Event::put(), resolveGsfTracks(), secpftrack_, trajinev_, useConversions_, useFifthStepForEcalDriven_, useFifthStepForTrackDriven_, useNuclear_, and useV0_.

128 {
129 
130 
131  //create the empty collections
132  auto_ptr< GsfPFRecTrackCollection >
133  gsfPFRecTrackCollection(new GsfPFRecTrackCollection);
134 
135 
136  auto_ptr< GsfPFRecTrackCollection >
137  gsfPFRecTrackCollectionSecondary(new GsfPFRecTrackCollection);
138 
139  //read collections of tracks
140  Handle<GsfTrackCollection> gsftrackscoll;
141  iEvent.getByToken(gsfTrackLabel_,gsftrackscoll);
142 
143  //read collections of trajectories
145 
146  //read pfrectrack collection
147  Handle<PFRecTrackCollection> thePfRecTrackCollection;
148  iEvent.getByToken(pfTrackLabel_,thePfRecTrackCollection);
149  const PFRecTrackCollection& PfRTkColl = *(thePfRecTrackCollection.product());
150 
151  // PFClusters
152  Handle<PFClusterCollection> theECPfClustCollection;
153  iEvent.getByToken(pfEcalClusters_,theECPfClustCollection);
154  const PFClusterCollection& theEcalClusters = *(theECPfClustCollection.product());
155 
156  //Primary Vertexes
157  Handle<reco::VertexCollection> thePrimaryVertexColl;
158  iEvent.getByToken(primVtxLabel_,thePrimaryVertexColl);
159 
160 
161 
162  // Displaced Vertex
164  if( useNuclear_ )
165  iEvent.getByToken(pfNuclear_, pfNuclears);
166 
167 
168 
169  // Conversions
171  if( useConversions_ )
172  iEvent.getByToken(pfConv_,pfConversions);
173 
174  // V0
176  if( useV0_ )
177  iEvent.getByToken(pfV0_, pfV0);
178 
179 
180 
181 
182  GsfTrackCollection gsftracks = *(gsftrackscoll.product());
183  vector<Trajectory> tjvec(0);
184  if (trajinev_){
185  iEvent.getByToken(gsfTrackLabel_,TrajectoryCollection);
186 
187  tjvec= *(TrajectoryCollection.product());
188  }
189 
190 
191  vector<reco::GsfPFRecTrack> selGsfPFRecTracks;
192  vector<reco::GsfPFRecTrack> primaryGsfPFRecTracks;
193  std::map<unsigned int, std::vector<reco::GsfPFRecTrack> > GsfPFMap;
194 
195 
196  for (unsigned int igsf=0; igsf<gsftracks.size();igsf++) {
197 
198  GsfTrackRef trackRef(gsftrackscoll, igsf);
199 
200  int kf_ind=FindPfRef(PfRTkColl,gsftracks[igsf],false);
201 
202  if (kf_ind>=0) {
203 
204  PFRecTrackRef kf_ref(thePfRecTrackCollection,
205  kf_ind);
206 
207  // remove fifth step tracks
208  if( useFifthStepForEcalDriven_ == false
209  || useFifthStepForTrackDriven_ == false) {
210  bool isFifthStepTrack = isFifthStep(kf_ref);
211  bool isEcalDriven = true;
212  bool isTrackerDriven = true;
213 
214  if (&(*trackRef->seedRef())==0) {
215  isEcalDriven = false;
216  isTrackerDriven = false;
217  }
218  else {
219  auto const& SeedFromRef= dynamic_cast<ElectronSeed const&>(*(trackRef->extra()->seedRef()) );
220  if(SeedFromRef.caloCluster().isNull())
221  isEcalDriven = false;
222  if(SeedFromRef.ctfTrack().isNull())
223  isTrackerDriven = false;
224  }
225  //note: the same track could be both ecalDriven and trackerDriven
226  if(isFifthStepTrack &&
227  isEcalDriven &&
228  isTrackerDriven == false &&
229  useFifthStepForEcalDriven_ == false) {
230  continue;
231  }
232 
233  if(isFifthStepTrack &&
234  isTrackerDriven &&
235  isEcalDriven == false &&
236  useFifthStepForTrackDriven_ == false) {
237  continue;
238  }
239 
240  if(isFifthStepTrack &&
241  isTrackerDriven &&
242  isEcalDriven &&
243  useFifthStepForTrackDriven_ == false &&
244  useFifthStepForEcalDriven_ == false) {
245  continue;
246  }
247  }
248 
249  pftrack_=GsfPFRecTrack( gsftracks[igsf].charge(),
251  igsf, trackRef,
252  kf_ref);
253  } else {
254  PFRecTrackRef dummyRef;
255  pftrack_=GsfPFRecTrack( gsftracks[igsf].charge(),
257  igsf, trackRef,
258  dummyRef);
259  }
260 
261 
262  bool validgsfbrem = false;
263  if(trajinev_) {
264  validgsfbrem = pfTransformer_->addPointsAndBrems(pftrack_,
265  gsftracks[igsf],
266  tjvec[igsf],
267  modemomentum_);
268  } else {
269  validgsfbrem = pfTransformer_->addPointsAndBrems(pftrack_,
270  gsftracks[igsf],
271  mtsTransform_);
272  }
273 
274  bool passSel = true;
275  if(applySel_)
276  passSel = applySelection(gsftracks[igsf]);
277 
278  if(validgsfbrem && passSel)
279  selGsfPFRecTracks.push_back(pftrack_);
280  }
281 
282 
283  unsigned int count_primary = 0;
284  if(selGsfPFRecTracks.size() > 0) {
285  for(unsigned int ipfgsf=0; ipfgsf<selGsfPFRecTracks.size();ipfgsf++) {
286 
287  vector<unsigned int> secondaries(0);
288  secondaries.clear();
289  bool keepGsf = true;
290 
291  if(applyGsfClean_) {
292  keepGsf = resolveGsfTracks(selGsfPFRecTracks,ipfgsf,secondaries,theEcalClusters);
293  }
294 
295  //is primary?
296  if(keepGsf == true) {
297 
298  // Find kf tracks from converted brem photons
299  if(convBremFinder_->foundConvBremPFRecTrack(thePfRecTrackCollection,thePrimaryVertexColl,
300  pfNuclears,pfConversions,pfV0,
302  theEcalClusters,selGsfPFRecTracks[ipfgsf])) {
303  const vector<PFRecTrackRef>& convBremPFRecTracks(convBremFinder_->getConvBremPFRecTracks());
304  for(unsigned int ii = 0; ii<convBremPFRecTracks.size(); ii++) {
305  selGsfPFRecTracks[ipfgsf].addConvBremPFRecTrackRef(convBremPFRecTracks[ii]);
306  }
307  }
308 
309  // save primaries gsf tracks
310  // gsfPFRecTrackCollection->push_back(selGsfPFRecTracks[ipfgsf]);
311  primaryGsfPFRecTracks.push_back(selGsfPFRecTracks[ipfgsf]);
312 
313 
314  // NOTE:: THE TRACKID IS USED TO LINK THE PRIMARY GSF TRACK. THIS NEEDS
315  // TO BE CHANGED AS SOON AS IT IS POSSIBLE TO CHANGE DATAFORMATS
316  // A MODIFICATION HERE IMPLIES A MODIFICATION IN PFBLOCKALGO.CC/H
317  unsigned int primGsfIndex = selGsfPFRecTracks[ipfgsf].trackId();
318  vector<reco::GsfPFRecTrack> trueGsfPFRecTracks;
319  if(secondaries.size() > 0) {
320  // loop on secondaries gsf tracks (from converted brems)
321  for(unsigned int isecpfgsf=0; isecpfgsf<secondaries.size();isecpfgsf++) {
322 
323  PFRecTrackRef refsecKF = selGsfPFRecTracks[(secondaries[isecpfgsf])].kfPFRecTrackRef();
324 
325  unsigned int secGsfIndex = selGsfPFRecTracks[(secondaries[isecpfgsf])].trackId();
326  GsfTrackRef secGsfRef = selGsfPFRecTracks[(secondaries[isecpfgsf])].gsfTrackRef();
327 
328  if(refsecKF.isNonnull()) {
329  // NOTE::IT SAVED THE TRACKID OF THE PRIMARY!!! THIS IS USED IN PFBLOCKALGO.CC/H
330  secpftrack_= GsfPFRecTrack( gsftracks[secGsfIndex].charge(),
332  primGsfIndex, secGsfRef,
333  refsecKF);
334  }
335  else{
336  PFRecTrackRef dummyRef;
337  // NOTE::IT SAVED THE TRACKID OF THE PRIMARY!!! THIS IS USED IN PFBLOCKALGO.CC/H
338  secpftrack_= GsfPFRecTrack( gsftracks[secGsfIndex].charge(),
340  primGsfIndex, secGsfRef,
341  dummyRef);
342  }
343 
344  bool validgsfbrem = false;
345  if(trajinev_) {
347  gsftracks[secGsfIndex],
348  tjvec[secGsfIndex],
349  modemomentum_);
350  } else {
352  gsftracks[secGsfIndex],
353  mtsTransform_);
354  }
355 
356  if(validgsfbrem) {
357  gsfPFRecTrackCollectionSecondary->push_back(secpftrack_);
358  trueGsfPFRecTracks.push_back(secpftrack_);
359  }
360  }
361  }
362  GsfPFMap.insert(pair<unsigned int,std::vector<reco::GsfPFRecTrack> >(count_primary,trueGsfPFRecTracks));
363  trueGsfPFRecTracks.clear();
364  count_primary++;
365  }
366  }
367  }
368 
369 
370  const edm::OrphanHandle<GsfPFRecTrackCollection> gsfPfRefProd =
371  iEvent.put(gsfPFRecTrackCollectionSecondary,"Secondary");
372 
373 
374  //now the secondary GsfPFRecTracks are in the event, the Ref can be created
375  createGsfPFRecTrackRef(gsfPfRefProd,primaryGsfPFRecTracks,GsfPFMap);
376 
377  for(unsigned int iGSF = 0; iGSF<primaryGsfPFRecTracks.size();iGSF++){
378  gsfPFRecTrackCollection->push_back(primaryGsfPFRecTracks[iGSF]);
379  }
380  iEvent.put(gsfPFRecTrackCollection);
381 
382  selGsfPFRecTracks.clear();
383  GsfPFMap.clear();
384  primaryGsfPFRecTracks.clear();
385 }
bool trajinev_
Trajectory of GSfTracks in the event?
edm::EDGetTokenT< reco::PFRecTrackCollection > pfTrackLabel_
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
edm::EDGetTokenT< reco::GsfTrackCollection > gsfTrackLabel_
void createGsfPFRecTrackRef(const edm::OrphanHandle< reco::GsfPFRecTrackCollection > &gsfPfHandle, std::vector< reco::GsfPFRecTrack > &gsfPFRecTrackPrimary, const std::map< unsigned int, std::vector< reco::GsfPFRecTrack > > &MapPrimSec)
tuple pfV0
Definition: pfV0_cfi.py:3
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
bool addPointsAndBrems(reco::GsfPFRecTrack &pftrack, const reco::Track &track, const Trajectory &traj, const bool &GetMode) const
ConvBremPFTrackFinder * convBremFinder_
bool isFifthStep(reco::PFRecTrackRef pfKfTrack)
bool applySelection(const reco::GsfTrack &)
reco::GsfPFRecTrack secpftrack_
int ii
Definition: cuy.py:588
edm::EDGetTokenT< reco::VertexCollection > primVtxLabel_
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
const std::vector< reco::PFRecTrackRef > & getConvBremPFRecTracks()
bool foundConvBremPFRecTrack(const edm::Handle< reco::PFRecTrackCollection > &thePfRecTrackCol, const edm::Handle< reco::VertexCollection > &primaryVertex, const edm::Handle< reco::PFDisplacedTrackerVertexCollection > &pfNuclears, const edm::Handle< reco::PFConversionCollection > &pfConversions, const edm::Handle< reco::PFV0Collection > &pfV0, bool useNuclear, bool useConversions, bool useV0, const reco::PFClusterCollection &theEClus, const reco::GsfPFRecTrack &gsfpfrectk)
std::vector< GsfPFRecTrack > GsfPFRecTrackCollection
collection of GsfPFRecTrack objects
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
edm::EDGetTokenT< reco::PFV0Collection > pfV0_
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
edm::EDGetTokenT< reco::PFDisplacedTrackerVertexCollection > pfNuclear_
int FindPfRef(const reco::PFRecTrackCollection &PfRTkColl, const reco::GsfTrack &, bool)
bool resolveGsfTracks(const std::vector< reco::GsfPFRecTrack > &GsfPFVec, unsigned int ngsf, std::vector< unsigned int > &secondaries, const reco::PFClusterCollection &theEClus)
T const * product() const
Definition: Handle.h:81
string const
Definition: compareJSON.py:14
edm::EDGetTokenT< reco::PFConversionCollection > pfConv_
std::vector< Trajectory > TrajectoryCollection
reco::GsfPFRecTrack pftrack_
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
std::vector< PFRecTrack > PFRecTrackCollection
collection of PFRecTrack objects
Definition: PFRecTrackFwd.h:9
edm::EDGetTokenT< reco::PFClusterCollection > pfEcalClusters_
MultiTrajectoryStateTransform mtsTransform_
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 557 of file PFElecTkProducer.cc.

References applyAngularGsfClean_, compareJSON::const, gather_cfg::cout, debugGsfCleaning_, detaCutGsfClean_, dphiCutGsfClean_, MultiTrajectoryStateTransform::innerStateOnSurface(), isInnerMostWithLostHits(), isSameEgSC(), isSharingEcalEnergyWithEgSC(), TrajectoryStateOnSurface::isValid(), PV3DBase< T, PVType, FrameType >::mag(), minTangDist(), MultiTrajectoryStateMode::momentumFromModeCartesian(), mtsMode_, mtsTransform_, Pi, and TwoPi.

Referenced by produce().

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

Member Data Documentation

bool PFElecTkProducer::applyAngularGsfClean_
private

Definition at line 118 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and resolveGsfTracks().

bool PFElecTkProducer::applyGsfClean_
private

Definition at line 133 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

bool PFElecTkProducer::applySel_
private

Definition at line 132 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

edm::ParameterSet PFElecTkProducer::conf_
private

Definition at line 107 of file PFElecTkProducer.h.

ConvBremPFTrackFinder* PFElecTkProducer::convBremFinder_
private

Definition at line 126 of file PFElecTkProducer.h.

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

bool PFElecTkProducer::debugGsfCleaning_
private

Definition at line 137 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and resolveGsfTracks().

double PFElecTkProducer::detaCutGsfClean_
private

Definition at line 119 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and resolveGsfTracks().

double PFElecTkProducer::detaGsfSC_
private

Definition at line 139 of file PFElecTkProducer.h.

Referenced by applySelection(), and PFElecTkProducer().

double PFElecTkProducer::dphiCutGsfClean_
private

Definition at line 120 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and resolveGsfTracks().

double PFElecTkProducer::dphiGsfSC_
private

Definition at line 140 of file PFElecTkProducer.h.

Referenced by applySelection(), and PFElecTkProducer().

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

Definition at line 108 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

double PFElecTkProducer::maxPtConvReco_
private

Definition at line 141 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer().

bool PFElecTkProducer::modemomentum_
private

Definition at line 131 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

const MultiTrajectoryStateMode* PFElecTkProducer::mtsMode_
private

Definition at line 124 of file PFElecTkProducer.h.

Referenced by resolveGsfTracks().

MultiTrajectoryStateTransform PFElecTkProducer::mtsTransform_
private

Definition at line 125 of file PFElecTkProducer.h.

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

double PFElecTkProducer::mvaConvBremFinderIDBarrelHighPt_
private

Definition at line 147 of file PFElecTkProducer.h.

Referenced by beginRun(), and PFElecTkProducer().

double PFElecTkProducer::mvaConvBremFinderIDBarrelLowPt_
private

Definition at line 146 of file PFElecTkProducer.h.

Referenced by beginRun(), and PFElecTkProducer().

double PFElecTkProducer::mvaConvBremFinderIDEndcapsHighPt_
private

Definition at line 149 of file PFElecTkProducer.h.

Referenced by beginRun(), and PFElecTkProducer().

double PFElecTkProducer::mvaConvBremFinderIDEndcapsLowPt_
private

Definition at line 148 of file PFElecTkProducer.h.

Referenced by beginRun(), and PFElecTkProducer().

std::string PFElecTkProducer::path_mvaWeightFileConvBremBarrelHighPt_
private

Definition at line 151 of file PFElecTkProducer.h.

Referenced by beginRun(), and PFElecTkProducer().

std::string PFElecTkProducer::path_mvaWeightFileConvBremBarrelLowPt_
private

Definition at line 150 of file PFElecTkProducer.h.

Referenced by beginRun(), and PFElecTkProducer().

std::string PFElecTkProducer::path_mvaWeightFileConvBremEndcapsHighPt_
private

Definition at line 153 of file PFElecTkProducer.h.

Referenced by beginRun(), and PFElecTkProducer().

std::string PFElecTkProducer::path_mvaWeightFileConvBremEndcapsLowPt_
private

Definition at line 152 of file PFElecTkProducer.h.

Referenced by beginRun(), and PFElecTkProducer().

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

Definition at line 113 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

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

Definition at line 111 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

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

Definition at line 112 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

reco::GsfPFRecTrack PFElecTkProducer::pftrack_
private

Definition at line 105 of file PFElecTkProducer.h.

Referenced by produce().

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

Definition at line 109 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

PFTrackTransformer* PFElecTkProducer::pfTransformer_
private

PFTrackTransformer.

Definition at line 123 of file PFElecTkProducer.h.

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

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

Definition at line 114 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

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

Definition at line 110 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

double PFElecTkProducer::SCEne_
private

Definition at line 138 of file PFElecTkProducer.h.

Referenced by applySelection(), and PFElecTkProducer().

reco::GsfPFRecTrack PFElecTkProducer::secpftrack_
private

Definition at line 106 of file PFElecTkProducer.h.

Referenced by produce().

bool PFElecTkProducer::trajinev_
private

Trajectory of GSfTracks in the event?

Definition at line 130 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

bool PFElecTkProducer::useConvBremFinder_
private

Conv Brem Finder.

Definition at line 144 of file PFElecTkProducer.h.

Referenced by beginRun(), and PFElecTkProducer().

bool PFElecTkProducer::useConversions_
private

Definition at line 116 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

bool PFElecTkProducer::useFifthStepForEcalDriven_
private

Definition at line 134 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

bool PFElecTkProducer::useFifthStepForTrackDriven_
private

Definition at line 135 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

bool PFElecTkProducer::useNuclear_
private

Definition at line 115 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().

bool PFElecTkProducer::useV0_
private

Definition at line 117 of file PFElecTkProducer.h.

Referenced by PFElecTkProducer(), and produce().