CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <string.h>
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  std::auto_ptr<reco::METCollection> metcoll;
57  metcoll.reset(new reco::METCollection);
58  metcoll->push_back(met);
59  event.put(metcoll);
60  }
61 
62 //____________________________________________________________________________||
64 }
65 
66 //____________________________________________________________________________||
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
ElseMETProducer(const edm::ParameterSet &)
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::vector< reco::MET > METCollection
collection of MET objects
Definition: METCollection.h:23
static std::string const input
Definition: EdmProvDump.cc:44
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
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
virtual void produce(edm::Event &, const edm::EventSetup &) override
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
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")