52 useGsfTracks_(conf.getParameter<
bool>(
"UseGsfTracks")),
69 bool updateField(
false);
77 bool updateGeometry(
false);
79 updateGeometry =
true;
111 process(tracksH, gsfTracksH, outEle, bs);
120 for (
unsigned int i=0;
i<tracksH->size(); ++
i) {
135 float scale = scRef->energy()/tscp.momentum().mag();
138 tscp.momentum().y()*
scale,
139 tscp.momentum().z()*
scale,
142 Electron ele(trackRef->charge(), momentum, trackRef->vertex());
143 ele.setSuperCluster(scRef);
146 outEle.push_back(ele);
151 std::vector<unsigned int>
flag(gsfTracksH->size(), 0);
152 if (gsfTracksH->empty())
155 for (
unsigned int i=0;
i<gsfTracksH->size()-1; ++
i) {
163 float pin1 = trackRef1->pMode();
169 for (
unsigned int j=
i+1; j<gsfTracksH->size(); ++j) {
177 float pin2 = trackRef2->pMode();
183 if (scRef1 == scRef2) {
184 bool isSameLayer =
false;
187 if (iGsfInnermostWithLostHits) {
189 }
else if(isSameLayer) {
190 if(fabs((scRef1->energy()/pin1)-1) < fabs((scRef2->energy()/pin2)-1))
199 for (
unsigned int i=0;
i<gsfTracksH->size(); ++
i) {
216 float scale = scRef->energy()/innMom.
mag();
222 Electron ele(trackRef->charge(), momentum, trackRef->vertex());
223 ele.setSuperCluster(scRef);
225 ele.setGsfTrack(myRef);
226 outEle.push_back(ele);
234 unsigned int nLostHits = nGsfTrack->hitPattern().numberOfLostHits(HitPattern::MISSING_INNER_HITS);
235 unsigned int iLostHits = iGsfTrack->hitPattern().numberOfLostHits(HitPattern::MISSING_INNER_HITS);
237 if (nLostHits!=iLostHits) {
238 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
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
edm::ESHandle< MagneticField > magField_
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_
unsigned long long cacheIDMagField_
edm::ESHandle< TrackerGeometry > trackerGeom_
const Point & position() const
position
bool momentumFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
T const * product() const