CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
PFchsMETcorrInputProducer Class Reference

#include <PFchsMETcorrInputProducer.h>

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

Public Member Functions

 PFchsMETcorrInputProducer (const edm::ParameterSet &)
 
 ~PFchsMETcorrInputProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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.

8  : moduleLabel_(cfg.getParameter<std::string>("@module_label")),
9  src_(cfg.getParameter<edm::InputTag>("src")),
10  goodVtxNdof_(cfg.getParameter<unsigned int>("goodVtxNdof")),
11  goodVtxZ_(cfg.getParameter<double>("goodVtxZ"))
12 {
13  produces<CorrMETData>("type0");
14 }
T getParameter(std::string const &) const
PFchsMETcorrInputProducer::~PFchsMETcorrInputProducer ( )

Definition at line 16 of file PFchsMETcorrInputProducer.cc.

17 {
18 
19 }

Member Function Documentation

void PFchsMETcorrInputProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
privatevirtual

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(), v, and reco::Vertex::z().

22 {
24  evt.getByLabel(src_, recVtxs);
25 
26  std::auto_ptr<CorrMETData> chsSum(new CorrMETData());
27 
28  for (unsigned i = 1; i < recVtxs->size(); ++i)
29  {
30  const reco::Vertex& v = recVtxs->at(i);
31  if (v.isFake()) continue;
32  if (v.ndof() < goodVtxNdof_) continue;
33  if (fabs(v.z()) > goodVtxZ_) continue;
34 
35  for (reco::Vertex::trackRef_iterator track = v.tracks_begin(); track != v.tracks_end(); ++track)
36  {
37  if ((*track)->charge() != 0)
38  {
39  chsSum->mex += (*track)->px();
40  chsSum->mey += (*track)->py();
41  chsSum->sumet += (*track)->pt();
42  }
43  }
44  }
45 
46  evt.put(chsSum, "type0");
47 }
int i
Definition: DBlmapReader.cc:9
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:45
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
double z() const
y coordinate
Definition: Vertex.h:99
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
double ndof() const
Definition: Vertex.h:89
bool isFake() const
Definition: Vertex.h:65
a MET correction term
Definition: CorrMETData.h:14
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:38
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:40
mathSSE::Vec4< T > v

Member Data Documentation

unsigned PFchsMETcorrInputProducer::goodVtxNdof_
private

Definition at line 47 of file PFchsMETcorrInputProducer.h.

Referenced by produce().

double PFchsMETcorrInputProducer::goodVtxZ_
private

Definition at line 48 of file PFchsMETcorrInputProducer.h.

Referenced by produce().

std::string PFchsMETcorrInputProducer::moduleLabel_
private
edm::InputTag PFchsMETcorrInputProducer::src_
private

Definition at line 45 of file PFchsMETcorrInputProducer.h.

Referenced by produce().