52 useGsfTracks_(conf.getParameter<bool>(
"UseGsfTracks")),
71 bool updateField(
false);
79 bool updateGeometry(
false);
81 updateGeometry =
true;
113 process(tracksH, gsfTracksH, outEle, bs);
122 for (
unsigned int i=0;
i<tracksH->size(); ++
i) {
137 float scale = scRef->energy()/tscp.momentum().mag();
140 tscp.momentum().y()*
scale,
141 tscp.momentum().z()*
scale,
144 Electron ele(trackRef->charge(), momentum, trackRef->vertex());
148 outEle.push_back(ele);
153 std::vector<unsigned int> flag(gsfTracksH->size(), 0);
154 if (gsfTracksH->size() == 0)
157 for (
unsigned int i=0;
i<gsfTracksH->size()-1; ++
i) {
165 float pin1 = trackRef1->pMode();
171 for (
unsigned int j=
i+1;
j<gsfTracksH->size(); ++
j) {
179 float pin2 = trackRef2->pMode();
185 if (scRef1 == scRef2) {
186 bool isSameLayer =
false;
189 if (iGsfInnermostWithLostHits) {
191 }
else if(isSameLayer) {
192 if(fabs((scRef1->energy()/pin1)-1) < fabs((scRef2->energy()/pin2)-1))
201 for (
unsigned int i=0;
i<gsfTracksH->size(); ++
i) {
218 float scale = scRef->energy()/innMom.
mag();
224 Electron ele(trackRef->charge(), momentum, trackRef->vertex());
227 ele.setGsfTrack(myRef);
228 outEle.push_back(ele);
236 unsigned int nLostHits = nGsfTrack->hitPattern().numberOfLostHits(HitPattern::MISSING_INNER_HITS);
237 unsigned int iLostHits = iGsfTrack->hitPattern().numberOfLostHits(HitPattern::MISSING_INNER_HITS);
239 if (nLostHits!=iLostHits) {
240 return (nLostHits > iLostHits);
int unsigned long long cacheIDTDGeom_
unsigned long long cacheIdentifier() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void process(edm::Handle< reco::TrackCollection > tracksH, edm::Handle< reco::GsfTrackCollection > gsfTracksH, reco::ElectronCollection &outEle, Global3DPoint &bs)
std::vector< Track > TrackCollection
collection of Tracks
math::XYZPoint Point
point in the space
bool momentumFromModeCartesian(const TrajectoryStateOnSurface tsos, GlobalVector &momentum) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
edm::ESHandle< MagneticField > magField_
MultiTrajectoryStateMode * mtsMode_
edm::EDGetTokenT< reco::GsfTrackCollection > gsfTrackProducer_
void run(edm::Event &, reco::ElectronCollection &)
EgammaHLTPixelMatchElectronAlgo(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
bool isInnerMostWithLostHits(const reco::GsfTrackRef &, const reco::GsfTrackRef &, bool &)
void setupES(const edm::EventSetup &setup)
MultiTrajectoryStateTransform * mtsTransform_
std::vector< Electron > ElectronCollection
collectin of Electron objects
~EgammaHLTPixelMatchElectronAlgo()
edm::EDGetTokenT< reco::BeamSpot > bsProducer_
edm::EDGetTokenT< reco::TrackCollection > trackProducer_
T const * product() const
unsigned long long cacheIDMagField_
edm::ESHandle< TrackerGeometry > trackerGeom_
void setSuperCluster(const reco::SuperClusterRef &r)
set refrence to Photon component