159 for (
unsigned int iRecoEcalCand = 0; iRecoEcalCand < recoEcalCandHandle->size(); ++iRecoEcalCand) {
165 std::vector<const reco::GsfTrack*>
gsfTracks;
167 for (
auto const& ele : *electronHandle) {
168 if (ele.superCluster() == scRef) {
169 gsfTracks.push_back(ele.gsfTrack().get());
181 int nLayerITValue = -1;
182 int validHitsValue = 0;
183 float chi2Value = 9999999.;
184 float missingHitsValue = 9999999;
185 float dEtaInValue = 999999;
186 float dEtaSeedInValue = 999999;
187 float dPhiInValue = 999999;
188 float oneOverESuperMinusOneOverPValue = 999999;
189 float oneOverESeedMinusOneOverPValue = 999999;
190 float fbrem = 999999;
195 const bool useDefaultValues =
std::abs(recoEcalCandRef->eta()) < 1.479
200 GsfTrackExtrapolations gsfTrackExtrapolations;
202 if (rmCutsDueToNrTracks || useDefaultValues) {
207 missingHitsValue = 0;
208 validHitsValue = 100;
210 oneOverESuperMinusOneOverPValue = 0;
211 oneOverESeedMinusOneOverPValue = 0;
214 for (
size_t trkNr = 0; trkNr <
gsfTracks.size(); trkNr++) {
215 GlobalPoint scPos(scRef->x(), scRef->y(), scRef->z());
217 gsfTrackExtrapolations(*
gsfTracks[trkNr], *scRef, mtsTransform);
219 EleRelPointPair scAtVtx(scRef->position(), gsfTrackExtrapolations.sclPos, beamSpotPosition);
221 fbrem = calRelDelta(gsfTrackExtrapolations.innMom.mag(), gsfTrackExtrapolations.outMom.mag(),
fbrem);
224 if (scRef->energy() != 0 && trkP != 0) {
225 fillAbsAbleVar(oneOverESuperMinusOneOverPValue, 1 / scRef->energy() - 1 / trkP);
227 if (scRef->seed().
isNonnull() && scRef->seed()->energy() != 0 && trkP != 0) {
228 fillAbsAbleVar(oneOverESeedMinusOneOverPValue, 1 / scRef->seed()->energy() - 1 / trkP);
231 if (
gsfTracks[trkNr]->missingInnerHits() < missingHitsValue) {
232 missingHitsValue =
gsfTracks[trkNr]->missingInnerHits();
238 validHitsValue =
gsfTracks[trkNr]->numberOfValidHits();
242 nLayerITValue =
gsfTracks[trkNr]->hitPattern().pixelLayersWithMeasurement();
246 chi2Value =
gsfTracks[trkNr]->normalizedChi2();
250 fillAbsAbleVar(dEtaSeedInValue, scAtVtx.dEta() - scRef->position().eta() + scRef->seed()->position().eta());
255 dEtaMap.insert(recoEcalCandRef, dEtaInValue);
256 dEtaSeedMap.insert(recoEcalCandRef, dEtaSeedInValue);
257 dPhiMap.insert(recoEcalCandRef, dPhiInValue);
258 oneOverESuperMinusOneOverPMap.insert(recoEcalCandRef, oneOverESuperMinusOneOverPValue);
259 oneOverESeedMinusOneOverPMap.insert(recoEcalCandRef, oneOverESeedMinusOneOverPValue);
260 missingHitsMap.insert(recoEcalCandRef, missingHitsValue);
261 validHitsMap.insert(recoEcalCandRef, validHitsValue);
262 nLayerITMap.insert(recoEcalCandRef, nLayerITValue);
263 chi2Map.insert(recoEcalCandRef, chi2Value);
264 fbremMap.insert(recoEcalCandRef,
fbrem);
const edm::EDGetTokenT< reco::ElectronCollection > electronToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandToken_
bool isNonnull() const
Checks for non-null.
const edm::EDPutTokenT< reco::RecoEcalCandidateIsolationMap > oneOverESuperMinusOneOverPMapPutToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
const edm::EDPutTokenT< reco::RecoEcalCandidateIsolationMap > chi2MapPutToken_
const edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
const edm::EDPutTokenT< reco::RecoEcalCandidateIsolationMap > validHitsMapPutToken_
Abs< T >::type abs(const T &t)
const edm::EDPutTokenT< reco::RecoEcalCandidateIsolationMap > dEtaMapPutToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
const edm::EDPutTokenT< reco::RecoEcalCandidateIsolationMap > fbremMapPutToken_
const edm::EDPutTokenT< reco::RecoEcalCandidateIsolationMap > oneOverESeedMinusOneOverPMapPutToken_
void fillAbsAbleVar(float &existVal, const float newVal) const
const bool useDefaultValuesForBarrel_
const bool useDefaultValuesForEndcap_
const edm::EDPutTokenT< reco::RecoEcalCandidateIsolationMap > dPhiMapPutToken_
const edm::EDPutTokenT< reco::RecoEcalCandidateIsolationMap > nLayerITMapPutToken_
const edm::EDPutTokenT< reco::RecoEcalCandidateIsolationMap > dEtaSeedMapPutToken_
const edm::EDGetTokenT< reco::GsfTrackCollection > gsfTrackToken_
const int upperTrackNrToRemoveCut_
const edm::EDPutTokenT< reco::RecoEcalCandidateIsolationMap > missingHitsMapPutToken_