96 for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoEcalCandHandle->begin(); iRecoEcalCand != recoEcalCandHandle->end(); iRecoEcalCand++){
102 std::vector<const reco::GsfTrack*>
gsfTracks;
104 for(reco::ElectronCollection::const_iterator eleIt = electronHandle->begin(); eleIt != electronHandle->end(); eleIt++){
105 if(eleIt->superCluster()==scRef){
106 gsfTracks.push_back(&*eleIt->gsfTrack());
110 for(reco::GsfTrackCollection::const_iterator trkIt =gsfTracksHandle->begin();trkIt!=gsfTracksHandle->end();++trkIt){
115 if(scRefFromTrk==scRef){
116 gsfTracks.push_back(&*trkIt);
122 int validHitsValue = 9999999;
123 float chi2Value = 9999999.;
124 float missingHitsValue = 9999999;
125 float dEtaInValue=999999;
126 float dEtaSeedInValue=999999;
127 float dPhiInValue=999999;
128 float oneOverESuperMinusOneOverPValue=999999;
129 float oneOverESeedMinusOneOverPValue=999999;
135 missingHitsValue = 0;
142 missingHitsValue = 0;
146 for(
size_t trkNr=0;trkNr<gsfTracks.size();trkNr++){
148 GlobalPoint scPos(scRef->x(),scRef->y(),scRef->z());
152 float trkP = gsfTracks[trkNr]->p();
153 if(scRef->energy()!=0 && trkP!=0){
154 if(fabs(1/scRef->energy() - 1/trkP)<oneOverESuperMinusOneOverPValue) oneOverESuperMinusOneOverPValue =fabs(1/scRef->energy() - 1/trkP);
156 if(scRef->seed().isNonnull() && scRef->seed()->energy()!=0 && trkP!=0){
157 if(fabs(1/scRef->seed()->energy() - 1/trkP)<oneOverESeedMinusOneOverPValue) oneOverESeedMinusOneOverPValue =fabs(1/scRef->seed()->energy() - 1/trkP);
164 if (gsfTracks[trkNr]->numberOfValidHits() < validHitsValue)
165 validHitsValue = gsfTracks[trkNr]->numberOfValidHits();
167 if (gsfTracks[trkNr]->numberOfValidHits() < chi2Value)
168 chi2Value = gsfTracks[trkNr]->normalizedChi2();
170 if (fabs(scAtVtx.dEta())<dEtaInValue)
171 dEtaInValue=fabs(scAtVtx.dEta());
173 if (fabs(scAtVtx.dEta())<dEtaSeedInValue)
174 dEtaSeedInValue = fabs(scAtVtx.dEta()-scRef->position().eta()+scRef->seed()->position().eta());
176 if (fabs(scAtVtx.dPhi())<dPhiInValue)
177 dPhiInValue=fabs(scAtVtx.dPhi());
181 dEtaMap.insert(recoEcalCandRef, dEtaInValue);
182 dEtaSeedMap.insert(recoEcalCandRef, dEtaSeedInValue);
183 dPhiMap.insert(recoEcalCandRef, dPhiInValue);
184 oneOverESuperMinusOneOverPMap.insert(recoEcalCandRef,oneOverESuperMinusOneOverPValue);
185 oneOverESeedMinusOneOverPMap.insert(recoEcalCandRef,oneOverESeedMinusOneOverPValue);
186 missingHitsMap.insert(recoEcalCandRef, missingHitsValue);
187 validHitsMap.insert(recoEcalCandRef, validHitsValue);
188 chi2Map.insert(recoEcalCandRef, chi2Value);
191 auto dEtaMapForEvent = std::make_unique<reco::RecoEcalCandidateIsolationMap>(dEtaMap);
192 auto dEtaSeedMapForEvent = std::make_unique<reco::RecoEcalCandidateIsolationMap>(dEtaSeedMap);
193 auto dPhiMapForEvent = std::make_unique<reco::RecoEcalCandidateIsolationMap>(dPhiMap);
194 auto oneOverESuperMinusOneOverPMapForEvent = std::make_unique<reco::RecoEcalCandidateIsolationMap>(oneOverESuperMinusOneOverPMap);
195 auto oneOverESeedMinusOneOverPMapForEvent = std::make_unique<reco::RecoEcalCandidateIsolationMap>(oneOverESeedMinusOneOverPMap);
196 auto missingHitsForEvent = std::make_unique<reco::RecoEcalCandidateIsolationMap>(missingHitsMap);
197 auto validHitsForEvent = std::make_unique<reco::RecoEcalCandidateIsolationMap>(validHitsMap);
198 auto chi2ForEvent = std::make_unique<reco::RecoEcalCandidateIsolationMap>(chi2Map);
201 iEvent.
put(
std::move(dEtaSeedMapForEvent),
"DetaSeed" );
203 iEvent.
put(
std::move(oneOverESuperMinusOneOverPMapForEvent),
"OneOESuperMinusOneOP");
204 iEvent.
put(
std::move(oneOverESeedMinusOneOverPMapForEvent),
"OneOESeedMinusOneOP");
205 iEvent.
put(
std::move(missingHitsForEvent),
"MissingHits");
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandTag_
const edm::EDGetTokenT< reco::GsfTrackCollection > inputCollectionTag2_
TrackExtrapolator trackExtrapolator_
const edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
const edm::EDGetTokenT< reco::ElectronCollection > inputCollectionTag1_
const Point & position() const
position
const int upperTrackNrToRemoveCut_
const int lowerTrackNrToRemoveCut_