Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:06

0001 
0002 #include "DataFormats/EgammaCandidates/interface/GsfElectronCore.h"
0003 #include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
0004 #include "DataFormats/EgammaReco/interface/ElectronSeedFwd.h"
0005 #include "DataFormats/EgammaReco/interface/ElectronSeed.h"
0006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0007 
0008 #include <cmath>
0009 
0010 using namespace reco;
0011 
0012 GsfElectronCore::GsfElectronCore() : ctfGsfOverlap_(0.), isEcalDrivenSeed_(false), isTrackerDrivenSeed_(false) {}
0013 
0014 GsfElectronCore::GsfElectronCore(const GsfTrackRef& gsfTrack)
0015     : gsfTrack_(gsfTrack), ctfGsfOverlap_(0.), isEcalDrivenSeed_(false), isTrackerDrivenSeed_(false) {
0016   edm::RefToBase<TrajectorySeed> seed = gsfTrack_->extra()->seedRef();
0017   if (seed.isNull()) {
0018     edm::LogError("GsfElectronCore") << "The GsfTrack has no seed ?!";
0019   } else {
0020     ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>();
0021     if (elseed.isNull()) {
0022       edm::LogError("GsfElectronCore") << "The GsfTrack seed is not an ElectronSeed ?!";
0023     } else {
0024       if (elseed->isEcalDriven())
0025         isEcalDrivenSeed_ = true;
0026       if (elseed->isTrackerDriven())
0027         isTrackerDrivenSeed_ = true;
0028     }
0029   }
0030 }
0031 
0032 GsfElectronCore* GsfElectronCore::clone() const { return new GsfElectronCore(*this); }