73 electronToken_{consumes<reco::ElectronCollection>(
config.getParameter<
edm::InputTag>(
"inputCollection"))},
74 gsfTrackToken_{consumes<reco::GsfTrackCollection>(
config.getParameter<
edm::InputTag>(
"inputCollection"))},
75 beamSpotToken_{consumes<reco::BeamSpot>(
config.getParameter<
edm::InputTag>(
"beamSpotProducer"))},
76 magneticFieldToken_{esConsumes<MagneticField, IdealMagneticFieldRecord>()},
77 trackerGeometryToken_{esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>()},
78 upperTrackNrToRemoveCut_{
config.getParameter<
int>(
"upperTrackNrToRemoveCut")},
79 lowerTrackNrToRemoveCut_{
config.getParameter<
int>(
"lowerTrackNrToRemoveCut")},
80 useDefaultValuesForBarrel_{
config.getParameter<
bool>(
"useDefaultValuesForBarrel")},
81 useDefaultValuesForEndcap_{
config.getParameter<
bool>(
"useDefaultValuesForEndcap")},
82 dEtaMapPutToken_{produces<reco::RecoEcalCandidateIsolationMap>(
"Deta").setBranchAlias(
"deta")},
83 dEtaSeedMapPutToken_{produces<reco::RecoEcalCandidateIsolationMap>(
"DetaSeed").setBranchAlias(
"detaseed")},
84 dPhiMapPutToken_{produces<reco::RecoEcalCandidateIsolationMap>(
"Dphi").setBranchAlias(
"dphi")},
85 oneOverESuperMinusOneOverPMapPutToken_{produces<reco::RecoEcalCandidateIsolationMap>(
"OneOESuperMinusOneOP")},
86 oneOverESeedMinusOneOverPMapPutToken_{produces<reco::RecoEcalCandidateIsolationMap>(
"OneOESeedMinusOneOP")},
87 missingHitsMapPutToken_{
88 produces<reco::RecoEcalCandidateIsolationMap>(
"MissingHits").setBranchAlias(
"missinghits")},
89 validHitsMapPutToken_{produces<reco::RecoEcalCandidateIsolationMap>(
"Chi2").setBranchAlias(
"chi2")},
90 chi2MapPutToken_{produces<reco::RecoEcalCandidateIsolationMap>(
"ValidHits").setBranchAlias(
"validhits")} {}
97 desc.
add<
int>((
"upperTrackNrToRemoveCut"), 9999);
98 desc.
add<
int>((
"lowerTrackNrToRemoveCut"), -1);
99 desc.
add<
bool>((
"useDefaultValuesForBarrel"),
false);
100 desc.
add<
bool>((
"useDefaultValuesForEndcap"),
false);
102 descriptions.
add(
"hltEgammaHLTGsfTrackVarProducer", desc);
124 for (
unsigned int iRecoEcalCand = 0; iRecoEcalCand < recoEcalCandHandle->size(); ++iRecoEcalCand) {
129 std::vector<const reco::GsfTrack*>
gsfTracks;
131 for (
auto const& ele : *electronHandle) {
132 if (ele.superCluster() == scRef) {
133 gsfTracks.push_back(ele.gsfTrack().get());
145 int validHitsValue = 0;
146 float chi2Value = 9999999.;
147 float missingHitsValue = 9999999;
148 float dEtaInValue = 999999;
149 float dEtaSeedInValue = 999999;
150 float dPhiInValue = 999999;
151 float oneOverESuperMinusOneOverPValue = 999999;
152 float oneOverESeedMinusOneOverPValue = 999999;
157 const bool useDefaultValues =
std::abs(recoEcalCandRef->eta()) < 1.479
161 if (rmCutsDueToNrTracks || useDefaultValues) {
165 missingHitsValue = 0;
166 validHitsValue = 100;
168 oneOverESuperMinusOneOverPValue = 0;
169 oneOverESeedMinusOneOverPValue = 0;
171 for (
size_t trkNr = 0; trkNr <
gsfTracks.size(); trkNr++) {
172 GlobalPoint scPos(scRef->x(), scRef->y(), scRef->z());
178 auto posTSOS = extrapolator.extrapolate(innTSOS, scPos);
182 EleRelPointPair scAtVtx(scRef->position(), trackExtrapToSC, beamSpotPosition);
185 if (scRef->energy() != 0 && trkP != 0) {
186 if (
std::abs(1 / scRef->energy() - 1 / trkP) < oneOverESuperMinusOneOverPValue) {
187 oneOverESuperMinusOneOverPValue =
std::abs(1 / scRef->energy() - 1 / trkP);
190 if (scRef->seed().
isNonnull() && scRef->seed()->energy() != 0 && trkP != 0) {
191 if (
std::abs(1 / scRef->seed()->energy() - 1 / trkP) < oneOverESeedMinusOneOverPValue) {
192 oneOverESeedMinusOneOverPValue =
std::abs(1 / scRef->seed()->energy() - 1 / trkP);
201 validHitsValue =
gsfTracks[trkNr]->numberOfValidHits();
205 chi2Value =
gsfTracks[trkNr]->normalizedChi2();
208 if (
std::abs(scAtVtx.dEta()) < dEtaInValue) {
210 dEtaInValue =
std::abs(scAtVtx.dEta());
213 if (
std::abs(scAtVtx.dEta()) < dEtaSeedInValue) {
214 dEtaSeedInValue =
std::abs(scAtVtx.dEta() - scRef->position().eta() + scRef->seed()->position().eta());
217 if (
std::abs(scAtVtx.dPhi()) < dPhiInValue) {
219 dPhiInValue =
std::abs(scAtVtx.dPhi());
224 dEtaMap.
insert(recoEcalCandRef, dEtaInValue);
225 dEtaSeedMap.
insert(recoEcalCandRef, dEtaSeedInValue);
226 dPhiMap.
insert(recoEcalCandRef, dPhiInValue);
227 oneOverESuperMinusOneOverPMap.
insert(recoEcalCandRef, oneOverESuperMinusOneOverPValue);
228 oneOverESeedMinusOneOverPMap.
insert(recoEcalCandRef, oneOverESeedMinusOneOverPValue);
229 missingHitsMap.
insert(recoEcalCandRef, missingHitsValue);
230 validHitsMap.
insert(recoEcalCandRef, validHitsValue);
231 chi2Map.
insert(recoEcalCandRef, chi2Value);