CMS 3D CMS Logo

GenMETProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: METProducers
4 // Class: GenMETProducer
5 //
6 //
7 
8 //____________________________________________________________________________||
10 
12 
14 
16 
20 
22 
23 #include <cstring>
24 
25 //____________________________________________________________________________||
26 namespace cms
27 {
28 
29 //____________________________________________________________________________||
31  : inputToken_(consumes<edm::View<reco::Candidate> >(iConfig.getParameter<edm::InputTag>("src")))
32  , globalThreshold_(iConfig.getParameter<double>("globalThreshold"))
33  , onlyFiducial_(iConfig.getParameter<bool>("onlyFiducialParticles"))
34  , applyFiducialThresholdForFractions_(iConfig.getParameter<bool>("applyFiducialThresholdForFractions"))
35  , usePt_(iConfig.getParameter<bool>("usePt"))
36  {
37  std::string alias = iConfig.exists("alias") ? iConfig.getParameter<std::string>("alias") : "";
38  produces<reco::GenMETCollection>().setBranchAlias(alias);
39  }
40 
41 
42 //____________________________________________________________________________||
44  {
46  event.getByToken(inputToken_, input);
47 
48  CommonMETData commonMETdata;
49 
51  auto genmetcoll = std::make_unique<reco::GenMETCollection>();
52  genmetcoll->push_back(gen.addInfo(input, &commonMETdata, globalThreshold_, onlyFiducial_, applyFiducialThresholdForFractions_, usePt_));
53  event.put(std::move(genmetcoll));
54  }
55 
56 //____________________________________________________________________________||
58 }
59 
60 //____________________________________________________________________________||
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_
reco::GenMET addInfo(edm::Handle< edm::View< reco::Candidate > > particles, CommonMETData *met, double globalThreshold=0, bool onlyFiducial=false, bool applyFiducialThresholdForFractions=false, bool usePt=false)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
GenMETProducer(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:45
bool applyFiducialThresholdForFractions_
Structure containing data common to all types of MET.
Definition: CommonMETData.h:12
def gen(fragment, howMuch)
Production test section ####.
Namespace of DDCMS conversion namespace.
fixed size matrix
HLT enums.
void produce(edm::Event &, const edm::EventSetup &) override
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1