53 produces < reco::ElectronIsolationMap >(
"Deta" ).setBranchAlias(
"deta" );
54 produces < reco::ElectronIsolationMap >(
"Dphi" ).setBranchAlias(
"dphi" );
85 for(reco::ElectronCollection::const_iterator iElectron = electronHandle->begin(); iElectron != electronHandle->end(); iElectron++){
91 math::XYZPoint SCcorrPosition(theClus->x()-BSPosition.x(), theClus->y()-BSPosition.y() , theClus->z()-eleref->track()->vz() );
92 float deltaeta = fabs(SCcorrPosition.eta()-eleref->track()->eta());
98 const math::XYZPoint vertex(BSPosition.x(),BSPosition.y(),eleref->track()->vz());
100 float phi1= posCalc.
ecalPhi(theMagField.
product(),trackMom,vertex,1);
101 float phi2= posCalc.
ecalPhi(theMagField.
product(),trackMom,vertex,-1);
103 float deltaphi1=fabs( phi1 - theClus->position().phi() );
104 if(deltaphi1>6.283185308) deltaphi1 -= 6.283185308;
105 if(deltaphi1>3.141592654) deltaphi1 = 6.283185308-deltaphi1;
107 float deltaphi2=fabs( phi2 - theClus->position().phi() );
108 if(deltaphi2>6.283185308) deltaphi2 -= 6.283185308;
109 if(deltaphi2>3.141592654) deltaphi2 = 6.283185308-deltaphi2;
111 deltaphi = deltaphi1;
112 if(deltaphi2<deltaphi1){ deltaphi = deltaphi2;}
116 deltaphi=fabs(eleref->track()->outerPosition().phi()-theClus->phi());
117 if(deltaphi>6.283185308) deltaphi -= 6.283185308;
118 if(deltaphi>3.141592654) deltaphi = 6.283185308-deltaphi;
122 detaMap.
insert(eleref, deltaeta);
123 dphiMap.
insert(eleref, deltaphi);
129 iEvent.
put(detMap,
"Deta" );
130 iEvent.
put(dphMap,
"Dphi" );
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag electronProducer_
edm::InputTag BSProducer_
math::XYZPoint Point
point in the space
~EgammaHLTElectronDetaDphiProducer()
double ecalPhi(const MagneticField *magField, const math::XYZVector &momentum, const math::XYZPoint &vertex, const int charge)
virtual void produce(edm::Event &, const edm::EventSetup &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
EgammaHLTElectronDetaDphiProducer(const edm::ParameterSet &)
void insert(const key_type &k, const data_type &v)
insert an association
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
bool useTrackProjectionToEcal_