CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

PFchsMETcorrInputProducer Class Reference

#include <PFchsMETcorrInputProducer.h>

Inheritance diagram for PFchsMETcorrInputProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 PFchsMETcorrInputProducer (const edm::ParameterSet &)
 ~PFchsMETcorrInputProducer ()

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &)

Private Attributes

unsigned goodVtxNdof_
double goodVtxZ_
std::string moduleLabel_
edm::InputTag src_

Detailed Description

Sum PF Charged Particles Originating from the primary vertices which are not primary vertex of the high-pT events needed as input for Type 0 MET corrections

Authors:
Anne-Maria Visuri, Mikko Voutilainen Tai Sakuma
Version:
Revision:
1.1
Id:
PFchsMETcorrInputProducer.h,v 1.1 2011/12/09 00:05:49 sakuma Exp

Definition at line 32 of file PFchsMETcorrInputProducer.h.


Constructor & Destructor Documentation

PFchsMETcorrInputProducer::PFchsMETcorrInputProducer ( const edm::ParameterSet cfg) [explicit]

Definition at line 7 of file PFchsMETcorrInputProducer.cc.

  : moduleLabel_(cfg.getParameter<std::string>("@module_label")),
    src_(cfg.getParameter<edm::InputTag>("src")),
    goodVtxNdof_(cfg.getParameter<unsigned int>("goodVtxNdof")),
    goodVtxZ_(cfg.getParameter<double>("goodVtxZ"))
{
  produces<CorrMETData>("type0");
}
PFchsMETcorrInputProducer::~PFchsMETcorrInputProducer ( )

Definition at line 16 of file PFchsMETcorrInputProducer.cc.

{

}

Member Function Documentation

void PFchsMETcorrInputProducer::produce ( edm::Event evt,
const edm::EventSetup es 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 21 of file PFchsMETcorrInputProducer.cc.

References edm::Event::getByLabel(), goodVtxNdof_, goodVtxZ_, i, reco::Vertex::isFake(), reco::Vertex::ndof(), edm::Event::put(), src_, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), findQualityFiles::v, and reco::Vertex::z().

{
  edm::Handle<reco::VertexCollection> recVtxs;
  evt.getByLabel(src_, recVtxs);

  std::auto_ptr<CorrMETData> chsSum(new CorrMETData());

  for (unsigned i = 1; i < recVtxs->size(); ++i)
    {
      const reco::Vertex& v = recVtxs->at(i);
      if (v.isFake()) continue;
      if (v.ndof() < goodVtxNdof_) continue;
      if (fabs(v.z()) > goodVtxZ_) continue;

      for (reco::Vertex::trackRef_iterator track = v.tracks_begin(); track != v.tracks_end(); ++track)
        {
          if ((*track)->charge() != 0) 
            {
              chsSum->mex += (*track)->px();
              chsSum->mey += (*track)->py();
              chsSum->sumet += (*track)->pt();
            }
        }
    }

  evt.put(chsSum, "type0");
}

Member Data Documentation

Definition at line 47 of file PFchsMETcorrInputProducer.h.

Referenced by produce().

Definition at line 48 of file PFchsMETcorrInputProducer.h.

Referenced by produce().

Definition at line 43 of file PFchsMETcorrInputProducer.h.

Definition at line 45 of file PFchsMETcorrInputProducer.h.

Referenced by produce().