43 produces < reco::RecoEcalCandidateIsolationMap >(
"Deta" ).setBranchAlias(
"deta" );
44 produces < reco::RecoEcalCandidateIsolationMap >(
"Dphi" ).setBranchAlias(
"dphi" );
45 produces < reco::RecoEcalCandidateIsolationMap >(
"OneOESuperMinusOneOP" );
46 produces < reco::RecoEcalCandidateIsolationMap >(
"OneOESeedMinusOneOP" );
47 produces < reco::RecoEcalCandidateIsolationMap >(
"MissingHits" ).setBranchAlias(
"missinghits" );
58 desc.
add<
int>((
"upperTrackNrToRemoveCut"), 9999);
59 desc.
add<
int>((
"lowerTrackNrToRemoveCut"), -1);
60 descriptions.
add(
"hltEgammaHLTGsfTrackVarProducer", desc);
91 for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoEcalCandHandle->begin(); iRecoEcalCand != recoEcalCandHandle->end(); iRecoEcalCand++){
97 std::vector<const reco::GsfTrack*> gsfTracks;
99 for(reco::ElectronCollection::const_iterator eleIt = electronHandle->begin(); eleIt != electronHandle->end(); eleIt++){
100 if(eleIt->superCluster()==scRef){
101 gsfTracks.push_back(&*eleIt->gsfTrack());
105 for(reco::GsfTrackCollection::const_iterator trkIt =gsfTracksHandle->begin();trkIt!=gsfTracksHandle->end();++trkIt){
110 if(scRefFromTrk==scRef){
111 gsfTracks.push_back(&*trkIt);
117 float missingHitsValue = 9999999;
118 float dEtaInValue=999999;
119 float dPhiInValue=999999;
120 float oneOverESuperMinusOneOverPValue=999999;
121 float oneOverESeedMinusOneOverPValue=999999;
126 missingHitsValue = 0;
130 missingHitsValue = 0;
132 for(
size_t trkNr=0;trkNr<gsfTracks.size();trkNr++){
134 GlobalPoint scPos(scRef->x(),scRef->y(),scRef->z());
139 float trkP = gsfTracks[trkNr]->p();
140 if(scRef->energy()!=0 && trkP!=0){
141 if(fabs(1/scRef->energy() - 1/trkP)<oneOverESuperMinusOneOverPValue) oneOverESuperMinusOneOverPValue =fabs(1/scRef->energy() - 1/trkP);
143 if(scRef->seed().isNonnull() && scRef->seed()->energy()!=0 && trkP!=0){
144 if(fabs(1/scRef->seed()->energy() - 1/trkP)<oneOverESeedMinusOneOverPValue) oneOverESeedMinusOneOverPValue =fabs(1/scRef->seed()->energy() - 1/trkP);
147 if (gsfTracks[trkNr]->trackerExpectedHitsInner().numberOfLostHits() < missingHitsValue)
148 missingHitsValue = gsfTracks[trkNr]->trackerExpectedHitsInner().numberOfLostHits();
149 if (fabs(scAtVtx.dEta())<dEtaInValue)
150 dEtaInValue=fabs(scAtVtx.dEta());
151 if (fabs(scAtVtx.dPhi())<dPhiInValue)
152 dPhiInValue=fabs(scAtVtx.dPhi());
156 dEtaMap.
insert(recoEcalCandRef, dEtaInValue);
157 dPhiMap.
insert(recoEcalCandRef, dPhiInValue);
158 oneOverESuperMinusOneOverPMap.
insert(recoEcalCandRef,oneOverESuperMinusOneOverPValue);
159 oneOverESeedMinusOneOverPMap.
insert(recoEcalCandRef,oneOverESeedMinusOneOverPValue);
160 missingHitsMap.
insert(recoEcalCandRef, missingHitsValue);
168 iEvent.
put(dEtaMapForEvent,
"Deta" );
169 iEvent.
put(dPhiMapForEvent,
"Dphi" );
170 iEvent.
put(oneOverESuperMinusOneOverPMapForEvent,
"OneOESuperMinusOneOP");
171 iEvent.
put(oneOverESeedMinusOneOverPMapForEvent,
"OneOESeedMinusOneOP");
172 iEvent.
put(missingHitsForEvent,
"MissingHits");
177 cacheIDTDGeom_(rhs.cacheIDTDGeom_),
178 cacheIDMagField_(rhs.cacheIDMagField_),
179 magField_(rhs.magField_),
180 trackerHandle_(rhs.trackerHandle_),
181 mtsMode_(rhs.mtsMode_)
198 delete mtsTransform_;
200 else mtsTransform_ =0;
207 bool updateField(
false);
214 bool updateGeometry(
false);
216 updateGeometry =
true;
221 if ( updateField || updateGeometry || !mtsTransform_ ) {
222 delete mtsTransform_;
232 mtsMode()->positionFromModeCartesian(posTSOS,extrapolatedPos);
233 return extrapolatedPos;
241 mtsMode()->momentumFromModeCartesian(posTSOS,extrapolatedMom);
242 return extrapolatedMom;
T getParameter(std::string const &) const
unsigned long long cacheIdentifier() const
virtual void produce(edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< reco::ElectronCollection > inputCollectionTag1_
edm::EDGetTokenT< reco::GsfTrackCollection > inputCollectionTag2_
TrackExtrapolator trackExtrapolator_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
~EgammaHLTGsfTrackVarProducer()
EgammaHLTGsfTrackVarProducer(const edm::ParameterSet &)
int upperTrackNrToRemoveCut_
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandTag_
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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)
int lowerTrackNrToRemoveCut_
const Point & position() const
position