Public Member Functions | |
DistortedMETProducer (const edm::ParameterSet &) | |
~DistortedMETProducer () | |
Private Member Functions | |
virtual void | beginJob () |
virtual void | endJob () |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
double | metScaleShift_ |
edm::InputTag | metTag_ |
Definition at line 10 of file DistortedMETProducer.cc.
DistortedMETProducer::DistortedMETProducer | ( | const edm::ParameterSet & | pset | ) | [explicit] |
Definition at line 31 of file DistortedMETProducer.cc.
References edm::ParameterSet::getUntrackedParameter(), metScaleShift_, and metTag_.
{ // What is being produced produces<std::vector<reco::MET> >(); // Input products metTag_ = pset.getUntrackedParameter<edm::InputTag> ("MetTag", edm::InputTag("met")); // Distortions in MET in Gev**{-1/2} metScaleShift_ = pset.getUntrackedParameter<double> ("MetScaleShift",1.e-3); }
DistortedMETProducer::~DistortedMETProducer | ( | ) |
Definition at line 44 of file DistortedMETProducer.cc.
{ }
void DistortedMETProducer::beginJob | ( | void | ) | [private, virtual] |
void DistortedMETProducer::endJob | ( | void | ) | [private, virtual] |
void DistortedMETProducer::produce | ( | edm::Event & | ev, |
const edm::EventSetup & | |||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 55 of file DistortedMETProducer.cc.
References funct::cos(), edm::Event::getByLabel(), edm::EventBase::isRealData(), CaloMET_cfi::met, metScaleShift_, metTag_, edm::Event::put(), and funct::sin().
{ if (ev.isRealData()) return; // MET collection edm::Handle<edm::View<reco::MET> > metCollection; if (!ev.getByLabel(metTag_, metCollection)) { edm::LogError("") << ">>> MET collection does not exist !!!"; return; } edm::RefToBase<reco::MET> met = metCollection->refAt(0); std::auto_ptr<reco::METCollection> newmetCollection (new reco::METCollection); double met_et = met->et() * (1. + metScaleShift_); double sum_et = met->sumEt() * (1. + metScaleShift_); double met_phi = met->phi(); double met_ex = met_et*cos(met_phi); double met_ey = met_et*sin(met_phi); reco::Particle::LorentzVector met_p4(met_ex, met_ey, 0., met_et); reco::Particle::Point met_vtx(0.,0.,0.); reco::MET* newmet = new reco::MET(sum_et, met_p4, met_vtx); newmetCollection->push_back(*newmet); ev.put(newmetCollection); }
double DistortedMETProducer::metScaleShift_ [private] |
Definition at line 21 of file DistortedMETProducer.cc.
Referenced by DistortedMETProducer(), and produce().
edm::InputTag DistortedMETProducer::metTag_ [private] |
Definition at line 20 of file DistortedMETProducer.cc.
Referenced by DistortedMETProducer(), and produce().