113 if(!validToken)
return;
122 if(!validToken)
return;
131 float evt_bField = magneticField->inTesla(
GlobalPoint(0.,0.,0.)).z();
141 if(!validToken)
return;
147 if(!validToken)
return;
155 if(!validToken)
return;
164 if(!validToken)
return;
186 if(!validToken)
return;
196 double mass = 0.000510998918;
204 const Track* el_track = (
const Track*)(el->gsfTrack().get());
206 const TrackRef ctfTkRef = el->closestTrack();
213 VertexCollection::const_iterator firstGoodVertex = vertexCollection->end();
214 int firstGoodVertexIdx = 0;
215 for (VertexCollection::const_iterator vtx = vertexCollection->begin(); vtx != vertexCollection->end(); ++vtx, ++firstGoodVertexIdx) {
216 if ( !vtx->isFake() && vtx->ndof()>=4. && vtx->position().Rho()<=2.0 && fabs(vtx->position().Z())<=24.0) {
217 firstGoodVertex = vtx;
226 int fiducialityMask = 0;
227 if ( el->isEB() ) fiducialityMask |= 1 <<
ISEB;
228 if ( el->isEBEEGap() ) fiducialityMask |= 1 <<
ISEBEEGAP;
229 if ( el->isEE() ) fiducialityMask |= 1 <<
ISEE;
230 if ( el->isEEGap() ) fiducialityMask |= 1 <<
ISEEGAP;
231 if ( el->isEBEtaGap() ) fiducialityMask |= 1 <<
ISEBETAGAP;
232 if ( el->isEBPhiGap() ) fiducialityMask |= 1 <<
ISEBPHIGAP;
233 if ( el->isEEDeeGap() ) fiducialityMask |= 1 <<
ISEEDEEGAP;
234 if ( el->isEERingGap() ) fiducialityMask |= 1 <<
ISEERINGGAP;
235 if ( el->isGap() ) fiducialityMask |= 1 <<
ISGAP;
242 int electronTypeMask = 0;
244 if ( el->trackerDrivenSeed() ) electronTypeMask |= 1 <<
ISTRACKERDRIVEN;
245 if ( el->ecalDrivenSeed() ) electronTypeMask |= 1 <<
ISECALDRIVEN;
246 if ( el->passingCutBasedPreselection() ) electronTypeMask |= 1 <<
ISCUTPRESELECTED;
247 if ( el->passingMvaPreselection() ) electronTypeMask |= 1 <<
ISMVAPRESELECTED;
259 p4In.SetXYZT ( p3In.x() , p3In.y() , p3In.z() ,
sqrt( mass*mass + p3In.R() *p3In.R() ) );
260 p4Out.SetXYZT( p3Out.x(), p3Out.y(), p3Out.z(),
sqrt( mass*mass + p3Out.R()*p3Out.R() ) );
268 hww.
els_type() .push_back( electronTypeMask );
279 hww.
els_ecalIso() .push_back( el->dr03EcalRecHitSumEt() );
280 hww.
els_hcalIso() .push_back( el->dr03HcalTowerSumEt() );
281 hww.
els_tkIso() .push_back( el->dr03TkSumPt() );
290 if ( firstGoodVertex!=vertexCollection->end() ) {
302 float pfiso_ch = 0.0;
303 float pfiso_em = 0.0;
304 float pfiso_nh = 0.0;
306 PFIsolation2012(*el, vertexCollection, firstGoodVertexIdx, 0.3, pfiso_ch, pfiso_em, pfiso_nh);
311 PFIsolation2012(*el, vertexCollection, firstGoodVertexIdx, 0.4, pfiso_ch, pfiso_em, pfiso_nh);
338 hww.
els_etaSC() .push_back( el->superCluster()->eta() );
339 hww.
els_eSC() .push_back( el->superCluster()->energy() );
340 hww.
els_eSCRaw() .push_back( el->superCluster()->rawEnergy() );
341 hww.
els_eSCPresh() .push_back( el->superCluster()->preshowerEnergy() );
342 hww.
els_nSeed() .push_back( el->basicClustersSize() - 1 );
343 hww.
els_e1x5() .push_back( el->e1x5() );
344 hww.
els_e5x5() .push_back( el->e5x5() );
346 hww.
els_etaSCwidth() .push_back( el->superCluster()->etaWidth() );
347 hww.
els_phiSCwidth() .push_back( el->superCluster()->phiWidth() );
354 if( el->superCluster()->seed().isAvailable() ) {
356 const BasicCluster& clRef = *(el->superCluster()->seed());
357 const vector<float>& lcovs = clusterTools.localCovariances(clRef);
358 const vector<float> localCovariancesSC = clusterTools.scLocalCovariances(*(el->superCluster()));
360 hww.
els_sigmaIPhiIPhi() .push_back( isfinite(lcovs[2]) ? lcovs[2] > 0 ?
sqrt(lcovs[2]) : -1 *
sqrt(-1 * lcovs[2]) : -9999. );
361 hww.
els_e3x3() .push_back( clusterTools.e3x3(clRef) );
375 hww.
els_hOverE() .push_back( el->hcalOverEcal() );
376 hww.
els_eOverPIn() .push_back( el->eSuperClusterOverP() );
380 hww.
els_fbrem() .push_back( el->fbrem() );
382 hww.
els_dEtaIn() .push_back( el->deltaEtaSuperClusterTrackAtVtx() );
383 hww.
els_dEtaOut() .push_back( el->deltaEtaSeedClusterTrackAtCalo() );
384 hww.
els_dPhiIn() .push_back( el->deltaPhiSuperClusterTrackAtVtx() );
385 hww.
els_dPhiOut() .push_back( el->deltaPhiSeedClusterTrackAtCalo() );
397 hww.
els_d0() .push_back( el_track->
d0() );
398 hww.
els_d0corr() .push_back( -1*(el_track->
dxy(beamSpotreco)) );
407 hww.
els_trkidx() . push_back( static_cast<int> ( ctfTkRef.
key() ) );
408 hww.
els_trkshFrac() . push_back( static_cast<float>( el->ctfGsfOverlap() ) );
421 if ( firstGoodVertex!=vertexCollection->end() ) {
428 hww.
els_ip3d() . push_back( -999. );
445 vector<ConversionInfo> v_convInfos = convFinder.getConversionInfos(*(el->core()), tracks_h, gsftracks_h, evt_bField);
448 vector<int> v_gsftkidx;
449 vector<int> v_delmisshits;
451 vector<float> v_dist;
452 vector<float> v_dcot;
454 vector<LorentzVector> v_pos_p4;
456 for(
unsigned int i_conv = 0; i_conv < v_convInfos.size(); i_conv++) {
458 math::XYZPoint convPoint = v_convInfos.at(i_conv).pointOfConversion();
459 float convPointX = isfinite(convPoint.x()) ? convPoint.x() : -9999.;
460 float convPointY = isfinite(convPoint.y()) ? convPoint.y() : -9999.;
461 float convPointZ = isfinite(convPoint.z()) ? convPoint.z() : -9999.;
463 v_dist .push_back( isfinite(v_convInfos.at(i_conv).dist()) ? v_convInfos.at(i_conv).dist() : -9999. );
464 v_dcot .push_back( v_convInfos.at(i_conv).dcot() );
465 v_rad .push_back( v_convInfos.at(i_conv).radiusOfConversion() );
466 v_delmisshits .push_back( v_convInfos.at(i_conv).deltaMissingHits() );
467 v_flag .push_back( v_convInfos.at(i_conv).flag() );
468 v_pos_p4 .push_back(
LorentzVector(convPointX, convPointY, convPointZ, 0) );
470 if( v_convInfos.at(i_conv).conversionPartnerCtfTk().isNonnull() ) {
471 v_tkidx.push_back(v_convInfos.at(i_conv).conversionPartnerCtfTk().key());
474 v_tkidx.push_back(-9999);
478 if( v_convInfos.at(i_conv).conversionPartnerGsfTk().isNonnull() ) {
479 v_gsftkidx.push_back(v_convInfos.at(i_conv).conversionPartnerGsfTk().key());
482 v_gsftkidx.push_back(-9999);
488 ConversionInfo convInfo = convFinder.getConversionInfo( *el, tracks_h, gsftracks_h, evt_bField );
506 hww.
els_conv_old_dist() . push_back( isfinite(el->convDist()) ? el->convDist() : -9999. );
507 hww.
els_conv_old_dcot() . push_back( isfinite(el->convDcot()) ? el->convDcot() : -9999. );
void Load_els_conv_old_dist()
std::vector< float > & els_ip3derr()
double p() const
momentum vector magnitude
std::vector< float > & els_iso03_pf2012_ch()
std::vector< float > & els_iso04_pf_nhad05()
bool isNonnull() const
Checks for non-null.
std::vector< float > & els_conv_dcot()
std::vector< float > & els_tkIso()
std::vector< int > & els_exp_innerlayers()
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
std::vector< float > & els_e3x3()
std::vector< float > & els_ndof()
void Load_els_conv_old_dcot()
edm::EDGetTokenT< reco::VertexCollection > thePVCollection_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::Handle< reco::PFCandidateCollection > pfCand_h
std::vector< LorentzVector > & els_vertex_p4()
std::vector< float > & els_hOverE()
std::vector< float > & els_d0corr()
std::vector< float > & els_ecalEnergy()
Global3DPoint GlobalPoint
std::vector< int > & els_nSeed()
std::vector< float > & els_d0()
std::vector< float > & els_iso04_pf2012_nh()
std::vector< float > & els_eOverPOut()
std::vector< int > & els_sccharge()
std::vector< float > & els_iso04_pf2012_em()
std::vector< float > & els_ip3d()
std::vector< Vertex > VertexCollection
collection of Vertex objects
std::vector< float > & els_fbrem()
void Load_els_iso03_pf_ch()
void Load_els_eOverPOut()
std::vector< float > & els_conv_dist()
edm::EDGetTokenT< reco::ConversionCollection > ConversionCollection_
edm::EDGetTokenT< reco::PFCandidateCollection > PFCandidateCollection_
key_type key() const
Accessor for product key.
double px() const
x coordinate of momentum vector
void Load_els_iso04_pf2012_em()
edm::EDGetTokenT< EcalRecHitCollection > ClusterToken1_
void Load_els_eSeedOverPOut()
std::vector< float > & els_iso04_pf2012_ch()
void Load_els_iso04_pf_nhad05()
std::vector< int > & els_gsftrkidx()
std::vector< float > & els_iso03_pf2012_nh()
std::vector< float > & els_eOverPIn()
std::vector< float > & els_iso03_pf_ch()
std::vector< float > & els_iso03_pf_gamma05()
void Load_els_trk_charge()
void Load_els_iso03_pf_nhad05()
std::vector< int > & els_trk_charge()
void Load_els_conv_dist()
double chi2() const
chi-squared of the fit
std::vector< float > & els_ecalIso()
double ndof() const
number of degrees of freedom of the fit
std::vector< float > & els_eSeedOverPOut()
std::vector< float > & els_chi2()
void Load_els_exp_innerlayers()
void Load_els_trkshFrac()
std::vector< float > & els_eSC()
void Load_els_sigmaIEtaIEta()
edm::EDGetTokenT< reco::GsfElectronCollection > GSFElectronCollection_
std::vector< float > & els_conv_old_dist()
edm::EDGetTokenT< reco::TrackCollection > TrackCollection_
void Load_els_etaSCwidth()
std::vector< float > & els_dEtaOut()
void Load_els_hcalIso04()
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
std::vector< float > & els_dPhiOut()
std::vector< float > & els_hcalIso()
std::vector< LorentzVector > & els_p4()
std::vector< float > & els_etaSC()
void Load_els_sigmaIPhiIPhi()
std::vector< float > & els_eSCPresh()
double pz() const
z coordinate of momentum vector
std::vector< float > & els_iso03_pf_nhad05()
void Load_els_iso03_pf2012_nh()
void Load_els_ecalIso04()
double electronIsoValuePF(const reco::GsfElectron &el, const reco::Vertex &vtx, float coner, float minptn, float dzcut, float footprintdr, float gammastripveto, float elestripveto, int filterId)
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
void Load_els_iso04_pf2012_nh()
double vz() const
z coordinate of the reference point on track
std::vector< float > & els_iso04_pf_gamma05()
std::vector< float > & els_e5x5()
std::vector< float > & els_etaSCwidth()
std::vector< float > & els_trkshFrac()
T const * product() const
void Load_els_iso04_pf_gamma05()
void Load_els_fiduciality()
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
std::vector< float > & els_eSCRaw()
std::vector< float > & els_ecalIso04()
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< float > & els_conv_old_dcot()
std::vector< int > & els_charge()
void Load_els_ecalEnergy()
std::vector< float > & els_hcalIso04()
edm::EDGetTokenT< edm::View< reco::GsfElectron > > GSFElectron_
void Load_els_eSeedOverPIn()
std::vector< float > & els_dPhiIn()
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > LorentzVector
void Load_els_iso04_pf_ch()
std::vector< int > & els_type()
std::vector< float > & els_e1x5()
std::vector< float > & els_iso04_pf_ch()
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
void Load_els_iso03_pf2012_em()
void Load_els_iso04_pf2012_ch()
std::vector< float > & els_dEtaIn()
int charge() const
track electric charge
const Point & position() const
position
std::vector< float > & els_phiSCwidth()
edm::EDGetTokenT< reco::BeamSpot > BeamSpot_
std::vector< float > & els_iso03_pf2012_em()
void Load_els_iso03_pf2012_ch()
std::vector< float > & els_eSeedOverPIn()
edm::EDGetTokenT< reco::GsfTrackCollection > GSFTrackCollection_
void Load_els_vertex_p4()
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
void Load_els_conv_dcot()
std::vector< float > & els_sigmaIEtaIEta()
void PFIsolation2012(const reco::GsfElectron &el, const reco::VertexCollection *vertexCollection, const int vertexIndex, const float &R, float &pfiso_ch, float &pfiso_em, float &pfiso_nh)
void Load_els_gsftrkidx()
double py() const
y coordinate of momentum vector
std::vector< LorentzVector > & els_trk_p4()
math::PtEtaPhiELorentzVectorF LorentzVector
int numberOfHits(HitCategory category) const
std::vector< float > & els_sigmaIPhiIPhi()
std::vector< int > & els_trkidx()
std::vector< int > & els_fiduciality()
edm::EDGetTokenT< EcalRecHitCollection > ClusterToken2_
std::vector< float > & els_z0corr()
void Load_els_iso03_pf_gamma05()
void Load_els_phiSCwidth()