CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloMETProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: METProducers
4 // Class: CaloMETProducer
5 //
6 //
7 
8 //____________________________________________________________________________||
10 
12 
14 
16 
21 
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  , calculateSignificance_(iConfig.getParameter<bool>("calculateSignificance"))
37  , globalThreshold_(iConfig.getParameter<double>("globalThreshold"))
38  {
39  noHF_ = iConfig.getParameter<bool>("noHF");
40 
41  std::string alias(iConfig.getParameter<std::string>("alias"));
42  produces<reco::CaloMETCollection>().setBranchAlias(alias.c_str());
43 
45  }
46 
47 //____________________________________________________________________________||
49  {
51  event.getByToken(inputToken_, input);
52 
53  METAlgo algo;
54  CommonMETData commonMETdata = algo.run(*input.product(), globalThreshold_);
55 
56  CaloSpecificAlgo calospecalgo;
57  reco::CaloMET calomet = calospecalgo.addInfo(input, commonMETdata, noHF_, globalThreshold_);
58 
60  {
61  SignCaloSpecificAlgo signcalospecalgo;
62  signcalospecalgo.calculateBaseCaloMET(input, commonMETdata, *resolutions_, noHF_, globalThreshold_);
63  calomet.SetMetSignificance(signcalospecalgo.getSignificance());
64  calomet.setSignificanceMatrix(signcalospecalgo.getSignificanceMatrix());
65  }
66 
67  std::auto_ptr<reco::CaloMETCollection> calometcoll;
68  calometcoll.reset(new reco::CaloMETCollection);
69  calometcoll->push_back(calomet);
70  event.put(calometcoll);
71  }
72 
73 //____________________________________________________________________________||
75 }
76 
77 //____________________________________________________________________________||
T getParameter(std::string const &) const
static std::string const input
Definition: EdmProvDump.cc:44
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
void setSignificanceMatrix(const TMatrixD &matrix)
Definition: MET.cc:185
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
DEFINE_FWK_MODULE(CaloMETProducer)
CaloMETProducer(const edm::ParameterSet &)
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_
TMatrixD getSignificanceMatrix() const
reco::CaloMET addInfo(edm::Handle< edm::View< reco::Candidate > > towers, const CommonMETData &met, bool noHF, double globalThreshold)
void calculateBaseCaloMET(edm::Handle< edm::View< reco::Candidate > > towers, const CommonMETData &met, const metsig::SignAlgoResolutions &resolutions, bool noHF, double globalthreshold)
T const * product() const
Definition: Handle.h:81
virtual void produce(edm::Event &, const edm::EventSetup &) override
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
metsig::SignAlgoResolutions * resolutions_
void SetMetSignificance(double metsig)
Definition: CaloMET.h:76