test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <string.h>
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  std::auto_ptr<reco::GenMETCollection> genmetcoll;
52  genmetcoll.reset(new reco::GenMETCollection);
53  genmetcoll->push_back(gen.addInfo(input, &commonMETdata, globalThreshold_, onlyFiducial_, applyFiducialThresholdForFractions_, usePt_));
54  event.put(genmetcoll);
55  }
56 
57 //____________________________________________________________________________||
59 }
60 
61 //____________________________________________________________________________||
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)
std::vector< reco::GenMET > GenMETCollection
collection of GenMET objects
#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
static std::string const input
Definition: EdmProvDump.cc:44
def gen
run2 Cosmic #### Run 256259 @ 0T 2015C### Run 272133 @ 3.8T 2016B###
bool applyFiducialThresholdForFractions_
Structure containing data common to all types of MET.
Definition: CommonMETData.h:12
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual void produce(edm::Event &, const edm::EventSetup &) override