Definition at line 136 of file DistortedPFCandProducer.cc.
References reco::PFCandidate::clone(), DEFINE_FWK_MODULE, efficiencyRatioOverMC_, reco::LeafCandidate::eta(), muonRecoAnalyzer_cfi::etaBin, etaBinEdges_, genMatchMapToken_, edm::Event::getByToken(), mps_fire::i, reco::Muon::isGlobalMuon(), edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::isNull(), edm::EventBase::isRealData(), reco::Muon::isStandAloneMuon(), reco::Muon::isTrackerMuon(), dqmiolumiharvest::j, edm::RefToBase< T >::key(), edm::Ref< C, T, F >::key(), LogTrace, reco::LeafCandidate::mass(), eostools::move(), amptDefaultParameters_cff::mu, reco::PFCandidate::mu, pdwgLeptonRecoSkim_cfi::muonCollection, reco::PFCandidate::muonRef(), muonToken_, LaserClient_cfi::nbins, MuonAlignmentFromReference_cff::newmuons, reco::PFCandidate::particleId(), packedPFCandidateRefMixer_cfi::pf, pfToken_, reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), edm::Event::put(), relativeShiftOnPt_, relativeUncertaintyOnPt_, reco::LeafCandidate::setP4(), shiftOnOneOverPt_, reco::Muon::track(), and uncertaintyOnOneOverPt_.
Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().
143 edm::LogError(
"") <<
">>> Muon collection does not exist !!!";
149 edm::LogError(
"") <<
">>> Muon-GenParticle match map does not exist !!!";
156 edm::LogError(
"") <<
">>> PFCandidate collection does not exist !!!";
160 unsigned int muonCollectionSize = muonCollection->size();
161 unsigned int pfCollectionSize = pfCollection->size();
163 if (pfCollectionSize < 1)
167 bool pfMuonFound =
false;
172 for (
unsigned int j = 0;
j < pfCollectionSize;
j++) {
176 double ptmu = pf->
pt();
178 for (
unsigned int i = 0;
i < muonCollectionSize;
i++) {
185 if (muref.
key() == mu.
key()) {
207 double ptgen = pf->
pt();
208 double etagen = pf->
eta();
214 LogTrace(
"") <<
">>> Muon-GenParticle match found; ptmu= " << pf->
pt() <<
", ptgen= " << ptgen;
216 LogTrace(
"") <<
">>> MUON-GENPARTICLE MATCH NOT FOUND!!!";
220 double effRatio = 0.;
230 for (
unsigned int j = 1;
j <=
nbins; ++
j) {
237 if (etaBin < nbins) {
238 LogTrace(
"") <<
">>> etaBin: " << etaBin <<
", for etagen =" << etagen;
241 LogTrace(
"") <<
">>> Muon outside eta range: reject it; etagen = " << etagen;
252 LogTrace(
"") <<
"\tshiftOnOneOverPt= " << shift1 * 100 <<
" [%]";
253 LogTrace(
"") <<
"\trelativeShiftOnPt= " << shift2 * 100 <<
" [%]";
258 LogTrace(
"") <<
"\tuncertaintyOnOneOverPt= " << sigma1 <<
" [1/GeV]";
259 LogTrace(
"") <<
"\trelativeUncertaintyOnPt= " << sigma2 * 100 <<
" [%]";
263 LogTrace(
"") <<
"\tefficiencyRatioOverMC= " << effRatio;
266 double rndf = CLHEP::RandFlat::shoot();
271 double rndg1 = CLHEP::RandGauss::shoot();
272 double rndg2 = CLHEP::RandGauss::shoot();
276 ptmu += ptgen * (shift1 * ptgen + shift2 + sigma1 * rndg1 * ptgen + sigma2 * rndg2);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
TrackRef track() const override
reference to a Track
bool isNonnull() const
Checks for non-null.
double eta() const final
momentum pseudorapidity
bool isStandAloneMuon() const override
std::vector< double > relativeUncertaintyOnPt_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< edm::View< reco::PFCandidate > > pfToken_
double pt() const final
transverse momentum
key_type key() const
Accessor for product key.
bool isTrackerMuon() const override
edm::EDGetTokenT< reco::GenParticleMatch > genMatchMapToken_
bool isGlobalMuon() const override
std::vector< double > uncertaintyOnOneOverPt_
bool isNull() const
Checks for null.
reco::MuonRef muonRef() const
PFCandidate * clone() const override
return a clone
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
std::vector< double > efficiencyRatioOverMC_
Particle reconstructed by the particle flow algorithm.
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
virtual ParticleType particleId() const
std::vector< double > relativeShiftOnPt_
std::vector< double > shiftOnOneOverPt_
double phi() const final
momentum azimuthal angle
void setP4(const LorentzVector &p4) final
set 4-momentum
std::vector< double > etaBinEdges_
double mass() const final
mass