test
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  , resolutions_(0)
38  , globalThreshold_(iConfig.getParameter<double>("globalThreshold"))
39  {
40  noHF_ = iConfig.getParameter<bool>("noHF");
41 
42  std::string alias = iConfig.exists("alias") ? iConfig.getParameter<std::string>("alias") : "";
43 
44  produces<reco::CaloMETCollection>().setBranchAlias(alias);
45 
47  }
48 
49 //____________________________________________________________________________||
51  {
52  if (resolutions_) delete resolutions_;
53  }
54 
55 //____________________________________________________________________________||
57  {
59  event.getByToken(inputToken_, input);
60 
61  METAlgo algo;
62  CommonMETData commonMETdata = algo.run(*input.product(), globalThreshold_);
63 
64  CaloSpecificAlgo calospecalgo;
65  reco::CaloMET calomet = calospecalgo.addInfo(input, commonMETdata, noHF_, globalThreshold_);
66 
67  /*
68  if( calculateSignificance_ )
69  {
70  SignCaloSpecificAlgo signcalospecalgo;
71  signcalospecalgo.calculateBaseCaloMET(input, commonMETdata, *resolutions_, noHF_, globalThreshold_);
72  calomet.SetMetSignificance(signcalospecalgo.getSignificance());
73  calomet.setSignificanceMatrix(signcalospecalgo.getSignificanceMatrix());
74  }
75 */
76  auto calometcoll = std::make_unique<reco::CaloMETCollection>();
77  calometcoll->push_back(calomet);
78  event.put(std::move(calometcoll));
79  }
80 
81 //____________________________________________________________________________||
83 }
84 
85 //____________________________________________________________________________||
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
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
def move
Definition: eostools.py:510
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
CaloMETProducer(const edm::ParameterSet &)
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_
T const * product() const
Definition: Handle.h:81
reco::CaloMET addInfo(edm::Handle< edm::View< reco::Candidate > > towers, const CommonMETData &met, bool noHF, double globalThreshold)
virtual void produce(edm::Event &, const edm::EventSetup &) override
metsig::SignAlgoResolutions * resolutions_