CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFClusterMETProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: METProducers
4 // Class: PFClusterMETProducer
5 //
6 //
7 
8 //____________________________________________________________________________||
10 
13 
15 
20 
22 
25 
26 #include <string.h>
27 
28 //____________________________________________________________________________||
29 namespace cms
30 {
31 
32 //____________________________________________________________________________||
34  : inputToken_(consumes<edm::View<reco::Candidate> >(iConfig.getParameter<edm::InputTag>("src")))
35  , globalThreshold_(iConfig.getParameter<double>("globalThreshold"))
36  {
37  std::string alias = iConfig.exists("alias") ? iConfig.getParameter<std::string>("alias") : "";
38  produces<reco::PFClusterMETCollection>().setBranchAlias(alias);
39  }
40 
41 
42 //____________________________________________________________________________||
44  {
46  event.getByToken(inputToken_, input);
47 
48  METAlgo algo;
49  CommonMETData commonMETdata = algo.run(*input.product(), globalThreshold_);
50 
51  PFClusterSpecificAlgo pfcluster;
52  std::auto_ptr<reco::PFClusterMETCollection> pfclustermetcoll;
53  pfclustermetcoll.reset (new reco::PFClusterMETCollection);
54 
55  pfclustermetcoll->push_back(pfcluster.addInfo(input, commonMETdata));
56  event.put(pfclustermetcoll);
57  }
58 
59 //____________________________________________________________________________||
61 }
62 
63 //____________________________________________________________________________||
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
bool exists(std::string const &parameterName) const
checks if a parameter exists
PFClusterMETProducer(const edm::ParameterSet &)
virtual void produce(edm::Event &, const edm::EventSetup &) override
reco::PFClusterMET addInfo(edm::Handle< edm::View< reco::Candidate > > PFClusterCandidates, const CommonMETData &met)
static std::string const input
Definition: EdmProvDump.cc:43
std::vector< reco::PFClusterMET > PFClusterMETCollection
collection of PFClusterMET objects
CommonMETData run(const edm::View< reco::Candidate > &candidates, double globalThreshold=0.0)
Definition: METAlgo.cc:16
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
T const * product() const
Definition: Handle.h:81
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_