CMS 3D CMS Logo

ElseMETProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: METProducers
4 // Class: ElseMETProducer
5 //
6 //
7 
8 //____________________________________________________________________________||
10 
15 
17 
24 
26 
27 #include <cstring>
28 
29 //____________________________________________________________________________||
30 namespace cms {
31 
32  //____________________________________________________________________________||
34  : inputToken_(consumes<edm::View<reco::Candidate> >(iConfig.getParameter<edm::InputTag>("src"))),
35  globalThreshold_(iConfig.getParameter<double>("globalThreshold")) {
36  std::string alias = iConfig.exists("alias") ? iConfig.getParameter<std::string>("alias") : "";
37 
38  produces<reco::METCollection>().setBranchAlias(alias);
39  }
40 
41  //____________________________________________________________________________||
44  event.getByToken(inputToken_, input);
45 
46  METAlgo algo;
47  CommonMETData commonMETdata = algo.run(*input.product(), globalThreshold_);
48 
49  math::XYZTLorentzVector p4(commonMETdata.mex, commonMETdata.mey, 0.0, commonMETdata.met);
50  math::XYZPoint vtx(0, 0, 0);
51  reco::MET met(commonMETdata.sumet, p4, vtx);
52  auto metcoll = std::make_unique<reco::METCollection>();
53  metcoll->push_back(met);
54  event.put(std::move(metcoll));
55  }
56 
57  //____________________________________________________________________________||
59 } // namespace cms
60 
61 //____________________________________________________________________________||
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
ElseMETProducer(const edm::ParameterSet &)
bool exists(std::string const &parameterName) const
checks if a parameter exists
static std::string const input
Definition: EdmProvDump.cc:50
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
Definition: MET.h:41
void produce(edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Structure containing data common to all types of MET.
Definition: CommonMETData.h:12
Namespace of DDCMS conversion namespace.
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
fixed size matrix
HLT enums.
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1