37 beamSpotTag_ (consumes<
reco::
BeamSpot>(config.getParameter<
edm::InputTag>(
"beamSpotProducer"))),
38 upperTrackNrToRemoveCut_ (config.getParameter<
int>(
"upperTrackNrToRemoveCut")),
39 lowerTrackNrToRemoveCut_ (config.getParameter<
int>(
"lowerTrackNrToRemoveCut")) {
42 produces < reco::RecoEcalCandidateIsolationMap >(
"Deta" ).setBranchAlias(
"deta" );
43 produces < reco::RecoEcalCandidateIsolationMap >(
"DetaSeed" ).setBranchAlias(
"detaseed" );
44 produces < reco::RecoEcalCandidateIsolationMap >(
"Dphi" ).setBranchAlias(
"dphi" );
45 produces < reco::RecoEcalCandidateIsolationMap >(
"OneOESuperMinusOneOP" );
46 produces < reco::RecoEcalCandidateIsolationMap >(
"OneOESeedMinusOneOP" );
47 produces < reco::RecoEcalCandidateIsolationMap >(
"MissingHits" ).setBranchAlias(
"missinghits" );
48 produces < reco::RecoEcalCandidateIsolationMap >(
"Chi2" ).setBranchAlias(
"chi2" );
49 produces < reco::RecoEcalCandidateIsolationMap >(
"ValidHits" ).setBranchAlias(
"validhits" );
60 desc.
add<
int>((
"upperTrackNrToRemoveCut"), 9999);
61 desc.
add<
int>((
"lowerTrackNrToRemoveCut"), -1);
62 descriptions.
add(
"hltEgammaHLTGsfTrackVarProducer", desc);
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");
212 cacheIDTDGeom_(rhs.cacheIDTDGeom_),
213 cacheIDMagField_(rhs.cacheIDMagField_),
214 magField_(rhs.magField_),
215 trackerHandle_(rhs.trackerHandle_),
216 mtsMode_(rhs.mtsMode_)
242 bool updateField(
false);
249 bool updateGeometry(
false);
251 updateGeometry =
true;
268 return extrapolatedPos;
277 return extrapolatedMom;
unsigned long long cacheIdentifier() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool positionFromModeCartesian(const TrajectoryStateOnSurface tsos, GlobalPoint &position) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool momentumFromModeCartesian(const TrajectoryStateOnSurface tsos, GlobalVector &momentum) const
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandTag_
const edm::EDGetTokenT< reco::GsfTrackCollection > inputCollectionTag2_
TrackExtrapolator trackExtrapolator_
~EgammaHLTGsfTrackVarProducer()
const edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
EgammaHLTGsfTrackVarProducer(const edm::ParameterSet &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< Electron > ElectronCollection
collectin of Electron objects
void produce(edm::Event &, const edm::EventSetup &) override
const edm::EDGetTokenT< reco::ElectronCollection > inputCollectionTag1_
void insert(const key_type &k, const data_type &v)
insert an association
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects
const Point & position() const
position
const int upperTrackNrToRemoveCut_
T const * product() const
const int lowerTrackNrToRemoveCut_