test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFMETProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: METProducers
4 // Class: PFMETProducer
5 //
6 //
7 
8 //____________________________________________________________________________||
10 
13 
19 
24 
25 #include <string.h>
26 
27 //____________________________________________________________________________||
28 namespace cms
29 {
30 
31 //____________________________________________________________________________||
33  : inputToken_(consumes<edm::View<reco::Candidate> >(iConfig.getParameter<edm::InputTag>("src")))
34  , calculateSignificance_(iConfig.getParameter<bool>("calculateSignificance"))
35  , resolutions_(0)
36  , globalThreshold_(iConfig.getParameter<double>("globalThreshold"))
37  {
39  {
40  jetToken_ = consumes<edm::View<reco::PFJet> >(iConfig.getParameter<edm::InputTag>("jets"));
42  }
43 
44  std::string alias(iConfig.getParameter<std::string>("alias"));
45  produces<reco::PFMETCollection>().setBranchAlias(alias.c_str());
46  }
47 
48 
49 //____________________________________________________________________________||
51  {
53  event.getByToken(inputToken_, input);
54 
55  METAlgo algo;
56  CommonMETData commonMETdata = algo.run(*input.product(), globalThreshold_);
57 
58  const math::XYZTLorentzVector p4(commonMETdata.mex, commonMETdata.mey, 0.0, commonMETdata.met);
59  const math::XYZPoint vtx(0.0, 0.0, 0.0);
60 
61  PFSpecificAlgo pf;
62  SpecificPFMETData specific = pf.run(*input.product());
63 
64  reco::PFMET pfmet(specific, commonMETdata.sumet, p4, vtx);
65 
67  {
68  metsig::SignPFSpecificAlgo pfsignalgo;
69  pfsignalgo.setResolutions(resolutions_);
70 
72  event.getByToken(jetToken_, jets);
73  pfsignalgo.addPFJets(jets.product());
74  pfmet.setSignificanceMatrix(pfsignalgo.mkSignifMatrix(input));
75  }
76 
77  std::auto_ptr<reco::PFMETCollection> pfmetcoll;
78  pfmetcoll.reset(new reco::PFMETCollection);
79 
80  pfmetcoll->push_back(pfmet);
81  event.put(pfmetcoll);
82  }
83 
84 //____________________________________________________________________________||
86 }
87 
88 //____________________________________________________________________________||
T getParameter(std::string const &) const
dictionary specific
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
PFMETProducer(const edm::ParameterSet &)
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
void addPFJets(const edm::View< reco::PFJet > *PFJets)
void setResolutions(metsig::SignAlgoResolutions *resolutions)
double p4[4]
Definition: TauolaWrapper.h:92
vector< PseudoJet > jets
virtual void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< edm::View< reco::PFJet > > jetToken_
Definition: PFMETProducer.h:58
Structure containing data common to all types of MET.
Definition: CommonMETData.h:12
void setSignificanceMatrix(const TMatrixD &matrix)
Definition: MET.cc:155
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
MET made from Particle Flow Candidates.
metsig::SignAlgoResolutions * resolutions_
Definition: PFMETProducer.h:54
SpecificPFMETData run(const edm::View< reco::Candidate > &pfCands)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
T const * product() const
Definition: Handle.h:81
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_
Definition: PFMETProducer.h:51
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
TMatrixD mkSignifMatrix(edm::Handle< edm::View< reco::Candidate > > &PFCandidates)