50 trackProducer_(conf.getParameter<edm::
InputTag>(
"TrackProducer")),
51 gsfTrackProducer_(conf.getParameter<edm::
InputTag>(
"GsfTrackProducer")),
52 useGsfTracks_(conf.getParameter<bool>(
"UseGsfTracks")),
53 bsProducer_(conf.getParameter<edm::
InputTag>(
"BSProducer")),
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) {
132 TSCPBuilderNoMaterial tscpBuilder;
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->trackerExpectedHitsInner().numberOfLostHits();
237 unsigned int iLostHits = iGsfTrack->trackerExpectedHitsInner().numberOfLostHits();
239 if (nLostHits!=iLostHits) {
240 return (nLostHits > iLostHits);
int unsigned long long cacheIDTDGeom_
unsigned long long cacheIdentifier() const
void process(edm::Handle< reco::TrackCollection > tracksH, edm::Handle< reco::GsfTrackCollection > gsfTracksH, reco::ElectronCollection &outEle, Global3DPoint &bs)
math::XYZPoint Point
point in the space
bool momentumFromModeCartesian(const TrajectoryStateOnSurface tsos, GlobalVector &momentum) const
edm::InputTag bsProducer_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
edm::ESHandle< MagneticField > magField_
MultiTrajectoryStateMode * mtsMode_
void run(edm::Event &, reco::ElectronCollection &)
edm::InputTag gsfTrackProducer_
edm::InputTag trackProducer_
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
~EgammaHLTPixelMatchElectronAlgo()
T const * product() const
EgammaHLTPixelMatchElectronAlgo(const edm::ParameterSet &conf)
unsigned long long cacheIDMagField_
edm::ESHandle< TrackerGeometry > trackerGeom_
void setSuperCluster(const reco::SuperClusterRef &r)
set refrence to Photon component