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 Attributes
cms::Type1MET Class Reference

#include <Type1MET.h>

Inheritance diagram for cms::Type1MET:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &)
 
 Type1MET (const edm::ParameterSet &)
 
 Type1MET ()
 
virtual ~Type1MET ()
 
- 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 Attributes

Type1METAlgo alg_
 
std::string correctorLabel
 
bool hasMuonsCorr
 
std::string inputUncorJetsLabel
 
std::string inputUncorMetLabel
 
edm::InputTag inputUncorUnlusteredLabel
 
double jetEMfracLimit
 
double jetPTthreshold
 
std::string metType
 
std::string refcorrectorLabel
 
bool subtractL1Fast_
 
double UscaleA
 
double UscaleB
 
double UscaleC
 
bool useTypeII
 

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

Definition at line 41 of file Type1MET.h.

Constructor & Destructor Documentation

Type1MET::Type1MET ( const edm::ParameterSet iConfig)
explicit

Definition at line 45 of file Type1MET.cc.

References correctorLabel, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hasMuonsCorr, inputUncorJetsLabel, inputUncorMetLabel, inputUncorUnlusteredLabel, jetEMfracLimit, jetPTthreshold, metType, refcorrectorLabel, subtractL1Fast_, UscaleA, UscaleB, UscaleC, and useTypeII.

45  : alg_()
46  {
47  metType = iConfig.getParameter<std::string>("metType");
48 
49  inputUncorMetLabel = iConfig.getParameter<std::string>("inputUncorMetLabel");
50  inputUncorJetsLabel = iConfig.getParameter<std::string>("inputUncorJetsLabel");
51  edm::InputTag inputUncorUnlusteredLabelDefault("", "");
52  inputUncorUnlusteredLabel = iConfig.getUntrackedParameter<edm::InputTag> ("inputUncorUnlusteredLabel", inputUncorUnlusteredLabelDefault);
53  jetPTthreshold = iConfig.getParameter<double>("jetPTthreshold");
54  jetEMfracLimit = iConfig.getParameter<double>("jetEMfracLimit");
55  UscaleA = iConfig.getParameter<double>("UscaleA");
56  UscaleB = iConfig.getParameter<double>("UscaleB");
57  UscaleC = iConfig.getParameter<double>("UscaleC");
58  useTypeII = iConfig.getParameter<bool>("useTypeII");
59  hasMuonsCorr = iConfig.getParameter<bool>("hasMuonsCorr");
60  correctorLabel = iConfig.getParameter<std::string>("corrector");
61  refcorrectorLabel = iConfig.getParameter<std::string>("refcorrector");
62  subtractL1Fast_ = iConfig.getParameter<bool>("subtractL1Fast");
63  if( metType == "CaloMET" )
64  produces<CaloMETCollection>();
65  else
66  produces<PFMETCollection>();
67  }
std::string refcorrectorLabel
Definition: Type1MET.h:55
std::string correctorLabel
Definition: Type1MET.h:54
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string inputUncorMetLabel
Definition: Type1MET.h:51
double UscaleA
Definition: Type1MET.h:58
double UscaleB
Definition: Type1MET.h:59
Type1METAlgo alg_
Definition: Type1MET.h:49
double UscaleC
Definition: Type1MET.h:60
double jetEMfracLimit
Definition: Type1MET.h:57
bool useTypeII
Definition: Type1MET.h:61
bool hasMuonsCorr
Definition: Type1MET.h:62
std::string metType
Definition: Type1MET.h:50
bool subtractL1Fast_
Definition: Type1MET.h:63
std::string inputUncorJetsLabel
Definition: Type1MET.h:52
edm::InputTag inputUncorUnlusteredLabel
Definition: Type1MET.h:53
double jetPTthreshold
Definition: Type1MET.h:56
Type1MET::Type1MET ( )
explicit

Definition at line 68 of file Type1MET.cc.

68 : alg_() {}
Type1METAlgo alg_
Definition: Type1MET.h:49
Type1MET::~Type1MET ( )
virtual

Definition at line 70 of file Type1MET.cc.

70 {}

Member Function Documentation

void Type1MET::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 73 of file Type1MET.cc.

References alg_, correctorLabel, edm::Event::getByLabel(), JetCorrector::getJetCorrector(), hasMuonsCorr, inputUncorJetsLabel, inputUncorMetLabel, inputUncorUnlusteredLabel, edm::HandleBase::isValid(), jetEMfracLimit, jetPTthreshold, metType, NULL, convertSQLitetoXML_cfg::output, edm::Handle< T >::product(), edm::Event::put(), refcorrectorLabel, Type1METAlgo::run(), subtractL1Fast_, UscaleA, UscaleB, UscaleC, and useTypeII.

