00001 #ifndef GsfElectron_h
00002 #define GsfElectron_h
00003
00004 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
00005 #include "DataFormats/EgammaCandidates/interface/GsfElectronCore.h"
00006 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
00007 #include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h"
00008
00009 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00010 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00011 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00012 #include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h"
00013 #include "DataFormats/CaloTowers/interface/CaloTowerDetId.h"
00014
00015 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00016 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00017 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00018 #include <vector>
00019 #include <limits>
00020
00021 namespace reco
00022 {
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class GsfElectron : public RecoCandidate
00038 {
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 public :
00050
00051
00052 struct ChargeInfo ;
00053 struct TrackClusterMatching ;
00054 struct TrackExtrapolations ;
00055 struct ClosestCtfTrack ;
00056 struct FiducialFlags ;
00057 struct ShowerShape ;
00058 struct IsolationVariables ;
00059 struct ConversionRejection ;
00060 struct ClassificationVariables ;
00061
00062 GsfElectron() ;
00063 GsfElectron( const GsfElectronCoreRef & ) ;
00064 GsfElectron
00065 (
00066 const GsfElectron &,
00067 const GsfElectronCoreRef &
00068 ) ;
00069 GsfElectron
00070 (
00071 const GsfElectron & electron,
00072 const GsfElectronCoreRef & core,
00073 const CaloClusterPtr & electronCluster,
00074 const TrackRef & closestCtfTrack,
00075 const TrackBaseRef & conversionPartner,
00076 const GsfTrackRefVector & ambiguousTracks
00077 ) ;
00078 GsfElectron
00079 (
00080 int charge,
00081 const ChargeInfo &,
00082 const GsfElectronCoreRef &,
00083 const TrackClusterMatching &,
00084 const TrackExtrapolations &,
00085 const ClosestCtfTrack &,
00086 const FiducialFlags &,
00087 const ShowerShape &,
00088 const ConversionRejection &
00089 ) ;
00090 GsfElectron * clone() const ;
00091 GsfElectron * clone
00092 (
00093 const GsfElectronCoreRef & core,
00094 const CaloClusterPtr & electronCluster,
00095 const TrackRef & closestCtfTrack,
00096 const TrackBaseRef & conversionPartner,
00097 const GsfTrackRefVector & ambiguousTracks
00098 ) const ;
00099 virtual ~GsfElectron() {} ;
00100
00101 private:
00102
00103 void init() ;
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116 public:
00117
00118
00119
00120
00121
00122
00123 struct ChargeInfo
00124 {
00125 int scPixCharge ;
00126 bool isGsfCtfScPixConsistent ;
00127 bool isGsfScPixConsistent ;
00128 bool isGsfCtfConsistent ;
00129 ChargeInfo()
00130 : scPixCharge(0), isGsfCtfScPixConsistent(false),
00131 isGsfScPixConsistent(false), isGsfCtfConsistent(false)
00132 {}
00133 } ;
00134
00135
00136
00137
00138 int scPixCharge() const { return chargeInfo_.scPixCharge ; }
00139 bool isGsfCtfScPixChargeConsistent() const { return chargeInfo_.isGsfCtfScPixConsistent ; }
00140 bool isGsfScPixChargeConsistent() const { return chargeInfo_.isGsfScPixConsistent ; }
00141 bool isGsfCtfChargeConsistent() const { return chargeInfo_.isGsfCtfConsistent ; }
00142 const ChargeInfo & chargeInfo() const { return chargeInfo_ ; }
00143
00144
00145 virtual bool isElectron() const { return true ; }
00146 virtual bool overlap( const Candidate & ) const ;
00147
00148 private:
00149
00150
00151 ChargeInfo chargeInfo_ ;
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162 public:
00163
00164
00165 virtual GsfElectronCoreRef core() const ;
00166
00167
00168 virtual SuperClusterRef superCluster() const { return core()->superCluster() ; }
00169 virtual GsfTrackRef gsfTrack() const { return core()->gsfTrack() ; }
00170 virtual TrackRef closestTrack() const { return core()->ctfTrack() ; }
00171 float ctfGsfOverlap() const { return core()->ctfGsfOverlap() ; }
00172 bool ecalDrivenSeed() const { return core()->ecalDrivenSeed() ; }
00173 bool trackerDrivenSeed() const { return core()->trackerDrivenSeed() ; }
00174 SuperClusterRef pflowSuperCluster() const { return core()->pflowSuperCluster() ; }
00175
00176
00177 struct ClosestCtfTrack
00178 {
00179 TrackRef ctfTrack ;
00180 float shFracInnerHits ;
00181 ClosestCtfTrack() : shFracInnerHits(0.) {}
00182 ClosestCtfTrack( TrackRef track, float sh ) : ctfTrack(track), shFracInnerHits(sh) {}
00183 } ;
00184 float shFracInnerHits() const { return core()->ctfGsfOverlap() ; }
00185 TrackRef closestCtfTrackRef() const { return core()->ctfTrack() ; }
00186 ClosestCtfTrack closestCtfTrack() const { return ClosestCtfTrack(core()->ctfTrack(),core()->ctfGsfOverlap()) ; }
00187
00188 private:
00189
00190
00191 GsfElectronCoreRef core_ ;
00192
00193
00194
00195
00196
00197
00198 public:
00199
00200 struct TrackClusterMatching
00201 {
00202 CaloClusterPtr electronCluster ;
00203 float eSuperClusterOverP ;
00204 float eSeedClusterOverP ;
00205 float eSeedClusterOverPout ;
00206 float eEleClusterOverPout ;
00207 float deltaEtaSuperClusterAtVtx ;
00208 float deltaEtaSeedClusterAtCalo ;
00209 float deltaEtaEleClusterAtCalo ;
00210 float deltaPhiEleClusterAtCalo ;
00211 float deltaPhiSuperClusterAtVtx ;
00212 float deltaPhiSeedClusterAtCalo ;
00213 TrackClusterMatching()
00214 : eSuperClusterOverP(0.),
00215 eSeedClusterOverP(0.),
00216 eSeedClusterOverPout(0.),
00217 eEleClusterOverPout(0.),
00218 deltaEtaSuperClusterAtVtx(std::numeric_limits<float>::infinity()),
00219 deltaEtaSeedClusterAtCalo(std::numeric_limits<float>::infinity()),
00220 deltaEtaEleClusterAtCalo(std::numeric_limits<float>::infinity()),
00221 deltaPhiEleClusterAtCalo(std::numeric_limits<float>::infinity()),
00222 deltaPhiSuperClusterAtVtx(std::numeric_limits<float>::infinity()),
00223 deltaPhiSeedClusterAtCalo(std::numeric_limits<float>::infinity())
00224 {}
00225 } ;
00226
00227
00228 CaloClusterPtr electronCluster() const { return trackClusterMatching_.electronCluster ; }
00229 float eSuperClusterOverP() const { return trackClusterMatching_.eSuperClusterOverP ; }
00230 float eSeedClusterOverP() const { return trackClusterMatching_.eSeedClusterOverP ; }
00231 float eSeedClusterOverPout() const { return trackClusterMatching_.eSeedClusterOverPout ; }
00232 float eEleClusterOverPout() const { return trackClusterMatching_.eEleClusterOverPout ; }
00233 float deltaEtaSuperClusterTrackAtVtx() const { return trackClusterMatching_.deltaEtaSuperClusterAtVtx ; }
00234 float deltaEtaSeedClusterTrackAtCalo() const { return trackClusterMatching_.deltaEtaSeedClusterAtCalo ; }
00235 float deltaEtaEleClusterTrackAtCalo() const { return trackClusterMatching_.deltaEtaEleClusterAtCalo ; }
00236 float deltaPhiSuperClusterTrackAtVtx() const { return trackClusterMatching_.deltaPhiSuperClusterAtVtx ; }
00237 float deltaPhiSeedClusterTrackAtCalo() const { return trackClusterMatching_.deltaPhiSeedClusterAtCalo ; }
00238 float deltaPhiEleClusterTrackAtCalo() const { return trackClusterMatching_.deltaPhiEleClusterAtCalo ; }
00239 const TrackClusterMatching & trackClusterMatching() const { return trackClusterMatching_ ; }
00240
00241
00242 void setDeltaEtaSuperClusterAtVtx( float de ) { trackClusterMatching_.deltaEtaSuperClusterAtVtx = de ; }
00243 void setDeltaPhiSuperClusterAtVtx( float dphi ) { trackClusterMatching_.deltaPhiSuperClusterAtVtx = dphi ; }
00244
00245
00246 private:
00247
00248
00249 TrackClusterMatching trackClusterMatching_ ;
00250
00251
00252
00253
00254
00255
00256 public :
00257
00258 struct TrackExtrapolations
00259 {
00260 math::XYZPointF positionAtVtx ;
00261 math::XYZPointF positionAtCalo ;
00262 math::XYZVectorF momentumAtVtx ;
00263 math::XYZVectorF momentumAtCalo ;
00264 math::XYZVectorF momentumOut ;
00265 math::XYZVectorF momentumAtEleClus ;
00266 math::XYZVectorF momentumAtVtxWithConstraint ;
00267 } ;
00268
00269
00270 math::XYZPointF trackPositionAtVtx() const { return trackExtrapolations_.positionAtVtx ; }
00271 math::XYZPointF trackPositionAtCalo() const { return trackExtrapolations_.positionAtCalo ; }
00272 math::XYZVectorF trackMomentumAtVtx() const { return trackExtrapolations_.momentumAtVtx ; }
00273 math::XYZVectorF trackMomentumAtCalo() const { return trackExtrapolations_.momentumAtCalo ; }
00274 math::XYZVectorF trackMomentumOut() const { return trackExtrapolations_.momentumOut ; }
00275 math::XYZVectorF trackMomentumAtEleClus() const { return trackExtrapolations_.momentumAtEleClus ; }
00276 math::XYZVectorF trackMomentumAtVtxWithConstraint() const { return trackExtrapolations_.momentumAtVtxWithConstraint ; }
00277 const TrackExtrapolations & trackExtrapolations() const { return trackExtrapolations_ ; }
00278
00279
00280 math::XYZPointF TrackPositionAtVtx() const { return trackPositionAtVtx() ; }
00281 math::XYZPointF TrackPositionAtCalo() const { return trackPositionAtCalo() ; }
00282
00283
00284 private:
00285
00286
00287 TrackExtrapolations trackExtrapolations_ ;
00288
00289
00290
00291
00292
00293
00294 public :
00295
00296
00297 math::XYZPoint superClusterPosition() const { return superCluster()->position() ; }
00298 int basicClustersSize() const { return superCluster()->clustersSize() ; }
00299 CaloCluster_iterator basicClustersBegin() const { return superCluster()->clustersBegin() ; }
00300 CaloCluster_iterator basicClustersEnd() const { return superCluster()->clustersEnd() ; }
00301
00302
00303 math::XYZPoint caloPosition() const { return superCluster()->position() ; }
00304
00305
00306
00307
00308
00309
00310
00311 public :
00312
00313 struct FiducialFlags
00314 {
00315 bool isEB ;
00316 bool isEE ;
00317 bool isEBEEGap ;
00318 bool isEBEtaGap ;
00319 bool isEBPhiGap ;
00320 bool isEEDeeGap ;
00321 bool isEERingGap ;
00322 FiducialFlags()
00323 : isEB(false), isEE(false), isEBEEGap(false),
00324 isEBEtaGap(false), isEBPhiGap(false),
00325 isEEDeeGap(false), isEERingGap(false)
00326 {}
00327 } ;
00328
00329
00330 bool isEB() const { return fiducialFlags_.isEB ; }
00331 bool isEE() const { return fiducialFlags_.isEE ; }
00332 bool isGap() const { return ((isEBEEGap())||(isEBGap())||(isEEGap())) ; }
00333 bool isEBEEGap() const { return fiducialFlags_.isEBEEGap ; }
00334 bool isEBGap() const { return (isEBEtaGap()||isEBPhiGap()) ; }
00335 bool isEBEtaGap() const { return fiducialFlags_.isEBEtaGap ; }
00336 bool isEBPhiGap() const { return fiducialFlags_.isEBPhiGap ; }
00337 bool isEEGap() const { return (isEEDeeGap()||isEERingGap()) ; }
00338 bool isEEDeeGap() const { return fiducialFlags_.isEEDeeGap ; }
00339 bool isEERingGap() const { return fiducialFlags_.isEERingGap ; }
00340 const FiducialFlags & fiducialFlags() const { return fiducialFlags_ ; }
00341
00342
00343 private:
00344
00345
00346 FiducialFlags fiducialFlags_ ;
00347
00348
00349
00350
00351
00352
00353 public :
00354
00355 struct ShowerShape
00356 {
00357 float sigmaEtaEta ;
00358 float sigmaIetaIeta ;
00359 float sigmaIphiIphi ;
00360 float e1x5 ;
00361 float e2x5Max ;
00362 float e5x5 ;
00363 float r9 ;
00364 float hcalDepth1OverEcal ;
00365 float hcalDepth2OverEcal ;
00366 std::vector<CaloTowerDetId> hcalTowersBehindClusters ;
00367 float hcalDepth1OverEcalBc ;
00368 float hcalDepth2OverEcalBc ;
00369 ShowerShape()
00370 : sigmaEtaEta(std::numeric_limits<float>::infinity()),
00371 sigmaIetaIeta(std::numeric_limits<float>::infinity()),
00372 sigmaIphiIphi(std::numeric_limits<float>::infinity()),
00373 e1x5(0.), e2x5Max(0.), e5x5(0.),
00374 r9(-std::numeric_limits<float>::infinity()),
00375 hcalDepth1OverEcal(0.), hcalDepth2OverEcal(0.),
00376 hcalDepth1OverEcalBc(0.), hcalDepth2OverEcalBc(0.)
00377 {}
00378 } ;
00379
00380
00381 float sigmaEtaEta() const { return showerShape_.sigmaEtaEta ; }
00382 float sigmaIetaIeta() const { return showerShape_.sigmaIetaIeta ; }
00383 float sigmaIphiIphi() const { return showerShape_.sigmaIphiIphi ; }
00384 float e1x5() const { return showerShape_.e1x5 ; }
00385 float e2x5Max() const { return showerShape_.e2x5Max ; }
00386 float e5x5() const { return showerShape_.e5x5 ; }
00387 float r9() const { return showerShape_.r9 ; }
00388 float hcalDepth1OverEcal() const { return showerShape_.hcalDepth1OverEcal ; }
00389 float hcalDepth2OverEcal() const { return showerShape_.hcalDepth2OverEcal ; }
00390 float hcalOverEcal() const { return hcalDepth1OverEcal() + hcalDepth2OverEcal() ; }
00391 const std::vector<CaloTowerDetId> & hcalTowersBehindClusters() const { return showerShape_.hcalTowersBehindClusters ; }
00392 float hcalDepth1OverEcalBc() const { return showerShape_.hcalDepth1OverEcalBc ; }
00393 float hcalDepth2OverEcalBc() const { return showerShape_.hcalDepth2OverEcalBc ; }
00394 float hcalOverEcalBc() const { return hcalDepth1OverEcalBc() + hcalDepth2OverEcalBc() ; }
00395 const ShowerShape & showerShape() const { return showerShape_ ; }
00396
00397
00398 float scSigmaEtaEta() const { return sigmaEtaEta() ; }
00399 float scSigmaIEtaIEta() const { return sigmaIetaIeta() ; }
00400 float scE1x5() const { return e1x5() ; }
00401 float scE2x5Max() const { return e2x5Max() ; }
00402 float scE5x5() const { return e5x5() ; }
00403 float hadronicOverEm() const {return hcalOverEcal();}
00404 float hadronicOverEm1() const {return hcalDepth1OverEcal();}
00405 float hadronicOverEm2() const {return hcalDepth2OverEcal();}
00406
00407
00408 private:
00409
00410
00411 ShowerShape showerShape_ ;
00412
00413
00414
00415
00416
00417
00418 public :
00419
00420 struct IsolationVariables
00421 {
00422 float tkSumPt ;
00423 float ecalRecHitSumEt ;
00424 float hcalDepth1TowerSumEt ;
00425 float hcalDepth2TowerSumEt ;
00426 float hcalDepth1TowerSumEtBc ;
00427 float hcalDepth2TowerSumEtBc ;
00428 IsolationVariables()
00429 : tkSumPt(0.), ecalRecHitSumEt(0.),
00430 hcalDepth1TowerSumEt(0.), hcalDepth2TowerSumEt(0.),
00431 hcalDepth1TowerSumEtBc(0.), hcalDepth2TowerSumEtBc(0.)
00432 {}
00433 } ;
00434
00435
00436 float dr03TkSumPt() const { return dr03_.tkSumPt ; }
00437 float dr03EcalRecHitSumEt() const { return dr03_.ecalRecHitSumEt ; }
00438 float dr03HcalDepth1TowerSumEt() const { return dr03_.hcalDepth1TowerSumEt ; }
00439 float dr03HcalDepth2TowerSumEt() const { return dr03_.hcalDepth2TowerSumEt ; }
00440 float dr03HcalTowerSumEt() const { return dr03HcalDepth1TowerSumEt()+dr03HcalDepth2TowerSumEt() ; }
00441 float dr03HcalDepth1TowerSumEtBc() const { return dr03_.hcalDepth1TowerSumEtBc ; }
00442 float dr03HcalDepth2TowerSumEtBc() const { return dr03_.hcalDepth2TowerSumEtBc ; }
00443 float dr03HcalTowerSumEtBc() const { return dr03HcalDepth1TowerSumEtBc()+dr03HcalDepth2TowerSumEtBc() ; }
00444 const IsolationVariables & dr03IsolationVariables() const { return dr03_ ; }
00445
00446
00447 float dr04TkSumPt() const { return dr04_.tkSumPt ; }
00448 float dr04EcalRecHitSumEt() const { return dr04_.ecalRecHitSumEt ; }
00449 float dr04HcalDepth1TowerSumEt() const { return dr04_.hcalDepth1TowerSumEt ; }
00450 float dr04HcalDepth2TowerSumEt() const { return dr04_.hcalDepth2TowerSumEt ; }
00451 float dr04HcalTowerSumEt() const { return dr04HcalDepth1TowerSumEt()+dr04HcalDepth2TowerSumEt() ; }
00452 float dr04HcalDepth1TowerSumEtBc() const { return dr04_.hcalDepth1TowerSumEtBc ; }
00453 float dr04HcalDepth2TowerSumEtBc() const { return dr04_.hcalDepth2TowerSumEtBc ; }
00454 float dr04HcalTowerSumEtBc() const { return dr04HcalDepth1TowerSumEtBc()+dr04HcalDepth2TowerSumEtBc() ; }
00455 const IsolationVariables & dr04IsolationVariables() const { return dr04_ ; }
00456
00457
00458 void setDr03Isolation( const IsolationVariables & dr03 ) { dr03_ = dr03 ; }
00459 void setDr04Isolation( const IsolationVariables & dr04 ) { dr04_ = dr04 ; }
00460
00461
00462 void setIsolation03( const IsolationVariables & dr03 ) { dr03_ = dr03 ; }
00463 void setIsolation04( const IsolationVariables & dr04 ) { dr04_ = dr04 ; }
00464 const IsolationVariables & isolationVariables03() const { return dr03_ ; }
00465 const IsolationVariables & isolationVariables04() const { return dr04_ ; }
00466
00467 private:
00468
00469
00470 IsolationVariables dr03_ ;
00471 IsolationVariables dr04_ ;
00472
00473
00474
00475
00476
00477
00478 public :
00479
00480 struct ConversionRejection
00481 {
00482 int flags ;
00483 TrackBaseRef partner ;
00484 float dist ;
00485 float dcot ;
00486 float radius ;
00487 ConversionRejection()
00488 : flags(-std::numeric_limits<float>::infinity()),
00489 dist(std::numeric_limits<float>::infinity()),
00490 dcot(std::numeric_limits<float>::infinity()),
00491 radius(std::numeric_limits<float>::infinity())
00492 {}
00493 } ;
00494
00495
00496 int convFlags() const { return conversionRejection_.flags ; }
00497 TrackBaseRef convPartner() const { return conversionRejection_.partner ; }
00498 float convDist() const { return conversionRejection_.dist ; }
00499 float convDcot() const { return conversionRejection_.dcot ; }
00500 float convRadius() const { return conversionRejection_.radius ; }
00501 const ConversionRejection & conversionRejectionVariables() const { return conversionRejection_ ; }
00502
00503 private:
00504
00505
00506 ConversionRejection conversionRejection_ ;
00507
00508
00509
00510
00511
00512
00513 public:
00514
00515 struct PflowIsolationVariables
00516 {
00517 float chargedHadronIso ;
00518 float neutralHadronIso ;
00519 float photonIso ;
00520 PflowIsolationVariables()
00521 : chargedHadronIso(0.), neutralHadronIso(0.), photonIso(0.)
00522 {}
00523 } ;
00524
00525 struct MvaInput
00526 {
00527 int earlyBrem ;
00528 int lateBrem ;
00529 float sigmaEtaEta ;
00530 float hadEnergy ;
00531 float deltaEta ;
00532 int nClusterOutsideMustache ;
00533 float etOutsideMustache ;
00534 MvaInput()
00535 : earlyBrem(-2), lateBrem(-2),
00536 sigmaEtaEta(std::numeric_limits<float>::infinity()),
00537 hadEnergy(0.),
00538 deltaEta(std::numeric_limits<float>::infinity()),
00539 nClusterOutsideMustache(-2),
00540 etOutsideMustache(-std::numeric_limits<float>::infinity())
00541 {}
00542 } ;
00543
00544 struct MvaOutput
00545 {
00546 int status ;
00547 float mva ;
00548 float mvaByPassForIsolated ;
00549 MvaOutput()
00550 : status(-1), mva(-999999999.), mvaByPassForIsolated(-999999999.)
00551 {}
00552 } ;
00553
00554
00555 const ShowerShape & pfShowerShape() const { return pfShowerShape_ ; }
00556 const PflowIsolationVariables & pfIsolationVariables() const { return pfIso_ ; }
00557 const MvaInput & mvaInput() const { return mvaInput_ ; }
00558 const MvaOutput & mvaOutput() const { return mvaOutput_ ; }
00559
00560
00561 void setPfShowerShape( const ShowerShape & shape ) { pfShowerShape_ = shape ; }
00562 void setPfIsolationVariables( const PflowIsolationVariables & iso ) { pfIso_ = iso ; }
00563 void setMvaInput( const MvaInput & mi ) { mvaInput_ = mi ; }
00564 void setMvaOutput( const MvaOutput & mo ) { mvaOutput_ = mo ; }
00565
00566
00567 float mva() const { return mvaOutput_.mva ; }
00568
00569 private:
00570
00571 ShowerShape pfShowerShape_ ;
00572 PflowIsolationVariables pfIso_ ;
00573 MvaInput mvaInput_ ;
00574 MvaOutput mvaOutput_ ;
00575
00576
00577
00578
00579
00580
00581 public :
00582
00583
00584 bool ecalDriven() const ;
00585 bool passingCutBasedPreselection() const { return passCutBasedPreselection_ ; }
00586 bool passingPflowPreselection() const { return passPflowPreselection_ ; }
00587 bool ambiguous() const { return ambiguous_ ; }
00588 GsfTrackRefVector::size_type ambiguousGsfTracksSize() const { return ambiguousGsfTracks_.size() ; }
00589 GsfTrackRefVector::const_iterator ambiguousGsfTracksBegin() const { return ambiguousGsfTracks_.begin() ; }
00590 GsfTrackRefVector::const_iterator ambiguousGsfTracksEnd() const { return ambiguousGsfTracks_.end() ; }
00591
00592
00593 void setPassCutBasedPreselection( bool flag ) { passCutBasedPreselection_ = flag ; }
00594 void setPassPflowPreselection( bool flag ) { passPflowPreselection_ = flag ; }
00595 void setAmbiguous( bool flag ) { ambiguous_ = flag ; }
00596 void clearAmbiguousGsfTracks() { ambiguousGsfTracks_.clear() ; }
00597 void addAmbiguousGsfTrack( const reco::GsfTrackRef & t ) { ambiguousGsfTracks_.push_back(t) ; }
00598
00599
00600 void setPassMvaPreselection( bool flag ) { passMvaPreslection_ = flag ; }
00601 bool passingMvaPreselection() const { return passMvaPreslection_ ; }
00602
00603 private:
00604
00605
00606 bool passCutBasedPreselection_ ;
00607 bool passPflowPreselection_ ;
00608 bool passMvaPreslection_ ;
00609 bool ambiguous_ ;
00610 GsfTrackRefVector ambiguousGsfTracks_ ;
00611
00612
00613
00614
00615
00616
00617 public :
00618
00619 struct ClassificationVariables
00620 {
00621 float trackFbrem ;
00622 float superClusterFbrem ;
00623 float pfSuperClusterFbrem ;
00624 ClassificationVariables()
00625 : trackFbrem(-1.e30), superClusterFbrem(-1.e30), pfSuperClusterFbrem(-1.e30)
00626 {}
00627 } ;
00628 enum Classification { UNKNOWN=-1, GOLDEN=0, BIGBREM=1, BADTRACK=2, SHOWERING=3, GAP=4 } ;
00629
00630
00631 float trackFbrem() const { return classVariables_.trackFbrem ; }
00632 float superClusterFbrem() const { return classVariables_.superClusterFbrem ; }
00633 float pfSuperClusterFbrem() const { return classVariables_.pfSuperClusterFbrem ; }
00634 const ClassificationVariables & classificationVariables() const { return classVariables_ ; }
00635 Classification classification() const { return class_ ; }
00636
00637
00638 int numberOfBrems() const { return basicClustersSize()-1 ; }
00639 float fbrem() const { return trackFbrem() ; }
00640
00641
00642 void setTrackFbrem( float fbrem ) { classVariables_.trackFbrem = fbrem ; }
00643 void setSuperClusterFbrem( float fbrem ) { classVariables_.superClusterFbrem = fbrem ; }
00644 void setPfSuperClusterFbrem( float fbrem ) { classVariables_.pfSuperClusterFbrem = fbrem ; }
00645 void setClassificationVariables( const ClassificationVariables & cv ) { classVariables_ = cv ; }
00646 void setClassification( Classification myclass ) { class_ = myclass ; }
00647
00648 private:
00649
00650
00651 ClassificationVariables classVariables_ ;
00652 Classification class_ ;
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676 public :
00677
00678 enum P4Kind { P4_UNKNOWN=-1, P4_FROM_SUPER_CLUSTER=0, P4_COMBINATION=1, P4_PFLOW_COMBINATION=2 } ;
00679
00680 struct Corrections
00681 {
00682 bool isEcalEnergyCorrected ;
00683 float correctedEcalEnergy ;
00684 float correctedEcalEnergyError ;
00685
00686 float trackMomentumError ;
00687
00688 LorentzVector fromSuperClusterP4 ;
00689 float fromSuperClusterP4Error ;
00690 LorentzVector combinedP4 ;
00691 float combinedP4Error ;
00692 LorentzVector pflowP4 ;
00693 float pflowP4Error ;
00694 P4Kind candidateP4Kind ;
00695
00696 Corrections()
00697 : isEcalEnergyCorrected(false), correctedEcalEnergy(0.), correctedEcalEnergyError(999.),
00698 trackMomentumError(999.),
00699 fromSuperClusterP4Error(999.), combinedP4Error(999.), pflowP4Error(999.),
00700 candidateP4Kind(P4_UNKNOWN)
00701 {}
00702 } ;
00703
00704
00705 void setCorrectedEcalEnergyError( float newEnergyError ) ;
00706 void setCorrectedEcalEnergy( float newEnergy ) ;
00707 void setTrackMomentumError( float trackMomentumError ) ;
00708 void setP4( P4Kind kind, const LorentzVector & p4, float p4Error, bool setCandidate ) ;
00709 using RecoCandidate::setP4 ;
00710
00711
00712 bool isEcalEnergyCorrected() const { return corrections_.isEcalEnergyCorrected ; }
00713 float correctedEcalEnergy() const { return corrections_.correctedEcalEnergy ; }
00714 float correctedEcalEnergyError() const { return corrections_.correctedEcalEnergyError ; }
00715 float trackMomentumError() const { return corrections_.trackMomentumError ; }
00716 const LorentzVector & p4( P4Kind kind ) const ;
00717 using RecoCandidate::p4 ;
00718 float p4Error( P4Kind kind ) const ;
00719 P4Kind candidateP4Kind() const { return corrections_.candidateP4Kind ; }
00720 const Corrections & corrections() const { return corrections_ ; }
00721
00722
00723 void setEcalEnergyError( float energyError ) { setCorrectedEcalEnergyError(energyError) ; }
00724 float ecalEnergy() const { return correctedEcalEnergy() ; }
00725 float ecalEnergyError() const { return correctedEcalEnergyError() ; }
00726
00727 float caloEnergy() const { return correctedEcalEnergy() ; }
00728 bool isEnergyScaleCorrected() const { return isEcalEnergyCorrected() ; }
00729 void correctEcalEnergy( float newEnergy, float newEnergyError )
00730 {
00731 setCorrectedEcalEnergy(newEnergy) ;
00732 setEcalEnergyError(newEnergyError) ;
00733 }
00734 void correctMomentum( const LorentzVector & p4, float trackMomentumError, float p4Error )
00735 { setTrackMomentumError(trackMomentumError) ; setP4(P4_COMBINATION,p4,p4Error,true) ; }
00736
00737
00738 private:
00739
00740
00741 Corrections corrections_ ;
00742
00743 } ;
00744
00745 }
00746
00747 #endif