47 : trackProducer_(iC.consumes(conf.getParameter<
edm::
InputTag>(
"TrackProducer"))),
48 gsfTrackProducer_(iC.consumes(conf.getParameter<
edm::
InputTag>(
"GsfTrackProducer"))),
49 useGsfTracks_(conf.getParameter<
bool>(
"UseGsfTracks")),
101 for (
unsigned int i = 0;
i < tracksH->size(); ++
i) {
115 float scale = scRef->energy() / tscp.momentum().mag();
118 tscp.momentum().x() *
scale, tscp.momentum().y() *
scale, tscp.momentum().z() *
scale, scRef->energy());
120 Electron ele(trackRef->charge(), momentum, trackRef->vertex());
121 ele.setSuperCluster(scRef);
124 outEle.push_back(ele);
128 std::vector<unsigned int>
flag(gsfTracksH->size(), 0);
129 if (gsfTracksH->empty())
132 for (
unsigned int i = 0;
i < gsfTracksH->size() - 1; ++
i) {
140 float pin1 = trackRef1->pMode();
146 for (
unsigned int j =
i + 1;
j < gsfTracksH->size(); ++
j) {
154 float pin2 = trackRef2->pMode();
160 if (scRef1 == scRef2) {
161 bool isSameLayer =
false;
164 if (iGsfInnermostWithLostHits) {
166 }
else if (isSameLayer) {
167 if (fabs((scRef1->energy() / pin1) - 1) < fabs((scRef2->energy() / pin2) - 1))
176 for (
unsigned int i = 0;
i < gsfTracksH->size(); ++
i) {
193 float scale = scRef->energy() / innMom.
mag();
197 Electron ele(trackRef->charge(), momentum, trackRef->vertex());
198 ele.setSuperCluster(scRef);
200 ele.setGsfTrack(myRef);
201 outEle.push_back(ele);
210 auto nLostHits = nGsfTrack->missingInnerHits();
211 auto iLostHits = iGsfTrack->missingInnerHits();
213 if (nLostHits != iLostHits) {
214 return (nLostHits > iLostHits);
const Point & position() const
position
void process(edm::Handle< reco::TrackCollection > tracksH, edm::Handle< reco::GsfTrackCollection > gsfTracksH, reco::ElectronCollection &outEle, Global3DPoint &bs)
math::XYZPoint Point
point in the space
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
edm::ESHandle< MagneticField > magField_
T const * product() const
edm::EDGetTokenT< reco::GsfTrackCollection > gsfTrackProducer_
void run(edm::Event &, reco::ElectronCollection &)
edm::ESWatcher< TrackerDigiGeometryRecord > trackerGeometryWatcher_
EgammaHLTPixelMatchElectronAlgo(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
bool isInnerMostWithLostHits(const reco::GsfTrackRef &, const reco::GsfTrackRef &, bool &)
void setupES(const edm::EventSetup &setup)
edm::ESWatcher< IdealMagneticFieldRecord > magneticFieldWatcher_
std::vector< Electron > ElectronCollection
collectin of Electron objects
edm::EDGetTokenT< reco::BeamSpot > bsProducer_
edm::EDGetTokenT< reco::TrackCollection > trackProducer_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
bool check(const edm::EventSetup &iSetup)
std::unique_ptr< MultiTrajectoryStateTransform > mtsTransform_
edm::ESHandle< TrackerGeometry > trackerGeom_
bool momentumFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)