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 
33 //____________________________________________________________________________||
35  : inputToken_(consumes<edm::View<reco::Candidate> >(iConfig.getParameter<edm::InputTag>("src")))
36  , globalThreshold_(iConfig.getParameter<double>("globalThreshold"))
37  {
38  std::string alias = iConfig.exists("alias") ? iConfig.getParameter<std::string>("alias") : "";
39 
40  produces<reco::METCollection>().setBranchAlias(alias);
41  }
42 
43 
44 //____________________________________________________________________________||
46  {
48  event.getByToken(inputToken_, input);
49 
50  METAlgo algo;
51  CommonMETData commonMETdata = algo.run(*input.product(), globalThreshold_);
52 
53  math::XYZTLorentzVector p4(commonMETdata.mex, commonMETdata.mey, 0.0, commonMETdata.met);
54  math::XYZPoint vtx(0,0,0);
55  reco::MET met(commonMETdata.sumet, p4, vtx);
56  auto metcoll = std::make_unique<reco::METCollection>();
57  metcoll->push_back(met);
58  event.put(std::move(metcoll));
59  }
60 
61 //____________________________________________________________________________||
63 }
64 
65 //____________________________________________________________________________||
T getParameter(std::string const &) const
ElseMETProducer(const edm::ParameterSet &)
bool exists(std::string const &parameterName) const
checks if a parameter exists
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
static std::string const input
Definition: EdmProvDump.cc:48
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
CommonMETData run(const edm::View< reco::Candidate > &candidates, double globalThreshold=0.0)
Definition: METAlgo.cc:16
Definition: MET.h:42
double p4[4]
Definition: TauolaWrapper.h:92
void produce(edm::Event &, const edm::EventSetup &) override
Structure containing data common to all types of MET.
Definition: CommonMETData.h:12
Namespace of DDCMS conversion namespace.
T const * product() const
Definition: Handle.h:74
met
===> hadronic RAZOR
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