74  {
75  using namespace edm;
76 
77  if( metType == "CaloMET")
78  {
79 
80  Handle<View<reco::Muon> > inputMuons;
81  iEvent.getByLabel( "muons", inputMuons );
82  // Remove lable from the code
84  iEvent.getByLabel( "muonMETValueMapProducer","muCorrData", vm_muCorrData_h);
85 
86  Handle<CaloJetCollection> inputUncorJets;
87  iEvent.getByLabel( inputUncorJetsLabel, inputUncorJets );
88  const JetCorrector* corrector = JetCorrector::getJetCorrector (correctorLabel, iSetup);
89  const JetCorrector* corrector2=NULL;
91 
92  Handle<CaloMETCollection> inputUncorMet; //Define Inputs
93  iEvent.getByLabel( inputUncorMetLabel, inputUncorMet ); //Get Inputs
94  std::auto_ptr<CaloMETCollection> output( new CaloMETCollection() ); //Create empty output
95  alg_.run( *(inputUncorMet.product()), *corrector, *corrector2, *(inputUncorJets.product()),
97  *(inputMuons.product()), *(vm_muCorrData_h.product()),
98  &*output, iEvent, iSetup, subtractL1Fast_ ); //Invoke the algorithm
99  iEvent.put( output ); //Put output into Event
100  }
101  else if (metType == "PFMET")
102  {
103  Handle<PFJetCollection> inputUncorJets;
104  iEvent.getByLabel( inputUncorJetsLabel, inputUncorJets );
105  const JetCorrector* corrector = JetCorrector::getJetCorrector (correctorLabel, iSetup);
106  const JetCorrector* corrector2=NULL;
108 
109  Handle < PFCandidateCollection > inputUncorUnlustered;
110  if (useTypeII) {
111  iEvent.getByLabel(inputUncorUnlusteredLabel, inputUncorUnlustered);
112  if (!inputUncorUnlustered.isValid()) {
113  useTypeII = false;
114  }
115  }
116 
117  Handle<PFMETCollection> inputUncorMet; //Define Inputs
118  iEvent.getByLabel( inputUncorMetLabel, inputUncorMet ); //Get Inputs
119  std::auto_ptr<PFMETCollection> output( new PFMETCollection() ); //Create empty output
120  alg_.run( *(inputUncorMet.product()), *corrector, *corrector2, *(inputUncorJets.product()), *(inputUncorUnlustered.product()),
122  &*output, iEvent, iSetup, subtractL1Fast_ ); //Invoke the algorithm
123  iEvent.put( output ); //Put output into Event
124  }
125  }
std::string refcorrectorLabel
Definition: Type1MET.h:55
std::string correctorLabel
Definition: Type1MET.h:54
std::string inputUncorMetLabel
Definition: Type1MET.h:51
#define NULL
Definition: scimark2.h:8
double UscaleA
Definition: Type1MET.h:58
double UscaleB
Definition: Type1MET.h:59
Type1METAlgo alg_
Definition: Type1MET.h:49
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
double UscaleC
Definition: Type1MET.h:60
double jetEMfracLimit
Definition: Type1MET.h:57
bool useTypeII
Definition: Type1MET.h:61
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
bool hasMuonsCorr
Definition: Type1MET.h:62
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
Definition: JetCorrector.cc:51
std::string metType
Definition: Type1MET.h:50
T const * product() const
Definition: Handle.h:74
bool subtractL1Fast_
Definition: Type1MET.h:63
virtual void run(const reco::CaloMETCollection &, const JetCorrector &, const JetCorrector &, const reco::CaloJetCollection &, double, double, double, double, double, bool, bool, const edm::View< reco::Muon > &, const edm::ValueMap< reco::MuonMETCorrectionData > &, reco::CaloMETCollection *, edm::Event &iEvent, const edm::EventSetup &iSetup, const bool subtractL1Fast)
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
std::string inputUncorJetsLabel
Definition: Type1MET.h:52
edm::InputTag inputUncorUnlusteredLabel
Definition: Type1MET.h:53
double jetPTthreshold
Definition: Type1MET.h:56

Member Data Documentation

Type1METAlgo cms::Type1MET::alg_
private

Definition at line 49 of file Type1MET.h.

Referenced by produce().

std::string cms::Type1MET::correctorLabel
private

Definition at line 54 of file Type1MET.h.

Referenced by produce(), and Type1MET().

bool cms::Type1MET::hasMuonsCorr
private

Definition at line 62 of file Type1MET.h.

Referenced by produce(), and Type1MET().

std::string cms::Type1MET::inputUncorJetsLabel
private

Definition at line 52 of file Type1MET.h.

Referenced by produce(), and Type1MET().

std::string cms::Type1MET::inputUncorMetLabel
private

Definition at line 51 of file Type1MET.h.

Referenced by produce(), and Type1MET().

edm::InputTag cms::Type1MET::inputUncorUnlusteredLabel
private

Definition at line 53 of file Type1MET.h.

Referenced by produce(), and Type1MET().

double cms::Type1MET::jetEMfracLimit
private

Definition at line 57 of file Type1MET.h.

Referenced by produce(), and Type1MET().

double cms::Type1MET::jetPTthreshold
private

Definition at line 56 of file Type1MET.h.

Referenced by produce(), and Type1MET().

std::string cms::Type1MET::metType
private

Definition at line 50 of file Type1MET.h.

Referenced by produce(), and Type1MET().

std::string cms::Type1MET::refcorrectorLabel
private

Definition at line 55 of file Type1MET.h.

Referenced by produce(), and Type1MET().

bool cms::Type1MET::subtractL1Fast_
private

Definition at line 63 of file Type1MET.h.

Referenced by produce(), and Type1MET().

double cms::Type1MET::UscaleA
private

Definition at line 58 of file Type1MET.h.

Referenced by produce(), and Type1MET().

double cms::Type1MET::UscaleB
private

Definition at line 59 of file Type1MET.h.

Referenced by produce(), and Type1MET().

double cms::Type1MET::UscaleC
private

Definition at line 60 of file Type1MET.h.

Referenced by produce(), and Type1MET().

bool cms::Type1MET::useTypeII
private

Definition at line 61 of file Type1MET.h.

Referenced by produce(), and Type1MET().