4 #include <boost/regex.hpp>
45 theConf(iConf), theTrackAssociator(0), theElecNN(0)
60 theTrackAssociator->useDefaultPropagator();
69 produces<reco::ElectronCollection>();
90 reco::TrackCollection::const_iterator itTrack;
93 reco::BasicClusterCollection::const_iterator itCluster;
104 double hcalEnergy, clusEnergy, trkP;
106 double covEtaEta, covEtaPhi, covPhiPhi, emFraction, deltaE;
107 double eMax, e2x2, e3x3, e5x5, v1, v2, v3, v4;
108 double value, dist, distMin;
139 unsigned int counterTrack;
142 for(itTrack = handleTrack->begin(), counterTrack = 0;
143 itTrack != handleTrack->end();
144 ++itTrack, ++counterTrack)
153 std::cerr <<
"Caught exception during track extrapolation: " << e.
what() <<
". Skipping track" << endl;
172 for(itCluster = handleCluster->begin(); itCluster != handleCluster->end();++itCluster)
174 x[1] = itCluster->x();
175 y[1] = itCluster->y();
176 z[1] = itCluster->z();
178 eta[1] = itCluster->eta();
179 phi[1] = itCluster->phi();
182 dist = hypot(x[0] - x[1], y[0] - y[1]);
183 dist = hypot(dist, z[0] - z[1]);
188 matchedCluster = &(*itCluster);
193 if(matchedCluster && distMin < 10.0)
196 auto_ptr<CaloRecHitMetaCollectionV> chosen = selectorRecHit.select(
position, metaRecHit);
198 for(itRecHit = chosen->begin(); itRecHit != chosen->end(); ++itRecHit)
200 hcalEnergy += itRecHit->
energy();
203 clusEnergy = matchedCluster->energy();
206 deltaE = (clusEnergy - trkP)/(clusEnergy + trkP);
207 emFraction = clusEnergy/(clusEnergy + hcalEnergy);
209 eMax = ecalTool.
eMax(*matchedCluster);
210 e2x2 = ecalTool.
e2x2(*matchedCluster);
211 e3x3 = ecalTool.
e3x3(*matchedCluster);
212 e5x5 = ecalTool.
e5x5(*matchedCluster);
216 v4 = ((e5x5 -
eMax) < 0.001) ? 1.0 : (e3x3 -
eMax)/(e5x5 - eMax);
217 std::vector<float> cov = ecalTool.
covariances(*matchedCluster);
223 v1, v2, v3, v4, emFraction, deltaE);
231 candidates->push_back(newCandidate);
238 iEvent.
put(candidates);
edm::InputTag theTrackTag
virtual char const * what() const
double p() const
momentum vector magnitude
T getParameter(std::string const &) const
TrackDetectorAssociator * theTrackAssociator
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
double theDiscriminatorCut
static int position[TOTALCHAMBERS][3]
edm::InputTag barrelRecHitCollection_
double eta() const
pseudorapidity of momentum vector
SoftElectronProducer(const edm::ParameterSet &iConf)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
double pt() const
track transverse momentum
math::XYZPoint Point
point in the space
unsigned short numberOfValidHits() const
number of valid hits found
tuple TrackAssociatorParameters
std::vector< Electron > ElectronCollection
collectin of Electron objects
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag endcapRecHitCollection_
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
double value(int index, double in0, double in1, double in2, double in3, double in4, double in5, double in6, double in7, double in8)
T const * product() const
edm::InputTag theBasicClusterTag
edm::InputTag theHBHERecHitTag
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
TrackAssociatorParameters * theTrackAssociatorParameters
void setTrack(const reco::TrackRef &r)
set refrence to Track component
edm::ParameterSet theConf
ElectronIdMLP * theElecNN
math::XYZTLorentzVector LorentzVector
Lorentz vector.