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);
200 iEvent.
put(dEtaMapForEvent,
"Deta" );
201 iEvent.
put(dEtaSeedMapForEvent,
"DetaSeed" );
202 iEvent.
put(dPhiMapForEvent,
"Dphi" );
203 iEvent.
put(oneOverESuperMinusOneOverPMapForEvent,
"OneOESuperMinusOneOP");
204 iEvent.
put(oneOverESeedMinusOneOverPMapForEvent,
"OneOESeedMinusOneOP");
205 iEvent.
put(missingHitsForEvent,
"MissingHits");
206 iEvent.
put(validHitsForEvent,
"ValidHits");
207 iEvent.
put(chi2ForEvent,
"Chi2");
212 cacheIDTDGeom_(rhs.cacheIDTDGeom_),
213 cacheIDMagField_(rhs.cacheIDMagField_),
214 magField_(rhs.magField_),
215 trackerHandle_(rhs.trackerHandle_),
216 mtsMode_(rhs.mtsMode_)
233 delete mtsTransform_;
235 else mtsTransform_ =0;
242 bool updateField(
false);
249 bool updateGeometry(
false);
251 updateGeometry =
true;
256 if ( updateField || updateGeometry || !mtsTransform_ ) {
257 delete mtsTransform_;
267 mtsMode()->positionFromModeCartesian(posTSOS,extrapolatedPos);
268 return extrapolatedPos;
276 mtsMode()->momentumFromModeCartesian(posTSOS,extrapolatedMom);
277 return extrapolatedMom;
unsigned long long cacheIdentifier() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandTag_
const edm::EDGetTokenT< reco::GsfTrackCollection > inputCollectionTag2_
TrackExtrapolator trackExtrapolator_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
~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
REF castTo() const
cast to a concrete type
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_
const int lowerTrackNrToRemoveCut_